def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
arg_6
=
)
:
if
not
arg_1
:
arg_1
=
elif
arg_1
not
in
affiliations
:
raise
ValueError
(
"Bad affiliation"
)
arg_0
.
affiliation
=
arg_1
if
not
arg_2
:
arg_2
=
elif
arg_2
not
in
roles
:
raise
ValueError
(
"Bad role"
)
arg_0
.
role
=
arg_2
if
arg_3
:
arg_0
.
jid
=
JID
(
arg_3
)
else
:
arg_0
.
jid
=
if
arg_5
:
arg_0
.
actor
=
JID
(
arg_5
)
else
:
arg_0
.
actor
=
arg_0
.
nick
=
arg_4
arg_0
.
reason
=
arg_6

def Func(arg_0,arg_1,arg_2,arg_3=None,arg_4=None,arg_5=None,arg_6=None):
        """Initialize a `MucItem` object from a set of attributes.

        :Parameters:
            - `affiliation`: affiliation of the user.
            - `role`: role of the user.
            - `jid`: JID of the user.
            - `nick`: nickname of the user.
            - `actor`: actor modyfying the user data.
            - `reason`: reason of change of the user data.
        :Types:
            - `affiliation`: `str`
            - `role`: `str`
            - `jid`: `JID`
            - `nick`: `unicode`
            - `actor`: `JID`
            - `reason`: `unicode`
        """
        if not arg_1:
            arg_1=None
        elif arg_1 not in affiliations:
            raise ValueError("Bad affiliation")
        arg_0.affiliation=arg_1
        if not arg_2:
            arg_2=None
        elif arg_2 not in roles:
            raise ValueError("Bad role")
        arg_0.role=arg_2
        if arg_3:
            arg_0.jid=JID(arg_3)
        else:
            arg_0.jid=None
        if arg_5:
            arg_0.actor=JID(arg_5)
        else:
            arg_0.actor=None
        arg_0.nick=arg_4
        arg_0.reason=arg_6

Initialize a MucItem object from a set of attributes .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . _safe_get_element_text ( arg_1 = arg_1 , arg_2 = arg_2 ) if arg_3 is not None : try : arg_3 = datetime . datetime . strptime ( arg_3 , '%Y-%m-%d' ) . date ( ) except ValueError : arg_3 = None return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """Safe get elemnent date.

        Get element as datetime.date or None,
        :param root:
            Lxml element.
        :param path:
            String path (i.e. 'Items.Item.Offers.Offer').
        :return:
            datetime.date or None.
        """
        arg_3 = arg_0._safe_get_element_text(arg_1=arg_1, arg_2=arg_2)
        if arg_3 is not None:
            try:
                arg_3 = datetime.datetime.strptime(arg_3, '%Y-%m-%d').date()
            except ValueError:
                arg_3 = None

        return arg_3


def
Func
(
*
arg_0
)
:
arg_1
=
{
}
for
arg_2
in
arg_0
:
for
arg_3
,
arg_4
in
arg_2
.
iteritems
(
)
:
if
not
type
(
arg_4
)
in
JOINERS
:
raise
KeyError
(
'Invalid type in dict: {}'
.
format
(
type
(
arg_4
)
)
)
JOINERS
[
type
(
arg_4
)
]
(
arg_1
,
arg_3
,
arg_4
)
return
arg_1

def Func(*arg_0):
    '''Join a bunch of dicts'''

    arg_1 = {}

    for arg_2 in arg_0:
        for arg_3, arg_4 in arg_2.iteritems():

            if not type(arg_4) in JOINERS:
                raise KeyError('Invalid type in dict: {}'.format(type(arg_4)))

            JOINERS[type(arg_4)](arg_1, arg_3, arg_4)

    return arg_1


def Func(arg_0):
    '''Construct a uniform transition matrix over `n_states`.

    Parameters
    ----------
    n_states : int > 0
        The number of states

    Returns
    -------
    transition : np.ndarray [shape=(n_states, n_states)]
        `transition[i, j] = 1./n_states`

    Examples
    --------

    >>> librosa.sequence.Func(3)
    array([[0.333, 0.333, 0.333],
           [0.333, 0.333, 0.333],
           [0.333, 0.333, 0.333]])
    '''

    if not isinstance(arg_0, int) or arg_0 <= 0:
        raise ParameterError('n_states={} must be a positive integer')

    arg_1 = np.empty((arg_0, arg_0), dtype=np.float)
    arg_1.fill(1./arg_0)
    return arg_1

Construct a uniform transition matrix over `n_states`.

    Parameters
    ----------
    n_states : int > 0
        The number of states

    Returns
    -------
    transition : np.ndarray [shape=(n_states, n_states)]
        `transition[i, j] = 1./n_states`

    Examples
    --------

    >>> librosa.sequence.transition_uniform(3)
    array([[0.333, 0.333, 0.333],
           [0.333, 0.333, 0.333],
           [0.333, 0.333, 0.333]])

Construct a uniform transition matrix over n_states .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
not
:
if
not
isinstance
(
arg_1
,
six
.
string_types
)
:
raise
TypeError
(
"uid must be a string"
)
arg_2
=
arg_0
.
proxy
.
Func
(
arg_1
)
arg_3
=
arg_2
.
result_status
.
value
if
arg_3
==
enums
.
ResultStatus
.
SUCCESS
:
return
else
:
arg_4
=
arg_2
.
result_reason
.
value
arg_5
=
arg_2
.
result_message
.
value
raise
exceptions
.
KmipOperationFailure
(
arg_3
,
arg_4
,
arg_5
)

def Func(arg_0, arg_1=None):
        """
        Activate a managed object stored by a KMIP appliance.

        Args:
            uid (string): The unique ID of the managed object to Func.
                Optional, defaults to None.

        Returns:
            None

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input argument is invalid
        """
        # Check input
        if arg_1 is not None:
            if not isinstance(arg_1, six.string_types):
                raise TypeError("uid must be a string")

        # Activate the managed object and handle the results
        arg_2 = arg_0.proxy.Func(arg_1)

        arg_3 = arg_2.result_status.value
        if arg_3 == enums.ResultStatus.SUCCESS:
            return
        else:
            arg_4 = arg_2.result_reason.value
            arg_5 = arg_2.result_message.value
            raise exceptions.KmipOperationFailure(arg_3, arg_4, arg_5)

Activate a managed object stored by a KMIP appliance.

        Args:
            uid (string): The unique ID of the managed object to activate.
                Optional, defaults to None.

        Returns:
            None

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input argument is invalid

Activate a managed object stored by a KMIP appliance .


def Func ( arg_0 , * arg_1 ) : if len ( arg_1 ) == 0 : arg_1 = ( 0 , ) arg_2 = [ ] for Func in arg_1 : arg_2 . append ( arg_0 . _get_slice ( arg_0 . _get_index ( Func ) , None ) ) if len ( arg_2 ) == 1 : return arg_2 [ 0 ] else : return tuple ( arg_2 )

def Func(arg_0, *arg_1):
        """Returns one or more subgroups of the match. Each argument is either a
        group index or a group name."""
        if len(arg_1) == 0:
            arg_1 = (0,)
        arg_2 = []
        for Func in arg_1:
            arg_2.append(arg_0._get_slice(arg_0._get_index(Func), None))
        if len(arg_2) == 1:
            return arg_2[0]
        else:
            return tuple(arg_2)

Returns one or more subgroups of the match . Each argument is either a group index or a group name .


def Func(arg_0, arg_1="Func"):
  """The inverse function for erf, the error function.

  Args:
    x: `Tensor` of type `float32`, `float64`.
    name: Python string. A name for the operation (default="Func").

  Returns:
    x: `Tensor` with `dtype=x.dtype`.

  Raises:
    TypeError: if `x` is not floating-type.
  """

  with tf.name_scope(arg_1):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1="x")
    if dtype_util.as_numpy_dtype(arg_0.dtype) not in [np.float32, np.float64]:
      raise TypeError("x.dtype={} is not handled, see docstring for supported "
                      "types.".format(dtype_util.name(arg_0.dtype)))
    return ndtri((arg_0 + 1.) / 2.) / np.sqrt(2.)

The inverse function for erf, the error function.

  Args:
    x: `Tensor` of type `float32`, `float64`.
    name: Python string. A name for the operation (default="erfinv").

  Returns:
    x: `Tensor` with `dtype=x.dtype`.

  Raises:
    TypeError: if `x` is not floating-type.

The inverse function for erf the error function .


def
Func
(
arg_0
)
:
if
not
arg_0
:
return
arg_0
=
unicode
(
arg_0
)
try
:
arg_1
=
RESOURCEPREP
.
prepare
(
arg_0
)
except
StringprepError
,
err
:
raise
JIDError
(
u"Local part invalid: {0}"
.
format
(
err
)
)
if
len
(
arg_1
.
encode
(
"utf-8"
)
)
>
1023
:
raise
JIDError
(
"Resource name too long"
)
return
arg_1

def Func(arg_0):
        """Prepare the resourcepart of the JID.

        :Parameters:
            - `data`: Resourcepart of the JID

        :raise JIDError: if the resource name is too long.
        :raise pyxmpp.xmppstringprep.StringprepError: if the
            resourcepart fails Resourceprep preparation."""
        if not arg_0:
            return None
        arg_0 = unicode(arg_0)
        try:
            arg_1 = RESOURCEPREP.prepare(arg_0)
        except StringprepError, err:
            raise JIDError(u"Local part invalid: {0}".format(err))
        if len(arg_1.encode("utf-8")) > 1023:
            raise JIDError("Resource name too long")
        return arg_1


