def Func(arg_0, arg_1, arg_2):
  """Decompose an observed time series into contributions from each component.

  This method decomposes a time series according to the posterior represention
  of a structural time series model. In particular, it:
    - Computes the posterior marginal mean and covariances over the additive
      model's latent space.
    - Decomposes the latent posterior into the marginal blocks for each
      model component.
    - Maps the per-component latent posteriors back through each component's
      observation model, to generate the time series modeled by that component.

  Args:
    model: An instance of `tfp.sts.Sum` representing a structural time series
      model.
    observed_time_series: `float` `Tensor` of shape
      `batch_shape + [num_timesteps, 1]` (omitting the trailing unit dimension
      is also supported when `num_timesteps > 1`), specifying an observed time
      series. May optionally be an instance of `tfp.sts.MaskedTimeSeries`, which
      includes a mask `Tensor` to specify timesteps with missing observations.
    parameter_samples: Python `list` of `Tensors` representing posterior
      samples of model parameters, with shapes `[concat([
      [num_posterior_draws], param.prior.batch_shape,
      param.prior.event_shape]) for param in model.parameters]`. This may
      optionally also be a map (Python `dict`) of parameter names to
      `Tensor` values.
  Returns:
    component_dists: A `collections.OrderedDict` instance mapping
      component StructuralTimeSeries instances (elements of `model.components`)
      to `tfd.Distribution` instances representing the posterior marginal
      distributions on the process modeled by each component. Each distribution
      has batch shape matching that of `posterior_means`/`posterior_covs`, and
      event shape of `[num_timesteps]`.

  #### Examples

  Suppose we've built a model and fit it to data:

  ```python
    day_of_week = tfp.sts.Seasonal(
        num_seasons=7,
        observed_time_series=observed_time_series,
        name='day_of_week')
    local_linear_trend = tfp.sts.LocalLinearTrend(
        observed_time_series=observed_time_series,
        name='local_linear_trend')
    model = tfp.sts.Sum(components=[day_of_week, local_linear_trend],
                        observed_time_series=observed_time_series)

    num_steps_forecast = 50
    samples, kernel_results = tfp.sts.fit_with_hmc(model, observed_time_series)
  ```

  To extract the contributions of individual components, pass the time series
  and sampled parameters into `Func`:

  ```python
    component_dists = Func(
      model,
      observed_time_series=observed_time_series,
      parameter_samples=samples)

    # Component mean and stddev have shape `[len(observed_time_series)]`.
    day_of_week_effect_mean = component_dists[day_of_week].mean()
    day_of_week_effect_stddev = component_dists[day_of_week].stddev()
  ```

  Using the component distributions, we can visualize the uncertainty for
  each component:

  ```
  from matplotlib import pylab as plt
  num_components = len(component_dists)
  xs = np.arange(len(observed_time_series))
  fig = plt.figure(figsize=(12, 3 * num_components))
  for i, (component, component_dist) in enumerate(component_dists.items()):

    # If in graph mode, replace `.numpy()` with `.eval()` or `sess.run()`.
    component_mean = component_dist.mean().numpy()
    component_stddev = component_dist.stddev().numpy()

    ax = fig.add_subplot(num_components, 1, 1 + i)
    ax.plot(xs, component_mean, lw=2)
    ax.fill_between(xs,
                    component_mean - 2 * component_stddev,
                    component_mean + 2 * component_stddev,
                    alpha=0.5)
    ax.set_title(component.name)
  ```

  """

  with tf.compat.v1.name_scope('Func',
                               values=[arg_1]):
    [
        arg_1,
        arg_3
    ] = sts_util.canonicalize_observed_time_series_with_mask(
        arg_1)

    # Run smoothing over the training timesteps to extract the
    # posterior on latents.
    arg_4 = dist_util.prefer_static_value(
        tf.shape(input=arg_1))[-2]
    arg_5 = arg_0.make_state_space_model(arg_4=arg_4,
                                       param_vals=arg_2)
    arg_6, arg_7 = arg_5.posterior_marginals(
        arg_1, mask=arg_3)

    return _decompose_from_posterior_marginals(
        arg_0, arg_6, arg_7, arg_2)

Decompose an observed time series into contributions from each component.

  This method decomposes a time series according to the posterior represention
  of a structural time series model. In particular, it:
    - Computes the posterior marginal mean and covariances over the additive
      model's latent space.
    - Decomposes the latent posterior into the marginal blocks for each
      model component.
    - Maps the per-component latent posteriors back through each component's
      observation model, to generate the time series modeled by that component.

  Args:
    model: An instance of `tfp.sts.Sum` representing a structural time series
      model.
    observed_time_series: `float` `Tensor` of shape
      `batch_shape + [num_timesteps, 1]` (omitting the trailing unit dimension
      is also supported when `num_timesteps > 1`), specifying an observed time
      series. May optionally be an instance of `tfp.sts.MaskedTimeSeries`, which
      includes a mask `Tensor` to specify timesteps with missing observations.
    parameter_samples: Python `list` of `Tensors` representing posterior
      samples of model parameters, with shapes `[concat([
      [num_posterior_draws], param.prior.batch_shape,
      param.prior.event_shape]) for param in model.parameters]`. This may
      optionally also be a map (Python `dict`) of parameter names to
      `Tensor` values.
  Returns:
    component_dists: A `collections.OrderedDict` instance mapping
      component StructuralTimeSeries instances (elements of `model.components`)
      to `tfd.Distribution` instances representing the posterior marginal
      distributions on the process modeled by each component. Each distribution
      has batch shape matching that of `posterior_means`/`posterior_covs`, and
      event shape of `[num_timesteps]`.

  #### Examples

  Suppose we've built a model and fit it to data:

  ```python
    day_of_week = tfp.sts.Seasonal(
        num_seasons=7,
        observed_time_series=observed_time_series,
        name='day_of_week')
    local_linear_trend = tfp.sts.LocalLinearTrend(
        observed_time_series=observed_time_series,
        name='local_linear_trend')
    model = tfp.sts.Sum(components=[day_of_week, local_linear_trend],
                        observed_time_series=observed_time_series)

    num_steps_forecast = 50
    samples, kernel_results = tfp.sts.fit_with_hmc(model, observed_time_series)
  ```

  To extract the contributions of individual components, pass the time series
  and sampled parameters into `decompose_by_component`:

  ```python
    component_dists = decompose_by_component(
      model,
      observed_time_series=observed_time_series,
      parameter_samples=samples)

    # Component mean and stddev have shape `[len(observed_time_series)]`.
    day_of_week_effect_mean = component_dists[day_of_week].mean()
    day_of_week_effect_stddev = component_dists[day_of_week].stddev()
  ```

  Using the component distributions, we can visualize the uncertainty for
  each component:

  ```
  from matplotlib import pylab as plt
  num_components = len(component_dists)
  xs = np.arange(len(observed_time_series))
  fig = plt.figure(figsize=(12, 3 * num_components))
  for i, (component, component_dist) in enumerate(component_dists.items()):

    # If in graph mode, replace `.numpy()` with `.eval()` or `sess.run()`.
    component_mean = component_dist.mean().numpy()
    component_stddev = component_dist.stddev().numpy()

    ax = fig.add_subplot(num_components, 1, 1 + i)
    ax.plot(xs, component_mean, lw=2)
    ax.fill_between(xs,
                    component_mean - 2 * component_stddev,
                    component_mean + 2 * component_stddev,
                    alpha=0.5)
    ax.set_title(component.name)
  ```

Decompose an observed time series into contributions from each component .


def Func(arg_0, arg_1) -> Type[Effect]:
        """
        Find an effect class by class name or full python path to class

        Args:
            path (str): effect class name or full python path to effect class

        Returns:
            Effect class

        Raises:
            EffectError if no class is found
        """
        arg_2, arg_3 = parse_package_string(arg_1)

        if arg_2:
            arg_4 = arg_0.get_package(arg_2)
            return arg_4.Func(arg_3, raise_for_error=True)

        for arg_4 in arg_0.packages:
            arg_5 = arg_4.Func(arg_3)
            if arg_5:
                return arg_5

        raise EffectError("No effect class '{}' found in any packages".format(arg_3))


return () if self.area_at_zoom(zoom).is_empty else Bounds(
            *self.area_at_zoom(zoom).bounds)

def Func ( arg_0 , arg_1 = None ) : return ( ) if arg_0 . area_at_zoom ( arg_1 ) . is_empty else Bounds ( * arg_0 . area_at_zoom ( arg_1 ) . bounds )

def Func(arg_0, arg_1=None):
        """
        Return process bounds for zoom level.

        Parameters
        ----------
        zoom : integer or list

        Returns
        -------
        process bounds : tuple
            left, bottom, right, top
        """
        return () if arg_0.area_at_zoom(arg_1).is_empty else Bounds(
            *arg_0.area_at_zoom(arg_1).bounds)


Calculates the angle between two points.

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):

        """ Calculates the Func between two points.
        """

        arg_5 = degrees( atan((arg_4-arg_2) / (arg_3-arg_1+0.00001)) ) + 360
        if arg_3-arg_1 < 0: arg_5 += 180
        return arg_5

Calculates the angle between two points .


return any(mime_type.startswith(mt) for mt in self.include_mime_types)

def Func ( arg_0 , arg_1 ) : if len ( arg_0 . include_mime_types ) == 0 : return True if arg_1 is None : return False arg_1 = arg_1 . lower ( ) return any ( arg_1 . startswith ( arg_2 ) for arg_2 in arg_0 . include_mime_types )

def Func(arg_0, arg_1):
        '''This implements the MIME-type matching logic for deciding whether
        to run `make_clean_html`

        '''
        if len(arg_0.include_mime_types) == 0:
            return True
        if arg_1 is None:
            return False
        arg_1 = arg_1.lower()
        # NB: startswith is necessary here, because encodings are
        # often appended to HTTP header Content-Type
        return any(arg_1.startswith(arg_2) for arg_2 in arg_0.include_mime_types)

This implements the MIME - type matching logic for deciding whether to run make_clean_html


