def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = pd . DataFrame ( symbols ( arg_0 , arg_1 ) ) _toDatetime ( arg_2 ) _reindex ( arg_2 , 'symbol' ) return arg_2

def Func(arg_0='', arg_1=''):
    '''This call returns an array of symbols that IEX Cloud supports for API calls.

    https://iexcloud.io/docs/api/#symbols
    8am, 9am, 12pm, 1pm UTC daily

    Args:
        token (string); Access token
        version (string); API version

    Returns:
        dataframe: result
    '''
    arg_2 = pd.DataFrame(symbols(arg_0, arg_1))
    _toDatetime(arg_2)
    _reindex(arg_2, 'symbol')
    return arg_2

This call returns an array of symbols that IEX Cloud supports for API calls .


def Func ( arg_0 , arg_1 ) : arg_0 . _discovered_services . add ( arg_1 ) if arg_0 . _discovered_services >= set ( arg_0 . _peripheral . services ( ) ) : arg_0 . _discovered . set ( )

def Func(arg_0, arg_1):
        """Called when GATT characteristics have been discovered."""
        # Characteristics for the specified service were discovered.  Update
        # set of discovered services and signal when all have been discovered.
        arg_0._discovered_services.add(arg_1)
        if arg_0._discovered_services >= set(arg_0._peripheral.services()):
            # Found all the services characteristics, finally time to fire the
            # service discovery complete event.
            arg_0._discovered.set()

Called when GATT characteristics have been discovered .


return format_html(
        '<link rel="stylesheet" href="{0}djfrontend/css/h5bp/{1}/h5bp.css">',
        _static_url, version)

def Func(arg_0=None):
    """
    Returns HTML5 Boilerplate CSS file.
    Included in HTML5 Boilerplate.
    """
    if arg_0 is None:
        arg_0 = getattr(settings, 'DJFRONTEND_H5BP_CSS', DJFRONTEND_H5BP_CSS_DEFAULT)

    return format_html(
        '<link rel="stylesheet" href="{0}djfrontend/css/h5bp/{1}/h5bp.css">',
        _static_url, arg_0)

Returns HTML5 Boilerplate CSS file . Included in HTML5 Boilerplate .


def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 , arg_4 in arg_0 . edges ( data = True , keys = True ) : if arg_4 [ RELATION ] in TWO_WAY_RELATIONS : infer_missing_backwards_edge ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0):
    """Add edges to the graph when a two way edge exists, and the opposite direction doesn't exist.

    Use: two way edges from BEL definition and/or axiomatic inverses of membership relations

    :param pybel.BELGraph graph: A BEL graph
    """
    for arg_1, arg_2, arg_3, arg_4 in arg_0.edges(data=True, keys=True):
        if arg_4[RELATION] in TWO_WAY_RELATIONS:
            infer_missing_backwards_edge(arg_0, arg_1, arg_2, arg_3)

Add edges to the graph when a two way edge exists and the opposite direction doesn t exist .


def Func ( arg_0 , arg_1 = False , arg_2 = True ) : arg_3 = arg_0 . get_json ( arg_1 , arg_2 ) if len ( arg_3 ) > 2 : if arg_1 : arg_3 = arg_3 [ 1 : - 2 ] + ",\n" else : arg_3 = arg_3 [ 1 : - 1 ] + "," else : arg_3 = "" return arg_3

def Func(arg_0, arg_1=False, arg_2=True):
        """
        Get the data as JSON tuples
        """
        arg_3 = arg_0.get_json(arg_1, arg_2)
        if len(arg_3) > 2:
            if arg_1:
                arg_3 = arg_3[1:-2] + ",\n"
            else:
                arg_3 = arg_3[1:-1] + ","
        else:
            arg_3 = ""
        return arg_3


return tf.matmul(tf.expand_dims(t1, axis=-1), tf.expand_dims(t2, axis=-2))

def Func ( arg_0 , arg_1 ) : return tf . matmul ( tf . expand_dims ( arg_0 , axis = - 1 ) , tf . expand_dims ( arg_1 , axis = - 2 ) )

def Func(arg_0, arg_1):
  """Computes the outer product of two possibly batched vectors.

  Args:
    t1: A `tf.Tensor` of shape `[..., n]`.
    t2: A `tf.Tensor` of shape `[..., m]`.

  Returns:
    A tensor of shape `[..., n, m]` with matching batch dimensions, let's call
    it `r`, whose components are:

    ```None
      r[..., i, j] = t1[..., i] * t2[..., j]
    ```
  """
  return tf.matmul(tf.expand_dims(arg_0, axis=-1), tf.expand_dims(arg_1, axis=-2))

Computes the outer product of two possibly batched vectors .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : arg_4 = re . escape ( arg_2 ) + r"\\?" arg_0 = re . sub ( arg_4 , lambda _ : arg_3 , arg_0 ) return arg_0

def Func(arg_0, arg_1):
    r"""Replace macros in the TeX source with their content.

    Parameters
    ----------
    tex_source : `str`
        TeX source content.
    macros : `dict`
        Keys are macro names (including leading ``\``) and values are the
        content (as `str`) of the macros. See
        `lsstprojectmeta.tex.scraper.get_macros`.

    Returns
    -------
    tex_source : `str`
        TeX source with known macros replaced.

    Notes
    -----
    Macros with arguments are not supported.

    Examples
    --------
    >>> macros = {r'\handle': 'LDM-nnn'}
    >>> sample = r'This is document \handle.'
    >>> Func(sample, macros)
    'This is document LDM-nnn.'

    Any trailing slash after the macro command is also replaced by this
    function.

    >>> macros = {r'\product': 'Data Management'}
    >>> sample = r'\title    [Test Plan]  { \product\ Test Plan}'
    >>> Func(sample, macros)
    '\\title    [Test Plan]  { Data Management Test Plan}'
    """
    for arg_2, arg_3 in arg_1.items():
        # '\\?' suffix matches an optional trailing '\' that might be used
        # for spacing.
        arg_4 = re.escape(arg_2) + r"\\?"
        # Wrap macro_content in lambda to avoid processing escapes
        arg_0 = re.sub(arg_4, lambda _: arg_3, arg_0)
    return arg_0

r"""Replace macros in the TeX source with their content.

    Parameters
    ----------
    tex_source : `str`
        TeX source content.
    macros : `dict`
        Keys are macro names (including leading ``\``) and values are the
        content (as `str`) of the macros. See
        `lsstprojectmeta.tex.scraper.get_macros`.

    Returns
    -------
    tex_source : `str`
        TeX source with known macros replaced.

    Notes
    -----
    Macros with arguments are not supported.

    Examples
    --------
    >>> macros = {r'\handle': 'LDM-nnn'}
    >>> sample = r'This is document \handle.'
    >>> replace_macros(sample, macros)
    'This is document LDM-nnn.'

    Any trailing slash after the macro command is also replaced by this
    function.

    >>> macros = {r'\product': 'Data Management'}
    >>> sample = r'\title    [Test Plan]  { \product\ Test Plan}'
    >>> replace_macros(sample, macros)
    '\\title    [Test Plan]  { Data Management Test Plan}'

r Replace macros in the TeX source with their content .


def Func(arg_0, arg_1, arg_2=0, arg_3=1):
    """
    Variance-covariance calculation of daily Value-at-Risk in a
    portfolio.

    Parameters
    ----------
    P : float
        Portfolio value.
    c : float
        Confidence level.
    mu : float, optional
        Mean.

    Returns
    -------
    float
        Variance-covariance.
    """

    arg_4 = sp.stats.norm.ppf(1 - arg_1, arg_2, arg_3)
    return arg_0 - arg_0 * (arg_4 + 1)

Variance - covariance calculation of daily Value - at - Risk in a portfolio .


return super(Bucket, self).delete_keys(*args, **kwargs)

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = iter ( arg_2 . get ( 'keys' , arg_1 [ 0 ] if arg_1 else [ ] ) ) while True : try : arg_4 = arg_3 . next ( ) except StopIteration : break if isinstance ( arg_4 , basestring ) : mimicdb . backend . srem ( tpl . bucket % arg_0 . name , arg_4 ) mimicdb . backend . delete ( tpl . key % ( arg_0 . name , arg_4 ) ) elif isinstance ( arg_4 , BotoKey ) or isinstance ( arg_4 , Key ) : mimicdb . backend . srem ( tpl . bucket % arg_0 . name , arg_4 . name ) mimicdb . backend . delete ( tpl . key % ( arg_0 . name , arg_4 . name ) ) return super ( Bucket , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Remove each key or key name in an iterable from the bucket set.
        """
        arg_3 = iter(arg_2.get('keys', arg_1[0] if arg_1 else []))

        while True:
            try:
                arg_4 = arg_3.next()
            except StopIteration:
                break

            if isinstance(arg_4, basestring):
                mimicdb.backend.srem(tpl.bucket % arg_0.name, arg_4)
                mimicdb.backend.delete(tpl.key % (arg_0.name, arg_4))
            elif isinstance(arg_4, BotoKey) or isinstance(arg_4, Key):
                mimicdb.backend.srem(tpl.bucket % arg_0.name, arg_4.name)
                mimicdb.backend.delete(tpl.key % (arg_0.name, arg_4.name))

        return super(Bucket, arg_0).Func(*arg_1, **arg_2)

Remove each key or key name in an iterable from the bucket set .


(graph: BELGraph,
                      data: Mapping[str, float],
                      func: str,
                      namespace: str,
                      label: Optional[str] = None,
                      overwrite: bool = False,
                      impute: Optional[float] = None,
                      )

def Func(arg_0: arg_1,
                      arg_2: arg_3[arg_4, arg_5],
                      arg_6: arg_4,
                      arg_7: arg_4,
                      arg_8: arg_9[arg_4] = None,
                      arg_10: arg_11 = False,
                      arg_12: arg_9[arg_5] = None,
                      ) -> None:
    """Overlay tabular data on the network for data that comes from an data set with identifiers that lack
    namespaces.

    For example, if you want to overlay differential gene expression data from a table, that table
    probably has HGNC identifiers, but no specific annotations that they are in the HGNC namespace or
    that the entities to which they refer are RNA.

    :param graph: A BEL Graph
    :param dict data: A dictionary of {name: data}
    :param func: The function of the keys in the data dictionary
    :param namespace: The namespace of the keys in the data dictionary
    :param label: The annotation label to put in the node dictionary
    :param overwrite: Should old annotations be overwritten?
    :param impute: The value to use for missing data
    """
    arg_13 = {
        node: arg_2.get(node[NAME], arg_12)
        for node in filter_nodes(arg_0, function_namespace_inclusion_builder(arg_6, arg_7))
    }

    overlay_data(arg_0, arg_13, arg_8=arg_8, arg_10=arg_10)

Overlay tabular data on the network for data that comes from an data set with identifiers that lack namespaces .


return sns.plotting_context(context=context, font_scale=font_scale, rc=rc)

def Func ( arg_0 = 'notebook' , arg_1 = 1.5 , arg_2 = None ) : if arg_2 is None : arg_2 = { } arg_3 = { 'lines.linewidth' : 1.5 } for arg_4 , arg_5 in arg_3 . items ( ) : arg_2 . setdefault ( arg_4 , arg_5 ) return sns . Func ( arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0='notebook', arg_1=1.5, arg_2=None):
    """
    Create pyfolio default plotting style context.

    Under the hood, calls and returns seaborn.Func() with
    some custom settings. Usually you would use in a with-context.

    Parameters
    ----------
    context : str, optional
        Name of seaborn context.
    font_scale : float, optional
        Scale font by factor font_scale.
    rc : dict, optional
        Config flags.
        By default, {'lines.linewidth': 1.5}
        is being used and will be added to any
        rc passed in, unless explicitly overriden.

    Returns
    -------
    seaborn plotting context

    Example
    -------
    >>> with pyfolio.plotting.Func(font_scale=2):
    >>>    pyfolio.create_full_tear_sheet(..., set_context=False)

    See also
    --------
    For more information, see seaborn.Func().

    """
    if arg_2 is None:
        arg_2 = {}

    arg_3 = {'lines.linewidth': 1.5}

    # Add defaults if they do not exist
    for arg_4, arg_5 in arg_3.items():
        arg_2.setdefault(arg_4, arg_5)

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

Create pyfolio default plotting style context.

    Under the hood, calls and returns seaborn.plotting_context() with
    some custom settings. Usually you would use in a with-context.

    Parameters
    ----------
    context : str, optional
        Name of seaborn context.
    font_scale : float, optional
        Scale font by factor font_scale.
    rc : dict, optional
        Config flags.
        By default, {'lines.linewidth': 1.5}
        is being used and will be added to any
        rc passed in, unless explicitly overriden.

    Returns
    -------
    seaborn plotting context

    Example
    -------
    >>> with pyfolio.plotting.plotting_context(font_scale=2):
    >>>    pyfolio.create_full_tear_sheet(..., set_context=False)

    See also
    --------
    For more information, see seaborn.plotting_context().