return self.request("pause", id, json=pause_json, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { "Pause" : arg_2 , "DeploymentID" : arg_1 } return arg_0 . request ( "pause" , arg_1 , json = arg_3 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2):
        """ This endpoint is used to pause or unpause a deployment.
            This is done to pause a rolling upgrade or resume it.

           https://www.nomadproject.io/docs/http/deployments.html

            arguments:
              - id
              - pause, Specifies whether to pause or resume the deployment.
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_3 = {"Pause": arg_2,
                      "DeploymentID": arg_1}
        return arg_0.request("pause", arg_1, json=arg_3, method="post").json()

This endpoint is used to pause or unpause a deployment . This is done to pause a rolling upgrade or resume it .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 == 0 : return for arg_3 in list ( arg_1 . instance_attrs_type . values ( ) ) + list ( arg_1 . locals_type . values ( ) ) : for arg_4 in arg_3 : if isinstance ( arg_4 , astroid . Instance ) : arg_4 = arg_4 . _proxied if not ( isinstance ( arg_4 , astroid . ClassDef ) and arg_0 . show_node ( arg_4 ) ) : continue yield arg_4

def Func(arg_0, arg_1, arg_2):
        """return associated nodes of a class node"""
        if arg_2 == 0:
            return
        for arg_3 in list(arg_1.instance_attrs_type.values()) + list(
            arg_1.locals_type.values()
        ):
            for arg_4 in arg_3:
                if isinstance(arg_4, astroid.Instance):
                    arg_4 = arg_4._proxied
                if not (isinstance(arg_4, astroid.ClassDef) and arg_0.show_node(arg_4)):
                    continue
                yield arg_4


def Func ( arg_0 ) : with open ( arg_0 . filename , "rb" ) as f : arg_1 = f . read ( ) arg_2 = arg_1 . rfind ( b"\n" , 0 , - 1 ) if arg_2 == - 1 : return False arg_3 = arg_1 [ : arg_2 + 1 ] arg_4 = arg_1 [ arg_2 + 1 : ] arg_5 = hashlib . sha1 ( arg_3 ) . hexdigest ( ) . encode ( 'utf8' ) arg_6 = re . search ( b"[0-9a-f]{40}" , arg_4 ) if not arg_6 : return False arg_7 = arg_6 . group ( 0 ) return arg_7 == arg_5

def Func(arg_0):
        """
        Check if the file still has its original contents.

        Returns True if the file is unchanged, False if it has been tampered
        with.
        """

        with open(arg_0.filename, "rb") as f:
            arg_1 = f.read()

        arg_2 = arg_1.rfind(b"\n", 0, -1)
        if arg_2 == -1:
            return False

        arg_3 = arg_1[:arg_2+1]
        arg_4 = arg_1[arg_2+1:]

        arg_5 = hashlib.sha1(arg_3).hexdigest().encode('utf8')
        arg_6 = re.search(b"[0-9a-f]{40}", arg_4)
        if not arg_6:
            return False
        arg_7 = arg_6.group(0)
        return arg_7 == arg_5

Check if the file still has its original contents .


return messages + inbox_messages, all_retrieved

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 , arg_4 = super ( StorageMixin , arg_0 ) . Func ( * arg_1 , ** arg_2 ) if arg_0 . user . is_authenticated ( ) : arg_5 = arg_0 . backend . inbox_list ( arg_0 . user ) else : arg_5 = [ ] return arg_3 + arg_5 , arg_4

def Func(arg_0, *arg_1, **arg_2):
        """
        Retrieve unread messages for current user, both from the inbox and
        from other storages
        """
        arg_3, arg_4 = super(StorageMixin, arg_0).Func(*arg_1, **arg_2)
        if arg_0.user.is_authenticated():
            arg_5 = arg_0.backend.inbox_list(arg_0.user)
        else:
            arg_5 = []

        return arg_3 + arg_5, arg_4

Retrieve unread messages for current user both from the inbox and from other storages


(self, old_states, exchange_proposed,
                            exchange_proposed_n, sampled_replica_states,
                            sampled_replica_results)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : with tf . compat . v1 . name_scope ( 'get_exchanged_states' ) : arg_6 = [ ] for arg_7 in range ( arg_0 . num_replica ) : arg_8 = _get_field ( arg_5 [ arg_7 ] , 'target_log_prob' ) arg_9 = arg_0 . inverse_temperatures [ arg_7 ] arg_6 . append ( arg_8 / arg_9 ) arg_6 = tf . stack ( arg_6 , axis = 0 ) arg_10 = arg_6 . dtype arg_11 = len ( arg_4 [ 0 ] ) arg_12 = [ tf . TensorArray ( arg_10 , size = arg_0 . num_replica , dynamic_size = False , tensor_array_name = 'exchanged_states' , element_shape = arg_4 [ 0 ] [ arg_26 ] . shape ) for arg_26 in range ( arg_11 ) ] arg_13 = tf . concat ( ( [ arg_0 . num_replica // 2 ] , tf . shape ( input = arg_6 ) [ 1 : ] ) , axis = 0 ) arg_14 = tf . math . log ( tf . random . uniform ( shape = arg_13 , arg_10 = arg_10 , seed = arg_0 . _seed_stream ( ) ) ) def _swap ( arg_15 , arg_16 , arg_17 ) : with tf . compat . v1 . name_scope ( 'swap_where_exchange_accepted' ) : arg_18 = mcmc_util . choose ( arg_15 , arg_17 , arg_16 ) arg_19 = mcmc_util . choose ( arg_15 , arg_16 , arg_17 ) return arg_18 , arg_19 def cond ( arg_20 , arg_21 ) : return arg_20 < arg_3 def body ( arg_20 , arg_12 ) : arg_22 , arg_23 = tf . unstack ( arg_2 [ arg_20 ] ) arg_24 = arg_0 . inverse_temperatures [ arg_22 ] - arg_0 . inverse_temperatures [ arg_23 ] arg_25 = mcmc_util . safe_sum ( [ - arg_24 * arg_6 [ arg_22 ] , arg_24 * arg_6 [ arg_23 ] ] ) arg_15 = arg_14 [ arg_20 ] < arg_25 for arg_26 in range ( arg_11 ) : arg_27 , arg_28 = _swap ( arg_15 , arg_1 [ arg_26 ] . read ( arg_22 ) , arg_1 [ arg_26 ] . read ( arg_23 ) ) arg_12 [ arg_26 ] = arg_12 [ arg_26 ] . write ( arg_22 , arg_27 ) arg_12 [ arg_26 ] = arg_12 [ arg_26 ] . write ( arg_23 , arg_28 ) return arg_20 + 1 , arg_12 return tf . while_loop ( cond = cond , body = body , loop_vars = [ tf . constant ( 0 ) , arg_12 ] ) [ 1 ]

def Func(arg_0, arg_1, arg_2,
                            arg_3, arg_4,
                            arg_5):
    """Get list of TensorArrays holding exchanged states, and zeros."""
    with tf.compat.v1.name_scope('get_exchanged_states'):

      arg_6 = []
      for arg_7 in range(arg_0.num_replica):
        arg_8 = _get_field(arg_5[arg_7],
                                      'target_log_prob')
        arg_9 = arg_0.inverse_temperatures[arg_7]
        arg_6.append(arg_8 / arg_9)
      arg_6 = tf.stack(arg_6, axis=0)

      arg_10 = arg_6.dtype
      arg_11 = len(arg_4[0])
      # exchanged_states[k][i] is Tensor of (new) state part k, for replica i.
      # The `k` will be known statically, and `i` is a Tensor.
      # We will insert values into indices `i` for every replica with a proposed
      # exchange.
      arg_12 = [
          tf.TensorArray(
              arg_10,
              size=arg_0.num_replica,
              dynamic_size=False,
              tensor_array_name='exchanged_states',
              # State part k has same shape, regardless of replica.  So use 0.
              element_shape=arg_4[0][arg_26].shape)
          for arg_26 in range(arg_11)
      ]

      # Draw random variables here, to avoid sampling in the loop (and losing
      # reproducibility).  This may mean we sample too many, but we will always
      # have enough.
      arg_13 = tf.concat(
          ([arg_0.num_replica // 2], tf.shape(input=arg_6)[1:]),
          axis=0)
      arg_14 = tf.math.log(
          tf.random.uniform(
              shape=arg_13, arg_10=arg_10, seed=arg_0._seed_stream()))

      def _swap(arg_15, arg_16, arg_17):
        """Swap batches of x, y where accepted."""
        with tf.compat.v1.name_scope('swap_where_exchange_accepted'):
          arg_18 = mcmc_util.choose(arg_15, arg_17, arg_16)
          arg_19 = mcmc_util.choose(arg_15, arg_16, arg_17)
        return arg_18, arg_19

      def cond(arg_20, arg_21):
        return arg_20 < arg_3

      def body(arg_20, arg_12):
        """Body of while loop for exchanging states."""
        # Propose exchange between replicas indexed by m and n.
        arg_22, arg_23 = tf.unstack(arg_2[arg_20])

        # Construct log_accept_ratio:  -temp_diff * target_log_prob_diff.
        # Note target_log_prob_diff = -EnergyDiff (common definition is in terms
        # of energy).
        arg_24 = arg_0.inverse_temperatures[arg_22] - arg_0.inverse_temperatures[arg_23]
        # Difference of target log probs may be +- Inf or NaN.  We want the
        # product of this with the temperature difference to have "alt value" of
        # -Inf.
        arg_25 = mcmc_util.safe_sum(
            [-arg_24 * arg_6[arg_22], arg_24 * arg_6[arg_23]])

        arg_15 = arg_14[arg_20] < arg_25

        for arg_26 in range(arg_11):
          arg_27, arg_28 = _swap(arg_15, arg_1[arg_26].read(arg_22),
                               arg_1[arg_26].read(arg_23))
          arg_12[arg_26] = arg_12[arg_26].write(arg_22, arg_27)
          arg_12[arg_26] = arg_12[arg_26].write(arg_23, arg_28)

        return arg_20 + 1, arg_12

      # At this point, exchanged_states[k] is a length num_replicas TensorArray.
      return tf.while_loop(
          cond=cond, body=body, loop_vars=[tf.constant(0),
                                           arg_12])[1]

Get list of TensorArrays holding exchanged states and zeros .


(key, stdin, preamble=None, chunk_size=65536,
                content_length=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=65536,
                arg_4=None):
    """
    Generator that encrypts a content stream using AES 256 in CBC
    mode.

    :param key: Any string to use as the encryption key.
    :param stdin: Where to read the contents from.
    :param preamble: str to yield initially useful for providing a
        hint for future readers as to the algorithm in use.
    :param chunk_size: Largest amount to read at once.
    :param content_length: The number of bytes to read from stdin.
        None or < 0 indicates reading until EOF.
    """
    if not AES256CBC_Support:
        raise Exception(
            'AES256CBC not supported; likely pycrypto is not installed')
    if arg_2:
        yield arg_2
    # Always use 256-bit key
    arg_0 = hashlib.sha256(arg_0).digest()
    # At least 16 and a multiple of 16
    arg_3 = max(16, arg_3 >> 4 << 4)
    arg_5 = Crypto.Random.new().read(16)
    yield arg_5
    arg_6 = Crypto.Cipher.AES.new(arg_0, Crypto.Cipher.AES.MODE_CBC, arg_5)
    arg_7 = True
    arg_8 = None
    if arg_4 is not None and arg_4 >= 0:
        arg_8 = arg_4
    while arg_7:
        arg_9 = arg_3
        if arg_8 is not None and arg_9 > arg_8:
            arg_9 = arg_8
        arg_10 = arg_1.read(arg_9)
        if not arg_10:
            if arg_8 is not None and arg_8 > 0:
                raise IOError('Early EOF from input')
            # Indicates how many usable bytes in last block
            yield arg_6.encrypt('\x00' * 16)
            break
        if arg_8 is not None:
            arg_8 -= len(arg_10)
            if arg_8 <= 0:
                arg_7 = False
        arg_11 = arg_10
        arg_12 = len(arg_11) % 16
        while arg_12:
            arg_9 = 16 - arg_12
            if arg_8 is not None and arg_9 > arg_8:
                arg_9 = arg_8
            arg_10 = arg_1.read(arg_9)
            if not arg_10:
                if arg_8 is not None and arg_8 > 0:
                    raise IOError('Early EOF from input')
                arg_7 = False
                # Indicates how many usable bytes in last block
                arg_10 = chr(arg_12) * (16 - arg_12)
            elif arg_8 is not None:
                arg_8 -= len(arg_10)
                if arg_8 <= 0:
                    arg_7 = False
            arg_11 += arg_10
            arg_12 = len(arg_11) % 16
        yield arg_6.encrypt(arg_11)

Generator that encrypts a content stream using AES 256 in CBC mode .


def
Func
(
arg_0
)
:
if
WINDOWS
:
arg_1
=
os
.
path
.
normpath
(
_get_win_folder
(
"CSIDL_COMMON_APPDATA"
)
)
arg_2
=
[
os
.
path
.
join
(
arg_1
,
arg_0
)
]
elif
sys
.
platform
==
'darwin'
:
arg_2
=
[
os
.
path
.
join
(
'/Library/Application Support'
,
arg_0
)
]
else
:
arg_3
=
os
.
getenv
(
'XDG_CONFIG_DIRS'
,
'/etc/xdg'
)
if
arg_3
:
arg_2
=
[
os
.
sep
.
join
(
[
os
.
path
.
expanduser
(
x
)
,
arg_0
]
)
for
x
in
arg_3
.
split
(
os
.
pathsep
)
]
else
:
arg_2
=
[
]
arg_2
.
append
(
'/etc'
)
return
arg_2

def Func(arg_0):
    """Return a list of potential user-shared config dirs for this application.

        "appname" is the name of application.

    Typical user config directories are:
        Mac OS X:   /Library/Application Support/<AppName>/
        Unix:       /etc or $XDG_CONFIG_DIRS[i]/<AppName>/ for each value in
                    $XDG_CONFIG_DIRS
        Win XP:     C:\Documents and Settings\All Users\Application ...
                    ...Data\<AppName>\
        Vista:      (Fail! "C:\ProgramData" is a hidden *system* directory
                    on Vista.)
        Win 7:      Hidden, but writeable on Win 7:
                    C:\ProgramData\<AppName>\
    """
    if WINDOWS:
        arg_1 = os.path.normpath(_get_win_folder("CSIDL_COMMON_APPDATA"))
        arg_2 = [os.path.join(arg_1, arg_0)]
    elif sys.platform == 'darwin':
        arg_2 = [os.path.join('/Library/Application Support', arg_0)]
    else:
        # try looking in $XDG_CONFIG_DIRS
        arg_3 = os.getenv('XDG_CONFIG_DIRS', '/etc/xdg')
        if arg_3:
            arg_2 = [
                os.sep.join([os.path.expanduser(x), arg_0])
                for x in arg_3.split(os.pathsep)
            ]
        else:
            arg_2 = []

        # always look in /etc directly as well
        arg_2.append('/etc')

    return arg_2

Return a list of potential user - shared config dirs for this application .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . write ( Operators . ZEXTEND ( arg_2 . read ( ) , arg_1 . size ) )

def Func(arg_0, arg_1, arg_2):
        """
        Moves with zero-extend.

        Copies the contents of the source operand (register or memory location) to the destination
        operand (register) and zero extends the value to 16 or 32 bits. The size of the converted value
        depends on the operand-size attribute::

                OP0  =  ZeroExtend(OP1);

        :param cpu: current CPU.
        :param op0: destination operand.
        :param op1: source operand.
        """
        arg_1.write(Operators.ZEXTEND(arg_2.read(), arg_1.size))


(self, object, stream, indent, allowance, context, level)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : try : PrettyPrinter . Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) except Exception as e : arg_2 . write ( Func_exception ( e ) )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """
        Recursive part of the formatting
        """
        try:
            PrettyPrinter.Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6)
        except Exception as e:
            arg_2.write(Func_exception(e))


def Func ( arg_0 , arg_1 ) : while arg_0 . Errors . empty ( ) : try : return arg_1 . Func ( timeout = 1 ) except queue . Empty : if not arg_0 . is_alive ( ) : try : return arg_1 . Func ( timeout = 0 ) except queue . Empty : raise StopProcessGroup else : continue else : raise StopProcessGroup

def Func(arg_0, arg_1):
        """ Protected Func. Get an item from Q.
            Will block. but if the process group has errors,
            raise an StopProcessGroup exception.

            A slave process will terminate upon StopProcessGroup.
            The master process shall read the error from the process group.

        """
        while arg_0.Errors.empty():
            try:
                return arg_1.Func(timeout=1)
            except queue.Empty:
                # check if the process group is dead
                if not arg_0.is_alive():
                    # todo : can be graceful, in which
                    # case the last item shall have been
                    # flushed to Q.
                    try:
                        return arg_1.Func(timeout=0)
                    except queue.Empty:
                        raise StopProcessGroup
                else:
                    continue
        else:
            raise StopProcessGroup

Protected get. Get an item from Q.
            Will block. but if the process group has errors,
            raise an StopProcessGroup exception.

            A slave process will terminate upon StopProcessGroup.
            The master process shall read the error from the process group.

Protected get . Get an item from Q . Will block . but if the process group has errors raise an StopProcessGroup exception .


def Func ( arg_0 ) : arg_1 = _compute_threshold ( arg_0 ) arg_2 = tf . where ( tf . greater ( arg_0 , arg_1 ) , arg_0 , tf . zeros_like ( arg_0 , tf . float32 ) ) arg_3 = tf . where ( tf . less ( arg_0 , - arg_1 ) , arg_0 , tf . zeros_like ( arg_0 , tf . float32 ) ) arg_4 = tf . add ( arg_2 , arg_3 , name = None ) arg_5 = tf . abs ( arg_4 ) arg_6 = tf . where ( tf . greater ( arg_5 , 0 ) , tf . ones_like ( arg_5 , tf . float32 ) , tf . zeros_like ( arg_5 , tf . float32 ) ) arg_7 = tf . reduce_sum ( arg_5 ) arg_8 = tf . reduce_sum ( arg_6 ) arg_9 = tf . div ( arg_7 , arg_8 ) return arg_9

def Func(arg_0):
    """Computing the scale parameter."""
    arg_1 = _compute_threshold(arg_0)
    arg_2 = tf.where(tf.greater(arg_0, arg_1), arg_0, tf.zeros_like(arg_0, tf.float32))
    arg_3 = tf.where(tf.less(arg_0, -arg_1), arg_0, tf.zeros_like(arg_0, tf.float32))
    arg_4 = tf.add(arg_2, arg_3, name=None)
    arg_5 = tf.abs(arg_4)
    arg_6 = tf.where(
        tf.greater(arg_5, 0), tf.ones_like(arg_5, tf.float32),
        tf.zeros_like(arg_5, tf.float32)
    )
    arg_7 = tf.reduce_sum(arg_5)
    arg_8 = tf.reduce_sum(arg_6)
    arg_9 = tf.div(arg_7, arg_8)
    return arg_9


(data, headers, table_format=None, **kwargs)

def Func(arg_0, arg_1, arg_2=None, **arg_3):
    """Wrap terminaltables inside a function for TabularOutputFormatter."""
    arg_4 = ('title', )

    arg_5 = table_format_handler[arg_2]

    arg_6 = arg_5([arg_1] + list(arg_0), **filter_dict_by_key(arg_3, arg_4))

    arg_7 = terminaltables.width_and_alignment.max_dimensions(
        arg_6.table_data,
        arg_6.padding_left,
        arg_6.padding_right)[:3]
    for arg_8 in arg_6.gen_table(*arg_7):
        yield u''.join(arg_8)

Wrap terminaltables inside a function for TabularOutputFormatter .


given a groups dictionary and an ID, return its actual parent ID.

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . keys ( ) : return arg_1 if not arg_1 in arg_0 . keys ( ) : for arg_2 in arg_0 . keys ( ) : if arg_1 in arg_0 [ arg_2 ] : return arg_2 return None

def Func(arg_0,arg_1):
    """given a groups dictionary and an ID, return its actual Func ID."""
    if arg_1 in arg_0.keys():
        return arg_1 # already a Func
    if not arg_1 in arg_0.keys():
        for arg_2 in arg_0.keys():
            if arg_1 in arg_0[arg_2]:
                return arg_2 # found the actual Func
    return None

given a groups dictionary and an ID return its actual parent ID .


def Func ( arg_0 ) : if hasattr ( arg_0 , 'Func' ) : for arg_1 in arg_0 . Func ( ) : yield ( arg_1 ) elif isinstance ( arg_0 , str ) : yield ( repr ( arg_0 ) )

def Func(arg_0):
    '''Generate token strings which, when joined together, form a valid
    XPath serialization of the AST.'''

    if hasattr(arg_0, 'Func'):
        for arg_1 in arg_0.Func():
            yield(arg_1)
    elif isinstance(arg_0, str):
        yield(repr(arg_0))

Generate token strings which when joined together form a valid XPath serialization of the AST .


return urlunsplit((scheme, netloc, path, query_string, fragment))

def Func(arg_0):
    """Given a file URL, return a md5 query of the file

    Args:
        url: a given URL
    Returns:
        URL of the md5 file
    """
    arg_1, arg_2, arg_3, arg_4, arg_5 = urlsplit(arg_0)
    arg_3 += '.md5'

    return urlunsplit((arg_1, arg_2, arg_3, arg_4, arg_5))

Given a file URL return a md5 query of the file


def Func(arg_0, arg_1=None, arg_2=None):
    r"""
    Return the running Func of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
    """
    arg_3 = copy.copy(arg_0)
    _bound_waveform(arg_3, arg_1, arg_2)
    arg_4 = _running_area(arg_3._indep_vector, arg_3._dep_vector)
    arg_4[0] = arg_3._dep_vector[0]
    arg_5 = arg_3._indep_vector - arg_3._indep_vector[0]
    arg_5[0] = 1.0
    arg_3._dep_vector = np.divide(arg_4, arg_5)
    arg_3.dep_name = "Func({0})".format(arg_3._dep_name)
    return arg_3

r"""
    Return the running average of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.average

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]