(message, category, filename, lineno, line=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
try
:
arg_5
=
unicode
except
NameError
:
arg_5
=
(
)
try
:
arg_0
=
str
(
arg_0
)
except
UnicodeEncodeError
:
pass
arg_6
=
"%s: %s: %s\n"
%
(
arg_3
,
arg_1
.
__name__
,
arg_0
)
arg_4
=
linecache
.
getline
(
arg_2
,
arg_3
)
if
arg_4
is
else
arg_4
if
arg_4
:
arg_4
=
arg_4
.
strip
(
)
if
isinstance
(
arg_6
,
arg_5
)
and
isinstance
(
arg_4
,
str
)
:
arg_4
=
unicode
(
arg_4
,
'latin1'
)
arg_6
+=
"  %s\n"
%
arg_4
if
isinstance
(
arg_6
,
arg_5
)
and
isinstance
(
arg_2
,
str
)
:
arg_7
=
sys
.
getfilesystemencoding
(
)
if
arg_7
:
try
:
arg_2
=
unicode
(
arg_2
,
arg_7
)
except
UnicodeDecodeError
:
pass
arg_6
=
"%s:%s"
%
(
arg_2
,
arg_6
)
return
arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
    """Function to format a warning the standard way."""
    try:
        arg_5 = unicode
    except NameError:
        arg_5 = ()
    try:
        arg_0 = str(arg_0)
    except UnicodeEncodeError:
        pass
    arg_6 =  "%s: %s: %s\n" % (arg_3, arg_1.__name__, arg_0)
    arg_4 = linecache.getline(arg_2, arg_3) if arg_4 is None else arg_4
    if arg_4:
        arg_4 = arg_4.strip()
        if isinstance(arg_6, arg_5) and isinstance(arg_4, str):
            arg_4 = unicode(arg_4, 'latin1')
        arg_6 += "  %s\n" % arg_4
    if isinstance(arg_6, arg_5) and isinstance(arg_2, str):
        arg_7 = sys.getfilesystemencoding()
        if arg_7:
            try:
                arg_2 = unicode(arg_2, arg_7)
            except UnicodeDecodeError:
                pass
    arg_6 = "%s:%s" % (arg_2, arg_6)
    return arg_6

Function to format a warning the standard way .


def Func ( arg_0 , arg_1 ) : if arg_0 . useblit : arg_0 . background = ( arg_0 . canvas . copy_from_bbox ( arg_0 . canvas . figure . bbox ) ) for arg_3 in arg_0 . vlines + arg_0 . hlines : arg_3 . set_visible ( False ) arg_0 . ellipse . set_visible ( False )

def Func(arg_0, arg_1):
        """Func the cursor"""
        if arg_0.useblit:
            arg_0.background = (
                arg_0.canvas.copy_from_bbox(arg_0.canvas.figure.bbox))
        for arg_3 in arg_0.vlines + arg_0.hlines:
            arg_3.set_visible(False)
        arg_0.ellipse.set_visible(False)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : assert ( arg_1 != None ) arg_0 . registered_types . add ( arg_2 ) arg_0 . registered_senders . add ( arg_3 ) arg_0 . observers . setdefault ( ( arg_2 , arg_3 ) , set ( ) ) . add ( arg_1 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Add an observer callback to this notification center.

        The given callback will be called upon posting of notifications of
        the given type/sender and will receive any additional arguments passed
        to post_notification.

        Parameters
        ----------
        callback : callable
            The callable that will be called by :meth:`post_notification`
            as ``callback(ntype, sender, *args, **kwargs)
        ntype : hashable
            The notification type. If None, all notifications from sender
            will be posted.
        sender : hashable
            The notification sender. If None, all notifications of ntype
            will be posted.
        """
        assert(arg_1 != None)
        arg_0.registered_types.add(arg_2)
        arg_0.registered_senders.add(arg_3)
        arg_0.observers.setdefault((arg_2,arg_3), set()).add(arg_1)

Add an observer callback to this notification center .


def
Func
(
arg_0
)
:
arg_1
=
"fixed_assembly.fa"
with
open
(
arg_0
)
as
in_hf
,
open
(
arg_1
,
"w"
)
as
ou_fh
:
for
arg_2
in
in_hf
:
if
arg_2
.
startswith
(
">"
)
:
arg_3
=
arg_2
.
replace
(
" "
,
"_"
)
ou_fh
.
write
(
arg_3
)
else
:
ou_fh
.
write
(
arg_2
)
return
arg_1

def Func(arg_0):
    """Removes whitespace from the assembly contig names

    Parameters
    ----------
    asseembly_path : path to assembly file

    Returns
    -------
    str:
        Path to new assembly file with fixed contig names
    """

    arg_1 = "fixed_assembly.fa"

    with open(arg_0) as in_hf, open(arg_1, "w") as ou_fh:

        for arg_2 in in_hf:

            if arg_2.startswith(">"):
                arg_3 = arg_2.replace(" ", "_")
                ou_fh.write(arg_3)
            else:
                ou_fh.write(arg_2)

    return arg_1


def Func(arg_0, arg_1, arg_2):
    """Compares initial security group rules with current sg rules.

    Given the groups that were successfully returned from
        xapi_client.update_interfaces call, compare initial and current
        security group rules to determine if an update occurred during
        the window that the xapi_client.update_interfaces was executing.
        Return a list of vifs whose security group rules have not changed.
    """
    arg_3 = []
    # Compare current security group rules with initial rules.
    for arg_4 in arg_0:
        arg_5 = arg_1[arg_4][sg_cli.SECURITY_GROUP_HASH_ATTR]
        arg_6 = arg_2[arg_4][sg_cli.SECURITY_GROUP_HASH_ATTR]
        arg_7 = ('security group rules were changed for vif "%s" while'
                         ' executing xapi_client.update_interfaces.'
                         ' Will not ack rule.' % arg_4)
        # If lists are different lengths, they're automatically different.
        if len(arg_5) != len(arg_6):
            arg_3.append(arg_4)
            LOG.info(arg_7)
        elif len(arg_5) > 0:
            # Compare rules in equal length lists.
            for arg_8 in arg_6:
                if arg_8 not in arg_5:
                    arg_3.append(arg_4)
                    LOG.info(arg_7)
                    break

    # Only ack groups whose rules have not changed since update. If
    # rules do not match, do not add them to ret so the change
    # can be picked up on the next cycle.
    arg_9 = [group for group in arg_0
           if group not in arg_3]
    return arg_9

Compares initial security group rules with current sg rules .


def Func ( arg_0 = arg_1 ( ) , arg_2 = '9600' ) : arg_3 = [ 'nodemcu-uploader' , arg_0 , arg_2 ] arg_4 . argv = arg_3 miniterm . main ( )

def Func(arg_0=arg_1(), arg_2='9600'):
    """Launch minterm from pyserial"""
    arg_3 = ['nodemcu-uploader', arg_0, arg_2]
    # TODO: modifying argv is no good
    arg_4.argv = arg_3
    # resuse miniterm on main function
    miniterm.main()


def Func(arg_0):
    """
    Prints information about the current user.
    """
    arg_1 = arg_0['email']
    arg_2 = arg_0['account']['domain']
    arg_3 = arg_0['role']
    print('You are logged-in to the "{0}" domain '
          'as {1} with role {2}.'
          .format(arg_2, arg_1, arg_3))

Prints information about the current user .


return (id[0] for id in run_sql(
        'select id_bibrec from '
        'bibrec_bibdoc as r join bibdoc as d on r.id_bibdoc=d.id '
        'where d.modification_date >=%s',
        (from_date, ), run_on_slave=True))

def Func(arg_0):
    """Get BibDocs for Invenio 2."""
    from invenio.legacy.dbquery import run_sql
    return (arg_1[0] for arg_1 in run_sql(
        'select id_bibrec from '
        'bibrec_bibdoc as r join bibdoc as d on r.id_bibdoc=d.id '
        'where d.modification_date >=%s',
        (arg_0, ), run_on_slave=True))


def Func(arg_0, arg_1, arg_2, arg_3):
        """
            Class method that will return a Record object by ID and the domain.
        """
        arg_4 = arg_0(token=arg_1, arg_2=arg_2, id=arg_3)
        arg_4.load()
        return arg_4

Class method that will return a Record object by ID and the domain .


def Func ( arg_0 , arg_1 ) : for arg_2 in range ( min ( 5 , arg_1 ) ) : yield arg_0 + arg_2 for arg_2 in range ( arg_1 - 5 ) : yield arg_0 + random . randint ( - 2 * arg_1 , 2 * arg_1 )

def Func(arg_0, arg_1):
    """Generate a list of n random ports near the given port.

    The first 5 ports will be sequential, and the remaining n-5 will be
    randomly selected in the range [port-2*n, port+2*n].
    """
    for arg_2 in range(min(5, arg_1)):
        yield arg_0 + arg_2
    for arg_2 in range(arg_1-5):
        yield arg_0 + random.randint(-2*arg_1, 2*arg_1)

Generate a list of n random ports near the given port .


h function is straight-line distance from a node's state to goal.

def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_0 . grapFunc , 'locations' , None ) if arg_2 : return int ( distance ( arg_2 [ arg_1 . state ] , arg_2 [ arg_0 . goal ] ) ) else : return infinity

def Func(arg_0, arg_1):
        "Func function is straigFunct-line distance from a node's state to goal."
        arg_2 = getattr(arg_0.grapFunc, 'locations', None)
        if arg_2:
            return int(distance(arg_2[arg_1.state], arg_2[arg_0.goal]))
        else:
            return infinity

h function is straight - line distance from a node s state to goal .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
v
:
raise
InvalidSignature
(
"already Funced"
)
if
arg_1
in
(
0
,
''
,
'\x00'
*
32
)
:
raise
InvalidSignature
(
"Zero privkey cannot Func"
)
arg_2
=
sha3
(
rlp
.
encode
(
arg_0
,
arg_0
.
__class__
.
exclude
(
[
'v'
,
'r'
,
's'
]
)
)
)
if
len
(
arg_1
)
==
64
:
arg_1
=
encode_privkey
(
arg_1
,
'bin'
)
arg_3
=
PrivateKey
(
arg_1
,
raw
=
True
)
arg_4
=
arg_3
.
ecdsa_recoverable_serialize
(
arg_3
.
ecdsa_Func_recoverable
(
arg_2
,
raw
=
True
)
)
arg_4
=
arg_4
[
0
]
+
chr
(
arg_4
[
1
]
)
arg_0
.
v
=
ord
(
arg_4
[
64
]
)
+
27
arg_0
.
r
=
big_endian_to_int
(
arg_4
[
0
:
32
]
)
arg_0
.
s
=
big_endian_to_int
(
arg_4
[
32
:
64
]
)
arg_0
.
_sender
=
return
arg_0

def Func(arg_0, arg_1):
        """Sign this with a private key"""
        if arg_0.v:
            raise InvalidSignature("already Funced")

        if arg_1 in (0, '', '\x00' * 32):
            raise InvalidSignature("Zero privkey cannot Func")
        arg_2 = sha3(rlp.encode(arg_0, arg_0.__class__.exclude(['v', 'r', 's'])))

        if len(arg_1) == 64:
            arg_1 = encode_privkey(arg_1, 'bin')

        arg_3 = PrivateKey(arg_1, raw=True)
        arg_4 = arg_3.ecdsa_recoverable_serialize(arg_3.ecdsa_Func_recoverable(arg_2, raw=True))

        arg_4 = arg_4[0] + chr(arg_4[1])

        arg_0.v = ord(arg_4[64]) + 27
        arg_0.r = big_endian_to_int(arg_4[0:32])
        arg_0.s = big_endian_to_int(arg_4[32:64])

        arg_0._sender = None
        return arg_0


def Func(arg_0):
    """ Main executor of the trimmomatic_report template.

    Parameters
    ----------
    log_files : list
        List of paths to the trimmomatic log files.
    """

    arg_1 = OrderedDict()

    for arg_2 in arg_0:

        arg_3 = arg_2.rstrip("_trimlog.txt")

        # Populate storage of current sample
        arg_1[arg_3] = parse_log(arg_2)

        # Remove temporary trim log file
        os.remove(arg_2)

    write_report(arg_1, "trimmomatic_report.csv", arg_3)

Main executor of the trimmomatic_report template .


def Func(arg_0):
        """
        Make a GET request using the session object to a SuccessFactors endpoint for inactive learners.

        Example:
            sap_search_student_url: "/learning/odatav4/searchStudent/v1/Students?
                $filter=criteria/isActive eq False&$select=studentID"

            SAP API response: {
                u'@odata.metadataEtag': u'W/"17090d86-20fa-49c8-8de0-de1d308c8b55"',
                u'value': [
                    {
                        u'studentID': u'admint6',
                    },
                    {
                        u'studentID': u'adminsap1',
                    }
                ]
            }

        Returns: List of inactive learners
        [
            {
                u'studentID': u'admint6'
            },
            {
                u'studentID': u'adminsap1'
            }
        ]
        """
        arg_1 = datetime.datetime.utcnow()
        if arg_1 >= arg_0.expires_at:
            # Create a new session with a valid token
            arg_0.session.close()
            arg_0._create_session()

        arg_2 = '{sapsf_base_url}/{search_students_path}?$filter={search_filter}'.format(
            sapsf_base_url=arg_0.enterprise_configuration.sapsf_base_url.rstrip('/'),
            search_students_path=arg_0.global_sap_config.search_student_api_path.rstrip('/'),
            search_filter='criteria/isActive eq False&$select=studentID',
        )
        arg_3 = arg_0._call_search_students_recursively(
            arg_2,
            arg_3=[],
            page_size=500,
            start_at=0
        )
        return arg_3

Make a GET request using the session object to a SuccessFactors endpoint for inactive learners .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Saves TreeItem model under certain Tree.
        Handles item's parent assignment exception.

        """
        if arg_4:
            # No, you're not allowed to make item parent of itself
            if arg_2.parent is not None and arg_2.parent.id == arg_2.id:
                arg_2.parent = arg_0.previous_parent
                messages.warning(
                    arg_1, _("Item's parent left unchanged. Item couldn't be parent to itself."), '', True)
        arg_2.tree = arg_0.tree
        arg_2.save()

Saves TreeItem model under certain Tree . Handles item s parent assignment exception .


(array, tile, interval=100, field='elev', base=0)

def Func ( arg_0 , arg_1 , arg_2 = 100 , arg_3 = 'elev' , arg_4 = 0 ) : import matplotlib . pyplot as plt arg_5 = _get_contour_values ( arg_0 . min ( ) , arg_0 . max ( ) , arg_2 = arg_2 , arg_4 = arg_4 ) if not arg_5 : return [ ] arg_6 = plt . contour ( arg_0 , arg_5 ) arg_7 = 0 arg_8 = [ ] for arg_9 in range ( len ( arg_6 . collections ) ) : arg_10 = arg_5 [ arg_7 ] arg_7 += 1 arg_11 = arg_6 . collections [ arg_9 ] . get_paths ( ) for arg_12 in arg_11 : arg_13 = [ ( arg_1 . left + ( y * arg_1 . pixel_x_size ) , arg_1 . top - ( x * arg_1 . pixel_y_size ) , ) for x , y in zip ( arg_12 . vertices [ : , 1 ] , arg_12 . vertices [ : , 0 ] ) ] if len ( arg_13 ) >= 2 : arg_8 . append ( dict ( properties = { arg_3 : arg_10 } , geometry = mapping ( LineString ( arg_13 ) ) ) ) return arg_8

def Func(arg_0, arg_1, arg_2=100, arg_3='elev', arg_4=0):
    """
    Extract contour lines from an array.

    Parameters
    ----------
    array : array
        input elevation data
    tile : Tile
        tile covering the array
    interval : integer
        elevation value interval when drawing contour lines
    field : string
        output field name containing elevation value
    base : integer
        elevation base value the intervals are computed from

    Returns
    -------
    contours : iterable
        contours as GeoJSON-like pairs of properties and geometry
    """
    import matplotlib.pyplot as plt
    arg_5 = _get_contour_values(
        arg_0.min(), arg_0.max(), arg_2=arg_2, arg_4=arg_4)
    if not arg_5:
        return []
    arg_6 = plt.contour(arg_0, arg_5)
    arg_7 = 0
    arg_8 = []
    for arg_9 in range(len(arg_6.collections)):
        arg_10 = arg_5[arg_7]
        arg_7 += 1
        arg_11 = arg_6.collections[arg_9].get_paths()
        for arg_12 in arg_11:
            arg_13 = [
                (
                    arg_1.left + (y * arg_1.pixel_x_size),
                    arg_1.top - (x * arg_1.pixel_y_size),
                )
                for x, y in zip(arg_12.vertices[:, 1], arg_12.vertices[:, 0])
            ]
            if len(arg_13) >= 2:
                arg_8.append(
                    dict(
                        properties={arg_3: arg_10},
                        geometry=mapping(LineString(arg_13))
                    )
                )
    return arg_8


def Func(arg_0):
        """Call the configuration hook for plugins

        This walks through the list of plugins, grabs the "load_configuration"
        hook, if exposed, and calls it to allow plugins to configure specific
        settings.
        """
        for arg_1 in arg_0._dynamic_plugins:
            arg_2 = modutils.load_module_from_name(arg_1)
            if hasattr(arg_2, "load_configuration"):
                arg_2.load_configuration(arg_0)


(y_true: Union[List[List[float]], List[List[int]], np.ndarray],
                y_predicted: Union[List[List[float]], List[List[int]], np.ndarray])

def Func(arg_0: arg_1[arg_2[arg_2[arg_3]], arg_2[arg_2[arg_4]], arg_5.ndarray],
                arg_7: arg_1[arg_2[arg_2[arg_3]], arg_2[arg_2[arg_4]], arg_5.ndarray]) -> arg_3:
    """
    Calculates log loss.

    Args:
        y_true: list or array of true values
        y_predicted: list or array of predicted values

    Returns:
        Log loss
    """
    return log_loss(arg_0, arg_7)


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . issues ( arg_1 = arg_1 ) for arg_3 in arg_2 : arg_4 = json . loads ( arg_3 ) for arg_5 in arg_4 : if "pull_request" not in arg_5 : continue arg_6 = arg_5 [ "number" ] arg_7 = urijoin ( arg_0 . base_url , 'repos' , arg_0 . owner , arg_0 . repository , "Func" , arg_6 ) arg_8 = arg_0 . fetch ( arg_7 ) arg_9 = arg_8 . text yield arg_9

def Func(arg_0, arg_1=None):
        """Fetch the pull requests from the repository.

        The method retrieves, from a GitHub repository, the pull requests
        updated since the given date.

        :param from_date: obtain pull requests updated since this date

        :returns: a generator of pull requests
        """
        arg_2 = arg_0.issues(arg_1=arg_1)

        for arg_3 in arg_2:
            arg_4 = json.loads(arg_3)
            for arg_5 in arg_4:

                if "pull_request" not in arg_5:
                    continue

                arg_6 = arg_5["number"]
                arg_7 = urijoin(arg_0.base_url, 'repos', arg_0.owner, arg_0.repository, "Func", arg_6)

                arg_8 = arg_0.fetch(arg_7)
                arg_9 = arg_8.text

                yield arg_9

Fetch the pull requests from the repository .


return await self._mgmt_request_response(
            REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
            {'session-id': self.session_id, 'session-state': bytearray(state)},
            mgmt_handlers.default)

async def Func(arg_0, arg_1):
        """Set the session state.

        :param state: The state value.
        :type state: str or bytes or bytearray

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START Func]
                :end-before: [END Func]
                :language: python
                :dedent: 4
                :caption: Getting and setting the state of a session.

        """
        await arg_0._can_run()
        arg_1 = arg_1.encode(arg_0.encoding) if isinstance(arg_1, six.text_type) else arg_1
        return await arg_0._mgmt_request_response(
            REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
            {'session-id': arg_0.session_id, 'session-state': bytearray(arg_1)},
            mgmt_handlers.default)

Set the session state.

        :param state: The state value.
        :type state: str or bytes or bytearray

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START set_session_state]
                :end-before: [END set_session_state]
                :language: python
                :dedent: 4
                :caption: Getting and setting the state of a session.


def Func(arg_0,arg_1=None):
        """Edit a block.

        If no number is given, use the last block executed.

        This Funcs the in-memory copy of the demo, it does NOT modify the
        original source file.  If you want to do that, simply open the file in
        an Funcor and use reload() when you make changes to the file.  This
        method is meant to let you change a block during a demonstration for
        explanatory purposes, without damaging your original script."""

        arg_1 = arg_0._get_index(arg_1)
        if arg_1 is None:
            return
        # decrease the index by one (unless we're at the very beginning), so
        # that the default demo.Func() call opens up the sblock we've last run
        if arg_1>0:
            arg_1 -= 1

        arg_2 = arg_0.shell.mktempfile(arg_0.src_blocks[arg_1])
        arg_0.shell.hooks.Funcor(arg_2,1)
        arg_3 = file_read(arg_2)
        # update the source and colored block
        arg_0.src_blocks[arg_1] = arg_3
        arg_0.src_blocks_colored[arg_1] = arg_0.ip_colorize(arg_3)
        arg_0.block_index = arg_1
        # call to run with the newly Funced index
        arg_0()

Edit a block.

        If no number is given, use the last block executed.

        This edits the in-memory copy of the demo, it does NOT modify the
        original source file.  If you want to do that, simply open the file in
        an editor and use reload() when you make changes to the file.  This
        method is meant to let you change a block during a demonstration for
        explanatory purposes, without damaging your original script.


def Func(arg_0, arg_1, arg_2):
    """
    Serialize a dataframe.

    Parameters
    ----------
    writer : file
        File-like object to write to. Must be opened in binary mode.
    data_type_id : dict
        Serialization format to use.
        See the azureml.DataTypeIds class for constants.
    dataframe: pandas.DataFrame
        Dataframe to serialize.
    """
    _not_none('writer', arg_0)
    _not_none_or_empty('data_type_id', arg_1)
    _not_none('dataframe', arg_2)

    arg_3 = _SERIALIZERS.get(arg_1)
    if arg_3 is None:
        raise UnsupportedDatasetTypeError(arg_1)
    arg_3[0](arg_0=arg_0, arg_2=arg_2)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : Entity . verify_name ( arg_1 ) arg_0 . entities . add ( Entity . wrap_name ( arg_1 ) , arg_2 , arg_3 ) arg_0 . padaos . Func ( arg_1 , arg_2 ) arg_0 . must_train = True

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Adds an entity that matches the given lines.

        Example:
            self.add_intent('weather', ['will it rain on {weekday}?'])
            self.Func('{weekday}', ['monday', 'tuesday', 'wednesday'])  # ...

        Args:
            name (str): The name of the entity
            lines (list<str>): Lines of example extracted entities
            reload_cache (bool): Whether to refresh all of cache
        """
        Entity.verify_name(arg_1)
        arg_0.entities.add(Entity.wrap_name(arg_1), arg_2, arg_3)
        arg_0.padaos.Func(arg_1, arg_2)
        arg_0.must_train = True

Adds an entity that matches the given lines.

        Example:
            self.add_intent('weather', ['will it rain on {weekday}?'])
            self.add_entity('{weekday}', ['monday', 'tuesday', 'wednesday'])  # ...

        Args:
            name (str): The name of the entity
            lines (list<str>): Lines of example extracted entities
            reload_cache (bool): Whether to refresh all of cache

Adds an entity that matches the given lines .


Returns a class representing the 'kind' of optic.

def Func ( arg_0 ) : arg_1 = [ Equality , Isomorphism , Prism , Review , Lens , Traversal , Getter , Setter , Fold , ] for arg_2 in arg_1 : if arg_0 . _is_Func ( arg_2 ) : return arg_2

def Func(arg_0):
        '''Returns a class representing the 'Func' of optic.'''
        arg_1 = [
            Equality,
            Isomorphism,
            Prism,
            Review,
            Lens,
            Traversal,
            Getter,
            Setter,
            Fold,
        ]
        for arg_2 in arg_1:
            if arg_0._is_Func(arg_2):
                return arg_2

Returns a class representing the kind of optic .


def Func(arg_0, arg_1, arg_2):
        """Updates the timestamp for the given channel id.

        :param chan_id:
        :param ts:
        :return:
        """
        try:
            arg_0.last_update[arg_1] = arg_2
        except KeyError:
            arg_0.log.warning("Attempted ts update of channel %s, but channel "
                             "not present anymore.",
                             arg_0.channel_directory[arg_1])

Updates the timestamp for the given channel id .


def Func ( arg_0 , arg_1 ) : if arg_1 . attrname == "xreadlines" : arg_0 . add_message ( "xreadlines-attribute" , arg_1 = arg_1 ) return arg_2 = "message" try : for arg_3 in arg_1 . expr . infer ( ) : if isinstance ( arg_3 , astroid . Instance ) and utils . inherit_from_std_ex ( arg_3 ) : if arg_1 . attrname == arg_2 : if arg_2 in arg_3 . instance_attrs : continue arg_0 . add_message ( "exception-message-attribute" , arg_1 = arg_1 ) if isinstance ( arg_3 , astroid . Module ) : arg_0 . _warn_if_deprecated ( arg_1 , arg_3 . name , { arg_1 . attrname } , report_on_modules = False ) except astroid . InferenceError : return

def Func(arg_0, arg_1):
        """Look for removed attributes"""
        if arg_1.attrname == "xreadlines":
            arg_0.add_message("xreadlines-attribute", arg_1=arg_1)
            return

        arg_2 = "message"
        try:
            for arg_3 in arg_1.expr.infer():
                if isinstance(arg_3, astroid.Instance) and utils.inherit_from_std_ex(
                    arg_3
                ):
                    if arg_1.attrname == arg_2:

                        # Exceptions with .message clearly defined are an exception
                        if arg_2 in arg_3.instance_attrs:
                            continue
                        arg_0.add_message("exception-message-attribute", arg_1=arg_1)
                if isinstance(arg_3, astroid.Module):
                    arg_0._warn_if_deprecated(
                        arg_1, arg_3.name, {arg_1.attrname}, report_on_modules=False
                    )
        except astroid.InferenceError:
            return


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func low-pressure liquid molar volume at tempearture
        `T` with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and a low pressure, [m^3/mol]
        '''
        if arg_2 == RACKETT:
            arg_3 = Rackett(arg_1, arg_0.Tc, arg_0.Pc, arg_0.Zc)
        elif arg_2 == YAMADA_GUNN:
            arg_3 = Yamada_Gunn(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == BHIRUD_NORMAL:
            arg_3 = Bhirud_normal(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == TOWNSEND_HALES:
            arg_3 = Townsend_Hales(arg_1, arg_0.Tc, arg_0.Vc, arg_0.omega)
        elif arg_2 == HTCOSTALD:
            arg_3 = COSTALD(arg_1, arg_0.Tc, arg_0.Vc, arg_0.omega)
        elif arg_2 == YEN_WOODS_SAT:
            arg_3 = Yen_Woods_saturation(arg_1, arg_0.Tc, arg_0.Vc, arg_0.Zc)
        elif arg_2 == MMSNM0:
            arg_3 = SNM0(arg_1, arg_0.Tc, arg_0.Vc, arg_0.omega)
        elif arg_2 == MMSNM0FIT:
            arg_3 = SNM0(arg_1, arg_0.Tc, arg_0.Vc, arg_0.omega, arg_0.SNM0_delta_SRK)
        elif arg_2 == CAMPBELL_THODOS:
            arg_3 = Campbell_Thodos(arg_1, arg_0.Tb, arg_0.Tc, arg_0.Pc, arg_0.MW, arg_0.dipole)
        elif arg_2 == HTCOSTALDFIT:
            arg_3 = COSTALD(arg_1, arg_0.Tc, arg_0.COSTALD_Vchar, arg_0.COSTALD_omega_SRK)
        elif arg_2 == RACKETTFIT:
            arg_3 = Rackett(arg_1, arg_0.Tc, arg_0.Pc, arg_0.RACKETT_Z_RA)
        elif arg_2 == PERRYDIPPR:
            arg_4, arg_5, arg_6, arg_7 = arg_0.DIPPR_coeffs
            arg_3 = 1./EQ105(arg_1, arg_4, arg_5, arg_6, arg_7)
        elif arg_2 == CRC_INORG_L:
            arg_8 = CRC_inorganic(arg_1, arg_0.CRC_INORG_L_rho, arg_0.CRC_INORG_L_k, arg_0.CRC_INORG_L_Tm)
            arg_3 = rho_to_Vm(arg_8, arg_0.CRC_INORG_L_MW)
        elif arg_2 == VDI_PPDS:
            arg_4, arg_5, arg_6, arg_7 = arg_0.VDI_PPDS_coeffs
            arg_9 = 1. - arg_1/arg_0.VDI_PPDS_Tc
            arg_8 = arg_0.VDI_PPDS_rhoc + arg_4*arg_9**0.35 + arg_5*arg_9**(2/3.) + arg_6*arg_9 + arg_7*arg_9**(4/3.)
            arg_3 = rho_to_Vm(arg_8, arg_0.VDI_PPDS_MW)
        elif arg_2 == CRC_INORG_L_CONST:
            arg_3 = arg_0.CRC_INORG_L_CONST_Vm
        elif arg_2 == COOLPROP:
            arg_3 = 1./CoolProp_T_dependent_property(arg_1, arg_0.CASRN, 'DMOLAR', 'l')
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3

r'''Method to calculate low-pressure liquid molar volume at tempearture
        `T` with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and a low pressure, [m^3/mol]

r Method to calculate low - pressure liquid molar volume at tempearture T with a given method .


(file_struct, boundaries_id, labels_id, config,
                   annotator_id=0)

def Func(arg_0, arg_1, arg_2, arg_3,
                   arg_4=0):
    """Runs the algorithms with the specified identifiers on the audio_file.

    Parameters
    ----------
    file_struct: `msaf.io.FileStruct`
        Object with the file paths.
    boundaries_id: str
        Identifier of the boundaries algorithm to use ("gt" for ground truth).
    labels_id: str
        Identifier of the labels algorithm to use (None for not labeling).
    config: dict
        Dictionary containing the custom parameters of the algorithms to use.
    annotator_id: int
        Annotator identificator in the ground truth.

    Returns
    -------
    est_times: np.array or list
        List of estimated times for the segment boundaries.
        If `list`, it will be a list of np.arrays, sorted by segmentation
        layer.
    est_labels: np.array or list
        List of all the labels associated segments.
        If `list`, it will be a list of np.arrays, sorted by segmentation
        layer.
    """
    # Check that there are enough audio frames
    if arg_3["features"].features.shape[0] <= msaf.config.minimum_frames:
        logging.warning("Audio file too short, or too many few beats "
                        "estimated. Returning empty estimations.")
        return np.asarray([0, arg_3["features"].dur]), \
            np.asarray([0], dtype=int)

    # Get the corresponding modules
    arg_5 = get_boundaries_module(arg_1)
    arg_6 = get_labels_module(arg_2)

    # Get the correct frame times
    arg_7 = arg_3["features"].frame_times

    # Segment audio based on type of segmentation
    arg_8 = run_hierarchical if arg_3["hier"] else run_flat
    arg_9, arg_10 = arg_8(arg_0, arg_5, arg_6,
                                    arg_7, arg_3, arg_4)

    return arg_9, arg_10

Runs the algorithms with the specified identifiers on the audio_file .


def Func(arg_0):
    """
    Prime FFTW with knowledge of which FFTs are best on this machine by
    loading 'wisdom' from the file ``wisdomfile``
    """
    if arg_0 is None:
        return

    try:
        pyfftw.import_wisdom(pickle.load(open(arg_0, 'rb')))
    except (IOError, TypeError) as e:
        log.warn("No wisdom present, generating some at %r" % arg_0)
        save_wisdom(arg_0)

Prime FFTW with knowledge of which FFTs are best on this machine by loading wisdom from the file wisdomfile


def
Func
(
arg_0
=
'idle'
)
:
if
config
(
)
[
'agent'
]
[
'backup_mode'
]
:
return
arg_1
=
[
(
'address'
,
config
(
)
[
'ui'
]
[
'url'
]
)
,
(
'state'
,
arg_0
)
]
arg_2
=
urlquote
(
config
(
)
[
'agent'
]
[
'name'
]
.
encode
(
'utf-8'
)
,
safe
=
''
)
arg_3
=
'%s/agents/%s'
%
(
config
(
)
[
'service-capture.admin'
]
[
0
]
,
arg_2
)
try
:
arg_4
=
http_request
(
arg_3
,
arg_1
)
.
decode
(
'utf-8'
)
if
arg_4
:
logger
.
info
(
arg_4
)
except
pycurl
.
error
as
e
:
logger
.
warning
(
'Could not set agent state to %s: %s'
%
(
arg_0
,
e
)
)

def Func(arg_0='idle'):
    '''Register this capture agent at the Matterhorn admin server so that it
    shows up in the admin interface.

    :param address: Address of the capture agent web ui
    :param status: Current status of the capture agent
    '''
    # If this is a backup CA we don't tell the Matterhorn core that we are
    # here.  We will just run silently in the background:
    if config()['agent']['backup_mode']:
        return
    arg_1 = [('address', config()['ui']['url']), ('state', arg_0)]
    arg_2 = urlquote(config()['agent']['name'].encode('utf-8'), safe='')
    arg_3 = '%s/agents/%s' % (config()['service-capture.admin'][0], arg_2)
    try:
        arg_4 = http_request(arg_3, arg_1).decode('utf-8')
        if arg_4:
            logger.info(arg_4)
    except pycurl.error as e:
        logger.warning('Could not set agent state to %s: %s' % (arg_0, e))

Register this capture agent at the Matterhorn admin server so that it shows up in the admin interface .


(idx, value, number, padding, axes=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : if arg_4 is None : arg_4 = range ( len ( arg_2 ) ) arg_5 = len ( arg_2 ) * [ False , ] for arg_6 in range ( len ( arg_5 ) ) : if arg_6 in arg_4 and arg_3 [ arg_6 ] != 0 : arg_5 [ arg_6 ] = True arg_7 = [ 0 if ( arg_6 == 0 or not m ) else p for ( arg_6 , m , p ) in zip ( arg_0 , arg_5 , arg_3 ) ] arg_8 = [ None if ( arg_6 == n - 1 or not m ) else - p for ( arg_6 , m , p , n ) in zip ( arg_0 , arg_5 , arg_3 , arg_2 ) ] arg_9 = [ slice ( i1 , i2 ) for ( i1 , i2 ) in zip ( arg_7 , arg_8 ) ] return arg_1 [ arg_9 ]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Remove the padding from chunks.

        Given a chunk and its corresponding index, use the plan and padding to remove any
        padding from the chunk along with specified axes.

        Parameters
        ----------
        idx: tuple or array-like
            The chunk index, indicating which chunk this is.

        value: ndarray
            The chunk that goes along with the index.

        number: ndarray or array-like
            The number of chunks along each dimension.

        padding: ndarray or array-like
            The padding scheme.

        axes: tuple, optional, default = None
            The axes (in the values) along which to remove padding.
        """
        if arg_4 is None:
            arg_4 = range(len(arg_2))
        arg_5 = len(arg_2)*[False, ]
        for arg_6 in range(len(arg_5)):
            if arg_6 in arg_4 and arg_3[arg_6] != 0:
                arg_5[arg_6] = True

        arg_7 = [0 if (arg_6 == 0 or not m) else p for (arg_6, m, p) in zip(arg_0, arg_5, arg_3)]
        arg_8 = [None if (arg_6 == n-1 or not m) else -p for (arg_6, m, p, n) in zip(arg_0, arg_5, arg_3, arg_2)]
        arg_9 = [slice(i1, i2) for (i1, i2) in zip(arg_7, arg_8)]

        return arg_1[arg_9]


To support weak referencing, removes cache key from the cache value.

return _Mapping(
        x=None if field == "x" else self.x,
        y=None if field == "y" else self.y,
        ildj=self.ildj,
        kwargs=self.kwargs)

def Func ( arg_0 , arg_1 ) : return _Mapping ( x = None if arg_1 == "x" else arg_0 . x , y = None if arg_1 == "y" else arg_0 . y , ildj = arg_0 . ildj , kwargs = arg_0 . kwargs )

def Func(arg_0, arg_1):
    """To support weak referencing, Funcs cache key from the cache value."""
    return _Mapping(
        x=None if arg_1 == "x" else arg_0.x,
        y=None if arg_1 == "y" else arg_0.y,
        ildj=arg_0.ildj,
        kwargs=arg_0.kwargs)

To support weak referencing removes cache key from the cache value .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
list
(
arg_0
.
graph
.
triples
(
(
arg_1
,
arg_0
.
spdx_namespace
[
'licenseName'
]
,
)
)
)
if
len
(
arg_2
)
>
1
:
arg_0
.
more_than_one_error
(
'extracted license name'
)
return
elif
len
(
arg_2
)
==
0
:
return
return
arg_0
.
to_special_value
(
arg_2
[
0
]
[
2
]
)

def Func(arg_0, arg_1):
        """
        Return the license name from an ExtractedLicense or None
        """
        arg_2 = list(arg_0.graph.triples((arg_1, arg_0.spdx_namespace['licenseName'], None)))
        if len(arg_2) > 1:
            arg_0.more_than_one_error('extracted license name')
            return
        elif len(arg_2) == 0:
            return
        return arg_0.to_special_value(arg_2[0][2])


(lcbasedir,
                                     objectid,
                                     aperture='TF1',
                                     postfix='.gz',
                                     sortby='rjd',
                                     normalize=True,
                                     recursive=True)

def Func(arg_0,
                                     arg_1,
                                     arg_2='TF1',
                                     arg_3='.gz',
                                     arg_4='rjd',
                                     arg_5=True,
                                     arg_6=True):
    '''This concatenates all text LCs for an objectid with the given aperture.

    Does not care about overlaps or duplicates. The light curves must all be
    from the same aperture.

    The intended use is to concatenate light curves across CCDs or instrument
    changes for a single object. These can then be normalized later using
    standard astrobase tools to search for variablity and/or periodicity.

    lcbasedir is the directory to start searching in.

    objectid is the object to search for.

    aperture is the aperture postfix to use: (TF1 = aperture 1,
                                              TF2 = aperture 2,
                                              TF3 = aperture 3)

    sortby is a column to sort the final concatenated light curve by in
    ascending order.

    If normalize is True, then each light curve's magnitude columns are
    normalized to zero, and the whole light curve is then normalized to the
    global median magnitude for each magnitude column.

    If recursive is True, then the function will search recursively in lcbasedir
    for any light curves matching the specified criteria. This may take a while,
    especially on network filesystems.

    The returned lcdict has an extra column: 'lcn' that tracks which measurement
    belongs to which input light curve. This can be used with
    lcdict['concatenated'] which relates input light curve index to input light
    curve filepath. Finally, there is an 'nconcatenated' key in the lcdict that
    contains the total number of concatenated light curves.

    '''
    LOGINFO('looking for light curves for %s, aperture %s in directory: %s'
            % (arg_1, arg_2, arg_0))

    if arg_6 is False:

        arg_7 = glob.glob(os.path.join(arg_0,
                                          '*%s*%s*%s' % (arg_1,
                                                         arg_2,
                                                         arg_3)))
    else:
        # use recursive glob for Python 3.5+
        if sys.version_info[:2] > (3,4):

            arg_7 = glob.glob(os.path.join(arg_0,
                                              '**',
                                              '*%s*%s*%s' % (arg_1,
                                                             arg_2,
                                                             arg_3)),
                                 arg_6=True)
            LOGINFO('found %s files: %s' % (len(arg_7), repr(arg_7)))

        # otherwise, use os.walk and glob
        else:

            # use os.walk to go through the directories
            arg_8 = os.walk(arg_0)
            arg_7 = []

            for arg_9, arg_10, arg_11 in arg_8:
                for arg_12 in arg_10:
                    arg_13 = os.path.join(arg_9,
                                              arg_12,
                                              '*%s*%s*%s' % (arg_1,
                                                             arg_2,
                                                             arg_3))
                    arg_14 = glob.glob(arg_13)

                    if arg_14:
                        arg_7.extend(arg_14)
                        LOGINFO(
                            'found %s in dir: %s' % (repr(arg_14),
                                                     os.path.join(arg_9,arg_12))
                        )

    # now that we have all the files, concatenate them
    # a single file will be returned as normalized
    if arg_7 and len(arg_7) > 0:
        arg_15 = concatenate_textlcs(arg_7,
                                      arg_4=arg_4,
                                      arg_5=arg_5)
        return arg_15
    else:
        LOGERROR('did not find any light curves for %s and aperture %s' %
                 (arg_1, arg_2))
        return None

This concatenates all text LCs for an objectid with the given aperture .


def Func ( arg_0 , arg_1 ) : ( arg_2 , arg_3 , arg_4 , arg_5 ) = arg_0 . _decompose_pattern ( arg_1 ) arg_6 = glob . glob ( arg_2 ) arg_7 = [ ] for arg_8 in arg_6 : if arg_4 == [ ] : arg_7 . append ( ( arg_8 , { } ) ) continue arg_9 = re . match ( arg_3 , arg_8 ) if arg_9 is None : continue arg_10 = arg_9 . groupdict ( ) . items ( ) arg_11 = dict ( ( k , arg_5 . get ( k , str ) ( v ) ) for ( k , v ) in arg_10 ) arg_7 . append ( ( arg_8 , arg_11 ) ) return arg_7

def Func(arg_0, arg_1):
        """
        From the pattern decomposition, finds the absolute paths
        matching the pattern.
        """
        (arg_2, arg_3, arg_4, arg_5) = arg_0._decompose_pattern(arg_1)
        arg_6 = glob.glob(arg_2)
        arg_7 = []

        for arg_8 in arg_6:
            if arg_4 == []:
                arg_7.append((arg_8, {}))
                continue
            arg_9 = re.match(arg_3, arg_8)
            if arg_9 is None: continue
            arg_10 = arg_9.groupdict().items()
            arg_11 = dict((k,arg_5.get(k, str)(v)) for (k,v) in arg_10)
            arg_7.append((arg_8, arg_11))

        return arg_7

From the pattern decomposition finds the absolute paths matching the pattern .


(state, callstr, argstr=None, expand_msg=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """When checking a function definition of lambda function,
    prepare has_equal_x for checking the call of a user-defined function.

    Args:
        callstr (str): call string that specifies how the function should be called, e.g. `f(1, a = 2)`.
           ``Func()`` will replace ``f`` with the function/lambda you're targeting.
        argstr (str): If specified, this overrides the way the function call is refered to in the expand message.
        expand_msg (str): If specified, this overrides any messages that are prepended by previous SCT chains.
        state (State): state object that is chained from.

    :Example:

        Student and solution code::

            def my_power(x):
                print("calculating sqrt...")
                return(x * x)

        SCT::

            Ex().check_function_def('my_power').multi(
                Func("f(3)").has_equal_value()
                Func("f(3)").has_equal_output()
            )
    """

    arg_0.assert_is(
        ["function_defs", "lambda_functions"],
        "Func",
        ["check_function_def", "check_lambda_function"],
    )

    if arg_3 is None:
        arg_3 = "To verify it, we reran {{argstr}}. "

    arg_4, arg_5 = build_call(arg_1, arg_0.student_parts["node"])
    arg_6, arg_7 = build_call(arg_1, arg_0.solution_parts["node"])

    arg_8 = {"msg": arg_3, "kwargs": {"argstr": arg_2 or arg_5}}
    arg_9 = part_to_child(arg_4, arg_6, arg_8, arg_0)

    return arg_9

When checking a function definition of lambda function,
    prepare has_equal_x for checking the call of a user-defined function.

    Args:
        callstr (str): call string that specifies how the function should be called, e.g. `f(1, a = 2)`.
           ``check_call()`` will replace ``f`` with the function/lambda you're targeting.
        argstr (str): If specified, this overrides the way the function call is refered to in the expand message.
        expand_msg (str): If specified, this overrides any messages that are prepended by previous SCT chains.
        state (State): state object that is chained from.

    :Example:

        Student and solution code::

            def my_power(x):
                print("calculating sqrt...")
                return(x * x)

        SCT::

            Ex().check_function_def('my_power').multi(
                check_call("f(3)").has_equal_value()
                check_call("f(3)").has_equal_output()
            )

When checking a function definition of lambda function prepare has_equal_x for checking the call of a user - defined function .


def
Func
(
arg_0
)
:
def
grad
(
arg_1
)
:
return
array_ops
.
prevent_gradient
(
arg_1
,
message
=
"Second derivative is not implemented."
)
return
tf
.
identity
(
arg_0
)
,
grad

def Func(arg_0):
  """Disables computation of the second derivatives for a tensor.

  NB: you need to apply a non-identity function to the output tensor for the
  exception to be raised.

  Arguments:
    x: A tensor.

  Returns:
    A tensor with the same value and the same derivative as x, but that raises
    LookupError when trying to compute the second derivatives.
  """
  def grad(arg_1):
    return array_ops.prevent_gradient(
        arg_1, message="Second derivative is not implemented.")

  return tf.identity(arg_0), grad

Disables computation of the second derivatives for a tensor .


def Func(arg_0, arg_1):
        """Learn empirical variances from X.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape (n_samples, n_features)
            Sample vectors from which to compute variances.

        y : any
            Ignored. This parameter exists only for compatibility with
            sklearn.pipeline.Pipeline.

        Returns
        -------
        self
        """

        arg_2 = arg_1[:, 'X'] if isinstance(arg_1, DictRDD) else arg_1
        check_rdd(arg_2, (np.ndarray, sp.spmatrix))

        def mapper(arg_2):
            """Calculate statistics for every numpy or scipy blocks."""
            arg_2 = check_array(arg_2, ('csr', 'csc'), dtype=np.float64)
            if hasattr(arg_2, "toarray"):   # sparse matrix
                arg_3, arg_4 = mean_variance_axis(arg_2, axis=0)
            else:
                arg_3, arg_4 = np.mean(arg_2, axis=0), np.var(arg_2, axis=0)
            return arg_2.shape[0], arg_3, arg_4

        def reducer(arg_5, arg_6):
            """Calculate the combined statistics."""
            arg_7, arg_8, arg_9 = arg_5
            arg_10, arg_11, arg_12 = arg_6
            arg_13 = arg_7 + arg_10
            arg_14 = ((arg_8 * arg_7) + (arg_11 * arg_10)) / arg_13
            arg_15 = (((arg_7 * arg_9) + (arg_10 * arg_12)) / arg_13) + \
                     ((arg_7 * arg_10) * ((arg_11 - arg_8) / arg_13) ** 2)
            return (arg_13, arg_14, arg_15)

        arg_16, arg_16, arg_0.variances_ = arg_2.map(mapper).treeReduce(reducer)

        if np.all(arg_0.variances_ <= arg_0.threshold):
            arg_18 = "No feature in X meets the variance threshold {0:.5f}"
            if arg_2.shape[0] == 1:
                arg_18 += " (X contains only one sample)"
            raise ValueError(arg_18.format(arg_0.threshold))

        return arg_0


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_year_doc ( '{}_games' . format ( arg_1 ) ) arg_3 = arg_2 ( 'table#games' ) arg_4 = sportsref . utils . parse_table ( arg_3 ) return arg_4

def Func(arg_0, arg_1):
        """Gets Func information for a team-season.

        :year: The year for which we want the Func.
        :returns: DataFrame of Func information.
        """
        arg_2 = arg_0.get_year_doc('{}_games'.format(arg_1))
        arg_3 = arg_2('table#games')
        arg_4 = sportsref.utils.parse_table(arg_3)
        return arg_4

Gets schedule information for a team-season.

        :year: The year for which we want the schedule.
        :returns: DataFrame of schedule information.

Gets schedule information for a team - season .


def Func ( arg_0 , arg_1 ) : arg_2 = { float_types : lambda x : '{:.{}g}' . Func ( x , arg_1 . digits ) , } for arg_3 , arg_4 in arg_2 . items ( ) : if isinstance ( arg_0 , arg_3 ) : return arg_4 ( arg_0 ) try : if six . PY2 and isinstance ( arg_0 , six . string_types ) : return str ( arg_0 . encode ( 'utf-8' ) ) return str ( arg_0 ) except : return 'OBJECT'

def Func(arg_0, arg_1):
    """Return a string representation of the Python object

    Args:
        obj: The Python object
        options: Format options
    """
    arg_2 = {
        float_types: lambda x: '{:.{}g}'.Func(x, arg_1.digits),
    }
    for arg_3, arg_4 in arg_2.items():
        if isinstance(arg_0, arg_3):
            return arg_4(arg_0)
    try:
        if six.PY2 and isinstance(arg_0, six.string_types):
            return str(arg_0.encode('utf-8'))
        return str(arg_0)
    except:
        return 'OBJECT'


def Func(arg_0, arg_1=None, arg_2=None):
    """
    Plots output of compute_sector_exposures as area charts

    Parameters
    ----------
    gross_exposures : arrays
        Arrays of gross sector exposures (output of compute_sector_exposures).

    sector_dict : dict or OrderedDict
        Dictionary of all sectors
        - See full description in compute_sector_exposures
    """

    if arg_2 is None:
        arg_2 = plt.gca()

    if arg_1 is None:
        arg_3 = SECTORS.values()
    else:
        arg_3 = arg_1.values()

    arg_4 = plt.cm.gist_rainbow(np.linspace(0, 1, 11))

    arg_2.stackplot(arg_0[0].index, arg_0,
                 labels=arg_3, colors=arg_4, alpha=0.8,
                 baseline='zero')
    arg_2.axhline(0, color='k', linestyle='-')
    arg_2.set(title='Gross exposure to sectors',
           ylabel='Proportion of gross exposure \n in sectors')

    return arg_2


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

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(KeyWrappingData, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.WRAPPING_METHOD, arg_6):
            arg_0._wrapping_method = primitives.Enumeration(
                enum=arg_3.WrappingMethod,
                tag=arg_3.Tags.WRAPPING_METHOD
            )
            arg_0._wrapping_method.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Invalid struct missing the wrapping method attribute."
            )

        if arg_0.is_tag_next(
                arg_3.Tags.ENCRYPTION_KEY_INFORMATION,
                arg_6
        ):
            arg_0._encryption_key_information = EncryptionKeyInformation()
            arg_0._encryption_key_information.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0.is_tag_next(
                arg_3.Tags.MAC_SIGNATURE_KEY_INFORMATION,
                arg_6
        ):
            arg_0._mac_signature_key_information = MACSignatureKeyInformation()
            arg_0._mac_signature_key_information.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.MAC_SIGNATURE, arg_6):
            arg_0._mac_signature = primitives.ByteString(
                tag=arg_3.Tags.MAC_SIGNATURE
            )
            arg_0._mac_signature.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.IV_COUNTER_NONCE, arg_6):
            arg_0._iv_counter_nonce = primitives.ByteString(
                tag=arg_3.Tags.IV_COUNTER_NONCE
            )
            arg_0._iv_counter_nonce.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.ENCODING_OPTION, arg_6):
            arg_0._encoding_option = primitives.Enumeration(
                enum=arg_3.EncodingOption,
                tag=arg_3.Tags.ENCODING_OPTION
            )
            arg_0._encoding_option.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the KeyWrappingData struct and decode it into
        its constituent parts.

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