Create pyfolio default plotting style context .


def
Func
(
arg_0
,
arg_1
=
' '
)
:
def
non_tag_chars
(
arg_2
)
:
arg_3
=
0
while
arg_3
<
len
(
arg_2
)
:
arg_4
=
arg_2
.
find
(
'<'
,
arg_3
)
if
arg_4
==
1
:
yield
arg_2
[
arg_3
:
]
arg_3
=
len
(
arg_2
)
break
yield
arg_2
[
arg_3
:
arg_4
]
arg_3
=
arg_4
while
arg_3
<
len
(
arg_2
)
:
arg_5
=
arg_2
.
find
(
'\n'
,
arg_3
)
arg_4
=
arg_2
.
find
(
'>'
,
arg_3
)
if
arg_4
==
1
:
yield
' '
*
(
len
(
arg_2
)
arg_3
)
arg_3
=
len
(
arg_2
)
break
elif
arg_5
==
1
or
arg_4
<
arg_5
:
yield
' '
*
(
arg_4
+
1
arg_3
)
arg_3
=
arg_4
+
1
break
else
:
yield
' '
*
(
arg_5
arg_3
)
+
'\n'
arg_3
=
arg_5
+
1
if
not
isinstance
(
arg_0
,
unicode
)
:
arg_0
=
unicode
(
arg_0
,
'utf-8'
)
arg_0
=
fix_emails
(
arg_0
)
arg_6
=
''
.
join
(
non_tag_chars
(
arg_0
)
)
return
arg_6
.
encode
(
'utf-8'
)

def Func(arg_0, arg_1=' '):
    '''
    Takes an HTML-like Unicode string as input and returns a UTF-8
    encoded string with all tags replaced by whitespace. In particular,
    all Unicode characters inside HTML are replaced with a single
    whitespace character.

    This does not detect comments, style, script, link.  It also does
    do anything with HTML-escaped characters.  All of these are
    handled by the clean_html pre-cursor step.

    Pre-existing whitespace of any kind (newlines, tabs) is converted
    to single spaces ' ', which has the same byte length (and
    character length).

    This is a simple state machine iterator without regexes
    '''
    def non_tag_chars(arg_2):
        arg_3 = 0
        while arg_3 < len(arg_2):
            arg_4 = arg_2.find('<', arg_3)
            if arg_4 == -1:
                yield arg_2[arg_3:]
                arg_3 = len(arg_2)
                break
            yield arg_2[arg_3:arg_4]
            arg_3 = arg_4

            while arg_3 < len(arg_2):
                arg_5 = arg_2.find('\n', arg_3)
                arg_4 = arg_2.find('>', arg_3)
                if arg_4 == -1:
                    yield ' ' * (len(arg_2) - arg_3)
                    arg_3 = len(arg_2)
                    break
                elif arg_5 == -1 or arg_4 < arg_5:
                    yield ' ' * (arg_4 + 1 - arg_3)
                    arg_3 = arg_4 + 1
                    break
                else:
                    yield ' ' * (arg_5 - arg_3) + '\n'
                    arg_3 = arg_5 + 1
                    # do not break

    if not isinstance(arg_0, unicode):
        arg_0 = unicode(arg_0, 'utf-8')

    # Protect emails by substituting with unique key
    arg_0 = fix_emails(arg_0)

    #Strip tags with previous logic
    arg_6 = ''.join(non_tag_chars(arg_0))

    return arg_6.encode('utf-8')

Takes an HTML - like Unicode string as input and returns a UTF - 8 encoded string with all tags replaced by whitespace . In particular all Unicode characters inside HTML are replaced with a single whitespace character .


return Constraint(func, configs, variables, vartype=vartype, name=name)

def Func(arg_0, arg_1=arg_2.BINARY, arg_4='FULL_ADDER'):
    """Full adder.

    Args:
        variables (list): Variable labels for the and gate as `[in1, in2, in3, sum, carry]`,
            where `in1, in2, in3` are inputs to be added and `sum` and 'carry' the resultant
            outputs.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        name (str, optional, default='FULL_ADDER'): Name for the constraint.

    Returns:
        Constraint(:obj:`.Constraint`): Constraint that is satisfied when its variables are
        assigned values that match the valid states of a Boolean full adder.

    Examples:
        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories.constraint.gates as gates
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(gates.Func(['a', 'b', 'c_in', 'total', 'c_out'], name='FA1'))
        >>> csp.check({'a': 1, 'b': 0, 'c_in': 1, 'total': 0, 'c_out': 1})
        True

    """

    arg_0 = tuple(arg_0)

    if arg_1 is arg_2.BINARY:
        arg_5 = frozenset([(0, 0, 0, 0, 0),
                             (0, 0, 1, 1, 0),
                             (0, 1, 0, 1, 0),
                             (0, 1, 1, 0, 1),
                             (1, 0, 0, 1, 0),
                             (1, 0, 1, 0, 1),
                             (1, 1, 0, 0, 1),
                             (1, 1, 1, 1, 1)])

    else:
        # SPIN, vartype is checked by the decorator
        arg_5 = frozenset([(-1, -1, -1, -1, -1),
                             (-1, -1, +1, +1, -1),
                             (-1, +1, -1, +1, -1),
                             (-1, +1, +1, -1, +1),
                             (+1, -1, -1, +1, -1),
                             (+1, -1, +1, -1, +1),
                             (+1, +1, -1, -1, +1),
                             (+1, +1, +1, +1, +1)])

    def func(arg_6, arg_7, arg_8, arg_9, arg_10):
        arg_11 = (arg_6 > 0) + (arg_7 > 0) + (arg_8 > 0)
        if arg_11 == 0:
            return (arg_9 <= 0) and (arg_10 <= 0)
        elif arg_11 == 1:
            return (arg_9 > 0) and (arg_10 <= 0)
        elif arg_11 == 2:
            return (arg_9 <= 0) and (arg_10 > 0)
        elif arg_11 == 3:
            return (arg_9 > 0) and (arg_10 > 0)
        else:
            raise ValueError("func recieved unexpected values")

    return Constraint(func, arg_5, arg_0, arg_1=arg_1, arg_4=arg_4)

Full adder.

    Args:
        variables (list): Variable labels for the and gate as `[in1, in2, in3, sum, carry]`,
            where `in1, in2, in3` are inputs to be added and `sum` and 'carry' the resultant
            outputs.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        name (str, optional, default='FULL_ADDER'): Name for the constraint.

    Returns:
        Constraint(:obj:`.Constraint`): Constraint that is satisfied when its variables are
        assigned values that match the valid states of a Boolean full adder.

    Examples:
        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories.constraint.gates as gates
        >>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
        >>> csp.add_constraint(gates.fulladder_gate(['a', 'b', 'c_in', 'total', 'c_out'], name='FA1'))
        >>> csp.check({'a': 1, 'b': 0, 'c_in': 1, 'total': 0, 'c_out': 1})
        True


(self, image, color=(0, 128, 0),
                             alpha=1.0, size=3,
                             copy=True, raise_if_out_of_image=False)

def Func(arg_0, arg_1, arg_2=(0, 128, 0),
                             arg_3=1.0, arg_4=3,
                             arg_5=True, arg_6=False):
        """
        Draw the points of the line string on a given image.

        Parameters
        ----------
        image : ndarray or tuple of int
            The image onto which to draw.
            Expected to be ``uint8`` and of shape ``(H, W, C)`` with ``C``
            usually being ``3`` (other values are not tested).
            If a tuple, expected to be ``(H, W, C)`` and will lead to a new
            ``uint8`` array of zeros being created.

        color : iterable of int
            Color to use as RGB, i.e. three values.

        alpha : float, optional
            Opacity of the line string points. Higher values denote a more
            visible points.

        size : int, optional
            Size of the points in pixels.

        copy : bool, optional
            Whether it is allowed to draw directly in the input
            array (``False``) or it has to be copied (``True``).
            The routine may still have to copy, even if ``copy=False`` was
            used. Always use the return value.

        raise_if_out_of_image : bool, optional
            Whether to raise an error if the line string is fully
            outside of the image. If set to False, no error will be raised and
            only the parts inside the image will be drawn.

        Returns
        -------
        ndarray
            Float array of shape `image_shape` (no channel axis) with drawn
            line string points. All values are in the interval ``[0.0, 1.0]``.

        """
        from .kps import KeypointsOnImage
        arg_7 = KeypointsOnImage.from_xy_array(arg_0.coords, shape=arg_1.shape)
        arg_1 = arg_7.draw_on_image(
            arg_1, arg_2=arg_2, arg_3=arg_3,
            arg_4=arg_4, arg_5=arg_5,
            arg_6=arg_6)

        return arg_1

Draw the points of the line string on a given image .


def Func(arg_0):
    '''Copy a global module to the active environment.'''

    arg_1 = cpenv.get_active_env()
    if not arg_1:
        click.echo('You need to activate an environment first.')
        return

    try:
        arg_2 = cpenv.resolve(arg_0)
    except cpenv.ResolveError as e:
        click.echo('\n' + str(e))

    arg_3 = arg_2.resolved[0]
    if isinstance(arg_3, cpenv.VirtualEnvironment):
        click.echo('\nCan only Func a module not an environment')
        return

    arg_4 = cpenv.get_active_modules()
    if arg_3 in arg_4:
        click.echo('\nCan not Func an active module.')
        return

    if arg_3 in arg_1.get_modules():
        click.echo('\n{} is already local to {}'.format(arg_3.name, arg_1.name))
        return

    if click.confirm('\nAdd {} to env {}?'.format(arg_3.name, arg_1.name)):
        click.echo('Adding module...', nl=False)
        try:
            arg_3 = arg_1.add_module(arg_3.name, arg_3.path)
        except:
            click.echo(bold_red('FAILED'))
            raise
        else:
            click.echo(bold_green('OK!'))

    click.echo('\nActivate the Func module:')
    click.echo('    cpenv activate {} {}'.format(arg_1.name, arg_3.name))

Copy a global module to the active environment .


def Func ( arg_0 , arg_1 = '\n' , arg_2 = None ) : if arg_2 is None : arg_2 = sys . stdout print ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1='\n', arg_2=None):
    """Prints an item.

    :param item: The item to print
    :param end: String to append to the end of printed output
    :param file: File to which output is printed
    :rtype: None

    Example::

        >>> from operator import add

        >>> fn = pfreduce(add, initial=0) >> Func
        >>> fn([1, 2, 3, 4])
        10

    """

    # Can't just make sys.stdout the file argument's default value, because
    # then we would be capturing the stdout file descriptor, and then
    # doctest -- which works by redefining sys.stdout -- would fail:
    if arg_2 is None:
        arg_2 = sys.stdout

    print(arg_0, arg_1=arg_1, arg_2=arg_2)