r Return the running average of a waveform s dependent variable vector .


def Func(arg_0, arg_1):
        """Asserts that the val is identical to other, via 'is' compare."""
        if arg_0.val is not arg_1:
            arg_0._err('Expected <%s> to be identical to <%s>, but was not.' % (arg_0.val, arg_1))
        return arg_0

Asserts that the val is identical to other via is compare .


def
Func
(
arg_0
)
:
if
not
arg_0
.
_is_running
:
raise
TimerError
(
'timer is not running'
)
arg_0
.
_t_last
=
time
(
)
return
arg_0
.
_t_last
arg_0
.
_t_start

def Func(arg_0):
        """Total time since the timer is started.

        Returns (float): Time in seconds.
        """
        if not arg_0._is_running:
            raise TimerError('timer is not running')
        arg_0._t_last = time()
        return arg_0._t_last - arg_0._t_start


def Func ( arg_0 , ** arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_1 . items ( ) : arg_3 = str ( arg_3 ) if arg_3 . startswith ( '_' ) : arg_3 = arg_3 [ 1 : ] if not arg_3 . startswith ( '-' ) : arg_3 = '-' + arg_3 if arg_4 is True : arg_2 . append ( arg_3 ) elif arg_4 is False : if arg_3 . startswith ( '-no' ) : arg_2 . append ( '-' + arg_3 [ 3 : ] ) else : arg_2 . append ( '-no' + arg_3 [ 1 : ] ) elif arg_4 is None : pass else : try : arg_2 . extend ( [ arg_3 ] + arg_4 ) except TypeError : arg_2 . extend ( [ arg_3 , arg_4 ] ) return list ( map ( str , arg_2 ) )

def Func(arg_0, **arg_1):
        """Build list of arguments from the dict; keys must be valid  gromacs flags."""
        arg_2 = []
        for arg_3, arg_4 in arg_1.items():
            # XXX: check flag against allowed values
            arg_3 = str(arg_3)
            if arg_3.startswith('_'):
                arg_3 = arg_3[1:]                 # python-illegal keywords are '_'-quoted
            if not arg_3.startswith('-'):
                arg_3 = '-' + arg_3               # now flag is guaranteed to start with '-'
            if arg_4 is True:
                arg_2.append(arg_3)            # simple command line flag
            elif arg_4 is False:
                if arg_3.startswith('-no'):
                    # negate a negated flag ('noX=False' --> X=True --> -X ... but who uses that?)
                    arg_2.append('-' + arg_3[3:])
                else:
                    arg_2.append('-no' + arg_3[1:])  # gromacs switches booleans by prefixing 'no'
            elif arg_4 is None:
                pass                            # ignore flag = None
            else:
                try:
                    arg_2.extend([arg_3] + arg_4) # option with value list
                except TypeError:
                    arg_2.extend([arg_3, arg_4])  # option with single value
        return list(map(str, arg_2))

Build list of arguments from the dict ; keys must be valid gromacs flags .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . split ( '.' ) [ - 1 ] if arg_3 in [ 'png' ] : arg_4 = '.' . join ( arg_0 . split ( '.' ) [ : - 1 ] ) else : arg_4 = arg_0 arg_3 = ".png" arg_5 = arg_4 . split ( '*' ) arg_6 = [ ] arg_7 = arg_2 for arg_8 in arg_1 : arg_9 = ( str ( arg_7 ) . zfill ( 6 ) ) . join ( arg_5 ) + arg_3 arg_6 . append ( save ( arg_9 , arg_8 ) ) arg_7 += 1 return arg_6

def Func(arg_0, arg_1, arg_2=1):
    """
    Export a numpy array to a set of png files, with each Z-index 2D
    array as its own 2D file.

    Arguments:
        png_filename_base:     A filename template, such as "my-image-*.png"
                                which will lead to a collection of files named
                                "my-image-0.png", "my-image-1.png", etc.
        numpy_data:             The numpy array data to save to png.

    Returns:
        Array. A list of expanded filenames that hold png data.
    """
    arg_3 = arg_0.split('.')[-1]
    if arg_3 in ['png']:
        # Filename is "name*.ext", set file_base to "name*".
        arg_4 = '.'.join(arg_0.split('.')[:-1])
    else:
        # Filename is "name*", set file_base to "name*".
        # That is, extension wasn't included.
        arg_4 = arg_0
        arg_3 = ".png"

    arg_5 = arg_4.split('*')

    # The array of filenames to return
    arg_6 = []

    # Filename 0-padding
    arg_7 = arg_2
    for arg_8 in arg_1:
        arg_9 = (str(arg_7).zfill(6)).join(arg_5) + arg_3
        arg_6.append(save(arg_9, arg_8))
        arg_7 += 1

    return arg_6

Export a numpy array to a set of png files with each Z - index 2D array as its own 2D file .


async def Func(arg_0, arg_1, *, arg_2):
        """ Lists the first 10 search results from a given query. """
        if not arg_2.startswith('ytsearch:') and not arg_2.startswith('scsearch:'):
            arg_2 = 'ytsearch:' + arg_2

        arg_3 = await arg_0.bot.lavalink.get_tracks(arg_2)

        if not arg_3 or not arg_3['tracks']:
            return await arg_1.send('Nothing found')

        arg_4 = arg_3['tracks'][:10]  # First 10 results

        arg_5 = ''
        for arg_6, arg_7 in enumerate(arg_4, start=1):
            arg_8 = arg_7["info"]["title"]
            arg_9 = arg_7["info"]["uri"]

            arg_5 += f'`{index}.` [{track_title}]({track_uri})\n'

        arg_10 = discord.Embed(color=discord.Color.blurple(), description=arg_5)
        await arg_1.send(arg_10=arg_10)

Lists the first 10 search results from a given query .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_except_handler_name ( arg_1 ) if not arg_2 : super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 ) return arg_0 . current_except_names . append ( arg_2 ) super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 ) arg_0 . current_except_names . pop ( )

def Func(arg_0, arg_1):
        """
        Process except blocks.

        """
        arg_2 = arg_0.get_except_handler_name(arg_1)
        if not arg_2:
            super(LoggingVisitor, arg_0).generic_visit(arg_1)
            return

        arg_0.current_except_names.append(arg_2)
        super(LoggingVisitor, arg_0).generic_visit(arg_1)
        arg_0.current_except_names.pop()


