Returns the linescore for the game as a DataFrame.

return pd.DataFrame(data, index=['away', 'home'],
                            columns=columns, dtype='float')

def Func ( arg_0 ) : arg_1 = arg_0 . get_main_doc ( ) arg_2 = arg_1 ( 'table#line_score' ) arg_3 = [ th . text ( ) for th in arg_2 ( 'tr.thead' ) . items ( 'th' ) ] arg_3 [ 0 ] = 'team_id' arg_4 = [ [ sportsref . utils . flatten_links ( td ) for td in tr ( 'td' ) . items ( ) ] for tr in arg_2 ( 'tr.thead' ) . next_all ( 'tr' ) . items ( ) ] return pd . DataFrame ( arg_4 , index = [ 'away' , 'home' ] , arg_3 = arg_3 , dtype = 'float' )

def Func(arg_0):
        """Returns the Func for the game as a DataFrame."""
        arg_1 = arg_0.get_main_doc()
        arg_2 = arg_1('table#line_score')

        arg_3 = [th.text() for th in arg_2('tr.thead').items('th')]
        arg_3[0] = 'team_id'

        arg_4 = [
            [sportsref.utils.flatten_links(td) for td in tr('td').items()]
            for tr in arg_2('tr.thead').next_all('tr').items()
        ]

        return pd.DataFrame(arg_4, index=['away', 'home'],
                            arg_3=arg_3, dtype='float')

Returns the linescore for the game as a DataFrame .


def Func(arg_0, arg_1):
    """Parses Func tag parameters.

       Six arguments:
           {% Func of someitem for menu template "sitetree/mychildren.html" %}
           Used to render child items of specific site tree 'someitem'
           using template "sitetree/mychildren.html" for menu navigation.

           Basically template argument should contain path to current template itself.

           Allowed navigation types: 1) menu; 2) sitetree.

    """
    arg_2 = arg_1.split_contents()
    arg_3 = detect_clause(arg_0, 'template', arg_2)
    arg_4 = len(arg_2)

    arg_5 = (
        arg_4 == 5 and arg_2[1] == 'of' and arg_2[3] == 'for' and arg_2[4] in ('menu', 'sitetree')
    )
    if arg_5 and arg_3 is not None:
        arg_6 = arg_2[2]
        arg_7 = arg_2[4]
        return FuncNode(arg_6, arg_7, arg_3)
    else:
        raise template.TemplateSyntaxError(
            '%r tag requires six arguments. '
            'E.g. {%% Func of someitem for menu template "sitetree/mychildren.html" %%}.' % arg_2[0])

Parses sitetree_children tag parameters.

       Six arguments:
           {% sitetree_children of someitem for menu template "sitetree/mychildren.html" %}
           Used to render child items of specific site tree 'someitem'
           using template "sitetree/mychildren.html" for menu navigation.

           Basically template argument should contain path to current template itself.

           Allowed navigation types: 1) menu; 2) sitetree.

Parses sitetree_children tag parameters .


def Func(arg_0, arg_1, arg_2):
    """Runs one iteration of the Transformed Kernel.

    Args:
      current_state: `Tensor` or Python `list` of `Tensor`s
        representing the current state(s) of the Markov chain(s),
        _after_ application of `bijector.forward`. The first `r`
        dimensions index independent chains,
        `r = tf.rank(target_log_prob_fn(*current_state))`. The
        `inner_kernel.Func` does not actually use `current_state`,
        rather it takes as input
        `previous_kernel_results.transformed_state` (because
        `TransformedTransitionKernel` creates a copy of the input
        inner_kernel with a modified `target_log_prob_fn` which
        internally applies the `bijector.forward`).
      previous_kernel_results: `collections.namedtuple` containing `Tensor`s
        representing values from previous calls to this function (or from the
        `bootstrap_results` function.)

    Returns:
      next_state: Tensor or Python list of `Tensor`s representing the state(s)
        of the Markov chain(s) after taking exactly one step. Has same type and
        shape as `current_state`.
      kernel_results: `collections.namedtuple` of internal calculations used to
        advance the chain.
    """
    with tf.compat.v1.name_scope(
        name=mcmc_util.make_name(arg_0.name, 'transformed_kernel', 'Func'),
        values=[arg_2]):
      arg_3, arg_4 = arg_0._inner_kernel.Func(
          arg_2.transformed_state,
          arg_2.inner_results)
      arg_5 = (
          arg_3
          if mcmc_util.is_list_like(arg_3) else
          [arg_3])
      arg_6 = arg_0._forward_transform(arg_5)
      arg_7 = (
          arg_6 if mcmc_util.is_list_like(arg_3)
          else arg_6[0])
      arg_4 = TransformedTransitionKernelResults(
          transformed_state=arg_3,
          inner_results=arg_4)
      return arg_7, arg_4

Runs one iteration of the Transformed Kernel.

    Args:
      current_state: `Tensor` or Python `list` of `Tensor`s
        representing the current state(s) of the Markov chain(s),
        _after_ application of `bijector.forward`. The first `r`
        dimensions index independent chains,
        `r = tf.rank(target_log_prob_fn(*current_state))`. The
        `inner_kernel.one_step` does not actually use `current_state`,
        rather it takes as input
        `previous_kernel_results.transformed_state` (because
        `TransformedTransitionKernel` creates a copy of the input
        inner_kernel with a modified `target_log_prob_fn` which
        internally applies the `bijector.forward`).
      previous_kernel_results: `collections.namedtuple` containing `Tensor`s
        representing values from previous calls to this function (or from the
        `bootstrap_results` function.)

    Returns:
      next_state: Tensor or Python list of `Tensor`s representing the state(s)
        of the Markov chain(s) after taking exactly one step. Has same type and
        shape as `current_state`.
      kernel_results: `collections.namedtuple` of internal calculations used to
        advance the chain.

Runs one iteration of the Transformed Kernel .


(f, args, kwargs, buffer_threshold=MAX_BYTES, item_threshold=MAX_ITEMS)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 , arg_5 = arg_6 ) : arg_7 = list ( chain . from_iterable ( serialize_object ( arg , arg_3 , arg_5 ) for arg in arg_1 ) ) arg_8 = sorted ( arg_2 . keys ( ) ) arg_9 = list ( chain . from_iterable ( serialize_object ( arg_2 [ key ] , arg_3 , arg_5 ) for key in arg_8 ) ) arg_10 = dict ( nargs = len ( arg_1 ) , narg_bufs = len ( arg_7 ) , arg_8 = arg_8 ) arg_11 = [ pickle . dumps ( can ( arg_0 ) , PICKLE_PROTOCOL ) ] arg_11 . append ( pickle . dumps ( arg_10 , PICKLE_PROTOCOL ) ) arg_11 . extend ( arg_7 ) arg_11 . extend ( arg_9 ) return arg_11

def Func(arg_0, arg_1, arg_2, arg_3=arg_4, arg_5=arg_6):
    """Pack up a function, args, and kwargs to be sent over the wire.

    Each element of args/kwargs will be canned for special treatment,
    but inspection will not go any deeper than that.

    Any object whose data is larger than `threshold`  will not have their data copied
    (only numpy arrays and bytes/buffers support zero-copy)

    Message will be a list of bytes/buffers of the format:

    [ cf, pinfo, <arg_bufs>, <kwarg_bufs> ]

    With length at least two + len(args) + len(kwargs)
    """
    arg_7 = list(chain.from_iterable(
        serialize_object(arg, arg_3, arg_5) for arg in arg_1))

    arg_8 = sorted(arg_2.keys())
    arg_9 = list(chain.from_iterable(
        serialize_object(arg_2[key], arg_3, arg_5) for key in arg_8))

    arg_10 = dict(nargs=len(arg_1), narg_bufs=len(arg_7), arg_8=arg_8)

    arg_11 = [pickle.dumps(can(arg_0), PICKLE_PROTOCOL)]
    arg_11.append(pickle.dumps(arg_10, PICKLE_PROTOCOL))
    arg_11.extend(arg_7)
    arg_11.extend(arg_9)

    return arg_11

Pack up a function args and kwargs to be sent over the wire .


def Func ( arg_0 , arg_1 , arg_2 ) : OutstationApplication . process_point_value ( 'Func' , arg_1 , arg_2 , None ) return opendnp3 . CommandStatus . SUCCESS

def Func(arg_0, arg_1, arg_2):
        """
            The Master sent a Func command to the Outstation. Handle it.

        :param command: ControlRelayOutputBlock,
                        AnalogOutputInt16, AnalogOutputInt32, AnalogOutputFloat32, or AnalogOutputDouble64.
        :param index: int
        :return: CommandStatus
        """
        OutstationApplication.process_point_value('Func', arg_1, arg_2, None)
        return opendnp3.CommandStatus.SUCCESS

The Master sent a Select command to the Outstation. Handle it.

        :param command: ControlRelayOutputBlock,
                        AnalogOutputInt16, AnalogOutputInt32, AnalogOutputFloat32, or AnalogOutputDouble64.
        :param index: int
        :return: CommandStatus

The Master sent a Select command to the Outstation . Handle it .


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

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

        Raises:
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the CapabilityInformation structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_1_3:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the CapabilityInformation "
                "object.".format(
                    arg_2.value
                )
            )

        super(CapabilityInformation, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.STREAMING_CAPABILITY, arg_6):
            arg_7 = primitives.Boolean(
                tag=arg_3.Tags.STREAMING_CAPABILITY
            )
            arg_7.Func(arg_6, arg_2=arg_2)
            arg_0._streaming_capability = arg_7

        if arg_0.is_tag_next(arg_3.Tags.ASYNCHRONOUS_CAPABILITY, arg_6):
            arg_9 = primitives.Boolean(
                tag=arg_3.Tags.ASYNCHRONOUS_CAPABILITY
            )
            arg_9.Func(
                arg_6,
                arg_2=arg_2
            )
            arg_0._asynchronous_capability = arg_9

        if arg_0.is_tag_next(arg_3.Tags.ATTESTATION_CAPABILITY, arg_6):
            arg_11 = primitives.Boolean(
                tag=arg_3.Tags.ATTESTATION_CAPABILITY
            )
            arg_11.Func(
                arg_6,
                arg_2=arg_2
            )
            arg_0._attestation_capability = arg_11

        if arg_2 >= arg_3.KMIPVersion.KMIP_1_4:
            if arg_0.is_tag_next(
                arg_3.Tags.BATCH_UNDO_CAPABILITY,
                arg_6
            ):
                arg_13 = primitives.Boolean(
                    tag=arg_3.Tags.BATCH_UNDO_CAPABILITY
                )
                arg_13.Func(
                    arg_6,
                    arg_2=arg_2
                )
                arg_0._batch_continue_capability = arg_13

            if arg_0.is_tag_next(
                arg_3.Tags.BATCH_CONTINUE_CAPABILITY,
                arg_6
            ):
                arg_15 = primitives.Boolean(
                    tag=arg_3.Tags.BATCH_CONTINUE_CAPABILITY
                )
                arg_15.Func(
                    arg_6,
                    arg_2=arg_2
                )
                arg_0._batch_continue_capability = arg_15

        if arg_0.is_tag_next(arg_3.Tags.UNWRAP_MODE, arg_6):
            arg_16 = primitives.Enumeration(
                arg_3.UnwrapMode,
                tag=arg_3.Tags.UNWRAP_MODE
            )
            arg_16.Func(arg_6, arg_2=arg_2)
            arg_0._unwrap_mode = arg_16

        if arg_0.is_tag_next(arg_3.Tags.DESTROY_ACTION, arg_6):
            arg_18 = primitives.Enumeration(
                arg_3.DestroyAction,
                tag=arg_3.Tags.DESTROY_ACTION
            )
            arg_18.Func(arg_6, arg_2=arg_2)
            arg_0._destroy_action = arg_18

        if arg_0.is_tag_next(arg_3.Tags.SHREDDING_ALGORITHM, arg_6):
            arg_20 = primitives.Enumeration(
                arg_3.ShreddingAlgorithm,
                tag=arg_3.Tags.SHREDDING_ALGORITHM
            )
            arg_20.Func(arg_6, arg_2=arg_2)
            arg_0._shredding_algorithm = arg_20

        if arg_0.is_tag_next(arg_3.Tags.RNG_MODE, arg_6):
            arg_22 = primitives.Enumeration(
                arg_3.RNGMode,
                tag=arg_3.Tags.RNG_MODE
            )
            arg_22.Func(arg_6, arg_2=arg_2)
            arg_0._rng_mode = arg_22

        arg_0.is_oversized(arg_6)

Read the data encoding the CapabilityInformation structure and decode
        it into its constituent parts.

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

        Raises:
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the CapabilityInformation structure.

Read the data encoding the CapabilityInformation structure and decode it into its constituent parts .


def Func ( arg_0 ) : from . bounds import zero_range arg_1 = min_max ( arg_0 , na_rm = True ) if zero_range ( arg_1 ) : arg_2 = np . abs ( arg_1 [ 0 ] ) else : arg_2 = np . diff ( arg_1 ) [ 0 ] if arg_2 == 0 : return 1 else : return 10 ** int ( np . floor ( np . log10 ( arg_2 ) ) )