Prints an item.

    :param item: The item to print
    :param end: String to append to the end of printed output
    :param file: File to which output is printed
    :rtype: None

    Example::

        >>> from operator import add

        >>> fn = pfreduce(add, initial=0) >> pfprint
        >>> fn([1, 2, 3, 4])
        10


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
out
(
"Deploying "
+
str
(
arg_2
)
+
" to "
+
str
(
arg_1
)
)
arg_0
.
ebs
.
update_environment
(
arg_1
=
arg_1
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """
        Deploys a version to an environment
        """
        out("Deploying " + str(arg_2) + " to " + str(arg_1))
        arg_0.ebs.update_environment(arg_1=arg_1, arg_2=arg_2)


def Func(arg_0, arg_1):
        """set current cursor position"""
        Func = min(max(arg_0._min, arg_1), arg_0._max)

        arg_0._current = Func

        if Func > arg_0._stop :
            arg_0._stop = Func
            arg_0._start = Func-arg_0._width
        elif Func < arg_0._start :
            arg_0._start = Func
            arg_0._stop = Func + arg_0._width

        if abs(arg_0._start - arg_0._min) <= arg_0._sticky_lenght :
            arg_0._start = arg_0._min

        if abs(arg_0._stop - arg_0._max) <= arg_0._sticky_lenght :
            arg_0._stop = arg_0._max


return compress(self.images, delete_tif, folder)

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : return Func ( arg_0 . images , arg_1 , arg_2 )

def Func(arg_0, arg_1=False, arg_2=None):
        """Lossless Func all images in experiment to PNG. If folder is
        omitted, images will not be moved.

        Images which already exists in PNG are omitted.

        Parameters
        ----------
        folder : string
            Where to store PNGs. Defaults to the folder they are in.
        delete_tif : bool
            If set to truthy value, ome.tifs will be deleted after Funcion.

        Returns
        -------
        list
            Filenames of PNG images. Files which already exists before
            Funcion are also returned.
        """
        return Func(arg_0.images, arg_1, arg_2)

Lossless compress all images in experiment to PNG. If folder is
        omitted, images will not be moved.

        Images which already exists in PNG are omitted.

        Parameters
        ----------
        folder : string
            Where to store PNGs. Defaults to the folder they are in.
        delete_tif : bool
            If set to truthy value, ome.tifs will be deleted after compression.

        Returns
        -------
        list
            Filenames of PNG images. Files which already exists before
            compression are also returned.

Lossless compress all images in experiment to PNG . If folder is omitted images will not be moved .


def Func ( arg_0 ) : arg_1 = arg_0 . readline ( ) if arg_1 == arg_0 . _empty_buffer : raise StopIteration return arg_1

def Func (arg_0):    # File-like object.

        """This is to support iterators over a file-like object.
        """

        arg_1 = arg_0.readline()
        if arg_1 == arg_0._empty_buffer:
            raise StopIteration
        return arg_1

This is to support iterators over a file - like object .


(sub_to_pix, pixels, regular_pixels, sub_to_regular, sub_grid_fraction)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = np . zeros ( ( arg_2 , arg_1 ) ) for arg_6 in range ( arg_3 . shape [ 0 ] ) : arg_5 [ arg_3 [ arg_6 ] , arg_0 [ arg_6 ] ] += arg_4 return arg_5

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Computes the mapping matrix, by iterating over the known mappings between the sub-grid and pixelization.

    Parameters
    -----------
    sub_to_pix : ndarray
        The mappings between the observed regular's sub-pixels and pixelization's pixels.
    pixels : int
        The number of pixels in the pixelization.
    regular_pixels : int
        The number of datas pixels in the observed datas and thus on the regular grid.
    sub_to_regular : ndarray
        The mappings between the observed regular's sub-pixels and observed regular's pixels.
    sub_grid_fraction : float
        The fractional area each sub-pixel takes up in an regular-pixel.
    """

    arg_5 = np.zeros((arg_2, arg_1))

    for arg_6 in range(arg_3.shape[0]):
        arg_5[arg_3[arg_6], arg_0[arg_6]] += arg_4

    return arg_5

Computes the mapping matrix by iterating over the known mappings between the sub - grid and pixelization .


def Func ( arg_0 , arg_1 ) : if arg_0 . _tapFileOut is not None : for arg_2 in range ( len ( arg_1 ) ) : print >> arg_0 . _tapFileOut , arg_1 [ arg_2 ] , print >> arg_0 . _tapFileOut

def Func(arg_0, arg_1):
    """
    Write outputs to output tap file.

    :param outputs: (iter) some outputs.
    """
    #raise Exception('MULTI-LINE DUMMY\nMULTI-LINE DUMMY')
    if arg_0._tapFileOut is not None:
      for arg_2 in range(len(arg_1)):
        print >> arg_0._tapFileOut, arg_1[arg_2],
      print >> arg_0._tapFileOut


(self, course_runs, enterprise_customer, enterprise_context)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] for arg_5 in arg_1 : arg_6 = utils . get_course_track_selection_url ( arg_5 = arg_5 , arg_9 = dict ( arg_3 , ** utils . get_enterprise_utm_context ( arg_2 ) ) , ) arg_7 = arg_2 . get_course_run_enrollment_url ( arg_5 . get ( 'key' ) ) arg_5 . update ( { 'enrollment_url' : arg_7 , 'track_selection_url' : arg_6 , } ) arg_8 = arg_5 . get ( 'marketing_url' ) if arg_8 : arg_9 = dict ( arg_3 , ** utils . get_enterprise_utm_context ( arg_2 ) ) arg_5 . update ( { 'marketing_url' : utils . update_query_parameters ( arg_8 , arg_9 ) } ) arg_4 . append ( arg_5 ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update Marketing urls in course metadata and return updated course.

        Arguments:
            course_runs (list): List of course runs.
            enterprise_customer (EnterpriseCustomer): enterprise customer instance.
            enterprise_context (dict): The context to inject into URLs.

        Returns:
            (dict): Dictionary containing updated course metadata.
        """
        arg_4 = []
        for arg_5 in arg_1:
            arg_6 = utils.get_course_track_selection_url(
                arg_5=arg_5,
                arg_9=dict(arg_3, **utils.get_enterprise_utm_context(arg_2)),
            )

            arg_7 = arg_2.get_course_run_enrollment_url(arg_5.get('key'))

            arg_5.update({
                'enrollment_url': arg_7,
                'track_selection_url': arg_6,
            })

            # Update marketing urls in course metadata to include enterprise related info.
            arg_8 = arg_5.get('marketing_url')
            if arg_8:
                arg_9 = dict(arg_3, **utils.get_enterprise_utm_context(arg_2))
                arg_5.update({'marketing_url': utils.update_query_parameters(arg_8, arg_9)})

            # Add updated course run to the list.
            arg_4.append(arg_5)
        return arg_4

Update Marketing urls in course metadata and return updated course .


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

def Func(arg_0, arg_1, arg_2, arg_3,
                  arg_4=0):
    """Prepares the parameters, runs the algorithms, and saves results.

    Parameters
    ----------
    file_struct: `msaf.io.FileStruct`
        FileStruct containing the paths of the input files (audio file,
        features file, reference file, output estimation file).
    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
        List of estimated times for the segment boundaries.
    est_labels: np.array
        List of all the labels associated segments.
    """
    logging.info("Segmenting %s" % arg_0.audio_file)

    # Get features
    arg_3["features"] = Features.select_features(
        arg_3["feature"], arg_0, arg_3["annot_beats"],
        arg_3["framesync"])

    # Get estimations
    arg_5, arg_6 = run_algorithms(arg_0,
                                           arg_1, arg_2, arg_3,
                                           arg_4=arg_4)

    # Save
    logging.info("Writing results in: %s" % arg_0.est_file)
    io.save_estimations(arg_0, arg_5, arg_6,
                        arg_1, arg_2, **arg_3)

    return arg_5, arg_6

Prepares the parameters runs the algorithms and saves results .


def Func(arg_0):
    '''This turns the pickled lightcurve file back into an `lcdict`.

    Parameters
    ----------

    picklefile : str
        The path to a previously written Kepler LC picklefile generated by
        `kepler_lcdict_to_pkl` above.

    Returns
    -------

    lcdict
        Returns an `lcdict` (this is useable by most astrobase functions for LC
        processing).

    '''

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

    try:
        with arg_1:
            arg_2 = pickle.load(arg_1)

    except UnicodeDecodeError:

        with open(arg_0,'rb') as arg_1:
            arg_2 = pickle.load(arg_1, encoding='latin1')

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

    return arg_2

This turns the pickled lightcurve file back into an lcdict .


return Table(items, kdims=kdims, vdims=vdims)

def
Func
(
arg_0
,
arg_1
=
[
]
)
:
if
not
Table
:
return
"HoloViews Table not available"
arg_2
=
[
dim
for
dim
in
arg_0
.
constant_keys
+
arg_0
.
varying_keys
if
dim
not
in
arg_1
]
arg_3
=
[
tuple
(
[
spec
[
k
]
for
k
in
arg_2
+
arg_1
]
)
for
spec
in
arg_0
.
specs
]
return
Table
(
arg_3
,
arg_2
=
arg_2
,
arg_1
=
arg_1
)

def Func(arg_0, arg_1=[]):
    "Helper function to convet an Args object to a HoloViews Table"
    if not Table:
        return "HoloViews Table not available"
    arg_2 = [dim for dim in arg_0.constant_keys + arg_0.varying_keys
             if dim not in arg_1]
    arg_3 = [tuple([spec[k] for k in arg_2+arg_1])
             for spec in arg_0.specs]
    return Table(arg_3, arg_2=arg_2, arg_1=arg_1)


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_3 = glob . glob ( os . path . join ( arg_0 . path , "*.vcf" ) ) if arg_1 and arg_2 : for arg_4 in arg_3 : with open ( arg_4 , "r" ) as filehandle : if re . search ( arg_1 , filehandle . read ( ) , re . IGNORECASE | re . DOTALL ) : yield arg_4 else : yield from arg_3

def Func(arg_0, arg_1=None, arg_2=False):
        """Find all vcard files inside this address book.

        If a search string is given only files which contents match that will
        be returned.

        :param search: a regular expression to limit the results
        :type search: str
        :param search_in_source_files: apply search regexp directly on the .vcf files to speed up parsing (less accurate)
        :type search_in_source_files: bool
        :returns: the paths of the vcard files
        :rtype: generator

        """
        arg_3 = glob.glob(os.path.join(arg_0.path, "*.vcf"))
        if arg_1 and arg_2:
            for arg_4 in arg_3:
                with open(arg_4, "r") as filehandle:
                    if re.search(arg_1, filehandle.read(),
                                 re.IGNORECASE | re.DOTALL):
                        yield arg_4
        else:
            yield from arg_3

Find all vcard files inside this address book .


def Func(arg_0, arg_1):
        """Called to verify that the given rule can become a child of the
        current node.

        :raises AttributeError:
            if the child is not allowed
        """
        arg_2 = arg_0.node.children.count()
        arg_3 = len(arg_0.rule.children)
        if not arg_0.rule.multiple_paths:
            arg_3 = 1

        if arg_2 >= arg_3:
            raise AttributeError('Rule %s only allows %s children' % (
                arg_0.rule_name, arg_0.num_kids_allowed))

        # verify not a duplicate
        for arg_4 in arg_0.node.children.all():
            if arg_4.data.rule_label == arg_1.class_label:
                raise AttributeError('Child rule already exists')

        # check if the given rule is allowed as a child
        if arg_1 not in arg_0.rule.children:
            raise AttributeError('Rule %s is not a valid child of Rule %s' % (
                arg_1.__name__, arg_0.rule_name))

Called to verify that the given rule can become a child of the current node .


(context, limit=None, page_reverse=False, sorts=['id'],
                marker=None, filters=None, fields=None)

def Func(arg_0, arg_1=None, arg_2=False, arg_3=['id'],
                arg_4=None, arg_5=None, arg_6=None):
    """Retrieve a list of subnets.

    The contents of the list depends on the identity of the user
    making the request (as indicated by the context) as well as any
    filters.
    : param context: neutron api request context
    : param filters: a dictionary with keys that are valid keys for
        a subnet as listed in the RESOURCE_ATTRIBUTE_MAP object
        in neutron/api/v2/attributes.py.  Values in this dictiontary
        are an iterable containing values that will be used for an exact
        match comparison for that value.  Each result returned by this
        function will have matched one of the values for each key in
        filters.
    : param fields: a list of strings that are valid keys in a
        subnet dictionary as listed in the RESOURCE_ATTRIBUTE_MAP
        object in neutron/api/v2/attributes.py. Only these fields
        will be returned.
    """
    LOG.info("Func for tenant %s with filters %s fields %s" %
             (arg_0.tenant_id, arg_5, arg_6))
    arg_5 = arg_5 or {}
    arg_7 = db_api.subnet_find(arg_0, arg_1=arg_1,
                                 arg_2=arg_2, arg_3=arg_3,
                                 marker_obj=arg_4, join_dns=True,
                                 join_routes=True, join_pool=True, **arg_5)
    for arg_8 in arg_7:
        arg_9 = arg_8.get("_allocation_pool_cache")
        if not arg_9:
            db_api.subnet_update_set_alloc_pool_cache(
                arg_0, arg_8, arg_8.allocation_pools)
    return v._make_subnets_list(arg_7, arg_6=arg_6)


def Func(arg_0, arg_1):
        """
        Returns location data.

        http://dev.wheniwork.com/#get-existing-location
        """
        arg_2 = "/2/locations/%s" % arg_1

        return arg_0.location_from_json(arg_0._get_resource(arg_2)["location"])


return [g for g in groups if len(g) > 0]

def Func ( arg_0 , arg_1 = 40 , arg_2 = None ) : arg_3 = ( arg_0 . oshape . translate ( - arg_0 . pad ) if arg_2 is None else util . Tile ( arg_2 [ 0 ] , arg_2 [ 1 ] ) ) arg_4 = util . Tile ( arg_1 , dim = arg_0 . dim ) arg_5 = np . ceil ( arg_3 . shape . astype ( 'float' ) / arg_4 . shape ) arg_6 = util . Tile ( arg_5 ) . coords ( form = 'vector' ) arg_6 = arg_6 . reshape ( - 1 , arg_6 . shape [ - 1 ] ) arg_7 = [ ] arg_8 = arg_0 . obj_get_positions ( ) for arg_9 in arg_6 : arg_10 = arg_4 . copy ( ) . translate ( arg_4 . shape * arg_9 - arg_0 . pad ) arg_7 . append ( find_particles_in_tile ( arg_8 , arg_10 ) ) return [ arg_11 for arg_11 in arg_7 if len ( arg_11 ) > 0 ]

def Func(arg_0, arg_1=40, arg_2=None):
    """
    Given a state, returns a list of groups of particles. Each group of
    particles are located near each other in the image. Every particle
    located in the desired region is contained in exactly 1 group.

    Parameters:
    -----------
    s : state
        The PERI state to find particles in.

    region_size: int or list of ints
        The size of the box. Groups particles into boxes of shape region_size.
        If region_size is a scalar, the box is a cube of length region_size.
        Default is 40.

    bounds: 2-element list-like of 3-element lists.
        The sub-region of the image over which to look for particles.
            bounds[0]: The lower-left  corner of the image region.
            bounds[1]: The upper-right corner of the image region.
        Default (None -> ([0,0,0], s.oshape.shape)) is a box of the entire
        image size, i.e. the default places every particle in the image
        somewhere in the groups.

    Returns:
    -----------
    particle_groups: list
        Each element of particle_groups is an int numpy.ndarray of the
        group of nearby particles. Only contains groups with a nonzero
        number of particles, so the elements don't necessarily correspond
        to a given image region.
    """
    arg_3 = (
        arg_0.oshape.translate(-arg_0.pad) if arg_2 is None else
        util.Tile(arg_2[0], arg_2[1])
    )

    # does all particle including out of image, is that correct?
    arg_4 = util.Tile(arg_1, dim=arg_0.dim)
    arg_5 = np.ceil(arg_3.shape.astype('float') / arg_4.shape)

    arg_6 = util.Tile(arg_5).coords(form='vector')
    arg_6 = arg_6.reshape(-1, arg_6.shape[-1])

    arg_7 = []
    arg_8 = arg_0.obj_get_positions()
    for arg_9 in arg_6:
        arg_10 = arg_4.copy().translate(arg_4.shape * arg_9 - arg_0.pad)
        arg_7.append(find_particles_in_tile(arg_8, arg_10))

    return [arg_11 for arg_11 in arg_7 if len(arg_11) > 0]

Given a state returns a list of groups of particles . Each group of particles are located near each other in the image . Every particle located in the desired region is contained in exactly 1 group .


def Func ( arg_0 , arg_1 ) : if not os . path . isfile ( arg_1 ) : return DotDict ( ) arg_2 = get_config_module ( arg_1 ) return arg_2 . filter ( arg_0 )

def Func(arg_0, arg_1):
    """Return a config subset using the filter defined in the deploy config."""
    if not os.path.isfile(arg_1):
        return DotDict()
    arg_2 = get_config_module(arg_1)
    return arg_2.filter(arg_0)

Return a config subset using the filter defined in the deploy config .


def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return None arg_0 = to_datetime ( arg_0 ) if arg_0 . tzinfo is None : arg_0 = arg_0 . replace ( tzinfo = localtz ) return arg_0 . astimezone ( arg_1 or utc )

def Func(arg_0, arg_1=None):
    """
    Return a date, time, or datetime converted to a datetime in the given timezone. If when is a
    datetime and has no timezone it is assumed to be local time. Date and time objects are also
    assumed to be UTC. The tz value defaults to UTC. Raise TypeError if when cannot be converted to
    a datetime.
    """
    if arg_0 is None:
        return None
    arg_0 = to_datetime(arg_0)
    if arg_0.tzinfo is None:
        arg_0 = arg_0.replace(tzinfo=localtz)
    return arg_0.astimezone(arg_1 or utc)

Return a date time or datetime converted to a datetime in the given timezone . If when is a datetime and has no timezone it is assumed to be local time . Date and time objects are also assumed to be UTC . The tz value defaults to UTC . Raise TypeError if when cannot be converted to a datetime .


def Func(arg_0):
  """Parse the command line for overriding the defaults"""
  arg_1 = dict()
  for arg_2 in arg_0:
    arg_3 = arg_2.split("=")
    if len(arg_3) != 2:
      raise Exception("Invalid config property format (%s) expected key=value" % arg_2)
    if arg_3[1] in ['true', 'True', 'TRUE']:
      arg_1[arg_3[0]] = True
    elif arg_3[1] in ['false', 'False', 'FALSE']:
      arg_1[arg_3[0]] = False
    else:
      arg_1[arg_3[0]] = arg_3[1]
  return arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = { 'Content-Type' : 'application/x-www-form-urlencoded' } arg_3 = { 'action' : 'award' } arg_4 = 'bids/{}' . format ( arg_1 ) arg_5 = make_put_request ( arg_0 , arg_4 , arg_2 = arg_2 , params_data = arg_3 ) arg_6 = arg_5 . json ( ) if arg_5 . status_code == 200 : return arg_6 [ 'status' ] else : arg_6 = arg_5 . json ( ) raise BidNotAwardedException ( message = arg_6 [ 'message' ] , error_code = arg_6 [ 'error_code' ] , request_id = arg_6 [ 'request_id' ] )

def Func(arg_0, arg_1):
    """
    Award a bid on a project
    """
    arg_2 = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    arg_3 = {
        'action': 'award'
    }
    # POST /api/projects/0.1/bids/{bid_id}/?action=award
    arg_4 = 'bids/{}'.format(arg_1)
    arg_5 = make_put_request(arg_0, arg_4, arg_2=arg_2,
                                params_data=arg_3)
    arg_6 = arg_5.json()
    if arg_5.status_code == 200:
        return arg_6['status']
    else:
        arg_6 = arg_5.json()
        raise BidNotAwardedException(
            message=arg_6['message'],
            error_code=arg_6['error_code'],
            request_id=arg_6['request_id']
        )


def Func ( arg_0 , arg_1 , arg_2 = arg_3 ( 'inf' ) ) : arg_4 = [ ] for arg_5 in arg_0 : if os . name == 'nt' and CYGPATH_RE . match ( arg_5 ) : arg_5 = convert_cygwin_path ( arg_5 ) if os . path . isdir ( arg_5 ) : for arg_6 , arg_7 , arg_8 in walk_depth ( arg_5 , arg_2 ) : for arg_9 in arg_8 : if arg_9 . lower ( ) . endswith ( arg_1 ) : arg_4 . append ( os . path . join ( arg_6 , arg_9 ) ) elif os . path . isfile ( arg_5 ) and arg_5 . lower ( ) . endswith ( arg_1 ) : arg_4 . append ( arg_5 ) return arg_4

def Func(arg_0, arg_1, arg_2=arg_3('inf')):
	"""Get filepaths with supported extensions from given filepaths.

	Parameters:
		filepaths (list or str): Filepath(s) to check.

		supported_extensions (tuple or str): Supported file extensions or a single file extension.

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

	Returns:
		A list of supported filepaths.
	"""

	arg_4 = []

	for arg_5 in arg_0:
		if os.name == 'nt' and CYGPATH_RE.match(arg_5):
			arg_5 = convert_cygwin_path(arg_5)

		if os.path.isdir(arg_5):
			for arg_6, arg_7, arg_8 in walk_depth(arg_5, arg_2):
				for arg_9 in arg_8:
					if arg_9.lower().endswith(arg_1):
						arg_4.append(os.path.join(arg_6, arg_9))
		elif os.path.isfile(arg_5) and arg_5.lower().endswith(arg_1):
			arg_4.append(arg_5)

	return arg_4

Get filepaths with supported extensions from given filepaths .


def
Func
(
*
arg_0
)
:
assert
len
(
arg_0
)
>
0
,
'at least one argument is required'
if
len
(
arg_0
)
==
1
:
arg_1
=
arg_0
[
0
]
else
:
arg_1
=
arg_0
def
checker
(
arg_2
)
:
if
arg_2
not
in
arg_1
:
raise
ValueError
(
arg_2
)
return
checker

def Func(*arg_0):
    """
    Return a value check function which raises a value error if the value is not
    in a pre-defined Func of values.

    If you pass in a list, tuple or set as the single argument, it is assumed
    that the list/tuple/set defines the membership of the Func.

    If you pass in more than on argument, it is assumed the arguments themselves
    define the Func.

    """

    assert len(arg_0) > 0, 'at least one argument is required'
    if len(arg_0) == 1:
        # assume the first argument defines the membership
        arg_1 = arg_0[0]
    else:
        # assume the arguments are the members
        arg_1 = arg_0
    def checker(arg_2):
        if arg_2 not in arg_1:
            raise ValueError(arg_2)
    return checker

Return a value check function which raises a value error if the value is not
    in a pre-defined enumeration of values.

    If you pass in a list, tuple or set as the single argument, it is assumed
    that the list/tuple/set defines the membership of the enumeration.

    If you pass in more than on argument, it is assumed the arguments themselves
    define the enumeration.

Return a value check function which raises a value error if the value is not in a pre - defined enumeration of values .


def Func ( arg_0 ) : if arg_0 . template_folder is not None : return FileSystemLoader ( os . path . join ( arg_0 . root_path , arg_0 . template_folder ) )

def Func(arg_0):
        """The Jinja loader for this package bound object.

        .. versionadded:: 0.5
        """
        if arg_0.template_folder is not None:
            return FileSystemLoader(os.path.join(arg_0.root_path,
                                                 arg_0.template_folder))

The Jinja loader for this package bound object .


def Func(arg_0):
        """
        Starts Cloud SQL Proxy.

        You have to remember to stop the proxy if you started it!
        """
        arg_0._download_sql_proxy_if_needed()
        if arg_0.sql_proxy_process:
            raise AirflowException("The sql proxy is already running: {}".format(
                arg_0.sql_proxy_process))
        else:
            arg_1 = [arg_0.sql_proxy_path]
            arg_1.extend(arg_0.command_line_parameters)
            try:
                arg_0.log.info("Creating directory %s",
                              arg_0.cloud_sql_proxy_socket_directory)
                os.makedirs(arg_0.cloud_sql_proxy_socket_directory)
            except OSError:
                # Needed for python 2 compatibility (exists_ok missing)
                pass
            arg_1.extend(arg_0._get_credential_parameters())
            arg_0.log.info("Running the command: `%s`", " ".join(arg_1))
            arg_0.sql_proxy_process = Popen(arg_1,
                                           stdin=PIPE, stdout=PIPE, stderr=PIPE)
            arg_0.log.info("The pid of cloud_sql_proxy: %s", arg_0.sql_proxy_process.pid)
            while True:
                arg_3 = arg_0.sql_proxy_process.stderr.readline().decode('utf-8')
                arg_4 = arg_0.sql_proxy_process.poll()
                if arg_3 == '' and arg_4 is not None:
                    arg_0.sql_proxy_process = None
                    raise AirflowException(
                        "The cloud_sql_proxy finished early with return code {}!".format(
                            arg_4))
                if arg_3 != '':
                    arg_0.log.info(arg_3)
                if "googleapi: Error" in arg_3 or "invalid instance name:" in arg_3:
                    arg_0.stop_proxy()
                    raise AirflowException(
                        "Error when starting the cloud_sql_proxy {}!".format(
                            arg_3))
                if "Ready for new connections" in arg_3:
                    return


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_2
=
arg_2
or
arg_0
.
current_page_context
arg_3
=
arg_0
.
resolve_var
if
not
isinstance
(
arg_1
,
MODEL_TREE_ITEM_CLASS
)
:
arg_1
=
arg_3
(
arg_1
,
arg_2
)
arg_4
=
arg_0
.
_items_urls
.
get
(
arg_1
)
if
arg_4
is
not
:
return
arg_4
if
arg_1
.
urlaspattern
:
Func
=
arg_1
.
url
arg_6
=
Func
arg_7
=
[
]
if
' '
in
Func
:
arg_6
=
Func
.
split
(
' '
)
for
arg_8
in
arg_6
[
1
:
]
:
arg_9
=
arg_3
(
arg_8
)
arg_7
.
append
(
'"%s"'
%
arg_9
)
arg_6
=
arg_6
[
0
]
.
strip
(
'"\' '
)
arg_10
=
"'%s' %s"
%
(
arg_6
,
' '
.
join
(
arg_7
)
)
else
:
arg_10
=
'%s'
%
arg_1
.
url
if
arg_1
.
urlaspattern
:
arg_11
=
'url %s as item.url_resolved'
%
arg_10
url_tag
(
Parser
(
)
,
Token
(
token_type
=
TOKEN_BLOCK
,
contents
=
arg_11
)
)
.
render
(
arg_2
)
arg_4
=
arg_2
[
'item.url_resolved'
]
or
UNRESOLVED_ITEM_MARKER
else
:
arg_4
=
arg_10
arg_0
.
_items_urls
[
arg_1
]
=
arg_4
return
arg_4

def Func(arg_0, arg_1, arg_2=None):
        """Resolves item's URL.

        :param TreeItemBase sitetree_item: TreeItemBase heir object, 'url' property of which
            is processed as URL pattern or simple URL.

        :param Context context:

        :rtype: str|unicode
        """
        arg_2 = arg_2 or arg_0.current_page_context
        arg_3 = arg_0.resolve_var

        if not isinstance(arg_1, MODEL_TREE_ITEM_CLASS):
            arg_1 = arg_3(arg_1, arg_2)

        arg_4 = arg_0._items_urls.get(arg_1)
        if arg_4 is not None:
            return arg_4

        # Resolve only if item's URL is marked as pattern.
        if arg_1.urlaspattern:
            Func = arg_1.url
            arg_6 = Func
            arg_7 = []

            if ' ' in Func:
                arg_6 = Func.split(' ')
                # We should try to resolve URL parameters from site tree item.
                for arg_8 in arg_6[1:]:
                    arg_9 = arg_3(arg_8)
                    # We enclose arg in double quotes as already resolved.
                    arg_7.append('"%s"' % arg_9)

                arg_6 = arg_6[0].strip('"\' ')

            arg_10 = "'%s' %s" % (arg_6, ' '.join(arg_7))

        else:
            arg_10 = '%s' % arg_1.url

        if arg_1.urlaspattern:
            # Form token to pass to Django 'url' tag.
            arg_11 = 'url %s as item.url_resolved' % arg_10
            url_tag(
                Parser(None),
                Token(token_type=TOKEN_BLOCK, contents=arg_11)
            ).render(arg_2)

            arg_4 = arg_2['item.url_resolved'] or UNRESOLVED_ITEM_MARKER

        else:
            arg_4 = arg_10

        arg_0._items_urls[arg_1] = arg_4

        return arg_4


return self.apply(func, pure, state).unwrap()

def Func(arg_0, arg_1, arg_2):
        # type: (S, Iterable[B]) -> T
        '''Sets all the foci within `state` to values taken from `iterable`.

        Requires kind Setter. This method will raise TypeError when the
        optic has no way to set foci.
        '''
        if not arg_0._is_kind(Setter):
            raise TypeError('Must be an instance of Setter to .Func()')

        arg_3 = iter(arg_2)
        arg_4 = lambda a: Identity(a)
        arg_5 = lambda a: Identity(next(arg_3))
        return arg_0.apply(arg_5, arg_4, arg_1).unwrap()

Sets all the foci within state to values taken from iterable .


def Func(arg_0):
        """
        Set this email address as the user's primary email.
        """
        arg_1 = EmailAddress.objects.filter(arg_2=True, user=arg_0.user)
        arg_1 = arg_1.exclude(pk=arg_0.pk)

        # The transaction is atomic so there is never a gap where a user
        # has no primary email address.
        with transaction.atomic():
            arg_1.update(arg_2=False)

            arg_0.is_primary = True
            arg_0.save()

        logger.info(
            "Set %s as the primary email address for %s.",
            arg_0.email,
            arg_0.user,
        )

Set this email address as the user s primary email .


(self, deletion_dataset_table,
                         ignore_if_missing=False)

def Func(arg_0, arg_1,
                         arg_2=False):
        """
        Delete an existing table from the dataset;
        If the table does not exist, return an error unless ignore_if_missing
        is set to True.

        :param deletion_dataset_table: A dotted
            ``(<project>.|<project>:)<dataset>.<table>`` that indicates which table
            will be deleted.
        :type deletion_dataset_table: str
        :param ignore_if_missing: if True, then return success even if the
            requested table does not exist.
        :type ignore_if_missing: bool
        :return:
        """
        arg_3, arg_4, arg_5 = \
            _split_tablename(table_input=arg_1,
                             default_project_id=arg_0.project_id)

        try:
            arg_0.service.tables() \
                .delete(projectId=arg_3,
                        datasetId=arg_4,
                        tableId=arg_5) \
                .execute(num_retries=arg_0.num_retries)
            arg_0.log.info('Deleted table %s:%s.%s.', arg_3,
                          arg_4, arg_5)
        except HttpError:
            if not arg_2:
                raise Exception('Table deletion failed. Table does not exist.')
            else:
                arg_0.log.info('Table does not exist. Skipping.')

Delete an existing table from the dataset ; If the table does not exist return an error unless ignore_if_missing is set to True .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_0 . walk_files_info ( ) : if arg_3 [ 'id' ] == arg_1 : return arg_2 return None

def Func(arg_0, arg_1):
        """
        Given an id, get the corresponding file info relative path joined with file name.

        Parameters:
            #. id (string): The file unique id string.

        :Returns:
            #. relativePath (string): The file relative path joined with file name.
               If None, it means file was not found.
        """
        for arg_2, arg_3 in arg_0.walk_files_info():
            if arg_3['id']==arg_1:
                return arg_2
        # none was found
        return None

Given an id get the corresponding file info relative path joined with file name .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    '''Calculates the autocorr of mag series for specific lag.

    This version of the function is taken from: Kim et al. (`2011
    <https://dx.doi.org/10.1088/0004-637X/735/2/68>`_)

    Parameters
    ----------

    mags : np.array
        This is the magnitudes array. MUST NOT have any nans.

    lag : float
        The specific lag value to calculate the auto-correlation for. This MUST
        be less than total number of observations in `mags`.

    maglen : int
        The number of elements in the `mags` array.

    magmed : float
        The median of the `mags` array.

    magstd : float
        The standard deviation of the `mags` array.

    Returns
    -------

    float
        The auto-correlation at this specific `lag` value.

    '''

    arg_5 = nparange(1,arg_2-arg_1)
    arg_6 = (arg_0[arg_5] - arg_3) * (arg_0[arg_5+arg_1] - arg_3)
    arg_7 = (1.0/((arg_2 - arg_1)*arg_4)) * npsum(arg_6)

    return arg_7

Calculates the autocorr of mag series for specific lag .


return Interval(self._begin + time, self._end + time)

def Func ( arg_0 , arg_1 : arg_2 ) -> 'Interval' : return Interval ( arg_0 . _begin + arg_1 , arg_0 . _end + arg_1 )

def Func(arg_0, arg_1: arg_2) -> 'Interval':
        """Return a new interval Funced by `time` from self

        Args:
            time: time to be Funced

        Returns:
            Interval: interval Funced by `time`
        """
        return Interval(arg_0._begin + arg_1, arg_0._end + arg_1)

Return a new interval shifted by `time` from self

        Args:
            time: time to be shifted

        Returns:
            Interval: interval shifted by `time`

Return a new interval shifted by time from self


def Func(arg_0, arg_1=0., arg_2=1., arg_3=100., arg_4='linear', arg_5=0):
    r"""Evaluate a Func signal at time t.

    A Func signal is a frequency swept cosine wave.

    .. math:: a = \pi  (f_1 - f_0) / t_1
    .. math:: b = 2  \pi  f_0
    .. math:: y = \cos\left( \pi\frac{f_1-f_0}{t_1}  t^2 + 2\pi f_0 t + \rm{phase} \right)

    :param array t: times at which to evaluate the Func signal
    :param float f0: frequency at time t=0 (Hz)
    :param float t1: time t1
    :param float f1: frequency at time t=t1 (Hz)
    :param str form: shape of frequency sweep in ['linear', 'quadratic', 'logarithmic']
    :param float phase: phase shift at t=0

    The parameter **form** can be:

        * 'linear'      :math:`f(t) = (f_1-f_0)(t/t_1) + f_0`
        * 'quadratic'   :math:`f(t) = (f_1-f_0)(t/t_1)^2 + f_0`
        * 'logarithmic' :math:`f(t) = (f_1-f_0)^{(t/t_1)} + f_0`

    Example:

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import Func
        from pylab import linspace, plot
        t = linspace(0, 1, 1000)
        y = Func(t, form='linear')
        plot(y)
        y = Func(t, form='quadratic')
        plot(y, 'r')

    """
    arg_6 = ['linear', 'quadratic', 'logarithmic']
    if arg_4 not in arg_6:
        raise ValueError("Invalid form. Valid form are %s"
            % arg_6)
    arg_0 = numpy.array(arg_0)
    arg_5 = 2. * pi * arg_5 / 360.
    if arg_4 == "linear":
        arg_7 = pi * (arg_3 - arg_1)/arg_2
        arg_8 = 2. * pi * arg_1
        arg_9 = numpy.cos(arg_7 * arg_0**2 + arg_8*arg_0 + arg_5)
    elif arg_4 == "quadratic":
        arg_7 = (2/3. * pi * (arg_3-arg_1)/arg_2/arg_2)
        arg_8 = 2. * pi * arg_1
        arg_9 = numpy.cos(arg_7*arg_0**3 + arg_8 * arg_0 + arg_5)
    elif arg_4 == "logarithmic":
        arg_7 = 2. * pi * arg_2/numpy.log(arg_3-arg_1)
        arg_8 = 2. * pi * arg_1
        arg_10 = (arg_3-arg_1)**(1./arg_2)
        arg_9 = numpy.cos(arg_7 * arg_10**arg_0 + arg_8 * arg_0 + arg_5)

    return arg_9

r"""Evaluate a chirp signal at time t.

    A chirp signal is a frequency swept cosine wave.

    .. math:: a = \pi  (f_1 - f_0) / t_1
    .. math:: b = 2  \pi  f_0
    .. math:: y = \cos\left( \pi\frac{f_1-f_0}{t_1}  t^2 + 2\pi f_0 t + \rm{phase} \right)

    :param array t: times at which to evaluate the chirp signal
    :param float f0: frequency at time t=0 (Hz)
    :param float t1: time t1
    :param float f1: frequency at time t=t1 (Hz)
    :param str form: shape of frequency sweep in ['linear', 'quadratic', 'logarithmic']
    :param float phase: phase shift at t=0

    The parameter **form** can be:

        * 'linear'      :math:`f(t) = (f_1-f_0)(t/t_1) + f_0`
        * 'quadratic'   :math:`f(t) = (f_1-f_0)(t/t_1)^2 + f_0`
        * 'logarithmic' :math:`f(t) = (f_1-f_0)^{(t/t_1)} + f_0`

    Example:

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import chirp
        from pylab import linspace, plot
        t = linspace(0, 1, 1000)
        y = chirp(t, form='linear')
        plot(y)
        y = chirp(t, form='quadratic')
        plot(y, 'r')


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = weighted_sampler ( arg_0 , arg_1 ) return [ arg_3 ( ) for arg_4 in range ( arg_2 ) ]

def Func(arg_0, arg_1, arg_2):
    """Pick n samples from seq at random, with replacement, with the
    probability of each element in proportion to its corresponding
    weight."""
    arg_3 = weighted_sampler(arg_0, arg_1)
    return [arg_3() for arg_4 in range(arg_2)]

Pick n samples from seq at random with replacement with the probability of each element in proportion to its corresponding weight .


def Func ( arg_0 ) : if arg_0 . _tn + arg_0 . _fp == 0 : return float ( 'NaN' ) return arg_0 . _tn / ( arg_0 . _tn + arg_0 . _fp )

def Func(arg_0):
        r"""Return Func.

        Specificity is defined as :math:`\frac{tn}{tn + fp}`

        AKA true negative rate (TNR)

        Cf. https://en.wikipedia.org/wiki/Specificity_(tests)

        Returns
        -------
        float
            The Func of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        0.75

        """
        if arg_0._tn + arg_0._fp == 0:
            return float('NaN')
        return arg_0._tn / (arg_0._tn + arg_0._fp)

r"""Return specificity.

        Specificity is defined as :math:`\frac{tn}{tn + fp}`

        AKA true negative rate (TNR)

        Cf. https://en.wikipedia.org/wiki/Specificity_(tests)

        Returns
        -------
        float
            The specificity of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.specificity()
        0.75


(f_pass1, f_stop1, f_stop2, f_pass2, Ripple_pass, Atten_stop,
            fs = 1.00, ftype = 'butter')

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
1.00
,
arg_7
=
'butter'
)
:
arg_8
,
arg_9
=
signal
.
iirdesign
(
[
2
*
float
(
arg_0
)
/
arg_6
,
2
*
float
(
arg_3
)
/
arg_6
]
,
[
2
*
float
(
arg_1
)
/
arg_6
,
2
*
float
(
arg_2
)
/
arg_6
]
,
arg_4
,
arg_5
,
arg_7
=
arg_7
,
output
=
'ba'
)
arg_10
=
signal
.
iirdesign
(
[
2
*
float
(
arg_0
)
/
arg_6
,
2
*
float
(
arg_3
)
/
arg_6
]
,
[
2
*
float
(
arg_1
)
/
arg_6
,
2
*
float
(
arg_2
)
/
arg_6
]
,
arg_4
,
arg_5
,
arg_7
=
arg_7
,
output
=
'sos'
)
arg_11
=
'IIR '
+
arg_7
+
' order'
print
(
'%s = %d.'
%
(
arg_11
,
len
(
arg_9
)
1
)
)
return
arg_8
,
arg_9
,
arg_10

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
            arg_6 = 1.00, arg_7 = 'butter'):
    """
    Design an IIR bandstop filter using scipy.signal.iirdesign.
    The filter order is determined based on
    f_pass Hz, f_stop Hz, and the desired stopband attenuation
    d_stop in dB, all relative to a sampling rate of fs Hz.

    Mark Wickert October 2016
    """

    arg_8,arg_9 = signal.iirdesign([2*float(arg_0)/arg_6, 2*float(arg_3)/arg_6],
                           [2*float(arg_1)/arg_6, 2*float(arg_2)/arg_6],
                           arg_4, arg_5,
                           arg_7 = arg_7, output='ba')
    arg_10 = signal.iirdesign([2*float(arg_0)/arg_6, 2*float(arg_3)/arg_6],
                           [2*float(arg_1)/arg_6, 2*float(arg_2)/arg_6],
                           arg_4, arg_5,
                           arg_7 =arg_7, output='sos')
    arg_11 = 'IIR ' + arg_7 + ' order'
    print('%s = %d.' % (arg_11,len(arg_9)-1))
    return arg_8, arg_9, arg_10