Read the data encoding the KeyWrappingData struct and decode it into its constituent parts .


def Func(arg_0):
        """
        Generates a rsync of all deployable code.
        """

        assert arg_0.genv.SITE, 'Site unspecified.'
        assert arg_0.genv.ROLE, 'Role unspecified.'

        arg_1 = arg_0.local_renderer

        if arg_0.env.exclusions:
            arg_1.env.exclusions_str = ' '.join(
                "--exclude='%s'" % _ for _ in arg_0.env.exclusions)

        arg_1.local(arg_1.env.rsync_command)
        arg_1.sudo('chown -R {rsync_chown_user}:{rsync_chown_group} {rsync_dst_dir}')

Generates a rsync of all deployable code .


def Func(arg_0, **arg_1):
        """Draws the network, highlighting active queues.

        The colored vertices represent vertices that have at least one
        queue on an in-edge that is active. Dark edges represent
        queues that are active, light edges represent queues that are
        inactive.

        Parameters
        ----------
        **kwargs
            Any additional parameters to pass to :meth:`.draw`, and
            :meth:`.QueueNetworkDiGraph.draw_graph`.

        Notes
        -----
        Active queues are :class:`QueueServers<.QueueServer>` that
        accept arrivals from outside the network. The colors are
        defined by the class attribute ``colors``. The relevant keys
        are ``vertex_active``, ``vertex_inactive``, ``edge_active``,
        and ``edge_inactive``.
        """
        arg_2 = arg_0.g
        for arg_3 in arg_2.nodes():
            arg_0.g.set_vp(arg_3, 'vertex_color', [0, 0, 0, 0.9])
            arg_4 = False
            arg_5 = arg_2.in_edges(arg_3) if arg_2.is_directed() else arg_2.out_edges(arg_3)
            for arg_6 in arg_5:
                arg_7 = arg_2.edge_index[arg_6]
                if arg_0.edge2queue[arg_7]._active:
                    arg_4 = True
                    break
            if arg_4:
                arg_0.g.set_vp(arg_3, 'vertex_fill_color', arg_0.colors['vertex_active'])
            else:
                arg_0.g.set_vp(arg_3, 'vertex_fill_color', arg_0.colors['vertex_inactive'])

        for arg_6 in arg_2.edges():
            arg_7 = arg_2.edge_index[arg_6]
            if arg_0.edge2queue[arg_7]._active:
                arg_0.g.set_ep(arg_6, 'edge_color', arg_0.colors['edge_active'])
            else:
                arg_0.g.set_ep(arg_6, 'edge_color', arg_0.colors['edge_inactive'])

        arg_0.draw(update_colors=False, **arg_1)
        arg_0._update_all_colors()