def Func(arg_0, *arg_1, **arg_2):
        """
            Returns the number of results after filtering with the given arguments.
        """
        arg_3 = arg_0.create_search(*arg_1, **arg_2)
        try:
            return arg_3.Func()
        except NotFoundError:
            print_error("The index was not found, have you initialized the index?")
        except (ConnectionError, TransportError):
            print_error("Cannot connect to elasticsearch")

Returns the number of results after filtering with the given arguments .


return list(
        {
            module.__name__: module

            for module in imported
        }.values()
    )

def Func(arg_0):
    """
    Recursively loads all modules from a package object, or set of package objects

    :param package_or_set_of_packages: package object, or iterable of package objects
    :return: list of all unique modules discovered by the function
    """
    if isinstance(arg_0, types.ModuleType):
        arg_1 = [arg_0]
    elif isinstance(arg_0, Iterable) and not isinstance(arg_0, (dict, str)):
        arg_1 = arg_0
    else:
        raise Exception("This function only accepts a module reference, or an iterable of said objects")

    arg_2 = arg_1.copy()

    for arg_3 in arg_1:
        if not hasattr(arg_3, '__path__'):
            raise Exception(
                'Package object passed in has no __path__ attribute. '
                'Make sure to pass in imported references to the packages in question.'
            )

        for arg_4, arg_5, arg_6 in pkgutil.walk_packages(arg_3.__path__):
            arg_7 = '{}.{}'.format(arg_3.__name__, arg_5)
            arg_8 = importlib.import_module(arg_7)
            arg_2.append(arg_8)
            if arg_6:
                arg_2 += Func(arg_8)

    for arg_9 in arg_2:
        # This is to cover cases where simply importing a module doesn't execute all the code/definitions within
        # I don't totally understand the reasons for this, but I do know enumerating a module's context (like with dir)
        # seems to solve things
        dir(arg_9)

    return list(
        {
            arg_9.__name__: arg_9

            for arg_9 in arg_2
        }.values()
    )

Recursively loads all modules from a package object or set of package objects


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_1
if
arg_1
else
arg_0
.
project_id
try
:
arg_3
=
arg_0
.
service
.
datasets
(
)
.
list
(
projectId
=
arg_2
)
.
execute
(
num_retries
=
arg_0
.
num_retries
)
[
'datasets'
]
arg_0
.
log
.
info
(
"Datasets List: %s"
,
arg_3
)
except
HttpError
as
err
:
raise
AirflowException
(
'BigQuery job failed. Error was: {}'
.
format
(
err
.
content
)
)
return
arg_3

def Func(arg_0, arg_1=None):
        """
        Method returns full list of BigQuery datasets in the current project

        .. seealso::
            For more information, see:
            https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/list

        :param project_id: Google Cloud Project for which you
            try to get all datasets
        :type project_id: str
        :return: datasets_list

            Example of returned datasets_list: ::

                   {
                      "kind":"bigquery#dataset",
                      "location":"US",
                      "id":"your-project:dataset_2_test",
                      "datasetReference":{
                         "projectId":"your-project",
                         "datasetId":"dataset_2_test"
                      }
                   },
                   {
                      "kind":"bigquery#dataset",
                      "location":"US",
                      "id":"your-project:dataset_1_test",
                      "datasetReference":{
                         "projectId":"your-project",
                         "datasetId":"dataset_1_test"
                      }
                   }
                ]
        """
        arg_2 = arg_1 if arg_1 else arg_0.project_id

        try:
            arg_3 = arg_0.service.datasets().list(
                projectId=arg_2).execute(num_retries=arg_0.num_retries)['datasets']
            arg_0.log.info("Datasets List: %s", arg_3)

        except HttpError as err:
            raise AirflowException(
                'BigQuery job failed. Error was: {}'.format(err.content))

        return arg_3


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . maps : if isinstance ( arg_2 , AnonMap ) : arg_1 . append ( ( arg_2 . start , arg_2 . end , arg_2 . perms , 0 , '' ) ) elif isinstance ( arg_2 , FileMap ) : arg_1 . append ( ( arg_2 . start , arg_2 . end , arg_2 . perms , arg_2 . _offset , arg_2 . _filename ) ) else : arg_1 . append ( ( arg_2 . start , arg_2 . end , arg_2 . perms , 0 , arg_2 . name ) ) return sorted ( arg_1 )

def Func(arg_0):
        """
        Returns a sorted list of all the Func for this memory.

        :return: a list of Func.
        :rtype: list
        """
        arg_1 = []
        for arg_2 in arg_0.maps:
            if isinstance(arg_2, AnonMap):
                arg_1.append((arg_2.start, arg_2.end, arg_2.perms, 0, ''))
            elif isinstance(arg_2, FileMap):
                arg_1.append((arg_2.start, arg_2.end, arg_2.perms, arg_2._offset, arg_2._filename))
            else:
                arg_1.append((arg_2.start, arg_2.end, arg_2.perms, 0, arg_2.name))

        return sorted(arg_1)

Returns a sorted list of all the mappings for this memory.

        :return: a list of mappings.
        :rtype: list

Returns a sorted list of all the mappings for this memory .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . current . read_string ( arg_1 ) arg_4 = arg_0 . current . read_string ( arg_2 ) arg_5 = 0 try : os . rename ( arg_3 , arg_4 ) except OSError as e : arg_5 = - e . errno return arg_5

def Func(arg_0, arg_1, arg_2):
        """
        Rename filename `oldnamep` to `newnamep`.

        :param int oldnamep: pointer to oldname
        :param int newnamep: pointer to newname
        """
        arg_3 = arg_0.current.read_string(arg_1)
        arg_4 = arg_0.current.read_string(arg_2)

        arg_5 = 0
        try:
            os.rename(arg_3, arg_4)
        except OSError as e:
            arg_5 = -e.errno

        return arg_5


async
def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
)
:
if
arg_0
.
event_future
is
not
:
raise
Exception
(
"Can't wait on multiple events!"
)
arg_3
=
await
asyncio
.
wait_for
(
arg_0
.
_wait_loop
(
arg_1
)
,
arg_2
)
return
arg_3

async def Func(arg_0, arg_1=None, arg_2=None):
        """ Wait for any or specified event """
        if arg_0.event_future is not None:
            raise Exception("Can't wait on multiple events!")

        arg_3 = await asyncio.wait_for(arg_0._wait_loop(arg_1), arg_2)
        return arg_3


def Func(arg_0, arg_1):
    """
    Make a class appear to reside in `module`, rather than the module in which
    it is actually defined.

    >>> from nose.failure import Failure
    >>> Failure.__module__
    'nose.failure'
    >>> Nf = Func(Failure, __name__)
    >>> Nf.__module__
    'nose.util'
    >>> Nf.__name__
    'Failure'

    """
    class arg_2(arg_0):
        pass
    arg_2.__module__ = arg_1
    arg_2.__name__ = arg_0.__name__
    return arg_2

Make a class appear to reside in `module`, rather than the module in which
    it is actually defined.

    >>> from nose.failure import Failure
    >>> Failure.__module__
    'nose.failure'
    >>> Nf = transplant_class(Failure, __name__)
    >>> Nf.__module__
    'nose.util'
    >>> Nf.__name__
    'Failure'

Make a class appear to reside in module rather than the module in which it is actually defined .


return self.b_fit_score(b, a) - self.b_fit_score(a, b)