Design an IIR bandstop filter using scipy . signal . iirdesign . The filter order is determined based on f_pass Hz f_stop Hz and the desired stopband attenuation d_stop in dB all relative to a sampling rate of fs Hz . Mark Wickert October 2016


def Func(arg_0):
        """
        Fetch all tags for repository from Github.

        :return: tags in repository
        :rtype: list
        """

        arg_1 = arg_0.options.verbose
        arg_2 = arg_0.github
        arg_3 = arg_0.options.user
        arg_4 = arg_0.options.project
        if arg_1:
            print("Fetching tags...")

        arg_5 = []
        arg_6 = 1
        while arg_6 > 0:
            if arg_1 > 2:
                print(".", end="")
            arg_7, arg_8 = arg_2.repos[arg_3][arg_4].tags.get(
                arg_6=arg_6, per_page=PER_PAGE_NUMBER)
            if arg_7 == 200:
                arg_5.extend(arg_8)
            else:
                arg_0.raise_GitHubError(arg_7, arg_8, arg_2.getheaders())
            arg_6 = NextPage(arg_2)
        if arg_1 > 2:
            print(".")

        if len(arg_5) == 0:
            if not arg_0.options.quiet:
                print("Warning: Can't find any tags in repo. Make sure, that "
                      "you push tags to remote repo via 'git push --tags'")
                exit()
        if arg_1 > 1:
            print("Found {} tag(s)".format(len(arg_5)))
        return arg_5