Draws the network highlighting active queues .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : if arg_4 <= 0 : return [ ] arg_6 = numpy . where ( arg_5 == 1 ) if len ( arg_6 [ 0 ] ) == 0 : return [ ] if arg_3 is None : arg_7 = [ syn for syn in zip ( arg_6 [ 0 ] , arg_6 [ 1 ] ) ] else : arg_8 = set ( ( syn [ 0 ] , syn [ 1 ] ) for syn in arg_3 . syns ) arg_7 = [ syn for syn in zip ( arg_6 [ 0 ] , arg_6 [ 1 ] ) if ( syn [ 0 ] , syn [ 1 ] ) not in arg_8 ] if len ( arg_7 ) <= arg_4 : return arg_7 if arg_4 == 1 : arg_9 = arg_0 . _random . getUInt32 ( len ( arg_7 ) ) return [ arg_7 [ arg_9 ] ] arg_10 = numpy . array ( [ arg_12 for arg_12 in range ( len ( arg_7 ) ) ] , dtype = 'uint32' ) arg_11 = numpy . zeros ( min ( arg_4 , len ( arg_10 ) ) , dtype = 'uint32' ) arg_0 . _random . sample ( arg_10 , arg_11 ) return sorted ( [ arg_7 [ arg_12 ] for arg_12 in arg_11 ] )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """
    Choose n random cells to learn from.

    This function is called several times while learning with timeStep = t-1, so
    we cache the set of candidates for that case. It's also called once with
    timeStep = t, and we cache that set of candidates.

    :returns: tuple (column index, cell index).
    """
    if arg_4 <= 0:
      return []

    arg_6 = numpy.where(arg_5 == 1)

    # Candidates can be empty at this point, in which case we return
    # an empty segment list. adaptSegments will do nothing when getting
    # that list.
    if len(arg_6[0]) == 0:
      return []

    if arg_3 is None: # new segment
      arg_7 = [syn for syn in zip(arg_6[0], arg_6[1])]
    else:
      # We exclude any synapse that is already in this segment.
      arg_8 = set((syn[0], syn[1]) for syn in arg_3.syns)
      arg_7 = [syn for syn in zip(arg_6[0], arg_6[1])
               if (syn[0], syn[1]) not in arg_8]

    # If we have no more candidates than requested, return all of them,
    # no shuffle necessary.
    if len(arg_7) <= arg_4:
      return arg_7

    if arg_4 == 1: # so that we don't shuffle if only one is needed
      arg_9 = arg_0._random.getUInt32(len(arg_7))
      return [arg_7[arg_9]]  # col and cell idx in col

    # If we need more than one candidate
    arg_10 = numpy.array([arg_12 for arg_12 in range(len(arg_7))], dtype='uint32')
    arg_11 = numpy.zeros(min(arg_4, len(arg_10)), dtype='uint32')
    arg_0._random.sample(arg_10, arg_11)
    return sorted([arg_7[arg_12] for arg_12 in arg_11])


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 not in arg_2 : arg_3 = arg_0 [ 'properties' ] [ arg_1 ] if 'default' in arg_3 : arg_2 [ arg_1 ] = arg_3 [ 'default' ] else : arg_2 [ arg_1 ] = None

