(model_matrix,
                 response,
                 model_coefficients,
                 predicted_linear_response,
                 offset,
                 name=None)

return [
      model_matrix,
      response,
      model_coefficients,
      predicted_linear_response,
      offset,
  ]

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None ) : arg_6 = [ arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ] with tf . compat . v1 . name_scope ( arg_5 , 'Func' , arg_6 ) : arg_7 = dtype_util . common_dtype ( arg_6 , np . float32 ) arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_7 = arg_7 , arg_5 = 'model_matrix' ) if arg_4 is not None : arg_4 = tf . convert_to_tensor ( value = arg_4 , arg_7 = arg_7 , arg_5 = 'offset' ) arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_7 = arg_7 , arg_5 = 'response' ) arg_8 = arg_2 is None if arg_8 : arg_9 = tf . shape ( input = arg_0 ) [ : - 2 ] arg_10 = tf . shape ( input = arg_0 ) [ - 1 ] arg_2 = tf . zeros ( shape = tf . concat ( [ arg_9 , [ arg_10 ] ] , axis = 0 ) , arg_7 = arg_7 , arg_5 = 'model_coefficients' ) else : arg_2 = tf . convert_to_tensor ( value = arg_2 , arg_7 = arg_7 , arg_5 = 'model_coefficients' ) if arg_3 is None : if arg_8 : if arg_4 is None : arg_3 = tf . zeros_like ( arg_1 , arg_7 , arg_5 = 'predicted_linear_response' ) else : arg_3 = tf . broadcast_to ( arg_4 , tf . shape ( input = arg_1 ) , arg_5 = 'predicted_linear_response' ) else : arg_3 = calculate_linear_predictor ( arg_0 , arg_2 , arg_4 ) else : arg_3 = tf . convert_to_tensor ( value = arg_3 , arg_7 = arg_7 , arg_5 = 'predicted_linear_response' ) return [ arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , ]

def Func(arg_0,
                 arg_1,
                 arg_2,
                 arg_3,
                 arg_4,
                 arg_5=None):
  """Helper to `fit` which sanitizes input args.

  Args:
    model_matrix: (Batch of) `float`-like, matrix-shaped `Tensor` where each row
      represents a sample's features.
    response: (Batch of) vector-shaped `Tensor` where each element represents a
      sample's observed response (to the corresponding row of features). Must
      have same `dtype` as `model_matrix`.
    model_coefficients: Optional (batch of) vector-shaped `Tensor` representing
      the model coefficients, one for each column in `model_matrix`. Must have
      same `dtype` as `model_matrix`.
      Default value: `tf.zeros(tf.shape(model_matrix)[-1], model_matrix.dtype)`.
    predicted_linear_response: Optional `Tensor` with `shape`, `dtype` matching
      `response`; represents `offset` shifted initial linear predictions based
      on current `model_coefficients`.
      Default value: `offset` if `model_coefficients is None`, and
      `tf.linalg.matvec(model_matrix, model_coefficients_start) + offset`
      otherwise.
    offset: Optional `Tensor` with `shape`, `dtype` matching `response`;
      represents constant shift applied to `predicted_linear_response`.
      Default value: `None` (i.e., `tf.zeros_like(response)`).
    name: Python `str` used as name prefix to ops created by this function.
      Default value: `"Func"`.

  Returns:
    model_matrix: A `Tensor` with `shape`, `dtype` and values of the
      `model_matrix` argument.
    response: A `Tensor` with `shape`, `dtype` and values of the
      `response` argument.
    model_coefficients_start: A `Tensor` with `shape`, `dtype` and
      values of the `model_coefficients_start` argument if specified.
      A (batch of) vector-shaped `Tensors` with `dtype` matching `model_matrix`
      containing the default starting point otherwise.
    predicted_linear_response:  A `Tensor` with `shape`, `dtype` and
      values of the `predicted_linear_response` argument if specified.
      A `Tensor` with `shape`, `dtype` matching `response` containing the
      default value otherwise.
    offset: A `Tensor` with `shape`, `dtype` and values of the `offset` argument
      if specified or `None` otherwise.
  """
  arg_6 = [arg_0, arg_1, arg_2,
                arg_3, arg_4]
  with tf.compat.v1.name_scope(arg_5, 'Func', arg_6):
    arg_7 = dtype_util.common_dtype(arg_6, np.float32)

    arg_0 = tf.convert_to_tensor(
        value=arg_0, arg_7=arg_7, arg_5='model_matrix')

    if arg_4 is not None:
      arg_4 = tf.convert_to_tensor(value=arg_4, arg_7=arg_7, arg_5='offset')

    arg_1 = tf.convert_to_tensor(
        value=arg_1, arg_7=arg_7, arg_5='response')

    arg_8 = arg_2 is None
    if arg_8:
      # User did not supply model coefficients; assume they're all zero.
      arg_9 = tf.shape(input=arg_0)[:-2]
      arg_10 = tf.shape(input=arg_0)[-1]
      arg_2 = tf.zeros(
          shape=tf.concat([arg_9, [arg_10]], axis=0),
          arg_7=arg_7, arg_5='model_coefficients')
    else:
      # User did supply model coefficients; convert to Tensor in case it's
      # numpy or literal.
      arg_2 = tf.convert_to_tensor(
          value=arg_2, arg_7=arg_7, arg_5='model_coefficients')

    if arg_3 is None:
      if arg_8:
        # Since we're using zeros for model_coefficients, we know the predicted
        # linear response will also be all zeros.
        if arg_4 is None:
          arg_3 = tf.zeros_like(
              arg_1, arg_7, arg_5='predicted_linear_response')
        else:
          arg_3 = tf.broadcast_to(
              arg_4,
              tf.shape(input=arg_1),
              arg_5='predicted_linear_response')
      else:
        # We were given model_coefficients but not the predicted linear
        # response.
        arg_3 = calculate_linear_predictor(
            arg_0, arg_2, arg_4)
    else:
      arg_3 = tf.convert_to_tensor(
          value=arg_3,
          arg_7=arg_7,
          arg_5='predicted_linear_response')

  return [
      arg_0,
      arg_1,
      arg_2,
      arg_3,
      arg_4,
  ]

Helper to `fit` which sanitizes input args.

  Args:
    model_matrix: (Batch of) `float`-like, matrix-shaped `Tensor` where each row
      represents a sample's features.
    response: (Batch of) vector-shaped `Tensor` where each element represents a
      sample's observed response (to the corresponding row of features). Must
      have same `dtype` as `model_matrix`.
    model_coefficients: Optional (batch of) vector-shaped `Tensor` representing
      the model coefficients, one for each column in `model_matrix`. Must have
      same `dtype` as `model_matrix`.
      Default value: `tf.zeros(tf.shape(model_matrix)[-1], model_matrix.dtype)`.
    predicted_linear_response: Optional `Tensor` with `shape`, `dtype` matching
      `response`; represents `offset` shifted initial linear predictions based
      on current `model_coefficients`.
      Default value: `offset` if `model_coefficients is None`, and
      `tf.linalg.matvec(model_matrix, model_coefficients_start) + offset`
      otherwise.
    offset: Optional `Tensor` with `shape`, `dtype` matching `response`;
      represents constant shift applied to `predicted_linear_response`.
      Default value: `None` (i.e., `tf.zeros_like(response)`).
    name: Python `str` used as name prefix to ops created by this function.
      Default value: `"prepare_args"`.

  Returns:
    model_matrix: A `Tensor` with `shape`, `dtype` and values of the
      `model_matrix` argument.
    response: A `Tensor` with `shape`, `dtype` and values of the
      `response` argument.
    model_coefficients_start: A `Tensor` with `shape`, `dtype` and
      values of the `model_coefficients_start` argument if specified.
      A (batch of) vector-shaped `Tensors` with `dtype` matching `model_matrix`
      containing the default starting point otherwise.
    predicted_linear_response:  A `Tensor` with `shape`, `dtype` and
      values of the `predicted_linear_response` argument if specified.
      A `Tensor` with `shape`, `dtype` matching `response` containing the
      default value otherwise.
    offset: A `Tensor` with `shape`, `dtype` and values of the `offset` argument
      if specified or `None` otherwise.

Helper to fit which sanitizes input args .