Fetch all tags for repository from Github .


def Func(arg_0):
    """Clears the state of the KNNClassifier."""
    arg_0._Memory = None
    arg_0._numPatterns = 0
    arg_0._M = None
    arg_0._categoryList = []
    arg_0._partitionIdList = []
    arg_0._partitionIdMap = {}
    arg_0._finishedLearning = False
    arg_0._iterationIdx = -1

    # Fixed capacity KNN
    if arg_0.maxStoredPatterns > 0:
      assert arg_0.useSparseMemory, ("Fixed capacity KNN is implemented only "
                                    "in the sparse memory mode")
      arg_0.fixedCapacity = True
      arg_0._categoryRecencyList = []
    else:
      arg_0.fixedCapacity = False

    # Cached value of the store prototype sizes
    arg_0._protoSizes = None

    # Used by PCA
    arg_0._s = None
    arg_0._vt = None
    arg_0._nc = None
    arg_0._mean = None

    # Used by Network Builder
    arg_0._specificIndexTraining = False
    arg_0._nextTrainingIndices = None


def Func(arg_0, arg_1, arg_2):
        """Get it on."""
        arg_3 = []
        try:
            arg_4 = npchoice([1,2], 1, p=[0.8, 0.2])[0] # 20% chance of twins
            for arg_5 in range(arg_4):
                arg_6 = God(arg_1, arg_2)
                arg_3.append(arg_6)
                send_birth_announcement(arg_1, arg_2, arg_6)
        except ValueError:
            print("Breeding error occurred. Likely the generator ran out of names.")

        return arg_3


