(x,
                             dims,
                             layer_fn=tf.compat.v1.layers.dense,
                             loc_fn=lambda x: x,
                             scale_fn=tril_with_diag_softplus_and_shift,
                             name=None)

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . compat . v1 . layers . dense , arg_8 = lambda arg_0 : arg_0 , arg_9 = arg_10 , arg_11 = None ) : with arg_3 . compat . v1 . name_scope ( arg_11 , 'Func' , [ arg_0 , arg_1 ] ) : arg_0 = arg_3 . convert_to_tensor ( value = arg_0 , arg_11 = 'x' ) arg_0 = arg_2 ( arg_0 , arg_1 + arg_1 * ( arg_1 + 1 ) // 2 ) return tfd . MultivariateNormalTriL ( loc = arg_8 ( arg_0 [ ... , : arg_1 ] ) , scale_tril = arg_9 ( arg_0 [ ... , arg_1 : ] ) )

def Func(arg_0,
                             arg_1,
                             arg_2=arg_3.compat.v1.layers.dense,
                             arg_8=lambda arg_0: arg_0,
                             arg_9=arg_10,
                             arg_11=None):
  """Constructs a trainable `tfd.MultivariateNormalTriL` distribution.

  This function creates a MultivariateNormal (MVN) with lower-triangular scale
  matrix. By default the MVN is parameterized via affine transformation of input
  tensor `x`. Using default args, this function is mathematically equivalent to:

  ```none
  Y = MVN(loc=matmul(W, x) + b,
          scale_tril=f(reshape_tril(matmul(M, x) + c)))

  where,
    W in R^[d, n]
    M in R^[d*(d+1)/2, n]
    b in R^d
    c in R^d
    f(S) = set_diag(S, softplus(matrix_diag_part(S)) + 1e-5)
  ```

  Observe that `f` makes the diagonal of the triangular-lower scale matrix be
  positive and no smaller than `1e-5`.

  #### Examples

  ```python
  # This example fits a multilinear regression loss.
  import tensorflow as tf
  import tensorflow_probability as tfp

  # Create fictitious training data.
  dtype = np.float32
  n = 3000    # number of samples
  x_size = 4  # size of single x
  y_size = 2  # size of single y
  def make_training_data():
    np.random.seed(142)
    x = np.random.randn(n, x_size).astype(dtype)
    w = np.random.randn(x_size, y_size).astype(dtype)
    b = np.random.randn(1, y_size).astype(dtype)
    true_mean = np.tensordot(x, w, axes=[[-1], [0]]) + b
    noise = np.random.randn(n, y_size).astype(dtype)
    y = true_mean + noise
    return y, x
  y, x = make_training_data()

  # Build TF graph for fitting MVNTriL maximum likelihood estimator.
  mvn = tfp.trainable_distributions.Func(x, dims=y_size)
  loss = -tf.reduce_mean(mvn.log_prob(y))
  train_op = tf.train.AdamOptimizer(learning_rate=2.**-3).minimize(loss)
  mse = tf.reduce_mean(tf.squared_difference(y, mvn.mean()))
  init_op = tf.global_variables_initializer()

  # Run graph 1000 times.
  num_steps = 1000
  loss_ = np.zeros(num_steps)   # Style: `_` to indicate sess.run result.
  mse_ = np.zeros(num_steps)
  with tf.Session() as sess:
    sess.run(init_op)
    for it in xrange(loss_.size):
      _, loss_[it], mse_[it] = sess.run([train_op, loss, mse])
      if it % 200 == 0 or it == loss_.size - 1:
        print("iteration:{}  loss:{}  mse:{}".format(it, loss_[it], mse_[it]))

  # ==> iteration:0    loss:38.2020797729  mse:4.17175960541
  #     iteration:200  loss:2.90179634094  mse:0.990987896919
  #     iteration:400  loss:2.82727336884  mse:0.990926623344
  #     iteration:600  loss:2.82726788521  mse:0.990926682949
  #     iteration:800  loss:2.82726788521  mse:0.990926682949
  #     iteration:999  loss:2.82726788521  mse:0.990926682949
  ```

  Args:
    x: `Tensor` with floating type. Must have statically defined rank and
      statically known right-most dimension.
    dims: Scalar, `int`, `Tensor` indicated the MVN event size, i.e., the
      created MVN will be distribution over length-`dims` vectors.
    layer_fn: Python `callable` which takes input `x` and `int` scalar `d` and
      returns a transformation of `x` with shape
      `tf.concat([tf.shape(x)[:-1], [d]], axis=0)`.
      Default value: `tf.layers.dense`.
    loc_fn: Python `callable` which transforms the `loc` parameter. Takes a
      (batch of) length-`dims` vectors and returns a `Tensor` of same shape and
      `dtype`.
      Default value: `lambda x: x`.
    scale_fn: Python `callable` which transforms the `scale` parameters. Takes a
      (batch of) length-`dims * (dims + 1) / 2` vectors and returns a
      lower-triangular `Tensor` of same batch shape with rightmost dimensions
      having shape `[dims, dims]`.
      Default value: `tril_with_diag_softplus_and_shift`.
    name: A `name_scope` name for operations created by this function.
      Default value: `None` (i.e., "Func").

  Returns:
    mvntril: An instance of `tfd.MultivariateNormalTriL`.
  """
  with arg_3.compat.v1.name_scope(arg_11, 'Func', [arg_0, arg_1]):
    arg_0 = arg_3.convert_to_tensor(value=arg_0, arg_11='x')
    arg_0 = arg_2(arg_0, arg_1 + arg_1 * (arg_1 + 1) // 2)
    return tfd.MultivariateNormalTriL(
        loc=arg_8(arg_0[..., :arg_1]),
        scale_tril=arg_9(arg_0[..., arg_1:]))

Constructs a trainable `tfd.MultivariateNormalTriL` distribution.

  This function creates a MultivariateNormal (MVN) with lower-triangular scale
  matrix. By default the MVN is parameterized via affine transformation of input
  tensor `x`. Using default args, this function is mathematically equivalent to:

  ```none
  Y = MVN(loc=matmul(W, x) + b,
          scale_tril=f(reshape_tril(matmul(M, x) + c)))

  where,
    W in R^[d, n]
    M in R^[d*(d+1)/2, n]
    b in R^d
    c in R^d
    f(S) = set_diag(S, softplus(matrix_diag_part(S)) + 1e-5)
  ```

  Observe that `f` makes the diagonal of the triangular-lower scale matrix be
  positive and no smaller than `1e-5`.

  #### Examples

  ```python
  # This example fits a multilinear regression loss.
  import tensorflow as tf
  import tensorflow_probability as tfp

  # Create fictitious training data.
  dtype = np.float32
  n = 3000    # number of samples
  x_size = 4  # size of single x
  y_size = 2  # size of single y
  def make_training_data():
    np.random.seed(142)
    x = np.random.randn(n, x_size).astype(dtype)
    w = np.random.randn(x_size, y_size).astype(dtype)
    b = np.random.randn(1, y_size).astype(dtype)
    true_mean = np.tensordot(x, w, axes=[[-1], [0]]) + b
    noise = np.random.randn(n, y_size).astype(dtype)
    y = true_mean + noise
    return y, x
  y, x = make_training_data()

  # Build TF graph for fitting MVNTriL maximum likelihood estimator.
  mvn = tfp.trainable_distributions.multivariate_normal_tril(x, dims=y_size)
  loss = -tf.reduce_mean(mvn.log_prob(y))
  train_op = tf.train.AdamOptimizer(learning_rate=2.**-3).minimize(loss)
  mse = tf.reduce_mean(tf.squared_difference(y, mvn.mean()))
  init_op = tf.global_variables_initializer()

  # Run graph 1000 times.
  num_steps = 1000
  loss_ = np.zeros(num_steps)   # Style: `_` to indicate sess.run result.
  mse_ = np.zeros(num_steps)
  with tf.Session() as sess:
    sess.run(init_op)
    for it in xrange(loss_.size):
      _, loss_[it], mse_[it] = sess.run([train_op, loss, mse])
      if it % 200 == 0 or it == loss_.size - 1:
        print("iteration:{}  loss:{}  mse:{}".format(it, loss_[it], mse_[it]))

  # ==> iteration:0    loss:38.2020797729  mse:4.17175960541
  #     iteration:200  loss:2.90179634094  mse:0.990987896919
  #     iteration:400  loss:2.82727336884  mse:0.990926623344
  #     iteration:600  loss:2.82726788521  mse:0.990926682949
  #     iteration:800  loss:2.82726788521  mse:0.990926682949
  #     iteration:999  loss:2.82726788521  mse:0.990926682949
  ```

  Args:
    x: `Tensor` with floating type. Must have statically defined rank and
      statically known right-most dimension.
    dims: Scalar, `int`, `Tensor` indicated the MVN event size, i.e., the
      created MVN will be distribution over length-`dims` vectors.
    layer_fn: Python `callable` which takes input `x` and `int` scalar `d` and
      returns a transformation of `x` with shape
      `tf.concat([tf.shape(x)[:-1], [d]], axis=0)`.
      Default value: `tf.layers.dense`.
    loc_fn: Python `callable` which transforms the `loc` parameter. Takes a
      (batch of) length-`dims` vectors and returns a `Tensor` of same shape and
      `dtype`.
      Default value: `lambda x: x`.
    scale_fn: Python `callable` which transforms the `scale` parameters. Takes a
      (batch of) length-`dims * (dims + 1) / 2` vectors and returns a
      lower-triangular `Tensor` of same batch shape with rightmost dimensions
      having shape `[dims, dims]`.
      Default value: `tril_with_diag_softplus_and_shift`.
    name: A `name_scope` name for operations created by this function.
      Default value: `None` (i.e., "multivariate_normal_tril").

  Returns:
    mvntril: An instance of `tfd.MultivariateNormalTriL`.

Constructs a trainable tfd . MultivariateNormalTriL distribution .


def Func(arg_0, arg_1=True):
        """ update the list of completion and hilight the currently selected completion """
        arg_0._sliding_interval.current = arg_0._index[0]
        arg_4 = None
        arg_5 = None
        if arg_0._sliding_interval.start > 0 :
            arg_4 = '...'

        if arg_0._sliding_interval.stop < arg_0._sliding_interval._max:
            arg_5 = '...'
        arg_6 = arg_0._justified_items[\
                       arg_0._sliding_interval.start:\
                       arg_0._sliding_interval.stop+1\
                                       ]

        arg_0._console_widget._clear_temporary_buffer()
        if(arg_1):
            arg_7 = (arg_0._sliding_interval.nth, arg_0._index[1])
        else :
            arg_7 = None

        arg_8 = html_tableify(arg_6, select=arg_7, header=arg_4, footer=arg_5)
        arg_0._console_widget._fill_temporary_buffer(arg_0._old_cursor, arg_8, html=True)


def Func(arg_0, arg_1):
        """
        Runs the task with the given id.

        :type  task_id: integer
        :param task_id: The id of the Task object.
        """
        if arg_1 is None:
            raise WorkflowException(arg_0.spec, 'task_id is None')
        for arg_2 in arg_0.task_tree:
            if arg_2.id == arg_1:
                return arg_2.complete()
        arg_3 = 'A task with the given task_id (%s) was not found' % arg_1
        raise WorkflowException(arg_0.spec, arg_3)


def
Func
(
arg_0
,
arg_1
=
2
,
arg_2
=
1
)
:
if
arg_1
>
0
:
arg_3
=
[
''
,
''
,
'WARNING: '
,
'ERROR: '
,
'FATAL ERROR: '
]
io
.
stderr
.
write
(
'%s%s'
%
(
arg_3
[
arg_1
]
,
arg_0
)
)
if
arg_1
==
4
:
print
>>
io
.
stderr
,
'Exiting.\n'
sys
.
exit
(
arg_2
)

def Func(arg_0,arg_1=2,arg_2=1):
    """Standard Funcing printer. Gives formatting consistency.

    Output is sent to io.stderr (sys.stderr by default).

    Options:

    -level(2): allows finer control:
      0 -> Do nothing, dummy function.
      1 -> Print message.
      2 -> Print 'WARNING:' + message. (Default level).
      3 -> Print 'ERROR:' + message.
      4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).

    -exit_val (1): exit value returned by sys.exit() for a level 4
    Funcing. Ignored for all other levels."""

    if arg_1>0:
        arg_3 = ['','','WARNING: ','ERROR: ','FATAL ERROR: ']
        io.stderr.write('%s%s' % (arg_3[arg_1],arg_0))
        if arg_1 == 4:
            print >> io.stderr,'Exiting.\n'
            sys.exit(arg_2)

Standard warning printer. Gives formatting consistency.

    Output is sent to io.stderr (sys.stderr by default).

    Options:

    -level(2): allows finer control:
      0 -> Do nothing, dummy function.
      1 -> Print message.
      2 -> Print 'WARNING:' + message. (Default level).
      3 -> Print 'ERROR:' + message.
      4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).

    -exit_val (1): exit value returned by sys.exit() for a level 4
    warning. Ignored for all other levels.

Standard warning printer . Gives formatting consistency .


return ep.downside_risk(returns,
                            required_return=required_return,
                            period=period)

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """
    Determines the downside deviation below a threshold

    Parameters
    ----------
    returns : pd.Series or pd.DataFrame
        Daily returns of the strategy, noncumulative.
        - See full explanation in :func:`~pyfolio.timeseries.cum_returns`.
    required_return: float / series
        minimum acceptable return
    period : str, optional
        Defines the periodicity of the 'returns' data for purposes of
        annualizing. Can be 'monthly', 'weekly', or 'daily'.
        - Defaults to 'daily'.

    Returns
    -------
    depends on input type
    series ==> float
    DataFrame ==> np.array

        Annualized downside deviation
    """

    return ep.Func(arg_0,
                            arg_1=arg_1,
                            arg_2=arg_2)


def Func ( arg_0 , arg_1 = False ) : for arg_2 in sorted ( arg_0 . intervals ) if arg_1 else arg_0 . intervals : yield arg_2

def Func(arg_0, arg_1=False):
        """Give all the intervals or points.

        :param bool sort: Flag for yielding the intervals or points sorted.
        :yields: All the intervals
        """
        for arg_2 in sorted(arg_0.intervals) if arg_1 else arg_0.intervals:
            yield arg_2


def Func(arg_0, arg_1):
    '''Construct a cyclic transition matrix over `n_states`.

    The transition matrix will have the following properties:

        - `transition[i, i] = p`
        - `transition[i, i + 1] = (1 - p)`

    This type of transition matrix is appropriate for state spaces
    with cyclical structure, such as metrical position within a bar.
    For example, a song in 4/4 time has state transitions of the form

        1->{1, 2}, 2->{2, 3}, 3->{3, 4}, 4->{4, 1}.

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

    prob : float in [0, 1] or iterable, length=n_states
        If a scalar, this is the probability of a self-transition.

        If a vector of length `n_states`, `p[i]` is the probability of state
        `i`'s self-transition.

    Returns
    -------
    transition : np.ndarray [shape=(n_states, n_states)]
        The transition matrix

    Examples
    --------
    >>> librosa.sequence.Func(4, 0.9)
    array([[0.9, 0.1, 0. , 0. ],
           [0. , 0.9, 0.1, 0. ],
           [0. , 0. , 0.9, 0.1],
           [0.1, 0. , 0. , 0.9]])
    '''

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

    arg_2 = arg_5.zeros((arg_0, arg_0), dtype=arg_5.float)

    # if it's a float, make it a vector
    arg_1 = arg_5.asarray(arg_1, dtype=arg_5.float)

    if arg_1.ndim == 0:
        arg_1 = arg_5.tile(arg_1, arg_0)

    if arg_1.shape != (arg_0,):
        raise ParameterError('prob={} must have length equal to n_states={}'.format(arg_1, arg_0))

    if arg_5.any(arg_1 < 0) or arg_5.any(arg_1 > 1):
        raise ParameterError('prob={} must have values in the range [0, 1]'.format(arg_1))

    for arg_3, arg_4 in enumerate(arg_1):
        arg_2[arg_3, arg_5.mod(arg_3 + 1, arg_0)] = 1. - arg_4
        arg_2[arg_3, arg_3] = arg_4

    return arg_2

Construct a cyclic transition matrix over `n_states`.

    The transition matrix will have the following properties:

        - `transition[i, i] = p`
        - `transition[i, i + 1] = (1 - p)`

    This type of transition matrix is appropriate for state spaces
    with cyclical structure, such as metrical position within a bar.
    For example, a song in 4/4 time has state transitions of the form

        1->{1, 2}, 2->{2, 3}, 3->{3, 4}, 4->{4, 1}.

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

    prob : float in [0, 1] or iterable, length=n_states
        If a scalar, this is the probability of a self-transition.

        If a vector of length `n_states`, `p[i]` is the probability of state
        `i`'s self-transition.

    Returns
    -------
    transition : np.ndarray [shape=(n_states, n_states)]
        The transition matrix

    Examples
    --------
    >>> librosa.sequence.transition_cycle(4, 0.9)
    array([[0.9, 0.1, 0. , 0. ],
           [0. , 0.9, 0.1, 0. ],
           [0. , 0. , 0.9, 0.1],
           [0.1, 0. , 0. , 0.9]])

Construct a cyclic transition matrix over n_states .


def Func ( arg_0 ) : if not os . path . exists ( arg_0 ) : return dict ( ) with open ( arg_0 , 'r' , encoding = 'utf-8' ) as fp : return YAML ( ) . load ( stream = fp )

def Func(arg_0):
    """
    Load assets infomation from file

    Args:
        file_name: file name

    Returns:
        dict
    """
    if not os.path.exists(arg_0): return dict()

    with open(arg_0, 'r', encoding='utf-8') as fp:
        return YAML().load(stream=fp)


return GeneratedPyAST(
        node=ast.Name(id=val_temp_name, ctx=ast.Load()),
        dependencies=list(
            chain(
                val_ast.dependencies,
                [
                    ast.Assign(
                        targets=[ast.Name(id=val_temp_name, ctx=ast.Store())],
                        value=val_ast.node,
                    )
                ],
                target_ast.dependencies,
                [ast.Assign(targets=[target_ast.node], value=val_ast.node)],
            )
        ),
    )

def Func(arg_0: arg_1, arg_2: arg_3) -> GeneratedPyAST:
    """Return a Python AST Node for a `set!` expression."""
    assert arg_2.op == NodeOp.SET_BANG

    arg_4 = genname("set_bang_val")
    arg_5 = gen_py_ast(arg_0, arg_2.val)

    arg_6 = arg_2.target
    assert isinstance(
        arg_6, (HostField, Local, VarRef)
    ), f"invalid set! target type {type(target)}"

    if isinstance(arg_6, HostField):
        arg_7 = _interop_prop_to_py_ast(arg_0, arg_6, is_assigning=True)
    elif isinstance(arg_6, VarRef):
        arg_7 = _var_sym_to_py_ast(arg_0, arg_6, is_assigning=True)
    elif isinstance(arg_6, Local):
        arg_7 = _local_sym_to_py_ast(arg_0, arg_6, is_assigning=True)
    else:  # pragma: no cover
        raise GeneratorException(
            f"invalid set! target type {type(target)}", lisp_ast=arg_6
        )

    return GeneratedPyAST(
        arg_2=ast.Name(id=arg_4, arg_0=ast.Load()),
        dependencies=list(
            chain(
                arg_5.dependencies,
                [
                    ast.Assign(
                        targets=[ast.Name(id=arg_4, arg_0=ast.Store())],
                        value=arg_5.node,
                    )
                ],
                arg_7.dependencies,
                [ast.Assign(targets=[arg_7.node], value=arg_5.node)],
            )
        ),
    )

Return a Python AST Node for a set! expression .


def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 . tree . find_clades ( order = 'preorder' ) : if arg_2 . up is None : continue arg_1 -= arg_2 . branch_length_interpolator ( arg_2 . branch_length ) if arg_0 . aln : arg_1 += arg_0 . gtr . sequence_logLH ( arg_0 . tree . root . cseq , pattern_multiplicity = arg_0 . multiplicity ) return arg_1

def Func(arg_0):
        '''
        Return the likelihood of the data given the current branch length in the tree
        '''
        arg_1 = 0
        for arg_2 in arg_0.tree.find_clades(order='preorder'):  # sum the likelihood contributions of all branches
            if arg_2.up is None: # root node
                continue
            arg_1 -= arg_2.branch_length_interpolator(arg_2.branch_length)

        # add the root sequence LH and return
        if arg_0.aln:
            arg_1 += arg_0.gtr.sequence_logLH(arg_0.tree.root.cseq, pattern_multiplicity=arg_0.multiplicity)
        return arg_1


def Func ( arg_0 ) : if arg_0 . _executed : arg_0 . fetchall ( ) del arg_0 . messages [ : ] arg_1 = arg_0 . _get_db ( ) arg_2 = arg_1 . next_result ( ) if arg_2 == - 1 : return None arg_0 . _do_get_result ( ) arg_0 . _post_get_result ( ) arg_0 . _warning_check ( ) return 1

def Func(arg_0):
        """Advance to the next result set.

        Returns None if there are no more result sets.
        """
        if arg_0._executed:
            arg_0.fetchall()
        del arg_0.messages[:]

        arg_1 = arg_0._get_db()
        arg_2 = arg_1.next_result()
        if arg_2 == -1:
            return None
        arg_0._do_get_result()
        arg_0._post_get_result()
        arg_0._warning_check()
        return 1


return SearchResult(self, self._api.get(self._href, **{"filter[]": filters}))

def Func ( arg_0 , arg_1 ) : return SearchResult ( arg_0 , arg_0 . _api . get ( arg_0 . _href , ** { "filter[]" : arg_1 } ) )

def Func(arg_0, arg_1):
        """Sends all filters to the API.

        No fancy, just a wrapper. Any advanced functionality shall be implemented as another method.

        Args:
            filters: List of filters (strings)

        Returns: :py:class:`SearchResult`
        """
        return SearchResult(arg_0, arg_0._api.get(arg_0._href, **{"filter[]": arg_1}))


def
Func
(
arg_0
)
:
try
:
PolyaxonClient
(
)
.
user
.
Func_user
(
arg_0
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func user `{}`.'
.
format
(
arg_0
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Printer
.
print_success
(
"User `{}` was Funcd successfully."
.
format
(
arg_0
)
)

def Func(arg_0):
    """Delete a user.

    Example:

    \b
    ```bash
    $ polyaxon user Func david
    ```
    """
    try:
        PolyaxonClient().user.Func_user(arg_0)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func user `{}`.'.format(arg_0))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("User `{}` was Funcd successfully.".format(arg_0))

Delete a user.

    Example:

    \b
    ```bash
    $ polyaxon user delete david
    ```


def Func(arg_0, arg_1='127.0.0.1', arg_2=8080):
        """Run the application using a simple WSGI server.

        Arguments:
          host (str, optional): Host on which to listen.
          port (int, optional): Port number on which to listen.
        """
        from wsgiref import simple_server
        arg_0._server = simple_server.make_server(arg_1, arg_2, arg_0)
        arg_0._server.serve_forever()

Run the application using a simple WSGI server .


def Func ( arg_0 ) : arg_1 = topology_pb2 . Bolt ( ) arg_1 . comp . CopyFrom ( arg_0 . _get_base_component ( ) ) arg_0 . _add_in_streams ( arg_1 ) arg_0 . _add_out_streams ( arg_1 ) return arg_1

def Func(arg_0):
    """Returns Bolt protobuf message"""
    arg_1 = topology_pb2.Bolt()
    arg_1.comp.CopyFrom(arg_0._get_base_component())

    # Add streams
    arg_0._add_in_streams(arg_1)
    arg_0._add_out_streams(arg_1)
    return arg_1


def Func ( arg_0 ) : arg_1 = [ ] with open ( arg_0 , 'rb' ) as f : arg_2 = f . read ( blosc . MAX_BUFFERSIZE ) while len ( arg_2 ) > 0 : arg_1 . append ( blosc . decompress ( arg_2 ) ) arg_2 = f . read ( blosc . MAX_BUFFERSIZE ) return pkl . loads ( b"" . join ( arg_1 ) )

def Func(arg_0):
    """Decompress and Func."""
    arg_1 = []
    with open(arg_0, 'rb') as f:
        arg_2 = f.read(blosc.MAX_BUFFERSIZE)
        while len(arg_2) > 0:
            arg_1.append(blosc.decompress(arg_2))
            arg_2 = f.read(blosc.MAX_BUFFERSIZE)
    return pkl.loads(b"".join(arg_1))


def Func ( arg_0 , arg_1 ) : if arg_0 . must_train : arg_0 . train ( ) arg_2 = { } if arg_0 . train_thread and arg_0 . train_thread . is_alive ( ) else { i . name : i for i in arg_0 . intents . Func ( arg_1 , arg_0 . entities ) } arg_3 = tokenize ( arg_1 ) for arg_4 in arg_0 . padaos . Func ( arg_1 ) : arg_5 = arg_4 [ 'name' ] arg_2 [ arg_5 ] = MatchData ( arg_5 , arg_3 , matches = arg_4 [ 'entities' ] , conf = 1.0 ) return list ( arg_2 . values ( ) )

def Func(arg_0, arg_1):
        """
        Tests all the intents against the query and returns
        data on how well each one matched against the query

        Args:
            query (str): Input sentence to test against intents
        Returns:
            list<MatchData>: List of intent matches
        See calc_intent() for a description of the returned MatchData
        """
        if arg_0.must_train:
            arg_0.train()
        arg_2 = {} if arg_0.train_thread and arg_0.train_thread.is_alive() else {
            i.name: i for i in arg_0.intents.Func(arg_1, arg_0.entities)
        }
        arg_3 = tokenize(arg_1)
        for arg_4 in arg_0.padaos.Func(arg_1):
            arg_5 = arg_4['name']
            arg_2[arg_5] = MatchData(arg_5, arg_3, matches=arg_4['entities'], conf=1.0)
        return list(arg_2.values())


def Func(arg_0) -> Optional[Namespace]:
        """Remove the default namespace if it exists."""
        arg_1 = arg_0._get_default_namespace()

        if arg_1 is not None:
            for arg_2 in tqdm(arg_1.entries, desc=f'deleting entries in {self._get_namespace_name()}'):
                arg_0.session.delete(arg_2)
            arg_0.session.delete(arg_1)

            log.info('committing deletions')
            arg_0.session.commit()
            return arg_1

Remove the default namespace if it exists .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( ObtainLeaseResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . UNIQUE_IDENTIFIER , arg_6 ) : arg_0 . _unique_identifier = primitives . TextString ( tag = arg_3 . Tags . UNIQUE_IDENTIFIER ) arg_0 . _unique_identifier . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . LEASE_TIME , arg_6 ) : arg_0 . _lease_time = primitives . Interval ( tag = arg_3 . Tags . LEASE_TIME ) arg_0 . _lease_time . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . LAST_CHANGE_DATE , arg_6 ) : arg_0 . _last_change_date = primitives . DateTime ( tag = arg_3 . Tags . LAST_CHANGE_DATE ) arg_0 . _last_change_date . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the ObtainLease response payload and decode it
        into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded 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 decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.
        """
        super(ObtainLeaseResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_0._unique_identifier = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0.is_tag_next(arg_3.Tags.LEASE_TIME, arg_6):
            arg_0._lease_time = primitives.Interval(
                tag=arg_3.Tags.LEASE_TIME
            )
            arg_0._lease_time.Func(arg_6, arg_2=arg_2)
        if arg_0.is_tag_next(arg_3.Tags.LAST_CHANGE_DATE, arg_6):
            arg_0._last_change_date = primitives.DateTime(
                tag=arg_3.Tags.LAST_CHANGE_DATE
            )
            arg_0._last_change_date.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the ObtainLease response payload and decode it
        into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.

Read the data encoding the ObtainLease response payload and decode it into its constituent parts .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
for
arg_3
in
arg_1
:
arg_4
=
arg_1
[
arg_3
]
if
not
arg_4
.
get
(
'compounds'
)
:
continue
arg_5
=
pymongo
.
UpdateOne
(
{
'_id'
:
arg_4
[
'_id'
]
}
,
{
'$set'
:
{
'compounds'
:
arg_4
[
'compounds'
]
}
}
)
arg_2
.
append
(
arg_5
)
if
not
arg_2
:
return
try
:
arg_0
.
variant_collection
.
bulk_write
(
arg_2
,
ordered
=
False
)
except
BulkWriteError
as
err
:
LOG
.
warning
(
"Updating compounds failed"
)
raise
err

def Func(arg_0, arg_1):
        """Update the compound information for a bulk of variants in the database

            Args:
                bulk(dict): {'_id': scout.models.Variant}

        """
        arg_2 = []
        for arg_3 in arg_1:
            arg_4 = arg_1[arg_3]
            if not arg_4.get('compounds'):
                continue
            # Add a request to update compounds
            arg_5 = pymongo.UpdateOne(
                {'_id': arg_4['_id']},
                {
                    '$set': {
                        'compounds': arg_4['compounds']
                    }
                })
            arg_2.append(arg_5)

        if not arg_2:
            return

        try:
            arg_0.variant_collection.bulk_write(arg_2, ordered=False)
        except BulkWriteError as err:
            LOG.warning("Updating compounds failed")
            raise err


def Func ( arg_0 , arg_1 ) : class CustomCommand ( BaseCommand ) : arg_2 = arg_0 def run ( arg_3 ) : for arg_4 in arg_1 : subprocess . check_call ( arg_4 ) return CustomCommand

def Func(arg_0, arg_1):
    """Creates a custom setup.py command."""

    class CustomCommand(BaseCommand):
        arg_2 = arg_0

        def run(arg_3):
            for arg_4 in arg_1:
                subprocess.check_call(arg_4)

    return CustomCommand


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . frame ( ) if isinstance ( arg_2 , astroid . Module ) : arg_0 . add_message ( "global-at-module-level" , arg_1 = arg_1 ) return arg_3 = arg_2 . root ( ) arg_4 = True arg_5 = arg_1 . scope ( ) . locals for arg_6 in arg_1 . names : try : arg_7 = arg_3 . getattr ( arg_6 ) except astroid . NotFoundError : arg_7 = [ ] arg_8 = not any ( isinstance ( local , astroid . node_classes . Import ) for local in arg_5 . get ( arg_6 , ( ) ) ) if not arg_7 and arg_8 : arg_0 . add_message ( "global-variable-not-assigned" , args = arg_6 , arg_1 = arg_1 ) arg_4 = False continue for arg_9 in arg_7 : if ( isinstance ( arg_9 , astroid . AssignName ) and arg_9 . name in arg_3 . special_attributes ) : arg_0 . add_message ( "redefined-builtin" , args = arg_6 , arg_1 = arg_1 ) break if arg_9 . frame ( ) is arg_3 : break else : if arg_8 : arg_0 . add_message ( "global-variable-undefined" , args = arg_6 , arg_1 = arg_1 ) arg_4 = False if arg_4 : arg_0 . add_message ( "global-statement" , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """check names imported exists in the global scope"""
        arg_2 = arg_1.frame()
        if isinstance(arg_2, astroid.Module):
            arg_0.add_message("global-at-module-level", arg_1=arg_1)
            return

        arg_3 = arg_2.root()
        arg_4 = True
        arg_5 = arg_1.scope().locals
        for arg_6 in arg_1.names:
            try:
                arg_7 = arg_3.getattr(arg_6)
            except astroid.NotFoundError:
                # unassigned global, skip
                arg_7 = []

            arg_8 = not any(
                isinstance(local, astroid.node_classes.Import)
                for local in arg_5.get(arg_6, ())
            )
            if not arg_7 and arg_8:
                arg_0.add_message("global-variable-not-assigned", args=arg_6, arg_1=arg_1)
                arg_4 = False
                continue

            for arg_9 in arg_7:
                if (
                    isinstance(arg_9, astroid.AssignName)
                    and arg_9.name in arg_3.special_attributes
                ):
                    arg_0.add_message("redefined-builtin", args=arg_6, arg_1=arg_1)
                    break
                if arg_9.frame() is arg_3:
                    # module level assignment
                    break
            else:
                if arg_8:
                    # global undefined at the module scope
                    arg_0.add_message("global-variable-undefined", args=arg_6, arg_1=arg_1)
                    arg_4 = False

        if arg_4:
            arg_0.add_message("global-statement", arg_1=arg_1)


(source_name, source_path, dest_name, dest_path)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Copy a file from the source container to an intermediate staging
    area on the local filesystem, then from that staging area to the
    destination container.

    These moves take place without demotion for two reasons:
      1. There should be no permissions vulnerabilities with copying
         between containers because it is assumed the non-privileged
         user has full access to all Dusty containers.
      2. The temp dir created by mkdtemp is owned by the owner of the
         Dusty daemon process, so if we demoted our moves to/from that location
         they would encounter permission errors."""
    if not container_path_exists(arg_0, arg_1):
        raise RuntimeError('ERROR: Path {} does not exist inside container {}.'.format(arg_1, arg_0))
    arg_4 = os.path.join(tempfile.mkdtemp(), str(uuid.uuid1()))
    with _cleanup_path(arg_4):
        copy_to_local(arg_4, arg_0, arg_1, demote=False)
        copy_from_local(arg_4, arg_2, arg_3, demote=False)

Copy a file from the source container to an intermediate staging area on the local filesystem then from that staging area to the destination container .


return (self.peak - self.low) / (self.high - self.low)

def Func ( arg_0 ) : return ( arg_0 . peak - arg_0 . low ) / ( arg_0 . high - arg_0 . low )

def Func(arg_0):
    """Pdf evaluated at the peak."""
    return (arg_0.peak - arg_0.low) / (arg_0.high - arg_0.low)


def Func(arg_0, arg_1):
        """
        Retrieves the number of pull requests on a repo in the organization.
        """
        arg_2 = 0
        arg_3 = 0
        for arg_4 in arg_1.iter_pulls(state='all'):
            arg_0.pull_requests_json[arg_1.name].append(arg_4.to_json())
            if arg_4.closed_at is not None:
                arg_3 += 1
            else:
                arg_2 += 1
        return arg_2, arg_3

Retrieves the number of pull requests on a repo in the organization .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        '''Draws a curve relatively to the last point.
        '''
        if arg_0._path is None:
            raise ShoebotError(_("No current path. Use beginpath() first."))
        arg_0._path.Func(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6)

Draws a curve relatively to the last point .


return getattr(node_a, attr_name) == getattr(node_b, attr_name)

def Func ( arg_0 , arg_1 , arg_2 ) : return getattr ( arg_0 , arg_2 ) == getattr ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """
    Check equality of nodes based on the comparison of their attributes named attr_name.

    Args:
        node_a (astroid.node): first node to compare.
        node_b (astroid.node): second node to compare.
        attr_name (str): name of the nodes attribute to use for comparison.

    Returns:
        bool: True if node_a.attr_name == node_b.attr_name, False otherwise.
    """
    return getattr(arg_0, arg_2) == getattr(arg_1, arg_2)

Check equality of nodes based on the comparison of their attributes named attr_name .


return callback in self._hard_callbacks()

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _weakly_connected_index ( arg_1 ) if arg_2 is not None : return True if arg_0 . hard_subscribers is None : return False return arg_1 in arg_0 . _hard_callbacks ( )

def Func(arg_0, arg_1):
        """
        Returns True if the event is connected to the given function.

        :type  callback: object
        :param callback: The callback function.
        :rtype:  bool
        :returns: Whether the signal is connected to the given function.
        """
        arg_2 = arg_0._weakly_connected_index(arg_1)
        if arg_2 is not None:
            return True
        if arg_0.hard_subscribers is None:
            return False
        return arg_1 in arg_0._hard_callbacks()

Returns True if the event is connected to the given function .


(self, req, working_set, installer=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_2 . find ( arg_1 ) if arg_4 is not None : return arg_4 for arg_4 in arg_0 [ arg_1 . key ] : if arg_4 in arg_1 : return arg_4 return arg_0 . obtain ( arg_1 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Find distribution best matching `req` and usable on `working_set`

        This calls the ``find(req)`` method of the `working_set` to see if a
        suitable distribution is already active.  (This may raise
        ``VersionConflict`` if an unsuitable version of the project is already
        active in the specified `working_set`.)  If a suitable distribution
        isn't active, this method returns the newest distribution in the
        environment that meets the ``Requirement`` in `req`.  If no suitable
        distribution is found, and `installer` is supplied, then the result of
        calling the environment's ``obtain(req, installer)`` method will be
        returned.
        """
        arg_4 = arg_2.find(arg_1)
        if arg_4 is not None:
            return arg_4
        for arg_4 in arg_0[arg_1.key]:
            if arg_4 in arg_1:
                return arg_4
        # try to download/install
        return arg_0.obtain(arg_1, arg_3)

Find distribution best matching req and usable on working_set


def Func(arg_0):
    """Convert autocorrelation sequence to prediction polynomial

    :param array data:    input data (list or numpy.array)
    :return:
        * AR parameters
        * noise variance

    This is an alias to::

        a, e, c = LEVINSON(data)

    :Example:

    .. doctest::

        >>> from spectrum import Func
        >>> from numpy import array
        >>> r = [5, -2, 1.01]
        >>> ar, e = Func(r)
        >>> ar
        array([ 1.  ,  0.38, -0.05])
        >>> e
        4.1895000000000007

    """
    arg_1, arg_2, arg_3 = LEVINSON(arg_0)
    arg_1 = numpy.insert(arg_1, 0, 1)
    return arg_1, arg_2

Convert autocorrelation sequence to prediction polynomial

    :param array data:    input data (list or numpy.array)
    :return:
        * AR parameters
        * noise variance

    This is an alias to::

        a, e, c = LEVINSON(data)

    :Example:

    .. doctest::

        >>> from spectrum import ac2poly
        >>> from numpy import array
        >>> r = [5, -2, 1.01]
        >>> ar, e = ac2poly(r)
        >>> ar
        array([ 1.  ,  0.38, -0.05])
        >>> e
        4.1895000000000007


(self, *, device: Optional[SomeDevice] = None)

async def Func ( arg_0 , * , arg_1 : arg_2 [ arg_3 ] = None ) : await arg_0 . _user . http . play_playback ( None , device_id = str ( arg_1 ) )

async def Func(arg_0, *, arg_1: arg_2[arg_3] = None):
        """Resume playback on the user's account.

        Parameters
        ----------
        device : Optional[:obj:`SomeDevice`]
            The Device object or id of the device this command is targeting.
            If not supplied, the user’s currently active device is the target.
        """
        await arg_0._user.http.play_playback(None, device_id=str(arg_1))


def Func(arg_0, arg_1, arg_2):
        """
        Populate the bit map with the supplied "shape" and color
        and then write the entire bitmap to the display
        @param shape: pattern to display
        @param color: color for the pattern
        """
        for arg_3 in range(0, 8):
            arg_4 = arg_1[arg_3]
            # shift data into buffer
            arg_5 = 0x80
            for arg_6 in range(0, 8):
                if arg_4 & arg_5:
                    arg_0.set_pixel(arg_3, arg_6, arg_2, True)
                arg_5 >>= 1
        arg_0.output_entire_buffer()

Populate the bit map with the supplied shape and color and then write the entire bitmap to the display


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . MDRUN . Func ( ) if arg_0 . mpiexec : arg_2 = arg_0 . mpicommand ( ** arg_1 ) + arg_2 return arg_2

def Func(arg_0, **arg_1):
        """Returns simple command line to invoke mdrun.

        If :attr:`mpiexec` is set then :meth:`mpicommand` provides the mpi
        launcher command that prefixes the actual ``mdrun`` invocation:

           :attr:`mpiexec` [*mpiargs*]  :attr:`mdrun` [*mdrun-args*]

        The *mdrun-args* are set on initializing the class. Override
        :meth:`mpicommand` to fit your system if the simple default
        OpenMP launcher is not appropriate.
        """
        arg_2 = arg_0.MDRUN.Func()
        if arg_0.mpiexec:
            arg_2 = arg_0.mpicommand(**arg_1) + arg_2
        return arg_2

Returns simple command line to invoke mdrun .


def
Func
(
arg_0
,
arg_1
)
:
assert
arg_1
in
(
'xml'
,
'json'
)
if
getattr
(
arg_0
,
'tag'
,
)
==
'open511'
:
if
arg_1
==
'json'
:
return
xml_to_json
(
arg_0
)
elif
isinstance
(
arg_0
,
dict
)
and
'meta'
in
arg_0
:
if
arg_1
==
'xml'
:
return
json_doc_to_xml
(
arg_0
)
else
:
raise
ValueError
(
"Unrecognized input document"
)
return
arg_0

def Func(arg_0, arg_1):
    """
    Ensures that the provided document is an lxml Element or json dict.
    """
    assert arg_1 in ('xml', 'json')
    if getattr(arg_0, 'tag', None) == 'open511':
        if arg_1 == 'json':
            return xml_to_json(arg_0)
    elif isinstance(arg_0, dict) and 'meta' in arg_0:
        if arg_1 == 'xml':
            return json_doc_to_xml(arg_0)
    else:
        raise ValueError("Unrecognized input document")
    return arg_0

Ensures that the provided document is an lxml Element or json dict .


return "\n".join(x for _, _, x in lines)

def Func(arg_0, arg_1, arg_2=False):
        """Return as a string a set of input history slices.

        Parameters
        ----------
        range_str : string
            The set of slices is given as a string, like "~5/6-~4/2 4:8 9",
            since this function is for use by magic functions which get their
            arguments as strings. The number before the / is the session
            number: ~n goes n back from the current session.

        Optional Parameters:
          - raw(False): by default, the processed input is used.  If this is
          true, the raw input history is used instead.

        Note that slices can be called with two notations:

        N:M -> standard python form, means including items N...(M-1).

        N-M -> include items N..M (closed endpoint)."""
        arg_3 = arg_0.history_manager.get_range_by_str(arg_1, arg_2=arg_2)
        return "\n".join(arg_5 for arg_4, arg_4, arg_5 in arg_3)

Return as a string a set of input history slices .


def Func(arg_0, arg_1):
        """Enumerate all possible resonance forms and return them as a list.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: A list of all possible resonance forms of the molecule.
        :rtype: list of rdkit.Chem.rdchem.Mol
        """
        arg_2 = 0
        if arg_0.kekule_all:
            arg_2 = arg_2 | Chem.KEKULE_ALL
        if arg_0.allow_incomplete_octets:
            arg_2 = arg_2 | Chem.ALLOW_INCOMPLETE_OCTETS
        if arg_0.allow_charge_separation:
            arg_2 = arg_2 | Chem.ALLOW_CHARGE_SEPARATION
        if arg_0.unconstrained_anions:
            arg_2 = arg_2 | Chem.UNCONSTRAINED_ANIONS
        if arg_0.unconstrained_cations:
            arg_2 = arg_2 | Chem.UNCONSTRAINED_CATIONS
        arg_3 = []
        for arg_4 in Chem.ResonanceMolSupplier(arg_1, arg_2=arg_2, maxStructs=arg_0.max_structures):
            # This seems necessary? ResonanceMolSupplier only does a partial sanitization
            Chem.SanitizeMol(arg_4)
            arg_3.append(arg_4)
        return arg_3

Enumerate all possible resonance forms and return them as a list .


(self, email, fullname, membership_type='normal')

return self.fetch_json(
            uri_path=self.base_uri + '/members',
            http_method='PUT',
            query_params={
                'email': email,
                'fullName': fullname,
                'type': membership_type
            }
        )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'normal' ) : return arg_0 . fetch_json ( uri_path = arg_0 . base_uri + '/members' , http_method = 'PUT' , query_params = { 'email' : arg_1 , 'fullName' : arg_2 , 'type' : arg_3 } )

def Func(arg_0, arg_1, arg_2, arg_3='normal'):
        '''
        Add a member to the board. Membership type can be normal or admin.
        Returns JSON of all members if successful or raises an Unauthorised
        exception if not.
        '''
        return arg_0.fetch_json(
            uri_path=arg_0.base_uri + '/members',
            http_method='PUT',
            query_params={
                'email': arg_1,
                'fullName': arg_2,
                'type': arg_3
            }
        )

Add a member to the board . Membership type can be normal or admin . Returns JSON of all members if successful or raises an Unauthorised exception if not .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = dict ( zip ( arg_0 , range ( len ( arg_0 ) ) ) , ** arg_1 ) arg_2 [ 'map' ] = copy . copy ( arg_2 ) arg_2 [ 'rmap' ] = { } for arg_3 , arg_4 in arg_2 . items ( ) : if type ( arg_4 ) is int : arg_2 [ 'rmap' ] [ arg_4 ] = arg_3 return type ( 'Enum' , ( ) , arg_2 )

def Func(*arg_0, **arg_1):
    """
    Build an Func statement
    """
    #: build Funcs from parameter
    arg_2 = dict(zip(arg_0, range(len(arg_0))), **arg_1)
    arg_2['map'] = copy.copy(arg_2)
    #: build reverse mapping
    arg_2['rmap'] = {}
    for arg_3, arg_4 in arg_2.items():
        if type(arg_4) is int:
            arg_2['rmap'][arg_4] = arg_3
    return type('Enum', (), arg_2)


def Func(arg_0, arg_1, arg_2, arg_3=None):
        '''
        Performs a PUT request and returns the response.

        path:
            Path to the resource.
            Ex: '/<subscription-id>/services/hostedservices/<service-name>'
        body:
            Body for the PUT request.
        x_ms_version:
            If specified, this is used for the x-ms-version header.
            Otherwise, self.x_ms_version is used.
        '''
        arg_4 = HTTPRequest()
        arg_4.method = 'PUT'
        arg_4.host = arg_0.host
        arg_4.path = arg_1
        arg_4.body = _get_request_body(arg_2)
        arg_4.path, arg_4.query = arg_0._httpclient._update_request_uri_query(arg_4)
        arg_4.headers = arg_0._update_management_header(arg_4, arg_3)
        arg_9 = arg_0._perform_request(arg_4)

        return arg_9

Performs a PUT request and returns the response .


def Func ( arg_0 ) : if isinstance ( arg_0 , nib . Nifti1Image ) : arg_0 = nifti2nipy ( arg_0 ) if arg_0 . ndim == 4 : from nipy . core . reference . coordinate_map import drop_io_dim arg_1 = drop_io_dim ( arg_0 . coordmap , 3 ) else : arg_1 = arg_0 . coordmap return arg_1

def Func(arg_0):
    '''
    Gets a 3D CoordinateMap from img.

    Parameters
    ----------
    img: nib.Nifti1Image or nipy Image

    Returns
    -------
    nipy.core.reference.coordinate_map.CoordinateMap
    '''
    if isinstance(arg_0, nib.Nifti1Image):
        arg_0 = nifti2nipy(arg_0)

    if arg_0.ndim == 4:
        from nipy.core.reference.coordinate_map import drop_io_dim
        arg_1 = drop_io_dim(arg_0.coordmap, 3)
    else:
        arg_1 = arg_0.coordmap

    return arg_1


(self, document_id, database_name=None, collection_name=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Delete an existing document out of a collection in the CosmosDB database.
        """
        if arg_1 is None:
            raise AirflowBadRequest("Cannot delete a document without an id")

        arg_0.get_conn().DeleteItem(
            get_document_link(
                arg_0.__get_database_name(arg_2),
                arg_0.__get_collection_name(arg_3),
                arg_1))

Delete an existing document out of a collection in the CosmosDB database .


(graphs: Iterable[BELGraph], path: Union[None, str, TextIO])

def Func ( arg_0 : arg_1 [ arg_2 ] , arg_3 : arg_4 [ None , arg_5 , arg_6 ] ) -> None : if isinstance ( arg_3 , arg_5 ) : with open ( arg_3 , 'w' ) as file : _multi_run_helper_file_wrapper ( arg_0 , file ) else : _multi_run_helper_file_wrapper ( arg_0 , arg_3 )

def Func(arg_0: arg_1[arg_2], arg_3: arg_4[None, arg_5, arg_6]) -> None:
    """Run EpiCom analysis on many graphs."""
    if isinstance(arg_3, arg_5):
        with open(arg_3, 'w') as file:
            _multi_run_helper_file_wrapper(arg_0, file)

    else:
        _multi_run_helper_file_wrapper(arg_0, arg_3)


def Func ( arg_0 ) : arg_0 . _orig_sys_module_state = { } arg_0 . _orig_sys_module_state [ 'stdin' ] = sys . stdin arg_0 . _orig_sys_module_state [ 'stdout' ] = sys . stdout arg_0 . _orig_sys_module_state [ 'stderr' ] = sys . stderr arg_0 . _orig_sys_module_state [ 'excepthook' ] = sys . excepthook arg_0 . _orig_sys_modules_main_name = arg_0 . user_module . __name__ arg_0 . _orig_sys_modules_main_mod = sys . modules . get ( arg_0 . user_module . __name__ )

def Func(arg_0):
        """Save the state of hooks in the sys module.

        This has to be called after self.user_module is created.
        """
        arg_0._orig_sys_module_state = {}
        arg_0._orig_sys_module_state['stdin'] = sys.stdin
        arg_0._orig_sys_module_state['stdout'] = sys.stdout
        arg_0._orig_sys_module_state['stderr'] = sys.stderr
        arg_0._orig_sys_module_state['excepthook'] = sys.excepthook
        arg_0._orig_sys_modules_main_name = arg_0.user_module.__name__
        arg_0._orig_sys_modules_main_mod = sys.modules.get(arg_0.user_module.__name__)

Save the state of hooks in the sys module .


def Func(arg_0):
        """
        Download the production configuration and install it in the
        current directory.
        """

        # We initiate the link to the production configuration.
        # It is not hard coded because this method is called only if we
        # are sure that the configuration file exist.
        arg_1 = "https://raw.githubusercontent.com/funilrys/PyFunceble/master/.PyFunceble_production.yaml"  # pylint: disable=line-too-long

        # We update the link according to our current version.
        arg_1 = Version(True).right_url_from_version(
            arg_1
        )

        if not Version(True).is_cloned():
            # The current version is not the cloned one.

            # We download the link content and save it inside the default location.
            #
            # Note: We add this one in order to allow the enduser to always have
            # a copy of our upstream configuration file.
            Download(arg_1, arg_0.path_to_default_config).text()

        # And we download the link content and return the download status.
        return Download(arg_1, arg_0.path_to_config).text()

Download the production configuration and install it in the current directory .


def Func(arg_0, *arg_1, **arg_2):
        """
        Sets args and kwargs that are passed when creating a subparsers group
        in an argparse.ArgumentParser i.e. when calling
        argparser.ArgumentParser.add_subparsers
        """
        arg_0.subparsers_args = arg_1
        arg_0.subparsers_kwargs = arg_2

Sets args and kwargs that are passed when creating a subparsers group in an argparse . ArgumentParser i . e . when calling argparser . ArgumentParser . add_subparsers


(src, dst_path, skip_globals, skip_dimensions, skip_variables)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if os . path . exists ( arg_1 ) : os . unlink ( arg_1 ) arg_5 = netCDF4 . Dataset ( arg_1 , 'w' ) for arg_6 in arg_0 . ncattrs ( ) : if arg_6 not in arg_2 : setattr ( arg_5 , arg_6 , getattr ( arg_0 , arg_6 ) ) arg_7 = None arg_8 = False for arg_9 , arg_10 in arg_0 . dimensions . items ( ) : if arg_9 in arg_3 : continue if arg_10 . isunlimited ( ) : arg_7 = arg_10 arg_8 = arg_9 arg_5 . createDimension ( arg_9 , None ) else : arg_5 . createDimension ( arg_9 , arg_23 ( arg_10 ) ) for arg_11 , arg_12 in arg_0 . variables . items ( ) : if arg_11 in arg_4 : continue arg_13 = False if arg_8 and arg_8 in arg_12 . dimensions : arg_13 = True arg_14 = None if hasattr ( arg_12 , '_FillValue' ) : arg_14 = arg_12 . _FillValue if arg_12 . chunking == "contiguous" : arg_15 = arg_5 . createVariable ( arg_11 , arg_12 . dtype , arg_12 . dimensions , fill_value = arg_14 ) else : arg_15 = arg_5 . createVariable ( arg_11 , arg_12 . dtype , arg_12 . dimensions , fill_value = arg_14 , chunksizes = arg_12 . chunking ( ) ) for arg_6 in arg_12 . ncattrs ( ) : if arg_6 == '_FillValue' : continue else : setattr ( arg_15 , arg_6 , getattr ( arg_12 , arg_6 ) ) arg_16 = 1000 if arg_13 : if arg_16 : arg_17 = 0 arg_18 = arg_23 ( arg_7 ) arg_19 = arg_16 if arg_19 < 1 : arg_19 = 1 for arg_20 in range ( arg_17 , arg_18 , arg_19 ) : arg_21 = arg_20 + arg_16 if arg_21 > arg_23 ( arg_7 ) : arg_21 = arg_23 ( arg_7 ) arg_22 = arg_12 [ arg_20 : arg_21 ] arg_15 [ arg_20 : arg_21 ] = arg_22 else : arg_22 = arg_12 [ : ] arg_15 [ 0 : arg_23 ( arg_7 ) ] = arg_22 else : arg_22 = arg_12 [ : ] arg_15 [ : ] = arg_22 arg_5 . sync ( ) arg_0 . close ( ) arg_5 . close ( )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
        Mostly ripped from nc3tonc4 in netCDF4-python.
        Added ability to skip dimension and variables.
        Removed all of the unpacking logic for shorts.
    """

    if os.path.exists(arg_1):
        os.unlink(arg_1)
    arg_5 = netCDF4.Dataset(arg_1, 'w')

    # Global attributes
    for arg_6 in arg_0.ncattrs():
        if arg_6 not in arg_2:
            setattr(arg_5, arg_6, getattr(arg_0, arg_6))

    # Dimensions
    arg_7     = None
    arg_8 = False
    for arg_9, arg_10 in arg_0.dimensions.items():

        # Skip what we need to
        if arg_9 in arg_3:
            continue

        if arg_10.isunlimited():
            arg_7     = arg_10
            arg_8 = arg_9
            arg_5.createDimension(arg_9, None)
        else:
            arg_5.createDimension(arg_9, arg_23(arg_10))

    # Variables
    for arg_11, arg_12 in arg_0.variables.items():

        # Skip what we need to
        if arg_11 in arg_4:
            continue

        arg_13 = False
        if arg_8 and arg_8 in arg_12.dimensions:
            arg_13 = True

        arg_14 = None
        if hasattr(arg_12, '_FillValue'):
            arg_14 = arg_12._FillValue

        if arg_12.chunking == "contiguous":
            arg_15 = arg_5.createVariable(arg_11, arg_12.dtype, arg_12.dimensions, fill_value=arg_14)
        else:
            arg_15 = arg_5.createVariable(arg_11, arg_12.dtype, arg_12.dimensions, fill_value=arg_14, chunksizes=arg_12.chunking())

        # Attributes
        for arg_6 in arg_12.ncattrs():
            if arg_6 == '_FillValue':
                continue
            else:
                setattr(arg_15, arg_6, getattr(arg_12, arg_6))

        # Data
        arg_16 = 1000
        if arg_13:
            if arg_16:
                arg_17 = 0
                arg_18 = arg_23(arg_7)
                arg_19 = arg_16
                if arg_19 < 1:
                    arg_19 = 1
                for arg_20 in range(arg_17, arg_18, arg_19):
                    arg_21 = arg_20 + arg_16
                    if arg_21 > arg_23(arg_7):
                        arg_21 = arg_23(arg_7)
                    arg_22 = arg_12[arg_20:arg_21]
                    arg_15[arg_20:arg_21] = arg_22
            else:
                arg_22 = arg_12[:]
                arg_15[0:arg_23(arg_7)] = arg_22
        else:
            arg_22 = arg_12[:]
            arg_15[:] = arg_22

        arg_5.sync()

    arg_0.close()
    arg_5.close()

Mostly ripped from nc3tonc4 in netCDF4 - python . Added ability to skip dimension and variables . Removed all of the unpacking logic for shorts .


def Func ( arg_0 ) : arg_0 . session . _save_object_number ( ) arg_0 . _output_encoding_diffs ( ) arg_0 . _output_font_files ( ) for arg_1 in arg_0 . fonts : arg_2 = arg_0 . session . _add_object ( ) arg_1 . _set_number ( arg_2 . id ) arg_1 . _output ( )

def Func(arg_0):
        """ Called by the PDFLite object to prompt creating
            the font objects."""
        arg_0.session._save_object_number()
        arg_0._output_encoding_diffs()
        arg_0._output_font_files()

        for arg_1 in arg_0.fonts:
            arg_2 = arg_0.session._add_object()
            arg_1._set_number(arg_2.id)
            arg_1._output()

Called by the PDFLite object to prompt creating the font objects .


def Func(arg_0, arg_1, arg_2=None):
        """
        private method for the addition of business days, used in the addition of a BusinessPeriod only

        :param BusinessDate d:
        :param int days_int:
        :param list holiday_obj:
        :return: BusinessDate
        """

        arg_3 = arg_0
        if arg_1 >= 0:
            arg_4 = 0
            while arg_4 < arg_1:
                arg_3 = BusinessDate.add_days(arg_3, 1)
                if BusinessDate.is_business_day(arg_3, arg_2):
                    arg_4 += 1
        else:
            arg_4 = 0
            while arg_4 > arg_1:
                arg_3 = BusinessDate.add_days(arg_3, -1)
                if BusinessDate.is_business_day(arg_3, arg_2):
                    arg_4 -= 1

        return arg_3

private method for the addition of business days used in the addition of a BusinessPeriod only


return {
        node
        for node in graph
        if node.function == func and is_causal_central(graph, node)
    }

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> Set [ BaseEntity ] : return { arg_4 for arg_4 in arg_0 if arg_4 . function == arg_2 and is_causal_central ( arg_0 , arg_4 ) }

def Func(arg_0: arg_1, arg_2: arg_3) -> Set[BaseEntity]:
    """Return a set of all nodes that have both an in-degree > 0 and out-degree > 0.

    This means that they are an integral part of a pathway, since they are both produced and consumed.
    """
    return {
        arg_4
        for arg_4 in arg_0
        if arg_4.function == arg_2 and is_causal_central(arg_0, arg_4)
    }

Return a set of all nodes that have both an in - degree > 0 and out - degree > 0 .


(self, uri_path, http_method='GET', query_params=None,
                   body=None, headers=None)

def Func ( arg_0 , arg_1 , arg_2 = 'GET' , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_3 = arg_3 or { } arg_5 = arg_5 or { } arg_3 = arg_0 . add_authorisation ( arg_3 ) arg_6 = arg_0 . build_uri ( arg_1 , arg_3 ) arg_7 = ( "POST" , "PUT" , "DELETE" ) if arg_2 in arg_7 and 'Content-Type' not in arg_5 : arg_5 [ 'Content-Type' ] = 'application/json' arg_5 [ 'Accept' ] = 'application/json' arg_8 , arg_9 = arg_0 . client . request ( arg_6 = arg_6 , method = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 ) arg_0 . check_errors ( arg_6 , arg_8 ) return json . loads ( arg_9 . decode ( 'utf-8' ) )

def Func(arg_0, arg_1, arg_2='GET', arg_3=None,
                   arg_4=None, arg_5=None):
        '''
        Make a call to Trello API and capture JSON response. Raises an error
        when it fails.

        Returns:
            dict: Dictionary with the JSON data
        '''
        arg_3 = arg_3 or {}
        arg_5 = arg_5 or {}

        arg_3 = arg_0.add_authorisation(arg_3)
        arg_6 = arg_0.build_uri(arg_1, arg_3)

        arg_7 = ("POST", "PUT", "DELETE")
        if arg_2 in arg_7 and 'Content-Type' not in arg_5:
            arg_5['Content-Type'] = 'application/json'

        arg_5['Accept'] = 'application/json'
        arg_8, arg_9 = arg_0.client.request(
            arg_6=arg_6,
            method=arg_2,
            arg_4=arg_4,
            arg_5=arg_5
        )

        arg_0.check_errors(arg_6, arg_8)

        return json.loads(arg_9.decode('utf-8'))

Make a call to Trello API and capture JSON response . Raises an error when it fails .


def Func(arg_0):
        """
        Verify that the contents of the OpaqueObject are valid.

        Raises:
            TypeError: if the types of any OpaqueObject attributes are invalid.
        """
        if not isinstance(arg_0.value, bytes):
            raise TypeError("opaque value must be bytes")
        elif not isinstance(arg_0.opaque_type, enums.OpaqueDataType):
            raise TypeError("opaque data type must be an OpaqueDataType "
                            "enumeration")

        arg_1 = len(arg_0.names)
        for arg_2 in range(arg_1):
            arg_3 = arg_0.names[arg_2]
            if not isinstance(arg_3, six.string_types):
                arg_4 = "({0} in list)".format(arg_2)
                raise TypeError("opaque data name {0} must be a string".format(
                    arg_4))

Verify that the contents of the OpaqueObject are valid .


def Func(arg_0) -> List['ExternalLink']:
        """Return a list of found external link objects.

        Note:
            Templates adjacent to external links are considered part of the
            link. In reality, this depends on the contents of the template:

            >>> WikiText(
            ...    'http://example.com{{dead link}}'
            ...).external_links[0].url
            'http://example.com{{dead link}}'

            >>> WikiText(
            ...    '[http://example.com{{space template}} text]'
            ...).external_links[0].url
            'http://example.com{{space template}}'
        """
        Func = []  # type: List['ExternalLink']
        arg_2 = Func.append
        arg_3 = arg_0._type_to_spans
        arg_4 = arg_0._lststr
        arg_5, arg_6 = arg_0._span
        arg_7 = arg_3.setdefault('ExternalLink', [])
        if not arg_7:
            # All the added spans will be new.
            arg_8 = arg_7.append
            for arg_9 in EXTERNAL_LINK_FINDITER(arg_0._ext_link_shadow):
                Func0, Func1 = arg_9.span()
                Func2 = [arg_5 + Func0, arg_5 + Func1]
                arg_8(Func2)
                arg_2(
                    ExternalLink(arg_4, arg_3, Func2, 'ExternalLink'))
            return Func
        # There are already some ExternalLink spans. Use the already existing
        # ones when the detected span is one of those.
        Func3 = {(Func0[0], Func0[1]): Func0 for Func0 in arg_7}.get
        for arg_9 in EXTERNAL_LINK_FINDITER(arg_0._ext_link_shadow):
            Func0, Func1 = arg_9.span()
            Func2 = Func0, Func1 = [Func0 + arg_5, Func1 + arg_5]
            Func4 = Func3((Func0, Func1))
            if Func4 is None:
                insort(arg_7, Func2)
            else:
                Func2 = Func4
            arg_2(
                ExternalLink(arg_4, arg_3, Func2, 'ExternalLink'))
        return Func

Return a list of found external link objects .


def Func(arg_0, arg_1):
        """
        Adds a trusted certificate to this store.

        Adding a certificate with this method adds this certificate as a
        *trusted* certificate.

        :param X509 cert: The certificate to add to this store.

        :raises TypeError: If the certificate is not an :class:`X509`.

        :raises OpenSSL.crypto.Error: If OpenSSL was unhappy with your
            certificate.

        :return: ``None`` if the certificate was added successfully.
        """
        if not isinstance(arg_1, X509):
            raise TypeError()

        # As of OpenSSL 1.1.0i adding the same cert to the store more than
        # once doesn't cause an error. Accordingly, this code now silences
        # the error for OpenSSL < 1.1.0i as well.
        if _lib.X509_STORE_Func(arg_0._store, arg_1._x509) == 0:
            arg_2 = _lib.ERR_peek_error()
            arg_3 = _lib.ERR_GET_REASON(arg_2)
            _openssl_assert(
                arg_3 == _lib.X509_R_CERT_ALREADY_IN_HASH_TABLE
            )
            _lib.ERR_clear_error()

Adds a trusted certificate to this store .


def Func(arg_0, arg_1, arg_2=False):
        r'''Method used to select certain property methods as having a higher
        priority than were set by default. If `forced` is true, then methods
        which were not specified are excluded from consideration.

        As a side effect, `method` is removed to ensure than the new methods
        will be used in calculations afterwards.

        An exception is raised if any of the methods specified aren't available
        for the chemical. An exception is raised if no methods are provided.

        Parameters
        ----------
        user_methods : str or list
            Methods by name to be considered or prefered
        forced : bool, optional
            If True, only the user specified methods will ever be considered;
            if False other methods will be considered if no user methods
            suceed
        '''
        # Accept either a string or a list of methods, and whether
        # or not to only consider the false methods
        if isinstance(arg_1, str):
            arg_1 = [arg_1]

        # The user's order matters and is retained for use by select_valid_methods
        arg_0.user_methods = arg_1
        arg_0.forced = arg_2

        # Validate that the user's specified methods are actual methods
        if set(arg_0.user_methods).difference(arg_0.all_methods):
            raise Exception("One of the given methods is not available for this chemical")
        if not arg_0.user_methods and arg_0.forced:
            raise Exception('Only user specified methods are considered when forced is True, but no methods were provided')

        # Remove previously selected methods
        arg_0.method = None
        arg_0.sorted_valid_methods = []
        arg_0.T_cached = None

r Method used to select certain property methods as having a higher priority than were set by default . If forced is true then methods which were not specified are excluded from consideration .


def Func(arg_0, arg_1):
        """Fetch information about a channel."""

        arg_2 = arg_0.RCHANNEL_INFO

        arg_3 = {
            arg_0.PCHANNEL: arg_1,
        }

        arg_4 = arg_0._fetch(arg_2, arg_3)

        return arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . lookup . whois ( PyFunceble . CONFIGURATION [ "iana_whois_server" ] , "hello.%s" % arg_1 ) if arg_2 and "refer" in arg_2 : arg_3 = r"(?s)refer\:\s+([a-zA-Z0-9._-]+)\n" arg_4 = Regex ( arg_2 , arg_3 , return_data = True , group = 1 ) . match ( ) if arg_4 : return arg_4 if arg_1 in arg_0 . manual_server : return arg_0 . manual_server [ arg_1 ] return None

def Func(arg_0, arg_1):
        """
        Return the referer for the given extension.

        :param extension: A valid domain extension.
        :type extension: str

        :return: The whois server to use to get the WHOIS record.
        :rtype: str
        """

        # We get the a copy of the page.
        arg_2 = arg_0.lookup.whois(
            PyFunceble.CONFIGURATION["iana_whois_server"], "hello.%s" % arg_1
        )

        if arg_2 and "refer" in arg_2:
            # The record is not empty.

            # We initiate a regex which will extract the referer.
            arg_3 = r"(?s)refer\:\s+([a-zA-Z0-9._-]+)\n"

            # We try to extract the referer.
            arg_4 = Regex(
                arg_2, arg_3, return_data=True, group=1
            ).match()

            if arg_4:
                # The referer was extracted successfully.

                # We return the matched referer.
                return arg_4

        # * The referer was not extracted successfully.
        # or
        # * The iana record is empty.

        if arg_1 in arg_0.manual_server:
            # The extension is in the list of manual entries.

            # We return the server which we set manually.
            return arg_0.manual_server[arg_1]

        # We return None because we weren't able to get the server to call for
        # the given extension.
        return None

Return the referer for the given extension .


def Func ( arg_0 , arg_1 ) : if arg_1 . continue_prompt and arg_0 . prefilter_manager . multi_line_specials : if arg_1 . esc == ESC_MAGIC : return arg_0 . prefilter_manager . get_handler_by_name ( 'magic' ) else : return None

def Func(arg_0, arg_1):
        "Allow ! and !! in multi-line statements if multi_line_specials is on"
        # Note that this one of the only places we Func the first character of
        # ifun and *not* the pre_char.  Also note that the below test matches
        # both ! and !!.
        if arg_1.continue_prompt \
            and arg_0.prefilter_manager.multi_line_specials:
                if arg_1.esc == ESC_MAGIC:
                    return arg_0.prefilter_manager.get_handler_by_name('magic')
        else:
            return None

Allow ! and !! in multi - line statements if multi_line_specials is on


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
True
for
arg_3
in
[
"numberOfCols"
,
"cellsPerColumn"
,
"initialPerm"
,
"connectedPerm"
,
"minThreshold"
,
"newSynapseCount"
,
"permanenceInc"
,
"permanenceDec"
,
"permanenceMax"
,
"globalDecay"
,
"activationThreshold"
,
"doPooling"
,
"segUpdateValidDuration"
,
"burnIn"
,
"pamLength"
,
"maxAge"
]
:
if
getattr
(
arg_0
,
arg_3
)
!=
getattr
(
arg_1
,
arg_3
)
:
print
arg_3
,
"is different"
print
getattr
(
arg_0
,
arg_3
)
,
"vs"
,
getattr
(
arg_1
,
arg_3
)
arg_2
=
False
return
arg_2

def Func(arg_0, arg_1):
  """Given two TM instances, see if any parameters are different."""
  arg_2 = True
  for arg_3 in ["numberOfCols", "cellsPerColumn", "initialPerm", "connectedPerm",
                "minThreshold", "newSynapseCount", "permanenceInc", "permanenceDec",
                "permanenceMax", "globalDecay", "activationThreshold",
                "doPooling", "segUpdateValidDuration",
                "burnIn", "pamLength", "maxAge"]:
    if getattr(arg_0, arg_3) != getattr(arg_1,arg_3):
      print arg_3,"is different"
      print getattr(arg_0, arg_3), "vs", getattr(arg_1,arg_3)
      arg_2 = False
  return arg_2

Given two TM instances see if any parameters are different .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
1
,
0
if
arg_1
<
1
:
raise
ValueError
(
'num_buckets must be a positive number'
)
while
arg_3
<
arg_1
:
arg_2
=
int
(
arg_3
)
arg_0
=
(
(
arg_0
*
long
(
2862933555777941757
)
)
+
1
)
&
0xffffffffffffffff
arg_3
=
float
(
arg_2
+
1
)
*
(
float
(
1
<<
31
)
/
float
(
(
arg_0
>>
33
)
+
1
)
)
return
int
(
arg_2
)

def Func(arg_0, arg_1):
    """Generate a number in the range [0, num_buckets).

    Args:
        key (int): The key to hash.
        num_buckets (int): Number of buckets to use.

    Returns:
        The bucket number `key` computes to.

    Raises:
        ValueError: If `num_buckets` is not a positive number.
    """
    arg_2, arg_3 = -1, 0

    if arg_1 < 1:
        raise ValueError('num_buckets must be a positive number')

    while arg_3 < arg_1:
        arg_2 = int(arg_3)
        arg_0 = ((arg_0 * long(2862933555777941757)) + 1) & 0xffffffffffffffff
        arg_3 = float(arg_2 + 1) * (float(1 << 31) / float((arg_0 >> 33) + 1))

    return int(arg_2)

Generate a number in the range [ 0 num_buckets ) .


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
(
arg_0
and
arg_0
.
strip
(
)
)
:
raise
AirflowBadRequest
(
"Pool name shouldn't be empty"
)
arg_2
=
arg_1
.
query
(
Pool
)
.
filter_by
(
arg_2
=
arg_0
)
.
first
(
)
if
arg_2
is
:
raise
PoolNotFound
(
"Pool '%s' doesn't exist"
%
arg_0
)
return
arg_2

def Func(arg_0, arg_1=None):
    """Get pool by a given name."""
    if not (arg_0 and arg_0.strip()):
        raise AirflowBadRequest("Pool name shouldn't be empty")

    arg_2 = arg_1.query(Pool).filter_by(arg_2=arg_0).first()
    if arg_2 is None:
        raise PoolNotFound("Pool '%s' doesn't exist" % arg_0)

    return arg_2


return re.sub(r'\*', ', '.join(undefined_name), line)

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
sorted
(
set
(
arg_1
)
)
return
re
.
sub
(
r'\*'
,
', '
.
join
(
arg_2
)
,
arg_0
)

def Func(arg_0, arg_1):
    """Return line with the star import expanded."""
    arg_2 = sorted(set(arg_1))
    return re.sub(r'\*', ', '.join(arg_2), arg_0)

Return line with the star import expanded .


return int(float(val) * self._multipier(mult) * 1000)

def
Func
(
arg_0
)
:
if
arg_0
.
resolution
is
or
not
isinstance
(
arg_0
.
resolution
,
basestring
)
:
return
arg_0
.
resolution
arg_1
,
arg_2
=
arg_0
.
resolution
.
split
(
' '
)
return
int
(
float
(
arg_1
)
*
arg_0
.
_multipier
(
arg_2
)
*
1000
)

def Func(arg_0):
        '''if set, get the value of resolution in milliseconds'''
        if arg_0.resolution is None or not isinstance(arg_0.resolution, basestring):
                return arg_0.resolution
        arg_1, arg_2 = arg_0.resolution.split(' ')
        return int(float(arg_1) * arg_0._multipier(arg_2) * 1000)

if set get the value of resolution in milliseconds


(
    iterable: Iterable[Any], start: str, end: str, meta=None, **kwargs
)

def Func(
    arg_0: arg_1[arg_2], arg_3: arg_4, arg_5: arg_4, arg_6=None, **arg_7
) -> arg_4:
    """Produce a Lisp representation of a sequential collection, bookended
    with the start and end string supplied. The keyword arguments will be
    passed along to lrepr for the sequence elements."""
    arg_8 = arg_7["print_level"]
    if isinstance(arg_8, int) and arg_8 < 1:
        return SURPASSED_PRINT_LEVEL

    arg_7 = _process_kwargs(**arg_7)

    arg_9 = []
    arg_10 = arg_7["print_dup"]
    arg_11 = arg_7["print_length"]
    if not arg_10 and isinstance(arg_11, int):
        arg_12 = seq(arg_0).take(arg_11 + 1).to_list()
        if len(arg_12) > arg_11:
            arg_12.pop()
            arg_9.append(SURPASSED_PRINT_LENGTH)
    else:
        arg_12 = arg_0

    arg_12 = list(map(lambda o: lrepr(o, **arg_7), arg_12))
    Func = PRINT_SEPARATOR.join(arg_12 + arg_9)

    arg_14 = arg_7["print_meta"]
    if arg_14 and arg_6:
        return f"^{lrepr(meta, **kwargs)} {start}{seq_lrepr}{end}"

    return f"{start}{seq_lrepr}{end}"

Produce a Lisp representation of a sequential collection bookended with the start and end string supplied . The keyword arguments will be passed along to lrepr for the sequence elements .


def Func(arg_0, arg_1, arg_2):
    """invoke task hooks for every time bolt acks a tuple

    :type heron_tuple: HeronTuple
    :param heron_tuple: tuple that is acked
    :type process_latency_ns: float
    :param process_latency_ns: process latency in nano seconds
    """
    if len(arg_0.task_hooks) > 0:
      arg_3 = BoltAckInfo(arg_1=arg_1,
                                  acking_task_id=arg_0.get_task_id(),
                                  process_latency_ms=arg_2 * system_constants.NS_TO_MS)
      for arg_4 in arg_0.task_hooks:
        arg_4.bolt_ack(arg_3)


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
filters
:
print
(
'WARNING: no filters to save to file!'
)
arg_2
=
open
(
arg_1
,
'w'
)
arg_2
.
write
(
''
.
join
(
arg_0
.
opening
+
arg_0
.
filters
+
arg_0
.
closing
)
)
arg_2
.
close
(
)

def Func(arg_0, arg_1):
        """ Save filter script to an mlx file """
        # TODO: rasie exception here instead?
        if not arg_0.filters:
            print('WARNING: no filters to save to file!')
        arg_2 = open(arg_1, 'w')
        arg_2.write(''.join(arg_0.opening + arg_0.filters + arg_0.closing))
        arg_2.close()


(
			filepaths, include_filters=None, exclude_filters=None, all_includes=False, all_excludes=False,
			exclude_patterns=None, max_depth=float('inf'))

return matched_songs, filtered_songs, excluded_songs

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
False
,
arg_5
=
,
arg_6
=
arg_7
(
'inf'
)
)
:
logger
.
info
(
"Loading local songs..."
)
arg_8
=
get_supported_filepaths
(
arg_0
,
SUPPORTED_SONG_FORMATS
,
arg_6
=
arg_6
)
arg_9
,
arg_10
=
exclude_filepaths
(
arg_8
,
arg_5
=
arg_5
)
arg_11
,
arg_12
=
filter_local_songs
(
arg_9
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)
logger
.
info
(
"Excluded {0} local songs"
.
format
(
len
(
arg_10
)
)
)
logger
.
info
(
"Filtered {0} local songs"
.
format
(
len
(
arg_12
)
)
)
logger
.
info
(
"Loaded {0} local songs"
.
format
(
len
(
arg_11
)
)
)
return
arg_11
,
arg_12
,
arg_10

def Func(
			arg_0, arg_1=None, arg_2=None, arg_3=False, arg_4=False,
			arg_5=None, arg_6=arg_7('inf')):
		"""Load songs from local filepaths.

		Parameters:
			filepaths (list or str): Filepath(s) to search for music files.

			include_filters (list): A list of ``(field, pattern)`` tuples.
				Fields are any valid mutagen metadata fields. Patterns are Python regex patterns.
				Local songs are filtered out if the given metadata field values don't match any of the given patterns.

			exclude_filters (list): A list of ``(field, pattern)`` tuples.
				Fields are any valid mutagen metadata fields. Patterns are Python regex patterns.
				Local songs are filtered out if the given metadata field values match any of the given patterns.

			all_includes (bool): If ``True``, all include_filters criteria must match to include a song.

			all_excludes (bool): If ``True``, all exclude_filters criteria must match to exclude a song.

			exclude_patterns (list or str): Pattern(s) to exclude.
				Patterns are Python regex patterns.
				Filepaths are excluded if they match any of the exclude patterns.

			max_depth (int): The depth in the directory tree to walk.
				A depth of '0' limits the walk to the top directory.
				Default: No limit.

		Returns:
			A list of local song filepaths matching criteria,
			a list of local song filepaths filtered out using filter criteria,
			and a list of local song filepaths excluded using exclusion criteria.

		"""

		logger.info("Loading local songs...")

		arg_8 = get_supported_filepaths(arg_0, SUPPORTED_SONG_FORMATS, arg_6=arg_6)

		arg_9, arg_10 = exclude_filepaths(arg_8, arg_5=arg_5)

		arg_11, arg_12 = filter_local_songs(
			arg_9, arg_1=arg_1, arg_2=arg_2,
			arg_3=arg_3, arg_4=arg_4
		)

		logger.info("Excluded {0} local songs".format(len(arg_10)))
		logger.info("Filtered {0} local songs".format(len(arg_12)))
		logger.info("Loaded {0} local songs".format(len(arg_11)))

		return arg_11, arg_12, arg_10


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_model ( 'waffle' , 'Switch' ) arg_2 . objects . get_or_create ( name = 'SAP_USE_ENTERPRISE_ENROLLMENT_PAGE' , defaults = { 'active' : False } )

def Func(arg_0, arg_1):
    """Create and activate the SAP_USE_ENTERPRISE_ENROLLMENT_PAGE switch if it does not already exist."""
    arg_2 = arg_0.get_model('waffle', 'Switch')
    arg_2.objects.get_or_create(name='SAP_USE_ENTERPRISE_ENROLLMENT_PAGE', defaults={'active': False})

Create and activate the SAP_USE_ENTERPRISE_ENROLLMENT_PAGE switch if it does not already exist .


def Func():
    """Main entry point for `dddp` command."""
    arg_0 = argparse.ArgumentParser(description=__doc__)
    arg_1 = arg_0.add_argument_group('Django Options')
    arg_1.add_argument(
        '--verbosity', '-v', metavar='VERBOSITY', dest='verbosity', type=int,
        default=1,
    )
    arg_1.add_argument(
        '--debug-port', metavar='DEBUG_PORT', dest='debug_port', type=int,
        default=0,
    )
    arg_1.add_argument(
        '--settings', metavar='SETTINGS', dest='settings',
        help="The Python path to a settings module, e.g. "
        "\"myproject.settings.Func\". If this isn't provided, the "
        "DJANGO_SETTINGS_MODULE environment variable will be used.",
    )
    arg_2 = arg_0.add_argument_group('HTTP Options')
    arg_2.add_argument(
        'listen', metavar='address[:port]', nargs='*', type=addr,
        help='Listening address for HTTP(s) server.',
    )
    arg_3 = arg_0.add_argument_group('SSL Options')
    arg_3.add_argument('--ssl-version', metavar='SSL_VERSION', dest='ssl_version',
                     help="SSL version to use (see stdlib ssl module's) [3]",
                     choices=['1', '2', '3'], default='3')
    arg_3.add_argument('--certfile', metavar='FILE', dest='certfile',
                     help="SSL certificate file [None]")
    arg_3.add_argument('--ciphers', metavar='CIPHERS', dest='ciphers',
                     help="Ciphers to use (see stdlib ssl module's) [TLSv1]")
    arg_3.add_argument('--ca-certs', metavar='FILE', dest='ca_certs',
                     help="CA certificates file [None]")
    arg_3.add_argument('--keyfile', metavar='FILE', dest='keyfile',
                     help="SSL key file [None]")
    arg_4 = arg_0.parse_args()
    if arg_4.settings:
        arg_5.environ['DJANGO_SETTINGS_MODULE'] = arg_4.settings
    serve(
        arg_4.listen or [Addr('localhost', 8000)],
        debug_port=arg_4.debug_port,
        keyfile=arg_4.keyfile,
        certfile=arg_4.certfile,
        verbosity=arg_4.verbosity,
    )


def Func ( arg_0 ) : if not arg_0 . _is_locked : yield else : try : arg_0 . _is_locked = False yield finally : arg_0 . _is_locked = True

def Func(arg_0):
        """
        Allow tokens to modify the world for the duration of a with-block.

        It's important that tokens only modify the world at appropriate times,
        otherwise the changes they make may not be communicated across the
        network to other clients.  To help catch and prevent these kinds of
        errors, the game engine keeps the world locked most of the time and
        only briefly unlocks it (using this method) when tokens are allowed to
        make changes.  When the world is locked, token methods that aren't
        marked as being read-only can't be called.  When the world is unlocked,
        any token method can be called.  These checks can be disabled by
        running python with optimization enabled.

        You should never call this method manually from within your own game.
        This method is intended to be used by the game engine, which was
        carefully designed to allow the world to be modified only when safe.
        Calling this method yourself disables an important safety check.
        """
        if not arg_0._is_locked:
            yield
        else:
            try:
                arg_0._is_locked = False
                yield
            finally:
                arg_0._is_locked = True

Allow tokens to modify the world for the duration of a with - block .


def Func(arg_0, arg_1, arg_2):
        """Given a parameter with type information, convert and validate it.

        Args:
            arg_name (str): The name of the argument to convert and validate
            arg_value (object): The value to convert and validate

        Returns:
            object: The converted value.
        """

        arg_0._ensure_loaded()

        arg_3 = arg_0.param_type(arg_1)
        if arg_3 is None:
            return arg_2

        arg_4 = typeinfo.type_system.convert_to_type(arg_2, arg_3)

        arg_5 = arg_0.annotated_params[arg_1].validators
        if len(arg_5) == 0:
            return arg_4

        arg_6 = typeinfo.type_system.get_type(arg_3)

        # Run all of the validators that were defined for this argument.
        # If the validation fails, they will raise an exception that we convert to
        # an instance of ValidationError
        try:
            for arg_7, arg_8 in arg_5:
                if not hasattr(arg_6, arg_7):
                    raise ValidationError("Could not find validator specified for argument", argument=arg_1, arg_7=arg_7, type=str(arg_6), method=dir(arg_6))

                arg_9 = getattr(arg_6, arg_7)
                arg_9(arg_4, *arg_8)
        except (ValueError, TypeError) as exc:
            raise ValidationError(exc.args[0], argument=arg_1, arg_2=arg_4)

        return arg_4

Given a parameter with type information convert and validate it .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 = next ( string_arg ( arg_0 , arg_1 ) , '' ) arg_2 = next ( string_arg ( arg_0 , arg_2 ) , '' ) for arg_3 in seq : arg_4 = arg_0 . copy ( arg_3 = arg_3 ) yield from pexpr . compute ( arg_4 )

def Func(arg_0, arg_1, arg_2):
    '''
    Yields a sequence of a single value, the result of looking up a value from the tables provided in the context, or an empty sequence if lookup is unsuccessful

    * tableid: id of the lookup table to use
    * expr: expression to be converted to string, then dynamically evaluated for each item on the sequence to produce the result
    '''
    arg_1 = next(string_arg(arg_0, arg_1), '')
    arg_2 = next(string_arg(arg_0, arg_2), '')
    #value = ctx.
    for arg_3 in seq:
        arg_4 = arg_0.copy(arg_3=arg_3)
        yield from pexpr.compute(arg_4)

Yields a sequence of a single value the result of looking up a value from the tables provided in the context or an empty sequence if lookup is unsuccessful


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
arg_1
.
strip
(
)
arg_2
=
arg_0
.
_regex
.
match
(
arg_1
)
if
arg_2
:
arg_3
=
{
}
for
arg_4
,
arg_5
in
enumerate
(
arg_2
.
groups
(
)
)
:
if
arg_5
==
"-"
:
arg_6
,
arg_7
=
arg_0
.
_names
[
arg_4
]
,
else
:
arg_6
,
arg_7
=
arg_0
.
_names
[
arg_4
]
,
arg_0
.
_types
[
arg_4
]
(
arg_5
)
arg_3
[
arg_6
]
=
arg_7
return
arg_3
raise
ApacheLogParserError
(
"Unable to Func: %s"
%
arg_1
)

def Func(arg_0, arg_1):
        """
        Parses a single line from the log file and returns
        a dictionary of it's contents.

        Raises and exception if it couldn't Func the line
        """
        arg_1 = arg_1.strip()
        arg_2 = arg_0._regex.match(arg_1)

        if arg_2:
            arg_3 = {}
            for arg_4, arg_5 in enumerate(arg_2.groups()):
                if arg_5 == "-":
                    arg_6, arg_7 = arg_0._names[arg_4], None
                else:
                    arg_6, arg_7 = arg_0._names[arg_4], arg_0._types[arg_4](arg_5)
                arg_3[arg_6] = arg_7
            return arg_3

        raise ApacheLogParserError("Unable to Func: %s" % arg_1)

Parses a single line from the log file and returns
        a dictionary of it's contents.

        Raises and exception if it couldn't parse the line

Parses a single line from the log file and returns a dictionary of it s contents .


def Func ( arg_0 ) : try : return arg_0 . extensions . get_extension_for_oid ( x509 . oid . ExtensionOID . EXTENDED_KEY_USAGE ) . value except x509 . ExtensionNotFound : return None

def Func(arg_0):
    """
    Given an X.509 certificate, extract and return the extendedKeyUsage
    extension.
    """
    try:
        return arg_0.extensions.get_extension_for_oid(
            x509.oid.ExtensionOID.EXTENDED_KEY_USAGE
        ).value
    except x509.ExtensionNotFound:
        return None

Given an X . 509 certificate extract and return the extendedKeyUsage extension .


def Func ( arg_0 ) : arg_1 = _mysql . connect ( ** arg_0 . _db_args ) if arg_1 is not None : arg_0 . close ( ) arg_0 . _db = arg_1

def Func(arg_0):
        """Closes the existing database connection and re-opens it."""
        arg_1 = _mysql.connect(**arg_0._db_args)
        if arg_1 is not None:
            arg_0.close()
            arg_0._db = arg_1

Closes the existing database connection and re - opens it .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
conn
.
cursor
(
)
arg_1
.
execute
(
"PRAGMA database_list"
)
arg_2
=
arg_1
.
fetchall
(
)
for
arg_3
in
arg_2
:
if
arg_3
[
1
]
==
str
(
"main"
)
:
return
arg_3
[
2
]

def Func(arg_0):
        """
        Should return the path to the database

        Returns
        -------
        path : unicode
            path to the database, empty string for in-memory databases
        """
        arg_1 = arg_0.conn.cursor()
        arg_1.execute("PRAGMA database_list")
        arg_2 = arg_1.fetchall()
        for arg_3 in arg_2:
            if arg_3[1] == str("main"):
                return arg_3[2]


return parent.is_type(TokenType.expression) and child.node_type == parent.node_type

def Func ( arg_0 , arg_1 ) : return arg_1 . is_type ( TokenType . expression ) and arg_0 . node_type == arg_1 . node_type

def Func(arg_0, arg_1):
    """Custom flattening method for the parse tree."""
    return arg_1.is_type(TokenType.expression) and arg_0.node_type == arg_1.node_type

Custom flattening method for the parse tree .


(cls, permWorkDir, outputLabel, hyperSearchJob)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 . getJobID ( ) arg_5 = arg_0 . __getHyperSearchJobIDFilePath ( arg_1 = arg_1 , arg_2 = arg_2 ) if os . path . exists ( arg_5 ) : _backupFile ( arg_5 ) arg_6 = dict ( hyperSearchJobID = arg_4 ) with open ( arg_5 , "wb" ) as jobIdPickleFile : pickle . dump ( arg_6 , jobIdPickleFile )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Saves the given _HyperSearchJob instance's jobID to file

    Parameters:
    ----------------------------------------------------------------------
    permWorkDir:   Directory path for saved jobID file
    outputLabel:   Label string for incorporating into file name for saved jobID
    hyperSearchJob: _HyperSearchJob instance
    retval:        nothing
    """
    arg_4 = arg_3.getJobID()
    arg_5 = arg_0.__getHyperSearchJobIDFilePath(arg_1=arg_1,
                                                 arg_2=arg_2)

    if os.path.exists(arg_5):
      _backupFile(arg_5)

    arg_6 = dict(hyperSearchJobID = arg_4)

    with open(arg_5, "wb") as jobIdPickleFile:
      pickle.dump(arg_6, jobIdPickleFile)

Saves the given _HyperSearchJob instance s jobID to file


(cls, entries, additional_columns=None,
                       only_show=None, numbers=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
False
)
:
arg_2
=
arg_2
or
[
]
if
arg_3
is
not
:
arg_5
=
_uniquify
(
arg_3
)
else
:
arg_5
=
_uniquify
(
arg_0
.
DEFAULT_COLUMNS
+
arg_2
)
arg_6
=
[
arg_0
.
prettyname
(
col
)
for
col
in
arg_5
]
arg_7
=
[
arg_6
]
if
arg_4
is
False
else
[
[
''
]
+
arg_6
]
for
arg_8
,
arg_9
in
enumerate
(
arg_1
)
:
arg_10
=
[
arg_9
.
_get_attrib
(
c
,
convert_to_str
=
True
)
for
c
in
arg_5
]
arg_7
.
append
(
arg_10
if
arg_4
is
False
else
[
arg_8
]
+
arg_10
)
arg_11
=
get_current_terminal_width
(
)
arg_12
=
[
get_color_hash
(
c
,
MIN_COLOR_BRIGHT
,
MAX_COLOR_BRIGHT
)
for
c
in
arg_5
]
if
arg_11
>=
get_table_width
(
arg_7
)
:
return
render_table
(
arg_7
,
column_colors
=
arg_12
if
arg_4
is
False
else
[
green
]
+
arg_12
)
else
:
arg_13
=
[
]
arg_14
=
1
if
arg_4
is
True
else
0
for
arg_10
in
arg_7
[
1
:
]
:
arg_15
=
[
green
(
'%s:'
%
arg_10
[
0
]
if
arg_4
is
True
else
'-----'
)
]
for
arg_8
,
arg_16
in
enumerate
(
arg_10
[
arg_14
:
]
)
:
arg_17
=
arg_12
[
arg_8
1
if
arg_4
is
True
else
arg_8
]
arg_18
=
arg_5
[
arg_8
]
arg_15
.
append
(
'  %s: %s'
%
(
arg_18
,
arg_17
(
arg_16
)
)
)
arg_13
.
append
(
'\n'
.
join
(
arg_15
)
)
return
'\n'
.
join
(
arg_13
)

def Func(arg_0, arg_1, arg_2=None,
                       arg_3=None, arg_4=False):
        """
        Pretty-prints a list of entries. If the window is wide enough to
        support printing as a table, runs the `print_table.render_table`
        function on the table. Otherwise, constructs a line-by-line
        representation..

        :param entries: A list of entries.
        :type entries: [:py:class:`HostEntry`]
        :param additional_columns: Columns to show in addition to defaults.
        :type additional_columns: ``list`` of ``str``
        :param only_show: A specific list of columns to show.
        :type only_show: ``NoneType`` or ``list`` of ``str``
        :param numbers: Whether to include a number column.
        :type numbers: ``bool``

        :return: A pretty-printed string.
        :rtype: ``str``
        """
        arg_2 = arg_2 or []
        if arg_3 is not None:
            arg_5 = _uniquify(arg_3)
        else:
            arg_5 = _uniquify(arg_0.DEFAULT_COLUMNS + arg_2)
        arg_6 = [arg_0.prettyname(col) for col in arg_5]
        arg_7 = [arg_6] if arg_4 is False else [[''] + arg_6]
        for arg_8, arg_9 in enumerate(arg_1):
            arg_10 = [arg_9._get_attrib(c, convert_to_str=True) for c in arg_5]
            arg_7.append(arg_10 if arg_4 is False else [arg_8] + arg_10)
        arg_11 = get_current_terminal_width()
        arg_12 = [get_color_hash(c, MIN_COLOR_BRIGHT, MAX_COLOR_BRIGHT)
                  for c in arg_5]
        if arg_11 >= get_table_width(arg_7):
            return render_table(arg_7,
                                column_colors=arg_12 if arg_4 is False
                                              else [green] + arg_12)
        else:
            arg_13 = []
            arg_14 = 1 if arg_4 is True else 0
            for arg_10 in arg_7[1:]:
                arg_15 = [green('%s:' % arg_10[0] if arg_4 is True else '-----')]
                for arg_8, arg_16 in enumerate(arg_10[arg_14:]):
                    arg_17 = arg_12[arg_8-1 if arg_4 is True else arg_8]
                    arg_18 = arg_5[arg_8]
                    arg_15.append('  %s: %s' % (arg_18, arg_17(arg_16)))
                arg_13.append('\n'.join(arg_15))
            return '\n'.join(arg_13)

Pretty - prints a list of entries . If the window is wide enough to support printing as a table runs the print_table . render_table function on the table . Otherwise constructs a line - by - line representation ..


def Func(arg_0):
    """Check if a string is a valid date

        Args:
            date(str)

        Returns:
            bool
    """
    arg_1 = re.compile("^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])")
    if re.match(arg_1, arg_0):
        return True

    return False


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) > 0 : arg_2 = sum ( map ( lambda galaxy : galaxy . deflections_from_grid ( arg_0 ) , arg_1 ) ) else : arg_2 = np . full ( ( arg_0 . shape [ 0 ] , 2 ) , 0.0 ) if isinstance ( arg_0 , grids . SubGrid ) : return np . asarray ( [ arg_0 . regular_data_1d_from_sub_data_1d ( arg_2 [ : , 0 ] ) , arg_0 . regular_data_1d_from_sub_data_1d ( arg_2 [ : , 1 ] ) ] ) . T return arg_2

def Func(arg_0, arg_1):
    """Compute the deflections of a list of galaxies from an input grid, by summing the individual deflections \
    of each galaxy's mass profile.

    If the input grid is a *grids.SubGrid*, the potential is calculated on the sub-grid and binned-up to the \
    original regular grid by taking the mean value of every set of sub-pixels.

    If no galaxies are entered into the function, an array of all zeros is returned.

    Parameters
    -----------
    grid : RegularGrid
        The grid (regular or sub) of (y,x) arc-second coordinates at the centre of every unmasked pixel which the \
        deflections is calculated on.
    galaxies : [galaxy.Galaxy]
        The galaxies whose mass profiles are used to compute the surface densities.
    """
    if len(arg_1) > 0:
        arg_2 = sum(map(lambda galaxy: galaxy.deflections_from_grid(arg_0), arg_1))
    else:
        arg_2 = np.full((arg_0.shape[0], 2), 0.0)

    if isinstance(arg_0, grids.SubGrid):
        return np.asarray([arg_0.regular_data_1d_from_sub_data_1d(arg_2[:, 0]),
                           arg_0.regular_data_1d_from_sub_data_1d(arg_2[:, 1])]).T

    return arg_2

Compute the deflections of a list of galaxies from an input grid by summing the individual deflections \ of each galaxy s mass profile .


(state, text, pattern=True, not_typed_msg=None)

def Func(arg_0, arg_1, arg_2=True, arg_3=None):
    """Test the student code.

    Tests if the student typed a (pattern of) text. It is advised to use ``has_equal_ast()`` instead of ``Func()``,
    as it is more robust to small syntactical differences that don't change the code's behavior.

    Args:
        text (str): the text that is searched for
        pattern (bool): if True (the default), the text is treated as a pattern. If False, it is treated as plain text.
        not_typed_msg (str): feedback message to be displayed if the student did not type the text.

    :Example:

        Student code and solution code::

            y = 1 + 2 + 3

        SCT::

            # Verify that student code contains pattern (not robust!!):
            Ex().Func(r"1\\s*\\+2\\s*\\+3")

    """
    if not arg_3:
        if arg_2:
            arg_3 = "Could not find the correct pattern in your code."
        else:
            arg_3 = "Could not find the following text in your code: %r" % arg_1

    arg_4 = arg_0.student_code

    arg_5 = arg_0.build_message(arg_3)
    arg_0.do_test(
        StringContainsTest(arg_4, arg_1, arg_2, Feedback(arg_5, arg_0))
    )

    return arg_0

Test the student code.

    Tests if the student typed a (pattern of) text. It is advised to use ``has_equal_ast()`` instead of ``has_code()``,
    as it is more robust to small syntactical differences that don't change the code's behavior.

    Args:
        text (str): the text that is searched for
        pattern (bool): if True (the default), the text is treated as a pattern. If False, it is treated as plain text.
        not_typed_msg (str): feedback message to be displayed if the student did not type the text.

    :Example:

        Student code and solution code::

            y = 1 + 2 + 3

        SCT::

            # Verify that student code contains pattern (not robust!!):
            Ex().has_code(r"1\\s*\\+2\\s*\\+3")