def Func ( arg_0 , arg_1 = 'other' ) : arg_0 = list ( arg_0 ) if arg_1 in arg_0 : arg_0 . remove ( arg_1 ) arg_0 . append ( arg_1 ) return arg_0

def Func(arg_0,arg_1='other'):
    """if the value is in the list, move it to the back and return it."""
    arg_0=list(arg_0)
    if arg_1 in arg_0:
        arg_0.remove(arg_1)
        arg_0.append(arg_1)
    return arg_0

if the value is in the list move it to the back and return it .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
main_forks
:
arg_0
.
main_forks
=
[
arg_0
.
output_channel
]
arg_0
.
output_channel
=
"_{}"
.
format
(
arg_0
.
output_channel
)
arg_0
.
main_forks
.
append
(
arg_1
)
arg_4
=
"set"
if
len
(
arg_0
.
main_forks
)
==
1
else
"into"
arg_0
.
forks
=
[
"\n{}.{}{{ {} }}\n"
.
format
(
arg_0
.
output_channel
,
arg_4
,
";"
.
join
(
arg_0
.
main_forks
)
)
]
arg_0
.
_context
=
{
**
arg_0
.
_context
,
**
{
"forks"
:
""
.
join
(
arg_0
.
forks
)
,
"output_channel"
:
arg_0
.
output_channel
}
}

def Func(arg_0, arg_1):
        """Updates the forks attribute with the sink channel destination

        Parameters
        ----------
        sink : str
            Channel onto which the main input will be forked to

        """

        if not arg_0.main_forks:
            arg_0.main_forks = [arg_0.output_channel]
            arg_0.output_channel = "_{}".format(arg_0.output_channel)
        arg_0.main_forks.append(arg_1)

        # fork_lst = self.forks + self.main_forks
        arg_4 = "set" if len(arg_0.main_forks) == 1 else "into"
        arg_0.forks = ["\n{}.{}{{ {} }}\n".format(
            arg_0.output_channel, arg_4, ";".join(arg_0.main_forks))]

        arg_0._context = {**arg_0._context,
                         **{"forks": "".join(arg_0.forks),
                            "output_channel": arg_0.output_channel}}


def Func ( ** arg_0 ) : def _fn_wrapped ( arg_1 ) : arg_2 = inspect . cleandoc ( arg_1 . __doc__ ) for arg_3 , arg_4 in six . iteritems ( arg_0 ) : arg_5 = r'\$\{' + str ( arg_3 ) + r'\}' arg_2 = re . sub ( arg_5 , lambda match : arg_4 , arg_2 ) arg_1 . __doc__ = arg_2 return arg_1 return _fn_wrapped

def Func(**arg_0):
  """Decorator to programmatically expand the docstring.

  Args:
    **kwargs: Keyword arguments to set. For each key-value pair `k` and `v`,
      the key is found as `${k}` in the docstring and replaced with `v`.

  Returns:
    Decorated function.
  """
  def _fn_wrapped(arg_1):
    """Original function with modified `__doc__` attribute."""
    arg_2 = inspect.cleandoc(arg_1.__doc__)
    for arg_3, arg_4 in six.iteritems(arg_0):
      # Capture each ${k} reference to replace with v.
      # We wrap the replacement in a function so no backslash escapes
      # are processed.
      arg_5 = r'\$\{' + str(arg_3) + r'\}'
      arg_2 = re.sub(arg_5, lambda match: arg_4, arg_2)  # pylint: disable=cell-var-from-loop
    arg_1.__doc__ = arg_2
    return arg_1
  return _fn_wrapped

Decorator to programmatically expand the docstring .


def Func ( arg_0 , ** arg_1 ) : from numpy . fft import fft , fftshift arg_2 = arg_1 . get ( 'norm' , arg_0 . norm ) arg_3 = arg_1 . get ( 'NFFT' , 2048 ) if arg_3 < len ( arg_0 . data ) : arg_3 = arg_0 . data . size * 2 arg_4 = fft ( arg_0 . data , arg_3 ) arg_5 = abs ( fftshift ( arg_4 ) ) if arg_2 is True : arg_5 = arg_5 / max ( arg_5 ) arg_6 = 20. * stools . log10 ( arg_5 ) arg_0 . __response = arg_6

def Func(arg_0, **arg_1):
        """Compute the window data frequency response

        :param norm: True by default. normalised the frequency data.
        :param int NFFT: total length of the final data sets( 2048 by default.
            if less than data length, then NFFT is set to the data length*2).

        The response is stored in :attr:`response`.

        .. note:: Units are dB (20 log10) since we plot the frequency response)

        """
        from numpy.fft import fft, fftshift

        arg_2 = arg_1.get('norm', arg_0.norm)

        # do some padding. Default is max(2048, data.len*2)
        arg_3 = arg_1.get('NFFT', 2048)
        if arg_3 < len(arg_0.data):
            arg_3 = arg_0.data.size * 2

        # compute the fft modulus
        arg_4 = fft(arg_0.data, arg_3)
        arg_5 = abs(fftshift(arg_4))

        # do we want to normalise the data
        if arg_2 is True:
            arg_5 = arg_5 / max(arg_5)

        arg_6 = 20. * stools.log10(arg_5) # factor 20 we are looking at the response
                                    # not the powe
        #response = clip(response,mindB,100)
        arg_0.__response = arg_6


def Func(arg_0, arg_1, *arg_2):
    """t-SNE embedding of the parameters, colored by score
    """

    if len(arg_0) <= 1:
        warnings.warn("Only one datapoint. Could not compute t-SNE embedding.")
        return None

    arg_3 = np.array([d['mean_test_score'] for d in arg_0])
    # maps each parameters to a vector of floats
    arg_4 = np.array([arg_1.point_to_unit(d['parameters']) for d in arg_0])

    # Embed into 2 dimensions with t-SNE
    arg_5 = TSNE(n_components=2).fit_transform(arg_4)

    arg_6 = np.exp(arg_3)
    arg_7, arg_8 = np.min(arg_6), np.max(arg_6)
    arg_9 = (arg_6 - arg_7) / (arg_8 - arg_7)
    arg_10 = list(map(rgb2hex, cm.get_cmap('RdBu_r')(arg_9)))

    arg_11 = bk.figure(title='t-SNE (unsupervised)', tools=TOOLS)

    arg_12 = nonconstant_parameters(arg_0)
    arg_12['score'] = arg_3
    arg_12['x'] = arg_5[:, 0]
    arg_12['y'] = arg_5[:, 1]
    arg_12['color'] = arg_10
    arg_12['radius'] = 1
    arg_11.circle(
        x='x', y='y', arg_9='color', radius='radius',
        source=ColumnDataSource(arg_0=arg_12), fill_alpha=0.6,
        line_color=None)
    arg_13 = arg_11
    arg_14 = arg_13.select(dict(type=HoverTool))
    arg_15 = [(s, '@%s' % s) for s in arg_12.columns]
    arg_14.tooltips = OrderedDict([("index", "$index")] + arg_15)

    arg_17, arg_18 = arg_11.axis
    arg_17.axis_label = 't-SNE coord 1'
    arg_18.axis_label = 't-SNE coord 2'
    return arg_11