def Func ( arg_0 , arg_1 ) : if arg_1 == 'minutes' : return list ( map ( lambda x : x * 1.0 / 60 , arg_0 ) ) elif arg_1 == 'hours' : return list ( map ( lambda x : x * 1.0 / ( 60 * 60 ) , arg_0 ) ) elif arg_1 == 'days' : return list ( map ( lambda x : x * 1.0 / ( 24 * 60 * 60 ) , arg_0 ) ) return arg_0

def Func(arg_0, arg_1):
    """
    Convert an array of time durations in seconds to the specified time unit.
    """
    if arg_1 == 'minutes':
        return list(map(lambda x: x * 1.0 / 60, arg_0))
    elif arg_1 == 'hours':
        return list(map(lambda x: x * 1.0 / (60 * 60), arg_0))
    elif arg_1 == 'days':
        return list(map(lambda x: x * 1.0 / (24 * 60 * 60), arg_0))
    return arg_0

Convert an array of time durations in seconds to the specified time unit .


def
Func
(
arg_0
,
arg_1
)
:
@
wraps
(
arg_1
)
def
decorated
(
*
arg_2
,
**
arg_3
)
:
log
.
warn
(
'@Func is deprecated in favor of '
'authorized_response'
)
arg_4
=
arg_0
.
authorized_response
(
)
return
arg_1
(
*
(
(
arg_4
,
)
+
arg_2
)
,
**
arg_3
)
return
decorated

def Func(arg_0, arg_1):
        """Handles an OAuth callback.

        .. versionchanged:: 0.7
           @Func is deprecated in favor of authorized_response.
        """
        @wraps(arg_1)
        def decorated(*arg_2, **arg_3):
            log.warn(
                '@Func is deprecated in favor of '
                'authorized_response'
            )
            arg_4 = arg_0.authorized_response()
            return arg_1(*((arg_4,) + arg_2), **arg_3)
        return decorated

Handles an OAuth callback.

        .. versionchanged:: 0.7
           @authorized_handler is deprecated in favor of authorized_response.


def Func ( arg_0 , arg_1 , Func ) : def end ( arg_3 ) : arg_4 = arg_3 . r * 0.35 arg_0 . _ctx . oval ( arg_3 . x - arg_4 , arg_3 . y - arg_4 , arg_4 * 2 , arg_4 * 2 ) if Func and len ( Func ) > 1 and arg_0 . stroke : arg_0 . _ctx . nofill ( ) arg_0 . _ctx . stroke ( arg_0 . stroke . r , arg_0 . stroke . g , arg_0 . stroke . b , arg_0 . stroke . a ) if arg_0 . name != DEFAULT : arg_0 . _ctx . strokewidth ( arg_0 . strokewidth ) else : arg_0 . _ctx . strokewidth ( arg_0 . strokewidth * 2 ) arg_5 = True for arg_6 in Func : arg_3 = arg_1 [ arg_6 ] if arg_5 : arg_5 = False arg_0 . _ctx . beginpath ( arg_3 . x , arg_3 . y ) end ( arg_3 ) else : arg_0 . _ctx . lineto ( arg_3 . x , arg_3 . y ) arg_0 . _ctx . endpath ( ) end ( arg_3 )

def Func(arg_0, arg_1, Func):

    """ Visualization of a shortest path between two nodes.
    """

    def end(arg_3):
        arg_4 = arg_3.r * 0.35
        arg_0._ctx.oval(arg_3.x-arg_4, arg_3.y-arg_4, arg_4*2, arg_4*2)

    if Func and len(Func) > 1 and arg_0.stroke:

        arg_0._ctx.nofill()
        arg_0._ctx.stroke(
            arg_0.stroke.r,
            arg_0.stroke.g,
            arg_0.stroke.b,
            arg_0.stroke.a
        )
        if arg_0.name != DEFAULT:
            arg_0._ctx.strokewidth(arg_0.strokewidth)
        else:
            arg_0._ctx.strokewidth(arg_0.strokewidth*2)

        arg_5 = True
        for arg_6 in Func:
            arg_3 = arg_1[arg_6]
            if arg_5:
                arg_5 = False
                arg_0._ctx.beginpath(arg_3.x, arg_3.y)
                end(arg_3)
            else:
                arg_0._ctx.lineto(arg_3.x, arg_3.y)
        arg_0._ctx.endpath()
        end(arg_3)

Visualization of a shortest path between two nodes .


return keychr.count('<') == 1 and keychr.count('>') == 1 and \
               keychr[0] == '<' and keychr[-1] == '>'

def Func ( arg_0 ) : if not arg_0 : return False if len ( arg_0 ) == 1 : return True return arg_0 . count ( '<' ) == 1 and arg_0 . count ( '>' ) == 1 and arg_0 [ 0 ] == '<' and arg_0 [ - 1 ] == '>'

def Func(arg_0):
        """Check whether given keyboard character is a single character.

        Parameters: key character which will be checked.
        Returns: True when given key character is a single character.
        """
        if not arg_0:
            return False
        # Regular character case.
        if len(arg_0) == 1:
            return True
        # Tagged character case.
        return arg_0.count('<') == 1 and arg_0.count('>') == 1 and \
               arg_0[0] == '<' and arg_0[-1] == '>'

Check whether given keyboard character is a single character .


def Func ( arg_0 ) : if istype ( arg_0 , sequence_types ) : arg_1 = type ( arg_0 ) return arg_1 ( [ can ( arg_2 ) for arg_2 in arg_0 ] ) else : return arg_0

def Func(arg_0):
    """Can the elements of a sequence."""
    if istype(arg_0, sequence_types):
        arg_1 = type(arg_0)
        return arg_1([can(arg_2) for arg_2 in arg_0])
    else:
        return arg_0


def Func ( arg_0 , * arg_1 ) : arg_0 . _compile ( ) arg_2 = arg_0 . _Func ( * arg_1 ) if arg_0 . _output_keys : return MapDict ( dict ( zip ( arg_0 . _output_keys , arg_2 ) ) ) else : return arg_2

def Func(arg_0, *arg_1):
        """
        Return network output.
        """
        arg_0._compile()
        arg_2 = arg_0._Func(*arg_1)
        if arg_0._output_keys:
            return MapDict(dict(zip(arg_0._output_keys, arg_2)))
        else:
            return arg_2


def Func ( arg_0 , Func , arg_2 = None ) : arg_3 = dict ( ) arg_3 [ 'search' ] = Func if arg_2 : arg_3 [ 'token' ] = arg_2 arg_4 = arg_0 . request ( 'midas.resource.search' , arg_3 ) return arg_4

def Func(arg_0, Func, arg_2=None):
        """
        Get the resources corresponding to a given query.

        :param search: The search criterion.
        :type search: string
        :param token: (optional) The credentials to use when searching.
        :type token: None | string
        :returns: Dictionary containing the search result. Notable is the
            dictionary item 'results', which is a list of item details.
        :rtype: dict
        """
        arg_3 = dict()
        arg_3['search'] = Func
        if arg_2:
            arg_3['token'] = arg_2
        arg_4 = arg_0.request('midas.resource.search', arg_3)
        return arg_4

Get the resources corresponding to a given query .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . columns . values . tolist ( ) arg_4 = [ ] for arg_5 in arg_2 : arg_6 = arg_5 . get ( 'col' ) arg_7 = arg_5 . get ( 'mapping' ) arg_8 = arg_3 . index ( arg_7 . columns [ 0 ] ) arg_1 . insert ( arg_8 , arg_6 , 0 ) arg_9 = arg_7 . index [ arg_7 . index > 0 ] for arg_10 in range ( arg_9 . shape [ 0 ] ) : arg_11 = arg_7 . columns [ arg_10 ] arg_12 = arg_9 [ arg_10 ] arg_1 . loc [ arg_1 [ arg_11 ] == 1 , arg_6 ] = arg_12 arg_4 . append ( arg_11 ) arg_1 . drop ( arg_7 . columns , axis = 1 , inplace = True ) arg_3 = arg_1 . columns . values . tolist ( ) return arg_1

def Func(arg_0, arg_1, arg_2):
        """
        Convert dummy variable into numerical variables

        Parameters
        ----------
        X : DataFrame
        mapping: list-like
              Contains mappings of column to be transformed to it's new columns and value represented

        Returns
        -------
        numerical: DataFrame

        """
        arg_3 = arg_1.columns.values.tolist()
        arg_4 = []
        for arg_5 in arg_2:
            arg_6 = arg_5.get('col')
            arg_7 = arg_5.get('mapping')
            arg_8 = arg_3.index(arg_7.columns[0])

            arg_1.insert(arg_8, arg_6, 0)
            arg_9 = arg_7.index[arg_7.index > 0]
            for arg_10 in range(arg_9.shape[0]):
                arg_11 = arg_7.columns[arg_10]
                arg_12 = arg_9[arg_10]
                arg_1.loc[arg_1[arg_11] == 1, arg_6] = arg_12
                arg_4.append(arg_11)
            arg_1.drop(arg_7.columns, axis=1, inplace=True)
            arg_3 = arg_1.columns.values.tolist()

        return arg_1


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
arg_1
:
arg_1
=
'%s-keplc.pkl'
%
arg_0
[
'objectid'
]
.
replace
(
' '
,
'-'
)
with
open
(
arg_1
,
'wb'
)
as
outfd
:
pickle
.
dump
(
arg_0
,
outfd
,
protocol
=
pickle
.
HIGHEST_PROTOCOL
)
return
os
.
path
.
abspath
(
arg_1
)