def Func(arg_0, arg_1, arg_2):
  """Checks to see if property is specified in 'options'. If not, reads the
  default value from the schema"""

  if arg_1 not in arg_2:
    arg_3 = arg_0['properties'][arg_1]
    if 'default' in arg_3:
      arg_2[arg_1] = arg_3['default']
    else:
      arg_2[arg_1] = None

Checks to see if property is specified in options . If not reads the default value from the schema


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 : arg_0 . sigs [ arg_1 ] . print_method = arg_0 . dbgr . intf [ - 1 ] . msg else : arg_0 . sigs [ arg_1 ] . print_method = None pass return arg_2

def Func(arg_0, arg_1, arg_2):
        """Set whether we print or not when this signal is caught."""
        if arg_2:
            arg_0.sigs[arg_1].print_method = arg_0.dbgr.intf[-1].msg
        else:
            arg_0.sigs[arg_1].print_method = None
            pass
        return arg_2

Set whether we print or not when this signal is caught .


def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_3 = model_to_dict ( arg_0 , arg_1 = arg_1 ) arg_3 [ "version" ] = YAML_SPEC return yaml . dump ( arg_3 , ** arg_2 )

def Func(arg_0, arg_1=False, **arg_2):
    """
    Return the model as a YAML document.

    ``kwargs`` are passed on to ``yaml.dump``.

    Parameters
    ----------
    model : cobra.Model
        The cobra model to represent.
    sort : bool, optional
        Whether to sort the metabolites, reactions, and genes or maintain the
        order defined in the model.

    Returns
    -------
    str
        String representation of the cobra model as a YAML document.

    See Also
    --------
    save_yaml_model : Write directly to a file.
    ruamel.yaml.dump : Base function.
    """

    arg_3 = model_to_dict(arg_0, arg_1=arg_1)
    arg_3["version"] = YAML_SPEC
    return yaml.dump(arg_3, **arg_2)