def Func(arg_0, arg_1, arg_2, **arg_3):
        """ Infer causal relationships between 2 variables using the RECI statistic

        :param a: Input variable 1
        :param b: Input variable 2
        :return: Causation coefficient (Value : 1 if a->b and -1 if b->a)
        :rtype: float
        """
        return arg_0.b_fit_score(arg_2, arg_1) - arg_0.b_fit_score(arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_2 = arg_0 . _request_graph ( arg_1 . ui . control ) if arg_2 is None : return arg_3 = [ v . ID for v in arg_2 . nodes ] arg_4 = Node ( ID = make_unique_name ( "node" , arg_3 ) ) arg_2 . nodes . append ( arg_4 ) arg_5 = arg_4 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" ) if not arg_5 . result : arg_2 . nodes . remove ( arg_4 )

def Func(arg_0, arg_1):
        """ Handles adding a Node to the graph.
        """
        if not arg_1.initialized:
            return

        arg_2 = arg_0._request_graph(arg_1.ui.control)

        if arg_2 is None:
            return

        arg_3 = [v.ID for v in arg_2.nodes]
        arg_4 = Node(ID=make_unique_name("node", arg_3))
        arg_2.nodes.append(arg_4)

        arg_5 = arg_4.edit_traits(parent=arg_1.ui.control, kind="livemodal")

        if not arg_5.result:
            arg_2.nodes.remove(arg_4)


def Func(arg_0, arg_1, arg_2=False):
        """Prefilter a single input line as text.

        This method prefilters a single line of text by calling the
        transformers and then the checkers/handlers.
        """

        # print "Func: ", line, continue_prompt
        # All handlers *must* return a value, even if it's blank ('').

        # save the line away in case we crash, so the post-mortem handler can
        # record it
        arg_0.shell._last_input_line = arg_1

        if not arg_1:
            # Return immediately on purely empty lines, so that if the user
            # previously typed some whitespace that started a continuation
            # prompt, he can break out of that loop with just an empty line.
            # This is how the default python prompt works.
            return ''

        # At this point, we invoke our transformers.
        if not arg_2 or (arg_2 and arg_0.multi_line_specials):
            arg_1 = arg_0.transform_line(arg_1, arg_2)

        # Now we compute line_info for the checkers and handlers
        arg_5 = LineInfo(arg_1, arg_2)

        # the input history needs to track even empty lines
        arg_6 = arg_1.strip()

        arg_7 = arg_0.get_handler_by_name('normal')
        if not arg_6:
            if not arg_2:
                arg_0.shell.displayhook.prompt_count -= 1

            return arg_7.handle(arg_5)

        # special handlers are only allowed for single line statements
        if arg_2 and not arg_0.multi_line_specials:
            return arg_7.handle(arg_5)

        arg_8 = arg_0.Func_info(arg_5)
        # print "prefiltered line: %r" % prefiltered
        return arg_8


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_1
+=
1
arg_4
+=
1
if
(
(
arg_1
<
1
)
or
(
arg_1
>
Extents
.
Seasons
)
or
(
arg_4
<
1
)
or
(
arg_4
>
Extents
.
Schedules
)
or
(
arg_2
>
12
)
or
(
arg_2
<
0
)
or
(
arg_3
<
0
)
or
(
arg_3
>
31
)
)
:
ekm_log
(
"Out of bounds: month "
+
str
(
arg_2
)
+
" day "
+
str
(
arg_3
)
+
" schedule "
+
str
(
arg_4
)
+
" season "
+
str
(
arg_1
)
)
return
False
arg_5
=
"Season_"
+
str
(
arg_1
)
+
"_Start_Day"
arg_6
=
"Season_"
+
str
(
arg_1
)
+
"_Start_Month"
arg_7
=
"Season_"
+
str
(
arg_1
)
+
"_Schedule"
if
arg_5
not
in
arg_0
.
m_seasons_sched_params
:
ekm_log
(
"Incorrect index: "
+
arg_5
)
return
False
if
arg_6
not
in
arg_0
.
m_seasons_sched_params
:
ekm_log
(
"Incorrect index: "
+
arg_6
)
return
False
if
arg_7
not
in
arg_0
.
m_seasons_sched_params
:
ekm_log
(
"Incorrect index: "
+
arg_7
)
return
False
arg_0
.
m_seasons_sched_params
[
arg_5
]
=
arg_2
arg_0
.
m_seasons_sched_params
[
arg_6
]
=
arg_3
arg_0
.
m_seasons_sched_params
[
arg_7
]
=
arg_4
return
True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Define a single season and assign a schedule

        Args:
            season (int): A :class:`~ekmmeters.Seasons` value or in range(Extent.Seasons).
            month (int): Month 1-12.
            day (int):  Day 1-31.
            schedule (int): A :class:`~ekmmeters.LCDItems` value or in range(Extent.Schedules).

        Returns:
            bool: True on completion and ACK.
        """
        arg_1 += 1
        arg_4 += 1
        if ((arg_1 < 1) or (arg_1 > Extents.Seasons) or (arg_4 < 1) or
                (arg_4 > Extents.Schedules) or (arg_2 > 12) or (arg_2 < 0) or
                (arg_3 < 0) or (arg_3 > 31)):
            ekm_log("Out of bounds: month " + str(arg_2) + " day " + str(arg_3) +
                    " schedule " + str(arg_4) + " season " + str(arg_1))
            return False

        arg_5 = "Season_" + str(arg_1) + "_Start_Day"
        arg_6 = "Season_" + str(arg_1) + "_Start_Month"
        arg_7 = "Season_" + str(arg_1) + "_Schedule"
        if arg_5 not in arg_0.m_seasons_sched_params:
            ekm_log("Incorrect index: " + arg_5)
            return False
        if arg_6 not in arg_0.m_seasons_sched_params:
            ekm_log("Incorrect index: " + arg_6)
            return False
        if arg_7 not in arg_0.m_seasons_sched_params:
            ekm_log("Incorrect index: " + arg_7)
            return False

        arg_0.m_seasons_sched_params[arg_5] = arg_2
        arg_0.m_seasons_sched_params[arg_6] = arg_3
        arg_0.m_seasons_sched_params[arg_7] = arg_4
        return True


def Func ( arg_0 , arg_1 ) : try : return valid_numeric ( arg_0 ) - valid_numeric ( arg_1 ) except ( ValueError , TypeError ) : try : return arg_0 - arg_1 except Exception : return ''

def Func(arg_0, arg_1):
    """Subtract the arg from the value."""
    try:
        return valid_numeric(arg_0) - valid_numeric(arg_1)
    except (ValueError, TypeError):
        try:
            return arg_0 - arg_1
        except Exception:
            return ''


def Func(arg_0, arg_1, arg_2):
        """
        Build a notebook model from database record.
        """
        arg_3 = to_api_path(arg_1['parent_name'] + arg_1['name'])
        arg_4 = base_model(arg_3)
        arg_4['type'] = 'notebook'
        arg_4['last_modified'] = arg_4['created'] = arg_1['created_at']
        if arg_2:
            arg_2 = reads_base64(arg_1['content'])
            arg_0.mark_trusted_cells(arg_2, arg_3)
            arg_4['content'] = arg_2
            arg_4['format'] = 'json'
            arg_0.validate_notebook_model(arg_4)
        return arg_4

Build a notebook model from database record .


(writer, dataframe, delimiter, with_header)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = codecs . getwriter ( 'utf-8' ) ( arg_0 ) arg_1 . to_csv ( path_or_buf = arg_4 , sep = arg_2 , header = arg_3 , index = False )

def Func(arg_0, arg_1, arg_2, arg_3):
    """serialize the dataframe with different delimiters"""
    arg_4 = codecs.getwriter('utf-8')(arg_0)
    arg_1.to_csv(
        path_or_buf=arg_4,
        sep=arg_2,
        header=arg_3,
        index=False
    )


def Func ( arg_0 , arg_1 = 2000 , arg_2 = True ) : from pymc3 . distributions . timeseries import GaussianRandomWalk with pm . Model ( ) as model : arg_3 = pm . Exponential ( 'nu' , 1. / 10 , testval = 5. ) arg_4 = pm . Exponential ( 'sigma' , 1. / .02 , testval = .1 ) arg_5 = GaussianRandomWalk ( 's' , arg_4 ** - 2 , shape = len ( arg_0 ) ) arg_6 = pm . Deterministic ( 'volatility_process' , pm . math . exp ( - 2 * arg_5 ) ) pm . StudentT ( 'r' , arg_3 , lam = arg_6 , observed = arg_0 ) arg_7 = pm . sample ( arg_1 , arg_2 = arg_2 ) return model , arg_7

def Func(arg_0, arg_1=2000, arg_2=True):
    """
    Run stochastic volatility model.

    This model estimates the volatility of a returns series over time.
    Returns are assumed to be T-distributed. lambda (width of
    T-distributed) is assumed to follow a random-walk.

    Parameters
    ----------
    data : pandas.Series
        Return series to model.
    samples : int, optional
        Posterior samples to draw.

    Returns
    -------
    model : pymc.Model object
        PyMC3 model containing all random variables.
    trace : pymc3.sampling.BaseTrace object
        A PyMC3 trace object that contains samples for each parameter
        of the posterior.

    See Also
    --------
    plot_stoch_vol : plotting of tochastic volatility model
    """

    from pymc3.distributions.timeseries import GaussianRandomWalk

    with pm.Model() as model:
        arg_3 = pm.Exponential('nu', 1. / 10, testval=5.)
        arg_4 = pm.Exponential('sigma', 1. / .02, testval=.1)
        arg_5 = GaussianRandomWalk('s', arg_4**-2, shape=len(arg_0))
        arg_6 = pm.Deterministic('volatility_process',
                                              pm.math.exp(-2 * arg_5))
        pm.StudentT('r', arg_3, lam=arg_6, observed=arg_0)

        arg_7 = pm.sample(arg_1, arg_2=arg_2)

    return model, arg_7


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) for arg_3 , arg_4 in arg_0 . key_map . items ( ) : if _is_null ( arg_1 , arg_3 ) : return None if arg_3 in arg_1 . __dict__ : arg_2 [ arg_4 ] = arg_1 . __dict__ [ arg_3 ] else : arg_2 [ arg_4 ] = getattr ( arg_1 , arg_3 ) return frozenset ( tuple ( arg_2 . items ( ) ) )

def Func(arg_0, arg_1):
        '''
        Compute the lookup key for an instance, i.e. a foreign key that
        can be used to identify an instance at the end of the link.
        '''
        arg_2 = dict()
        for arg_3, arg_4 in arg_0.key_map.items():
            if _is_null(arg_1, arg_3):
                return None

            if arg_3 in arg_1.__dict__:
                arg_2[arg_4] = arg_1.__dict__[arg_3]
            else:
                arg_2[arg_4] = getattr(arg_1, arg_3)

        return frozenset(tuple(arg_2.items()))

Compute the lookup key for an instance i . e . a foreign key that can be used to identify an instance at the end of the link .


def Func(arg_0, arg_1):
        """ Load activation data from a text file.

        Args:
            filename (str): a string pointing to the location of the txt file
                to read from.
        """
        logger.info("Loading activation data from %s..." % arg_1)

        arg_2 = pd.read_csv(arg_1, sep='\t')
        arg_2.columns = [col.lower()
                               for col in list(arg_2.columns)]

        # Make sure all mandatory columns exist
        arg_4 = ['x', 'y', 'z', 'id', 'space']
        if (set(arg_4) - set(list(arg_2.columns))):
            logger.error(
                "At least one of mandatory columns (x, y, z, id, and space) "
                "is missing from input file.")
            return

        # Transform to target space where needed
        arg_5 = arg_2['space'].unique()
        arg_6 = arg_2[['x', 'y', 'z']].values
        for arg_7 in arg_5:
            if arg_7 != arg_0.transformer.target:
                arg_8 = arg_2['space'] == arg_7
                arg_6[arg_8] = arg_0.transformer.apply(arg_7, arg_6[arg_8])
        arg_2[['x', 'y', 'z']] = arg_6

        # xyz --> ijk
        arg_9 = pd.DataFrame(
            transformations.xyz_to_mat(arg_6), arg_3=['i', 'j', 'k'])
        arg_2 = pd.concat([arg_2, arg_9], axis=1)
        return arg_2


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = arg_0 . _session . request ( arg_1 , '{}/{}' . format ( arg_0 . _base_url , arg_2 ) , headers = arg_0 . _headers , ** arg_3 ) try : arg_4 . raise_for_status ( ) except HTTPError as e : logging . error ( arg_4 . content ) raise RestClientError ( e ) return arg_4

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Make HTTP request and return response object

            Args:
                method (str): GET, POST, PUT, DELETE
                url (str): path appended to the base_url to create request
                **kwargs: passed directly to a requests.request object
        """
        arg_4 = arg_0._session.request(arg_1,
                                     '{}/{}'.format(arg_0._base_url, arg_2),
                                     headers=arg_0._headers,
                                     **arg_3)

        try:
            arg_4.raise_for_status()
        except HTTPError as e:
            logging.error(arg_4.content)
            raise RestClientError(e)

        return arg_4


def Func ( arg_0 , arg_1 , arg_2 ) : arg_2 = arg_2 . replace ( '.' , '-' ) . replace ( '+' , '-' ) arg_0 . resource_labels . update ( { arg_1 : arg_2 } ) return arg_0

def Func(arg_0, arg_1, arg_2):
        """
        Append labels to provided Cluster Protobuf

        Labels must fit the regex ``[a-z]([-a-z0-9]*[a-z0-9])?`` (current
         airflow version string follows semantic versioning spec: x.y.z).

        :param cluster_proto: The proto to append resource_label airflow
            version to
        :type cluster_proto: google.cloud.container_v1.types.Cluster
        :param key: The key label
        :type key: str
        :param val:
        :type val: str
        :return: The cluster proto updated with new label
        """
        arg_2 = arg_2.replace('.', '-').replace('+', '-')
        arg_0.resource_labels.update({arg_1: arg_2})
        return arg_0


def Func ( arg_0 ) : arg_1 = InlineBackend . instance ( ) . figure_format arg_2 = print_figure ( arg_0 , arg_1 ) if arg_2 is None : return arg_3 = { 'png' : 'image/png' , 'svg' : 'image/svg+xml' } arg_4 = arg_3 [ arg_1 ] sys . stdout . flush ( ) sys . stderr . flush ( ) publish_display_data ( 'IPython.zmq.pylab.backend_inline.Func' , { arg_4 : arg_2 } )

def Func(arg_0):
    """Draw the given figure and send it as a PNG payload.
    """
    arg_1 = InlineBackend.instance().figure_format
    arg_2 = print_figure(arg_0, arg_1)
    # print_figure will return None if there's nothing to draw:
    if arg_2 is None:
        return
    arg_3 = { 'png' : 'image/png', 'svg' : 'image/svg+xml' }
    arg_4 = arg_3[arg_1]
    # flush text streams before sending figures, helps a little with output
    # synchronization in the console (though it's a bandaid, not a real sln)
    sys.stdout.flush(); sys.stderr.flush()
    publish_display_data(
        'IPython.zmq.pylab.backend_inline.Func',
        {arg_4 : arg_2}
    )

Draw the given figure and send it as a PNG payload .


def Func ( arg_0 , arg_1 ) : arg_2 = None try : arg_2 = open ( arg_0 . dot_file . absolute_path , "wb" ) arg_1 . Func_dot ( arg_2 ) finally : if arg_2 is not None : arg_2 . close ( ) return

def Func(arg_0, arg_1):
        """ Save to file.
        """
        arg_2 = None
        try:
            arg_2 = open(arg_0.dot_file.absolute_path, "wb")
            arg_1.Func_dot(arg_2)
        finally:
            if arg_2 is not None:
                arg_2.close()
#        self.m_time = getmtime(self.adaptee.absolute_path)
        return


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ arg_1 * w for w in arg_0 ] arg_5 = '' . join ( [ arg_3 * arg_1 , arg_2 , arg_3 * arg_1 ] ) return arg_5 . join ( arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Create the column dividers for a table with given column widths.

    col_widths: list of column widths
    horiz: the character to use for a horizontal divider
    vert: the character to use for a vertical divider
    padding: amount of padding to add to each side of a column
    """
    arg_4 = [arg_1 * w for w in arg_0]
    arg_5 = ''.join([arg_3 * arg_1, arg_2, arg_3 * arg_1])
    return arg_5.join(arg_4)

Create the column dividers for a table with given column widths .


def
Func
(
arg_0
)
:
arg_1
=
saga
.
job
.
Description
(
)
arg_1
.
executable
=
'python'
arg_1
.
arguments
=
[
'merge_trajs.py'
]
arg_1
.
output
=
"mysagajob_merge.stdout"
arg_1
.
error
=
"mysagajob_merge.stderr"
arg_1
.
working_directory
=
WORKING_DIR
arg_7
=
saga
.
job
.
Service
(
'ssh://'
+
ADDRESS
,
arg_0
=
arg_0
)
arg_8
=
arg_7
.
create_job
(
arg_1
)
print
(
"\n...starting job...\n"
)
arg_8
.
run
(
)
print
(
"Job ID    : %s"
%
(
arg_8
.
id
)
)
print
(
"Job State : %s"
%
(
arg_8
.
state
)
)
print
(
"\n...waiting for job...\n"
)
arg_8
.
wait
(
)
print
(
"Job State : %s"
%
(
arg_8
.
state
)
)
print
(
"Exitcode  : %s"
%
(
arg_8
.
exit_code
)
)

def Func(arg_0):
    """ Merges all trajectories found in the working directory """
    arg_1 = saga.job.Description()

    arg_1.executable      = 'python'
    arg_1.arguments       = ['merge_trajs.py']
    arg_1.output          = "mysagajob_merge.stdout"
    arg_1.error           = "mysagajob_merge.stderr"
    arg_1.working_directory = WORKING_DIR

    arg_7 = saga.job.Service('ssh://' + ADDRESS, arg_0=arg_0)
    arg_8 = arg_7.create_job(arg_1)
    print("\n...starting job...\n")

    # Now we can start our job.
    arg_8.run()
    print("Job ID    : %s" % (arg_8.id))
    print("Job State : %s" % (arg_8.state))

    print("\n...waiting for job...\n")
    # wait for the job to either finish or fail
    arg_8.wait()

    print("Job State : %s" % (arg_8.state))
    print("Exitcode  : %s" % (arg_8.exit_code))


(self, address, filters=None, startDate=None, endDate=None, types=None)

return self.search_point(lat,lng, filters=filters, startDate=startDate, endDate=endDate, types=types)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None):
        ''' Perform a catalog search over an address string

        Args:
            address: any address string
            filters: Array of filters.  Optional.  Example:
            [
                "(sensorPlatformName = 'WORLDVIEW01' OR sensorPlatformName ='QUICKBIRD02')",
                "cloudCover < 10",
                "offNadirAngle < 10"
            ]
            startDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            endDate: string.  Optional.  Example: "2004-01-01T00:00:00.000Z"
            types: Array of types to search for.  Optional.  Example (and default):  ["Acquisition"]

        Returns:
            catalog search resultset
        '''
        arg_6, arg_7 = arg_0.get_address_coords(arg_1)
        return arg_0.search_point(arg_6,arg_7, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5)


def Func(arg_0):
        """
        If there is an edge with one endpoint mapped, return it.
        Else return in the first edge
        """
        for arg_1 in arg_0.pending_program_edges:
            arg_2 = arg_1[0] in arg_0.prog2hw
            arg_3 = arg_1[1] in arg_0.prog2hw
            assert not (arg_2 and arg_3)
            if arg_2 or arg_3:
                return arg_1
        return arg_0.pending_program_edges[0]

If there is an edge with one endpoint mapped return it . Else return in the first edge


(
        filename, content, job_configs, view_configs=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
with
open
(
arg_0
,
'w'
)
as
h
:
h
.
write
(
arg_1
)
if
arg_3
:
arg_4
=
os
.
path
.
join
(
os
.
path
.
dirname
(
arg_0
)
,
'view_configs'
)
if
not
os
.
path
.
isdir
(
arg_4
)
:
os
.
makedirs
(
arg_4
)
for
arg_5
,
arg_6
in
arg_3
.
items
(
)
:
arg_7
=
os
.
path
.
join
(
arg_4
,
arg_5
)
with
open
(
arg_7
,
'w'
)
as
config_fh
:
config_fh
.
write
(
arg_6
)
arg_8
=
os
.
path
.
join
(
os
.
path
.
dirname
(
arg_0
)
,
'job_configs'
)
if
not
os
.
path
.
isdir
(
arg_8
)
:
os
.
makedirs
(
arg_8
)
arg_9
=
'%0'
+
str
(
len
(
str
(
len
(
arg_2
)
)
)
)
+
'd'
arg_10
=
0
for
arg_5
,
arg_6
in
arg_2
.
items
(
)
:
arg_10
+=
1
arg_7
=
os
.
path
.
join
(
arg_8
,
arg_9
%
arg_10
+
' '
+
arg_5
)
with
open
(
arg_7
,
'w'
)
as
config_fh
:
config_fh
.
write
(
arg_6
)

def Func(
        arg_0, arg_1, arg_2, arg_3=None):
    """Write out the groovy script and configs to file.

    This writes the reconfigure script to the file location
    and places the expanded configs in subdirectories 'view_configs' /
    'job_configs' that the script can then access when run.
    """
    with open(arg_0, 'w') as h:
        h.write(arg_1)

    if arg_3:
        arg_4 = os.path.join(os.path.dirname(arg_0), 'view_configs')
        if not os.path.isdir(arg_4):
            os.makedirs(arg_4)
        for arg_5, arg_6 in arg_3.items():
            arg_7 = os.path.join(arg_4, arg_5)
            with open(arg_7, 'w') as config_fh:
                config_fh.write(arg_6)

    arg_8 = os.path.join(os.path.dirname(arg_0), 'job_configs')
    if not os.path.isdir(arg_8):
        os.makedirs(arg_8)
    # prefix each config file with a serial number to maintain order
    arg_9 = '%0' + str(len(str(len(arg_2)))) + 'd'
    arg_10 = 0
    for arg_5, arg_6 in arg_2.items():
        arg_10 += 1
        arg_7 = os.path.join(
            arg_8,
            arg_9 % arg_10 + ' ' + arg_5)
        with open(arg_7, 'w') as config_fh:
            config_fh.write(arg_6)

Write out the groovy script and configs to file .


def Func ( arg_0 ) : if arg_0 . result : arg_1 = [ ] for arg_2 in arg_0 . result : try : arg_1 . append ( arg_2 . parse ( arg_0 . scope ) ) except SyntaxError as e : arg_0 . handle_error ( e , 0 ) arg_0 . result = list ( utility . flatten ( arg_1 ) )

def Func(arg_0):
        """ Post parse cycle. nodejs version allows calls to mixins
        not yet defined or known to the parser. We defer all calls
        to mixins until after first cycle when all names are known.
        """
        if arg_0.result:
            arg_1 = []
            for arg_2 in arg_0.result:
                try:
                    arg_1.append(arg_2.parse(arg_0.scope))
                except SyntaxError as e:
                    arg_0.handle_error(e, 0)
            arg_0.result = list(utility.flatten(arg_1))

Post parse cycle . nodejs version allows calls to mixins not yet defined or known to the parser . We defer all calls to mixins until after first cycle when all names are known .


(response, response_lambda, timeout=1, attempts=0)

def Func(arg_0, arg_1, arg_2=1, arg_3=0):
    """
    Takes an initial response, and a way to repeat the request that produced it and retries the request with an increasing sleep period between requests if rate limiting resposne codes are encountered.

    If more than 3 attempts are made, a RateLimitingException is raised

    :param response: A response from Citrination
    :type response: requests.Response
    :param response_lambda: a callable that runs the request that returned the
        response
    :type response_lambda: function
    :param timeout: the time to wait before retrying
    :type timeout: int
    :param attempts: the number of the retry being executed
    :type attempts: int
    """
    if arg_3 >= 3:
        raise RateLimitingException()
    if arg_0.status_code == 429:
        sleep(arg_2)
        arg_4 = arg_2 + 1
        arg_5 = arg_3 + 1
        return Func(arg_1(arg_2, arg_3), arg_1, arg_2=arg_4, arg_3=arg_5)
    return arg_0

Takes an initial response and a way to repeat the request that produced it and retries the request with an increasing sleep period between requests if rate limiting resposne codes are encountered .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_3
=
arg_1
=
escape
(
arg_1
)
if
arg_2
:
arg_1
=
'mailto:%s'
%
arg_1
return
'%s'
%
(
arg_1
,
arg_3
)

def Func(arg_0, arg_1, arg_2=False):
        """Rendering a given link or email address.

        :param link: link content or email address.
        :param is_email: whether this is an email or not.
        """
        arg_3 = arg_1 = escape(arg_1)
        if arg_2:
            arg_1 = 'mailto:%s' % arg_1
        return '%s' % (arg_1, arg_3)

Rendering a given link or email address .


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
bytes
)
:
raise
TypeError
(
"name must be a byte string"
)
elif
b"\0"
in
arg_1
:
raise
TypeError
(
"name must not contain NUL byte"
)
_lib
.
SSL_Func
(
arg_0
.
_ssl
,
arg_1
)

def Func(arg_0, arg_1):
        """
        Set the value of the servername extension to send in the client hello.

        :param name: A byte string giving the name.

        .. versionadded:: 0.13
        """
        if not isinstance(arg_1, bytes):
            raise TypeError("name must be a byte string")
        elif b"\0" in arg_1:
            raise TypeError("name must not contain NUL byte")

        # XXX I guess this can fail sometimes?
        _lib.SSL_Func(arg_0._ssl, arg_1)

Set the value of the servername extension to send in the client hello .


r"""
    Generates values from a dictionary

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . NoParam ) : if arg_2 is arg_3 . NoParam : for arg_5 in arg_1 : yield arg_0 [ arg_5 ] else : for arg_5 in arg_1 : yield arg_0 . get ( arg_5 , arg_2 )