def Func(arg_0, arg_1=None):
    '''This writes the `lcdict` to a Python pickle.

    Parameters
    ----------

    lcdict : lcdict
        This is the input `lcdict` to write to a pickle.

    outfile : str or None
        If this is None, the object's Kepler ID/EPIC ID will determined from the
        `lcdict` and used to form the filename of the output pickle file. If
        this is a `str`, the provided filename will be used.

    Returns
    -------

    str
        The absolute path to the written pickle file.

    '''

    if not arg_1:
        arg_1 = '%s-keplc.pkl' % arg_0['objectid'].replace(' ','-')

    # we're using pickle.HIGHEST_PROTOCOL here, this will make Py3 pickles
    # unreadable for Python 2.7
    with open(arg_1,'wb') as outfd:
        pickle.dump(arg_0, outfd, protocol=pickle.HIGHEST_PROTOCOL)

    return os.path.abspath(arg_1)

This writes the lcdict to a Python pickle .


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_1 , "import.zip" ) arg_3 = zipfile . ZipFile ( arg_2 , "w" ) for arg_4 in CSV_FILES : arg_5 = os . path . join ( arg_1 , arg_4 ) if os . path . exists ( arg_5 ) : arg_3 . write ( arg_5 , arg_4 , zipfile . ZIP_DEFLATED ) arg_3 . close ( ) with open ( arg_2 , "rb" ) as f : arg_6 = f . read ( ) return arg_6

def Func(arg_0, arg_1):
        """
        Creates a zip archive from files in path.
        """
        arg_2 = os.path.join(arg_1, "import.zip")
        arg_3 = zipfile.ZipFile(arg_2, "w")

        for arg_4 in CSV_FILES:
            arg_5 = os.path.join(arg_1, arg_4)

            if os.path.exists(arg_5):
                arg_3.write(arg_5, arg_4, zipfile.ZIP_DEFLATED)

        arg_3.close()

        with open(arg_2, "rb") as f:
            arg_6 = f.read()

        return arg_6

Creates a zip archive from files in path .


def Func ( arg_0 ) : arg_1 = urijoin ( arg_0 . base_url , "api" , "json" ) arg_2 = arg_0 . fetch ( arg_1 ) return arg_2 . text

def Func(arg_0):
        """ Retrieve all jobs"""

        arg_1 = urijoin(arg_0.base_url, "api", "json")

        arg_2 = arg_0.fetch(arg_1)
        return arg_2.text


Pad this tile by an equal amount on each side as specified by pad

def Func ( arg_0 , Func ) : arg_2 = arg_0 . copy ( ) arg_2 . l -= Func arg_2 . r += Func return arg_2


def Func ( arg_0 ) : if not arg_0 . option . axis : return - 1 else : return arg_0 . screen . height - ( - arg_0 . minimum * 4.0 / arg_0 . extents * arg_0 . size . y )

def Func(arg_0):
        """Zero crossing value."""
        if not arg_0.option.axis:
            return -1
        else:
            return arg_0.screen.height - (
                -arg_0.minimum * 4.0 / arg_0.extents * arg_0.size.y
            )


(self, os_path=None, skip_sub_command=False,
                    disk_closed_callback=None)

def Func(arg_0, arg_1=None, arg_2=False,
                    arg_3=None):
        """
        A context manager yielding a stderr-suitable file-like object
        based on the optional os_path and optionally skipping any
        configured sub-command.

        :param os_path: Optional path to base the file-like object
            on.
        :param skip_sub_command: Set True to skip any configured
            sub-command filter.
        :param disk_closed_callback: If the backing of the file-like
            object is an actual file that will be closed,
            disk_closed_callback (if set) will be called with the
            on-disk path just after closing it.
        """
        arg_4 = None if arg_2 else arg_0.stderr_sub_command
        arg_5, arg_6 = arg_0._get_out_and_path(
            arg_0.stderr, arg_0.stderr_root, arg_4, arg_1)
        try:
            if hasattr(arg_5, 'stdin'):
                yield arg_5.stdin
            else:
                yield arg_5
        finally:
            if hasattr(arg_5, 'stdin'):
                arg_0._close(arg_5.stdin)
            arg_0._wait(arg_5, arg_6)
            arg_0._close(arg_5)
            if arg_3 and arg_6:
                arg_3(arg_6)

A context manager yielding a stderr - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .


def Func ( arg_0 , arg_1 = False ) : if arg_1 is True : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = lambda : stream_command ( ** arg_3 ) arg_5 = Thread ( arg_4 = arg_4 ) arg_5 . start ( ) arg_2 . append ( arg_5 ) for arg_6 in arg_2 : arg_6 . join ( ) else : for arg_3 in arg_0 : stream_command ( ** arg_3 )

def Func(arg_0, arg_1=False):
    """
    Takes a list of dictionaries with keys corresponding to ``stream_command``
    arguments, and runs all concurrently.

    :param commands: A list of dictionaries, the keys of which should line up
                     with the arguments to ``stream_command`` function.
    :type commands: ``list`` of ``dict``
    :param parallel: If true, commands will be run in parallel.
    :type parallel: ``bool``
    """
    if arg_1 is True:
        arg_2 = []
        for arg_3 in arg_0:
            arg_4 = lambda: stream_command(**arg_3)
            arg_5 = Thread(arg_4=arg_4)
            arg_5.start()
            arg_2.append(arg_5)
        for arg_6 in arg_2:
            arg_6.join()
    else:
        for arg_3 in arg_0:
            stream_command(**arg_3)

Takes a list of dictionaries with keys corresponding to stream_command arguments and runs all concurrently .


def Func(arg_0):
    """Return the ZCA whitening principal components matrix.

    Parameters
    -----------
    x : numpy.array
        Batch of images with dimension of [n_example, row, col, channel] (default).

    Returns
    -------
    numpy.array
        A processed image.

    """
    arg_1 = np.reshape(arg_0, (arg_0.shape[0], arg_0.shape[1] * arg_0.shape[2] * arg_0.shape[3]))
    tl.logging.info("zca : computing sigma ..")
    arg_2 = np.dot(arg_1.T, arg_1) / arg_1.shape[0]
    tl.logging.info("zca : computing U, S and V ..")
    arg_3, arg_4, arg_5 = linalg.svd(arg_2)  # USV
    tl.logging.info("zca : computing principal components ..")
    arg_6 = np.dot(np.dot(arg_3, np.diag(1. / np.sqrt(arg_4 + 10e-7))), arg_3.T)
    return arg_6

Return the ZCA whitening principal components matrix .


def Func ( arg_0 ) : arg_1 = PyFunceble . CONFIGURATION [ "links" ] [ "iana" ] arg_1 = Version ( True ) . right_url_from_version ( arg_1 ) arg_2 = PyFunceble . CURRENT_DIRECTORY + "iana-domains-db.json" if not Version ( True ) . is_cloned ( ) or not PyFunceble . path . isfile ( arg_2 ) : return Download ( arg_1 , arg_2 ) . text ( ) return None

def Func(arg_0):
        """
        Download `iana-domains-db.json` if not present.
        """

        # We initiate the link to the iana configuration.
        # It is not hard coded because this method is called only if we
        # are sure that the configuration file exist.
        arg_1 = PyFunceble.CONFIGURATION["links"]["iana"]

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

        # We set the destination of the downloaded file.
        arg_2 = PyFunceble.CURRENT_DIRECTORY + "iana-domains-db.json"

        if not Version(True).is_cloned() or not PyFunceble.path.isfile(arg_2):
            # The current version is not the cloned version.

            # We Download the link content and return the download status.
            return Download(arg_1, arg_2).text()

        # We are in the cloned version.

        # We do not need to download the file, so we are returning None.
        return None

Download iana - domains - db . json if not present .


def Func ( arg_0 , arg_1 ) : if version_info >= ( 3 , 6 ) : if arg_0 . within_logging_statement ( ) : if any ( isinstance ( arg_2 , FormattedValue ) for arg_2 in arg_1 . values ) : if arg_0 . within_logging_argument ( ) : arg_0 . violations . append ( ( arg_1 , FSTRING_VIOLATION ) ) super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 )

def Func(arg_0, arg_1):
        """
        Process f-string arguments.

        """
        if version_info >= (3, 6):
            if arg_0.within_logging_statement():
                if any(isinstance(arg_2, FormattedValue) for arg_2 in arg_1.values):
                    if arg_0.within_logging_argument():
                        arg_0.violations.append((arg_1, FSTRING_VIOLATION))
                        super(LoggingVisitor, arg_0).generic_visit(arg_1)


(model, gene_list=None, method="fba", solution=None,
                         processes=None, **kwargs)

return _multi_deletion(
        model, 'gene', element_lists=_element_lists(model.genes, gene_list),
        method=method, solution=solution, processes=processes, **kwargs)

def Func(arg_0, arg_1=None, arg_2="fba", arg_3=None,
                         arg_4=None, **arg_5):
    """
    Knock out each gene from a given list.

    Parameters
    ----------
    model : cobra.Model
        The metabolic model to perform deletions in.
    gene_list : iterable
        ``cobra.Gene``s to be deleted. If not passed,
        all the genes from the model are used.
    method: {"fba", "moma", "linear moma", "room", "linear room"}, optional
        Method used to predict the growth rate.
    solution : cobra.Solution, optional
        A previous solution to use as a reference for (linear) MOMA or ROOM.
    processes : int, optional
        The number of parallel processes to run. Can speed up the computations
        if the number of knockouts to perform is large. If not passed,
        will be set to the number of CPUs found.
    kwargs :
        Keyword arguments are passed on to underlying simulation functions
        such as ``add_room``.

    Returns
    -------
    pandas.DataFrame
        A representation of all single gene deletions. The columns are
        'growth' and 'status', where

        index : frozenset([str])
            The gene identifier that was knocked out.
        growth : float
            The growth rate of the adjusted model.
        status : str
            The solution's status.

    """
    return _multi_deletion(
        arg_0, 'gene', element_lists=_element_lists(arg_0.genes, arg_1),
        arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, **arg_5)