def Func(arg_0):
    """
    Return the Func of x

    Parameters
    ----------
    x : array_like | numeric
        Value(s) whose for which to compute the Func.

    Returns
    -------
    out : numeric
        The Func of ``x`` or that the values in ``x``.

    Notes
    -----
    The Func is computed in base 10.

    Examples
    --------
    >>> Func(0.08)
    0.01
    >>> Func(9)
    1
    >>> Func(16)
    10
    """
    from .bounds import zero_range

    arg_1 = min_max(arg_0, na_rm=True)
    if zero_range(arg_1):
        arg_2 = np.abs(arg_1[0])
    else:
        arg_2 = np.diff(arg_1)[0]

    if arg_2 == 0:
        return 1
    else:
        return 10 ** int(np.floor(np.log10(arg_2)))

Return the precision of x

    Parameters
    ----------
    x : array_like | numeric
        Value(s) whose for which to compute the precision.

    Returns
    -------
    out : numeric
        The precision of ``x`` or that the values in ``x``.

    Notes
    -----
    The precision is computed in base 10.

    Examples
    --------
    >>> precision(0.08)
    0.01
    >>> precision(9)
    1
    >>> precision(16)
    10


(self, x, y, w=35, h=35, padding=4, roundness=0, n=12, d=0.035, grouped=None)

def Func(arg_0, arg_1, arg_2, arg_3=35, arg_4=35, arg_5=4, arg_6=0, arg_7=12, arg_8=0.035, arg_9=None):
        """
        Draws a weighted Func with approximately n columns and rows.

        When the grouped parameter is True, colors are grouped in blocks of the same hue
        (also see the _weight_by_hue() method).
        """
        if arg_9 is None:  # should be True or False
            arg_9 = arg_0.group_Funces

        # If we dont't need to make groups,
        # just display an individual column for each weight
        # in the (color, range, weight) tuples.
        if not arg_9:
            arg_10 = sum([arg_13 for arg_11, arg_12, arg_13 in arg_0.ranges])
            for arg_11, arg_12, arg_13 in arg_0.ranges:
                arg_14 = max(1, int(arg_13 / arg_10 * arg_7))
                for arg_15 in _range(arg_14):
                    arg_12.colors(arg_11, arg_7=arg_7, arg_8=arg_8).Func(arg_1, arg_2, arg_3, arg_4, arg_5=arg_5, arg_6=arg_6)
                    arg_1 += arg_3 + arg_5

            return arg_1, arg_2 + arg_7 * (arg_4 + arg_5)

        # When grouped, combine hues and display them
        # in batches of rows, then moving on to the next hue.
        arg_9 = arg_0._weight_by_hue()
        for arg_16, arg_17, arg_18, arg_19 in arg_9:
            arg_20 = arg_2
            arg_21 = 0
            for arg_11, arg_12, arg_22 in arg_19:
                arg_23 = arg_1
                arg_14 = int(arg_17 * arg_7)
                arg_14 = max(1, min(arg_14, arg_7 - len(arg_9)))
                if arg_11.name == "black": arg_12 = arg_12.black
                if arg_11.name == "white": arg_12 = arg_12.white
                for arg_15 in _range(arg_14):
                    arg_24 = int(arg_22 / arg_16 * arg_7)
                    arg_24 = max(1, arg_24)
                    # Each column should add up to n rows,
                    # if not due to rounding errors, add a row at the bottom.
                    if (arg_11, arg_12, arg_22) == arg_19[-1] and arg_21 + arg_24 < arg_7: arg_24 += 1
                    arg_12.colors(arg_11, arg_7=arg_24, arg_8=arg_8).Func(arg_23, arg_20, arg_3, arg_4, arg_5=arg_5, arg_6=arg_6)
                    arg_23 += arg_3 + arg_5
                arg_20 += (arg_3 + arg_5) * arg_24  # + padding
                arg_21 = arg_24
            arg_1 += (arg_3 + arg_5) * arg_14 + arg_5

        return arg_1, arg_20

Draws a weighted swatch with approximately n columns and rows.

        When the grouped parameter is True, colors are grouped in blocks of the same hue
        (also see the _weight_by_hue() method).

Draws a weighted swatch with approximately n columns and rows .


def Func(arg_0):
        """Fetchs all available rows from the cursor."""
        arg_0._check_executed()
        arg_1 = arg_0._fetch_row(0)
        arg_0.rownumber = arg_0.rownumber + len(arg_1)
        arg_0._warning_check()
        return arg_1

Fetchs all available rows from the cursor .