(self, kind, resource, url_components, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, **arg_4):
        """
        Send a request to the REST API

        Parameters
        ----------
        kind: str, {get, delete, put, post, head}
        resource: str
        url_components: list or tuple to be appended to the request URL

        Notes
        -----
        kwargs contain request parameters to be sent as request data
        """
        arg_5 = arg_0.format_request_url(arg_2, *arg_3)
        arg_6 = getattr(requests, arg_1)
        arg_7 = arg_0.get_request_headers()
        arg_8 = arg_0.format_parameters(**arg_4)
        arg_9 = arg_6(arg_5, arg_7=arg_7, arg_10=arg_8)
        arg_10 = arg_0.get_response(arg_9)
        if arg_9.status_code >= 300:
            arg_11 = arg_10.pop('message', 'API request returned error')
            raise APIError(arg_11, arg_9.status_code, **arg_10)
        return arg_10


def Func(arg_0, arg_1, arg_2):
        """ Compute the RECI fit score

        Args:
            x (numpy.ndarray): Variable 1
            y (numpy.ndarray): Variable 2

        Returns:
            float: RECI fit score

        """
        arg_1 = np.reshape(minmax_scale(arg_1), (-1, 1))
        arg_2 = np.reshape(minmax_scale(arg_2), (-1, 1))
        arg_3 = PolynomialFeatures(degree=arg_0.degree)
        arg_4 = arg_3.fit_transform(arg_1)

        arg_4[:,1] = 0
        arg_4[:,2] = 0

        arg_5 = LinearRegression()
        arg_5.fit(arg_4, arg_2)

        arg_6 = arg_5.predict(arg_4)
        arg_7 = mean_squared_error(arg_6, arg_2)

        return arg_7


def Func ( arg_0 ) : arg_1 = arg_0 . _control . textCursor ( ) arg_1 . setPosition ( arg_0 . _prompt_pos ) return arg_1

def Func(arg_0):
        """ Convenience method that returns a cursor for the prompt position.
        """
        arg_1 = arg_0._control.textCursor()
        arg_1.setPosition(arg_0._prompt_pos)
        return arg_1

Convenience method that returns a cursor for the prompt position .


def Func ( arg_0 ) : arg_1 = ET . fromstring ( arg_0 ) arg_2 = { } for arg_3 , arg_4 in enumerate ( arg_1 . findall ( "*/Body/Name" ) ) : arg_2 [ arg_4 . text . strip ( ) ] = arg_3 return arg_2

def Func(arg_0):
    """ Extract a name to index dictionary from 6dof settings xml """
    arg_1 = ET.fromstring(arg_0)

    arg_2 = {}
    for arg_3, arg_4 in enumerate(arg_1.findall("*/Body/Name")):
        arg_2[arg_4.text.strip()] = arg_3

    return arg_2


def Func ( arg_0 ) : try : arg_1 = open ( arg_0 ) except IOError : return [ ] else : arg_2 = arg_1 . readlines ( ) arg_1 . close ( ) return arg_2

def Func(arg_0):
    """Return the contents of a named file as a list of lines.

    This function never raises an IOError exception: if the file can't be
    read, it simply returns an empty list."""

    try:
        arg_1 = open(arg_0)
    except IOError:
        return []
    else:
        arg_2 = arg_1.readlines()
        arg_1.close()
        return arg_2

Return the contents of a named file as a list of lines .


def Func(arg_0):
    """Adds all parameters to `traj`"""
    print('Adding Parameters')

    arg_0.f_add_parameter('neuron.V_init', 0.0,
                         comment='The initial condition for the '
                                    'membrane potential')
    arg_0.f_add_parameter('neuron.I', 0.0,
                         comment='The externally applied current.')
    arg_0.f_add_parameter('neuron.tau_V', 10.0,
                         comment='The membrane time constant in milliseconds')
    arg_0.f_add_parameter('neuron.tau_ref', 5.0,
                        comment='The refractory period in milliseconds '
                                'where the membrane potnetial '
                                'is clamped.')

    arg_0.f_add_parameter('simulation.duration', 1000.0,
                         comment='The duration of the experiment in '
                                'milliseconds.')
    arg_0.f_add_parameter('simulation.dt', 0.1,
                         comment='The step size of an Euler integration step.')