def Func(arg_0, **arg_1):
        """
        Check to see if a movie id is already added to a list.

        Args:
            movie_id: The id of the movie.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Check to see if a movie id is already added to a list .


Verify that the ENV defined NVMe device exists

def
Func
(
)
:
if
env
(
)
:
cij
.
err
(
"cij.nvm.Func: Invalid NVMe ENV."
)
return
1
arg_0
=
cij
.
env_to_dict
(
PREFIX
,
EXPORTED
+
REQUIRED
)
arg_1
=
[
'[[ -b "%s" ]]'
%
arg_0
[
"DEV_PATH"
]
]
arg_2
,
arg_3
,
arg_3
=
cij
.
ssh
.
command
(
arg_1
,
shell
=
True
,
echo
=
False
)
return
arg_2

def Func():
    """Verify that the ENV defined NVMe device Func"""

    if env():
        cij.err("cij.nvm.Func: Invalid NVMe ENV.")
        return 1

    arg_0 = cij.env_to_dict(PREFIX, EXPORTED + REQUIRED)

    arg_1 = ['[[ -b "%s" ]]' % arg_0["DEV_PATH"]]
    arg_2, arg_3, arg_3 = cij.ssh.command(arg_1, shell=True, echo=False)

    return arg_2


def Func():
    """
    Populates the global env variables with custom default settings.
    """
    arg_0.ROLES_DIR = ROLE_DIR
    arg_0.services = []
    arg_0.confirm_deployment = False
    arg_0.is_local = None
    arg_0.base_config_dir = '.'
    arg_0.src_dir = 'src' # The path relative to fab where the code resides.
    arg_0.sites = {} # {site:site_settings}
    arg_0[arg_8] = None
    arg_0[arg_9] = None

    arg_0.hosts_retriever = None
    arg_0.hosts_retrievers = type(arg_0)() #'default':lambda hostname: hostname,

    arg_0.hostname_translator = 'default'
    arg_0.hostname_translators = type(arg_0)()
    arg_0.hostname_translators.default = lambda hostname: hostname

    arg_0.default_site = None

    # A list of all site names that should be available on the current host.
    arg_0.available_sites = []

    # A list of all site names per host.
    # {hostname: [sites]}
    # If no entry found, will use available_sites.
    arg_0.available_sites_by_host = {}

    # The command run to determine the percent of disk usage.
    arg_0.disk_usage_command = "df -H | grep -vE '^Filesystem|tmpfs|cdrom|none' | awk '{print $5 " " $1}'"

    arg_0.burlap_data_dir = '.burlap'

    arg_0.setdefault('roledefs', {})
    arg_0.setdefault('roles', [])
    arg_0.setdefault('hosts', [])
    arg_0.setdefault('exclude_hosts', [])

Populates the global env variables with custom default settings .


return self.copy(
            x1=coords_proj[0][0],
            y1=coords_proj[0][1],
            x2=coords_proj[1][0],
            y2=coords_proj[1][1],
            label=self.label)

def Func(arg_0, arg_1, arg_2):
        """
        Project the bounding box onto a differently shaped image.

        E.g. if the bounding box is on its original image at
        x1=(10 of 100 pixels) and y1=(20 of 100 pixels) and is Funced onto
        a new image with size (width=200, height=200), its new position will
        be (x1=20, y1=40). (Analogous for x2/y2.)

        This is intended for cases where the original image is resized.
        It cannot be used for more complex changes (e.g. padding, cropping).

        Parameters
        ----------
        from_shape : tuple of int or ndarray
            Shape of the original image. (Before resize.)

        to_shape : tuple of int or ndarray
            Shape of the new image. (After resize.)

        Returns
        -------
        out : imgaug.BoundingBox
            BoundingBox object with new coordinates.

        """
        arg_3 = Func_coords([(arg_0.x1, arg_0.y1), (arg_0.x2, arg_0.y2)],
                                     arg_1, arg_2)
        return arg_0.copy(
            x1=arg_3[0][0],
            y1=arg_3[0][1],
            x2=arg_3[1][0],
            y2=arg_3[1][1],
            label=arg_0.label)

Project the bounding box onto a differently shaped image.

        E.g. if the bounding box is on its original image at
        x1=(10 of 100 pixels) and y1=(20 of 100 pixels) and is projected onto
        a new image with size (width=200, height=200), its new position will
        be (x1=20, y1=40). (Analogous for x2/y2.)

        This is intended for cases where the original image is resized.
        It cannot be used for more complex changes (e.g. padding, cropping).

        Parameters
        ----------
        from_shape : tuple of int or ndarray
            Shape of the original image. (Before resize.)

        to_shape : tuple of int or ndarray
            Shape of the new image. (After resize.)

        Returns
        -------
        out : imgaug.BoundingBox
            BoundingBox object with new coordinates.

Project the bounding box onto a differently shaped image .


(self, name=None, attrs={}, text=None, **kwargs)

return self._findOne(self.findNextSiblings, name, attrs, text,
                             **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = { } , arg_3 = None , ** arg_4 ) : return arg_0 . _findOne ( arg_0 . Funcs , arg_1 , arg_2 , arg_3 , ** arg_4 )

def Func(arg_0, arg_1=None, arg_2={}, arg_3=None, **arg_4):
        """Returns the closest sibling to this Tag that matches the
        given criteria and appears after this Tag in the document."""
        return arg_0._findOne(arg_0.Funcs, arg_1, arg_2, arg_3,
                             **arg_4)

Returns the closest sibling to this Tag that matches the given criteria and appears after this Tag in the document .


def Func ( arg_0 ) : Func_bytes ( arg_0 . __fileobj , arg_0 . size , arg_0 . offset ) if arg_0 . parent_chunk is not None : arg_0 . parent_chunk . resize ( arg_0 . parent_chunk . data_size - arg_0 . size )

def Func(arg_0):
        """Removes the chunk from the file"""
        Func_bytes(arg_0.__fileobj, arg_0.size, arg_0.offset)
        if arg_0.parent_chunk is not None:
            arg_0.parent_chunk.resize(arg_0.parent_chunk.data_size - arg_0.size)


def Func(arg_0, arg_1, arg_2):
    """Round or extend the fraction to size digs."""
    arg_3 = len(arg_1)
    if arg_3 <= arg_2:
        return arg_0, arg_1 + '0'*(arg_2-arg_3)
    arg_4 = len(arg_0)
    if arg_4+arg_2 < 0:
        return '0'*-arg_2, ''
    arg_5 = arg_0 + arg_1
    arg_6 = arg_5[arg_4+arg_2]
    if arg_6 >= '5': # Hard case: increment last digit, may have carry!
        arg_7 = arg_4 + arg_2 - 1
        while arg_7 >= 0:
            if arg_5[arg_7] != '9': break
            arg_7 = arg_7-1
        else:
            arg_5 = '0' + arg_5
            arg_4 = arg_4+1
            arg_7 = 0
        arg_5 = arg_5[:arg_7] + chr(ord(arg_5[arg_7]) + 1) + '0'*(len(arg_5)-arg_7-1)
        arg_0, arg_1 = arg_5[:arg_4], arg_5[arg_4:]
    if arg_2 >= 0:
        return arg_0, arg_1[:arg_2]
    else:
        return arg_0[:arg_2] + '0'*-arg_2, ''

Round or extend the fraction to size digs .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_0 . linter . msgs_store . list_messages ( ) sys . exit ( 0 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):  # FIXME
        """optik callback for printing available messages"""
        arg_0.linter.msgs_store.list_messages()
        sys.exit(0)


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
_file_paths
=
arg_1
arg_0
.
_file_path_queue
=
[
x
for
x
in
arg_0
.
_file_path_queue
if
x
in
arg_1
]
arg_4
=
{
}
for
arg_5
,
arg_6
in
arg_0
.
_processors
.
items
(
)
:
if
arg_5
in
arg_1
:
arg_4
[
arg_5
]
=
arg_6
else
:
arg_0
.
log
.
warning
(
"Stopping processor for %s"
,
arg_5
)
arg_6
.
terminate
(
)
arg_0
.
_processors
=
arg_4

def Func(arg_0, arg_1):
        """
        Update this with a new set of paths to DAG definition files.

        :param new_file_paths: list of paths to DAG definition files
        :type new_file_paths: list[unicode]
        :return: None
        """
        arg_0._file_paths = arg_1
        arg_0._file_path_queue = [x for x in arg_0._file_path_queue
                                 if x in arg_1]
        # Stop processors that are working on deleted files
        arg_4 = {}
        for arg_5, arg_6 in arg_0._processors.items():
            if arg_5 in arg_1:
                arg_4[arg_5] = arg_6
            else:
                arg_0.log.warning("Stopping processor for %s", arg_5)
                arg_6.terminate()
        arg_0._processors = arg_4

Update this with a new set of paths to DAG definition files .


return llist.l(_FN, vector.vector(arg_list), body)

def
Func
(
arg_0
:
arg_1
)
->
llist
.
List
:
if
arg_0
.
is_in_anon_fn
:
raise
SyntaxError
(
f"Nested #() definitions not allowed"
)
with
arg_0
.
in_anon_fn
(
)
:
arg_2
=
_read_list
(
arg_0
)
arg_3
=
set
(
)
def
arg_suffix
(
arg_4
)
:
if
arg_4
is
:
return
"1"
elif
arg_4
==
"&"
:
return
"rest"
else
:
return
arg_4
def
sym_replacement
(
arg_4
)
:
arg_5
=
arg_suffix
(
arg_4
)
return
symbol
.
symbol
(
f"arg-{suffix}"
)
def
identify_and_replace
(
arg_6
)
:
if
isinstance
(
arg_6
,
symbol
.
Symbol
)
:
if
arg_6
.
ns
is
:
arg_7
=
fn_macro_args
.
match
(
arg_6
.
name
)
if
arg_7
is
not
:
arg_4
=
arg_7
.
group
(
2
)
arg_5
=
arg_suffix
(
arg_4
)
arg_3
.
add
(
arg_5
)
return
sym_replacement
(
arg_4
)
return
arg_6
arg_8
=
walk
.
postwalk
(
identify_and_replace
,
arg_2
)
if
len
(
arg_2
)
>
0
else
arg_9
:
List
[
symbol
.
Symbol
]
=
[
]
arg_10
=
sorted
(
map
(
int
,
filter
(
lambda
k
:
k
!=
"rest"
,
arg_3
)
)
)
if
len
(
arg_10
)
>
0
:
arg_11
=
max
(
arg_10
)
arg_9
=
[
sym_replacement
(
str
(
i
)
)
for
i
in
range
(
1
,
arg_11
+
1
)
]
if
"rest"
in
arg_3
:
arg_9
.
append
(
_AMPERSAND
)
arg_9
.
append
(
sym_replacement
(
"rest"
)
)
return
llist
.
l
(
_FN
,
vector
.
vector
(
arg_9
)
,
arg_8
)

def Func(arg_0: arg_1) -> llist.List:
    """Read a function reader macro from the input stream."""
    if arg_0.is_in_anon_fn:
        raise SyntaxError(f"Nested #() definitions not allowed")

    with arg_0.in_anon_fn():
        arg_2 = _read_list(arg_0)
    arg_3 = set()

    def arg_suffix(arg_4):
        if arg_4 is None:
            return "1"
        elif arg_4 == "&":
            return "rest"
        else:
            return arg_4

    def sym_replacement(arg_4):
        arg_5 = arg_suffix(arg_4)
        return symbol.symbol(f"arg-{suffix}")

    def identify_and_replace(arg_6):
        if isinstance(arg_6, symbol.Symbol):
            if arg_6.ns is None:
                arg_7 = fn_macro_args.match(arg_6.name)
                if arg_7 is not None:
                    arg_4 = arg_7.group(2)
                    arg_5 = arg_suffix(arg_4)
                    arg_3.add(arg_5)
                    return sym_replacement(arg_4)
        return arg_6

    arg_8 = walk.postwalk(identify_and_replace, arg_2) if len(arg_2) > 0 else None

    arg_9: List[symbol.Symbol] = []
    arg_10 = sorted(map(int, filter(lambda k: k != "rest", arg_3)))
    if len(arg_10) > 0:
        arg_11 = max(arg_10)
        arg_9 = [sym_replacement(str(i)) for i in range(1, arg_11 + 1)]
        if "rest" in arg_3:
            arg_9.append(_AMPERSAND)
            arg_9.append(sym_replacement("rest"))

    return llist.l(_FN, vector.vector(arg_9), arg_8)

Read a function reader macro from the input stream .


(message, title="", parent=None, scrolled=False, icon="exclamation")

def Func ( arg_0 , arg_1 = "" , arg_2 = None , arg_3 = False , arg_4 = "exclamation" ) : if not arg_3 : arg_5 = { 'exclamation' : wx . ICON_EXCLAMATION , 'error' : wx . ICON_ERROR , 'question' : wx . ICON_QUESTION , 'info' : wx . ICON_INFORMATION } arg_6 = wx . OK | arg_5 [ arg_4 ] arg_7 = dialogs . messageDialog ( arg_2 , arg_0 , arg_1 , arg_6 ) else : arg_7 = dialogs . scrolledMessageDialog ( arg_2 , arg_0 , arg_1 )

def Func(arg_0, arg_1="", arg_2=None, arg_3=False, arg_4="exclamation"):
    "Show a simple pop-up modal dialog"
    if not arg_3:
        arg_5 = {'exclamation': wx.ICON_EXCLAMATION, 'error': wx.ICON_ERROR,
             'question': wx.ICON_QUESTION, 'info': wx.ICON_INFORMATION}
        arg_6 = wx.OK | arg_5[arg_4]
        arg_7 = dialogs.messageDialog(arg_2, arg_0, arg_1, arg_6)
    else:
        arg_7 = dialogs.scrolledMessageDialog(arg_2, arg_0, arg_1)


def Func ( arg_0 , arg_1 = 3 ) : arg_2 = list ( filter ( lambda w : w . word_id > 0 , arg_0 ) ) arg_3 = len ( arg_2 ) for arg_4 in iter ( range ( 0 , arg_3 - 1 ) ) : arg_5 = arg_2 [ arg_4 ] for arg_6 in iter ( range ( arg_4 + 1 , min ( arg_3 , arg_4 + 1 + arg_1 ) ) ) : arg_7 = arg_2 [ arg_6 ] if ( arg_7 . idx - arg_5 . idx ) <= arg_1 : yield ( arg_5 . root , arg_7 . root , )

def Func (arg_0, arg_1=3):
    """
    generate word pairs for the TextRank graph
    """
    arg_2 = list(filter(lambda w: w.word_id > 0, arg_0))
    arg_3 = len(arg_2)

    for arg_4 in iter(range(0, arg_3 - 1)):
        arg_5 = arg_2[arg_4]

        for arg_6 in iter(range(arg_4 + 1, min(arg_3, arg_4 + 1 + arg_1))):
            arg_7 = arg_2[arg_6]

            if (arg_7.idx - arg_5.idx) <= arg_1:
                yield (arg_5.root, arg_7.root,)