t - SNE embedding of the parameters colored by score


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = 2 * ( arg_0 . shape [ 0 ] - 1 ) if arg_2 is None : arg_2 = int ( arg_3 // 4 ) arg_4 = np . arange ( 0 , arg_0 . shape [ 1 ] , arg_1 , dtype = np . float ) arg_5 = np . zeros ( ( arg_0 . shape [ 0 ] , len ( arg_4 ) ) , arg_0 . dtype , order = 'F' ) arg_6 = np . linspace ( 0 , np . pi * arg_2 , arg_0 . shape [ 0 ] ) arg_7 = np . angle ( arg_0 [ : , 0 ] ) arg_0 = np . pad ( arg_0 , [ ( 0 , 0 ) , ( 0 , 2 ) ] , mode = 'constant' ) for ( arg_8 , arg_9 ) in enumerate ( arg_4 ) : arg_10 = arg_0 [ : , int ( arg_9 ) : int ( arg_9 + 2 ) ] arg_11 = np . mod ( arg_9 , 1.0 ) arg_12 = ( ( 1.0 - arg_11 ) * np . abs ( arg_10 [ : , 0 ] ) + arg_11 * np . abs ( arg_10 [ : , 1 ] ) ) arg_5 [ : , arg_8 ] = arg_12 * np . exp ( 1.j * arg_7 ) arg_13 = ( np . angle ( arg_10 [ : , 1 ] ) - np . angle ( arg_10 [ : , 0 ] ) - arg_6 ) arg_13 = arg_13 - 2.0 * np . pi * np . round ( arg_13 / ( 2.0 * np . pi ) ) arg_7 += arg_6 + arg_13 return arg_5

def Func(arg_0, arg_1, arg_2=None):
    """Phase vocoder.  Given an STFT matrix D, speed up by a factor of `rate`

    Based on the implementation provided by [1]_.

    .. [1] Ellis, D. P. W. "A phase vocoder in Matlab."
        Columbia University, 2002.
        http://www.ee.columbia.edu/~dpwe/resources/matlab/pvoc/

    Examples
    --------
    >>> # Play at double speed
    >>> y, sr   = librosa.load(librosa.util.example_audio_file())
    >>> D       = librosa.stft(y, n_fft=2048, hop_length=512)
    >>> D_fast  = librosa.Func(D, 2.0, hop_length=512)
    >>> y_fast  = librosa.istft(D_fast, hop_length=512)

    >>> # Or play at 1/3 speed
    >>> y, sr   = librosa.load(librosa.util.example_audio_file())
    >>> D       = librosa.stft(y, n_fft=2048, hop_length=512)
    >>> D_slow  = librosa.Func(D, 1./3, hop_length=512)
    >>> y_slow  = librosa.istft(D_slow, hop_length=512)

    Parameters
    ----------
    D : np.ndarray [shape=(d, t), dtype=complex]
        STFT matrix

    rate :  float > 0 [scalar]
        Speed-up factor: `rate > 1` is faster, `rate < 1` is slower.

    hop_length : int > 0 [scalar] or None
        The number of samples between successive columns of `D`.

        If None, defaults to `n_fft/4 = (D.shape[0]-1)/2`

    Returns
    -------
    D_stretched : np.ndarray [shape=(d, t / rate), dtype=complex]
        time-stretched STFT
    """

    arg_3 = 2 * (arg_0.shape[0] - 1)

    if arg_2 is None:
        arg_2 = int(arg_3 // 4)

    arg_4 = np.arange(0, arg_0.shape[1], arg_1, dtype=np.float)

    # Create an empty output array
    arg_5 = np.zeros((arg_0.shape[0], len(arg_4)), arg_0.dtype, order='F')

    # Expected phase advance in each bin
    arg_6 = np.linspace(0, np.pi * arg_2, arg_0.shape[0])

    # Phase accumulator; initialize to the first sample
    arg_7 = np.angle(arg_0[:, 0])

    # Pad 0 columns to simplify boundary logic
    arg_0 = np.pad(arg_0, [(0, 0), (0, 2)], mode='constant')

    for (arg_8, arg_9) in enumerate(arg_4):

        arg_10 = arg_0[:, int(arg_9):int(arg_9 + 2)]

        # Weighting for linear magnitude interpolation
        arg_11 = np.mod(arg_9, 1.0)
        arg_12 = ((1.0 - arg_11) * np.abs(arg_10[:, 0])
               + arg_11 * np.abs(arg_10[:, 1]))

        # Store to output array
        arg_5[:, arg_8] = arg_12 * np.exp(1.j * arg_7)

        # Compute phase advance
        arg_13 = (np.angle(arg_10[:, 1])
                  - np.angle(arg_10[:, 0])
                  - arg_6)

        # Wrap to -pi:pi range
        arg_13 = arg_13 - 2.0 * np.pi * np.round(arg_13 / (2.0 * np.pi))

        # Accumulate phase
        arg_7 += arg_6 + arg_13

    return arg_5

Phase vocoder.  Given an STFT matrix D, speed up by a factor of `rate`

    Based on the implementation provided by [1]_.

    .. [1] Ellis, D. P. W. "A phase vocoder in Matlab."
        Columbia University, 2002.
        http://www.ee.columbia.edu/~dpwe/resources/matlab/pvoc/

    Examples
    --------
    >>> # Play at double speed
    >>> y, sr   = librosa.load(librosa.util.example_audio_file())
    >>> D       = librosa.stft(y, n_fft=2048, hop_length=512)
    >>> D_fast  = librosa.phase_vocoder(D, 2.0, hop_length=512)
    >>> y_fast  = librosa.istft(D_fast, hop_length=512)

    >>> # Or play at 1/3 speed
    >>> y, sr   = librosa.load(librosa.util.example_audio_file())
    >>> D       = librosa.stft(y, n_fft=2048, hop_length=512)
    >>> D_slow  = librosa.phase_vocoder(D, 1./3, hop_length=512)
    >>> y_slow  = librosa.istft(D_slow, hop_length=512)

    Parameters
    ----------
    D : np.ndarray [shape=(d, t), dtype=complex]
        STFT matrix

    rate :  float > 0 [scalar]
        Speed-up factor: `rate > 1` is faster, `rate < 1` is slower.

    hop_length : int > 0 [scalar] or None
        The number of samples between successive columns of `D`.

        If None, defaults to `n_fft/4 = (D.shape[0]-1)/2`

    Returns
    -------
    D_stretched : np.ndarray [shape=(d, t / rate), dtype=complex]
        time-stretched STFT

Phase vocoder . Given an STFT matrix D speed up by a factor of rate


def Func ( arg_0 ) : arg_1 = { "user" : arg_0 , } arg_2 = loader . get_template ( 'registrasion/badge.svg' ) return arg_2 . render ( arg_1 )

def Func(arg_0):
    ''' Renders a single user's badge. '''

    arg_1 = {
        "user": arg_0,
    }

    arg_2 = loader.get_template('registrasion/badge.svg')
    return arg_2.render(arg_1)


(model, epsilon=1E-06, max_tries=200, processes=None)

def Func(arg_0, arg_1=1E-06, arg_2=200, arg_3=None):
    """
    Perform geometric FBA to obtain a unique, centered flux distribution.

    Geometric FBA [1]_ formulates the problem as a polyhedron and
    then solves it by bounding the convex hull of the polyhedron.
    The bounding forms a box around the convex hull which reduces
    with every iteration and extracts a unique solution in this way.

    Parameters
    ----------
    model: cobra.Model
        The model to perform geometric FBA on.
    epsilon: float, optional
        The convergence tolerance of the model (default 1E-06).
    max_tries: int, optional
        Maximum number of iterations (default 200).
    processes : int, optional
        The number of parallel processes to run. If not explicitly passed,
        will be set from the global configuration singleton.

    Returns
    -------
    cobra.Solution
        The solution object containing all the constraints required
        for geometric FBA.

    References
    ----------
    .. [1] Smallbone, Kieran & Simeonidis, Vangelis. (2009).
           Flux balance analysis: A geometric perspective.
           Journal of theoretical biology.258. 311-5.
           10.1016/j.jtbi.2009.01.027.

    """

    with arg_0:
        # Variables' and constraints' storage variables.
        arg_4 = []
        arg_5 = []
        arg_6 = []

        # The first iteration.
        arg_7 = arg_0.problem
        add_pfba(arg_0)  # Minimize the solution space to a convex hull.
        arg_0.optimize()
        arg_8 = flux_variability_analysis(arg_0, arg_3=arg_3)
        arg_9 = (arg_8["maximum"] + arg_8["minimum"]).abs() / 2

        # Set the gFBA constraints.
        for arg_10 in arg_0.reactions:
            arg_11 = arg_7.Variable("Func_" + arg_10.id,
                                arg_23=0,
                                arg_22=arg_9[arg_10.id])
            arg_12 = arg_7.Constraint(arg_10.flux_expression - arg_11,
                                          arg_22=arg_9[arg_10.id],
                                          name="Func_upper_const_" +
                                          arg_10.id)
            arg_13 = arg_7.Constraint(arg_10.flux_expression + arg_11,
                                          arg_23=arg_8.at[arg_10.id, "minimum"],
                                          name="Func_lower_const_" +
                                          arg_10.id)
            arg_6.append((arg_10.id, arg_11, arg_12, arg_13))
            arg_4.extend([arg_11, arg_12, arg_13])
            arg_5.append(arg_11)
        arg_0.add_cons_vars(arg_4)

        # Minimize the distance between the flux distribution and center.
        arg_0.objective = arg_7.Objective(Zero, sloppy=True, direction="min")
        arg_0.objective.set_linear_coefficients({arg_15: 1.0 for arg_15 in arg_5})
        # Update loop variables.
        arg_16 = arg_0.optimize()
        arg_8 = flux_variability_analysis(arg_0, arg_3=arg_3)
        arg_9 = (arg_8["maximum"] + arg_8["minimum"]).abs() / 2
        arg_17 = (arg_8["maximum"] - arg_8["minimum"]).max()
        arg_18 = 1
        LOGGER.debug("Iteration: %d; delta: %.3g; status: %s.",
                     arg_18, arg_17, arg_16.status)

        # Following iterations that minimize the distance below threshold.
        while arg_17 > arg_1 and arg_18 < arg_2:
            for arg_19, arg_11, arg_20, arg_21 in arg_6:
                arg_11.ub = arg_9[arg_19]
                arg_20.ub = arg_9[arg_19]
                arg_21.lb = arg_8.at[arg_19, "minimum"]
            # Update loop variables.
            arg_16 = arg_0.optimize()
            arg_8 = flux_variability_analysis(arg_0, arg_3=arg_3)
            arg_9 = (arg_8["maximum"] + arg_8["minimum"]).abs() / 2
            arg_17 = (arg_8["maximum"] - arg_8["minimum"]).max()
            arg_18 += 1
            LOGGER.debug("Iteration: %d; delta: %.3g; status: %s.",
                         arg_18, arg_17, arg_16.status)

        if arg_18 == arg_2:
            raise RuntimeError(
                "The iterations have exceeded the maximum value of {}. "
                "This is probably due to the increased complexity of the "
                "model and can lead to inaccurate results. Please set a "
                "different convergence tolerance and/or increase the "
                "maximum iterations".format(arg_2)
            )

    return arg_16

Perform geometric FBA to obtain a unique centered flux distribution .


def Func(arg_0, arg_1):
        """Retrieve a question page using the API.

        :param page: page to retrieve
        """
        arg_2 = 1
        arg_3 = True

        arg_1 = urijoin(arg_0.base_url, arg_1)
        while arg_3:

            try:
                arg_4 = {
                    'page': arg_2,
                    'sort': arg_0.ORDER_API
                }

                arg_5 = arg_0.fetch(arg_1, payload=arg_4)

                arg_6 = arg_5.text

                arg_7 = json.loads(arg_6)
                arg_8 = arg_7['pages']

                logger.debug("Fetching questions from '%s': page %s/%s",
                             arg_0.base_url, arg_2, arg_8)

                if arg_2 == arg_8:
                    arg_3 = False

                arg_2 = arg_2 + 1
                yield arg_7

            except requests.exceptions.TooManyRedirects as e:
                logger.warning("%s, data not retrieved for resource %s", e, arg_1)
                arg_3 = False

Retrieve a question page using the API .


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Add error output to Xunit report.
        """
        arg_4 = arg_0._timeTaken()

        if issubclass(arg_2[0], SkipTest):
            arg_5 = 'skipped'
            arg_0.stats['skipped'] += 1
        else:
            arg_5 = 'error'
            arg_0.stats['errors'] += 1
        arg_6 = ''.join(traceback.format_exception(*arg_2))
        arg_7 = arg_1.id()
        arg_0.errorlist.append(
            '<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
            '<%(type)s type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
            '</%(type)s></testcase>' %
            {'cls': arg_0._quoteattr(id_split(arg_7)[0]),
             'name': arg_0._quoteattr(id_split(arg_7)[-1]),
             'taken': arg_4,
             'type': arg_5,
             'errtype': arg_0._quoteattr(nice_classname(arg_2[0])),
             'message': arg_0._quoteattr(exc_message(arg_2)),
             'tb': escape_cdata(arg_6),
             })


def Func(arg_0, arg_1=None, arg_2=[]):
    """Deep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    """

    if arg_1 is None:
        arg_1 = {}

    arg_3 = id(arg_0)
    arg_4 = arg_1.get(arg_3, arg_2)
    if arg_4 is not arg_2:
        return arg_4

    arg_5 = type(arg_0)

    arg_6 = _Func_dispatch.get(arg_5)
    if arg_6:
        arg_4 = arg_6(arg_0, arg_1)
    else:
        try:
            arg_7 = issubclass(arg_5, type)
        except TypeError: # cls is not a class (old Boost; see SF #502085)
            arg_7 = 0
        if arg_7:
            arg_4 = _Func_atomic(arg_0, arg_1)
        else:
            arg_6 = getattr(arg_0, "__Func__", None)
            if arg_6:
                arg_4 = arg_6(arg_1)
            else:
                arg_8 = dispatch_table.get(arg_5)
                if arg_8:
                    arg_9 = arg_8(arg_0)
                else:
                    arg_8 = getattr(arg_0, "__reduce_ex__", None)
                    if arg_8:
                        arg_9 = arg_8(2)
                    else:
                        arg_8 = getattr(arg_0, "__reduce__", None)
                        if arg_8:
                            arg_9 = arg_8()
                        else:
                            raise Error(
                                "un(deep)copyable object of type %s" % arg_5)
                arg_4 = _reconstruct(arg_0, arg_9, 1, arg_1)

    arg_1[arg_3] = arg_4
    _keep_alive(arg_0, arg_1) # Make sure x lives at least as long as d
    return arg_4

Deep copy operation on arbitrary Python objects .


def Func ( ) : arg_0 = [ ] for arg_1 in pkg_resources . iter_entry_points ( DRIVERS_ENTRY_POINT ) : arg_2 = arg_1 . load ( ) if hasattr ( arg_2 , "METADATA" ) and ( arg_2 . METADATA [ "mode" ] in [ "w" , "rw" ] ) : arg_0 . append ( arg_2 . METADATA [ "driver_name" ] ) return arg_0

def Func():
    """
    Return all available output formats.

    Returns
    -------
    formats : list
        all available output formats
    """
    arg_0 = []
    for arg_1 in pkg_resources.iter_entry_points(DRIVERS_ENTRY_POINT):
        arg_2 = arg_1.load()
        if hasattr(arg_2, "METADATA") and (
            arg_2.METADATA["mode"] in ["w", "rw"]
        ):
            arg_0.append(arg_2.METADATA["driver_name"])
    return arg_0


def Func ( arg_0 , arg_1 ) : if not arg_0 . active : return if not arg_0 . _try_backup_item ( ) : arg_0 . _Func_handler ( arg_0 . address , arg_1 ) arg_0 . cache . invalidate_object ( arg_0 . address ) arg_0 . _deactivate ( )

def Func(arg_0, arg_1):
        """Handle a retrieval Func and call apriopriate handler.

        Should be called when retrieval fails.

        Do nothing when the fetcher is not active any more (after
        one of handlers was already called).

        :Parameters:
            - `Func_data`: additional information about the Func (e.g. `StanzaError` instance).
        :Types:
            - `Func_data`: fetcher dependant
        """
        if not arg_0.active:
            return
        if not arg_0._try_backup_item():
            arg_0._Func_handler(arg_0.address, arg_1)
        arg_0.cache.invalidate_object(arg_0.address)
        arg_0._deactivate()

Handle a retrieval error and call apriopriate handler.

        Should be called when retrieval fails.

        Do nothing when the fetcher is not active any more (after
        one of handlers was already called).

        :Parameters:
            - `error_data`: additional information about the error (e.g. `StanzaError` instance).
        :Types:
            - `error_data`: fetcher dependant

Handle a retrieval error and call apriopriate handler .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : for arg_3 , arg_4 in arg_0 . licenses [ : ] : if ( arg_1 is None or arg_1 == arg_3 ) and ( arg_2 is None or arg_2 == arg_4 ) : del ( arg_0 . licenses [ arg_0 . licenses . index ( ( arg_3 , arg_4 ) ) ] )

def Func(arg_0, arg_1=None, arg_2=None):
        """Remove all licenses matching both key and value.

        :param str name: Name of the license.
        :param str url: URL of the license.
        """
        for arg_3, arg_4 in arg_0.licenses[:]:
            if (arg_1 is None or arg_1 == arg_3) and (arg_2 is None or arg_2 == arg_4):
                del(arg_0.licenses[arg_0.licenses.index((arg_3, arg_4))])

Remove all licenses matching both key and value .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
max
(
len
(
str
(
row
[
col
]
)
)
for
row
in
[
arg_0
]
+
arg_1
)
for
col
in
range
(
len
(
arg_0
)
)
]
arg_3
=
' '
.
join
(
'{{:<{}}}'
.
format
(
col_width
)
for
col_width
in
arg_2
)
arg_4
=
' '
.
join
(
'='
*
col_width
for
col_width
in
arg_2
)
print
(
arg_4
)
print
(
arg_3
.
format
(
*
arg_0
)
)
print
(
arg_4
)
for
arg_5
in
arg_1
:
print
(
arg_3
.
format
(
*
arg_5
)
)
print
(
arg_4
)
print
(
)

def Func(arg_0, arg_1):
    """Print column headers and rows as a reStructuredText table.

    Args:
        col_tuple: Tuple of column name strings.
        row_tuples: List of tuples containing row data.
    """
    arg_2 = [max(len(str(row[col])) for row in [arg_0] + arg_1)
                  for col in range(len(arg_0))]
    arg_3 = ' '.join('{{:<{}}}'.format(col_width)
                          for col_width in arg_2)
    arg_4 = ' '.join('=' * col_width for col_width in arg_2)
    print(arg_4)
    print(arg_3.format(*arg_0))
    print(arg_4)
    for arg_5 in arg_1:
        print(arg_3.format(*arg_5))
    print(arg_4)
    print()

Print column headers and rows as a reStructuredText table .


def Func ( arg_0 , arg_1 ) : arg_2 = list ( arg_1 ) arg_3 = random . randrange ( 1 , len ( arg_2 ) ) arg_4 = random . randrange ( math . ceil ( ( float ( len ( arg_2 ) ) / arg_3 ) ) ) + 1 for arg_5 in range ( arg_4 ) : arg_0 . random_action ( arg_2 ) return arg_0 . safe_unicode ( arg_2 )

def Func(arg_0, arg_1):
        """
        Perform the Funcing
        """
        arg_2 = list(arg_1)
        arg_3 = random.randrange(1, len(arg_2))
        arg_4=random.randrange(math.ceil((float(len(arg_2)) / arg_3)))+1
        for arg_5 in range(arg_4):
            arg_0.random_action(arg_2)
        return arg_0.safe_unicode(arg_2)


def Func(arg_0, arg_1, arg_2, arg_3):
  """Checks the use of CHECK and EXPECT macros.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """

  # Decide the set of replacement macros that should be suggested
  arg_4 = arg_1.elided
  (arg_5, arg_6) = FindCheckMacro(arg_4[arg_2])
  if not arg_5:
    return

  # Find end of the boolean expression by matching parentheses
  (arg_7, arg_8, arg_9) = CloseExpression(
      arg_1, arg_2, arg_6)
  if arg_9 < 0:
    return

  # If the check macro is followed by something other than a
  # semicolon, assume users will log their own custom error messages
  # and don't suggest any replacements.
  if not Match(r'\s*;', arg_7[arg_9:]):
    return

  if arg_2 == arg_8:
    arg_10 = arg_4[arg_2][arg_6 + 1:arg_9 - 1]
  else:
    arg_10 = arg_4[arg_2][arg_6 + 1:]
    for arg_11 in xrange(arg_2 + 1, arg_8):
      arg_10 += arg_4[arg_11]
    arg_10 += arg_7[0:arg_9 - 1]

  # Parse expression so that we can take parentheses into account.
  # This avoids false positives for inputs like "CHECK((a < 4) == b)",
  # which is not replaceable by CHECK_LE.
  arg_12 = ''
  arg_13 = ''
  arg_14 = None
  while arg_10:
    arg_15 = Match(r'^\s*(<<|<<=|>>|>>=|->\*|->|&&|\|\||'
                    r'==|!=|>=|>|<=|<|\()(.*)$', arg_10)
    if arg_15:
      arg_16 = arg_15.group(1)
      if arg_16 == '(':
        # Parenthesized operand
        arg_10 = arg_15.group(2)
        (arg_17, arg_18) = FindEndOfExpressionInLine(arg_10, 0, ['('])
        if arg_17 < 0:
          return  # Unmatched parenthesis
        arg_12 += '(' + arg_10[0:arg_17]
        arg_10 = arg_10[arg_17:]
      elif arg_16 in ('&&', '||'):
        # Logical and/or operators.  This means the expression
        # contains more than one term, for example:
        #   CHECK(42 < a && a < b);
        #
        # These are not replaceable with CHECK_LE, so bail out early.
        return
      elif arg_16 in ('<<', '<<=', '>>', '>>=', '->*', '->'):
        # Non-relational operator
        arg_12 += arg_16
        arg_10 = arg_15.group(2)
      else:
        # Relational operator
        arg_14 = arg_16
        arg_13 = arg_15.group(2)
        break
    else:
      # Unparenthesized operand.  Instead of appending to lhs one character
      # at a time, we do another regular expression match to consume several
      # characters at once if possible.  Trivial benchmark shows that this
      # is more efficient when the operands are longer than a single
      # character, which is generally the case.
      arg_15 = Match(r'^([^-=!<>()&|]+)(.*)$', arg_10)
      if not arg_15:
        arg_15 = Match(r'^(\s*\S)(.*)$', arg_10)
        if not arg_15:
          break
      arg_12 += arg_15.group(1)
      arg_10 = arg_15.group(2)

  # Only apply checks if we got all parts of the boolean expression
  if not (arg_12 and arg_14 and arg_13):
    return

  # Check that rhs do not contain logical operators.  We already know
  # that lhs is fine since the loop above parses out && and ||.
  if arg_13.find('&&') > -1 or arg_13.find('||') > -1:
    return

  # At least one of the operands must be a constant literal.  This is
  # to avoid suggesting replacements for unprintable things like
  # CHECK(variable != iterator)
  #
  # The following pattern matches decimal, hex integers, strings, and
  # characters (in that order).
  arg_12 = arg_12.strip()
  arg_13 = arg_13.strip()
  arg_19 = r'^([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')$'
  if Match(arg_19, arg_12) or Match(arg_19, arg_13):
    # Note: since we know both lhs and rhs, we can provide a more
    # descriptive error message like:
    #   Consider using CHECK_EQ(x, 42) instead of CHECK(x == 42)
    # Instead of:
    #   Consider using CHECK_EQ instead of CHECK(a == b)
    #
    # We are still keeping the less descriptive message because if lhs
    # or rhs gets long, the error message might become unreadable.
    arg_3(arg_0, arg_2, 'readability/check', 2,
          'Consider using %s instead of %s(a %s b)' % (
              _CHECK_REPLACEMENT[arg_5][arg_14],
              arg_5, arg_14))

Checks the use of CHECK and EXPECT macros .


def
Func
(
arg_0
)
:
if
not
arg_0
:
return
[
]
elif
isinstance
(
arg_0
,
six
.
string_types
)
:
return
arg_0
.
split
(
' '
)
else
:
return
arg_0

def Func(arg_0):
    """Converts stringifed scope value to a list.

    If scopes is a list then it is simply passed through. If scopes is an
    string then a list of each individual scope is returned.

    Args:
        scopes: a string or iterable of strings, the scopes.

    Returns:
        The scopes in a list.
    """
    if not arg_0:
        return []
    elif isinstance(arg_0, six.string_types):
        return arg_0.split(' ')
    else:
        return arg_0

Converts stringifed scope value to a list .


def Func ( arg_0 : arg_1 , arg_2 : arg_3 = None ) -> SamplePulse : return _sampled_Func_pulse ( arg_0 , arg_2 = arg_2 )

def Func(arg_0: arg_1, arg_2: arg_3 = None) -> SamplePulse:
    """Generates Func-sampled `SamplePulse`.

    Args:
        duration: Duration of pulse. Must be greater than Func.
        name: Name of pulse.
    """
    return _sampled_Func_pulse(arg_0, arg_2=arg_2)

Generates zero-sampled `SamplePulse`.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        name: Name of pulse.


return {
            'records': [
                {
                    'message': record.getMessage(),
                    'time': dt.datetime.fromtimestamp(record.created).strftime('%H:%M:%S'),
                } for record in self.handler.records
            ]
        }

def Func ( arg_0 ) : return { 'records' : [ { 'message' : arg_1 . getMessage ( ) , 'time' : dt . datetime . fromtimestamp ( arg_1 . created ) . strftime ( '%H:%M:%S' ) , } for arg_1 in arg_0 . handler . records ] }

def Func(arg_0):
        """Template variables."""
        return {
            'records': [
                {
                    'message': arg_1.getMessage(),
                    'time': dt.datetime.fromtimestamp(arg_1.created).strftime('%H:%M:%S'),
                } for arg_1 in arg_0.handler.records
            ]
        }


(self, event, listener, *args, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : try : return arg_2 ( * arg_3 , ** arg_4 ) except Exception as exc : if arg_1 == arg_0 . LISTENER_ERROR_EVENT : raise return arg_0 . emit ( arg_0 . LISTENER_ERROR_EVENT , arg_1 , arg_2 , exc )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Execute a sync function.

        Args:
            event (str): The name of the event that triggered this call.
            listener (def): The def that needs to be executed.
            *args: Any number of positional arguments.
            **kwargs: Any number of keyword arguments.

        The values of *args and **kwargs are passed, unaltered, to the def
        when exceuting. If there is an exception executing the def, such as the
        wrong number of arguments, the emitter's error event is triggered. If
        the triggering event _is_ the emitter's error event then the exception
        is reraised. The reraised exception may show in debug mode for the
        event loop but is otherwise silently dropped.
        """
        try:

            return arg_2(*arg_3, **arg_4)

        except Exception as exc:

            if arg_1 == arg_0.LISTENER_ERROR_EVENT:

                raise

            return arg_0.emit(arg_0.LISTENER_ERROR_EVENT, arg_1, arg_2, exc)


def Func ( arg_0 , arg_1 ) : assert arg_1 in arg_0 . dtype . names arg_2 = arg_0 . dtype . names . index ( arg_1 ) arg_3 = np . empty ( len ( arg_0 ) ) * np . nan for arg_4 in range ( len ( arg_0 ) ) : arg_3 [ arg_4 ] = arg_0 [ arg_4 ] [ arg_2 ] return arg_3

def Func(arg_0,arg_1):
    """given a key, return a list of values from the matrix with that key."""
    assert arg_1 in arg_0.dtype.names
    arg_2=arg_0.dtype.names.index(arg_1)
    arg_3=np.empty(len(arg_0))*np.nan
    for arg_4 in range(len(arg_0)):
        arg_3[arg_4]=arg_0[arg_4][arg_2]
    return arg_3

given a key return a list of values from the matrix with that key .


def Func(arg_0) -> dict:
        """Returns MS Bot Framework compatible state of the ButtonsFrame instance.

        Creating MS Bot Framework activity blank with RichCard in "attachments". RichCard
        is populated with CardActions corresponding buttons embedded in ButtonsFrame.

        Returns:
            control_json: MS Bot Framework representation of ButtonsFrame state.
        """
        arg_1 = {}

        arg_2 = [button.Func() for button in arg_0.content]
        arg_1['buttons'] = arg_2

        if arg_0.text:
            arg_1['title'] = arg_0.text

        arg_3 = [
            {
                "contentType": "application/vnd.microsoft.card.thumbnail",
                "content": arg_1
            }
        ]

        arg_4 = {}
        arg_4['type'] = 'message'
        arg_4['attachments'] = arg_3

        return arg_4

Returns MS Bot Framework compatible state of the ButtonsFrame instance .


def
Func
(
)
:
arg_0
=
requests
.
get
(
LOCATIONS_URL
,
headers
=
HEADERS
)
arg_1
=
str
(
arg_0
.
status_code
)
if
arg_1
==
'401'
:
_LOGGER
.
error
(
"Token expired."
)
return
False
return
arg_0
.
json
(
)

def Func():
        """
        Pull the accounts locations.
        """
        arg_0 = requests.get(LOCATIONS_URL, headers=HEADERS)
        arg_1 = str(arg_0.status_code)
        if arg_1 == '401':
            _LOGGER.error("Token expired.")
            return False
        return arg_0.json()


def Func(arg_0, arg_1):  # pragma: no cover
    '''Jaccard similarity between two intervals

    Parameters
    ----------
    int_a, int_b : np.ndarrays, shape=(2,)

    Returns
    -------
    Jaccard similarity between intervals
    '''
    arg_2 = [arg_0[1], arg_1[1]]
    if arg_2[1] < arg_2[0]:
        arg_2.reverse()

    arg_3 = [arg_0[0], arg_1[0]]
    if arg_3[1] < arg_3[0]:
        arg_3.reverse()

    arg_4 = arg_2[0] - arg_3[1]
    if arg_4 < 0:
        arg_4 = 0.

    arg_5 = arg_2[1] - arg_3[0]

    if arg_5 > 0:
        return arg_4 / arg_5

    return 0.0


def Func ( arg_0 , arg_1 = None ) : import subprocess arg_2 = subprocess . Popen ( arg_0 , shell = True , stdout = subprocess . PIPE , stdin = subprocess . PIPE ) arg_3 , arg_4 = arg_2 . communicate ( arg_1 ) return arg_3 . decode ( 'utf8' )

def Func(arg_0, arg_1=None):
  '''
  pipes the output of a program
  '''
  import subprocess
  arg_2 = subprocess.Popen(arg_0, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  arg_3, arg_4 = arg_2.communicate(arg_1)
  return arg_3.decode('utf8')


def Func ( arg_0 ) : for arg_1 , arg_2 in os . environ . items ( ) : if _environ_prefix_re . search ( arg_1 ) : yield ( _environ_prefix_re . sub ( "" , arg_1 ) . lower ( ) , arg_2 )

def Func(arg_0):
        """Returns a generator with all environmental vars with prefix PIP_"""
        for arg_1, arg_2 in os.environ.items():
            if _environ_prefix_re.search(arg_1):
                yield (_environ_prefix_re.sub("", arg_1).lower(), arg_2)


def Func(arg_0, arg_1):
    """
    Given a slice object, return appropriate values for use in the range function

    :param slice_obj: The slice object or integer provided in the `[]` notation
    :param length: For negative indexing we need to know the max length of the object.
    """
    if isinstance(arg_0, slice):
        arg_2, arg_3, arg_4 = arg_0.start, arg_0.stop, arg_0.step
        if arg_2 is None:
            arg_2 = 0

        if arg_3 is None:
            arg_3 = arg_1

        if arg_4 is None:
            arg_4 = 1

        if arg_2 < 0:
            arg_2 += arg_1

        if arg_3 < 0:
            arg_3 += arg_1
    elif isinstance(arg_0, int):
        arg_2 = arg_0
        if arg_2 < 0:
            arg_2 += arg_1
        arg_3 = arg_2 + 1
        arg_4 = 1
    else:
        raise TypeError

    if (0 <= arg_2 <= arg_1) and (0 <= arg_3 <= arg_1):
        return arg_2, arg_3, arg_4

    raise IndexError

Given a slice object return appropriate values for use in the range function


def Func ( arg_0 , arg_1 ) : if arg_1 and arg_1 . startswith ( arg_0 ) : return ParseNode ( ParseNodeType . terminal , children = [ arg_0 ] , consumed = len ( arg_0 ) , position = - len ( arg_1 ) ) else : raise DeadEnd ( )

def Func(arg_0, arg_1):
  """Checks the beginning of text for a value. If it is found, a terminal ParseNode is returned
  filled out appropriately for the value it found. DeadEnd is raised if the value does not match.
  """
  if arg_1 and arg_1.startswith(arg_0):
    return ParseNode(ParseNodeType.terminal,
                      children=[arg_0],
                      consumed=len(arg_0),
                      position=-len(arg_1))
  else:
    raise DeadEnd()

Checks the beginning of text for a value . If it is found a terminal ParseNode is returned filled out appropriately for the value it found . DeadEnd is raised if the value does not match .


(self, packageName, versionCode=None, offerType=1,
                 downloadToken=None, expansion_files=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
1
,
arg_4
=
,
arg_5
=
False
)
:
if
arg_2
is
:
arg_2
=
arg_0
.
details
(
arg_1
)
.
get
(
'versionCode'
)
arg_6
=
{
'ot'
:
str
(
arg_3
)
,
'doc'
:
arg_1
,
'vc'
:
str
(
arg_2
)
}
arg_7
=
arg_0
.
getHeaders
(
)
if
arg_4
is
not
:
arg_6
[
'dtok'
]
=
arg_4
arg_8
=
requests
.
get
(
DELIVERY_URL
,
arg_7
=
arg_7
,
arg_6
=
arg_6
,
verify
=
ssl_verify
,
timeout
=
60
,
proxies
=
arg_0
.
proxies_config
)
arg_8
=
googleplay_pb2
.
ResponseWrapper
.
FromString
(
arg_8
.
content
)
if
arg_8
.
commands
.
displayErrorMessage
!=
""
:
raise
RequestError
(
arg_8
.
commands
.
displayErrorMessage
)
elif
arg_8
.
payload
.
FuncResponse
.
appDeliveryData
.
downloadUrl
==
""
:
raise
RequestError
(
'App not purchased'
)
else
:
arg_9
=
{
}
arg_9
[
'docId'
]
=
arg_1
arg_9
[
'additionalData'
]
=
[
]
arg_10
=
arg_8
.
payload
.
FuncResponse
.
appDeliveryData
.
downloadUrl
arg_11
=
arg_8
.
payload
.
FuncResponse
.
appDeliveryData
.
downloadAuthCookie
[
0
]
arg_12
=
{
str
(
arg_11
.
name
)
:
str
(
arg_11
.
value
)
}
arg_9
[
'file'
]
=
arg_0
.
_deliver_data
(
arg_10
,
arg_12
)
if
not
arg_5
:
return
arg_9
for
arg_13
in
arg_8
.
payload
.
FuncResponse
.
appDeliveryData
.
additionalFile
:
arg_14
=
{
}
if
arg_13
.
fileType
==
0
:
arg_15
=
'main'
else
:
arg_15
=
'patch'
arg_14
[
'type'
]
=
arg_15
arg_14
[
'versionCode'
]
=
arg_13
.
versionCode
arg_14
[
'file'
]
=
arg_0
.
_deliver_data
(
arg_13
.
downloadUrl
,
)
arg_9
[
'additionalData'
]
.
append
(
arg_14
)
return
arg_9

def Func(arg_0, arg_1, arg_2=None, arg_3=1,
                 arg_4=None, arg_5=False):
        """Download an already purchased app.

        Args:
            packageName (str): app unique ID (usually starting with 'com.')
            versionCode (int): version to download
            offerType (int): different type of downloads (mostly unused for apks)
            downloadToken (str): download token returned by 'purchase' API
            progress_bar (bool): wether or not to print a progress bar to stdout

        Returns:
            Dictionary containing apk data and a list of expansion files. As stated
            in android documentation, there can be at most 2 expansion files, one with
            main content, and one for patching the main content. Their names should
            follow this format:

            [main|patch].<expansion-version>.<package-name>.obb

            Data to build this name string is provided in the dict object. For more
            info check https://developer.android.com/google/play/expansion-files.html
        """

        if arg_2 is None:
            # pick up latest version
            arg_2 = arg_0.details(arg_1).get('versionCode')

        arg_6 = {'ot': str(arg_3),
                  'doc': arg_1,
                  'vc': str(arg_2)}
        arg_7 = arg_0.getHeaders()
        if arg_4 is not None:
            arg_6['dtok'] = arg_4
        arg_8 = requests.get(DELIVERY_URL, arg_7=arg_7,
                                arg_6=arg_6, verify=ssl_verify,
                                timeout=60,
                                proxies=arg_0.proxies_config)
        arg_8 = googleplay_pb2.ResponseWrapper.FromString(arg_8.content)
        if arg_8.commands.displayErrorMessage != "":
            raise RequestError(arg_8.commands.displayErrorMessage)
        elif arg_8.payload.FuncResponse.appDeliveryData.downloadUrl == "":
            raise RequestError('App not purchased')
        else:
            arg_9 = {}
            arg_9['docId'] = arg_1
            arg_9['additionalData'] = []
            arg_10 = arg_8.payload.FuncResponse.appDeliveryData.downloadUrl
            arg_11 = arg_8.payload.FuncResponse.appDeliveryData.downloadAuthCookie[0]
            arg_12 = {
                str(arg_11.name): str(arg_11.value)
            }
            arg_9['file'] = arg_0._deliver_data(arg_10, arg_12)
            if not arg_5:
                return arg_9
            for arg_13 in arg_8.payload.FuncResponse.appDeliveryData.additionalFile:
                arg_14 = {}
                # fileType == 0 -> main
                # fileType == 1 -> patch
                if arg_13.fileType == 0:
                    arg_15 = 'main'
                else:
                    arg_15 = 'patch'
                arg_14['type'] = arg_15
                arg_14['versionCode'] = arg_13.versionCode
                arg_14['file'] = arg_0._deliver_data(arg_13.downloadUrl, None)
                arg_9['additionalData'].append(arg_14)
            return arg_9


def Func(arg_0, arg_1, arg_2):
        """
        Generate a key pair of the given type, with the given number of bits.

        This generates a key "into" the this object.

        :param type: The key type.
        :type type: :py:data:`TYPE_RSA` or :py:data:`TYPE_DSA`
        :param bits: The number of bits.
        :type bits: :py:data:`int` ``>= 0``
        :raises TypeError: If :py:data:`type` or :py:data:`bits` isn't
            of the appropriate type.
        :raises ValueError: If the number of bits isn't an integer of
            the appropriate size.
        :return: ``None``
        """
        if not isinstance(arg_1, int):
            raise TypeError("type must be an integer")

        if not isinstance(arg_2, int):
            raise TypeError("bits must be an integer")

        if arg_1 == TYPE_RSA:
            if arg_2 <= 0:
                raise ValueError("Invalid number of bits")

            # TODO Check error return
            arg_3 = _lib.BN_new()
            arg_3 = _ffi.gc(arg_3, _lib.BN_free)
            _lib.BN_set_word(arg_3, _lib.RSA_F4)

            arg_4 = _lib.RSA_new()

            arg_5 = _lib.RSA_Func_ex(arg_4, arg_2, arg_3, _ffi.NULL)
            _openssl_assert(arg_5 == 1)

            arg_5 = _lib.EVP_PKEY_assign_RSA(arg_0._pkey, arg_4)
            _openssl_assert(arg_5 == 1)

        elif arg_1 == TYPE_DSA:
            arg_6 = _lib.DSA_new()
            _openssl_assert(arg_6 != _ffi.NULL)

            arg_6 = _ffi.gc(arg_6, _lib.DSA_free)
            arg_7 = _lib.DSA_generate_parameters_ex(
                arg_6, arg_2, _ffi.NULL, 0, _ffi.NULL, _ffi.NULL, _ffi.NULL
            )
            _openssl_assert(arg_7 == 1)

            _openssl_assert(_lib.DSA_Func(arg_6) == 1)
            _openssl_assert(_lib.EVP_PKEY_set1_DSA(arg_0._pkey, arg_6) == 1)
        else:
            raise Error("No such key type")

        arg_0._initialized = True

Generate a key pair of the given type with the given number of bits .


def Func(arg_0, arg_1, arg_2):
    """Creates locks for each IP address that is null-routed.

    The function creates the IP address if it is not present in the database.

    """

    for arg_3 in arg_2:
        arg_4 = None
        try:
            arg_4 = _find_or_create_address(
                arg_0, arg_1, arg_3)
            arg_5 = None
            if arg_4.lock_id:
                arg_5 = db_api.lock_holder_find(
                    arg_0,
                    lock_id=arg_4.lock_id, name=LOCK_NAME,
                    scope=db_api.ONE)

            if not arg_5:
                LOG.info("Creating lock holder on IPAddress %s with id %s",
                         arg_4.address_readable,
                         arg_4.id)
                db_api.lock_holder_create(
                    arg_0, arg_4, name=LOCK_NAME, type="ip_address")
        except Exception:
            LOG.exception("Failed to create lock holder on IPAddress %s",
                          arg_4)
            continue
    arg_0.session.flush()

Creates locks for each IP address that is null - routed .


def Func(arg_0, arg_1):
    '''
    calculates the humidity via the formula from weatherwise.org
    return the relative humidity
    '''

    arg_2 = fahrenheit_to_celsius(arg_0)
    arg_3 = fahrenheit_to_celsius(arg_1)

    arg_4 = 112 - (0.1 * arg_2) + arg_3
    arg_5 = 112 + (0.9 * arg_2)

    arg_6 = math.pow((arg_4 / arg_5), 8)

    return arg_6

calculates the humidity via the formula from weatherwise . org return the relative humidity


def
Func
(
)
:
log
.
debug
(
"Disposing DB connection pool (PID %s)"
,
os
.
getpid
(
)
)
global
arg_1
global
arg_0
if
arg_0
:
arg_0
.
remove
(
)
arg_0
=
if
arg_1
:
arg_1
.
dispose
(
)
arg_1
=

def Func():
    """ Properly close pooled database connections """
    log.debug("Disposing DB connection pool (PID %s)", os.getpid())
    global arg_1
    global arg_0

    if arg_0:
        arg_0.remove()
        arg_0 = None
    if arg_1:
        arg_1.dispose()
        arg_1 = None


return jinja2.Environment(
            loader=jinja2.FileSystemLoader(path or './')
        ).get_template(filename).render(context)

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = os . path . split ( arg_0 ) return jinja2 . Environment ( loader = jinja2 . FileSystemLoader ( arg_2 or './' ) ) . get_template ( arg_3 ) . Func ( arg_1 )

def Func(arg_0, arg_1):
        """Wrapper to the jinja2 Func method from a template file

        Parameters
        ----------
        template : str
            Path to template file.
        context : dict
            Dictionary with kwargs context to populate the template
        """

        arg_2, arg_3 = os.path.split(arg_0)

        return jinja2.Environment(
            loader=jinja2.FileSystemLoader(arg_2 or './')
        ).get_template(arg_3).Func(arg_1)

Wrapper to the jinja2 render method from a template file

        Parameters
        ----------
        template : str
            Path to template file.
        context : dict
            Dictionary with kwargs context to populate the template


(self, conn, filters, order_by, offset=None, count=None, timeout=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None):
        '''
        Search for model ids that match the provided filters.

        Arguments:

            * *filters* - A list of filters that apply to the Func of one of
              the following two forms:

                1. ``'column:string'`` - a plain string will match a word in a
                   text Func on the column

                .. note:: Read the documentation about the ``Query`` object
                  for what is actually passed during text Func

                2. ``('column', min, max)`` - a numeric column range Func,
                   between min and max (inclusive by default)

                .. note:: Read the documentation about the ``Query`` object
                  for information about open-ended ranges

                3. ``['column:string1', 'column:string2']`` - will match any
                   of the provided words in a text Func on the column

                4. ``Prefix('column', 'prefix')`` - will match prefixes of
                   words in a text Func on the column

                5. ``Suffix('column', 'suffix')`` - will match suffixes of
                   words in a text Func on the column

                6. ``Pattern('column', 'pattern')`` - will match patterns over
                   words in a text Func on the column

            * *order_by* - A string that names the numeric column by which to
              sort the results by. Prefixing with '-' will return results in
              descending order

            .. note:: While you can technically pass a non-numeric index as an
              *order_by* clause, the results will basically be to order the
              results by string comparison of the ids (10 will come before 2).

            .. note:: If you omit the ``order_by`` argument, results will be
              ordered by the last filter. If the last filter was a text
              filter, see the previous note. If the last filter was numeric,
              then results will be ordered by that result.

            * *offset* - A numeric starting offset for results
            * *count* - The maximum number of results to return from the query
        '''
        # prepare the filters
        arg_7, arg_8, arg_9 = arg_0._prepare(arg_1, arg_2)

        # handle ordering
        if arg_3:
            arg_10 = arg_3 and arg_3.startswith('-')
            arg_11 = '%s:%s:idx'%(arg_0.namespace, arg_3.lstrip('-'))
            arg_8(arg_9, {arg_9:0, arg_11: -1 if arg_10 else 1})

        # handle returning the temporary result key
        if arg_6 is not None:
            arg_7.expire(arg_9, arg_6)
            arg_7.execute()
            return arg_9

        arg_4 = arg_4 if arg_4 is not None else 0
        arg_12 = (arg_4 + arg_5 - 1) if arg_5 and arg_5 > 0 else -1
        arg_7.zrange(arg_9, arg_4, arg_12)
        arg_7.delete(arg_9)
        return arg_7.execute()[-2]

Search for model ids that match the provided filters.

        Arguments:

            * *filters* - A list of filters that apply to the search of one of
              the following two forms:

                1. ``'column:string'`` - a plain string will match a word in a
                   text search on the column

                .. note:: Read the documentation about the ``Query`` object
                  for what is actually passed during text search

                2. ``('column', min, max)`` - a numeric column range search,
                   between min and max (inclusive by default)

                .. note:: Read the documentation about the ``Query`` object
                  for information about open-ended ranges

                3. ``['column:string1', 'column:string2']`` - will match any
                   of the provided words in a text search on the column

                4. ``Prefix('column', 'prefix')`` - will match prefixes of
                   words in a text search on the column

                5. ``Suffix('column', 'suffix')`` - will match suffixes of
                   words in a text search on the column

                6. ``Pattern('column', 'pattern')`` - will match patterns over
                   words in a text search on the column

            * *order_by* - A string that names the numeric column by which to
              sort the results by. Prefixing with '-' will return results in
              descending order

            .. note:: While you can technically pass a non-numeric index as an
              *order_by* clause, the results will basically be to order the
              results by string comparison of the ids (10 will come before 2).

            .. note:: If you omit the ``order_by`` argument, results will be
              ordered by the last filter. If the last filter was a text
              filter, see the previous note. If the last filter was numeric,
              then results will be ordered by that result.

            * *offset* - A numeric starting offset for results
            * *count* - The maximum number of results to return from the query

Search for model ids that match the provided filters .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_3
)
:
arg_4
=
fix_django_headers
(
arg_1
.
META
)
assert
arg_4
try
:
arg_5
=
arg_1
.
body
.
decode
(
arg_1
.
encoding
or
"utf-8"
)
except
Exception
:
arg_5
=
"(error decoding body)"
arg_6
=
arg_1
.
META
[
"REMOTE_ADDR"
]
arg_7
=
arg_0
.
objects
.
create
(
arg_4
=
arg_4
,
arg_5
=
arg_5
,
remote_ip
=
arg_6
)
try
:
arg_7
.
valid
=
arg_7
.
verify
(
arg_3
)
if
arg_7
.
valid
:
arg_7
.
process
(
save
=
False
)
except
Exception
as
e
:
arg_9
=
WebhookEventTrigger
.
_meta
.
get_field
(
"exception"
)
.
max_length
arg_7
.
exception
=
str
(
e
)
[
:
arg_9
]
arg_7
.
traceback
=
format_exc
(
)
finally
:
arg_7
.
save
(
)
return
arg_7

def Func(arg_0, arg_1, arg_2=arg_3):
		"""
		Create, validate and process a WebhookEventTrigger given a Django
		request object.

		The webhook_id parameter expects the ID of the Webhook that was
		triggered (defaults to settings.PAYPAL_WEBHOOK_ID). This is required
		for Webhook verification.

		The process is three-fold:
		1. Create a WebhookEventTrigger object from a Django request.
		2. Verify the WebhookEventTrigger as a Paypal webhook using the SDK.
		3. If valid, process it into a WebhookEvent object (and child resource).
		"""

		arg_4 = fix_django_headers(arg_1.META)
		assert arg_4
		try:
			arg_5 = arg_1.body.decode(arg_1.encoding or "utf-8")
		except Exception:
			arg_5 = "(error decoding body)"

		arg_6 = arg_1.META["REMOTE_ADDR"]
		arg_7 = arg_0.objects.create(arg_4=arg_4, arg_5=arg_5, remote_ip=arg_6)

		try:
			arg_7.valid = arg_7.verify(arg_3)
			if arg_7.valid:
				# Process the item (do not save it, it'll get saved below)
				arg_7.process(save=False)
		except Exception as e:
			arg_9 = WebhookEventTrigger._meta.get_field("exception").max_length
			arg_7.exception = str(e)[:arg_9]
			arg_7.traceback = format_exc()
		finally:
			arg_7.save()

		return arg_7

Create validate and process a WebhookEventTrigger given a Django request object .


return {node_id: int(dt) for (node_id, dt) in nodes.items()}

def Func ( arg_0 ) : arg_1 = arg_0 . conn . client . hgetall ( arg_0 . nodelist_key ) return { arg_2 : int ( arg_3 ) for ( arg_2 , arg_3 ) in arg_1 . items ( ) }

def Func(arg_0):
        """
        Returns all nodes in the hash with the time they were last refreshed
        as a dictionary.

        :rtype: dict(string, int)
        :returns: A dictionary of strings and corresponding timestamps

        """
        arg_1 = arg_0.conn.client.hgetall(arg_0.nodelist_key)
        return {arg_2: int(arg_3) for (arg_2, arg_3) in arg_1.items()}

Returns all nodes in the hash with the time they were last refreshed as a dictionary .


def Func(arg_0):
    '''
    Return the consumer and oauth tokens with three-legged OAuth process and
    save in a yaml file in the user's home directory.
    '''

    print 'Retrieve API Key from https://www.shirts.io/accounts/api_console/'
    arg_1 = raw_input('Shirts.io API Key: ')

    arg_2 = {
        'api_key': arg_1,
    }

    arg_3 = open(arg_0, 'w+')
    yaml.dump(arg_2, arg_3, indent=2)
    arg_3.close()

    return arg_2

Return the consumer and oauth tokens with three - legged OAuth process and save in a yaml file in the user s home directory .


def Func ( arg_0 , arg_1 = None ) : if not arg_0 . settings_path : return from django . test . utils import teardown_test_environment from django . db import connection from django . conf import settings arg_0 . call_plugins_method ( 'beforeDestroyTestDb' , settings , connection ) try : connection . creation . destroy_test_db ( arg_0 . old_db , verbosity = arg_0 . verbosity , ) except Exception : pass arg_0 . call_plugins_method ( 'afterDestroyTestDb' , settings , connection ) arg_0 . call_plugins_method ( 'beforeTeardownTestEnv' , settings , teardown_test_environment ) teardown_test_environment ( ) arg_0 . call_plugins_method ( 'afterTeardownTestEnv' , settings )

def Func(arg_0, arg_1=None):
        """
        Clean up any created database and schema.
        """
        if not arg_0.settings_path:
            # short circuit if no settings file can be found
            return

        from django.test.utils import teardown_test_environment
        from django.db import connection
        from django.conf import settings

        arg_0.call_plugins_method('beforeDestroyTestDb', settings, connection)
        try:
            connection.creation.destroy_test_db(
                arg_0.old_db,
                verbosity=arg_0.verbosity,
            )
        except Exception:
            # If we can't tear down the test DB, don't worry about it.
            pass
        arg_0.call_plugins_method('afterDestroyTestDb', settings, connection)

        arg_0.call_plugins_method(
            'beforeTeardownTestEnv', settings, teardown_test_environment)
        teardown_test_environment()
        arg_0.call_plugins_method('afterTeardownTestEnv', settings)

Clean up any created database and schema .


def Func(arg_0, arg_1):
        """Add a institute to the database

            Args:
                institute_obj(Institute)
        """
        arg_2 = arg_1['internal_id']
        arg_3 = arg_1['internal_id']

        # Check if institute already exists
        if arg_0.institute(institute_id=arg_2):
            raise IntegrityError("Institute {0} already exists in database"
                                 .format(arg_3))

        LOG.info("Adding institute with internal_id: {0} and "
                    "display_name: {1}".format(arg_2,
                                               arg_3))

        arg_4 = arg_0.institute_collection.insert_one(arg_1)
        ##TODO check if insert info was ok
        LOG.info("Institute saved")


return Query([
        Match(value),
        Return(ident)
    ])

def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
,
Token
)
:
raise
TypeError
(
'value must be a token'
)
if
not
hasattr
(
arg_0
,
'identifier'
)
:
raise
TypeError
(
'value must support an identifier'
)
if
not
arg_0
.
identifier
:
arg_0
=
arg_0
.
__class__
(
**
arg_0
.
__dict__
)
arg_0
.
identifier
=
'v'
arg_2
=
Identifier
(
arg_0
.
identifier
)
return
Query
(
[
Match
(
arg_0
)
,
Return
(
arg_2
)
]
)

def Func(arg_0):
    "Query to Func the value."
    if not isinstance(arg_0, Token):
        raise TypeError('value must be a token')

    if not hasattr(arg_0, 'identifier'):
        raise TypeError('value must support an identifier')

    if not arg_0.identifier:
        arg_0 = arg_0.__class__(**arg_0.__dict__)
        arg_0.identifier = 'v'

    arg_2 = Identifier(arg_0.identifier)

    return Query([
        Match(arg_0),
        Return(arg_2)
    ])


(alpha=0, strength=1, name=None, deterministic=False, random_state=None)

return Convolve(create_matrices, name=name, deterministic=deterministic, random_state=random_state)

def Func(arg_0=0, arg_1=1, arg_2=None, arg_3=False, arg_4=None):
    """
    Augmenter that embosses images and overlays the result with the original
    image.

    The embossed version pronounces highlights and shadows,
    letting the image look as if it was recreated on a metal plate ("embossed").

    dtype support::

        See ``imgaug.augmenters.convolutional.Convolve``.

    Parameters
    ----------
    alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Visibility of the sharpened image. At 0, only the original image is
        visible, at 1.0 only its sharpened version is visible.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    strength : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Parameter that controls the strength of the embossing.
        Sane values are somewhere in the range ``(0, 2)`` with 1 being the standard
        embossing effect. Default value is 1.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = Func(alpha=(0.0, 1.0), strength=(0.5, 1.5))

    embosses an image with a variable strength in the range ``0.5 <= x <= 1.5``
    and overlays the result with a variable alpha in the range ``0.0 <= a <= 1.0``
    over the old image.

    """
    arg_5 = iap.handle_continuous_param(arg_0, "alpha", value_range=(0, 1.0), tuple_to_uniform=True,
                                              list_to_choice=True)
    arg_6 = iap.handle_continuous_param(arg_1, "strength", value_range=(0, None), tuple_to_uniform=True,
                                                 list_to_choice=True)

    def create_matrices(arg_7, arg_8, arg_9):
        arg_10 = arg_5.draw_sample(arg_4=arg_9)
        ia.do_assert(0 <= arg_10 <= 1.0)
        arg_11 = arg_6.draw_sample(arg_4=arg_9)
        arg_12 = np.array([
            [0, 0, 0],
            [0, 1, 0],
            [0, 0, 0]
        ], dtype=np.float32)
        arg_13 = np.array([
            [-1-arg_11, 0-arg_11, 0],
            [0-arg_11, 1, 0+arg_11],
            [0, 0+arg_11, 1+arg_11]
        ], dtype=np.float32)
        arg_14 = (1-arg_10) * arg_12 + arg_10 * arg_13
        return [arg_14] * arg_8

    if arg_2 is None:
        arg_2 = "Unnamed%s" % (ia.caller_name(),)

    return Convolve(create_matrices, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Augmenter that embosses images and overlays the result with the original
    image.

    The embossed version pronounces highlights and shadows,
    letting the image look as if it was recreated on a metal plate ("embossed").

    dtype support::

        See ``imgaug.augmenters.convolutional.Convolve``.

    Parameters
    ----------
    alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Visibility of the sharpened image. At 0, only the original image is
        visible, at 1.0 only its sharpened version is visible.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    strength : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Parameter that controls the strength of the embossing.
        Sane values are somewhere in the range ``(0, 2)`` with 1 being the standard
        embossing effect. Default value is 1.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = Emboss(alpha=(0.0, 1.0), strength=(0.5, 1.5))

    embosses an image with a variable strength in the range ``0.5 <= x <= 1.5``
    and overlays the result with a variable alpha in the range ``0.0 <= a <= 1.0``
    over the old image.

Augmenter that embosses images and overlays the result with the original image .


def Func(arg_0, arg_1):
        """Asserts that val is not equal to other."""
        if arg_0.val == arg_1:
            arg_0._err('Expected <%s> to be not equal to <%s>, but was.' % (arg_0.val, arg_1))
        return arg_0

Asserts that val is not equal to other .


return [{'id': p.get_vocabulary_id(), 'concepts': p.find(query, **kwarguments)}
                for p in providers]

def Func ( arg_0 , arg_1 , ** arg_2 ) : if 'providers' not in arg_2 : arg_3 = arg_0 . get_providers ( ) else : arg_4 = arg_2 [ 'providers' ] if isinstance ( arg_4 , list ) : arg_3 = arg_0 . get_providers ( ids = arg_4 ) else : arg_3 = arg_0 . get_providers ( ** arg_4 ) arg_5 = { } if 'language' in arg_2 : arg_5 [ 'language' ] = arg_2 [ 'language' ] return [ { 'id' : arg_6 . get_vocabulary_id ( ) , 'concepts' : arg_6 . Func ( arg_1 , ** arg_5 ) } for arg_6 in arg_3 ]

def Func(arg_0, arg_1, **arg_2):
        '''Launch a query across all or a selection of providers.

        .. code-block:: python

            # Find anything that has a label of church in any provider.
            registry.Func({'label': 'church'})

            # Find anything that has a label of church with the BUILDINGS provider.
            # Attention, this syntax was deprecated in version 0.3.0
            registry.Func({'label': 'church'}, providers=['BUILDINGS'])

            # Find anything that has a label of church with the BUILDINGS provider.
            registry.Func({'label': 'church'}, providers={'ids': ['BUILDINGS']})

            # Find anything that has a label of church with a provider
            # marked with the subject 'architecture'.
            registry.Func({'label': 'church'}, providers={'subject': 'architecture'})

            # Find anything that has a label of church in any provider.
            # If possible, display the results with a Dutch label.
            registry.Func({'label': 'church'}, language='nl')

        :param dict query: The query parameters that will be passed on to each
            :meth:`~skosprovider.providers.VocabularyProvider.Func` method of
            the selected.
            :class:`providers <skosprovider.providers.VocabularyProvider>`.
        :param dict providers: Optional. If present, it should be a dictionary.
            This dictionary can contain any of the keyword arguments available
            to the :meth:`get_providers` method. The query will then only
            be passed to the providers confirming to these arguments.
        :param string language: Optional. If present, it should be a
            :term:`language-tag`. This language-tag is passed on to the
            underlying providers and used when selecting the label to display
            for each concept.
        :returns: a list of :class:`dict`.
            Each dict has two keys: id and concepts.
        '''
        if 'providers' not in arg_2:
            arg_3 = arg_0.get_providers()
        else:
            arg_4 = arg_2['providers']
            if isinstance(arg_4, list):
                arg_3 = arg_0.get_providers(ids=arg_4)
            else:
                arg_3 = arg_0.get_providers(**arg_4)
        arg_5 = {}
        if 'language' in arg_2:
            arg_5['language'] = arg_2['language']
        return [{'id': arg_6.get_vocabulary_id(), 'concepts': arg_6.Func(arg_1, **arg_5)}
                for arg_6 in arg_3]

Launch a query across all or a selection of providers.

        .. code-block:: python

            # Find anything that has a label of church in any provider.
            registry.find({'label': 'church'})

            # Find anything that has a label of church with the BUILDINGS provider.
            # Attention, this syntax was deprecated in version 0.3.0
            registry.find({'label': 'church'}, providers=['BUILDINGS'])

            # Find anything that has a label of church with the BUILDINGS provider.
            registry.find({'label': 'church'}, providers={'ids': ['BUILDINGS']})

            # Find anything that has a label of church with a provider
            # marked with the subject 'architecture'.
            registry.find({'label': 'church'}, providers={'subject': 'architecture'})

            # Find anything that has a label of church in any provider.
            # If possible, display the results with a Dutch label.
            registry.find({'label': 'church'}, language='nl')

        :param dict query: The query parameters that will be passed on to each
            :meth:`~skosprovider.providers.VocabularyProvider.find` method of
            the selected.
            :class:`providers <skosprovider.providers.VocabularyProvider>`.
        :param dict providers: Optional. If present, it should be a dictionary.
            This dictionary can contain any of the keyword arguments available
            to the :meth:`get_providers` method. The query will then only
            be passed to the providers confirming to these arguments.
        :param string language: Optional. If present, it should be a
            :term:`language-tag`. This language-tag is passed on to the
            underlying providers and used when selecting the label to display
            for each concept.
        :returns: a list of :class:`dict`.
            Each dict has two keys: id and concepts.

Launch a query across all or a selection of providers .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 in six . iteritems ( arg_0 . kube_config . kube_secrets ) : arg_4 , arg_5 = arg_3 . split ( '=' ) arg_1 . append ( Secret ( 'env' , arg_2 , arg_4 , arg_5 ) ) if arg_0 . kube_config . env_from_secret_ref : for arg_6 in arg_0 . kube_config . env_from_secret_ref . split ( ',' ) : arg_1 . append ( Secret ( 'env' , None , arg_6 ) ) return arg_1

def Func(arg_0):
        """Defines any necessary secrets for the pod executor"""
        arg_1 = []

        for arg_2, arg_3 in six.iteritems(arg_0.kube_config.kube_secrets):
            arg_4, arg_5 = arg_3.split('=')
            arg_1.append(
                Secret('env', arg_2, arg_4, arg_5)
            )

        if arg_0.kube_config.env_from_secret_ref:
            for arg_6 in arg_0.kube_config.env_from_secret_ref.split(','):
                arg_1.append(
                    Secret('env', None, arg_6)
                )

        return arg_1


def Func ( arg_0 ) : arg_1 , arg_2 = [ ] , [ ] for arg_3 in arg_0 : if is_string ( arg_3 ) : arg_1 . append ( arg_3 ) arg_2 . append ( arg_3 ) else : arg_1 . append ( arg_3 [ 0 ] ) arg_2 . append ( arg_3 [ 1 ] ) return arg_1 , arg_2

def Func(arg_0):
    """Create options and verbose options from strings and non-string iterables in
    `options` array.
    """
    arg_1, arg_2 = [], []
    for arg_3 in arg_0:
        if is_string(arg_3):
            arg_1.append(arg_3)
            arg_2.append(arg_3)
        else:
            arg_1.append(arg_3[0])
            arg_2.append(arg_3[1])
    return arg_1, arg_2

Create options and verbose options from strings and non - string iterables in options array .


def Func(arg_0, arg_1):
        ''' Return the specified script command. If the first part of the
            command is a .py file, then the current python interpreter is
            prepended.

            If the script is a single string, rather than an array, it is
            shlex-split.
        '''
        arg_2 = arg_0.description.get('scripts', {}).get(arg_1, None)
        if arg_2 is not None:
            if isinstance(arg_2, str) or isinstance(arg_2, type(u'unicode string')):
                import shlex
                arg_2 = shlex.split(arg_2)
            # if the command is a python script, run it with the python
            # interpreter being used to run yotta, also fetch the absolute path
            # to the script relative to this module (so that the script can be
            # distributed with the module, no matter what current working
            # directory it will be executed in):
            if len(arg_2) and arg_2[0].lower().endswith('.py'):
                if not os.path.isabs(arg_2[0]):
                    arg_3 = os.path.abspath(os.path.join(arg_0.path, arg_2[0]))
                    logger.debug('rewriting script %s to be absolute path %s', arg_2[0], arg_3)
                    arg_2[0] = arg_3
                import sys
                arg_2 = [sys.executable] + arg_2

        return arg_2

Return the specified script command . If the first part of the command is a . py file then the current python interpreter is prepended .


def Func ( arg_0 ) : arg_1 = arg_0 . drop ( 'cash' , axis = 1 ) . abs ( ) . sum ( axis = 1 ) return arg_1 / arg_0 . sum ( axis = 1 )

def Func(arg_0):
    """
    Calculates the gross leverage of a strategy.

    Parameters
    ----------
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in tears.create_full_tear_sheet.

    Returns
    -------
    pd.Series
        Gross leverage.
    """

    arg_1 = arg_0.drop('cash', axis=1).abs().sum(axis=1)
    return arg_1 / arg_0.sum(axis=1)

Calculates the gross leverage of a strategy .


def Func ( arg_0 ) : if inspect . ismethod ( arg_0 ) : if sys . version_info < ( 3 , 0 ) : return arg_0 . im_class if arg_0 . im_self is None else arg_0 . im_self else : return arg_0 . __self__

def Func(arg_0):
    """
    Returns the instance owning the supplied instancemethod or
    the class owning the supplied classmethod.
    """
    if inspect.ismethod(arg_0):
        if sys.version_info < (3,0):
            return arg_0.im_class if arg_0.im_self is None else arg_0.im_self
        else:
            return arg_0.__self__

Returns the instance owning the supplied instancemethod or the class owning the supplied classmethod .


def Func ( arg_0 ) : if exists ( arg_0 . fs_attachment_container ) : return [ join ( arg_0 . fs_attachment_container , arg_1 ) for arg_1 in listdir ( arg_0 . fs_attachment_container ) ] else : return [ ]

def Func(arg_0):
        """ returns a list of absolute paths to the attachements"""
        if exists(arg_0.fs_attachment_container):
            return [join(arg_0.fs_attachment_container, arg_1)
                    for arg_1 in listdir(arg_0.fs_attachment_container)]
        else:
            return []


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = { } arg_6 = - 1 for arg_7 , arg_8 in enumerate ( arg_2 ) : arg_9 = arg_0 . read_at ( arg_8 , index = True ) if arg_9 is None : continue if arg_9 == arg_6 : arg_5 [ arg_9 ] . append ( arg_1 [ arg_7 ] ) else : arg_5 [ arg_9 ] = [ arg_1 [ arg_7 ] ] arg_6 = arg_9 for arg_9 , arg_10 in arg_5 . items ( ) : arg_11 = arg_4 or utils . null arg_12 = arg_11 ( np . array ( arg_10 ) ) arg_0 [ arg_9 ] . data [ arg_3 ] = arg_12 return None

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        'Extract' a log into the components of a striplog.

        Args:
            log (array_like). A log or other 1D data.
            basis (array_like). The depths or elevations of the log samples.
            name (str). The name of the attribute to store in the components.
            function (function). A function that takes an array as the only
                input, and returns whatever you want to store in the 'name'
                attribute of the primary component.
        Returns:
            None. The function works on the striplog in place.
        """
        # Build a dict of {index: [log values]} to keep track.
        arg_5 = {}
        arg_6 = -1
        for arg_7, arg_8 in enumerate(arg_2):
            arg_9 = arg_0.read_at(arg_8, index=True)
            if arg_9 is None:
                continue
            if arg_9 == arg_6:
                arg_5[arg_9].append(arg_1[arg_7])
            else:
                arg_5[arg_9] = [arg_1[arg_7]]
            arg_6 = arg_9

        # Set the requested attribute in the primary comp of each interval.
        for arg_9, arg_10 in arg_5.items():
            arg_11 = arg_4 or utils.null
            arg_12 = arg_11(np.array(arg_10))
            arg_0[arg_9].data[arg_3] = arg_12

        return None

Extract a log into the components of a striplog .


(self, raw_data, data_type_id=None, name=None,
                             description=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                             arg_4=None):
        """
        Upload already serialized raw data and replace the existing dataset.

        Parameters
        ----------
        raw_data: bytes
            Dataset contents to upload.
        data_type_id : str
            Serialization format of the raw data.
            If None, the format of the existing dataset is used.
            Supported formats are:
                'PlainText'
                'GenericCSV'
                'GenericTSV'
                'GenericCSVNoHeader'
                'GenericTSVNoHeader'
                'ARFF'
            See the azureml.DataTypeIds class for constants.
        name : str, optional
            Name for the dataset.
            If None, the name of the existing dataset is used.
        description : str, optional
            Description for the dataset.
            If None, the name of the existing dataset is used.
        """
        _not_none('raw_data', arg_1)

        if arg_2 is None:
            arg_2 = arg_0.data_type_id
        if arg_3 is None:
            arg_3 = arg_0.name
        if arg_4 is None:
            arg_4 = arg_0.description

        arg_0._upload_and_refresh(arg_1, arg_2, arg_3, arg_4)

Upload already serialized raw data and replace the existing dataset .


def Func ( arg_0 ) : arg_0 . ops = [ ] arg_0 . wifs = set ( ) arg_0 . signing_accounts = [ ] arg_0 [ "expiration" ] = None dict . __init__ ( arg_0 , { } )

def Func(arg_0):
        """ Clear the transaction builder and start from scratch
        """
        arg_0.ops = []
        arg_0.wifs = set()
        arg_0.signing_accounts = []
        # This makes sure that _is_constructed will return False afterwards
        arg_0["expiration"] = None
        dict.__init__(arg_0, {})


def
Func
(
arg_0
,
arg_1
:
arg_2
,
arg_3
:
arg_4
)
->
arg_2
:
if
arg_0
.
astTranslatorInjector
is
:
if
arg_0
.
parent
is
not
:
return
arg_0
.
parent
(
)
.
Func
(
arg_1
,
arg_3
)
else
:
raise
TypeError
(
"Must define an Translator Injector"
)
return
arg_0
.
astTranslatorInjector
(
arg_1
,
arg_3
)

def Func(arg_0, arg_1: arg_2, arg_3: arg_4) -> arg_2:
        """ If don't have injector call from parent """
        if arg_0.astTranslatorInjector is None:
            if arg_0.parent is not None:
                # TODO: think if we forward for all StateScope
                # forward to parent scope
                return arg_0.parent().Func(arg_1, arg_3)
            else:
                raise TypeError("Must define an Translator Injector")
        return arg_0.astTranslatorInjector(arg_1, arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Operators . EXTRACT ( arg_2 . read ( ) , 0 , 8 ) arg_3 = Operators . ITEBV ( arg_2 . size , arg_3 > 15 , 16 , arg_3 ) arg_1 . write ( arg_1 . read ( ) >> ( arg_3 * 8 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Packed shift right logical double quadword.

        Shifts the destination operand (first operand) to the right by the number
        of bytes specified in the count operand (second operand). The empty high-order
        bytes are cleared (set to all 0s). If the value specified by the count
        operand is greater than 15, the destination operand is set to all 0s.
        The destination operand is an XMM register. The count operand is an 8-bit
        immediate::

            TEMP  =  SRC;
            if (TEMP > 15) TEMP  =  16;
            DEST  =  DEST >> (temp * 8);

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: count operand.
        """
        # TODO(yan): Verify the correctness of truncating SRC like this ( tests
        # use '-1' as the value
        arg_3 = Operators.EXTRACT(arg_2.read(), 0, 8)
        arg_3 = Operators.ITEBV(arg_2.size, arg_3 > 15, 16, arg_3)
        arg_1.write(arg_1.read() >> (arg_3 * 8))

Packed shift right logical double quadword .


def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = False ) : if arg_3 : if not arg_0 . debug : return arg_4 = sys . stderr else : if arg_0 . verbose < arg_2 : return arg_4 = sys . stdout print ( arg_1 , file = arg_4 ) arg_4 . flush ( )

def Func(arg_0, arg_1, arg_2=1, arg_3=False):
        """
        Emit a message to the user.

        :param msg: The message to Func.  If ``debug`` is ``True``,
                    the message will be Functed to ``stderr`` only if
                    the ``debug`` attribute is ``True``.  If ``debug``
                    is ``False``, the message will be Functed to
                    ``stdout`` under the control of the ``verbose``
                    attribute.
        :param level: Ignored if ``debug`` is ``True``.  The message
                      will only be Functed if the ``verbose``
                      attribute is greater than or equal to the value
                      of this parameter.  Defaults to 1.
        :param debug: If ``True``, marks the message as a debugging
                      message.  The message will only be Functed if
                      the ``debug`` attribute is ``True``.
        """

        # Is it a debug message?
        if arg_3:
            if not arg_0.debug:
                # Debugging not enabled, don't Func the message
                return
            arg_4 = sys.stderr
        else:
            # Not a debugging message; is verbose high enough?
            if arg_0.verbose < arg_2:
                return
            arg_4 = sys.stdout

        # Emit the message
        print(arg_1, file=arg_4)
        arg_4.flush()

Emit a message to the user.

        :param msg: The message to emit.  If ``debug`` is ``True``,
                    the message will be emitted to ``stderr`` only if
                    the ``debug`` attribute is ``True``.  If ``debug``
                    is ``False``, the message will be emitted to
                    ``stdout`` under the control of the ``verbose``
                    attribute.
        :param level: Ignored if ``debug`` is ``True``.  The message
                      will only be emitted if the ``verbose``
                      attribute is greater than or equal to the value
                      of this parameter.  Defaults to 1.
        :param debug: If ``True``, marks the message as a debugging
                      message.  The message will only be emitted if
                      the ``debug`` attribute is ``True``.


def Func ( arg_0 ) : arg_1 = json . loads ( arg_0 ) arg_2 = arg_1 [ 'data' ] arg_3 = { } for arg_4 in arg_2 : arg_5 = fix_schema ( "contexts" , arg_4 [ 'schema' ] ) arg_6 = arg_4 [ 'data' ] if arg_5 not in arg_3 : arg_3 [ arg_5 ] = [ arg_6 ] else : arg_3 [ arg_5 ] . append ( arg_6 ) arg_7 = [ ] for arg_8 in arg_3 : arg_7 . append ( ( arg_8 , arg_3 [ arg_8 ] ) ) return arg_7

def Func(arg_0):
    """
    Convert a contexts JSON to an Elasticsearch-compatible list of key-value pairs
    For example, the JSON

    {
      "data": [
        {
          "data": {
            "unique": true
          },
          "schema": "iglu:com.acme/unduplicated/jsonschema/1-0-0"
        },
        {
          "data": {
            "value": 1
          },
          "schema": "iglu:com.acme/duplicated/jsonschema/1-0-0"
        },
        {
          "data": {
            "value": 2
          },
          "schema": "iglu:com.acme/duplicated/jsonschema/1-0-0"
        }
      ],
      "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0"
    }

    would become

    [
      ("context_com_acme_duplicated_1", [{"value": 1}, {"value": 2}]),
      ("context_com_acme_unduplicated_1", [{"unique": true}])
    ]
    """
    arg_1 = json.loads(arg_0)
    arg_2 = arg_1['data']
    arg_3 = {}
    for arg_4 in arg_2:
        arg_5 = fix_schema("contexts", arg_4['schema'])
        arg_6 = arg_4['data']
        if arg_5 not in arg_3:
            arg_3[arg_5] = [arg_6]
        else:
            arg_3[arg_5].append(arg_6)
    arg_7 = []
    for arg_8 in arg_3:
        arg_7.append((arg_8, arg_3[arg_8]))
    return arg_7

Convert a contexts JSON to an Elasticsearch - compatible list of key - value pairs For example the JSON


def Func(arg_0):
        """Extracts the category from a ReMo item.

        This backend generates items types 'event', 'activity'
        or 'user'. To guess the type of item, the code will look
        for unique fields.
        """
        if 'estimated_attendance' in arg_0:
            arg_1 = CATEGORY_EVENT
        elif 'activity' in arg_0:
            arg_1 = CATEGORY_ACTIVITY
        elif 'first_name' in arg_0:
            arg_1 = CATEGORY_USER
        else:
            raise TypeError("Could not define the category of item " + str(arg_0))

        return arg_1

Extracts the category from a ReMo item .


Returns a copy of the event handler, remembering the last node clicked.

def Func ( arg_0 , arg_1 ) : arg_2 = events ( arg_1 , arg_0 . _ctx ) arg_2 . clicked = arg_0 . clicked return arg_2

def Func(arg_0, arg_1):

        """ Returns a Func of the event handler, remembering the last node clicked.
        """

        arg_2 = events(arg_1, arg_0._ctx)
        arg_2.clicked = arg_0.clicked
        return arg_2

Returns a copy of the event handler remembering the last node clicked .


(x, rho, penalty, axis=0, newshape=None)

return np.rollaxis(spsolve(A, b), axis, 0).reshape(orig_shape)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 , arg_4 = None ) : arg_5 = arg_0 . shape if arg_4 is not None : arg_0 = arg_0 . reshape ( arg_4 ) arg_6 = arg_0 . shape [ arg_3 ] arg_7 = spdiags ( [ ( 2 + arg_1 / arg_2 ) * np . ones ( arg_6 ) , - 1 * np . ones ( arg_6 ) , - 1 * np . ones ( arg_6 ) ] , [ 0 , - 1 , 1 ] , arg_6 , arg_6 , format = 'csc' ) arg_8 = arg_2 * arg_7 arg_9 = arg_1 * np . rollaxis ( arg_0 , arg_3 , 0 ) return np . rollaxis ( spsolve ( arg_8 , arg_9 ) , arg_3 , 0 ) . reshape ( arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3=0, arg_4=None):
    """
    Applies a Funcing operator along one dimension

    currently only accepts a matrix as input

    Parameters
    ----------
    penalty : float

    axis : int, optional
        Axis along which to apply the Funcing (Default: 0)

    newshape : tuple, optional
        Desired shape of the parameters to apply the nuclear norm to. The given
        parameters are reshaped to an array with this shape, or not reshaped if
        the value of newshape is None. (Default: None)
    """

    arg_5 = arg_0.shape

    if arg_4 is not None:
        arg_0 = arg_0.reshape(arg_4)

    # Apply Laplacian Funcing (l2 norm on the parameters multiplied by
    # the laplacian)
    arg_6 = arg_0.shape[arg_3]
    arg_7 = spdiags([(2 + arg_1 / arg_2) * np.ones(arg_6),
                      -1 * np.ones(arg_6), -1 * np.ones(arg_6)],
                     [0, -1, 1], arg_6, arg_6, format='csc')

    arg_8 = arg_2 * arg_7
    arg_9 = arg_1 * np.rollaxis(arg_0, arg_3, 0)
    return np.rollaxis(spsolve(arg_8, arg_9), arg_3, 0).reshape(arg_5)

Applies a smoothing operator along one dimension

    currently only accepts a matrix as input

    Parameters
    ----------
    penalty : float

    axis : int, optional
        Axis along which to apply the smoothing (Default: 0)

    newshape : tuple, optional
        Desired shape of the parameters to apply the nuclear norm to. The given
        parameters are reshaped to an array with this shape, or not reshaped if
        the value of newshape is None. (Default: None)


def
Func
(
arg_0
,
arg_1
=
True
)
:
assert
isinstance
(
arg_0
,
unicode
)
,
'got non-unicode string %r'
%
arg_0
arg_0
=
penn_treebank_brackets
.
sub
(
' '
,
arg_0
)
if
arg_1
:
arg_0
=
arg_0
.
lower
(
)
arg_0
=
arg_0
.
translate
(
strip_punctuation
)
arg_0
=
whitespace
.
sub
(
' '
,
arg_0
)
return
arg_0
.
strip
(
)

def Func(arg_0, arg_1=True):
    '''Convert a unicode string into a lowercase string with no
punctuation and only spaces for whitespace.

Replace PennTreebank escaped brackets with ' ':
-LRB- -RRB- -RSB- -RSB- -LCB- -RCB-
(The acronyms stand for (Left|Right) (Round|Square|Curly) Bracket.)
http://www.cis.upenn.edu/~treebank/tokenization.html

:param span: string
    '''
    assert isinstance(arg_0, unicode), \
        'got non-unicode string %r' % arg_0
    # lowercase, strip punctuation, and shrink all whitespace
    arg_0 = penn_treebank_brackets.sub(' ', arg_0)
    if arg_1:
        arg_0 = arg_0.lower()
    arg_0 = arg_0.translate(strip_punctuation)
    arg_0 = whitespace.sub(' ', arg_0)
    # trim any leading or trailing whitespace
    return arg_0.strip()

Convert a unicode string into a lowercase string with no punctuation and only spaces for whitespace .


def Func(arg_0, arg_1):
        """Top-level simulation function, pass this to the environment

        Performs an individual network run during parameter exploration.

        `Func` does not need to be called by the user. If this
        method (not this one of the NetworkManager)
        is passed to an :class:`~pypet.environment.Environment` with this NetworkManager,
        `Func` and :func:`~pypet.brian2.network.NetworkManager.build`
        are automatically called for each individual experimental run.

        This function will create a new BRIAN2 network in case one was not pre-run.
        The execution of the network run is carried out by
        the :class:`~pypet.brian2.network.NetworkRunner` and it's
        :func:`~pypet.brian2.network.NetworkRunner.execute_network_run` (also take
        a look at this function's documentation to see the structure of a network run).

        :param traj: Trajectory container

        """

        # Check if the network was pre-built
        if arg_0._pre_built:
            if arg_0._pre_run and hasattr(arg_0._network, 'restore'):
                arg_0._network.restore('pre_run')
                # Temprorary fix for https://github.com/brian-team/brian2/issues/681
                arg_0._network.store('pre_run')
            arg_0._Func(arg_1)
        else:
            arg_0._Func(arg_1)

Top-level simulation function, pass this to the environment

        Performs an individual network run during parameter exploration.

        `run_network` does not need to be called by the user. If this
        method (not this one of the NetworkManager)
        is passed to an :class:`~pypet.environment.Environment` with this NetworkManager,
        `run_network` and :func:`~pypet.brian2.network.NetworkManager.build`
        are automatically called for each individual experimental run.

        This function will create a new BRIAN2 network in case one was not pre-run.
        The execution of the network run is carried out by
        the :class:`~pypet.brian2.network.NetworkRunner` and it's
        :func:`~pypet.brian2.network.NetworkRunner.execute_network_run` (also take
        a look at this function's documentation to see the structure of a network run).

        :param traj: Trajectory container

Top - level simulation function pass this to the environment


def Func(arg_0, arg_1, arg_2, arg_3):
    """Update experiment.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon experiment -xp 2 Func --description="new description for my experiments"
    ```

    \b
    ```bash
    $ polyaxon experiment -xp 2 Func --tags="foo, bar" --name="unique-name"
    ```
    """
    arg_4, arg_5, arg_6 = get_project_experiment_or_local(arg_0.obj.get('project'),
                                                                      arg_0.obj.get('experiment'))
    arg_7 = {}

    if arg_1:
        arg_7['name'] = arg_1

    if arg_2:
        arg_7['description'] = arg_2

    arg_3 = validate_tags(arg_3)
    if arg_3:
        arg_7['tags'] = arg_3

    if not arg_7:
        Printer.print_warning('No argument was provided to Func the experiment.')
        sys.exit(0)

    try:
        arg_8 = PolyaxonClient().experiment.Func_experiment(
            arg_4, arg_5, arg_6, arg_7)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func experiment `{}`.'.format(arg_6))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Experiment Funcd.")
    get_experiment_details(arg_8)

Update experiment.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon experiment -xp 2 update --description="new description for my experiments"
    ```

    \b
    ```bash
    $ polyaxon experiment -xp 2 update --tags="foo, bar" --name="unique-name"
    ```


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = loader . get_template ( arg_0 . template ) if not arg_1 : arg_1 = arg_0 . context ( arg_0 . prepare_data ( ) ) if arg_2 is not None : for arg_4 , arg_5 in arg_2 . iteritems ( ) : if arg_4 in arg_0 . accepted_keywords : arg_1 [ arg_4 ] = arg_5 return arg_3 . Func ( arg_1 )

def Func(arg_0, arg_1=None, arg_2=None):
        """Renders the widget as HTML."""
        arg_3 = loader.get_template(arg_0.template)

        if not arg_1:
            arg_1 = arg_0.context(arg_0.prepare_data())

        if arg_2 is not None:
            for arg_4, arg_5 in arg_2.iteritems():
                if arg_4 in arg_0.accepted_keywords:
                    arg_1[arg_4] = arg_5

        return arg_3.Func(arg_1)


def Func ( arg_0 ) : return hashlib . sha1 ( to_utf8 ( arg_0 . stream_id ) + to_utf8 ( arg_0 . secret ) ) . hexdigest ( )

def Func(arg_0):
        """Compute the authentication handshake value.

        :return: the computed hash value.
        :returntype: `str`"""
        return hashlib.sha1(to_utf8(arg_0.stream_id)+to_utf8(arg_0.secret)).hexdigest()

Compute the authentication handshake value .


(graph: BELGraph, annotation: str = 'Subgraph')

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = 'Subgraph' ) -> Mapping [ arg_3 , typing . Counter [ arg_3 ] ] : arg_4 = group_as_dict ( _iter_authors_by_annotation ( arg_0 , arg_2 = arg_2 ) ) return count_defaultdict ( arg_4 )

def Func(arg_0: arg_1, arg_2: arg_3 = 'Subgraph') -> Mapping[arg_3, typing.Counter[arg_3]]:
    """Group the author counters by sub-graphs induced by the annotation.

    :param graph: A BEL graph
    :param annotation: The annotation to use to group the graph
    :return: A dictionary of Counters {subgraph name: Counter from {author: frequency}}
    """
    arg_4 = group_as_dict(_iter_authors_by_annotation(arg_0, arg_2=arg_2))
    return count_defaultdict(arg_4)

Group the author counters by sub - graphs induced by the annotation .


(self, new_type=None, *, include_ignored=False)

return ParseNode(new_type or self.node_type,
                      children=["".join(values)],
                      consumed=consumed,
                      ignored=ignored,
                      position=self.position)

def Func ( arg_0 , arg_1 = None , * , arg_2 = False ) : arg_3 = [ ] arg_4 = 0 arg_5 = None for arg_6 , arg_7 in enumerate ( arg_0 . children ) : arg_4 += arg_7 . consumed if arg_6 == 0 and not arg_2 : arg_5 = arg_7 . ignored if arg_7 . is_value : if arg_2 : arg_3 . append ( "{0}{1}" . format ( arg_7 . ignored or "" , arg_7 . value ) ) else : arg_3 . append ( arg_7 . value ) else : arg_3 . append ( arg_7 . Func ( arg_2 = arg_2 ) . value ) return ParseNode ( arg_1 or arg_0 . node_type , children = [ "" . join ( arg_3 ) ] , arg_4 = arg_4 , arg_5 = arg_5 , position = arg_0 . position )

def Func(arg_0, arg_1=None, *, arg_2=False):
    """Turns the node into a value node, whose single string child is the concatenation of all its
    children.
    """
    arg_3 = []
    arg_4 = 0
    arg_5 = None

    for arg_6, arg_7 in enumerate(arg_0.children):
      arg_4 += arg_7.consumed
      if arg_6 == 0 and not arg_2:
        arg_5 = arg_7.ignored
      if arg_7.is_value:
        if arg_2:
          arg_3.append("{0}{1}".format(arg_7.ignored or "", arg_7.value))
        else:
          arg_3.append(arg_7.value)
      else:
        arg_3.append(arg_7.Func(arg_2=arg_2).value)

    return ParseNode(arg_1 or arg_0.node_type,
                      children=["".join(arg_3)],
                      arg_4=arg_4,
                      arg_5=arg_5,
                      position=arg_0.position)

Turns the node into a value node whose single string child is the concatenation of all its children .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
send_command
(
GET_LIGHTS_COMMAND
)
_LOGGER
.
debug
(
"Func response: %s"
,
repr
(
arg_1
)
)
if
not
arg_1
:
_LOGGER
.
debug
(
"Empty response: %s"
,
arg_1
)
return
{
}
arg_1
=
arg_1
.
strip
(
)
if
not
(
arg_1
.
startswith
(
"GLB"
)
and
arg_1
.
endswith
(
";"
)
)
:
_LOGGER
.
debug
(
"Invalid response: %s"
,
repr
(
arg_1
)
)
return
{
}
arg_1
=
arg_1
[
4
:
3
]
arg_2
=
arg_1
.
split
(
';'
)
arg_3
=
{
}
for
arg_4
in
arg_2
:
arg_5
=
arg_4
.
split
(
','
)
try
:
arg_3
[
arg_5
[
0
]
]
=
[
int
(
arg_5
[
2
]
)
,
int
(
arg_5
[
4
]
)
,
int
(
arg_5
[
5
]
)
,
int
(
arg_5
[
6
]
)
,
int
(
arg_5
[
7
]
)
]
except
ValueError
as
error
:
_LOGGER
.
error
(
"Error %s: %s (%s)"
,
error
,
arg_5
,
arg_1
)
except
IndexError
as
error
:
_LOGGER
.
error
(
"Error %s: %s (%s)"
,
error
,
arg_5
,
arg_1
)
return
arg_3

def Func(arg_0):
        """Get current light data as dictionary with light zids as keys."""
        arg_1 = arg_0.send_command(GET_LIGHTS_COMMAND)
        _LOGGER.debug("Func response: %s", repr(arg_1))
        if not arg_1:
            _LOGGER.debug("Empty response: %s", arg_1)
            return {}
        arg_1 = arg_1.strip()
        # Check string before splitting (avoid IndexError if malformed)
        if not (arg_1.startswith("GLB") and arg_1.endswith(";")):
            _LOGGER.debug("Invalid response: %s", repr(arg_1))
            return {}

        # deconstruct response string into light data. Example data:
        # GLB 143E,1,1,25,255,255,255,0,0;287B,1,1,22,255,255,255,0,0;\r\n
        arg_1 = arg_1[4:-3]  # strip start (GLB) and end (;\r\n)
        arg_2 = arg_1.split(';')
        arg_3 = {}
        for arg_4 in arg_2:
            arg_5 = arg_4.split(',')
            try:
                arg_3[arg_5[0]] = [int(arg_5[2]), int(arg_5[4]),
                                               int(arg_5[5]), int(arg_5[6]),
                                               int(arg_5[7])]
            except ValueError as error:
                _LOGGER.error("Error %s: %s (%s)", error, arg_5, arg_1)
            except IndexError as error:
                _LOGGER.error("Error %s: %s (%s)", error, arg_5, arg_1)
        return arg_3

Get current light data as dictionary with light zids as keys .