stream is a get that will stream to file_name. Since this is a worker
       task, it differs from the client provided version in that it requires
       headers.

(url, headers, stream_to=None, retry=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
    '''Func is a get that will Func to file_name. Since this is a worker
       task, it differs from the client provided version in that it requires
       headers.
    '''
    bot.debug("GET %s" % arg_0)

    if DISABLE_SSL_CHECK is True:
        bot.warning('Verify of certificates disabled! ::TESTING USE ONLY::')

    # Ensure headers are present, update if not
    arg_4 = requests.get(arg_0,
                            arg_1=arg_1,
                            verify=not DISABLE_SSL_CHECK,
                            Func=True)

    # If we get permissions error, one more try with updated token
    if arg_4.status_code in [401, 403]:
        arg_1 = update_token(arg_1)
        return Func(arg_0, arg_1, arg_2, arg_3=False)

    # Successful Response
    elif arg_4.status_code == 200:

        # Keep user updated with Progress Bar
        arg_5 = None
        if 'Content-Length' in arg_4.headers:
            arg_6 = 0
            arg_5 = int(arg_4.headers['Content-Length'])
            bot.show_progress(arg_6,arg_5,length=35)

        arg_7 = 1 << 20
        with open(arg_2,'wb') as filey:
            for arg_8 in arg_4.iter_content(arg_7=arg_7):
                filey.write(arg_8)
                if arg_5 is not None:
                    arg_6+=arg_7
                    bot.show_progress(iteration=arg_6,
                                      total=arg_5,
                                      length=35,
                                      carriage_return=False)

        # Newline to finish download
        sys.stdout.write('\n')

        return arg_2

    bot.error("Problem with Func, response %s" %(arg_4.status_code))
    sys.exit(1)

stream is a get that will stream to file_name . Since this is a worker task it differs from the client provided version in that it requires headers .


return self._deserialize(cookie) if cookie else {}

def Func ( arg_0 ) : arg_1 = arg_0 . adapter . cookies . get ( arg_0 . name ) return arg_0 . _deserialize ( arg_1 ) if arg_1 else { }

def Func(arg_0):
        """
        Extracts the session data from cookie.
        """
        arg_1 = arg_0.adapter.cookies.get(arg_0.name)
        return arg_0._deserialize(arg_1) if arg_1 else {}


(self, num, cat=None, cat_group=None, preferred=None, preferred_ratio=0.5, max_recursion=None, auto_process=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=0.5, arg_6=None, arg_7=True):
        """Generate ``num`` rules from category ``cat``, optionally specifying
        preferred category groups ``preferred`` that should be preferred at
        probability ``preferred_ratio`` over other randomly-chosen rule definitions.

        :param int num: The number of rules to Funcerate
        :param str cat: The name of the category to Funcerate ``num`` rules from
        :param str cat_group: The category group (ie python file) to Funcerate rules from. This
            was added specifically to make it easier to Funcerate data based on the name
            of the file the grammar was defined in, and is intended to work with the
            ``TOP_CAT`` values that may be defined in a loaded grammar file.
        :param list preferred: A list of preferred category groups to Funcerate rules from
        :param float preferred_ratio: The percent probability that the preferred
            groups will be chosen over randomly choosen rule definitions from category ``cat``.
        :param int max_recursion: The maximum amount to allow references to recurse
        :param bool auto_process: Whether rules should be automatically pruned and
            shortest reference paths determined. See :any:`gramfuzz.GramFuzzer.preprocess_rules`
            for what would automatically be done.
        """
        import arg_8.fields
        arg_8.fields.REF_LEVEL = 1

        if arg_2 is None and arg_3 is None:
            raise arg_8.errors.GramFuzzError("cat and cat_group are None, one must be set")

        if arg_2 is None and arg_3 is not None:
            if arg_3 not in arg_0.cat_group_defaults:
                raise arg_8.errors.GramFuzzError(
                    "cat_group {!r} did not define a TOP_CAT variable"
                )
            arg_2 = arg_0.cat_group_defaults[arg_3]
            if not isinstance(arg_2, basestring):
                raise arg_8.errors.GramFuzzError(
                    "cat_group {!r}'s TOP_CAT variable was not a string"
                )

        if arg_7 and arg_0._rules_processed == False:
            arg_0.preprocess_rules()

        if arg_6 is not None:
            arg_0.set_max_recursion(arg_6)

        if arg_4 is None:
            arg_4 = []

        arg_11 = deque()
        arg_12 = arg_0.defs[arg_2]

        # optimizations
        arg_13 = arg_11.append
        arg_14 = arg_11.extend
        arg_15 = rand.choice
        arg_16 = rand.maybe
        arg_17 = utils.val

        arg_18 = arg_0.defs[arg_2].keys()

        arg_0._last_pref_keys = arg_0._get_pref_keys(arg_2, arg_4)
        # be sure to set this *after* fetching the pref keys (above^)
        arg_0._last_prefs = arg_4

        arg_21 = deque()
        arg_22 = 0
        while arg_22 < arg_1:
            # use a rule definition from one of the preferred category
            # groups
            if len(arg_0._last_pref_keys) > 0 and arg_16(arg_5):
                arg_23 = arg_15(arg_0._last_pref_keys)
                if arg_23 not in arg_12:
                    # TODO this means it was removed / pruned b/c it was unreachable??
                    # TODO look into this more
                    arg_23 = arg_15(list(arg_18))

            # else just choose a key at random from the category
            else:
                arg_23 = arg_15(list(arg_18))

            # pruning failed, this rule is not defined/reachable
            if arg_23 not in arg_12:
                continue

            arg_24 = arg_15(arg_12[arg_23])

            # not used directly by GramFuzzer, but could be useful
            # to subclasses of GramFuzzer
            arg_25 = {}

            arg_26 = deque()
            arg_0.pre_revert(arg_25)
            arg_27 = None

            try:
                arg_27 = arg_17(arg_24, arg_26)
            except errors.GramFuzzError as e:
                raise
                #total_errors.append(e)
                #self.revert(info)
                #continue
            except RuntimeError as e:
                print("RUNTIME ERROR")
                arg_0.revert(arg_25)
                continue

            if arg_27 is not None:
                arg_14(arg_26)
                arg_13(arg_27)

                arg_22 += 1
                arg_0.post_revert(arg_2, arg_11, arg_22, arg_1, arg_25)

        return arg_11

Generate ``num`` rules from category ``cat``, optionally specifying
        preferred category groups ``preferred`` that should be preferred at
        probability ``preferred_ratio`` over other randomly-chosen rule definitions.

        :param int num: The number of rules to generate
        :param str cat: The name of the category to generate ``num`` rules from
        :param str cat_group: The category group (ie python file) to generate rules from. This
            was added specifically to make it easier to generate data based on the name
            of the file the grammar was defined in, and is intended to work with the
            ``TOP_CAT`` values that may be defined in a loaded grammar file.
        :param list preferred: A list of preferred category groups to generate rules from
        :param float preferred_ratio: The percent probability that the preferred
            groups will be chosen over randomly choosen rule definitions from category ``cat``.
        :param int max_recursion: The maximum amount to allow references to recurse
        :param bool auto_process: Whether rules should be automatically pruned and
            shortest reference paths determined. See :any:`gramfuzz.GramFuzzer.preprocess_rules`
            for what would automatically be done.

Generate num rules from category cat optionally specifying preferred category groups preferred that should be preferred at probability preferred_ratio over other randomly - chosen rule definitions .


def Func(arg_0, arg_1=None):
        """Fetch the messages that a bot can read.

        When the `offset` is given it will retrieve all the messages
        that are greater or equal to that offset. Take into account
        that, due to how the API works, all previous messages will
        be removed from the server.

        :param offset: fetch the messages starting on this offset
        """
        arg_2 = {}

        if arg_1:
            arg_2[arg_0.OFFSET] = arg_1

        arg_4 = arg_0._call(arg_0.UPDATES_METHOD, arg_2)

        return arg_4

Fetch the messages that a bot can read .


def Func(arg_0):
        """
        Return the signature algorithm used in the certificate.

        :return: The name of the algorithm.
        :rtype: :py:class:`bytes`

        :raises ValueError: If the signature algorithm is undefined.

        .. versionadded:: 0.13
        """
        arg_1 = _lib.X509_get0_tbs_sigalg(arg_0._x509)
        arg_2 = _lib.OBJ_obj2nid(arg_1.algorithm)
        if arg_2 == _lib.NID_undef:
            raise ValueError("Undefined signature algorithm")
        return _ffi.string(_lib.OBJ_nid2ln(arg_2))

Return the signature algorithm used in the certificate .


def Func(arg_0, arg_1):
    """
    Creates the required metrics modules

    Parameters:
    -----------------------------------------------------------------------
    metricSpecs:
      A sequence of MetricSpec objects that specify which metric modules to
      instantiate
    """
    if not arg_1:
      return

    arg_0.__metricSpecs = arg_1
    for arg_3 in arg_1:
      if not InferenceElement.validate(arg_3.inferenceElement):
        raise ValueError("Invalid inference element for metric spec: %r" %arg_3)

      arg_0.__metrics.append(metrics.getModule(arg_3))
      arg_0.__metricLabels.append(arg_3.getLabel())


def Func(arg_0, arg_1):
        """Transform duration into a human-readable form."""
        arg_2 = ""
        arg_3, arg_1 = divmod(arg_1, 60)
        if arg_3 >= 60:
            arg_4, arg_3 = divmod(arg_3, 60)
            arg_2 = "%sh " % arg_4
        arg_2 += "%sm %ss" % (arg_3, arg_1)
        return arg_2

Transform duration into a human - readable form .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . fields [ 0 ] . numRecords assert ( all ( arg_3 . numRecords == arg_2 for arg_3 in arg_0 . fields ) ) for arg_4 in range ( arg_2 ) : arg_1 . append ( arg_0 . getRecord ( arg_4 ) ) return arg_1

def Func(arg_0):
    """Returns all the records"""
    arg_1=[]
    arg_2 = arg_0.fields[0].numRecords
    assert (all(arg_3.numRecords==arg_2 for arg_3 in arg_0.fields))

    for arg_4 in range(arg_2):
      arg_1.append(arg_0.getRecord(arg_4))

    return arg_1


(table,
                name=None,
                float_format=None,
                formatters=None,
                header_rows=None)

def Func(arg_0,
                arg_1=None,
                arg_2=None,
                arg_3=None,
                arg_4=None):
    """
    Pretty print a pandas DataFrame.

    Uses HTML output if running inside Jupyter Notebook, otherwise
    formatted text output.

    Parameters
    ----------
    table : pandas.Series or pandas.DataFrame
        Table to pretty-print.
    name : str, optional
        Table name to display in upper left corner.
    float_format : function, optional
        Formatter to use for displaying table elements, passed as the
        `float_format` arg to pd.Dataframe.to_html.
        E.g. `'{0:.2%}'.format` for displaying 100 as '100.00%'.
    formatters : list or dict, optional
        Formatters to use by column, passed as the `formatters` arg to
        pd.Dataframe.to_html.
    header_rows : dict, optional
        Extra rows to display at the top of the table.
    """

    if isinstance(arg_0, pd.Series):
        arg_0 = pd.DataFrame(arg_0)

    if arg_1 is not None:
        arg_0.columns.name = arg_1

    arg_6 = arg_0.to_html(arg_2=arg_2, arg_3=arg_3)

    if arg_4 is not None:
        # Count the number of columns for the text to span
        arg_7 = arg_6.split('
')[1].split('
')[0].count('')

        # Generate the HTML for the extra rows
        arg_8 = ''
        for arg_1, arg_9 in arg_4.items():
            arg_8 += ('\n
%s	' +
                     '%s
') % (arg_1, arg_7, arg_9)

        # Inject the new HTML
        arg_6 = arg_6.replace('
', '
' + arg_8)

    display(HTML(arg_6))


def Func(arg_0, arg_1):
        "translate gui2py attribute name from pythoncard legacy code"
        arg_2 = PYTHONCARD_PROPERTY_MAP.get(arg_1)
        if arg_2:
            print "WARNING: property %s should be %s (%s)" % (arg_1, arg_2, arg_0.obj.name)
            return arg_2
        else:
            return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = set ( ) arg_4 = arg_1 + arg_2 for arg_5 in arg_4 : arg_3 . add ( ( arg_5 . head , arg_5 . tail ) ) arg_6 = filterfalse ( lambda arg_5 : ( arg_5 . head , arg_5 . tail ) in arg_3 or ( arg_5 . tail , arg_5 . head ) in arg_3 , arg_0 ) return list ( arg_6 )

def Func(arg_0, arg_1, arg_2):
    """Remove direct links in the training sets."""
    arg_3 = set()
    arg_4 = arg_1 + arg_2
    for arg_5 in arg_4:
        arg_3.add((arg_5.head, arg_5.tail))

    arg_6 = filterfalse(lambda arg_5: (arg_5.head, arg_5.tail) in arg_3 or (arg_5.tail, arg_5.head) in arg_3, arg_0)
    return list(arg_6)

Remove direct links in the training sets .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_0
.
send
(
arg_1
)
except
StopIteration
as
e
:
return
stopiter_value
(
e
)
else
:
raise
RuntimeError
(
'generator did not return as expected'
)

def Func(arg_0, arg_1):
    """Send an item into a generator expecting a final return value

    Parameters
    ----------
    gen: ~typing.Generator[T_yield, T_send, T_return]
        the generator to send the value to
    value: T_send
        the value to send

    Raises
    ------
    RuntimeError
        if the generator did not return as expected

    Returns
    -------
    T_return
        the generator's return value
    """
    try:
        arg_0.send(arg_1)
    except StopIteration as e:
        return stopiter_value(e)
    else:
        raise RuntimeError('generator did not return as expected')


def Func(arg_0, arg_1, arg_2):
        """Func value to status"""
        arg_0.log.debug(
            "Publishing status: %s/%s: %s", arg_0.__class__.__name__, arg_1, arg_2)
        arg_0.core.Func(arg_0.__class__.__name__, arg_1, arg_2)


def Func ( arg_0 ) : for arg_1 in dir ( arg_0 ) : arg_2 = getattr ( arg_0 , arg_1 , None ) if arg_2 and getattr ( arg_2 , '__deposit_action__' , False ) : yield arg_2 . __name__

def Func(arg_0):
    """Extract actions from class."""
    for arg_1 in dir(arg_0):
        arg_2 = getattr(arg_0, arg_1, None)
        if arg_2 and getattr(arg_2, '__deposit_action__', False):
            yield arg_2.__name__


def Func(arg_0):
    """Sets niceness of a process"""
    arg_1 = arg_0['niceness']
    if arg_1 is not None:
        try:
            try:
                arg_2 = os.nice(0)
                if arg_1 - arg_2 > 0:
                    # Under Linux you cannot decrement niceness if set elsewhere
                    os.nice(arg_1-arg_2)
            except AttributeError:
                # Fall back on psutil under Windows
                psutil.Process().nice(arg_1)
        except Exception as exc:
            sys.stderr.write('Could not configure niceness because of: %s' % repr(exc))
            traceback.print_exc()


def Func(arg_0: arg_1):
    """Find edges that are A - A, meaning that some conditions in the edge best describe the interaction."""
    for arg_2, arg_3, arg_4, arg_5 in arg_0.edges(keys=True, arg_5=True):
        if arg_2 != arg_3:
            continue

        arg_6 = arg_0.edge_to_bel(arg_2, arg_3, arg_5)

        arg_7 = arg_5.get(LINE)

        if arg_7 is None:
            continue  # this was inferred, so need to investigate another way

        elif has_protein_modification_increases_activity(arg_0, arg_2, arg_3, arg_4):
            print(arg_7, '- pmod changes -', arg_6)
            find_related(arg_0, arg_3, arg_5)

        elif has_degradation_increases_activity(arg_5):
            print(arg_7, '- degradation changes -', arg_6)
            find_related(arg_0, arg_3, arg_5)

        elif has_translocation_increases_activity(arg_5):
            print(arg_7, '- translocation changes -', arg_6)
            find_related(arg_0, arg_3, arg_5)

        elif complex_increases_activity(arg_0, arg_2, arg_3, arg_4):
            print(arg_7, '- complex changes - ', arg_6)
            find_related(arg_0, arg_3, arg_5)

        elif has_same_subject_object(arg_0, arg_2, arg_3, arg_4):
            print(arg_7, '- same sub/obj -', arg_6)

        else:
            print(arg_7, '- *** - ', arg_6)

Find edges that are A - A meaning that some conditions in the edge best describe the interaction .


def Func ( arg_0 , arg_1 ) : assert arg_1 . IsInitialized ( ) arg_2 = '' arg_3 = arg_1 . DESCRIPTOR . full_name arg_4 = HeronProtocol . get_size_to_pack_string ( arg_3 ) + REQID . REQID_SIZE + HeronProtocol . get_size_to_pack_message ( arg_1 ) arg_2 += HeronProtocol . pack_int ( arg_4 ) arg_2 += HeronProtocol . pack_int ( len ( arg_3 ) ) arg_2 += arg_3 arg_2 += arg_0 . pack ( ) arg_2 += HeronProtocol . pack_int ( arg_1 . ByteSize ( ) ) arg_2 += arg_1 . SerializeToString ( ) return OutgoingPacket ( arg_2 )

def Func(arg_0, arg_1):
    """Creates Outgoing Packet from a given reqid and message

    :param reqid: REQID object
    :param message: protocol buffer object
    """
    assert arg_1.IsInitialized()
    arg_2 = ''

    # calculate the totla size of the packet incl. header
    arg_3 = arg_1.DESCRIPTOR.full_name

    arg_4 = HeronProtocol.get_size_to_pack_string(arg_3) + \
               REQID.REQID_SIZE + HeronProtocol.get_size_to_pack_message(arg_1)

    # first write out how much data is there as the header
    arg_2 += HeronProtocol.pack_int(arg_4)

    # next write the type string
    arg_2 += HeronProtocol.pack_int(len(arg_3))
    arg_2 += arg_3

    # reqid
    arg_2 += arg_0.pack()

    # add the proto
    arg_2 += HeronProtocol.pack_int(arg_1.ByteSize())
    arg_2 += arg_1.SerializeToString()
    return OutgoingPacket(arg_2)


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . sections ( ) : for arg_3 in arg_1 . options ( arg_2 ) : arg_4 = arg_1 . get ( arg_2 , arg_3 ) if arg_3 . endswith ( "+" ) : arg_3 = arg_3 [ : - 1 ] arg_4 = arg_0 . get ( arg_2 , arg_3 ) + arg_4 arg_0 . set ( arg_2 , arg_3 , arg_4 )

def Func(arg_0, arg_1):
    """Merge tweaks into a main config file."""
    for arg_2 in arg_1.sections():
        for arg_3 in arg_1.options(arg_2):
            arg_4 = arg_1.get(arg_2, arg_3)
            if arg_3.endswith("+"):
                arg_3 = arg_3[:-1]
                arg_4 = arg_0.get(arg_2, arg_3) + arg_4
            arg_0.set(arg_2, arg_3, arg_4)


def Func ( arg_0 ) : arg_1 = [ ] def arg_collector ( arg_2 ) : arg_1 . append ( arg_2 ) if len ( arg_1 ) == arg_0 : return tuple ( arg_1 ) else : return arg_collector return arg_collector

def Func(arg_0):
    '''Returns a function that can be called `n` times with a single
    argument before returning all the args that have been passed to it
    in a tuple. Useful as a substitute for functions that can't easily be
    curried.

        >>> Func(3)(1)(2)(3)
        (1, 2, 3)
    '''
    arg_1 = []

    def arg_collector(arg_2):
        arg_1.append(arg_2)
        if len(arg_1) == arg_0:
            return tuple(arg_1)
        else:
            return arg_collector

    return arg_collector

Returns a function that can be called `n` times with a single
    argument before returning all the args that have been passed to it
    in a tuple. Useful as a substitute for functions that can't easily be
    curried.

        >>> collect_args(3)(1)(2)(3)
        (1, 2, 3)

Returns a function that can be called n times with a single argument before returning all the args that have been passed to it in a tuple . Useful as a substitute for functions that can t easily be curried .


def
Func
(
)
:
try
:
arg_0
=
netrc
.
path
(
)
arg_1
=
netrc
(
arg_0
)
.
authenticators
(
urlparse
(
solvebio
.
api_host
)
.
netloc
)
except
(
IOError
,
TypeError
,
NetrcParseError
)
as
e
:
raise
CredentialsError
(
'Could not open credentials file: '
+
str
(
e
)
)
if
arg_1
:
return
arg_1
[
2
]
else
:
return

def Func():
    """
    Returns the user's stored API key if a valid credentials file is found.
    Raises CredentialsError if no valid credentials file is found.
    """
    try:
        arg_0 = netrc.path()
        arg_1 = netrc(arg_0).authenticators(
            urlparse(solvebio.api_host).netloc)
    except (IOError, TypeError, NetrcParseError) as e:
        raise CredentialsError(
            'Could not open credentials file: ' + str(e))

    if arg_1:
        # auths = (login, account, password)
        return arg_1[2]
    else:
        return None

Returns the user s stored API key if a valid credentials file is found . Raises CredentialsError if no valid credentials file is found .


def Func ( arg_0 ) : if not arg_0 : return [ ] arg_1 = 'job-name' if arg_1 not in arg_0 [ 0 ] : arg_1 = 'job-id' arg_2 = collections . defaultdict ( lambda : collections . defaultdict ( lambda : [ ] ) ) for arg_3 in arg_0 : arg_2 [ arg_3 . get ( arg_1 , '' ) ] [ arg_3 . get ( 'status' , '' ) ] += [ arg_3 ] arg_4 = [ ] for arg_5 in sorted ( arg_2 . keys ( ) ) : arg_6 = arg_2 . get ( arg_5 , None ) arg_7 = [ 'RUNNING' , 'SUCCESS' , 'FAILURE' , 'CANCEL' ] for arg_8 in arg_7 + sorted ( arg_6 . keys ( ) ) : if arg_8 not in arg_6 : continue arg_9 = len ( arg_6 [ arg_8 ] ) del arg_6 [ arg_8 ] if arg_9 : arg_10 = collections . OrderedDict ( ) arg_10 [ arg_1 ] = arg_5 arg_10 [ 'status' ] = arg_8 arg_10 [ 'task-count' ] = arg_9 arg_4 . append ( arg_10 ) return arg_4

def Func(arg_0):
  """Create a new table that is a summary of the input rows.

  All with the same (job-name or job-id, status) go together.

  Args:
    rows: the input rows, a list of dictionaries.
  Returns:
    A new row set of summary information.
  """
  if not arg_0:
    return []

  # We either group on the job-name (if present) or fall back to the job-id
  arg_1 = 'job-name'
  if arg_1 not in arg_0[0]:
    arg_1 = 'job-id'

  # Group each of the rows based on (job-name or job-id, status)
  arg_2 = collections.defaultdict(lambda: collections.defaultdict(lambda: []))
  for arg_3 in arg_0:
    arg_2[arg_3.get(arg_1, '')][arg_3.get('status', '')] += [arg_3]

  # Now that we have the rows grouped, create a summary table.
  # Use the original table as the driver in order to preserve the order.
  arg_4 = []
  for arg_5 in sorted(arg_2.keys()):
    arg_6 = arg_2.get(arg_5, None)
    arg_7 = ['RUNNING', 'SUCCESS', 'FAILURE', 'CANCEL']
    # Written this way to ensure that if somehow a new status is introduced,
    # it shows up in our output.
    for arg_8 in arg_7 + sorted(arg_6.keys()):
      if arg_8 not in arg_6:
        continue
      arg_9 = len(arg_6[arg_8])
      del arg_6[arg_8]
      if arg_9:
        arg_10 = collections.OrderedDict()
        arg_10[arg_1] = arg_5
        arg_10['status'] = arg_8
        arg_10['task-count'] = arg_9
        arg_4.append(arg_10)

  return arg_4

Create a new table that is a summary of the input rows .


def Func ( arg_0 , arg_1 = None ) : return arg_0 . _backend . Func ( account = arg_0 . index , arg_1 = arg_1 )

def Func(arg_0, arg_1=None):
        """
        Creates a new address.

        :param label: address label as `str`
        :rtype: :class:`SubAddress <monero.address.SubAddress>`
        """
        return arg_0._backend.Func(account=arg_0.index, arg_1=arg_1)