(master_dict, mash_output, sample_id, assembly_file)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
{
}
if
arg_0
:
arg_5
=
open
(
"{}.json"
.
format
(
""
.
join
(
arg_1
.
split
(
"."
)
[
0
]
)
)
,
"w"
)
arg_5
.
write
(
json
.
dumps
(
arg_0
)
)
arg_5
.
close
(
)
for
arg_6
,
arg_7
in
arg_0
.
items
(
)
:
if
not
arg_7
[
2
]
in
arg_4
:
arg_4
[
arg_7
[
2
]
]
=
[
arg_6
]
else
:
arg_4
[
arg_7
[
2
]
]
.
append
(
arg_6
)
arg_8
=
len
(
arg_0
)
else
:
arg_8
=
0
arg_9
=
{
"tableRow"
:
[
{
"sample"
:
arg_2
,
"data"
:
[
{
"header"
:
"Mash Dist"
,
"table"
:
"plasmids"
,
"patlas_mashdist"
:
arg_0
,
"value"
:
arg_8
}
]
}
]
,
"plotData"
:
[
{
"sample"
:
arg_2
,
"data"
:
{
"patlasMashDistXrange"
:
arg_4
}
,
"assemblyFile"
:
arg_3
}
]
}
with
open
(
".report.json"
,
"w"
)
as
json_report
:
json_report
.
write
(
json
.
dumps
(
arg_9
,
separators
=
(
","
,
":"
)
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Send dictionary to output json file
    This function sends master_dict dictionary to a json file if master_dict is
    populated with entries, otherwise it won't create the file

    Parameters
    ----------
    master_dict: dict
        dictionary that stores all entries for a specific query sequence
        in multi-fasta given to mash dist as input against patlas database
    last_seq: str
        string that stores the last sequence that was parsed before writing to
        file and therefore after the change of query sequence between different
        rows on the input file
    mash_output: str
        the name/path of input file to main function, i.e., the name/path of
        the mash dist output txt file.
    sample_id: str
        The name of the sample being parse to .report.json file

    Returns
    -------

    """

    arg_4 = {}

    # create a new file only if master_dict is populated
    if arg_0:
        arg_5 = open("{}.json".format(
            "".join(arg_1.split(".")[0])), "w")
        arg_5.write(json.dumps(arg_0))
        arg_5.close()

        # iterate through master_dict in order to make contigs the keys
        for arg_6,arg_7 in arg_0.items():
            if not arg_7[2] in arg_4:
                arg_4[arg_7[2]] = [arg_6]
            else:
                arg_4[arg_7[2]].append(arg_6)

        arg_8 = len(arg_0)
    else:
        arg_8 = 0

    arg_9 = {
        "tableRow": [{
            "sample": arg_2,
            "data": [{
                "header": "Mash Dist",
                "table": "plasmids",
                "patlas_mashdist": arg_0,
                "value": arg_8
            }]
        }],
        "plotData": [{
            "sample": arg_2,
            "data": {
                "patlasMashDistXrange": arg_4
            },
            "assemblyFile": arg_3
        }]
    }

    with open(".report.json", "w") as json_report:
        json_report.write(json.dumps(arg_9, separators=(",", ":")))

Send dictionary to output json file This function sends master_dict dictionary to a json file if master_dict is populated with entries otherwise it won t create the file


def Func ( arg_0 , arg_1 ) : arg_2 = current_app . config [ 'MAIL_USERNAME' ] arg_3 = current_app . config [ 'TICKET_SYSTEM_EMAIL' ] controllers . Func ( store , mail , current_user , arg_0 , arg_1 , arg_2 , arg_3 ) return redirect ( request . referrer )

def Func(arg_0, arg_1):
    """Request a case to be Func."""
    arg_2 = current_app.config['MAIL_USERNAME']
    arg_3 = current_app.config['TICKET_SYSTEM_EMAIL']
    controllers.Func(store, mail, current_user, arg_0, arg_1, arg_2,
                      arg_3)
    return redirect(request.referrer)


def Func ( arg_0 , arg_1 = 0 , arg_2 = arg_3 ) : return ep . Func ( arg_0 , arg_1 = arg_1 )

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """
    Determines the Sortino ratio of a strategy.

    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 Sortino ratio.
    """

    return ep.Func(arg_0, arg_1=arg_1)

Determines the Sortino ratio of a strategy .


def
Func
(
arg_0
)
:
arg_1
=
want_bytes
(
arg_0
.
salt
)
if
arg_0
.
key_derivation
==
'concat'
:
return
arg_0
.
digest_method
(
arg_1
+
arg_0
.
secret_key
)
.
digest
(
)
elif
arg_0
.
key_derivation
==
'django-concat'
:
return
arg_0
.
digest_method
(
arg_1
+
b'signer'
+
arg_0
.
secret_key
)
.
digest
(
)
elif
arg_0
.
key_derivation
==
'hmac'
:
arg_2
=
hmac
.
new
(
arg_0
.
secret_key
,
digestmod
=
arg_0
.
digest_method
)
arg_2
.
update
(
arg_1
)
return
arg_2
.
digest
(
)
elif
arg_0
.
key_derivation
==
'none'
:
return
arg_0
.
secret_key
else
:
raise
TypeError
(
'Unknown key derivation method'
)

def Func(arg_0):
        """This method is called to derive the key.  If you're unhappy with
        the default key derivation choices you can override them here.
        Keep in mind that the key derivation in itsdangerous is not intended
        to be used as a security method to make a complex key out of a short
        password.  Instead you should use large random secret keys.
        """
        arg_1 = want_bytes(arg_0.salt)
        if arg_0.key_derivation == 'concat':
            return arg_0.digest_method(arg_1 + arg_0.secret_key).digest()
        elif arg_0.key_derivation == 'django-concat':
            return arg_0.digest_method(arg_1 + b'signer' +
                arg_0.secret_key).digest()
        elif arg_0.key_derivation == 'hmac':
            arg_2 = hmac.new(arg_0.secret_key, digestmod=arg_0.digest_method)
            arg_2.update(arg_1)
            return arg_2.digest()
        elif arg_0.key_derivation == 'none':
            return arg_0.secret_key
        else:
            raise TypeError('Unknown key derivation method')

This method is called to derive the key . If you re unhappy with the default key derivation choices you can override them here . Keep in mind that the key derivation in itsdangerous is not intended to be used as a security method to make a complex key out of a short password . Instead you should use large random secret keys .


(
    forms: Iterable[ReaderForm],
    ctx: CompilerContext,
    module: types.ModuleType,
    collect_bytecode: Optional[BytecodeCollector] = None,
)

def Func(
    arg_0: arg_1[arg_2],
    arg_3: arg_4,
    arg_5: arg_6.ModuleType,
    arg_8: arg_9[arg_10] = None,
) -> None:
    """Compile an entire Basilisp module into Python bytecode which can be
    executed as a Python module.

    This function is designed to generate bytecode which can be used for the
    Basilisp import machinery, to allow callers to import Basilisp modules from
    Python code.
    """
    _bootstrap_module(arg_3.generator_context, arg_3.py_ast_optimizer, arg_5)

    for arg_11 in arg_0:
        arg_12 = gen_py_ast(arg_3.generator_context, parse_ast(arg_3.parser_context, arg_11))
        _incremental_Func(
            arg_3.py_ast_optimizer,
            arg_12,
            arg_5,
            source_filename=arg_3.filename,
            arg_8=arg_8,
        )

Compile an entire Basilisp module into Python bytecode which can be executed as a Python module .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : arg_0 . remove_tier ( arg_2 , clean = False ) arg_0 . clean_time_slots ( )

def Func(arg_0, arg_1):
        """Remove multiple tiers, note that this is a lot faster then removing
        them individually because of the delayed cleaning of timeslots.

        :param list tiers: Names of the tier to remove.
        :raises KeyError: If a tier is non existent.
        """
        for arg_2 in arg_1:
            arg_0.remove_tier(arg_2, clean=False)
        arg_0.clean_time_slots()

Remove multiple tiers note that this is a lot faster then removing them individually because of the delayed cleaning of timeslots .


def Func ( arg_0 , arg_1 : arg_2 ) -> Message : try : return arg_0 . receiver . Func ( arg_1 ) except KeyError as err : raise UnknownCommandError from err except DecodeError as err : raise UnknownCommandError ( f"{err}" ) from err

def Func(arg_0, arg_1: arg_2) -> Message:
        """\
        Parses a binary protobuf message into a Message object.
        """
        try:
            return arg_0.receiver.Func(arg_1)
        except KeyError as err:
            raise UnknownCommandError from err
        except DecodeError as err:
            raise UnknownCommandError(f"{err}") from err

\ Parses a binary protobuf message into a Message object .


return pad_top, pad_right, pad_bottom, pad_left

def Func(arg_0, arg_1):
    """
    Compute the amount of pixels by which an array has to be padded to fulfill an aspect ratio.

    The aspect ratio is given as width/height.
    Depending on which dimension is smaller (height or width), only the corresponding
    sides (left/right or top/bottom) will be padded. In each case, both of the sides will
    be padded equally.

    Parameters
    ----------
    arr : (H,W) ndarray or (H,W,C) ndarray
        Image-like array for which to compute pad amounts.

    aspect_ratio : float
        Target aspect ratio, given as width/height. E.g. 2.0 denotes the image having twice
        as much width as height.

    Returns
    -------
    result : tuple of int
        Required paddign amounts to reach the target aspect ratio, given as a tuple
        of the form ``(top, right, bottom, left)``.

    """
    do_assert(arg_0.ndim in [2, 3])
    do_assert(arg_1 > 0)
    arg_2, arg_3 = arg_0.shape[0:2]
    do_assert(arg_2 > 0)
    arg_4 = arg_3 / arg_2

    arg_5 = 0
    arg_6 = 0
    arg_7 = 0
    arg_8 = 0

    if arg_4 < arg_1:
        # vertical image, height > width
        arg_9 = (arg_1 * arg_2) - arg_3
        arg_6 = int(np.ceil(arg_9 / 2))
        arg_8 = int(np.floor(arg_9 / 2))
    elif arg_4 > arg_1:
        # horizontal image, width > height
        arg_9 = ((1/arg_1) * arg_3) - arg_2
        arg_5 = int(np.floor(arg_9 / 2))
        arg_7 = int(np.ceil(arg_9 / 2))

    return arg_5, arg_6, arg_7, arg_8

Compute the amount of pixels by which an array has to be padded to fulfill an aspect ratio .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = arg_0 . _formatter . _format_lines ( [ ( arg_1 , u'dummy' ) ] ) . next ( ) arg_0 . _document . setHtml ( arg_4 ) return QtGui . QTextCursor ( arg_0 . _document ) . charFormat ( )

def Func(arg_0, arg_1, arg_2):
        """ Returns a QTextCharFormat for token by
        """
        arg_3, arg_4 = arg_0._formatter._format_lines([(arg_1, u'dummy')]).next()
        arg_0._document.setHtml(arg_4)
        return QtGui.QTextCursor(arg_0._document).charFormat()


def Func ( arg_0 : arg_1 ) -> Set [ NodePair ] : arg_2 = get_causal_subgraph ( arg_0 ) arg_3 = set ( ) for arg_4 , arg_5 , arg_6 in arg_2 . edges ( data = True ) : if arg_6 [ RELATION ] not in CAUSAL_INCREASE_RELATIONS : continue if arg_2 . has_edge ( arg_5 , arg_4 ) and any ( arg_7 [ RELATION ] in CAUSAL_DECREASE_RELATIONS for arg_7 in arg_2 [ arg_5 ] [ arg_4 ] . values ( ) ) : arg_3 . add ( ( arg_4 , arg_5 ) ) return arg_3

def Func(arg_0: arg_1) -> Set[NodePair]:
    """Find pairs of nodes that have mutual causal edges that are regulating each other such that ``A -> B`` and
    ``B -| A``.

    :return: A set of pairs of nodes with mutual causal edges
    """
    arg_2 = get_causal_subgraph(arg_0)

    arg_3 = set()

    for arg_4, arg_5, arg_6 in arg_2.edges(data=True):
        if arg_6[RELATION] not in CAUSAL_INCREASE_RELATIONS:
            continue

        if arg_2.has_edge(arg_5, arg_4) and any(arg_7[RELATION] in CAUSAL_DECREASE_RELATIONS for arg_7 in arg_2[arg_5][arg_4].values()):
            arg_3.add((arg_4, arg_5))

    return arg_3

Find pairs of nodes that have mutual causal edges that are regulating each other such that A - > B and B - | A .


def Func ( arg_0 , arg_1 ) : arg_2 = np . flipud ( np . sort ( arg_0 . ravel ( ) ) ) arg_3 = ( 1 - np . cumsum ( arg_2 ) ) / ( 1. + np . arange ( arg_2 . size ) ) arg_4 = np . where ( arg_2 + arg_3 > 0 ) [ 0 ] . max ( ) return np . maximum ( arg_0 + arg_3 [ arg_4 ] , 0 )

def Func(arg_0, arg_1):
    """
    Projection onto the probability Func

    http://arxiv.org/pdf/1309.1541v1.pdf
    """

    # sort the elements in descending order
    arg_2 = np.flipud(np.sort(arg_0.ravel()))
    arg_3 = (1 - np.cumsum(arg_2)) / (1. + np.arange(arg_2.size))
    arg_4 = np.where(arg_2 + arg_3 > 0)[0].max()
    return np.maximum(arg_0 + arg_3[arg_4], 0)

Projection onto the probability simplex

    http://arxiv.org/pdf/1309.1541v1.pdf


def Func ( arg_0 ) : arg_1 = ed . MultivariateNormalDiag ( loc = tf . zeros ( arg_0 . shape [ 1 ] ) , name = "coeffs" ) arg_2 = ed . Bernoulli ( logits = tf . tensordot ( arg_0 , arg_1 , [ [ 1 ] , [ 0 ] ] ) , name = "labels" ) return arg_2

def Func(arg_0):
  """Bayesian logistic regression, which returns labels given features."""
  arg_1 = ed.MultivariateNormalDiag(
      loc=tf.zeros(arg_0.shape[1]), name="coeffs")
  arg_2 = ed.Bernoulli(
      logits=tf.tensordot(arg_0, arg_1, [[1], [0]]), name="labels")
  return arg_2

Bayesian logistic regression which returns labels given features .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
try
:
arg_3
=
getattr
(
settings
,
arg_0
)
except
AttributeError
:
raise
AnalyticalException
(
"%s setting: not found"
%
arg_0
)
if
not
arg_3
:
raise
AnalyticalException
(
"%s setting is not set"
%
arg_0
)
arg_3
=
str
(
arg_3
)
if
not
arg_1
.
search
(
arg_3
)
:
raise
AnalyticalException
(
"%s setting: %s: '%s'"
%
(
arg_0
,
arg_2
,
arg_3
)
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
    """
    Return a constant from ``django.conf.settings``.  The `setting`
    argument is the constant name, the `value_re` argument is a regular
    expression used to validate the setting value and the `invalid_msg`
    argument is used as exception message if the value is not valid.
    """
    try:
        arg_3 = getattr(settings, arg_0)
    except AttributeError:
        raise AnalyticalException("%s setting: not found" % arg_0)
    if not arg_3:
        raise AnalyticalException("%s setting is not set" % arg_0)
    arg_3 = str(arg_3)
    if not arg_1.search(arg_3):
        raise AnalyticalException("%s setting: %s: '%s'"
                                  % (arg_0, arg_2, arg_3))
    return arg_3

Return a constant from django . conf . settings . The setting argument is the constant name the value_re argument is a regular expression used to validate the setting value and the invalid_msg argument is used as exception message if the value is not valid .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = [ ] if arg_3 : arg_5 = max ( 0.01 , arg_0 . option . sleep ) arg_6 = arg_1 . fileno ( ) while True : try : if select . select ( [ arg_6 ] , [ ] , [ ] , arg_5 ) : try : arg_7 = arg_1 . readline ( ) if arg_7 == '' : break arg_4 . append ( arg_0 . Func_line ( arg_7 ) ) except ValueError : continue if arg_0 . option . sort_by_column : arg_4 = sorted ( arg_4 , key = itemgetter ( arg_0 . option . sort_by_column - 1 ) ) if len ( arg_4 ) > 1 : arg_4 = arg_4 [ - arg_0 . maximum_points : ] arg_0 . update ( [ arg_8 [ 0 ] for arg_8 in arg_4 ] , [ arg_8 [ 1 ] for arg_8 in arg_4 ] ) arg_0 . render ( arg_2 ) time . sleep ( arg_5 ) except KeyboardInterrupt : break else : for arg_7 in arg_1 : try : arg_4 . append ( arg_0 . Func_line ( arg_7 ) ) except ValueError : pass if arg_0 . option . sort_by_column : arg_4 = sorted ( arg_4 , key = itemgetter ( arg_0 . option . sort_by_column - 1 ) ) arg_0 . update ( [ arg_8 [ 0 ] for arg_8 in arg_4 ] , [ arg_8 [ 1 ] for arg_8 in arg_4 ] ) arg_0 . render ( arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """Read points from istream and output to ostream."""
        arg_4 = []  # List of 2-tuples

        if arg_3:
            arg_5 = max(0.01, arg_0.option.sleep)
            arg_6 = arg_1.fileno()
            while True:
                try:
                    if select.select([arg_6], [], [], arg_5):
                        try:
                            arg_7 = arg_1.readline()
                            if arg_7 == '':
                                break
                            arg_4.append(arg_0.Func_line(arg_7))
                        except ValueError:
                            continue

                        if arg_0.option.sort_by_column:
                            arg_4 = sorted(arg_4, key=itemgetter(arg_0.option.sort_by_column - 1))

                        if len(arg_4) > 1:
                            arg_4 = arg_4[-arg_0.maximum_points:]
                            arg_0.update([arg_8[0] for arg_8 in arg_4], [arg_8[1] for arg_8 in arg_4])
                            arg_0.render(arg_2)

                        time.sleep(arg_5)

                except KeyboardInterrupt:
                    break

        else:
            for arg_7 in arg_1:
                try:
                    arg_4.append(arg_0.Func_line(arg_7))
                except ValueError:
                    pass

            if arg_0.option.sort_by_column:
                arg_4 = sorted(arg_4, key=itemgetter(arg_0.option.sort_by_column - 1))

            arg_0.update([arg_8[0] for arg_8 in arg_4], [arg_8[1] for arg_8 in arg_4])
            arg_0.render(arg_2)

Read points from istream and output to ostream .


def Func ( arg_0 , arg_1 ) : if callable ( arg_1 ) : arg_2 = arg_1 arg_3 = ( ( arg_2 ( arg_6 ) , arg_6 ) for arg_6 in arg_0 ) else : arg_3 = zip ( arg_1 , arg_0 ) arg_4 = defaultdict ( list ) for arg_5 , arg_6 in arg_3 : arg_4 [ arg_5 ] . append ( arg_6 ) return arg_4

def Func(arg_0, arg_1):
    r"""
    Groups a list of items by group id.

    Args:
        items (Iterable): a list of items to group
        groupids (Iterable or Callable): a corresponding list of item groupids
            or a function mapping an item to a groupid.

    Returns:
        dict: groupid_to_items: maps a groupid to a list of items

    CommandLine:
        python -m ubelt.util_dict Func

    Example:
        >>> import ubelt as ub
        >>> items    = ['ham',     'jam',   'spam',     'eggs',    'cheese', 'banana']
        >>> groupids = ['protein', 'fruit', 'protein',  'protein', 'dairy',  'fruit']
        >>> groupid_to_items = ub.Func(items, groupids)
        >>> print(ub.repr2(groupid_to_items, nl=0))
        {'dairy': ['cheese'], 'fruit': ['jam', 'banana'], 'protein': ['ham', 'spam', 'eggs']}
    """
    if callable(arg_1):
        arg_2 = arg_1
        arg_3 = ((arg_2(arg_6), arg_6) for arg_6 in arg_0)
    else:
        arg_3 = zip(arg_1, arg_0)

    # Initialize a dict of lists
    arg_4 = defaultdict(list)
    # Insert each item into the correct group
    for arg_5, arg_6 in arg_3:
        arg_4[arg_5].append(arg_6)
    return arg_4

r"""
    Groups a list of items by group id.

    Args:
        items (Iterable): a list of items to group
        groupids (Iterable or Callable): a corresponding list of item groupids
            or a function mapping an item to a groupid.

    Returns:
        dict: groupid_to_items: maps a groupid to a list of items

    CommandLine:
        python -m ubelt.util_dict group_items

    Example:
        >>> import ubelt as ub
        >>> items    = ['ham',     'jam',   'spam',     'eggs',    'cheese', 'banana']
        >>> groupids = ['protein', 'fruit', 'protein',  'protein', 'dairy',  'fruit']
        >>> groupid_to_items = ub.group_items(items, groupids)
        >>> print(ub.repr2(groupid_to_items, nl=0))
        {'dairy': ['cheese'], 'fruit': ['jam', 'banana'], 'protein': ['ham', 'spam', 'eggs']}


return urljoin(self.API_URI, '/'.join(map(quote, parts)))

def Func ( arg_0 , * arg_1 ) : return urljoin ( arg_0 . API_URI , '/' . join ( map ( quote , arg_1 ) ) )

def Func(arg_0, *arg_1):
    """Creates fully qualified endpoint URIs.

    :param parts: the string parts that form the request URI

    """
    return urljoin(arg_0.API_URI, '/'.join(map(quote, arg_1)))


def
Func
(
arg_0
,
arg_1
=
True
)
:
arg_2
=
""
for
arg_3
in
sorted
(
dir
(
arg_0
)
)
:
if
not
"__"
in
arg_3
:
arg_2
+=
"%s\n"
%
arg_3
try
:
arg_2
+=
" ^-VALUE: %s\n"
%
getattr
(
arg_0
,
arg_3
)
(
)
except
:
pass
if
arg_1
:
arg_1
=
''
+
arg_2
+
''
arg_1
=
arg_1
.
replace
(
" "
,
" "
)
.
replace
(
"\n"
,
"
"
)
arg_4
=
tempfile
.
gettempdir
(
)
+
"/swhlab/checkout.html"
with
open
(
arg_4
,
'w'
)
as
f
:
f
.
write
(
arg_1
)
webbrowser
.
open
(
arg_4
)
print
(
arg_2
.
replace
(
''
,
''
)
.
replace
(
''
,
''
)
)

def Func(arg_0,arg_1=True):
    """show everything we can about an object's projects and methods."""
    arg_2=""
    for arg_3 in sorted(dir(arg_0)):
        if not "__" in arg_3:
            arg_2+="%s\n"%arg_3
            try:
                arg_2+=" ^-VALUE: %s\n"%getattr(arg_0,arg_3)()
            except:
                pass
    if arg_1:
        arg_1=''+arg_2+''
        arg_1=arg_1.replace(" "," ").replace("\n","
")
        arg_4 = tempfile.gettempdir()+"/swhlab/checkout.html"
        with open(arg_4,'w') as f:
            f.write(arg_1)
        webbrowser.open(arg_4)
    print(arg_2.replace('','').replace('',''))

show everything we can about an object s projects and methods .


def Func ( arg_0 , arg_1 ) : if arg_1 . args . defaults : return arg_2 = arg_1 . body if not isinstance ( arg_2 , astroid . Call ) : return if isinstance ( arg_1 . body . func , astroid . Attribute ) and isinstance ( arg_1 . body . func . expr , astroid . Call ) : return arg_3 = CallSite . from_call ( arg_2 ) arg_4 = list ( arg_1 . args . args ) arg_5 = list ( arg_0 . _filter_vararg ( arg_1 , arg_2 . args ) ) if arg_1 . args . kwarg : if arg_0 . _has_variadic_argument ( arg_2 . kwargs , arg_1 . args . kwarg ) : return if arg_1 . args . vararg : if arg_0 . _has_variadic_argument ( arg_2 . starargs , arg_1 . args . vararg ) : return elif arg_2 . starargs : return if arg_2 . keywords : arg_6 = { keyword . name for keyword in arg_1 . args . defaults } if len ( arg_6 ) != len ( arg_3 . keyword_arguments ) : return if set ( arg_3 . keyword_arguments ) . difference ( arg_6 ) : return if len ( arg_4 ) != len ( arg_5 ) : return for arg_7 , arg_8 in zip ( arg_4 , arg_5 ) : if not isinstance ( arg_8 , astroid . Name ) : return if arg_7 . name != arg_8 . name : return arg_0 . add_message ( "unnecessary-lambda" , line = arg_1 . fromlineno , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """check whether or not the lambda is suspicious
        """
        # if the body of the lambda is a call expression with the same
        # argument list as the lambda itself, then the lambda is
        # possibly unnecessary and at least suspicious.
        if arg_1.args.defaults:
            # If the arguments of the lambda include defaults, then a
            # judgment cannot be made because there is no way to check
            # that the defaults defined by the lambda are the same as
            # the defaults defined by the function called in the body
            # of the lambda.
            return
        arg_2 = arg_1.body
        if not isinstance(arg_2, astroid.Call):
            # The body of the lambda must be a function call expression
            # for the lambda to be unnecessary.
            return
        if isinstance(arg_1.body.func, astroid.Attribute) and isinstance(
            arg_1.body.func.expr, astroid.Call
        ):
            # Chained call, the intermediate call might
            # return something else (but we don't check that, yet).
            return

        arg_3 = CallSite.from_call(arg_2)
        arg_4 = list(arg_1.args.args)
        arg_5 = list(arg_0._filter_vararg(arg_1, arg_2.args))
        if arg_1.args.kwarg:
            if arg_0._has_variadic_argument(arg_2.kwargs, arg_1.args.kwarg):
                return

        if arg_1.args.vararg:
            if arg_0._has_variadic_argument(arg_2.starargs, arg_1.args.vararg):
                return
        elif arg_2.starargs:
            return

        if arg_2.keywords:
            # Look for additional keyword arguments that are not part
            # of the lambda's signature
            arg_6 = {keyword.name for keyword in arg_1.args.defaults}
            if len(arg_6) != len(arg_3.keyword_arguments):
                # Different lengths, so probably not identical
                return
            if set(arg_3.keyword_arguments).difference(arg_6):
                return

        # The "ordinary" arguments must be in a correspondence such that:
        # ordinary_args[i].name == call.args[i].name.
        if len(arg_4) != len(arg_5):
            return
        for arg_7, arg_8 in zip(arg_4, arg_5):
            if not isinstance(arg_8, astroid.Name):
                return
            if arg_7.name != arg_8.name:
                return

        arg_0.add_message("unnecessary-lambda", line=arg_1.fromlineno, arg_1=arg_1)


def Func ( arg_0 , arg_1 ) : if type ( arg_1 ) == bytes : return arg_1 return arg_1 . encode ( arg_0 . getEncoding ( ) )

def Func(arg_0, arg_1):
		'''
			Func - Convert a value to bytes using the encoding specified on this field

			@param value <str> - The field to convert to bytes

			@return <bytes> - The object encoded using the codec specified on this field.

			NOTE: This method may go away.
		'''
		if type(arg_1) == bytes:
			return arg_1
		return arg_1.encode(arg_0.getEncoding())

toBytes - Convert a value to bytes using the encoding specified on this field

			@param value <str> - The field to convert to bytes

			@return <bytes> - The object encoded using the codec specified on this field.

			NOTE: This method may go away.


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ ] if arg_2 is None : arg_2 = DEFAULT_ENCODING for arg_4 in arg_1 : if not isinstance ( arg_4 , unicode ) : arg_4 = arg_4 . decode ( arg_2 ) arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """decode argv if bytes, using stin.encoding, falling back on default enc"""
        arg_3 = []
        if arg_2 is None:
            arg_2 = DEFAULT_ENCODING
        for arg_4 in arg_1:
            if not isinstance(arg_4, unicode):
                # only decode if not already decoded
                arg_4 = arg_4.decode(arg_2)
            arg_3.append(arg_4)
        return arg_3

decode argv if bytes using stin . encoding falling back on default enc


def Func(arg_0, arg_1):
        """Hack in texture directory"""
        arg_2 = list(arg_0.TEXTURE_DIRS)
        arg_2.append(arg_1)
        arg_0.TEXTURE_DIRS = arg_2


def Func(arg_0):
    """
    Checks if input is VCF and reads in appropriately if it is
    """
    arg_1 = None
    arg_2 = arg_0.aln
    arg_3 = None
    if hasattr(arg_0, 'aln') and arg_0.aln is not None:
        if any([arg_0.aln.lower().endswith(arg_4) for arg_4 in ['.vcf', '.vcf.gz']]):
            if not arg_0.vcf_reference:
                print("ERROR: a reference Fasta is required with VCF-format alignments")
                return -1
            arg_5 = read_vcf(arg_0.aln, arg_0.vcf_reference)
            arg_6 = arg_5['sequences']
            arg_1 = arg_5['reference']
            arg_2 = arg_6

            if not hasattr(arg_0, 'gtr') or arg_0.gtr=="infer": #if not specified, set it:
                arg_7 = alphabets['aa'] if arg_0.aa else alphabets['nuc']
                arg_3 = [arg_1.count(base)/len(arg_1) for base in arg_7]
                if arg_3[-1] == 0:
                    arg_3[-1] = 0.05
                    arg_3 = [v-0.01 for v in arg_3]

    return arg_2, arg_1, arg_3


def Func ( arg_0 , arg_1 = '' ) : arg_2 = [ ] for arg_3 , arg_4 , arg_5 in os . walk ( arg_0 ) : arg_2 . extend ( [ op . join ( arg_3 , arg_6 ) for arg_6 in arg_5 if re . search ( arg_1 , arg_6 ) ] ) return arg_2

def Func(arg_0, arg_1=''):
    """
    Returns absolute paths of files that match the regex within file_dir and
    all its children folders.

    Note: The regex matching is done using the search function
    of the re module.

    Parameters
    ----------
    folder_path: string

    regex: string

    Returns
    -------
    A list of strings.

    """
    arg_2 = []
    for arg_3, arg_4, arg_5 in os.walk(arg_0):
        arg_2.extend([op.join(arg_3, arg_6) for arg_6 in arg_5
                        if re.search(arg_1, arg_6)])

    return arg_2

Returns absolute paths of files that match the regex within file_dir and all its children folders .


def Func(arg_0, arg_1):
        """
        Build an EncryptionKeyInformation struct from a dictionary.

        Args:
            value (dict): A dictionary containing the key/value pairs for a
                EncryptionKeyInformation struct.

        Returns:
            EncryptionKeyInformation: an EncryptionKeyInformation struct

        Raises:
            TypeError: if the input argument is invalid
        """
        if arg_1 is None:
            return None
        if not isinstance(arg_1, dict):
            raise TypeError("Encryption key information must be a dictionary.")

        arg_2 = arg_1.get('cryptographic_parameters')
        if arg_2:
            arg_2 = arg_0._build_cryptographic_parameters(
                arg_2
            )
        arg_3 = cobjects.EncryptionKeyInformation(
            unique_identifier=arg_1.get('unique_identifier'),
            arg_2=arg_2
        )
        return arg_3

Build an EncryptionKeyInformation struct from a dictionary .


def Func ( arg_0 ) : try : arg_1 = os . stat ( arg_0 ) except os . error : return False return stat . S_ISDIR ( arg_1 . st_mode )

def Func(arg_0):
    """Return true if the pathname refers to an existing directory."""
    try:
        arg_1 = os.stat(arg_0)
    except os.error:
        return False
    return stat.S_ISDIR(arg_1.st_mode)

Return true if the pathname refers to an existing directory .


def Func ( arg_0 , arg_1 = False , arg_2 = 'broadcast' ) : if arg_1 is False : arg_1 = 1 if arg_1 is True : arg_1 = np . array ( arg_0 . shape ) arg_1 = aN ( arg_1 , arg_0 . dim , dtype = 'float' ) arg_3 = list ( np . arange ( arg_0 . l [ i ] , arg_0 . r [ i ] ) / arg_1 [ i ] for i in range ( arg_0 . dim ) ) return arg_0 . _format_vector ( arg_3 , arg_2 = arg_2 )

def Func(arg_0, arg_1=False, arg_2='broadcast'):
        """
        Returns the coordinate vectors associated with the tile.

        Parameters
        -----------
        norm : boolean
            can rescale the coordinates for you. False is no rescaling, True is
            rescaling so that all coordinates are from 0 -> 1.  If a scalar,
            the same norm is applied uniformally while if an iterable, each
            scale is applied to each dimension.

        form : string
            In what form to return the vector array. Can be one of:
                'broadcast' -- return 1D arrays that are broadcasted to be 3D

                'flat' -- return array without broadcasting so each component
                    is 1D and the appropriate length as the tile

                'meshed' -- arrays are explicitly broadcasted and so all have
                    a 3D shape, each the size of the tile.

                'vector' -- array is meshed and combined into one array with
                    the vector components along last dimension [Nz, Ny, Nx, 3]

        Examples
        --------
        >>> Tile(3, dim=2).Func(form='meshed')[0]
        array([[ 0.,  0.,  0.],
               [ 1.,  1.,  1.],
               [ 2.,  2.,  2.]])

        >>> Tile(3, dim=2).Func(form='meshed')[1]
        array([[ 0.,  1.,  2.],
               [ 0.,  1.,  2.],
               [ 0.,  1.,  2.]])

        >>> Tile([4,5]).Func(form='vector').shape
        (4, 5, 2)

        >>> [i.shape for i in Tile((4,5), dim=2).Func(form='broadcast')]
        [(4, 1), (1, 5)]
        """
        if arg_1 is False:
            arg_1 = 1
        if arg_1 is True:
            arg_1 = np.array(arg_0.shape)
        arg_1 = aN(arg_1, arg_0.dim, dtype='float')

        arg_3 = list(np.arange(arg_0.l[i], arg_0.r[i]) / arg_1[i] for i in range(arg_0.dim))
        return arg_0._format_vector(arg_3, arg_2=arg_2)

Returns the coordinate vectors associated with the tile.

        Parameters
        -----------
        norm : boolean
            can rescale the coordinates for you. False is no rescaling, True is
            rescaling so that all coordinates are from 0 -> 1.  If a scalar,
            the same norm is applied uniformally while if an iterable, each
            scale is applied to each dimension.

        form : string
            In what form to return the vector array. Can be one of:
                'broadcast' -- return 1D arrays that are broadcasted to be 3D

                'flat' -- return array without broadcasting so each component
                    is 1D and the appropriate length as the tile

                'meshed' -- arrays are explicitly broadcasted and so all have
                    a 3D shape, each the size of the tile.

                'vector' -- array is meshed and combined into one array with
                    the vector components along last dimension [Nz, Ny, Nx, 3]

        Examples
        --------
        >>> Tile(3, dim=2).coords(form='meshed')[0]
        array([[ 0.,  0.,  0.],
               [ 1.,  1.,  1.],
               [ 2.,  2.,  2.]])

        >>> Tile(3, dim=2).coords(form='meshed')[1]
        array([[ 0.,  1.,  2.],
               [ 0.,  1.,  2.],
               [ 0.,  1.,  2.]])

        >>> Tile([4,5]).coords(form='vector').shape
        (4, 5, 2)

        >>> [i.shape for i in Tile((4,5), dim=2).coords(form='broadcast')]
        [(4, 1), (1, 5)]

Returns the coordinate vectors associated with the tile .


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] if arg_1 is None : for arg_3 in arg_0 . actions : for arg_4 in arg_0 . actions [ arg_3 ] : arg_2 . append ( arg_4 . as_action_description ( ) ) elif arg_1 in arg_0 . actions : for arg_4 in arg_0 . actions [ arg_1 ] : arg_2 . append ( arg_4 . as_action_description ( ) ) return arg_2

def Func(arg_0, arg_1=None):
        """
        Get the thing's actions as an array.

        action_name -- Optional action name to get descriptions for

        Returns the action descriptions.
        """
        arg_2 = []

        if arg_1 is None:
            for arg_3 in arg_0.actions:
                for arg_4 in arg_0.actions[arg_3]:
                    arg_2.append(arg_4.as_action_description())
        elif arg_1 in arg_0.actions:
            for arg_4 in arg_0.actions[arg_1]:
                arg_2.append(arg_4.as_action_description())

        return arg_2


return send_from_directory(outdir, filename,
        attachment_filename=attachment_filename,
        as_attachment=True)

def Func(arg_0, arg_1, arg_2):
    """Download vcf2cytosure file for individual."""

    (arg_3, Func) = controllers.vcf2cytosure(store,
        arg_0, arg_1, arg_2)

    arg_5 = os.path.abspath(os.path.dirname(Func))
    arg_6 = os.path.basename(Func)

    log.debug("Attempt to deliver file {0} from dir {1}".format(arg_6, arg_5))

    arg_7 = arg_3 + ".vcf2cytosure.cgh"

    return send_from_directory(arg_5, arg_6,
        arg_7=arg_7,
        as_attachment=True)

Download vcf2cytosure file for individual .


def Func(arg_0):
    '''
    This just reads a pickle LC. Returns an lcdict.

    '''

    try:

        if arg_0.endswith('.gz'):
            arg_1 = gzip.open(arg_0,'rb')
        else:
            arg_1 = open(arg_0,'rb')

        arg_2 = pickle.load(arg_1)
        arg_1.close()

        return arg_2

    except UnicodeDecodeError:

        if arg_0.endswith('.gz'):
            arg_1 = gzip.open(arg_0,'rb')
        else:
            arg_1 = open(arg_0,'rb')

        LOGWARNING('pickle %s was probably from Python 2 '
                   'and failed to load without using "latin1" encoding. '
                   'This is probably a numpy issue: '
                   'http://stackoverflow.com/q/11305790' % arg_0)
        arg_2 = pickle.load(arg_1, encoding='latin1')
        arg_1.close()

        return arg_2

This just reads a pickle LC . Returns an lcdict .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 , arg_2 = arg_0 . _pre_transform ( arg_1 , ** arg_2 ) arg_0 . steps [ - 1 ] [ - 1 ] . Func ( arg_3 , ** arg_2 ) arg_3 . unpersist ( ) return arg_0

def Func(arg_0, arg_1, **arg_2):
        """Fit all the transforms one after the other and transform the
        data, then Func the transformed data using the final estimator.

        Parameters
        ----------
        Z : ArrayRDD, TupleRDD or DictRDD
            Input data in blocked distributed format.

        Returns
        -------
        self : SparkPipeline
        """
        arg_3, arg_2 = arg_0._pre_transform(arg_1, **arg_2)
        arg_0.steps[-1][-1].Func(arg_3, **arg_2)
        arg_3.unpersist()
        return arg_0

Fit all the transforms one after the other and transform the
        data, then fit the transformed data using the final estimator.

        Parameters
        ----------
        Z : ArrayRDD, TupleRDD or DictRDD
            Input data in blocked distributed format.

        Returns
        -------
        self : SparkPipeline

Fit all the transforms one after the other and transform the data then fit the transformed data using the final estimator .


return fmt.format(parser_base=self._get_parser_base(),
                      indent=self.indent,
                      entry_point=self._get_entry_point(),
                      rule_definitions="\n".join(self._get_rule_definitions()))

def Func(arg_0):
    """Builds the class definition of the parser."""
    arg_1 = """class Parser({parser_base}):
             {indent}\"\"\"This class contains methods for reading source code and generating a parse tree.\"\"\"
             {indent}entry_point = "{entry_point}"

             {rule_definitions}
             """
    arg_1 = arg_0._clean_fmt(arg_1)
    return arg_1.format(parser_base=arg_0._get_parser_base(),
                      indent=arg_0.indent,
                      entry_point=arg_0._get_entry_point(),
                      rule_definitions="\n".join(arg_0._get_rule_definitions()))

Builds the class definition of the parser .


(self, old_text, new_text, move_param_from_idx)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Find the step with old_text and change it to new_text.
        The step function parameters are also changed according
        to move_param_from_idx.  Each entry in this list should
        specify parameter position from old
        """
        arg_4 = []
        arg_5, arg_6 = arg_0._find_step_node(arg_1)
        if arg_5 is None:
            return arg_4
        arg_7 = arg_0._Func_text(arg_5, arg_1, arg_2)
        arg_4.append(arg_7)
        arg_8 = arg_0._move_params(arg_6.arguments, arg_3)
        if arg_6.arguments is not arg_8:
            arg_9 = arg_0._span_for_node(arg_6.arguments, False)
            arg_6.arguments = arg_8
            arg_4.append((arg_9, arg_6.arguments.dumps()))
        return arg_4

Find the step with old_text and change it to new_text . The step function parameters are also changed according to move_param_from_idx . Each entry in this list should specify parameter position from old


def Func ( arg_0 ) : arg_1 = [ ] while hasattr ( arg_0 , 'parameters' ) and 'inner_kernel' in arg_0 . parameters : arg_1 . append ( arg_0 ) arg_0 = arg_0 . parameters [ 'inner_kernel' ] def _recreate_kernel ( arg_0 , arg_2 ) : arg_3 = arg_0 . parameters . copy ( ) arg_3 . update ( arg_2 ) if 'store_parameters_in_results' in arg_3 : arg_3 [ 'store_parameters_in_results' ] = True with deprecation . silence ( ) : return type ( arg_0 ) ( ** arg_3 ) if hasattr ( arg_0 , 'parameters' ) : arg_0 = _recreate_kernel ( arg_0 , { } ) for arg_4 in reversed ( arg_1 ) : arg_4 = _recreate_kernel ( arg_4 , { 'inner_kernel' : arg_0 } ) arg_0 = arg_4 return arg_0

def Func(arg_0):
  """Enables the `store_parameters_in_results` parameter in a chain of kernels.

  This is a temporary utility for use during the transition period of the
  parameter storage methods.

  Args:
    kernel: A TransitionKernel.

  Returns:
    kernel: The same kernel, but recreated with `store_parameters_in_results`
        recursively set to `True` in its parameters and its inner kernels (as
        appropriate).
  """
  arg_1 = []
  while hasattr(arg_0, 'parameters') and 'inner_kernel' in arg_0.parameters:
    arg_1.append(arg_0)
    arg_0 = arg_0.parameters['inner_kernel']

  def _recreate_kernel(arg_0, arg_2):
    arg_3 = arg_0.parameters.copy()
    arg_3.update(arg_2)
    if 'store_parameters_in_results' in arg_3:
      arg_3['store_parameters_in_results'] = True
    with deprecation.silence():
      return type(arg_0)(**arg_3)

  if hasattr(arg_0, 'parameters'):
    arg_0 = _recreate_kernel(arg_0, {})

  for arg_4 in reversed(arg_1):
    arg_4 = _recreate_kernel(arg_4, {'inner_kernel': arg_0})
    arg_0 = arg_4

  return arg_0

Enables the store_parameters_in_results parameter in a chain of kernels .


def
Func
(
arg_0
,
arg_1
)
:
with
settings
(
warn_only
=
True
)
:
arg_0
.
sudo
(
'dropdb %s'
%
(
arg_1
,
)
,
user
=
'postgres'
)

def Func(arg_0, arg_1):
        """
        Delete a PostgreSQL database.

        Example::

            import burlap

            # Remove DB if it exists
            if burlap.postgres.database_exists('myapp'):
                burlap.postgres.Func('myapp')

        """
        with settings(warn_only=True):
            arg_0.sudo('dropdb %s' % (arg_1,), user='postgres')

Delete a PostgreSQL database.

        Example::

            import burlap

            # Remove DB if it exists
            if burlap.postgres.database_exists('myapp'):
                burlap.postgres.drop_database('myapp')


def Func(arg_0, arg_1):
        """
        Calculate the temperature of the stream given the specified
        enthalpy flow rate using a secant algorithm.

        :param H: Enthalpy flow rate. [kWh/h]

        :returns: Temperature. [°C]
        """

        # Create the initial guesses for temperature.
        arg_2 = list()
        arg_2.append(arg_0._T)
        arg_2.append(arg_0._T + 10.0)

        # Evaluate the enthalpy for the initial guesses.
        arg_3 = list()
        arg_3.append(arg_0._calculate_Hfr(arg_2[0]) - arg_1)
        arg_3.append(arg_0._calculate_Hfr(arg_2[1]) - arg_1)

        # Solve for temperature.
        for arg_4 in range(2, 50):
            arg_2.append(arg_2[arg_4-1] - arg_3[arg_4-1]*((arg_2[arg_4-1] - arg_2[arg_4-2])/(arg_3[arg_4-1] - arg_3[arg_4-2])))
            arg_3.append(arg_0._calculate_Hfr(arg_2[arg_4]) - arg_1)
            if abs(arg_3[arg_4-1]) < 1.0e-5:
                break

        return arg_2[len(arg_2) - 1]

Calculate the temperature of the stream given the specified enthalpy flow rate using a secant algorithm .


Generator which returns all of the statements in all of the variables tables

def Func ( arg_0 ) : for arg_1 in arg_0 . tables : if isinstance ( arg_1 , VariableTable ) : for arg_2 in arg_1 . rows : if arg_2 [ 0 ] != "" : yield arg_2

def Func(arg_0):
        '''Generator which returns all of the statements in all of the Func tables'''
        for arg_1 in arg_0.tables:
            if isinstance(arg_1, VariableTable):
                # FIXME: settings have statements, Func have rows WTF? :-(
                for arg_2 in arg_1.rows:
                    if arg_2[0] != "":
                        yield arg_2


def Func(arg_0, arg_1):
    """
    Get a PIL.Image from the given image file which has been scaled down to
    THUMBNAIL_WIDTH wide.
    @param {String} dir_path - The directory containing the image file
    @param {String} image_file - The filename of the image file within dir_path
    @return {PIL.Image} An instance of the thumbnail as a PIL Image, or None
        if the functionality is not available. See _get_image_from_file for
        details.
    """
    # Get image
    arg_2 = _get_image_from_file(arg_0, arg_1)
    # If it's not supported, exit now
    if arg_2 is None:
        return None
    if arg_2.format.lower() == 'gif':
        return None
    # Get image dimensions
    arg_3, arg_4 = arg_2.size
    # We need to perform a resize - first, work out the scale ratio to take the
    # image width to THUMBNAIL_WIDTH (THUMBNAIL_WIDTH:img_width ratio)
    arg_5 = THUMBNAIL_WIDTH / float(arg_3)
    # Work out target image height based on the scale ratio
    arg_6 = int(arg_5 * arg_4)
    # Perform the resize
    try:
        arg_2.thumbnail((THUMBNAIL_WIDTH, arg_6), resample=RESAMPLE)
    except IOError as exptn:
        print('WARNING: IOError when thumbnailing %s/%s: %s' % (
            arg_0, arg_1, exptn
        ))
        return None
    # Return the resized image
    return arg_2

Get a PIL . Image from the given image file which has been scaled down to THUMBNAIL_WIDTH wide .


def Func(arg_0):
    """
    Asks user for removal of project directory and eventually removes it
    """
    if os.path.exists(arg_0.project_directory):
        arg_1 = False
        if arg_0.noinput is False and not arg_0.verbose:
            arg_1 = query_yes_no(
                'The installation failed.\n'
                'Do you want to clean up by removing {0}?\n'
                '\tWarning: this will delete all files in:\n'
                '\t\t{0}\n'
                'Do you want to cleanup?'.format(
                    os.path.abspath(arg_0.project_directory)
                ),
                'no'
            )
        else:
            sys.stdout.write('The installation has failed.\n')
        if arg_0.skip_project_dir_check is False and (arg_1 or
                                                            (arg_0.noinput and
                                                             arg_0.delete_project_dir)):
            sys.stdout.write('Removing everything under {0}\n'.format(
                os.path.abspath(arg_0.project_directory)
            ))
            shutil.rmtree(arg_0.project_directory, True)


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = False if 'inv' not in arg_3 else arg_3 . pop ( 'inv' ) arg_5 = re . compile ( arg_1 , * arg_2 , ** arg_3 ) for arg_6 in arg_0 : if bool ( arg_4 ) ^ bool ( arg_5 . match ( arg_6 ) ) : yield arg_6

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """The pipe Funcs the data passed from previous generator according to
    given regular expression.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The pattern which used to filter out data.
    :type pattern: str|unicode|re pattern object
    :param inv: If true, invert the match condition.
    :type inv: boolean
    :param kw:
    :type kw: dict
    :returns: generator
    """
    arg_4 = False if 'inv' not in arg_3 else arg_3.pop('inv')
    arg_5 = re.compile(arg_1, *arg_2, **arg_3)

    for arg_6 in arg_0:
        if bool(arg_4) ^ bool(arg_5.match(arg_6)):
            yield arg_6

The pipe greps the data passed from previous generator according to
    given regular expression.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The pattern which used to filter out data.
    :type pattern: str|unicode|re pattern object
    :param inv: If true, invert the match condition.
    :type inv: boolean
    :param kw:
    :type kw: dict
    :returns: generator

The pipe greps the data passed from previous generator according to given regular expression .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
datetime
.
datetime
.
now
(
)
arg_3
=
{
"uuid"
:
arg_0
.
get_template_uuid
(
)
,
"settings"
:
{
"name"
:
"jackal-"
+
arg_2
.
strftime
(
"%Y-%m-%d %H:%M"
)
,
"text_targets"
:
arg_1
}
}
arg_4
=
requests
.
post
(
arg_0
.
url
+
'scans'
,
arg_3
=
json
.
dumps
(
arg_3
)
,
verify
=
False
,
headers
=
arg_0
.
headers
)
if
arg_4
:
arg_5
=
json
.
loads
(
arg_4
.
text
)
return
arg_5
[
'scan'
]
[
'id'
]

def Func(arg_0, arg_1):
        """
            Creates a scan with the given host ips
            Returns the scan id of the created object.
        """
        arg_2 = datetime.datetime.now()
        arg_3 = {
            "uuid": arg_0.get_template_uuid(),
            "settings": {
                "name": "jackal-" + arg_2.strftime("%Y-%m-%d %H:%M"),
                "text_targets": arg_1
            }
        }
        arg_4 = requests.post(arg_0.url + 'scans', arg_3=json.dumps(arg_3), verify=False, headers=arg_0.headers)
        if arg_4:
            arg_5 = json.loads(arg_4.text)
            return arg_5['scan']['id']

Creates a scan with the given host ips Returns the scan id of the created object .


def Func ( arg_0 ) : arg_0 . forum . on_finish_game ( ) for arg_1 in arg_0 . actors : arg_1 . on_finish_game ( ) with arg_0 . world . _unlock_temporarily ( ) : arg_0 . world . on_finish_game ( )

def Func(arg_0):
        """
        Give the actors, the world, and the messaging system a chance to react
        to the end of the game.
        """

        # 1. Let the forum react to the end of the game.  Local forums don't
        #    react to this, but remote forums take the opportunity to stop
        #    trying to extract tokens from messages.

        arg_0.forum.on_finish_game()

        # 2. Let the actors react to the end of the game.

        for arg_1 in arg_0.actors:
            arg_1.on_finish_game()

        # 3. Let the world react to the end of the game.

        with arg_0.world._unlock_temporarily():
            arg_0.world.on_finish_game()

Give the actors the world and the messaging system a chance to react to the end of the game .


def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "floating_ips" ) arg_2 = list ( ) for arg_3 in arg_1 [ 'floating_ips' ] : arg_4 = FloatingIP ( ** arg_3 ) arg_4 . token = arg_0 . token arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0):
        """
            This function returns a list of FloatingIP objects.
        """
        arg_1 = arg_0.get_data("floating_ips")
        arg_2 = list()
        for arg_3 in arg_1['floating_ips']:
            arg_4 = FloatingIP(**arg_3)
            arg_4.token = arg_0.token
            arg_2.append(arg_4)
        return arg_2

This function returns a list of FloatingIP objects .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
ThreadPool
(
ThreadUtil
,
arg_0
.
opt
)
arg_1
=
arg_0
.
source_expand
(
arg_1
)
if
os
.
path
.
isdir
(
arg_2
)
:
for
arg_4
in
arg_1
:
arg_0
.
get_single_file
(
arg_3
,
arg_4
,
os
.
path
.
join
(
arg_2
,
arg_0
.
get_basename
(
S3URL
(
arg_4
)
.
path
)
)
)
else
:
if
len
(
arg_1
)
>
1
:
raise
Failure
(
'Target "%s" is not a directory.'
%
arg_2
)
elif
len
(
arg_1
)
==
1
:
arg_0
.
get_single_file
(
arg_3
,
arg_1
[
0
]
,
arg_2
)
else
:
pass
arg_3
.
join
(
)

def Func(arg_0, arg_1, arg_2):
    '''Download files.
       This function can handle multiple files if source S3 URL has wildcard
       characters. It also handles recursive mode by download all files and
       keep the directory structure.
    '''
    arg_3 = ThreadPool(ThreadUtil, arg_0.opt)
    arg_1 = arg_0.source_expand(arg_1)

    if os.path.isdir(arg_2):
      for arg_4 in arg_1:
        arg_0.get_single_file(arg_3, arg_4, os.path.join(arg_2, arg_0.get_basename(S3URL(arg_4).path)))
    else:
      if len(arg_1) > 1:
        raise Failure('Target "%s" is not a directory.' % arg_2)
        # Get file if it exists on s3 otherwise do nothing
      elif len(arg_1) == 1:
        arg_0.get_single_file(arg_3, arg_1[0], arg_2)
      else:
        #Source expand may return empty list only if ignore-empty-source is set to true
        pass

    arg_3.join()

Download files . This function can handle multiple files if source S3 URL has wildcard characters . It also handles recursive mode by download all files and keep the directory structure .


def
Func
(
arg_0
,
*
arg_1
)
:
arg_2
=
[
_unwrap
(
item
)
for
item
in
(
arg_0
,
)
+
arg_1
]
arg_3
=
arg_0
.
count
(
)
if
not
all
(
len
(
arg_4
)
==
arg_3
for
arg_4
in
arg_2
)
:
raise
ValueError
(
"Arguments are not all the same length"
)
return
Collection
(
map
(
Wrapper
.
wrap
,
Func
(
*
arg_2
)
)
)

def Func(arg_0, *arg_1):
        """
        Zip the items of this collection with one or more
        other sequences, and wrap the result.

        Unlike Python's Func, all sequences must be the same length.

        Parameters:

            others: One or more iterables or Collections

        Returns:

            A new collection.

        Examples:

            >>> c1 = Collection([Scalar(1), Scalar(2)])
            >>> c2 = Collection([Scalar(3), Scalar(4)])
            >>> c1.Func(c2).val()
            [(1, 3), (2, 4)]
        """
        arg_2 = [_unwrap(item) for item in (arg_0,) + arg_1]
        arg_3 = arg_0.count()
        if not all(len(arg_4) == arg_3 for arg_4 in arg_2):
            raise ValueError("Arguments are not all the same length")
        return Collection(map(Wrapper.wrap, Func(*arg_2)))

Zip the items of this collection with one or more
        other sequences, and wrap the result.

        Unlike Python's zip, all sequences must be the same length.

        Parameters:

            others: One or more iterables or Collections

        Returns:

            A new collection.

        Examples:

            >>> c1 = Collection([Scalar(1), Scalar(2)])
            >>> c2 = Collection([Scalar(3), Scalar(4)])
            >>> c1.zip(c2).val()
            [(1, 3), (2, 4)]

Zip the items of this collection with one or more other sequences and wrap the result .


def Func(arg_0, arg_1):
    """
    Write out the database according to the GTFS format.

    Parameters
    ----------
    gtfs: gtfspy.GTFS
    output: str
        Path where to put the GTFS files
        if output ends with ".zip" a ZIP-file is created instead.

    Returns
    -------
    None
    """
    arg_1 = os.path.abspath(arg_1)
    arg_2 = "tmp_" + str(uuid.uuid1())
    if arg_1[-4:] == '.zip':
        arg_3 = True
        arg_4 = os.path.dirname(os.path.abspath(arg_1))
        if not os.path.exists(arg_4):
            raise IOError(arg_4 + " does not exist, cannot write gtfs as a zip")
        arg_5 = os.path.join(arg_4, str(arg_2))
        # zip_file_na,e = ../out_basedir + ".zip
    else:
        arg_3 = False
        arg_4 = arg_1
        arg_5 = os.path.join(arg_4 + "_" + str(arg_2))

    os.makedirs(arg_5, exist_ok=True)

    arg_6 = {
        "agency": _Func_agencies,
        "calendar": _Func_calendar,
        "calendar_dates": _Func_calendar_dates,
        # fare attributes and fare_rules omitted (seldomly used)
        "feed_info": _Func_feed_info,
        # "frequencies": not written, as they are incorporated into trips and routes,
        # Frequencies table is expanded into other tables on initial import. -> Thus frequencies.txt is not created
        "routes": _Func_routes,
        "shapes": _Func_shapes,
        "stops": _Func_stops,
        "stop_times": _Func_stop_times,
        "transfers": _Func_transfers,
        "trips": _Func_trips,
    }

    for arg_7, arg_8 in arg_6.items():
        arg_9 = os.path.join(arg_5, arg_7 + '.txt')
        print(arg_9)
        arg_8(arg_0, open(os.path.join(arg_5, arg_7 + '.txt'), 'w'))

    if arg_3:
        shutil.make_archive(arg_1[:-4], 'zip', arg_5)
        shutil.rmtree(arg_5)
    else:
        print("moving " + str(arg_5) + " to " + arg_4)
        os.rename(arg_5, arg_4)

Write out the database according to the GTFS format .


def Func(arg_0):
    """
    Normalize a shape tuple or array to a shape tuple.

    Parameters
    ----------
    shape : tuple of int or ndarray
        The input to normalize. May optionally be an array.

    Returns
    -------
    tuple of int
        Shape tuple.

    """
    if isinstance(arg_0, tuple):
        return arg_0
    assert ia.is_np_array(arg_0), (
        "Expected tuple of ints or array, got %s." % (type(arg_0),))
    return arg_0.shape

Normalize a shape tuple or array to a shape tuple .


return sum(self.get_compound_amount(c) for c in self.material.compounds)

def Func ( arg_0 ) : return sum ( arg_0 . get_compound_Func ( arg_1 ) for arg_1 in arg_0 . material . compounds )

def Func(arg_0):
        """
        Determine the sum of mole Funcs of all the compounds.

        :returns: Amount. [kmol]
        """

        return sum(arg_0.get_compound_Func(arg_1) for arg_1 in arg_0.material.compounds)

Determine the sum of mole amounts of all the compounds.

        :returns: Amount. [kmol]

Determine the sum of mole amounts of all the compounds .


def Func(arg_0, arg_1, arg_2='strict'):
        """
        Decodes a tryte string into bytes.
        """
        if isinstance(arg_1, memoryview):
            arg_1 = arg_1.tobytes()

        if not isinstance(arg_1, (binary_type, bytearray)):
            raise with_context(
                exc=TypeError(
                    "Can't Func {type}; byte string expected.".format(
                        type=type(arg_1).__name__,
                    )),

                context={
                    'input': arg_1,
                },
            )

        # :bc: In Python 2, iterating over a byte string yields
        # characters instead of integers.
        if not isinstance(arg_1, bytearray):
            arg_1 = bytearray(arg_1)

        arg_3 = bytearray()

        for arg_4 in range(0, len(arg_1), 2):
            try:
                arg_5, arg_6 = arg_1[arg_4:arg_4 + 2]
            except ValueError:
                if arg_2 == 'strict':
                    raise with_context(
                        exc=TrytesDecodeError(
                            "'{name}' codec can't Func value; "
                            "tryte sequence has odd length.".format(
                                name=arg_0.name,
                            ),
                        ),

                        context={
                            'input': arg_1,
                        },
                    )
                elif arg_2 == 'replace':
                    arg_3 += b'?'

                continue

            try:
                arg_3.append(
                    arg_0.index[arg_5]
                    + (arg_0.index[arg_6] * len(arg_0.index))
                )
            except ValueError:
                # This combination of trytes yields a value > 255 when
                # Funcd.
                # Naturally, we can't represent this using ASCII.
                if arg_2 == 'strict':
                    raise with_context(
                        exc=TrytesDecodeError(
                            "'{name}' codec can't Func trytes {pair} "
                            "at position {i}-{j}: "
                            "ordinal not in range(255)".format(
                                name=arg_0.name,
                                pair=chr(arg_5) + chr(arg_6),
                                arg_4=arg_4,
                                j=arg_4 + 1,
                            ),
                        ),

                        context={
                            'input': arg_1,
                        }
                    )
                elif arg_2 == 'replace':
                    arg_3 += b'?'

        return binary_type(arg_3), len(arg_1)


def Func ( arg_0 , arg_1 ) : arg_1 = _helpers . string_to_scopes ( arg_1 ) return set ( arg_1 ) . issubset ( arg_0 . scopes )

def Func(arg_0, arg_1):
        """Verify that the credentials are authorized for the given scopes.

        Returns True if the credentials authorized scopes contain all of the
        scopes given.

        Args:
            scopes: list or string, the scopes to check.

        Notes:
            There are cases where the credentials are unaware of which scopes
            are authorized. Notably, credentials obtained and stored before
            this code was added will not have scopes, AccessTokenCredentials do
            not have scopes. In both cases, you can use refresh_scopes() to
            obtain the canonical set of scopes.
        """
        arg_1 = _helpers.string_to_scopes(arg_1)
        return set(arg_1).issubset(arg_0.scopes)

Verify that the credentials are authorized for the given scopes .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _get_end_cursor ( ) if arg_0 . _get_cursor ( ) . blockNumber ( ) == arg_2 . blockNumber ( ) : if arg_0 . _history_locked ( ) and not arg_1 : return False arg_3 = arg_0 . history_next ( arg_0 . _history_prefix , as_prefix = not arg_1 ) if arg_0 . _history_prefix and arg_3 : arg_4 = arg_0 . _get_prompt_cursor ( ) arg_4 . movePosition ( QtGui . QTextCursor . Right , n = len ( arg_0 . _history_prefix ) ) arg_0 . _set_cursor ( arg_4 ) return False return True

def Func(arg_0, arg_1):
        """ Called when the down key is pressed. Returns whether to continue
            processing the event.
        """
        arg_2 = arg_0._get_end_cursor()
        if arg_0._get_cursor().blockNumber() == arg_2.blockNumber():
            # Bail out if we're locked.
            if arg_0._history_locked() and not arg_1:
                return False

            # Perform the search.
            arg_3 = arg_0.history_next(arg_0._history_prefix,
                                            as_prefix=not arg_1)

            # Emulate readline: keep the cursor position fixed for a prefix
            # search. (We don't need to move the cursor to the end of the buffer
            # in the other case because this happens automatically when the
            # input buffer is set.)
            if arg_0._history_prefix and arg_3:
                arg_4 = arg_0._get_prompt_cursor()
                arg_4.movePosition(QtGui.QTextCursor.Right,
                                    n=len(arg_0._history_prefix))
                arg_0._set_cursor(arg_4)

            return False

        return True

Called when the down key is pressed . Returns whether to continue processing the event .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . filt . grab_filt ( arg_3 = arg_2 ) arg_0 . filt . add ( arg_1 , arg_3 , info = arg_2 ) return

def Func(arg_0, arg_1, arg_2):
        """
        Make new filter from combination of other filters.

        Parameters
        ----------
        name : str
            The name of the new filter. Should be unique.
        filt_str : str
            A logical combination of partial strings which will create
            the new filter. For example, 'Albelow & Mnbelow' will combine
            all filters that partially match 'Albelow' with those that
            partially match 'Mnbelow' using the 'AND' logical operator.

        Returns
        -------
        None
        """
        arg_3 = arg_0.filt.grab_filt(arg_3=arg_2)
        arg_0.filt.add(arg_1, arg_3, info=arg_2)
        return

Make new filter from combination of other filters .


(
        multiple_args_dict,
        print_commands=True,
        process_limit=-1,
        polling_freq=0.5,
        **kwargs)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
1
,
arg_3
=
0.5
,
**
arg_4
)
:
assert
len
(
arg_0
)
>
0
assert
all
(
len
(
arg_5
)
>
0
for
arg_5
in
arg_0
.
values
(
)
)
assert
all
(
hasattr
(
arg_6
,
'name'
)
for
arg_6
in
arg_0
.
keys
(
)
)
if
arg_2
<
0
:
logger
.
debug
(
"Using %d processes"
%
cpu_count
(
)
)
arg_2
=
cpu_count
(
)
arg_7
=
time
.
time
(
)
arg_8
=
Queue
(
maxsize
=
arg_2
)
def
add_to_queue
(
arg_9
)
:
arg_9
.
start
(
)
if
arg_1
:
arg_10
=
logging
.
FileHandler
(
arg_9
.
redirect_stdout_file
.
name
)
arg_10
.
setLevel
(
logging
.
DEBUG
)
logger
.
addHandler
(
arg_10
)
logger
.
debug
(
" "
.
join
(
arg_9
.
args
)
)
logger
.
removeHandler
(
arg_10
)
arg_8
.
put
(
arg_9
)
for
arg_6
,
arg_5
in
arg_0
.
items
(
)
:
arg_11
=
AsyncProcess
(
arg_5
,
redirect_stdout_file
=
arg_6
,
**
arg_4
)
if
not
arg_8
.
full
(
)
:
add_to_queue
(
arg_11
)
else
:
while
arg_8
.
full
(
)
:
arg_12
=
[
]
for
arg_13
in
arg_8
.
queue
:
if
arg_13
.
poll
(
)
is
not
:
arg_13
.
wait
(
)
arg_12
.
append
(
arg_13
)
if
arg_12
:
for
arg_14
in
arg_12
:
arg_8
.
queue
.
remove
(
arg_14
)
break
time
.
sleep
(
arg_3
)
add_to_queue
(
arg_11
)
while
not
arg_8
.
empty
(
)
:
arg_8
.
get
(
)
.
wait
(
)
arg_15
=
time
.
time
(
)
arg_7
logger
.
info
(
"Ran %d commands in %0.4f seconds"
,
len
(
arg_0
)
,
arg_15
)

def Func(
        arg_0,
        arg_1=True,
        arg_2=-1,
        arg_3=0.5,
        **arg_4):
    """
    Run multiple shell commands in parallel, write each of their
    stdout output to files associated with each command.

    Parameters
    ----------
    multiple_args_dict : dict
        A dictionary whose keys are files and values are args list.
        Run each args list as a subprocess and write stdout to the
        corresponding file.

    print_commands : bool
        Print shell commands before running them.

    process_limit : int
        Limit the number of concurrent processes to this number. 0
        if there is no limit, -1 to use max number of processors

    polling_freq : int
        Number of seconds between checking for done processes, if
        we have a process limit
    """
    assert len(arg_0) > 0
    assert all(len(arg_5) > 0 for arg_5 in arg_0.values())
    assert all(hasattr(arg_6, 'name') for arg_6 in arg_0.keys())
    if arg_2 < 0:
        logger.debug("Using %d processes" % cpu_count())
        arg_2 = cpu_count()

    arg_7 = time.time()
    arg_8 = Queue(maxsize=arg_2)

    def add_to_queue(arg_9):
        arg_9.start()
        if arg_1:
            arg_10 = logging.FileHandler(arg_9.redirect_stdout_file.name)
            arg_10.setLevel(logging.DEBUG)
            logger.addHandler(arg_10)
            logger.debug(" ".join(arg_9.args))
            logger.removeHandler(arg_10)
        arg_8.put(arg_9)

    for arg_6, arg_5 in arg_0.items():
        arg_11 = AsyncProcess(
                arg_5,
                redirect_stdout_file=arg_6,
                **arg_4)
        if not arg_8.full():
            add_to_queue(arg_11)
        else:
            while arg_8.full():
                # Are there any done processes?
                arg_12 = []
                for arg_13 in arg_8.queue:
                    if arg_13.poll() is not None:
                        arg_13.wait()
                        arg_12.append(arg_13)
                # Remove them from the queue and stop checking
                if arg_12:
                    for arg_14 in arg_12:
                        arg_8.queue.remove(arg_14)
                    break
                # Check again in a second if there weren't
                time.sleep(arg_3)
            add_to_queue(arg_11)

    # Wait for all the rest of the processes
    while not arg_8.empty():
        arg_8.get().wait()

    arg_15 = time.time() - arg_7
    logger.info(
        "Ran %d commands in %0.4f seconds",
        len(arg_0),
        arg_15)

Run multiple shell commands in parallel write each of their stdout output to files associated with each command .


return ParseNode(self.node_type,
                     children=new_children,
                     consumed=self.consumed,
                     position=self.position,
                     ignored=self.ignored)

def Func ( arg_0 , arg_1 = arg_2 ) : if arg_0 . is_value : return arg_0 arg_3 = [ ] for arg_4 in arg_0 . children : if arg_4 . is_empty : continue arg_5 = arg_4 . Func ( arg_1 ) if arg_1 ( arg_5 , arg_0 ) : arg_3 . extend ( arg_5 . children ) else : arg_3 . append ( arg_5 ) return ParseNode ( arg_0 . node_type , children = arg_3 , consumed = arg_0 . consumed , position = arg_0 . position , ignored = arg_0 . ignored )

def Func(arg_0, arg_1=arg_2):
    """Flattens nodes by hoisting children up to ancestor nodes.

    A node is hoisted if pred(node) returns True.
    """
    if arg_0.is_value:
      return arg_0

    arg_3 = []

    for arg_4 in arg_0.children:
      if arg_4.is_empty:
        continue

      arg_5 = arg_4.Func(arg_1)

      if arg_1(arg_5, arg_0):
        arg_3.extend(arg_5.children)
      else:
        arg_3.append(arg_5)

    return ParseNode(arg_0.node_type,
                     children=arg_3,
                     consumed=arg_0.consumed,
                     position=arg_0.position,
                     ignored=arg_0.ignored)

Flattens nodes by hoisting children up to ancestor nodes .


return out + argiope.utils.list_to_string(labels, **kwargs)

def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
"*NSET, NSET={0}, UNSORTED\n"
.
format
(
arg_1
)
arg_4
=
arg_0
.
index
.
values
return
arg_3
+
argiope
.
utils
.
list_to_string
(
arg_4
,
**
arg_2
)

def Func(arg_0, arg_1, **arg_2):
    """
    Returns a set as inp string with unsorted option.
    """
    arg_3 = "*NSET, NSET={0}, UNSORTED\n".format(arg_1)
    arg_4 = arg_0.index.values
    return arg_3 + argiope.utils.list_to_string(arg_4, **arg_2)

Returns a set as inp string with unsorted option .


def Func ( arg_0 ) : if arg_0 . __Func : return arg_0 . __Func else : arg_0 . __Func = Func ( arg_0 . CAS , Method = 'Combined' ) return arg_0 . __Func

def Func(arg_0):
        r'''Dictionary of economic status indicators for the chemical.

        Examples
        --------
        >>> pprint(Chemical('benzene').Func)
        ["US public: {'Manufactured': 6165232.1, 'Imported': 463146.474, 'Exported': 271908.252}",
         u'1,000,000 - 10,000,000 tonnes per annum',
         u'Intermediate Use Only',
         'OECD HPV Chemicals']
        '''
        if arg_0.__Func:
            return arg_0.__Func
        else:
            arg_0.__Func = Func(arg_0.CAS, Method='Combined')
            return arg_0.__Func

r'''Dictionary of economic status indicators for the chemical.

        Examples
        --------
        >>> pprint(Chemical('benzene').economic_status)
        ["US public: {'Manufactured': 6165232.1, 'Imported': 463146.474, 'Exported': 271908.252}",
         u'1,000,000 - 10,000,000 tonnes per annum',
         u'Intermediate Use Only',
         'OECD HPV Chemicals']

r Dictionary of economic status indicators for the chemical .


def
Func
(
arg_0
)
:
arg_1
=
2
+
max
(
reduce
(
lambda
x
,
y
:
x
+
y
,
[
[
len
(
item
)
for
item
in
arg_5
]
for
arg_5
in
arg_0
]
,
[
]
)
)
arg_2
=
len
(
arg_0
[
0
]
)
arg_3
=
table_div
(
arg_2
,
arg_1
,
0
)
arg_4
=
1
for
arg_5
in
arg_0
:
arg_3
=
arg_3
+
'| '
+
'| '
.
join
(
[
normalize_cell
(
x
,
arg_1
1
)
for
x
in
arg_5
]
)
+
'|\n'
arg_3
=
arg_3
+
table_div
(
arg_2
,
arg_1
,
arg_4
)
arg_4
=
0
return
arg_3

def Func(arg_0):
    """ Make a RST-compatible table

    From http://stackoverflow.com/a/12539081

    """
    arg_1 = 2 + max(
        reduce(
            lambda x, y: x+y, [[len(item) for item in arg_5] for arg_5 in arg_0], []
        )
    )
    arg_2 = len(arg_0[0])
    arg_3 = table_div(arg_2, arg_1, 0)
    arg_4 = 1
    for arg_5 in arg_0:
        arg_3 = arg_3 + '| ' + '| '.join(
            [normalize_cell(x, arg_1-1) for x in arg_5]
        ) + '|\n'
        arg_3 = arg_3 + table_div(arg_2, arg_1, arg_4)
        arg_4 = 0
    return arg_3


return not any(os.path.isdir(os.path.join(local_folder, entry))
                   for entry in os.listdir(local_folder))

def Func ( arg_0 ) : return not any ( os . path . isdir ( os . path . join ( arg_0 , arg_1 ) ) for arg_1 in os . listdir ( arg_0 ) )

def Func(arg_0):
    """
    Return whether a folder contains only files. This will be False if the
    folder contains any subdirectories.

    :param local_folder: full path to the local folder
    :type local_folder: string
    :returns: True if the folder contains only files
    :rtype: bool
    """
    return not any(os.path.isdir(os.path.join(arg_0, arg_1))
                   for arg_1 in os.listdir(arg_0))

Return whether a folder contains only files . This will be False if the folder contains any subdirectories .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
=
load
.
load_if_filename
(
arg_0
)
or
arg_0
if
isinstance
(
arg_0
,
str
)
:
arg_2
=
{
'typename'
:
arg_0
}
elif
not
isinstance
(
arg_0
,
dict
)
:
raise
TypeError
(
'Unexpected type %s in collection'
%
type
(
arg_0
)
)
elif
'typename'
in
arg_0
or
'animation'
not
in
arg_0
:
arg_2
=
arg_0
else
:
arg_2
=
arg_0
.
pop
(
'animation'
,
{
}
)
if
isinstance
(
arg_2
,
str
)
:
arg_2
=
{
'typename'
:
arg_2
}
arg_2
[
'run'
]
=
arg_0
.
pop
(
'run'
,
{
}
)
if
arg_0
:
raise
ValueError
(
'Extra animation fields: '
+
', '
.
join
(
arg_0
)
)
arg_2
.
setdefault
(
'typename'
,
DEFAULT_ANIMATION
)
arg_2
=
construct
.
to_type_constructor
(
arg_2
,
ANIMATION_PATH
)
arg_3
=
arg_2
.
setdefault
(
'datatype'
,
failed
.
Failed
)
arg_2
.
setdefault
(
'name'
,
arg_3
.
__name__
)
arg_4
=
arg_2
.
setdefault
(
'run'
,
{
}
)
arg_5
=
arg_1
.
setdefault
(
'run'
,
{
}
)
if
not
(
'fps'
in
arg_4
or
'sleep_time'
in
arg_4
)
:
if
'fps'
in
arg_5
:
arg_4
.
update
(
fps
=
arg_5
[
'fps'
]
)
elif
'sleep_time'
in
arg_5
:
arg_4
.
update
(
sleep_time
=
arg_5
[
'sleep_time'
]
)
return
arg_2

def Func(arg_0, arg_1):
    """
    Cleans up all sorts of special cases that humans want when entering
    an animation from a yaml file.

    1. Loading it from a file
    2. Using just a typename instead of a dict
    3. A single dict representing an animation, with a run: section.
    4. (Legacy) Having a dict with parallel elements run: and animation:
    5. (Legacy) A tuple or list: (animation, run )

    """
    arg_0 = load.load_if_filename(arg_0) or arg_0

    if isinstance(arg_0, str):
        arg_2 = {'typename': arg_0}

    elif not isinstance(arg_0, dict):
        raise TypeError('Unexpected type %s in collection' % type(arg_0))

    elif 'typename' in arg_0 or 'animation' not in arg_0:
        arg_2 = arg_0

    else:
        arg_2 = arg_0.pop('animation', {})
        if isinstance(arg_2, str):
            arg_2 = {'typename': arg_2}

        arg_2['run'] = arg_0.pop('run', {})
        if arg_0:
            raise ValueError('Extra animation fields: ' + ', '.join(arg_0))

    arg_2.setdefault('typename', DEFAULT_ANIMATION)
    arg_2 = construct.to_type_constructor(arg_2, ANIMATION_PATH)
    arg_3 = arg_2.setdefault('datatype', failed.Failed)
    arg_2.setdefault('name', arg_3.__name__)

    # Children without fps or sleep_time get it from their parents.
    # TODO: We shouldn't have to rewrite our descriptions here!  The
    # animation engine should be smart enough to figure out the right
    # speed to run a subanimation without a run: section.
    arg_4 = arg_2.setdefault('run', {})
    arg_5 = arg_1.setdefault('run', {})
    if not ('fps' in arg_4 or 'sleep_time' in arg_4):
        if 'fps' in arg_5:
            arg_4.update(fps=arg_5['fps'])
        elif 'sleep_time' in arg_5:
            arg_4.update(sleep_time=arg_5['sleep_time'])

    return arg_2

Cleans up all sorts of special cases that humans want when entering an animation from a yaml file .


return convert_constants(jmag,hmag,kmag,
                             RJHK,
                             RJH, RJK, RHK,
                             RJ, RH, RK)

def Func ( arg_0 , arg_1 , arg_2 ) : return convert_constants ( arg_0 , arg_1 , arg_2 , RJHK , RJH , RJK , RHK , RJ , RH , RK )

def Func(arg_0,arg_1,arg_2):
    '''Converts given J, H, Ks mags to an R magnitude value.

    Parameters
    ----------

    jmag,hmag,kmag : float
        2MASS J, H, Ks mags of the object.

    Returns
    -------

    float
        The converted R band magnitude.

    '''

    return convert_constants(arg_0,arg_1,arg_2,
                             RJHK,
                             RJH, RJK, RHK,
                             RJ, RH, RK)

Converts given J H Ks mags to an R magnitude value .


def Func(arg_0, arg_1):
        """Validate message."""
        if arg_0.reject.data and not arg_1.data.strip():
            raise validators.ValidationError(
                _("You are required to provide message to the requester when"
                  " you reject a request.")
            )


return "Lock(<{}..>, '{}', {}, {}, depth-{}, until {}".format(
        # first 4 significant token characters
        lock_dict.get("token", "?" * 30)[18:22],
        lock_dict.get("root"),
        lock_dict.get("principal"),
        lock_dict.get("scope"),
        lock_dict.get("depth"),
        expire,
    )

def Func(arg_0):
    """Return readable rep."""
    if not arg_0:
        return "Lock: None"

    if arg_0["expire"] < 0:
        arg_1 = "Infinite ({})".format(arg_0["expire"])
    else:
        arg_1 = "{} (in {} seconds)".format(
            util.get_log_time(arg_0["expire"]), arg_0["expire"] - time.time()
        )

    return "Lock(<{}..>, '{}', {}, {}, depth-{}, until {}".format(
        # first 4 significant token characters
        arg_0.get("token", "?" * 30)[18:22],
        arg_0.get("root"),
        arg_0.get("principal"),
        arg_0.get("scope"),
        arg_0.get("depth"),
        arg_1,
    )


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or [ ] arg_3 = { 'list1' : OrderedDict ( ) , 'list2' : OrderedDict ( ) } arg_4 = 1 for arg_5 in [ arg_0 , arg_1 ] : arg_6 = arg_3 [ 'list{0}' . format ( arg_4 ) ] for arg_7 in arg_5 : arg_8 = id ( arg_7 ) if isinstance ( arg_7 , dict ) : for arg_9 in arg_2 : if arg_9 in arg_7 : arg_8 = arg_7 [ arg_9 ] break arg_6 [ arg_8 ] = deepcopy ( arg_7 ) arg_4 += 1 arg_10 = merge_config ( arg_3 [ 'list1' ] , arg_3 [ 'list2' ] ) return list ( arg_10 . values ( ) )

def Func(arg_0, arg_1, arg_2=None):
    """
    Merges ``list2`` on top of ``list1``.

    If both lists contain dictionaries which have keys specified
    in ``identifiers`` which have equal values, those dicts will
    be merged (dicts in ``list2`` will override dicts in ``list1``).
    The remaining elements will be summed in order to create a list
    which contains elements of both lists.

    :param list1: ``list`` from template
    :param list2: ``list`` from config
    :param identifiers: ``list`` or ``None``
    :returns: merged ``list``
    """
    arg_2 = arg_2 or []
    arg_3 = {'list1': OrderedDict(), 'list2': OrderedDict()}
    arg_4 = 1
    for arg_5 in [arg_0, arg_1]:
        arg_6 = arg_3['list{0}'.format(arg_4)]
        for arg_7 in arg_5:
            # merge by internal python id by default
            arg_8 = id(arg_7)
            # if el is a dict, merge by keys specified in ``identifiers``
            if isinstance(arg_7, dict):
                for arg_9 in arg_2:
                    if arg_9 in arg_7:
                        arg_8 = arg_7[arg_9]
                        break
            arg_6[arg_8] = deepcopy(arg_7)
        arg_4 += 1
    arg_10 = merge_config(arg_3['list1'], arg_3['list2'])
    return list(arg_10.values())


def Func(arg_0, arg_1=False):
    """
    Gets the base domain name for the given domain

    .. note::
        Results are based on a list of public domain suffixes at
        https://publicsuffix.org/list/public_suffix_list.dat.

    Args:
        domain (str): A domain or subdomain
        use_fresh_psl (bool): Download a fresh Public Suffix List

    Returns:
        str: The base domain of the given domain

    """
    arg_2 = os.path.join(tempdir, "public_suffix_list.dat")

    def download_psl():
        arg_3 = "https://publicsuffix.org/list/public_suffix_list.dat"
        # Use a browser-like user agent string to bypass some proxy blocks
        arg_4 = {"User-Agent": USER_AGENT}
        arg_5 = requests.get(arg_3, arg_4=arg_4).text
        with open(arg_2, "w", encoding="utf-8") as fresh_psl_file:
            fresh_psl_file.write(arg_5)

    if arg_1:
        if not os.path.exists(arg_2):
            download_psl()
        else:
            arg_6 = datetime.now() - datetime.fromtimestamp(
                os.stat(arg_2).st_mtime)
            if arg_6 > timedelta(hours=24):
                try:
                    download_psl()
                except Exception as error:
                    logger.warning(
                        "Failed to download an updated PSL {0}".format(error))
        with open(arg_2, encoding="utf-8") as psl_file:
            arg_7 = publicsuffix2.PublicSuffixList(psl_file)

        return arg_7.get_public_suffix(arg_0)
    else:
        return publicsuffix2.get_public_suffix(arg_0)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
getattr
(
arg_0
,
'provider'
,
'google'
)
if
arg_2
==
'google'
:
return
google
.
GoogleJobProvider
(
getattr
(
arg_0
,
'verbose'
,
False
)
,
getattr
(
arg_0
,
'dry_run'
,
False
)
,
arg_0
.
project
)
elif
arg_2
==
'google-v2'
:
return
google_v2
.
GoogleV2JobProvider
(
getattr
(
arg_0
,
'verbose'
,
False
)
,
getattr
(
arg_0
,
'dry_run'
,
False
)
,
arg_0
.
project
)
elif
arg_2
==
'local'
:
return
local
.
LocalJobProvider
(
arg_1
)
elif
arg_2
==
'test-fails'
:
return
test_fails
.
FailsJobProvider
(
)
else
:
raise
ValueError
(
'Unknown provider: '
+
arg_2
)

def Func(arg_0, arg_1):
  """Returns a provider for job submission requests."""

  arg_2 = getattr(arg_0, 'provider', 'google')

  if arg_2 == 'google':
    return google.GoogleJobProvider(
        getattr(arg_0, 'verbose', False),
        getattr(arg_0, 'dry_run', False), arg_0.project)
  elif arg_2 == 'google-v2':
    return google_v2.GoogleV2JobProvider(
        getattr(arg_0, 'verbose', False), getattr(arg_0, 'dry_run', False),
        arg_0.project)
  elif arg_2 == 'local':
    return local.LocalJobProvider(arg_1)
  elif arg_2 == 'test-fails':
    return test_fails.FailsJobProvider()
  else:
    raise ValueError('Unknown provider: ' + arg_2)

Returns a provider for job submission requests .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_1 : for arg_4 in ast . walk ( arg_3 ) : if isinstance ( arg_4 , ast . Name ) : if arg_4 . id == arg_2 : arg_4 . id = "self" yield arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Transform the body of an ``Example`` into the body of a method.

        Replaces instances of ``context_variable`` to refer to ``self``.

        ``body`` is the body.
        ``context_variable`` is the name bound in the surrounding context
        manager to the example (usually "test").

        """

        for arg_3 in arg_1:
            for arg_4 in ast.walk(arg_3):
                if isinstance(arg_4, ast.Name):
                    if arg_4.id == arg_2:
                        arg_4.id = "self"
            yield arg_3

Transform the body of an Example into the body of a method .


def Func ( arg_0 , arg_1 ) : if arg_1 is None : return if isinstance ( arg_1 , six . string_types ) : arg_1 = [ host . strip ( ) for host in arg_1 . split ( ',' ) ] arg_1 = [ host . split ( ':' ) for host in arg_1 ] arg_1 = [ ( host [ 0 ] , int ( host [ 1 ] ) ) for host in arg_1 ] return tuple ( arg_1 )

def Func(arg_0, arg_1):
        """
        Return hosts parsed into a tuple of tuples.

        :param hosts: String or list of hosts

        """
        # Default host
        if arg_1 is None:
            return

        # If it's a string, we allow comma separated strings
        if isinstance(arg_1, six.string_types):
            # Split comma-separated list
            arg_1 = [host.strip() for host in arg_1.split(',')]
            # Split host and port
            arg_1 = [host.split(':') for host in arg_1]
            # Coerce ports to int
            arg_1 = [(host[0], int(host[1])) for host in arg_1]

        # The python-etcd client explicitly checks for a tuple type
        return tuple(arg_1)

Return hosts parsed into a tuple of tuples .


def Func ( ** arg_0 ) : arg_1 = get_terminal_size ( ) . columns - 1 for arg_2 in PROGRESS_FORMATS : arg_3 = arg_2 . format ( ** arg_0 ) if len ( arg_3 ) <= arg_1 : break return arg_3

def Func(**arg_0):
    """Creates a status line with appropriate size."""
    arg_1 = get_terminal_size().columns - 1

    for arg_2 in PROGRESS_FORMATS:
        arg_3 = arg_2.format(**arg_0)

        if len(arg_3) <= arg_1:
            break

    return arg_3

Creates a status line with appropriate size .


def Func(arg_0):
    """Send messages in out_stream to the Stream Manager"""
    while not arg_0.out_stream.is_empty() and arg_0._stmgr_client.is_registered:
      arg_1 = arg_0.out_stream.poll()
      if isinstance(arg_1, tuple_pb2.HeronTupleSet):
        arg_1.src_task_id = arg_0.my_pplan_helper.my_task_id
        arg_0.gateway_metrics.update_sent_packet(arg_1.ByteSize())
      arg_0._stmgr_client.send_message(arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . clinvar_submission_collection . find_one_and_update ( { '_id' : ObjectId ( arg_2 ) } , { '$set' : { 'clinvar_subm_id' : arg_1 , 'updated_at' : datetime . now ( ) } } , upsert = True , return_document = pymongo . ReturnDocument . AFTER ) return arg_3

def Func(arg_0, arg_1, arg_2 ):
        """saves an official clinvar submission ID in a clinvar submission object

            Args:
                clinvar_id(str): a string with a format: SUB[0-9]. It is obtained from clinvar portal when starting a new submission
                submission_id(str): submission_id(str) : id of the submission to be updated

            Returns:
                updated_submission(obj): a clinvar submission object, updated
        """
        arg_3 = arg_0.clinvar_submission_collection.find_one_and_update( {'_id': ObjectId(arg_2)}, { '$set' : {'clinvar_subm_id' : arg_1, 'updated_at': datetime.now()} }, upsert=True, return_document=pymongo.ReturnDocument.AFTER )
        return arg_3


def Func ( arg_0 , arg_1 = "" ) : arg_2 = "" arg_1 = os . path . normpath ( arg_1 ) arg_3 , arg_2 = arg_0 . get_directory_info ( arg_1 ) assert arg_3 is not None , arg_2 for arg_4 in dict . __getitem__ ( arg_3 , "directories" ) : yield os . path . join ( arg_1 , arg_4 )

def Func(arg_0, arg_1=""):
        """
        Walk a certain directory in repository and yield all found directories relative path.

        :parameters:
            #. relativePath (str): The relative path of the directory.
        """
        # get directory info dict
        arg_2 = ""
        arg_1 = os.path.normpath(arg_1)
        arg_3, arg_2 = arg_0.get_directory_info(arg_1)
        assert arg_3 is not None, arg_2
        for arg_4 in dict.__getitem__(arg_3, "directories"):
            yield os.path.join(arg_1, arg_4)

Walk a certain directory in repository and yield all found directories relative path .


def
Func
(
arg_0
,
arg_1
=
100
,
arg_2
=
)
:
log
.
debug
(
"step"
)
arg_0
.
seen
=
{
}
arg_0
.
ignore
(
arg_0
,
arg_0
.
__dict__
,
arg_0
.
obj
,
arg_0
.
seen
,
arg_0
.
_ignore
)
arg_0
.
ignore_caller
(
)
arg_0
.
maxdepth
=
arg_2
arg_4
=
0
log
.
debug
(
"will iterate results"
)
for
arg_5
in
arg_0
.
_gen
(
arg_0
.
obj
)
:
log
.
debug
(
"will yeld"
)
yield
arg_5
arg_4
+=
1
if
arg_1
and
arg_4
>=
arg_1
:
yield
0
,
0
,
"==== Max results reached ===="
return

def Func(arg_0, arg_1=100, arg_2=None):
        """Walk the object tree, ignoring duplicates and circular refs."""
        log.debug("step")
        arg_0.seen = {}
        arg_0.ignore(arg_0, arg_0.__dict__, arg_0.obj, arg_0.seen, arg_0._ignore)

        # Ignore the calling frame, its builtins, globals and locals
        arg_0.ignore_caller()
        arg_0.maxdepth = arg_2
        arg_4 = 0
        log.debug("will iterate results")
        for arg_5 in arg_0._gen(arg_0.obj):
            log.debug("will yeld")
            yield arg_5
            arg_4 += 1
            if arg_1 and arg_4 >= arg_1:
                yield 0, 0, "==== Max results reached ===="
                return

Walk the object tree ignoring duplicates and circular refs .


return items_to_create, items_to_update, items_to_delete, transmission_map

def Func(arg_0, arg_1):
        """
        Return items that need to be created, updated, and deleted along with the
        current ContentMetadataItemTransmissions.
        """
        arg_2 = {}
        arg_3 = {}
        arg_4 = {}
        arg_5 = {}
        arg_6 = arg_1.keys()

        # Get the items that were previously transmitted to the integrated channel.
        # If we are not transmitting something that was previously transmitted,
        # we need to delete it from the integrated channel.
        for arg_7 in arg_0._get_transmissions():
            arg_5[arg_7.content_id] = arg_7
            if arg_7.content_id not in arg_6:
                arg_4[arg_7.content_id] = arg_7.channel_metadata

        # Compare what is currently being transmitted to what was transmitted
        # previously, identifying items that need to be created or updated.
        for arg_9 in arg_1.values():
            arg_8 = arg_9.content_id
            arg_10 = arg_9.channel_metadata
            arg_11 = arg_5.get(arg_8, None)
            if arg_11 is not None:
                if diff(arg_10, arg_11.channel_metadata):
                    arg_3[arg_8] = arg_10
            else:
                arg_2[arg_8] = arg_10

        LOGGER.info(
            'Preparing to transmit creation of [%s] content metadata items with plugin configuration [%s]: [%s]',
            len(arg_2),
            arg_0.enterprise_configuration,
            arg_2.keys(),
        )
        LOGGER.info(
            'Preparing to transmit update of [%s] content metadata items with plugin configuration [%s]: [%s]',
            len(arg_3),
            arg_0.enterprise_configuration,
            arg_3.keys(),
        )
        LOGGER.info(
            'Preparing to transmit deletion of [%s] content metadata items with plugin configuration [%s]: [%s]',
            len(arg_4),
            arg_0.enterprise_configuration,
            arg_4.keys(),
        )

        return arg_2, arg_3, arg_4, arg_5

Return items that need to be created updated and deleted along with the current ContentMetadataItemTransmissions .


return list(i for i in self.images
                    if attribute(i, 'u') == well_column and
                       attribute(i, 'v') == well_row)

def Func ( arg_0 , arg_1 , arg_2 ) : return list ( arg_3 for arg_3 in arg_0 . images if attribute ( arg_3 , 'u' ) == arg_2 and attribute ( arg_3 , 'v' ) == arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Get list of paths to images in specified well.

        Parameters
        ----------
        well_row : int
            Starts at 0. Same as --V in files.
        well_column : int
            Starts at 0. Save as --U in files.

        Returns
        -------
        list of strings
            Paths to images or empty list if no images are found.
        """
        return list(arg_3 for arg_3 in arg_0.images
                    if attribute(arg_3, 'u') == arg_2 and
                       attribute(arg_3, 'v') == arg_1)

Get list of paths to images in specified well .


return self._execute(Command.FIND_CHILD_ELEMENT, {
            'using': using,
            'value': value
        })

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . _execute ( Command . FIND_CHILD_ELEMENT , { 'using' : arg_1 , 'value' : arg_2 } )

def Func(arg_0, arg_1, arg_2):
        """find an Func in the current Func.

        Support:
            Android iOS Web(WebView)

        Args:
            using(str): The Func location strategy.
            value(str): The value of the location strategy.

        Returns:
            WebElement Object.

        Raises:
            WebDriverException.
        """
        return arg_0._execute(Command.FIND_CHILD_ELEMENT, {
            'using': arg_1,
            'value': arg_2
        })

find an element in the current element.

        Support:
            Android iOS Web(WebView)

        Args:
            using(str): The element location strategy.
            value(str): The value of the location strategy.

        Returns:
            WebElement Object.

        Raises:
            WebDriverException.

find an element in the current element .