def Func(arg_0, arg_1, arg_2=arg_3.NoParam):
    r"""
    Generates values from a dictionary

    Args:
        dict_ (Mapping): a dictionary to take from
        keys (Iterable): the keys to take
        default (object, optional): if specified uses default if keys are missing

    CommandLine:
        python -m ubelt.util_dict Func_gen

    Example:
        >>> import ubelt as ub
        >>> dict_ = {1: 'a', 2: 'b', 3: 'c'}
        >>> keys = [1, 2, 3, 4, 5]
        >>> result = list(ub.Func(dict_, keys, None))
        >>> assert result == ['a', 'b', 'c', None, None]

    Example:
        >>> import ubelt as ub
        >>> dict_ = {1: 'a', 2: 'b', 3: 'c'}
        >>> keys = [1, 2, 3, 4, 5]
        >>> try:
        >>>     print(list(ub.Func(dict_, keys)))
        >>>     raise AssertionError('did not get key error')
        >>> except KeyError:
        >>>     print('correctly got key error')
    """
    if arg_2 is arg_3.NoParam:
        for arg_5 in arg_1:
            yield arg_0[arg_5]
    else:
        for arg_5 in arg_1:
            yield arg_0.get(arg_5, arg_2)

r"""
    Generates values from a dictionary

    Args:
        dict_ (Mapping): a dictionary to take from
        keys (Iterable): the keys to take
        default (object, optional): if specified uses default if keys are missing

    CommandLine:
        python -m ubelt.util_dict dict_take_gen

    Example:
        >>> import ubelt as ub
        >>> dict_ = {1: 'a', 2: 'b', 3: 'c'}
        >>> keys = [1, 2, 3, 4, 5]
        >>> result = list(ub.dict_take(dict_, keys, None))
        >>> assert result == ['a', 'b', 'c', None, None]

    Example:
        >>> import ubelt as ub
        >>> dict_ = {1: 'a', 2: 'b', 3: 'c'}
        >>> keys = [1, 2, 3, 4, 5]
        >>> try:
        >>>     print(list(ub.dict_take(dict_, keys)))
        >>>     raise AssertionError('did not get key error')
        >>> except KeyError:
        >>>     print('correctly got key error')


(elapsed, display_amt, est_end, nLoops, count, numPrints)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
>
arg_3
:
arg_1
=
1
else
:
arg_1
=
round
(
arg_3
/
arg_5
)
if
arg_4
%
arg_1
==
0
:
arg_6
=
arg_0
/
arg_4
arg_2
=
round
(
arg_6
*
arg_3
)
(
arg_7
,
arg_8
,
arg_9
)
=
timeUnit
(
int
(
round
(
arg_0
)
)
,
int
(
round
(
arg_6
)
)
,
int
(
round
(
arg_2
)
)
)
print
"%s%%"
%
str
(
round
(
arg_4
/
float
(
arg_3
)
*
100
)
)
,
"@"
+
str
(
arg_4
)
,
arg_10
=
arg_9
[
0
]
arg_11
=
arg_9
[
1
]
if
str
(
arg_11
)
==
"secs"
:
arg_12
=
arg_10
round
(
arg_0
)
arg_13
=
"secs"
elif
str
(
arg_11
)
==
"mins"
:
arg_12
=
arg_10
round
(
arg_0
)
/
60
arg_13
=
"mins"
elif
str
(
arg_11
)
==
"hr"
:
arg_12
=
arg_10
round
(
arg_0
)
/
3600
arg_13
=
"hr"
print
"ETA: %s %s"
%
(
str
(
arg_12
)
,
arg_13
)
print
return

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    '''Displays time if verbose is true and count is within the display amount'''

    if arg_5 > arg_3:
        arg_1 = 1
    else:
        arg_1 = round(arg_3 / arg_5)

    if arg_4 % arg_1 == 0:

        arg_6 = arg_0 / arg_4
        arg_2 = round(arg_6 * arg_3)

        (arg_7,
         arg_8,
         arg_9) = timeUnit(int(round(arg_0)),
                              int(round(arg_6)),
                              int(round(arg_2)))

        print "%s%%" % str(round(arg_4 / float(arg_3) * 100)), "@" + str(arg_4),

        arg_10 = arg_9[0]
        arg_11 = arg_9[1]

        if str(arg_11) == "secs":
            arg_12 = arg_10 - round(arg_0)
            arg_13 = "secs"
        elif str(arg_11) == "mins":
            arg_12 = arg_10 - round(arg_0) / 60
            arg_13 = "mins"
        elif str(arg_11) == "hr":
            arg_12 = arg_10 - round(arg_0) / 3600
            arg_13 = "hr"

        print "ETA: %s %s" % (str(arg_12), arg_13)
        print

    return


return (entry['modelParams']['particleState'], modelId, entry['errScore'],
            entry['completed'], entry['matured'])

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _allResults [ arg_0 . _modelIDToIdx [ arg_1 ] ] return ( arg_2 [ 'modelParams' ] [ 'particleState' ] , arg_1 , arg_2 [ 'errScore' ] , arg_2 [ 'completed' ] , arg_2 [ 'matured' ] )

def Func(arg_0, arg_1):
    """Return particle info for a specific modelId.

    Parameters:
    ---------------------------------------------------------------------
    modelId:  which model Id

    retval:  (particleState, modelId, errScore, completed, matured)
    """
    arg_2 = arg_0._allResults[arg_0._modelIDToIdx[arg_1]]
    return (arg_2['modelParams']['particleState'], arg_1, arg_2['errScore'],
            arg_2['completed'], arg_2['matured'])

Return particle info for a specific modelId .


(self, x="x", y="y", z="z", vx="vx", vy="vy", vz="vz", vr="vr", pm_long="pm_long", pm_lat="pm_lat", distance=None)

def Func(arg_0, arg_1="x", arg_2="y", arg_3="z", arg_4="vx", arg_5="vy", arg_6="vz", arg_7="vr", arg_8="pm_long", arg_9="pm_lat", arg_10=None):
    """Concert velocities from a cartesian system to proper motions and radial velocities

    TODO: errors

    :param x: name of x column (input)
    :param y:         y
    :param z:         z
    :param vx:       vx
    :param vy:       vy
    :param vz:       vz
    :param vr: name of the column for the radial velocity in the r direction (output)
    :param pm_long: name of the column for the proper motion component in the longitude direction  (output)
    :param pm_lat: name of the column for the proper motion component in the latitude direction, positive points to the north pole (output)
    :param distance: Expression for distance, if not given defaults to sqrt(x**2+y**2+z**2), but if this column already exists, passing this expression may lead to a better performance
    :return:
    """
    if arg_10 is None:
        arg_10 = "sqrt({x}**2+{y}**2+{z}**2)".format(**locals())
    arg_11 = 4.74057
    arg_0.add_variable("k", arg_11, overwrite=False)
    arg_0.add_virtual_column(arg_7, "({x}*{vx}+{y}*{vy}+{z}*{vz})/{distance}".format(**locals()))
    arg_0.add_virtual_column(arg_8, "-({vx}*{y}-{x}*{vy})/sqrt({x}**2+{y}**2)/{distance}/k".format(**locals()))
    arg_0.add_virtual_column(arg_9, "-({z}*({x}*{vx}+{y}*{vy}) - ({x}**2+{y}**2)*{vz})/( ({x}**2+{y}**2+{z}**2) * sqrt({x}**2+{y}**2) )/k".format(**locals()))


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
_squeeze
(
arg_0
)
.
lower
(
)
arg_2
=
arg_0
.
replace
(
'('
,
''
)
arg_2
=
arg_2
.
replace
(
')'
,
''
)
arg_2
=
arg_2
.
replace
(
','
,
''
)
arg_2
=
arg_2
.
replace
(
"'"
,
'"'
)
arg_2
=
arg_2
.
replace
(
'\n'
,
' '
)
arg_2
=
arg_2
.
replace
(
'\t'
,
' '
)
arg_2
=
_squeeze
(
arg_2
)
arg_2
=
arg_2
.
split
(
' '
)
arg_2
=
[
arg_4
.
strip
(
)
for
arg_4
in
arg_2
]
arg_3
=
[
]
for
arg_4
in
arg_2
:
try
:
float
(
arg_4
)
except
ValueError
as
e
:
arg_3
.
append
(
arg_4
)
arg_5
=
[
]
for
arg_4
in
arg_3
:
if
not
(
arg_4
.
startswith
(
'"'
)
and
arg_4
.
endswith
(
'"'
)
)
:
arg_5
.
append
(
arg_4
)
arg_5
=
[
arg_4
for
arg_4
in
arg_5
if
len
(
arg_4
)
>
0
]
arg_6
=
set
(
arg_5
)
arg_7
=
SQLITE_ALLOWED_WORDS
+
arg_1
arg_8
=
set
(
arg_7
)
arg_9
=
list
(
arg_6
arg_8
)
if
len
(
arg_9
)
>
0
:
LOGWARNING
(
"provided SQL filter string '%s' "
"contains non-allowed keywords"
%
arg_0
)
return
else
:
return
arg_0

def Func(arg_0, arg_1):
    '''This validates the sqlitecurve filter string.

    This MUST be valid SQL but not contain any commands.

    '''

    # first, lowercase, then _squeeze to single spaces
    arg_2 = _squeeze(arg_0).lower()

    # replace shady characters
    arg_2 = arg_0.replace('(','')
    arg_2 = arg_2.replace(')','')
    arg_2 = arg_2.replace(',','')
    arg_2 = arg_2.replace("'",'"')
    arg_2 = arg_2.replace('\n',' ')
    arg_2 = arg_2.replace('\t',' ')
    arg_2 = _squeeze(arg_2)

    # split into words
    arg_2 = arg_2.split(' ')
    arg_2 = [arg_4.strip() for arg_4 in arg_2]

    # get rid of all numbers
    arg_3 = []
    for arg_4 in arg_2:
        try:
            float(arg_4)
        except ValueError as e:
            arg_3.append(arg_4)

    # get rid of everything within quotes
    arg_5 = []
    for arg_4 in arg_3:
        if not(arg_4.startswith('"') and arg_4.endswith('"')):
            arg_5.append(arg_4)
    arg_5 = [arg_4 for arg_4 in arg_5 if len(arg_4) > 0]

    # check the filterstring words against the allowed words
    arg_6 = set(arg_5)

    # generate the allowed word set for these LC columns
    arg_7 = SQLITE_ALLOWED_WORDS + arg_1
    arg_8 = set(arg_7)

    arg_9 = list(arg_6 - arg_8)

    # if there are words left over, then this filter string is suspicious
    if len(arg_9) > 0:

        # check if validatecheck contains an elem with % in it
        LOGWARNING("provided SQL filter string '%s' "
                   "contains non-allowed keywords" % arg_0)
        return None

    else:
        return arg_0

This validates the sqlitecurve filter string .


def Func ( arg_0 ) : if arg_0 . pplan . topology . HasField ( "topology_config" ) : return arg_0 . _get_dict_from_config ( arg_0 . pplan . topology . topology_config ) else : return { }

def Func(arg_0):
    """Returns the topology config"""
    if arg_0.pplan.topology.HasField("topology_config"):
      return arg_0._get_dict_from_config(arg_0.pplan.topology.topology_config)
    else:
      return {}


def Func():
    '''
    Parse command line options and launch the interpreter
    '''
    arg_0 = optparse.OptionParser(usage="%prog [options] <model_path> [another_model_path..]",
                                   version=xtuml.version.complete_string,
                                   formatter=optparse.TitledHelpFormatter())

    arg_0.add_option("-v", "--verbosity", dest='verbosity', action="count",
                      default=1, help="increase debug logging level")

    arg_0.add_option("-f", "--function", dest='function', action="store",
                      help="invoke function named NAME", metavar='NAME')

    arg_0.add_option("-c", "--component", dest='component', action="store",
                      help="look for the function in a component named NAME",
                      metavar='NAME', default=None)

    (arg_1, arg_2) = arg_0.parse_args()
    if len(arg_2) == 0 or not arg_1.function:
        arg_0.print_help()
        sys.exit(1)

    arg_3 = {
              0: logging.ERROR,
              1: logging.WARNING,
              2: logging.INFO,
              3: logging.DEBUG,
    }
    logging.basicConfig(level=arg_3.get(arg_1.verbosity, logging.DEBUG))

    from bridgepoint import ooaofooa
    arg_4 = ooaofooa.load_metamodel(arg_2)
    arg_5 = arg_4.select_any('C_C', where(Name=arg_1.component))
    arg_6 = ooaofooa.mk_component(arg_4, arg_5, derived_attributes=False)

    arg_7 = arg_6.find_symbol(arg_1.function)
    return arg_7()


def Func ( arg_0 , arg_1 ) : arg_2 = 0 for arg_3 , arg_4 in arg_1 . items ( ) : if arg_0 . match ( str ( arg_3 ) ) : arg_2 += arg_4 return arg_2

def Func(arg_0, arg_1):
        """ helper to aggregate codes by mask """
        arg_2 = 0
        for arg_3, arg_4 in arg_1.items():
            if arg_0.match(str(arg_3)):
                arg_2 += arg_4
        return arg_2


def Func(arg_0, **arg_1):
        """Starts a kernel process and configures the manager to use it.

        If random ports (port=0) are being used, this method must be called
        before the channels are created.

        Parameters:
        -----------
        launcher : callable, optional (default None)
             A custom function for launching the kernel process (generally a
             wrapper around ``entry_point.base_launch_kernel``). In most cases,
             it should not be necessary to use this parameter.

        **kw : optional
             See respective options for IPython and Python kernels.
        """
        if arg_0.ip not in LOCAL_IPS:
            raise RuntimeError("Can only launch a kernel on a local interface. "
                               "Make sure that the '*_address' attributes are "
                               "configured properly. "
                               "Currently valid addresses are: %s"%LOCAL_IPS
                               )

        # write connection file / get default ports
        arg_0.write_connection_file()

        arg_0._launch_args = arg_1.copy()
        arg_3 = arg_1.pop('launcher', None)
        if arg_3 is None:
            from ipkernel import arg_3
        arg_0.kernel = arg_3(fname=arg_0.connection_file, **arg_1)

Starts a kernel process and configures the manager to use it .


def Func ( arg_0 ) : if arg_0 . pinger : arg_0 . pinger . cancel ( ) arg_0 . pinger = None if getattr ( arg_0 , 'protocol' , None ) : arg_0 . protocol . Func ( )

def Func(arg_0):
        """Close the connection"""
        if arg_0.pinger:
            arg_0.pinger.cancel()
            arg_0.pinger = None
        if getattr(arg_0, 'protocol', None):
            arg_0.protocol.Func()


return self._assoc_or_create('failure', parent, child, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : return arg_0 . _assoc_or_create ( 'failure' , arg_1 , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Add a node to run on failure.

        =====API DOCS=====
        Add a node to run on failure.

        :param parent: Primary key of parent node to associate failure node to.
        :type parent: int
        :param child: Primary key of child node to be associated.
        :type child: int
        :param `**kwargs`: Fields used to create child node if ``child`` is not provided.
        :returns: Dictionary of only one key "changed", which indicates whether the association succeeded.
        :rtype: dict

        =====API DOCS=====
        """
        return arg_0._assoc_or_create('failure', arg_1, arg_2, **arg_3)