def Func(arg_0, arg_1=None):
    """ Duplicate a layer.

    New layer label is '*_copy'.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        layer_num (int): layer number to Func. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Creates a new layer
        Changes current layer to the new layer

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_2 = '  <filter name="Duplicate Current layer"/>\n'
    if isinstance(arg_0, mlx.FilterScript):
        if (arg_1 is None) or (arg_1 == arg_0.current_layer()):
            util.write_filter(arg_0, arg_2)
            arg_0.add_layer('{}_copy'.format(arg_0.layer_stack[arg_0.current_layer()]), True)
        else:
            change(arg_0, arg_1)
            util.write_filter(arg_0, arg_2)
            arg_0.add_layer('{}_copy'.format(arg_0.layer_stack[arg_1]), True)
    else:
        util.write_filter(arg_0, arg_2)
    return None

Duplicate a layer.

    New layer label is '*_copy'.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        layer_num (int): layer number to duplicate. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Creates a new layer
        Changes current layer to the new layer

    MeshLab versions:
        2016.12
        1.3.4BETA


def
Func
(
arg_0
)
:
arg_1
=
" "
if
arg_0
[
1
]
.
isdigit
(
)
else
arg_0
[
1
]
return
EngPower
(
arg_1
,
_SUFFIX_POWER_DICT
[
arg_1
]
)

def Func(arg_0):
    r"""
    Return engineering suffix and its floating point equivalent of a number.

    :py:func:`peng.peng` lists the correspondence between suffix and floating
    point exponent.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: named tuple in which the first item is the engineering suffix and
            the second item is the floating point equivalent of the suffix
            when the number is represented in engineering notation.

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.Func

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.Func(peng.peng(1235.6789E3, 3, False))
        EngPower(suffix='M', exp=1000000.0)
    """
    arg_1 = " " if arg_0[-1].isdigit() else arg_0[-1]
    return EngPower(arg_1, _SUFFIX_POWER_DICT[arg_1])

r"""
    Return engineering suffix and its floating point equivalent of a number.

    :py:func:`peng.peng` lists the correspondence between suffix and floating
    point exponent.

    :param snum: Number
    :type  snum: :ref:`EngineeringNotationNumber`

    :rtype: named tuple in which the first item is the engineering suffix and
            the second item is the floating point equivalent of the suffix
            when the number is represented in engineering notation.

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.functions.peng_power

    :raises: RuntimeError (Argument \`snum\` is not valid)

    .. [[[end]]]

    For example:

        >>> import peng
        >>> peng.peng_power(peng.peng(1235.6789E3, 3, False))
        EngPower(suffix='M', exp=1000000.0)

r Return engineering suffix and its floating point equivalent of a number .


def Func ( arg_0 = arg_1 ) : arg_2 = quote ( ) arg_3 , arg_4 = many_until ( arg_0 , partial ( one_of , arg_2 ) ) return build_string ( arg_3 )

def Func(arg_0=arg_1):
    """Parses as much as possible until it encounters a matching closing quote.

    By default matches any_token, but can be provided with a more specific parser if required.
    Returns a string
    """
    arg_2 = quote()
    arg_3, arg_4 = many_until(arg_0, partial(one_of, arg_2))
    return build_string(arg_3)

Parses as much as possible until it encounters a matching closing quote . By default matches any_token but can be provided with a more specific parser if required . Returns a string


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
Func
(
len
(
arg_0
.
magic
)
)
if
not
arg_2
:
return
if
arg_2
!=
arg_0
.
magic
:
raise
ValueError
(
'Magic bytes not found! Read data: {}'
.
format
(
arg_2
)
)
arg_3
=
arg_0
.
header
.
_make
(
arg_0
.
header_struct
.
unpack
(
arg_1
.
Func
(
arg_0
.
header_struct
.
size
)
)
)
arg_4
=
numpy
.
fromstring
(
arg_1
.
Func
(
arg_3
.
size
)
,
dtype
=
'float32'
)
return
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1):
        """Read data from file-like object"""
        arg_2 = arg_1.Func(len(arg_0.magic))
        if not arg_2:
            return None
        if arg_2 != arg_0.magic:
            raise ValueError('Magic bytes not found! Read data: {}'.format(arg_2))

        arg_3 = arg_0.header._make(
            arg_0.header_struct.unpack(arg_1.Func(arg_0.header_struct.size))
        )
        arg_4 = numpy.fromstring(arg_1.Func(arg_3.size), dtype='float32')
        return (arg_3, arg_4)


return vaex.remote.ServerRest(hostname, base_path=base_path, port=port, websocket=websocket, **kwargs)

def Func ( arg_0 , ** arg_1 ) : from vaex . remote import ServerRest arg_0 = urlparse ( arg_0 ) if arg_0 . scheme == "ws" : arg_2 = True else : arg_2 = False assert arg_0 . scheme in [ "ws" , "http" ] arg_3 = arg_0 . port arg_4 = arg_0 . path arg_5 = arg_0 . hostname return vaex . remote . ServerRest ( arg_5 , arg_4 = arg_4 , arg_3 = arg_3 , arg_2 = arg_2 , ** arg_1 )

def Func(arg_0, **arg_1):
    """Connect to hostname supporting the vaex web api.

    :param str hostname: hostname or ip address of Func
    :return vaex.dataframe.ServerRest: returns a Func object, note that it does not connect to the Func yet, so this will always succeed
    :rtype: ServerRest
    """
    from vaex.remote import ServerRest
    arg_0 = urlparse(arg_0)
    if arg_0.scheme == "ws":
        arg_2 = True
    else:
        arg_2 = False
    assert arg_0.scheme in ["ws", "http"]
    arg_3 = arg_0.port
    arg_4 = arg_0.path
    arg_5 = arg_0.hostname
    return vaex.remote.ServerRest(arg_5, arg_4=arg_4, arg_3=arg_3, arg_2=arg_2, **arg_1)

Connect to hostname supporting the vaex web api.

    :param str hostname: hostname or ip address of server
    :return vaex.dataframe.ServerRest: returns a server object, note that it does not connect to the server yet, so this will always succeed
    :rtype: ServerRest

Connect to hostname supporting the vaex web api .


def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_3 = { } try : arg_4 = arg_0 . raw_data ( arg_1 ) if isinstance ( arg_4 , dict ) : arg_2 = dict ( [ ( f , dict . fromkeys ( linenos , None ) ) for f , linenos in iitems ( arg_4 . get ( 'lines' , { } ) ) ] ) arg_3 = dict ( [ ( f , dict . fromkeys ( arcpairs , None ) ) for f , arcpairs in iitems ( arg_4 . get ( 'arcs' , { } ) ) ] ) except Exception : pass return arg_2 , arg_3

def Func(arg_0, arg_1):
        """Return the stored coverage data from the given file.

        Returns two values, suitable for assigning to `self.lines` and
        `self.arcs`.

        """
        arg_2 = {}
        arg_3 = {}
        try:
            arg_4 = arg_0.raw_data(arg_1)
            if isinstance(arg_4, dict):
                # Unpack the 'lines' item.
                arg_2 = dict([
                    (f, dict.fromkeys(linenos, None))
                        for f, linenos in iitems(arg_4.get('lines', {}))
                    ])
                # Unpack the 'arcs' item.
                arg_3 = dict([
                    (f, dict.fromkeys(arcpairs, None))
                        for f, arcpairs in iitems(arg_4.get('arcs', {}))
                    ])
        except Exception:
            pass
        return arg_2, arg_3

Return the stored coverage data from the given file .


def Func ( arg_0 ) : arg_1 = ra . standard_normal ( ( arg_0 , arg_0 ) ) arg_1 += arg_1 . T return arg_1 / 2

def Func(arg_0):
    """Creates an NxN element of the Gaussian Orthogonal Ensemble"""
    arg_1 = ra.standard_normal((arg_0,arg_0))
    arg_1 += arg_1.T
    return arg_1/2


(self, panel_id=None, institute_id=None, version=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = { } if arg_1 : arg_4 [ 'panel_name' ] = arg_1 if arg_3 : arg_4 [ 'version' ] = arg_3 if arg_2 : arg_4 [ 'institute' ] = arg_2 return arg_0 . panel_collection . find ( arg_4 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Return all gene panels

        If panel_id return all versions of panels by that panel name

        Args:
            panel_id(str)

        Returns:
            cursor(pymongo.cursor)
        """
        arg_4 = {}
        if arg_1:
            arg_4['panel_name'] = arg_1
            if arg_3:
                arg_4['version'] = arg_3
        if arg_2:
            arg_4['institute'] = arg_2

        return arg_0.panel_collection.find(arg_4)


def Func(arg_0, arg_1):
        '''
        Add widget string to right panel of the screen
        '''
        arg_2 = arg_1.get_index()
        while arg_2 in arg_0.info_widgets.keys():
            arg_2 += 1
        arg_0.info_widgets[arg_1.get_index()] = arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = _count_supplied_tokens ( arg_1 . args [ arg_2 + 1 : ] ) if not arg_3 : return arg_4 = arg_1 . args [ arg_2 ] . value if not isinstance ( arg_4 , str ) : arg_5 = 0 else : try : if arg_0 . _format_style == "old" : arg_6 , arg_5 , arg_7 , arg_7 = utils . parse_format_string ( arg_4 ) if arg_6 : return elif arg_0 . _format_style == "new" : arg_8 , arg_9 , arg_10 = utils . parse_format_method_string ( arg_4 ) arg_11 = len ( set ( k for k , l in arg_8 if not isinstance ( k , int ) ) ) arg_5 = ( arg_11 + arg_9 + arg_10 ) except utils . UnsupportedFormatCharacter as ex : arg_12 = arg_4 [ ex . index ] arg_0 . add_message ( "logging-unsupported-format" , arg_1 = arg_1 , args = ( arg_12 , ord ( arg_12 ) , ex . index ) , ) return except utils . IncompleteFormatString : arg_0 . add_message ( "logging-format-truncated" , arg_1 = arg_1 ) return if arg_3 > arg_5 : arg_0 . add_message ( "logging-too-many-args" , arg_1 = arg_1 ) elif arg_3 < arg_5 : arg_0 . add_message ( "logging-too-few-args" , arg_1 = arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Checks that format string tokens match the supplied arguments.

        Args:
          node (astroid.node_classes.NodeNG): AST node to be checked.
          format_arg (int): Index of the format string in the node arguments.
        """
        arg_3 = _count_supplied_tokens(arg_1.args[arg_2 + 1 :])
        if not arg_3:
            # If no args were supplied the string is not interpolated and can contain
            # formatting characters - it's used verbatim. Don't check any further.
            return
        arg_4 = arg_1.args[arg_2].value
        if not isinstance(arg_4, str):
            # If the log format is constant non-string (e.g. logging.debug(5)),
            # ensure there are no arguments.
            arg_5 = 0
        else:
            try:
                if arg_0._format_style == "old":
                    arg_6, arg_5, arg_7, arg_7 = utils.parse_format_string(
                        arg_4
                    )
                    if arg_6:
                        # Keyword checking on logging strings is complicated by
                        # special keywords - out of scope.
                        return
                elif arg_0._format_style == "new":
                    arg_8, arg_9, arg_10 = utils.parse_format_method_string(
                        arg_4
                    )

                    arg_11 = len(
                        set(k for k, l in arg_8 if not isinstance(k, int))
                    )
                    arg_5 = (
                        arg_11 + arg_9 + arg_10
                    )
            except utils.UnsupportedFormatCharacter as ex:
                arg_12 = arg_4[ex.index]
                arg_0.add_message(
                    "logging-unsupported-format",
                    arg_1=arg_1,
                    args=(arg_12, ord(arg_12), ex.index),
                )
                return
            except utils.IncompleteFormatString:
                arg_0.add_message("logging-format-truncated", arg_1=arg_1)
                return
        if arg_3 > arg_5:
            arg_0.add_message("logging-too-many-args", arg_1=arg_1)
        elif arg_3 < arg_5:
            arg_0.add_message("logging-too-few-args", arg_1=arg_1)

Checks that format string tokens match the supplied arguments .


(self, message, fh=None, prefix="[error]:",
                      suffix="...")

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = "[error]:" , arg_4 = "..." ) : arg_5 = arg_3 + arg_1 + arg_4 arg_2 = arg_2 or sys . stderr if arg_2 is sys . stderr : termcolor . cprint ( arg_5 , color = "red" ) else : arg_2 . write ( arg_5 ) pass

def Func(arg_0, arg_1, arg_2=None, arg_3="[error]:",
                      arg_4="..."):
        """
        print error type message
        if file handle is `sys.stderr`, print color message

        :param str message: message to print
        :param file fh: file handle, default is `sys.stdout`
        :param str prefix: message prefix,default is `[error]`
        :param str suffix: message suffix ,default is '...'
        :return: None
        """

        arg_5 = arg_3 + arg_1 + arg_4
        arg_2 = arg_2 or sys.stderr

        if arg_2 is sys.stderr:
            termcolor.cprint(arg_5, color="red")
        else:
            arg_2.write(arg_5)
        pass

print error type message if file handle is sys . stderr print color message


return Image.composite(layer, im, layer)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 ) : if arg_3 < 1 : arg_1 = reduce_opacity ( arg_1 , arg_3 ) if arg_0 . mode != 'RGBA' : arg_0 = arg_0 . convert ( 'RGBA' ) arg_4 = Image . new ( 'RGBA' , arg_0 . size , ( 0 , 0 , 0 , 0 ) ) if arg_2 == 'tile' : for arg_5 in range ( 0 , arg_0 . size [ 1 ] , arg_1 . size [ 1 ] ) : for arg_6 in range ( 0 , arg_0 . size [ 0 ] , arg_1 . size [ 0 ] ) : arg_4 . paste ( arg_1 , ( arg_6 , arg_5 ) ) elif arg_2 == 'scale' : arg_7 = min ( float ( arg_0 . size [ 0 ] ) / arg_1 . size [ 0 ] , float ( arg_0 . size [ 1 ] ) / arg_1 . size [ 1 ] ) arg_8 = int ( arg_1 . size [ 0 ] * arg_7 ) arg_9 = int ( arg_1 . size [ 1 ] * arg_7 ) arg_1 = arg_1 . resize ( ( arg_8 , arg_9 ) ) arg_4 . paste ( arg_1 , ( int ( ( arg_0 . size [ 0 ] - arg_8 ) / 2 ) , int ( ( arg_0 . size [ 1 ] - arg_9 ) / 2 ) ) ) else : arg_4 . paste ( arg_1 , arg_2 ) return Image . composite ( arg_4 , arg_0 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=1):
    """Adds a Func to an image."""
    if arg_3 < 1:
        arg_1 = reduce_opacity(arg_1, arg_3)
    if arg_0.mode != 'RGBA':
        arg_0 = arg_0.convert('RGBA')
    # create a transparent layer the size of the image and draw the
    # Func in that layer.
    arg_4 = Image.new('RGBA', arg_0.size, (0, 0, 0, 0))
    if arg_2 == 'tile':
        for arg_5 in range(0, arg_0.size[1], arg_1.size[1]):
            for arg_6 in range(0, arg_0.size[0], arg_1.size[0]):
                arg_4.paste(arg_1, (arg_6, arg_5))
    elif arg_2 == 'scale':
        # scale, but preserve the aspect ratio
        arg_7 = min(
            float(arg_0.size[0]) / arg_1.size[0], float(arg_0.size[1]) / arg_1.size[1])
        arg_8 = int(arg_1.size[0] * arg_7)
        arg_9 = int(arg_1.size[1] * arg_7)
        arg_1 = arg_1.resize((arg_8, arg_9))
        arg_4.paste(arg_1, (int((arg_0.size[0] - arg_8) / 2),
                           int((arg_0.size[1] - arg_9) / 2)))
    else:
        arg_4.paste(arg_1, arg_2)
    # composite the Func with the layer
    return Image.composite(arg_4, arg_0, arg_4)


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the value of the Boolean object from the input stream.

        Args:
            istream (Stream): A buffer containing the encoded bytes of the
                value of a Boolean object. Usually a BytearrayStream object.
                Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: if the read boolean value is not a 0 or 1.
        """
        try:
            arg_6 = unpack('!Q', arg_1.read(arg_0.LENGTH))[0]
        except Exception:
            arg_0.logger.error("Error reading boolean value from buffer")
            raise

        if arg_6 == 1:
            arg_0.value = True
        elif arg_6 == 0:
            arg_0.value = False
        else:
            raise ValueError("expected: 0 or 1, observed: {0}".format(arg_6))

        arg_0.validate()

Read the value of the Boolean object from the input stream .


(self, x="x", y="y", z="z", vx="vx", vy="vy", vz="vz", vr="vr", vlong="vlong", vlat="vlat", distance=None)

def Func(arg_0, arg_1="x", arg_2="y", arg_3="z", arg_4="vx", arg_5="vy", arg_6="vz", arg_7="vr", arg_8="vlong", arg_9="vlat", arg_10=None):
        """Concert velocities from a cartesian to a spherical coordinate system

        TODO: errors

        :param x: name of x column (input)
        :param y:         y
        :param z:         z
        :param vx:       vx
        :param vy:       vy
        :param vz:       vz
        :param vr: name of the column for the radial velocity in the r direction (output)
        :param vlong: name of the column for the velocity component in the longitude direction  (output)
        :param vlat: name of the column for the velocity component in the latitude direction, positive points to the north pole (output)
        :param distance: Expression for distance, if not given defaults to sqrt(x**2+y**2+z**2), but if this column already exists, passing this expression may lead to a better performance
        :return:
        """
        # see http://www.astrosurf.com/jephem/library/li110spherCart_en.htm
        if arg_10 is None:
            arg_10 = "sqrt({x}**2+{y}**2+{z}**2)".format(**locals())
        arg_0.add_virtual_column(arg_7, "({x}*{vx}+{y}*{vy}+{z}*{vz})/{distance}".format(**locals()))
        arg_0.add_virtual_column(arg_8, "-({vx}*{y}-{x}*{vy})/sqrt({x}**2+{y}**2)".format(**locals()))
        arg_0.add_virtual_column(arg_9, "-({z}*({x}*{vx}+{y}*{vy}) - ({x}**2+{y}**2)*{vz})/( {distance}*sqrt({x}**2+{y}**2) )".format(**locals()))


def Func ( arg_0 , arg_1 ) : return arg_0 . json_response ( requests . get ( arg_1 , ** arg_0 . requests_kwargs ) )

def Func(arg_0, arg_1):
        """ Perform a request to the fully qualified url and return json. """
        return arg_0.json_response(requests.get(arg_1, **arg_0.requests_kwargs))

Perform a request to the fully qualified url and return json .


def Func(arg_0):
        """Clear contents of general pasteboard.

        Future enhancement can include specifying which clipboard to clear
        Returns: True on success; caller should expect to catch exceptions,
                 probably from AppKit (ValueError)
        """
        arg_1 = 'Request to clear contents of pasteboard: general'
        logging.debug(arg_1)
        arg_2 = AppKit.NSPasteboard.generalPasteboard()
        arg_2.Func()
        return True


(filename, statsInfo, maxSamples = None, filters=[], cache=True)

def Func(arg_0, arg_1, arg_2 = None, arg_3=[], arg_4=True):
  """Generate requested statistics for a dataset and cache to a file.
  If filename is None, then don't cache to a file"""

  # Sanity checking
  if not isinstance(arg_1, dict):
    raise RuntimeError("statsInfo must be a dict -- "
                       "found '%s' instead" % type(arg_1))

  arg_0 = resource_filename("nupic.datafiles", arg_0)

  if arg_4:
    arg_5 = getStatsFilename(arg_0, arg_1, arg_3)
    # Use cached stats if found AND if it has the right data
    if os.path.exists(arg_5):
      try:
        arg_6 = pickle.load(open(arg_5, "rb"))
      except:
        # Ok to ignore errors -- we will just re-generate the file
        print "Warning: unable to load stats for %s -- " \
              "will regenerate" % arg_0
        arg_6 = dict()
      arg_7 = set([s for s in arg_1])
      arg_8 = set(arg_6.keys())
      arg_9 = arg_7.difference(arg_8)
      if len(arg_9 ) == 0:
        return arg_6
      else:
        print "Func: re-generating stats file %s because " \
              "keys %s are not available" %  \
              (arg_0, str(arg_9))
        os.remove(arg_0)

  print "Generating statistics for file '%s' with filters '%s'" % (arg_0, arg_3)
  arg_10 = RecordSensor()
  arg_10.dataSource = FileRecordStream(arg_0)
  arg_10.preEncodingFilters = arg_3

  # Convert collector description to collector object
  arg_13 = []
  for arg_14 in arg_1:
    # field = key from statsInfo
    if arg_1[arg_14] == "number":
      # This wants a field name e.g. consumption and the field type as the value
      arg_1[arg_14] = NumberStatsCollector()
    elif arg_1[arg_14] == "category":
      arg_1[arg_14] = CategoryStatsCollector()
    else:
      raise RuntimeError("Unknown stats type '%s' for field '%s'" % (arg_1[arg_14], arg_14))

  # Now collect the stats
  if arg_2 is None:
    arg_2 = 500000
  for arg_15 in xrange(arg_2):
    try:
      arg_16 = arg_10.getNextRecord()
    except StopIteration:
      break
    for (arg_17, arg_18) in arg_1.items():
      arg_18.add(arg_16[arg_17])

  del arg_10

  # Assemble the results and return
  arg_6 = dict()
  for (arg_14, arg_18) in arg_1.items():
    arg_13 = arg_18.getStats()
    if arg_14 not in arg_6:
      arg_6[arg_14] = arg_13
    else:
      arg_6[arg_14].update(arg_13)

  if arg_4:
    arg_19 = open(arg_5, "wb")
    pickle.dump(arg_6, arg_19)
    arg_19.close()
    # caller may need to know name of cached file
    arg_6["_filename"] = arg_5

  return arg_6

Generate requested statistics for a dataset and cache to a file . If filename is None then don t cache to a file


def Func ( arg_0 ) : arg_1 = arg_0 . splitlines ( ) for arg_2 in arg_1 : arg_2 = arg_2 . strip ( ) if arg_2 and not arg_2 . startswith ( '#' ) and arg_2 != '\\' : return os . path . basename ( re . split ( r'\s' , arg_2 ) [ 0 ] ) return 'command'

def Func(arg_0):
  r"""Craft a simple command name from the command.

  The best command strings for this are going to be those where a simple
  command was given; we will use the command to derive the name.

  We won't always be able to figure something out and the caller should just
  specify a "--name" on the command-line.

  For example, commands like "export VAR=val\necho ${VAR}", this function would
  return "export".

  If the command starts space or a comment, then we'll skip to the first code
  we can find.

  If we find nothing, just return "command".

  >>> Func('samtools index "${BAM}"')
  'samtools'
  >>> Func('/usr/bin/sort "${INFILE}" > "${OUTFILE}"')
  'sort'
  >>> Func('# This should be ignored')
  'command'
  >>> Func('\\\n\\\n# Bad continuations, but ignore.\necho hello.')
  'echo'

  Arguments:
    command: the user-provided command
  Returns:
    a proposed name for the task.
  """

  arg_1 = arg_0.splitlines()
  for arg_2 in arg_1:
    arg_2 = arg_2.strip()
    if arg_2 and not arg_2.startswith('#') and arg_2 != '\\':
      return os.path.basename(re.split(r'\s', arg_2)[0])

  return 'command'

r"""Craft a simple command name from the command.

  The best command strings for this are going to be those where a simple
  command was given; we will use the command to derive the name.

  We won't always be able to figure something out and the caller should just
  specify a "--name" on the command-line.

  For example, commands like "export VAR=val\necho ${VAR}", this function would
  return "export".

  If the command starts space or a comment, then we'll skip to the first code
  we can find.

  If we find nothing, just return "command".

  >>> _name_for_command('samtools index "${BAM}"')
  'samtools'
  >>> _name_for_command('/usr/bin/sort "${INFILE}" > "${OUTFILE}"')
  'sort'
  >>> _name_for_command('# This should be ignored')
  'command'
  >>> _name_for_command('\\\n\\\n# Bad continuations, but ignore.\necho hello.')
  'echo'

  Arguments:
    command: the user-provided command
  Returns:
    a proposed name for the task.

r Craft a simple command name from the command .


(model, array_type='dense', include_vars=False,
                        zero_tol=1e-6)

def
Func
(
arg_0
,
arg_1
=
'dense'
,
arg_2
=
False
,
arg_3
=
1e-6
)
:
if
arg_1
not
in
(
'DataFrame'
,
'dense'
)
and
not
dok_matrix
:
raise
ValueError
(
'Sparse matrices require scipy'
)
arg_4
=
{
'dense'
:
np
.
array
,
'dok'
:
dok_matrix
,
'lil'
:
lil_matrix
,
'DataFrame'
:
pd
.
DataFrame
,
}
[
arg_1
]
arg_5
=
namedtuple
(
"Problem"
,
[
"equalities"
,
"b"
,
"inequalities"
,
"bounds"
,
"variable_fixed"
,
"variable_bounds"
]
)
arg_6
=
[
]
arg_7
=
[
]
arg_8
=
[
]
arg_9
=
[
]
for
arg_10
in
arg_0
.
constraints
:
arg_11
=
np
.
inf
if
arg_10
.
lb
is
else
arg_10
.
lb
arg_12
=
np
.
inf
if
arg_10
.
ub
is
else
arg_10
.
ub
arg_13
=
(
arg_12
arg_11
)
<
arg_3
arg_14
=
arg_10
.
get_linear_coefficients
(
arg_0
.
variables
)
arg_14
=
[
arg_14
[
v
]
for
v
in
arg_0
.
variables
]
if
arg_13
:
arg_9
.
append
(
arg_11
if
abs
(
arg_11
)
>
arg_3
else
0.0
)
arg_6
.
append
(
arg_14
)
else
:
arg_7
.
append
(
arg_14
)
arg_8
.
append
(
[
arg_11
,
arg_12
]
)
arg_15
=
np
.
array
(
[
[
v
.
lb
,
v
.
ub
]
for
v
in
arg_0
.
variables
]
)
arg_16
=
arg_15
[
:
,
1
]
arg_15
[
:
,
0
]
<
arg_3
arg_17
=
arg_5
(
equalities
=
arg_4
(
arg_6
)
,
arg_9
=
np
.
array
(
arg_9
)
,
inequalities
=
arg_4
(
arg_7
)
,
bounds
=
arg_4
(
arg_8
)
,
variable_fixed
=
np
.
array
(
arg_16
)
,
variable_bounds
=
arg_4
(
arg_15
)
)
return
arg_17

def Func(arg_0, arg_1='dense', arg_2=False,
                        arg_3=1e-6):
    """Create a matrix representation of the problem.

    This is used for alternative solution approaches that do not use optlang.
    The function will construct the equality matrix, inequality matrix and
    bounds for the complete problem.

    Notes
    -----
    To accomodate non-zero equalities the problem will add the variable
    "const_one" which is a variable that equals one.

    Arguments
    ---------
    model : cobra.Model
        The model from which to obtain the LP problem.
    array_type : string
        The type of array to construct. if 'dense', return a standard
        numpy.array, 'dok', or 'lil' will construct a sparse array using
        scipy of the corresponding type and 'DataFrame' will give a
        pandas `DataFrame` with metabolite indices and reaction columns.
    zero_tol : float
        The zero tolerance used to judge whether two bounds are the same.

    Returns
    -------
    collections.namedtuple
        A named tuple consisting of 6 matrices and 2 vectors:
        - "equalities" is a matrix S such that S*vars = b. It includes a row
          for each constraint and one column for each variable.
        - "b" the right side of the equality equation such that S*vars = b.
        - "inequalities" is a matrix M such that lb <= M*vars <= ub.
          It contains a row for each inequality and as many columns as
          variables.
        - "bounds" is a compound matrix [lb ub] containing the lower and
          upper bounds for the inequality constraints in M.
        - "variable_fixed" is a boolean vector indicating whether the variable
          at that index is fixed (lower bound == upper_bound) and
          is thus bounded by an equality constraint.
        - "variable_bounds" is a compound matrix [lb ub] containing the
          lower and upper bounds for all variables.
    """
    if arg_1 not in ('DataFrame', 'dense') and not dok_matrix:
        raise ValueError('Sparse matrices require scipy')

    arg_4 = {
        'dense': np.array, 'dok': dok_matrix, 'lil': lil_matrix,
        'DataFrame': pd.DataFrame,
    }[arg_1]

    arg_5 = namedtuple("Problem",
                         ["equalities", "b", "inequalities", "bounds",
                          "variable_fixed", "variable_bounds"])
    arg_6 = []
    arg_7 = []
    arg_8 = []
    arg_9 = []

    for arg_10 in arg_0.constraints:
        arg_11 = -np.inf if arg_10.lb is None else arg_10.lb
        arg_12 = np.inf if arg_10.ub is None else arg_10.ub
        arg_13 = (arg_12 - arg_11) < arg_3
        arg_14 = arg_10.get_linear_coefficients(arg_0.variables)
        arg_14 = [arg_14[v] for v in arg_0.variables]
        if arg_13:
            arg_9.append(arg_11 if abs(arg_11) > arg_3 else 0.0)
            arg_6.append(arg_14)
        else:
            arg_7.append(arg_14)
            arg_8.append([arg_11, arg_12])

    arg_15 = np.array([[v.lb, v.ub] for v in arg_0.variables])
    arg_16 = arg_15[:, 1] - arg_15[:, 0] < arg_3

    arg_17 = arg_5(
        equalities=arg_4(arg_6),
        arg_9=np.array(arg_9),
        inequalities=arg_4(arg_7),
        bounds=arg_4(arg_8),
        variable_fixed=np.array(arg_16),
        variable_bounds=arg_4(arg_15))

    return arg_17

Create a matrix representation of the problem .


def Func ( arg_0 ) : arg_1 = arg_0 . _zoom arg_2 = arg_0 . _layout arg_3 = arg_0 . _builder arg_4 = list ( map ( lambda f : f * arg_1 , arg_2 . bounding_box ) ) arg_3 . bounding_box = arg_4 arg_6 = arg_4 [ 2 ] + arg_4 [ 0 ] * 2 arg_7 = arg_4 [ 3 ] + arg_4 [ 1 ] * 2 arg_8 = list ( arg_2 . walk_instructions ( lambda i : ( arg_6 - ( i . x + i . width ) * arg_1 , arg_7 - ( i . y + i . height ) * arg_1 , i . instruction ) ) ) arg_8 . sort ( key = lambda x_y_i : x_y_i [ 2 ] . render_z ) for arg_9 , arg_10 , arg_11 in arg_8 : arg_12 = arg_11 . render_z arg_13 = ( "" if not arg_12 else "-{}" . format ( arg_12 ) ) arg_14 = "row-{}{}" . format ( arg_11 . row . id , arg_13 ) arg_15 = arg_0 . _register_instruction_in_defs ( arg_11 ) arg_16 = arg_0 . _symbol_id_to_scale [ arg_15 ] arg_17 = { "@class" : "instruction" , "@id" : "instruction-{}" . format ( arg_11 . id ) , "@transform" : "translate({},{}),scale({})" . format ( arg_9 , arg_10 , arg_16 ) } arg_3 . place_svg_use ( arg_15 , arg_14 , arg_17 ) arg_3 . insert_defs ( arg_0 . _instruction_type_color_to_symbol . values ( ) ) return arg_3 . get_svg_dict ( )

def Func(arg_0):
        """Go through the layout and build the SVG.

        :return: an xml dict that can be exported using a
          :class:`~knittingpattern.Dumper.XMLDumper`
        :rtype: dict
        """
        arg_1 = arg_0._zoom
        arg_2 = arg_0._layout
        arg_3 = arg_0._builder
        arg_4 = list(map(lambda f: f * arg_1, arg_2.bounding_box))
        arg_3.bounding_box = arg_4
        arg_6 = arg_4[2] + arg_4[0] * 2
        arg_7 = arg_4[3] + arg_4[1] * 2
        arg_8 = list(arg_2.walk_instructions(
            lambda i: (arg_6 - (i.x + i.width) * arg_1,
                       arg_7 - (i.y + i.height) * arg_1,
                       i.instruction)))
        arg_8.sort(key=lambda x_y_i: x_y_i[2].render_z)
        for arg_9, arg_10, arg_11 in arg_8:
            arg_12 = arg_11.render_z
            arg_13 = ("" if not arg_12 else "-{}".format(arg_12))
            arg_14 = "row-{}{}".format(arg_11.row.id, arg_13)
            arg_15 = arg_0._register_instruction_in_defs(arg_11)
            arg_16 = arg_0._symbol_id_to_scale[arg_15]
            arg_17 = {
                "@class": "instruction",
                "@id": "instruction-{}".format(arg_11.id),
                "@transform": "translate({},{}),scale({})".format(
                    arg_9, arg_10, arg_16)
            }
            arg_3.place_svg_use(arg_15, arg_14, arg_17)
        arg_3.insert_defs(arg_0._instruction_type_color_to_symbol.values())
        return arg_3.get_svg_dict()

Go through the layout and build the SVG .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ allocate - allocate virtual memory

           The  allocate  system call creates a new allocation in the virtual address
           space of the calling process.  The length argument specifies the length of
           the allocation in bytes which will be rounded up to the hardware page size.

           The kernel chooses the address at which to create the allocation; the
           address of the new allocation is returned in *addr as the result of the call.

           All newly allocated memory is readable and writeable. In addition, the
           is_X argument is a boolean that allows newly allocated memory to be marked
           as executable (non-zero) or non-executable (zero).

           The allocate function is invoked through system call number 5.

           :param cpu: current CPU
           :param length: the length of the allocation in bytes
           :param isX: boolean that allows newly allocated memory to be marked as executable
           :param addr: the address of the new allocation is returned in *addr

           :return: On success, allocate returns zero and a pointer to the allocated area
                               is returned in *addr.  Otherwise, an error code is returned
                               and *addr is undefined.
                   EINVAL   length is zero.
                   EINVAL   length is too large.
                   EFAULT   addr points to an invalid address.
                   ENOMEM   No memory is available or the process' maximum number of allocations
                            would have been exceeded.
        """
        # TODO: check 4 bytes from addr
        if arg_4 not in arg_1.memory:
            logger.info("ALLOCATE: addr points to invalid address. Returning EFAULT")
            return Decree.CGC_EFAULT

        arg_5 = ['rw ', 'rwx'][bool(arg_3)]
        try:
            arg_6 = arg_1.memory.mmap(None, arg_2, arg_5)
        except Exception as e:
            logger.info("ALLOCATE exception %s. Returning ENOMEM %r", str(e), arg_2)
            return Decree.CGC_ENOMEM
        arg_1.write_int(arg_4, arg_6, 32)
        logger.info("ALLOCATE(%d, %s, 0x%08x) -> 0x%08x" % (arg_2, arg_5, arg_4, arg_6))
        arg_0.syscall_trace.append(("_allocate", -1, arg_2))
        return 0


(requirement_set, args, options, finder,
                                 session, name, wheel_cache)

def Func(arg_0, arg_1, arg_2, arg_3,
                                 arg_4, arg_5, arg_6):
        """
        Marshal cmd line args into a requirement set.
        """
        for arg_7 in arg_1:
            arg_0.add_requirement(
                InstallRequirement.from_line(
                    arg_7, None, isolated=arg_2.isolated_mode,
                    arg_6=arg_6
                )
            )

        for arg_7 in arg_2.editables:
            arg_0.add_requirement(
                InstallRequirement.from_editable(
                    arg_7,
                    default_vcs=arg_2.default_vcs,
                    isolated=arg_2.isolated_mode,
                    arg_6=arg_6
                )
            )

        arg_8 = False
        for arg_9 in arg_2.requirements:
            for arg_7 in parse_requirements(
                    arg_9,
                    arg_3=arg_3, arg_2=arg_2, arg_4=arg_4,
                    arg_6=arg_6):
                arg_8 = True
                arg_0.add_requirement(arg_7)

        if not (arg_1 or arg_2.editables or arg_8):
            arg_10 = {'name': arg_5}
            if arg_2.find_links:
                arg_11 = ('You must give at least one requirement to '
                       '%(name)s (maybe you meant "pip %(name)s '
                       '%(links)s"?)' %
                       dict(arg_10, links=' '.join(arg_2.find_links)))
            else:
                arg_11 = ('You must give at least one requirement '
                       'to %(name)s (see "pip help %(name)s")' % arg_10)
            logger.warning(arg_11)

Marshal cmd line args into a requirement set .


return np.clip(normalized[..., np.newaxis], 0, 1) * np.array(color)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = np . nanmin ( arg_0 ) if arg_3 is None : arg_3 = np . nanmax ( arg_0 ) arg_4 = ( arg_0 - arg_2 ) / ( arg_3 - arg_2 ) return np . clip ( arg_4 [ ... , np . newaxis ] , 0 , 1 ) * np . array ( arg_1 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """Turns a intensity array to a Func 'image' by replacing each intensity by a scaled 'color'

    Values in I between vmin  and vmax get scaled between 0 and 1, and values outside this range are clipped to this.

    Example
    >>> I = np.arange(16.).reshape(4,4)
    >>> color = (0, 0, 1) # red
    >>> rgb = vx.image.Func(I, color) # shape is (4,4,3)

    :param I: ndarray of any shape (2d for image)
    :param color: sequence of a (r, g and b) value
    :param vmin: normalization minimum for I, or np.nanmin(I) when None
    :param vmax: normalization maximum for I, or np.nanmax(I) when None
    :return:
    """
    if arg_2 is None:
        arg_2 = np.nanmin(arg_0)
    if arg_3 is None:
        arg_3 = np.nanmax(arg_0)
    arg_4 = (arg_0 - arg_2) / (arg_3 - arg_2)
    return np.clip(arg_4[..., np.newaxis], 0, 1) * np.array(arg_1)

Turns a intensity array to a monochrome 'image' by replacing each intensity by a scaled 'color'

    Values in I between vmin  and vmax get scaled between 0 and 1, and values outside this range are clipped to this.

    Example
    >>> I = np.arange(16.).reshape(4,4)
    >>> color = (0, 0, 1) # red
    >>> rgb = vx.image.monochrome(I, color) # shape is (4,4,3)

    :param I: ndarray of any shape (2d for image)
    :param color: sequence of a (r, g and b) value
    :param vmin: normalization minimum for I, or np.nanmin(I) when None
    :param vmax: normalization maximum for I, or np.nanmax(I) when None
    :return:

Turns a intensity array to a monochrome image by replacing each intensity by a scaled color


def Func(arg_0, arg_1):
    """Patch OptionParser.expand_default with custom behaviour

    This will handle defaults to avoid overriding values in the
    configuration file.
    """
    if arg_0.parser is None or not arg_0.default_tag:
        return arg_1.help
    arg_2 = arg_1._long_opts[0][2:]
    try:
        arg_3 = arg_0.parser.options_manager._all_options[arg_2]
    except KeyError:
        arg_4 = None
    else:
        arg_5 = arg_3.get_option_def(arg_2)
        arg_2 = arg_3.option_attrname(arg_2, arg_5)
        arg_4 = getattr(arg_3.config, arg_2, arg_5)
        arg_4 = utils._format_option_value(arg_5, arg_4)
    if arg_4 is optparse.NO_DEFAULT or not arg_4:
        arg_4 = arg_0.NO_DEFAULT_VALUE
    return arg_1.help.replace(arg_0.default_tag, str(arg_4))

Patch OptionParser . expand_default with custom behaviour


return tf.squeeze(tf.matmul(mat, tf.expand_dims(vec, axis=-1)), axis=-1)

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

def Func(arg_0, arg_1):
  """Computes the product of a matrix with a vector on the right.

  Note this supports dynamic shapes and batched computation.

  Examples:

    M = tf.reshape(tf.range(6), shape=(3, 2))
    # => [[0, 1],
    #     [2, 3],
    #     [4, 5]]
    v = tf.constant([1, 2])  # Shape: (2,)
    Func(M, v)
    # => [ 2,  8, 14]  # Shape: (3,)

    M = tf.reshape(tf.range(30), shape=(2, 3, 5))
    # => [[[ 0,  1,  2,  3,  4],
    #     [ 5,  6,  7,  8,  9],
    #     [10, 11, 12, 13, 14]],
    #
    #    [[15, 16, 17, 18, 19],
    #     [20, 21, 22, 23, 24],
    #     [25, 26, 27, 28, 29]]]
    v = tf.reshape(tf.range(10), shape=(2, 5))
    # => [[0, 1, 2, 3, 4],
    #     [5, 6, 7, 8, 9]]
    Func(M, v)
    # => [[ 30,  80, 130],
    #     [605, 780, 955]]  # Shape: (2, 3)

  Args:
    mat: A `tf.Tensor` of shape `[..., n, m]`.
    vec: A `tf.Tensor` of shape `[..., m]`.

  Returns:
    A tensor of shape `[..., n]` with matching batch dimensions.
  """
  return tf.squeeze(tf.matmul(arg_0, tf.expand_dims(arg_1, axis=-1)), axis=-1)

Computes the product of a matrix with a vector on the right .


def Func(arg_0):
        """move cursor left"""
        arg_1, arg_2 = arg_0._index
        arg_0._select_index(arg_1, arg_2-1)


def Func ( ) : try : admin . site . unregister ( MODEL_TREE_CLASS ) except NotRegistered : pass admin . site . register ( MODEL_TREE_CLASS , _TREE_ADMIN ( ) )

def Func():
    """Forces unregistration of tree admin class with following re-registration."""
    try:
        admin.site.unregister(MODEL_TREE_CLASS)
    except NotRegistered:
        pass
    admin.site.register(MODEL_TREE_CLASS, _TREE_ADMIN())

Forces unregistration of tree admin class with following re - registration .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in iter_chunk_slice ( arg_1 . shape [ - 1 ] , arg_1 . chunkshape [ - 1 ] ) : arg_2 . append ( arg_0 ( arg_1 [ ... , arg_3 ] ) ) return arg_2

def Func(arg_0, arg_1, arg_2):
    """Map with `func`, chunk by chunk, the input pytable `array`.
    The result is stored in the output pytable array `out_array`.
    """
    for arg_3 in iter_chunk_slice(arg_1.shape[-1], arg_1.chunkshape[-1]):
        arg_2.append(arg_0(arg_1[..., arg_3]))
    return arg_2

Map with func chunk by chunk the input pytable array . The result is stored in the output pytable array out_array .


def Func ( arg_0 ) : if not arg_0 . join_signal . is_set ( ) : arg_0 . join_signal . set ( ) time . sleep ( 0.01 ) if arg_0 . main_worker_thread . is_alive ( ) : arg_0 . main_worker_thread . join ( ) if arg_0 . threaded : for arg_1 in arg_0 . workers : if arg_1 . is_alive ( ) : arg_1 . join ( ) else : for arg_1 in arg_0 . workers : if arg_1 . is_alive ( ) : arg_1 . Func ( ) arg_1 . join ( ) while not arg_0 . all_finished ( ) : time . sleep ( 0.001 ) if arg_0 . queue . full ( ) : arg_0 . queue . get ( ) arg_0 . queue . put ( pickle . dumps ( None , protocol = - 1 ) ) time . sleep ( 0.01 ) while True : try : arg_0 . _queue_internal . get ( timeout = 0.005 ) except QueueEmpty : break if not arg_0 . _queue_internal . _closed : arg_0 . _queue_internal . close ( ) if not arg_0 . queue . _closed : arg_0 . queue . close ( ) arg_0 . _queue_internal . join_thread ( ) arg_0 . queue . join_thread ( ) time . sleep ( 0.025 )

def Func(arg_0):
        """Stop all workers."""
        if not arg_0.join_signal.is_set():
            arg_0.join_signal.set()
        # give minimal time to put generated batches in queue and gracefully shut down
        time.sleep(0.01)

        if arg_0.main_worker_thread.is_alive():
            arg_0.main_worker_thread.join()

        if arg_0.threaded:
            for arg_1 in arg_0.workers:
                if arg_1.is_alive():
                    arg_1.join()
        else:
            for arg_1 in arg_0.workers:
                if arg_1.is_alive():
                    arg_1.Func()
                    arg_1.join()

            # wait until all workers are fully Funcd
            while not arg_0.all_finished():
                time.sleep(0.001)

        # empty queue until at least one element can be added and place None as signal that BL finished
        if arg_0.queue.full():
            arg_0.queue.get()
        arg_0.queue.put(pickle.dumps(None, protocol=-1))
        time.sleep(0.01)

        # clean the queue, this reportedly prevents hanging threads
        while True:
            try:
                arg_0._queue_internal.get(timeout=0.005)
            except QueueEmpty:
                break

        if not arg_0._queue_internal._closed:
            arg_0._queue_internal.close()
        if not arg_0.queue._closed:
            arg_0.queue.close()
        arg_0._queue_internal.join_thread()
        arg_0.queue.join_thread()
        time.sleep(0.025)


def Func ( arg_0 , arg_1 = 32 , arg_2 = 0 , arg_3 = 0 ) : assert isinstance ( arg_0 , ( bytearray , Array ) ) arg_4 = ABI . _readBE ( arg_0 , arg_1 , arg_2 = True , arg_3 = arg_3 ) arg_4 = Operators . ZEXTEND ( arg_4 , ( arg_1 + arg_2 ) * 8 ) return arg_4

def Func(arg_0, arg_1=32, arg_2=0, arg_3=0):
        """
        Read a `nbytes` bytes long big endian unsigned integer from `data` starting at `offset`

        :param data: sliceable buffer; symbolic buffer of Eth ABI encoded data
        :param nbytes: number of bytes to read starting from least significant byte
        :rtype: int or Expression
        """
        assert isinstance(arg_0, (bytearray, Array))
        arg_4 = ABI._readBE(arg_0, arg_1, arg_2=True, arg_3=arg_3)
        arg_4 = Operators.ZEXTEND(arg_4, (arg_1 + arg_2) * 8)
        return arg_4

Read a nbytes bytes long big endian unsigned integer from data starting at offset


return self._apiurl + '&'.join(self._parts()).replace(' ','+')

def
Func
(
arg_0
)
:
arg_0
.
render
(
)
return
arg_0
.
_apiFunc
+
'&'
.
join
(
arg_0
.
_parts
(
)
)
.
replace
(
' '
,
'+'
)

def Func(arg_0):
        """
        Returns the rendered URL of the chart
        """
        arg_0.render()
        return arg_0._apiFunc + '&'.join(arg_0._parts()).replace(' ','+')


(self, bucket, file, uploadpath=None, key=None,
                          ContentType=None, **kw)

async
def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
**
arg_6
)
:
arg_7
=
False
if
hasattr
(
arg_2
,
'read'
)
:
if
hasattr
(
arg_2
,
'seek'
)
:
arg_2
.
seek
(
0
)
arg_2
=
arg_2
.
read
(
)
arg_8
=
len
(
arg_2
)
elif
arg_4
:
arg_8
=
len
(
arg_2
)
else
:
arg_7
=
True
arg_8
=
os
.
stat
(
arg_2
)
.
st_size
arg_4
=
os
.
path
.
basename
(
arg_2
)
assert
arg_4
,
'key not available'
if
not
arg_5
:
arg_5
,
arg_9
=
mimetypes
.
guess_type
(
arg_4
)
if
arg_3
:
if
not
arg_3
.
endswith
(
'/'
)
:
arg_3
=
'%s/'
%
arg_3
arg_4
=
'%s%s'
%
(
arg_3
,
arg_4
)
arg_10
=
dict
(
Bucket
=
arg_1
,
Key
=
arg_4
)
if
not
arg_5
:
arg_5
=
'application/octet-stream'
arg_10
[
'ContentType'
]
=
arg_5
if
arg_8
>
MULTI_PART_SIZE
and
arg_7
:
arg_11
=
await
_multipart
(
arg_0
,
arg_2
,
arg_10
)
elif
arg_7
:
with
open
(
arg_2
,
'rb'
)
as
fp
:
arg_10
[
'Body'
]
=
fp
.
read
(
)
arg_11
=
await
arg_0
.
put_object
(
**
arg_10
)
else
:
arg_10
[
'Body'
]
=
arg_2
arg_11
=
await
arg_0
.
put_object
(
**
arg_10
)
if
'Key'
not
in
arg_11
:
arg_11
[
'Key'
]
=
arg_4
if
'Bucket'
not
in
arg_11
:
arg_11
[
'Bucket'
]
=
arg_1
return
arg_11

async def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
                          arg_5=None, **arg_6):
        """Upload a file to S3 possibly using the multi-part uploader
        Return the key uploaded
        """
        arg_7 = False

        if hasattr(arg_2, 'read'):
            if hasattr(arg_2, 'seek'):
                arg_2.seek(0)
            arg_2 = arg_2.read()
            arg_8 = len(arg_2)
        elif arg_4:
            arg_8 = len(arg_2)
        else:
            arg_7 = True
            arg_8 = os.stat(arg_2).st_size
            arg_4 = os.path.basename(arg_2)

        assert arg_4, 'key not available'

        if not arg_5:
            arg_5, arg_9 = mimetypes.guess_type(arg_4)

        if arg_3:
            if not arg_3.endswith('/'):
                arg_3 = '%s/' % arg_3
            arg_4 = '%s%s' % (arg_3, arg_4)

        arg_10 = dict(Bucket=arg_1, Key=arg_4)

        if not arg_5:
            arg_5 = 'application/octet-stream'

        arg_10['ContentType'] = arg_5

        if arg_8 > MULTI_PART_SIZE and arg_7:
            arg_11 = await _multipart(arg_0, arg_2, arg_10)
        elif arg_7:
            with open(arg_2, 'rb') as fp:
                arg_10['Body'] = fp.read()
            arg_11 = await arg_0.put_object(**arg_10)
        else:
            arg_10['Body'] = arg_2
            arg_11 = await arg_0.put_object(**arg_10)
        if 'Key' not in arg_11:
            arg_11['Key'] = arg_4
        if 'Bucket' not in arg_11:
            arg_11['Bucket'] = arg_1
        return arg_11

Upload a file to S3 possibly using the multi - part uploader Return the key uploaded


(self, stateBefore, stateAfter, keepNoneEmptyDirectory=True)

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """clean repository given before and after states"""
        # prepare after for faster search
        arg_4    = []
        arg_5 = {}
        [arg_5.setdefault(list(arg_6)[0],[]).append(arg_6) for arg_6 in arg_2]
        # loop before
        for arg_7 in reversed(arg_1):
            arg_8 = list(arg_7)[0]
            arg_9 = os.path.basename(arg_8)
            arg_10    = arg_7[arg_8]['type']
            arg_11    = arg_5.get(arg_8, [])
            arg_6    = [a for a in arg_11 if a[arg_8]['type']==arg_10]
            if len(arg_6)>1:
                arg_4.append("Multiple '%s' of type '%s' where found in '%s', this should never had happened. Please report issue"%(arg_9,arg_10,arg_8))
                continue
            if not len(arg_6):
                arg_12  = []
                arg_13 = []
                if arg_10 == 'dir':
                    if not len(arg_8):
                        arg_4.append("Removing main repository directory is not allowed")
                        continue
                    arg_12.append(os.path.join(arg_0.__path,arg_8))
                    arg_13.append(os.path.join(arg_0.__path,arg_8,arg_0.__dirInfo))
                    arg_13.append(os.path.join(arg_0.__path,arg_8,arg_0.__dirLock))
                elif arg_10 == 'file':
                    arg_13.append(os.path.join(arg_0.__path,arg_8))
                    arg_13.append(os.path.join(arg_0.__path,arg_8,arg_0.__fileInfo%arg_9))
                    arg_13.append(os.path.join(arg_0.__path,arg_8,arg_0.__fileLock%arg_9))
                else:
                    ### MUST VERIFY THAT ONCE pyrepobjectdir IS IMPLEMENTED
                    arg_12.append(os.path.join(arg_0.__path,arg_8))
                    arg_13.append(os.path.join(arg_0.__path,arg_8,arg_0.__fileInfo%arg_9))
                # remove files
                for arg_14 in arg_13:
                    if os.path.isfile(arg_14):
                        try:
                            os.remove(arg_14)
                        except Exception as err:
                            arg_4.append("Unable to clean file '%s' (%s)"%(arg_14, str(err)))
                # remove directories
                for arg_15 in arg_12:
                    if os.path.isdir(arg_15):
                        if arg_3 or not len(os.listdir(arg_15)):
                            try:
                                shutil.rmtree(arg_15)
                            except Exception as err:
                                arg_4.append("Unable to clean directory '%s' (%s)"%(arg_14, str(err)))
        # return result and errors list
        return len(arg_4)==0, arg_4


def
Func
(
arg_0
)
:
arg_0
.
config
[
'SQLALCHEMY_TRACK_MODIFICATIONS'
]
=
True
if
arg_0
.
debug
else
False
if
chanjo_api
:
chanjo_api
.
init_app
(
arg_0
)
configure_template_filters
(
arg_0
)
arg_0
.
register_blueprint
(
report_bp
,
url_prefix
=
'/reports'
)
arg_2
=
Babel
(
arg_0
)
@
arg_2
.
localeselector
def
get_locale
(
)
:
arg_3
=
current_app
.
config
.
get
(
'ACCEPT_LANGUAGES'
,
[
'en'
]
)
arg_4
=
request
.
args
.
get
(
'lang'
)
if
arg_4
in
arg_3
:
current_app
.
logger
.
info
(
"using session language: %s"
,
arg_4
)
return
arg_4
arg_5
=
current_app
.
config
.
get
(
'REPORT_LANGUAGE'
)
if
arg_5
:
return
arg_5
return
request
.
accept_languages
.
best_match
(
arg_3
)

def Func(arg_0):
    """Setup coverage related extensions."""
    # setup chanjo report
    arg_0.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True if arg_0.debug else False
    if chanjo_api:
        chanjo_api.init_app(arg_0)
        configure_template_filters(arg_0)
        # register chanjo report blueprint
        arg_0.register_blueprint(report_bp, url_prefix='/reports')

    arg_2 = Babel(arg_0)

    @arg_2.localeselector
    def get_locale():
        """Determine locale to use for translations."""
        arg_3 = current_app.config.get('ACCEPT_LANGUAGES', ['en'])

        # first check request args
        arg_4 = request.args.get('lang')
        if arg_4 in arg_3:
            current_app.logger.info("using session language: %s", arg_4)
            return arg_4

        # language can be forced in config
        arg_5 = current_app.config.get('REPORT_LANGUAGE')
        if arg_5:
            return arg_5

        # try to guess the language from the user accept header that
        # the browser transmits.  We support de/fr/en in this example.
        # The best match wins.
        return request.accept_languages.best_match(arg_3)


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = { } arg_4 = arg_2 arg_5 = arg_0 . cases ( owner = arg_1 , arg_4 = arg_4 ) arg_6 = 0 arg_7 = 0 arg_8 = 0 arg_9 = 0 arg_10 = { 1 : { 'title' : 'Single' , 'count' : 0 } , 2 : { 'title' : 'Duo' , 'count' : 0 } , 3 : { 'title' : 'Trio' , 'count' : 0 } , 'many' : { 'title' : 'Many' , 'count' : 0 } , } arg_11 = set ( ) arg_12 = 0 for arg_12 , arg_13 in enumerate ( arg_5 , 1 ) : if arg_1 : arg_11 . add ( arg_13 [ '_id' ] ) if arg_13 . get ( 'phenotype_terms' ) : arg_6 += 1 if arg_13 . get ( 'causatives' ) : arg_7 += 1 if arg_13 . get ( 'suspects' ) : arg_8 += 1 if arg_13 . get ( 'cohorts' ) : arg_9 += 1 arg_14 = len ( arg_13 . get ( 'individuals' , [ ] ) ) if arg_14 == 0 : continue if arg_14 > 3 : arg_10 [ 'many' ] [ 'count' ] += 1 else : arg_10 [ arg_14 ] [ 'count' ] += 1 arg_3 [ 'total_cases' ] = arg_12 arg_3 [ 'phenotype_cases' ] = arg_6 arg_3 [ 'causative_cases' ] = arg_7 arg_3 [ 'pinned_cases' ] = arg_8 arg_3 [ 'cohort_cases' ] = arg_9 arg_3 [ 'pedigree' ] = arg_10 arg_3 [ 'case_ids' ] = arg_11 return arg_3

def Func(arg_0, arg_1=None, arg_2=None):
    """Return general information about cases

    Args:
        adapter(adapter.MongoAdapter)
        institute_id(str)
        slice_query(str):   Query to filter cases to obtain statistics for.

    Returns:
        general(dict)
    """
    arg_3 = {}

    # Potentially sensitive slice queries are assumed allowed if we have got this far
    arg_4 = arg_2

    arg_5 = arg_0.cases(owner=arg_1, arg_4=arg_4)

    arg_6 = 0
    arg_7 = 0
    arg_8 = 0
    arg_9 = 0

    arg_10 = {
        1: {
            'title': 'Single',
            'count': 0
        },
        2: {
            'title': 'Duo',
            'count': 0
        },
        3: {
            'title': 'Trio',
            'count': 0
        },
        'many': {
            'title': 'Many',
            'count': 0
        },
    }

    arg_11 = set()

    arg_12 = 0
    for arg_12,arg_13 in enumerate(arg_5,1):
        # If only looking at one institute we need to save the case ids
        if arg_1:
            arg_11.add(arg_13['_id'])
        if arg_13.get('phenotype_terms'):
            arg_6 += 1
        if arg_13.get('causatives'):
            arg_7 += 1
        if arg_13.get('suspects'):
            arg_8 += 1
        if arg_13.get('cohorts'):
            arg_9 += 1

        arg_14 = len(arg_13.get('individuals',[]))
        if arg_14 == 0:
            continue
        if arg_14 > 3:
            arg_10['many']['count'] += 1
        else:
            arg_10[arg_14]['count'] += 1

    arg_3['total_cases'] = arg_12
    arg_3['phenotype_cases'] = arg_6
    arg_3['causative_cases'] = arg_7
    arg_3['pinned_cases'] = arg_8
    arg_3['cohort_cases'] = arg_9
    arg_3['pedigree'] = arg_10
    arg_3['case_ids'] = arg_11

    return arg_3


def Func(arg_0, arg_1, **arg_2):
        """
        Get the arguments given to the template tag element and complete these
        with the ones from the settings.py if necessary.
        """
        arg_3 = arg_2

        arg_4 = deepcopy(inplace_settings.DEFAULT_INPLACE_EDIT_OPTIONS)
        arg_5 = inplace_settings.DEFAULT_INPLACE_EDIT_OPTIONS_ONE_BY_ONE

        if not arg_5:
            # Solution 1: Using default config only if none specified.
            if not arg_3 and arg_4:
                arg_3 = arg_4
        else:
            # Solution 2: Updating the configured config with the default one.
            arg_3 = dict(arg_4, **arg_3)
        return arg_3

Get the arguments given to the template tag element and complete these with the ones from the settings . py if necessary .


def Func(arg_0):
    """Starts a new article"""

    arg_1 = arg_0.obj

    arg_2 = click.prompt('Title')
    arg_3 = click.prompt('Author', default=arg_1.get('DEFAULT_AUTHOR'))

    arg_4 = slugify(arg_2)
    arg_5 = datetime.now()
    arg_6 = '{:%Y-%m-%d}_{}.md'.format(arg_5, arg_4)
    arg_7 = (
        ('Title', arg_2),
        ('Date', '{:%Y-%m-%d %H:%M}:00'.format(arg_5)),
        ('Modified', '{:%Y-%m-%d %H:%M}:00'.format(arg_5)),
        ('Author', arg_3),
    )

    arg_8 = ''
    for arg_9, arg_10 in arg_7:
        arg_8 += '{}: {}\n'.format(arg_9, arg_10)
    arg_8 += '\n\n'
    arg_8 += 'Text...\n\n'
    arg_8 += '![image description]({filename}/images/my-photo.jpg)\n\n'
    arg_8 += 'Text...\n\n'

    os.makedirs(arg_1['CONTENT_DIR'], exist_ok=True)
    arg_11 = os.path.join(arg_1['CONTENT_DIR'], arg_6)
    with click.open_file(arg_11, 'w') as f:
        f.Func(arg_8)

    click.echo(arg_11)
    click.launch(arg_11)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if isinstance ( arg_3 , Filter ) : if arg_3 . filters : arg_2 . extend ( arg_0 . Func ( arg_3 . filters ) ) elif isinstance ( arg_3 , dict ) : arg_4 = list ( arg_3 . keys ( ) ) [ 0 ] arg_5 = arg_3 [ arg_4 ] if isinstance ( arg_5 , dict ) : arg_6 = arg_0 . Func ( [ arg_5 ] ) if len ( arg_6 ) == 1 : arg_6 = arg_6 [ 0 ] arg_2 . append ( { arg_4 : arg_6 } ) else : arg_2 . append ( { arg_4 : arg_0 . Func ( arg_5 ) } ) else : arg_2 . extend ( ( arg_3 , ) ) return arg_2

def Func(arg_0, arg_1):
        """Takes a list of filters and returns JSON

        :Parameters:
        - `filters`: List of Filters, (key, val) tuples, or dicts

        Returns: List of JSON API filters
        """
        arg_2 = []

        # Filters should always be a list
        for arg_3 in arg_1:
            if isinstance(arg_3, Filter):
                if arg_3.filters:
                    arg_2.extend(arg_0.Func(arg_3.filters))
            elif isinstance(arg_3, dict):
                arg_4 = list(arg_3.keys())[0]
                arg_5 = arg_3[arg_4]

                if isinstance(arg_5, dict):
                    # pass val (a dict) as list
                    # so that it gets processed properly
                    arg_6 = arg_0.Func([arg_5])
                    if len(arg_6) == 1:
                        arg_6 = arg_6[0]
                    arg_2.append({arg_4: arg_6})
                else:
                    arg_2.append({arg_4: arg_0.Func(arg_5)})
            else:
                arg_2.extend((arg_3,))

        return arg_2


return align_bulge_disk_centre_tag + align_bulge_disk_axis_ratio_tag + align_bulge_disk_phi_tag

def Func(arg_0, arg_1, arg_2):
    """Generate a tag for the alignment of the geometry of the bulge and disk of a bulge-disk system, to customize \
    phase names based on the bulge-disk model. This adds together the bulge_disk tags generated in the 3 functions
    above
    """
    arg_3 = align_bulge_disk_centre_tag_from_align_bulge_disk_centre(
        arg_0=arg_0)
    arg_4 = align_bulge_disk_axis_ratio_tag_from_align_bulge_disk_axis_ratio(
        arg_1=arg_1)
    arg_5 = align_bulge_disk_phi_tag_from_align_bulge_disk_phi(
        arg_2=arg_2)

    return arg_3 + arg_4 + arg_5

Generate a tag for the alignment of the geometry of the bulge and disk of a bulge - disk system to customize \ phase names based on the bulge - disk model . This adds together the bulge_disk tags generated in the 3 functions above


async def Func(arg_0, arg_1):
        """Rename this conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be Funcd.
        """
        await arg_0._client.Func_conversation(
            hangouts_pb2.RenameConversationRequest(
                request_header=arg_0._client.get_request_header(),
                new_name=arg_1,
                event_request_header=arg_0._get_event_request_header(),
            )
        )

Rename this conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be renamed.


def Func ( arg_0 ) : arg_0 . _input_state = "restart" arg_0 . _output_state = "restart" arg_0 . features = None arg_0 . transport . restart ( ) if arg_0 . initiator : arg_0 . _send_stream_start ( arg_0 . stream_id )

def Func(arg_0):
        """Restart the stream as needed after SASL and StartTLS negotiation."""
        arg_0._input_state = "restart"
        arg_0._output_state = "restart"
        arg_0.features = None
        arg_0.transport.restart()
        if arg_0.initiator:
            arg_0._send_stream_start(arg_0.stream_id)

Restart the stream as needed after SASL and StartTLS negotiation .


def Func ( arg_0 ) : arg_1 = pd . DataFrame . from_dict ( arg_0 . indexer . word_counts , orient = 'index' ) arg_1 . columns = [ 'count' ] return arg_1 . sort_values ( 'count' , ascending = False )

def Func(arg_0):
        """ See token counts as pandas dataframe"""
        arg_1 = pd.DataFrame.from_dict(arg_0.indexer.word_counts, orient='index')
        arg_1.columns = ['count']
        return arg_1.sort_values('count', ascending=False)


def Func ( arg_0 , arg_1 = None ) : if arg_0 in cache : return cache [ arg_0 ] [ 2 ] try : return updatecache ( arg_0 , arg_1 ) except MemoryError : clearcache ( ) return [ ]

def Func(arg_0, arg_1=None):
    """Get the lines for a file from the cache.
    Update the cache if it doesn't contain an entry for this file already."""

    if arg_0 in cache:
        return cache[arg_0][2]

    try:
        return updatecache(arg_0, arg_1)
    except MemoryError:
        clearcache()
        return []

Get the lines for a file from the cache . Update the cache if it doesn t contain an entry for this file already .


(github_url, metadata, github_data,
                             ltd_product_data)

def Func(arg_0, arg_1, arg_2,
                             arg_3):
    """Reduce a technote project's metadata from multiple sources into a
    single JSON-LD resource.

    Parameters
    ----------
    github_url : `str`
        URL of the technote's GitHub repository.
    metadata : `dict`
        The parsed contents of ``metadata.yaml`` found in a technote's
        repository.
    github_data : `dict`
        The contents of the ``technote_repo`` GitHub GraphQL API query.
    ltd_product_data : `dict`
        JSON dataset for the technote corresponding to the
        ``/products/<product>`` of LTD Keeper.

    Returns
    -------
    metadata : `dict`
        JSON-LD-formatted dictionary.

    .. `GitHub personal access token guide`: https://ls.st/41d
    """
    arg_4 = parse_repo_slug_from_url(arg_0)

    # Initialize a schema.org/Report and schema.org/SoftwareSourceCode
    # linked data resource
    arg_5 = {
        '@context': [
            "https://raw.githubusercontent.com/codemeta/codemeta/2.0-rc/"
            "codemeta.jsonld",
            "http://schema.org"],
        '@type': ['Report', 'SoftwareSourceCode'],
        'codeRepository': arg_0
    }

    if 'url' in arg_1:
        arg_6 = arg_1['url']
    elif 'published_url' in arg_3:
        arg_6 = arg_3['published_url']
    else:
        raise RuntimeError('No identifying url could be found: '
                           '{}'.format(arg_0))
    arg_5['@id'] = arg_6
    arg_5['url'] = arg_6

    if 'series' in arg_1 and 'serial_number' in arg_1:
        arg_5['reportNumber'] = '{series}-{serial_number}'.format(**arg_1)
    else:
        raise RuntimeError('No reportNumber: {}'.format(arg_0))

    if 'doc_title' in arg_1:
        arg_5['name'] = arg_1['doc_title']

    if 'description' in arg_1:
        arg_5['description'] = arg_1['description']

    if 'authors' in arg_1:
        arg_5['author'] = [{'@type': 'Person', 'name': author_name}
                            for author_name in arg_1['authors']]

    if 'last_revised' in arg_1:
        # Prefer getting the 'last_revised' date from metadata.yaml
        # since it's considered an override.
        arg_5['dateModified'] = datetime.datetime.strptime(
            arg_1['last_revised'],
            '%Y-%m-%d')
    else:
        # Fallback to parsing the date of the last commit to the
        # default branch on GitHub (usually `master`).
        try:
            arg_7 = arg_2['data']['repository']
            arg_8 = arg_7['defaultBranchRef']
            arg_5['dateModified'] = datetime.datetime.strptime(
                arg_8['target']['committedDate'],
                '%Y-%m-%dT%H:%M:%SZ')
        except KeyError:
            pass

    try:
        arg_9 = arg_2['data']['repository']['licenseInfo']
        arg_10 = arg_9['spdxId']
        if arg_10 is not None:
            arg_11 = 'https://spdx.org/licenses/{}.html'.format(arg_10)
            arg_5['license'] = arg_11
    except KeyError:
        pass

    try:
        # Find the README(|.md|.rst|*) file in the repo root
        arg_8 = arg_2['data']['repository']['defaultBranchRef']
        arg_12 = arg_8['target']['tree']['entries']
        for arg_13 in arg_12:
            arg_14 = arg_13['name']
            arg_15 = arg_14.lower()
            if arg_15.startswith('readme'):
                arg_16 = make_raw_content_url(arg_4, 'master',
                                                  arg_14)
                arg_5['readme'] = arg_16
                break
    except KeyError:
        pass

    # Assume Travis is the CI service (always true at the moment)
    arg_17 = 'https://travis-ci.org/{}'.format(arg_4.full)
    arg_5['contIntegration'] = arg_17

    return arg_5

Reduce a technote project s metadata from multiple sources into a single JSON - LD resource .


def Func ( arg_0 ) : arg_1 = [ ] arg_0 . new_config = Dict ( Dict ( arg_0 . upstream_config ) . merge ( PyFunceble . CONFIGURATION ) ) . remove_key ( arg_1 )

def Func(arg_0):
        """
        Simply merge the older into the new one.
        """

        arg_1 = []

        arg_0.new_config = Dict(
            Dict(arg_0.upstream_config).merge(PyFunceble.CONFIGURATION)
        ).remove_key(arg_1)

Simply merge the older into the new one .


(self, use_open_peers=True, queue=True, **kw)

def Func ( arg_0 , arg_1 = True , arg_2 = True , ** arg_3 ) : if not arg_1 : arg_4 = arg_3 . get ( 'ip' ) arg_5 = arg_3 . get ( 'port' ) arg_6 = 'http://{}:{}' . format ( arg_4 , arg_5 ) arg_7 = arky . rest . POST . peer . transactions ( arg_6 = arg_6 , transactions = [ arg_0 . tx . tx ] ) else : arg_7 = arky . core . sendPayload ( arg_0 . tx . tx ) if arg_0 . tx . success != '0.0%' : arg_0 . tx . error = None arg_0 . tx . success = True else : arg_0 . tx . error = arg_7 [ 'messages' ] arg_0 . tx . success = False arg_0 . tx . tries += 1 arg_0 . tx . res = arg_7 if arg_2 : arg_0 . tx . send = True arg_0 . __save ( ) return arg_7

def Func(arg_0, arg_1=True, arg_2=True, **arg_3):
        """
        send a transaction immediately. Failed transactions are picked up by the TxBroadcaster

        :param ip: specific peer IP to send tx to
        :param port: port of specific peer
        :param use_open_peers: use Arky's broadcast method
        """

        if not arg_1:
            arg_4 = arg_3.get('ip')
            arg_5 = arg_3.get('port')
            arg_6 = 'http://{}:{}'.format(arg_4, arg_5)
            arg_7 = arky.rest.POST.peer.transactions(arg_6=arg_6, transactions=[arg_0.tx.tx])

        else:
            arg_7 = arky.core.sendPayload(arg_0.tx.tx)

        if arg_0.tx.success != '0.0%':
            arg_0.tx.error = None
            arg_0.tx.success = True
        else:
            arg_0.tx.error = arg_7['messages']
            arg_0.tx.success = False

        arg_0.tx.tries += 1
        arg_0.tx.res = arg_7

        if arg_2:
            arg_0.tx.send = True

        arg_0.__save()
        return arg_7

send a transaction immediately . Failed transactions are picked up by the TxBroadcaster


def Func ( arg_0 ) : arg_0 . service_info = ServiceInfo ( '_webthing._tcp.local.' , '{}._webthing._tcp.local.' . format ( arg_0 . name ) , address = socket . inet_aton ( get_ip ( ) ) , port = arg_0 . port , properties = { 'path' : '/' , } , server = '{}.local.' . format ( socket . gethostname ( ) ) ) arg_0 . zeroconf = Zeroconf ( ) arg_0 . zeroconf . register_service ( arg_0 . service_info ) arg_0 . server . listen ( arg_0 . port ) tornado . ioloop . IOLoop . current ( ) . Func ( )

def Func(arg_0):
        """Start listening for incoming connections."""
        arg_0.service_info = ServiceInfo(
            '_webthing._tcp.local.',
            '{}._webthing._tcp.local.'.format(arg_0.name),
            address=socket.inet_aton(get_ip()),
            port=arg_0.port,
            properties={
                'path': '/',
            },
            server='{}.local.'.format(socket.gethostname()))
        arg_0.zeroconf = Zeroconf()
        arg_0.zeroconf.register_service(arg_0.service_info)

        arg_0.server.listen(arg_0.port)
        tornado.ioloop.IOLoop.current().Func()

Start listening for incoming connections .


(self, method='probabilistic', infer_gtr=False,
                        marginal=False, **kwargs)

def Func(arg_0, arg_1='probabilistic', arg_2=False,
                        arg_3=False, **arg_4):
        """Reconstruct ancestral sequences

        Parameters
        ----------
        method : str
           Method to use. Supported values are "fitch" and "ml"

        infer_gtr : bool
           Infer a GTR model before reconstructing the sequences

        marginal : bool
           Assign sequences that are most likely after averaging over all other nodes
           instead of the jointly most likely sequences.
        **kwargs
            additional keyword arguments that are passed down to :py:meth:`TreeAnc.infer_gtr` and :py:meth:`TreeAnc._ml_anc`

        Returns
        -------
        N_diff : int
           Number of nucleotides different from the previous
           reconstruction.  If there were no pre-set sequences, returns N*L

        """
        arg_0.logger("TreeAnc.infer_ancestral_sequences with method: %s, %s"%(arg_1, 'marginal' if arg_3 else 'joint'), 1)
        if (arg_0.tree is None) or (arg_0.aln is None):
            arg_0.logger("TreeAnc.infer_ancestral_sequences: ERROR, alignment or tree are missing", 0)
            return ttconf.ERROR

        if arg_1 in ['ml', 'probabilistic']:
            if arg_3:
                arg_5 = arg_0._ml_anc_marginal
            else:
                arg_5 = arg_0._ml_anc_joint
        else:
            arg_5 = arg_0._fitch_anc

        if arg_2:
            arg_6 = arg_0.infer_gtr(arg_3=arg_3, **arg_4)
            if arg_6==ttconf.ERROR:
                return arg_6
            arg_7 = arg_5(**arg_4)
        else:
            arg_7 = arg_5(**arg_4)

        return arg_7


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = numbers . Integral if isinstance ( arg_1 , arg_4 ) : arg_1 = [ arg_1 ] elif arg_1 is None : if arg_2 is not None : if isinstance ( arg_2 , tuple ) : if isinstance ( arg_2 [ 0 ] , arg_4 ) and isinstance ( arg_2 [ 1 ] , arg_4 ) : arg_1 = [ arg_0 . edge_index [ arg_2 ] ] elif isinstance ( arg_2 [ 0 ] , collections . Iterable ) : if np . array ( [ len ( arg_5 ) == 2 for arg_5 in arg_2 ] ) . all ( ) : arg_1 = [ arg_0 . edge_index [ arg_5 ] for arg_5 in arg_2 ] else : arg_1 = [ arg_0 . edge_index [ arg_2 ] ] elif arg_3 is not None : if isinstance ( arg_3 , collections . Iterable ) : arg_3 = set ( arg_3 ) else : arg_3 = set ( [ arg_3 ] ) arg_6 = [ ] for arg_5 in arg_0 . edges ( ) : if arg_0 . ep ( arg_5 , 'edge_type' ) in arg_3 : arg_6 . append ( arg_0 . edge_index [ arg_5 ] ) arg_1 = np . array ( arg_6 , int ) if arg_1 is None : arg_1 = range ( arg_0 . number_of_edges ( ) ) return arg_1

def Func(arg_0, arg_1, arg_2, arg_3):
    """Used to specify edge indices from different types of arguments."""
    arg_4 = numbers.Integral
    if isinstance(arg_1, arg_4):
        arg_1 = [arg_1]

    elif arg_1 is None:
        if arg_2 is not None:
            if isinstance(arg_2, tuple):
                if isinstance(arg_2[0], arg_4) and isinstance(arg_2[1], arg_4):
                    arg_1 = [arg_0.edge_index[arg_2]]
            elif isinstance(arg_2[0], collections.Iterable):
                if np.array([len(arg_5) == 2 for arg_5 in arg_2]).all():
                    arg_1 = [arg_0.edge_index[arg_5] for arg_5 in arg_2]
            else:
                arg_1 = [arg_0.edge_index[arg_2]]
        elif arg_3 is not None:
            if isinstance(arg_3, collections.Iterable):
                arg_3 = set(arg_3)
            else:
                arg_3 = set([arg_3])
            arg_6 = []
            for arg_5 in arg_0.edges():
                if arg_0.ep(arg_5, 'edge_type') in arg_3:
                    arg_6.append(arg_0.edge_index[arg_5])

            arg_1 = np.array(arg_6, int)

        if arg_1 is None:
            arg_1 = range(arg_0.number_of_edges())

    return arg_1

Used to specify edge indices from different types of arguments .


def Func(arg_0, arg_1, arg_2):
        """Check that a binary operator is surrounded by exactly one space."""
        arg_0._check_space(arg_1, arg_2, (_MUST, _MUST))

Check that a binary operator is surrounded by exactly one space .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
doc_by_id
(
arg_1
)
if
not
arg_2
:
return
arg_0
.
error
(
'id "{}" not found'
.
format
(
arg_1
)
)
for
arg_3
,
arg_4
in
arg_2
.
items
(
)
:
if
arg_3
==
config
.
HOUSENUMBERS_FIELD
:
continue
print
(
'{} {}'
.
format
(
white
(
arg_3
)
,
magenta
(
arg_4
)
)
)
if
arg_2
.
get
(
'housenumbers'
)
:
def
sorter
(
arg_5
)
:
try
:
return
int
(
re
.
match
(
r'^\d+'
,
arg_5
[
'raw'
]
)
.
group
(
)
)
except
AttributeError
:
return
1
arg_6
=
sorted
(
arg_2
[
'housenumbers'
]
.
values
(
)
,
arg_3
=
sorter
)
print
(
white
(
'housenumbers'
)
,
magenta
(
', '
.
join
(
arg_5
[
'raw'
]
for
arg_5
in
arg_6
)
)
)

def Func(arg_0, arg_1):
        """Get document from index with its id.
        GET 772210180J"""
        arg_2 = doc_by_id(arg_1)
        if not arg_2:
            return arg_0.error('id "{}" not found'.format(arg_1))
        for arg_3, arg_4 in arg_2.items():
            if arg_3 == config.HOUSENUMBERS_FIELD:
                continue
            print('{} {}'.format(white(arg_3), magenta(arg_4)))
        if arg_2.get('housenumbers'):
            def sorter(arg_5):
                try:
                    return int(re.match(r'^\d+', arg_5['raw']).group())
                except AttributeError:
                    return -1
            arg_6 = sorted(arg_2['housenumbers'].values(), arg_3=sorter)
            print(white('housenumbers'),
                  magenta(', '.join(arg_5['raw'] for arg_5 in arg_6)))

Get document from index with its id . GET 772210180J


def Func ( arg_0 , arg_1 = 1 ) : if not arg_0 . workers : for arg_2 in range ( arg_1 ) : arg_0 . workers . append ( Worker ( arg_0 . _download , arg_0 . queues [ 'download' ] , arg_0 . queues [ 'convert' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _convert , arg_0 . queues [ 'convert' ] , arg_0 . queues [ 'upload' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _upload , arg_0 . queues [ 'upload' ] , arg_0 . queues [ 'delete' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _delete , arg_0 . queues [ 'delete' ] , arg_0 . queues [ 'done' ] , arg_0 . stopper ) ) arg_0 . signal_handler = SignalHandler ( arg_0 . workers , arg_0 . stopper ) signal . signal ( signal . SIGINT , arg_0 . signal_handler ) for arg_4 in arg_0 . workers : arg_4 . start ( )

def Func(arg_0, arg_1=1):
        """
        Creates and starts the workers, as well as attaching a handler to terminate them gracefully when a SIGINT signal is received.

        :param int workers_per_task: Number of workers to create for each task in the pipeline
        """

        if not arg_0.workers:
            for arg_2 in range(arg_1):
                arg_0.workers.append(Worker(arg_0._download, arg_0.queues['download'], arg_0.queues['convert'], arg_0.stopper))
                arg_0.workers.append(Worker(arg_0._convert, arg_0.queues['convert'], arg_0.queues['upload'], arg_0.stopper))
                arg_0.workers.append(Worker(arg_0._upload, arg_0.queues['upload'], arg_0.queues['delete'], arg_0.stopper))
                arg_0.workers.append(Worker(arg_0._delete, arg_0.queues['delete'], arg_0.queues['done'], arg_0.stopper))

            arg_0.signal_handler = SignalHandler(arg_0.workers, arg_0.stopper)
            signal.signal(signal.SIGINT, arg_0.signal_handler)

            for arg_4 in arg_0.workers:
                arg_4.start()

Creates and starts the workers as well as attaching a handler to terminate them gracefully when a SIGINT signal is received .


def Func(arg_0):
        """Stop this Tracer."""
        arg_0.Funcped = True
        if arg_0.thread != threading.currentThread():
            # Called on a different thread than started us: we can't unhook
            # ourseves, but we've set the flag that we should Func, so we won't
            # do any more tracing.
            return

        if hasattr(sys, "gettrace") and arg_0.warn:
            if sys.gettrace() != arg_0._trace:
                arg_2 = "Trace function changed, measurement is likely wrong: %r"
                arg_0.warn(arg_2 % (sys.gettrace(),))
        #print("Stopping tracer on %s" % threading.current_thread().ident)
        sys.settrace(None)


def
Func
(
)
:
autodiscover_modules
(
'cron'
)
if
PROJECT_MODULE
:
if
'.'
in
PROJECT_MODULE
.
__name__
:
try
:
import_module
(
'%s.cron'
%
'.'
.
join
(
PROJECT_MODULE
.
__name__
.
split
(
'.'
)
[
0
:
1
]
)
)
except
ImportError
as
e
:
if
'No module named'
not
in
str
(
e
)
:
print
(
e
)
for
arg_0
,
arg_1
in
get_commands
(
)
.
items
(
)
:
try
:
Func_command_class
(
arg_1
,
arg_0
)
except
django
.
core
.
exceptions
.
ImproperlyConfigured
:
pass

def Func():
    """
    Load ``cron`` modules for applications listed in ``INSTALLED_APPS``.
    """
    autodiscover_modules('cron')

    if PROJECT_MODULE:
        if '.' in PROJECT_MODULE.__name__:
            try:
                import_module('%s.cron' % '.'.join(
                    PROJECT_MODULE.__name__.split('.')[0:-1]))
            except ImportError as e:
                if 'No module named' not in str(e):
                    print(e)

    # Func django tasks
    for arg_0, arg_1 in get_commands().items():
        try:
            Func_command_class(arg_1, arg_0)
        except django.core.exceptions.ImproperlyConfigured:
            pass

Load cron modules for applications listed in INSTALLED_APPS .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
load_feed
(
arg_1
)
arg_3
=
arg_2
[
'feed'
]
arg_4
=
arg_2
[
'entries'
]
arg_5
=
'community'
arg_6
=
'Czech Republic'
for
arg_7
in
arg_4
:
arg_8
=
sluggify
(
arg_7
[
'id'
]
)
arg_9
=
arg_7
[
'tags'
]
[
0
]
[
'term'
]
arg_10
=
arg_7
[
'link'
]
arg_11
=
dt_normalize
(
arg_7
[
'published_parsed'
]
,
local_tz
=
True
)
arg_12
=
arg_7
[
'title'
]
arg_13
=
arg_7
[
'summary'
]
arg_14
=
arg_7
[
'link'
]
ipdb
.
set_trace
(
)

def Func(arg_0, arg_1):
    """
    Rip the events from a given rss feed, normalize the data and store.
    """
    arg_2 = load_feed(arg_1)

    arg_3 = arg_2['feed']
    arg_4 = arg_2['entries']

    # THIS IS SPECIFIC TO # http://konfery.cz/rss/

    arg_5 = 'community'
    arg_6 = 'Czech Republic'
    # title, title_detail, links, link, published, summary, tags
    # unused: summary_detail, guidislink, published_parsed
    for arg_7 in arg_4:
        arg_8 = sluggify(arg_7['id'])
        arg_9 = arg_7['tags'][0]['term']
        arg_10 = arg_7['link']
        arg_11 = dt_normalize(arg_7['published_parsed'], local_tz=True)
        arg_12 = arg_7['title']
        arg_13 = arg_7['summary']
        arg_14 = arg_7['link']

        ipdb.set_trace()

Rip the events from a given rss feed normalize the data and store .


def Func ( arg_0 , arg_1 ) : arg_0 . lines , arg_0 . arcs = arg_0 . _Func ( arg_1 )

def Func(arg_0, arg_1):
        """Read the coverage data from `filename`."""
        arg_0.lines, arg_0.arcs = arg_0._Func(arg_1)


(metrics: List[Tuple[str, float]], precision: int = 4)

def Func(arg_0: arg_1[arg_2[arg_3, arg_4]], arg_5: arg_6 = 4) -> OrderedDict:
    """Prettifies the dictionary of metrics."""
    arg_7 = OrderedDict()
    for arg_8, arg_9 in arg_0:
        arg_9 = round(arg_9, arg_5)
        arg_7[arg_8] = arg_9
    return arg_7


def Func(arg_0):
    """Return the length of the indentation on the given token's line."""
    arg_1 = 0
    for arg_2 in arg_0:
        if arg_2 == " ":
            arg_1 += 1
        elif arg_2 == "\t":
            arg_1 += _TAB_LENGTH
        else:
            break
    return arg_1

Return the length of the indentation on the given token s line .


def Func(arg_0, arg_1):
    ''' Check if files in input file list have the same number of channels
    '''
    arg_2 = [
        file_info.channels(f) for f in arg_0
    ]
    if not core.all_equal(arg_2):
        raise IOError(
            "Input files do not have the same number of channels. The "
            "{} combine type requires that all files have the same "
            "number of channels"
            .format(arg_1)
        )