(bot_class, host, port, nick, channels=None, ssl=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
    """\
    Convenience function to start a bot on the given network, optionally joining
    some channels
    """
    arg_6 = IRCConnection(arg_1, arg_2, arg_3, arg_5)
    arg_7 = arg_0(arg_6)

    while 1:
        if not arg_6.connect():
            break

        arg_4 = arg_4 or []

        for arg_8 in arg_4:
            arg_6.join(arg_8)

        arg_6.enter_event_loop()

\ Convenience function to start a bot on the given network optionally joining some channels


Return a dictionary of circuit properties.

def Func ( arg_0 ) : arg_1 = { "size" : arg_0 . size ( ) , "depth" : arg_0 . depth ( ) , "width" : arg_0 . width ( ) , "bits" : arg_0 . num_cbits ( ) , "factors" : arg_0 . num_tensor_factors ( ) , "operations" : arg_0 . count_ops ( ) } return arg_1

def Func(arg_0):
        """Return a dictionary of circuit Func."""
        arg_1 = {"size": arg_0.size(),
                   "depth": arg_0.depth(),
                   "width": arg_0.width(),
                   "bits": arg_0.num_cbits(),
                   "factors": arg_0.num_tensor_factors(),
                   "operations": arg_0.count_ops()}
        return arg_1

Return a dictionary of circuit properties .


(self, x=None, y=None, ildj=None, kwargs=None, mapping=None)

return _Mapping(
        x=self._merge(self.x, mapping.x),
        y=self._merge(self.y, mapping.y),
        ildj=self._merge(self.ildj, mapping.ildj),
        kwargs=self._merge(self.kwargs, mapping.kwargs, use_equals=True))

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None):
    """Returns new _Mapping with args Funcd with self.

    Args:
      x: `Tensor` or None. Input to forward; output of inverse.
      y: `Tensor` or None. Input to inverse; output of forward.
      ildj: `Tensor`. This is the (un-reduce_sum'ed) inverse log det jacobian.
      kwargs: Python dictionary. Extra args supplied to forward/inverse/etc
        functions.
      mapping: Instance of _Mapping to Func. Can only be specified if no other
        arg is specified.

    Returns:
      mapping: New instance of `_Mapping` which has inputs Funcd with self.

    Raises:
      ValueError: if mapping and any other arg is not `None`.
    """
    if arg_5 is None:
      arg_5 = _Mapping(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)
    elif any(arg_6 is not None for arg_6 in [arg_1, arg_2, arg_3, arg_4]):
      raise ValueError("Cannot simultaneously specify mapping and individual "
                       "arguments.")

    return _Mapping(
        arg_1=arg_0._Func(arg_0.x, arg_5.x),
        arg_2=arg_0._Func(arg_0.y, arg_5.y),
        arg_3=arg_0._Func(arg_0.ildj, arg_5.ildj),
        arg_4=arg_0._Func(arg_0.kwargs, arg_5.kwargs, use_equals=True))

Returns new _Mapping with args merged with self.

    Args:
      x: `Tensor` or None. Input to forward; output of inverse.
      y: `Tensor` or None. Input to inverse; output of forward.
      ildj: `Tensor`. This is the (un-reduce_sum'ed) inverse log det jacobian.
      kwargs: Python dictionary. Extra args supplied to forward/inverse/etc
        functions.
      mapping: Instance of _Mapping to merge. Can only be specified if no other
        arg is specified.

    Returns:
      mapping: New instance of `_Mapping` which has inputs merged with self.

    Raises:
      ValueError: if mapping and any other arg is not `None`.

Returns new _Mapping with args merged with self .


def Func(arg_0):
    """docstring for Func"""
    arg_1 = get_file_handle(arg_0)
    arg_2 = parse_cytoband(arg_1)

    print("Check some coordinates:")

    print("checking chrom 1 pos 2")
    arg_3 = arg_2['1'][2]
    for arg_4 in arg_3:
        print(arg_4)
        print(arg_4.begin)
        print(arg_4.end)
        print(arg_4.data)
        # print(interval.__dict__)
    print(arg_2['1'][2])

    print("checking chrom 8 pos 101677777")
    print(arg_2['8'][101677777])

    print("checking chrom X pos 4200000 - 6000000")
    print(arg_2['X'][4200000:6000000])


def Func ( arg_0 , arg_1 ) : arg_0 . _section = arg_0 . _INITIAL_SECTION arg_0 . _last_header = '' if arg_1 in ( 'if' , 'ifdef' , 'ifndef' ) : arg_0 . include_list . append ( [ ] ) elif arg_1 in ( 'else' , 'elif' ) : arg_0 . include_list [ - 1 ] = [ ]

def Func(arg_0, arg_1):
    """Reset section checking for preprocessor directive.

    Args:
      directive: preprocessor directive (e.g. "if", "else").
    """
    # The name of the current section.
    arg_0._section = arg_0._INITIAL_SECTION
    # The path of last found header.
    arg_0._last_header = ''

    # Update list of includes.  Note that we never pop from the
    # include list.
    if arg_1 in ('if', 'ifdef', 'ifndef'):
      arg_0.include_list.append([])
    elif arg_1 in ('else', 'elif'):
      arg_0.include_list[-1] = []

Reset section checking for preprocessor directive .


def Func ( arg_0 ) : try : arg_1 = models . EmailAddress . objects . get ( arg_1 = arg_0 . validated_data [ "email" ] , is_verified = True ) except models . EmailAddress . DoesNotExist : return None arg_2 = models . PasswordResetToken . objects . create ( arg_1 = arg_1 ) arg_2 . send ( ) return arg_2

def Func(arg_0):
        """
        Send out a password reset if the provided data is valid.

        If the provided email address exists and is verified, a reset
        email is sent to the address.

        Returns:
            The password reset token if it was returned and ``None``
            otherwise.
        """
        try:
            arg_1 = models.EmailAddress.objects.get(
                arg_1=arg_0.validated_data["email"], is_verified=True
            )
        except models.EmailAddress.DoesNotExist:
            return None

        arg_2 = models.PasswordResetToken.objects.create(arg_1=arg_1)
        arg_2.send()

        return arg_2

Send out a password reset if the provided data is valid .


(self, cell, block=None, groupby='type', save_name=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
'type'
,
arg_4
=
)
:
arg_2
=
arg_0
.
view
.
block
if
arg_2
is
else
arg_2
arg_5
=
"Parallel"
if
arg_2
else
"Async parallel"
arg_6
=
arg_0
.
view
.
targets
if
isinstance
(
arg_6
,
list
)
and
len
(
arg_6
)
>
10
:
arg_7
=
str
(
arg_6
[
:
4
]
)
[
:
1
]
+
', ..., '
+
str
(
arg_6
[
4
:
]
)
[
1
:
]
else
:
arg_7
=
str
(
arg_6
)
if
arg_0
.
verbose
:
print
arg_5
+
" execution on engine(s): %s"
%
arg_7
arg_8
=
arg_0
.
view
.
execute
(
arg_1
,
silent
=
False
,
arg_2
=
False
)
arg_0
.
last_result
=
arg_8
if
arg_4
:
arg_0
.
shell
.
user_ns
[
arg_4
]
=
arg_8
if
arg_2
:
arg_8
.
get
(
)
arg_8
.
display_outputs
(
arg_3
)
else
:
return
arg_8

def Func(arg_0, arg_1, arg_2=None, arg_3='type', arg_4=None):
        """implementation used by %px and %%parallel"""

        # defaults:
        arg_2 = arg_0.view.block if arg_2 is None else arg_2

        arg_5 = "Parallel" if arg_2 else "Async parallel"

        arg_6 = arg_0.view.targets
        if isinstance(arg_6, list) and len(arg_6) > 10:
            arg_7 = str(arg_6[:4])[:-1] + ', ..., ' + str(arg_6[-4:])[1:]
        else:
            arg_7 = str(arg_6)
        if arg_0.verbose:
            print arg_5 + " execution on engine(s): %s" % arg_7

        arg_8 = arg_0.view.execute(arg_1, silent=False, arg_2=False)
        arg_0.last_result = arg_8

        if arg_4:
            arg_0.shell.user_ns[arg_4] = arg_8

        if arg_2:
            arg_8.get()
            arg_8.display_outputs(arg_3)
        else:
            # return AsyncResult only on non-blocking submission
            return arg_8


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_0 . set ( arg_0 . node_ids . to_series ( ) , name = 'counter' ) arg_4 = arg_0 . aggregate ( arg_1 , type = 'count' , arg_3 = arg_3 , name = 'counter' ) return np . array ( arg_4 [ arg_4 < arg_2 ] . index )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Identify nodes that are connected to fewer than some threshold
        of other nodes within a given distance.

        Parameters
        ----------
        impedance : float
            Distance within which to search for other connected nodes. This
            will usually be a distance unit in meters however if you have
            customized the impedance this could be in other units such as
            utility or time etc.
        count : int
            Threshold for connectivity. If a node is connected to fewer
            than this many nodes within `impedance` it will be identified
            as "low connectivity".
        imp_name : string, optional
            The impedance name to use for the aggregation on this network.
            Must be one of the impedance names passed in the constructor of
            this object.  If not specified, there must be only one impedance
            passed in the constructor, which will be used.

        Returns
        -------
        node_ids : array
            List of "low connectivity" node IDs.

        """
        # set a counter variable on all nodes
        arg_0.set(arg_0.node_ids.to_series(), name='counter')

        # count nodes within impedance range
        arg_4 = arg_0.aggregate(
            arg_1, type='count', arg_3=arg_3, name='counter')

        return np.array(arg_4[arg_4 < arg_2].index)

Identify nodes that are connected to fewer than some threshold of other nodes within a given distance .


(
        data_path, target_path, vocabulary_path, tokenizer=None, normalize_digits=True, UNK_ID=3,
        _DIGIT_RE=re.compile(br"\d")
)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
True
,
arg_5
=
3
,
arg_6
=
arg_7
.
compile
(
br"\d"
)
)
:
if
not
gfile
.
Exists
(
arg_1
)
:
tl
.
logging
.
info
(
"Tokenizing data in %s"
%
arg_0
)
arg_9
,
arg_10
=
initialize_vocabulary
(
arg_2
)
with
gfile
.
GFile
(
arg_0
,
mode
=
"rb"
)
as
data_file
:
with
gfile
.
GFile
(
arg_1
,
mode
=
"w"
)
as
tokens_file
:
arg_11
=
0
for
arg_12
in
data_file
:
arg_11
+=
1
if
arg_11
%
100000
==
0
:
tl
.
logging
.
info
(
"  tokenizing line %d"
%
arg_11
)
arg_13
=
sentence_to_token_ids
(
arg_12
,
arg_9
,
arg_3
,
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
)
tokens_file
.
write
(
" "
.
join
(
[
str
(
arg_14
)
for
arg_14
in
arg_13
]
)
+
"\n"
)
else
:
tl
.
logging
.
info
(
"Target path %s exists"
%
arg_1
)

def Func(
        arg_0, arg_1, arg_2, arg_3=None, arg_4=True, arg_5=3,
        arg_6=arg_7.compile(br"\d")
):
    """Tokenize data file and turn into token-ids using given vocabulary file.

    This function loads data line-by-line from data_path, calls the above
    sentence_to_token_ids, and saves the result to target_path. See comment
    for sentence_to_token_ids on the details of token-ids format.

    Parameters
    -----------
    data_path : str
        Path to the data file in one-sentence-per-line format.
    target_path : str
        Path where the file with token-ids will be created.
    vocabulary_path : str
        Path to the vocabulary file.
    tokenizer : function
        A function to use to tokenize each sentence. If None, ``basic_tokenizer`` will be used.
    normalize_digits : boolean
        If true, all digits are replaced by 0.

    References
    ----------
    - Code from ``/tensorflow/models/rnn/translation/data_utils.py``

    """
    if not gfile.Exists(arg_1):
        tl.logging.info("Tokenizing data in %s" % arg_0)
        arg_9, arg_10 = initialize_vocabulary(arg_2)
        with gfile.GFile(arg_0, mode="rb") as data_file:
            with gfile.GFile(arg_1, mode="w") as tokens_file:
                arg_11 = 0
                for arg_12 in data_file:
                    arg_11 += 1
                    if arg_11 % 100000 == 0:
                        tl.logging.info("  tokenizing line %d" % arg_11)
                    arg_13 = sentence_to_token_ids(
                        arg_12, arg_9, arg_3, arg_4, arg_5=arg_5, arg_6=arg_6
                    )
                    tokens_file.write(" ".join([str(arg_14) for arg_14 in arg_13]) + "\n")
    else:
        tl.logging.info("Target path %s exists" % arg_1)

Tokenize data file and turn into token - ids using given vocabulary file .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 not in arg_0 . conf : arg_0 . conf [ arg_2 ] = arg_1 [ arg_2 ] else : for arg_4 in arg_1 [ arg_2 ] : arg_0 . conf [ arg_2 ] [ arg_4 ] = arg_1 [ arg_2 ] [ arg_4 ]

def Func(arg_0, arg_1):
        """Add new configuration to self.conf.

        Adds configuration parameters in new_con to self.conf.
        If they already existed in conf, overwrite them.

        :param new_conf: new configuration, to add
        """

        for arg_2 in arg_1:
            if arg_2 not in arg_0.conf:
                arg_0.conf[arg_2] = arg_1[arg_2]
            else:
                for arg_4 in arg_1[arg_2]:
                    arg_0.conf[arg_2][arg_4] = arg_1[arg_2][arg_4]


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the QueryRequestPayload object to a stream.

        Args:
            output_buffer (Stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidField: Raised if the query functions are not defined.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._query_functions:
            for arg_7 in arg_0._query_functions:
                arg_7.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidField(
                "The Query request payload is missing the query functions "
                "field."
            )

        arg_0.length = arg_6.length()
        super(QueryRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the QueryRequestPayload object to a stream.

        Args:
            output_buffer (Stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidField: Raised if the query functions are not defined.

Write the data encoding the QueryRequestPayload object to a stream .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Register the old ID and symbol for a warning that was renamed.

        This allows users to keep using the old ID/symbol in suppressions.
        """
        arg_4 = arg_0.get_message_definitions(arg_3)[0]
        arg_4.old_names.append((arg_1, arg_2))
        arg_0._register_alternative_name(arg_4, arg_1, arg_2)

Register the old ID and symbol for a warning that was renamed .