(y=None, sr=22050, S=None, norm=np.inf, n_fft=2048,
                hop_length=512, win_length=None, window='hann', center=True,
                pad_mode='reflect', tuning=None, **kwargs)

return util.normalize(raw_chroma, norm=norm, axis=0)

def Func(arg_0=None, arg_1=22050, arg_2=None, arg_3=arg_4.inf, arg_6=2048,
                arg_7=512, arg_8=None, arg_9='hann', arg_10=True,
                arg_11='reflect', arg_12=None, **arg_13):
    """Compute a chromagram from a waveform or power spectrogram.

    This implementation is derived from `chromagram_E` [1]_

    .. [1] Ellis, Daniel P.W.  "Chroma feature analysis and synthesis"
           2007/04/21
           http://labrosa.ee.columbia.edu/matlab/chroma-ansyn/

    Parameters
    ----------
    y : np.ndarray [shape=(n,)] or None
        audio time series

    sr : number > 0 [scalar]
        sampling rate of `y`

    S : np.ndarray [shape=(d, t)] or None
        power spectrogram

    norm : float or None
        Column-wise normalization.
        See `librosa.util.normalize` for details.

        If `None`, no normalization is performed.

    n_fft : int  > 0 [scalar]
        FFT window size if provided `y, sr` instead of `S`

    hop_length : int > 0 [scalar]
        hop length if provided `y, sr` instead of `S`

    win_length : int <= n_fft [scalar]
        Each frame of audio is windowed by `window()`.
        The window will be of length `win_length` and then padded
        with zeros to match `n_fft`.

        If unspecified, defaults to ``win_length = n_fft``.

    window : string, tuple, number, function, or np.ndarray [shape=(n_fft,)]
        - a window specification (string, tuple, or number);
          see `scipy.signal.get_window`
        - a window function, such as `scipy.signal.hanning`
        - a vector or array of length `n_fft`

        .. see also:: `filters.get_window`

    center : boolean
        - If `True`, the signal `y` is padded so that frame
          `t` is centered at `y[t * hop_length]`.
        - If `False`, then frame `t` begins at `y[t * hop_length]`

    pad_mode : string
        If `center=True`, the padding mode to use at the edges of the signal.
        By default, STFT uses reflection padding.

    tuning : float in `[-0.5, 0.5)` [scalar] or None.
        Deviation from A440 tuning in fractional bins (cents).
        If `None`, it is automatically estimated.

    kwargs : additional keyword arguments
        Arguments to parameterize chroma filters.
        See `librosa.filters.chroma` for details.

    Returns
    -------
    chromagram : np.ndarray [shape=(n_chroma, t)]
        Normalized energy for each chroma bin at each frame.

    See Also
    --------
    librosa.filters.chroma
        Chroma filter bank construction
    librosa.util.normalize
        Vector normalization

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> librosa.feature.Func(y=y, sr=sr)
    array([[ 0.974,  0.881, ...,  0.925,  1.   ],
           [ 1.   ,  0.841, ...,  0.882,  0.878],
           ...,
           [ 0.658,  0.985, ...,  0.878,  0.764],
           [ 0.969,  0.92 , ...,  0.974,  0.915]])

    Use an energy (magnitude) spectrum instead of power spectrogram

    >>> S = np.abs(librosa.stft(y))
    >>> chroma = librosa.feature.Func(S=S, sr=sr)
    >>> chroma
    array([[ 0.884,  0.91 , ...,  0.861,  0.858],
           [ 0.963,  0.785, ...,  0.968,  0.896],
           ...,
           [ 0.871,  1.   , ...,  0.928,  0.829],
           [ 1.   ,  0.982, ...,  0.93 ,  0.878]])

    Use a pre-computed power spectrogram with a larger frame

    >>> S = np.abs(librosa.stft(y, n_fft=4096))**2
    >>> chroma = librosa.feature.Func(S=S, sr=sr)
    >>> chroma
    array([[ 0.685,  0.477, ...,  0.961,  0.986],
           [ 0.674,  0.452, ...,  0.952,  0.926],
           ...,
           [ 0.844,  0.575, ...,  0.934,  0.869],
           [ 0.793,  0.663, ...,  0.964,  0.972]])

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(10, 4))
    >>> librosa.display.specshow(chroma, y_axis='chroma', x_axis='time')
    >>> plt.colorbar()
    >>> plt.title('Chromagram')
    >>> plt.tight_layout()

    """

    arg_2, arg_6 = _spectrogram(arg_0=arg_0, arg_2=arg_2, arg_6=arg_6, arg_7=arg_7, power=2,
                            arg_8=arg_8, arg_9=arg_9, arg_10=arg_10,
                            arg_11=arg_11)

    arg_14 = arg_13.get('n_chroma', 12)

    if arg_12 is None:
        arg_12 = estimate_tuning(arg_2=arg_2, arg_1=arg_1, bins_per_octave=arg_14)

    # Get the filter bank
    if 'A440' not in arg_13:
        arg_13['A440'] = 440.0 * 2.0**(float(arg_12) / arg_14)

    arg_15 = filters.chroma(arg_1, arg_6, **arg_13)

    # Compute raw chroma
    arg_16 = arg_4.dot(arg_15, arg_2)

    # Compute normalization factor for each frame
    return util.normalize(arg_16, arg_3=arg_3, axis=0)

Compute a chromagram from a waveform or power spectrogram.

    This implementation is derived from `chromagram_E` [1]_

    .. [1] Ellis, Daniel P.W.  "Chroma feature analysis and synthesis"
           2007/04/21
           http://labrosa.ee.columbia.edu/matlab/chroma-ansyn/

    Parameters
    ----------
    y : np.ndarray [shape=(n,)] or None
        audio time series

    sr : number > 0 [scalar]
        sampling rate of `y`

    S : np.ndarray [shape=(d, t)] or None
        power spectrogram

    norm : float or None
        Column-wise normalization.
        See `librosa.util.normalize` for details.

        If `None`, no normalization is performed.

    n_fft : int  > 0 [scalar]
        FFT window size if provided `y, sr` instead of `S`

    hop_length : int > 0 [scalar]
        hop length if provided `y, sr` instead of `S`

    win_length : int <= n_fft [scalar]
        Each frame of audio is windowed by `window()`.
        The window will be of length `win_length` and then padded
        with zeros to match `n_fft`.

        If unspecified, defaults to ``win_length = n_fft``.

    window : string, tuple, number, function, or np.ndarray [shape=(n_fft,)]
        - a window specification (string, tuple, or number);
          see `scipy.signal.get_window`
        - a window function, such as `scipy.signal.hanning`
        - a vector or array of length `n_fft`

        .. see also:: `filters.get_window`

    center : boolean
        - If `True`, the signal `y` is padded so that frame
          `t` is centered at `y[t * hop_length]`.
        - If `False`, then frame `t` begins at `y[t * hop_length]`

    pad_mode : string
        If `center=True`, the padding mode to use at the edges of the signal.
        By default, STFT uses reflection padding.

    tuning : float in `[-0.5, 0.5)` [scalar] or None.
        Deviation from A440 tuning in fractional bins (cents).
        If `None`, it is automatically estimated.

    kwargs : additional keyword arguments
        Arguments to parameterize chroma filters.
        See `librosa.filters.chroma` for details.

    Returns
    -------
    chromagram : np.ndarray [shape=(n_chroma, t)]
        Normalized energy for each chroma bin at each frame.

    See Also
    --------
    librosa.filters.chroma
        Chroma filter bank construction
    librosa.util.normalize
        Vector normalization

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> librosa.feature.chroma_stft(y=y, sr=sr)
    array([[ 0.974,  0.881, ...,  0.925,  1.   ],
           [ 1.   ,  0.841, ...,  0.882,  0.878],
           ...,
           [ 0.658,  0.985, ...,  0.878,  0.764],
           [ 0.969,  0.92 , ...,  0.974,  0.915]])

    Use an energy (magnitude) spectrum instead of power spectrogram

    >>> S = np.abs(librosa.stft(y))
    >>> chroma = librosa.feature.chroma_stft(S=S, sr=sr)
    >>> chroma
    array([[ 0.884,  0.91 , ...,  0.861,  0.858],
           [ 0.963,  0.785, ...,  0.968,  0.896],
           ...,
           [ 0.871,  1.   , ...,  0.928,  0.829],
           [ 1.   ,  0.982, ...,  0.93 ,  0.878]])

    Use a pre-computed power spectrogram with a larger frame

    >>> S = np.abs(librosa.stft(y, n_fft=4096))**2
    >>> chroma = librosa.feature.chroma_stft(S=S, sr=sr)
    >>> chroma
    array([[ 0.685,  0.477, ...,  0.961,  0.986],
           [ 0.674,  0.452, ...,  0.952,  0.926],
           ...,
           [ 0.844,  0.575, ...,  0.934,  0.869],
           [ 0.793,  0.663, ...,  0.964,  0.972]])

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(10, 4))
    >>> librosa.display.specshow(chroma, y_axis='chroma', x_axis='time')
    >>> plt.colorbar()
    >>> plt.title('Chromagram')
    >>> plt.tight_layout()

Compute a chromagram from a waveform or power spectrogram .


def Func ( arg_0 , Func ) : _set_params ( arg_0 . ode_obj , 'HiStop' , Func , arg_0 . ADOF + arg_0 . LDOF )

def Func(arg_0, Func):
        '''Set the hi stop values for this object's degrees of freedom.

        Parameters
        ----------
        hi_stops : float or sequence of float
            A hi stop value to set on all degrees of freedom, or a list
            containing one such value for each degree of freedom. For rotational
            degrees of freedom, these values must be in radians.
        '''
        _set_params(arg_0.ode_obj, 'HiStop', Func, arg_0.ADOF + arg_0.LDOF)

Set the hi stop values for this object s degrees of freedom .


def Func ( arg_0 ) : assert os . path . isabs ( arg_0 ) try : os . makedirs ( arg_0 ) except OSError , e : if e . errno != os . errno . EEXIST : raise return arg_0

def Func(arg_0):
  """ Makes directory for the given directory path with default permissions.
  If the directory already exists, it is treated as success.

  absDirPath:   absolute path of the directory to create.

  Returns:      absDirPath arg

  Exceptions:         OSError if directory creation fails
  """

  assert os.path.isabs(arg_0)

  try:
    os.makedirs(arg_0)
  except OSError, e:
    if e.errno != os.errno.EEXIST:
      raise

  return arg_0

Makes directory for the given directory path with default permissions . If the directory already exists it is treated as success .


def Func ( arg_0 ) : arg_0 . history_manager . end_session ( ) for arg_1 in arg_0 . tempfiles : try : os . unlink ( arg_1 ) except OSError : pass arg_0 . reset ( new_session = False ) arg_0 . hooks . shutdown_hook ( )

def Func(arg_0):
        """This will be executed at the time of exit.

        Cleanup operations and saving of persistent data that is done
        unconditionally by IPython should be performed here.

        For things that may depend on startup flags or platform specifics (such
        as having readline or not), register a separate atexit function in the
        code that has the appropriate information, rather than trying to
        clutter
        """
        # Close the history session (this stores the end time and line count)
        # this must be *before* the tempfile cleanup, in case of temporary
        # history db
        arg_0.history_manager.end_session()

        # Cleanup all tempfiles left around
        for arg_1 in arg_0.tempfiles:
            try:
                os.unlink(arg_1)
            except OSError:
                pass

        # Clear all user namespaces to release all references cleanly.
        arg_0.reset(new_session=False)

        # Run user hooks
        arg_0.hooks.shutdown_hook()

This will be executed at the time of exit .


(endpoint, cert, key, pem, ca, aad, no_verify)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6): #pylint: disable=invalid-name,too-many-arguments
    """Verify arguments for select command"""

    if not (arg_0.lower().startswith('http')
            or arg_0.lower().startswith('https')):
        raise CLIError('Endpoint must be HTTP or HTTPS')

    arg_7 = ('Valid syntax : --endpoint [ [ --key --cert | --pem | --aad] '
             '[ --ca | --no-verify ] ]')

    if arg_4 and not (arg_3 or all([arg_2, arg_1])):
        raise CLIError(arg_7)

    if arg_6 and not (arg_3 or all([arg_2, arg_1]) or arg_5):
        raise CLIError(arg_7)

    if arg_6 and arg_4:
        raise CLIError(arg_7)

    if any([arg_1, arg_2]) and not all([arg_1, arg_2]):
        raise CLIError(arg_7)

    if arg_5 and any([arg_3, arg_1, arg_2]):
        raise CLIError(arg_7)

    if arg_3 and any([arg_1, arg_2]):
        raise CLIError(arg_7)


(self, ratios=None, destination_frames=None, seed=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Split a frame into distinct subsets of size determined by the given ratios.

        The number of subsets is always 1 more than the number of ratios given. Note that
        this does not give an exact split. H2O is designed to be efficient on big data
        using a probabilistic splitting method rather than an exact split. For example
        when specifying a split of 0.75/0.25, H2O will produce a test/train split with
        an expected value of 0.75/0.25 rather than exactly 0.75/0.25. On small datasets,
        the sizes of the resulting splits will deviate from the expected value more than
        on big data, where they will be very close to exact.

        :param List[float] ratios: The fractions of rows for each split.
        :param List[str] destination_frames: The names of the split frames.
        :param int seed: seed for the random number generator

        :returns: A list of H2OFrames
        """
        assert_is_type(arg_1, [numeric], None)
        assert_is_type(arg_2, [str], None)
        assert_is_type(arg_3, int, None)

        if arg_1 is None:
            arg_1 = [0.75]
        if not arg_1:
            raise ValueError("Ratios array may not be empty")

        if arg_2 is not None:
            if len(arg_1) + 1 != len(arg_2):
                raise ValueError("The number of provided destination_frames must be one more "
                                 "than the number of provided ratios")

        arg_4 = len(arg_1) + 1
        arg_5 = []

        arg_6 = 0
        arg_7 = 0
        while arg_7 < arg_4 - 1:
            arg_8 = arg_1[arg_7]
            if arg_8 < 0:
                raise ValueError("Ratio must be greater than 0")
            arg_9 = arg_6 + arg_8
            if arg_9 >= 1.0:
                raise ValueError("Ratios must add up to less than 1.0")
            arg_5.append(arg_9)
            arg_6 = arg_9
            arg_7 += 1

        arg_10 = []
        arg_11 = arg_0.runif(arg_3)
        arg_11.frame_id = "%s_splitter" % _py_tmp_key(h2o.connection().session_id)

        arg_7 = 0
        while arg_7 < arg_4:
            if arg_7 == 0:
                # lower_boundary is 0.0
                arg_13 = arg_5[arg_7]
                arg_14 = arg_0[(arg_11 <= arg_13), :]
            elif arg_7 == arg_4 - 1:
                arg_15 = arg_5[arg_7 - 1]
                # upper_boundary is 1.0
                arg_14 = arg_0[(arg_11 > arg_15), :]
            else:
                arg_15 = arg_5[arg_7 - 1]
                arg_13 = arg_5[arg_7]
                arg_14 = arg_0[((arg_11 > arg_15) & (arg_11 <= arg_13)), :]

            if arg_2 is None:
                arg_10.append(arg_14)
            else:
                arg_16 = arg_2[arg_7]
                arg_14.frame_id = arg_16
                arg_10.append(arg_14)

            arg_7 += 1

        del arg_11
        return arg_10

Split a frame into distinct subsets of size determined by the given ratios .


def Func ( arg_0 ) : arg_1 = super ( ApacheSatchel , arg_0 ) . Func ( ) arg_2 = arg_0 . os_version arg_3 = arg_1 . env . specifics [ arg_2 . type ] [ arg_2 . distro ] arg_1 . env . update ( arg_3 ) return arg_1

def Func(arg_0):
        """
        Instantiates a new local renderer.
        Override this to do any additional initialization.
        """
        arg_1 = super(ApacheSatchel, arg_0).Func()

        # Dynamically set values based on target operating system.
        arg_2 = arg_0.os_version
        arg_3 = arg_1.env.specifics[arg_2.type][arg_2.distro]
        arg_1.env.update(arg_3)

        return arg_1

Instantiates a new local renderer . Override this to do any additional initialization .


def Func(arg_0, arg_1=False, **arg_2):
        """Return a Func of groups.

        =====API DOCS=====
        Retrieve a Func of groups.

        :param root: Flag that if set, only root groups of a specific inventory will be Funced.
        :type root: bool
        :param parent: Primary key or name of the group whose child groups will be Funced.
        :type parent: str
        :param all_pages: Flag that if set, collect all pages of content from the API when returning results.
        :type all_pages: bool
        :param page: The page to show. Ignored if all_pages is set.
        :type page: int
        :param query: Contains 2-tuples used as query parameters to filter resulting resource objects.
        :type query: Func
        :param `**kwargs`: Keyword arguments Func of available fields used for searching resource objects.
        :returns: A JSON object containing details of all resource objects returned by Tower backend.
        :rtype: dict
        :raises tower_cli.exceptions.UsageError: When ``root`` flag is on and ``inventory`` is not present in
                                                 ``**kwargs``.

        =====API DOCS=====
        """
        # Option to Func children of a parent group
        if arg_2.get('parent', None):
            arg_0.set_child_endpoint(parent=arg_2['parent'], inventory=arg_2.get('inventory', None))
            arg_2.pop('parent')
        # Sanity check: If we got `--root` and no inventory, that's an error.
        if arg_1 and not arg_2.get('inventory', None):
            raise exc.UsageError('The --root option requires specifying an inventory also.')
        # If we are tasked with getting root groups, do that.
        if arg_1:
            arg_3 = arg_2['inventory']
            arg_4 = client.get('/inventories/%d/root_groups/' % arg_3)
            return arg_4.json()
        # Return the superclass implementation.
        return super(Resource, arg_0).Func(**arg_2)

Return a list of groups.

        =====API DOCS=====
        Retrieve a list of groups.

        :param root: Flag that if set, only root groups of a specific inventory will be listed.
        :type root: bool
        :param parent: Primary key or name of the group whose child groups will be listed.
        :type parent: str
        :param all_pages: Flag that if set, collect all pages of content from the API when returning results.
        :type all_pages: bool
        :param page: The page to show. Ignored if all_pages is set.
        :type page: int
        :param query: Contains 2-tuples used as query parameters to filter resulting resource objects.
        :type query: list
        :param `**kwargs`: Keyword arguments list of available fields used for searching resource objects.
        :returns: A JSON object containing details of all resource objects returned by Tower backend.
        :rtype: dict
        :raises tower_cli.exceptions.UsageError: When ``root`` flag is on and ``inventory`` is not present in
                                                 ``**kwargs``.

        =====API DOCS=====


(self, graph, reset=True, initialize=True)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : if arg_2 : for arg_4 in arg_0 . _input_shapes : arg_0 . _input_shapes [ arg_4 ] = None for arg_4 in arg_0 . _output_shapes : arg_0 . _output_shapes [ arg_4 ] = None arg_0 . resolve_inputs ( arg_1 . layers ) arg_0 . resolve_outputs ( ) arg_0 . activate = activations . build ( arg_0 . kwargs . get ( 'activation' , 'relu' ) , arg_0 ) if arg_3 : arg_0 . setup ( ) arg_0 . log ( )

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        '''Bind this layer into a computation graph.

        This method is a wrapper for performing common initialization tasks. It
        calls :func:`resolve`, :func:`setup`, and :func:`log`.

        Parameters
        ----------
        graph : :class:`Network <theanets.graph.Network>`
            A computation network in which this layer is to be bound.
        reset : bool, optional
            If ``True`` (the default), reset the resolved layers for this layer.
        initialize : bool, optional
            If ``True`` (the default), initialize the parameters for this layer
            by calling :func:`setup`.

        Raises
        ------
        theanets.util.ConfigurationError :
            If an input cannot be resolved.
        '''
        if arg_2:
            for arg_4 in arg_0._input_shapes:
                arg_0._input_shapes[arg_4] = None
            for arg_4 in arg_0._output_shapes:
                arg_0._output_shapes[arg_4] = None
        arg_0.resolve_inputs(arg_1.layers)
        arg_0.resolve_outputs()
        arg_0.activate = activations.build(
            arg_0.kwargs.get('activation', 'relu'), arg_0)
        if arg_3:
            arg_0.setup()
        arg_0.log()

Bind this layer into a computation graph .


return self.get_data("load_balancers/%s/" % self.id,
                             type=PUT,
                             params=data)

def Func ( arg_0 ) : arg_1 = [ rule . __dict__ for rule in arg_0 . forwarding_rules ] arg_2 = { 'name' : arg_0 . name , 'region' : arg_0 . region [ 'slug' ] , 'forwarding_rules' : arg_1 , 'redirect_http_to_https' : arg_0 . redirect_http_to_https } if arg_0 . tag : arg_2 [ 'tag' ] = arg_0 . tag else : arg_2 [ 'droplet_ids' ] = arg_0 . droplet_ids if arg_0 . algorithm : arg_2 [ "algorithm" ] = arg_0 . algorithm if arg_0 . health_check : arg_2 [ 'health_check' ] = arg_0 . health_check . __dict__ if arg_0 . sticky_sessions : arg_2 [ 'sticky_sessions' ] = arg_0 . sticky_sessions . __dict__ return arg_0 . get_data ( "load_balancers/%s/" % arg_0 . id , type = PUT , params = arg_2 )

def Func(arg_0):
        """
        Save the LoadBalancer
        """
        arg_1 = [rule.__dict__ for rule in arg_0.forwarding_rules]

        arg_2 = {
            'name': arg_0.name,
            'region': arg_0.region['slug'],
            'forwarding_rules': arg_1,
            'redirect_http_to_https': arg_0.redirect_http_to_https
        }

        if arg_0.tag:
            arg_2['tag'] = arg_0.tag
        else:
            arg_2['droplet_ids'] = arg_0.droplet_ids

        if arg_0.algorithm:
            arg_2["algorithm"] = arg_0.algorithm
        if arg_0.health_check:
            arg_2['health_check'] = arg_0.health_check.__dict__
        if arg_0.sticky_sessions:
            arg_2['sticky_sessions'] = arg_0.sticky_sessions.__dict__

        return arg_0.get_data("load_balancers/%s/" % arg_0.id,
                             type=PUT,
                             params=arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . pos - arg_1 arg_3 = ( arg_2 * arg_2 ) . sum ( axis = 1 ) arg_4 = arg_3 . argmin ( ) arg_5 = arg_0 . pos [ arg_4 ] . copy ( ) arg_0 . pos = np . delete ( arg_0 . pos , arg_4 , axis = 0 ) return arg_5

def Func(arg_0, arg_1):
        """removes the closest particle in self.pos to ``p``"""
        #1. find closest pos:
        arg_2 = arg_0.pos - arg_1
        arg_3 = (arg_2*arg_2).sum(axis=1)
        arg_4 = arg_3.argmin()
        arg_5 = arg_0.pos[arg_4].copy()
        #2. delete
        arg_0.pos = np.delete(arg_0.pos, arg_4, axis=0)
        return arg_5

removes the closest particle in self . pos to p


(ctxt, test, key=None, check=False, exts=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
)
:
if
arg_4
is
:
arg_4
=
extensions
.
ExtensionSet
(
)
arg_0
.
emit
(
'Reading test steps from %s%s...'
%
(
arg_1
,
'[%s]'
%
arg_2
if
arg_2
else
''
)
,
debug
=
True
)
arg_0
.
steps
+=
arg_4
.
read_steps
(
arg_0
,
steps
.
Step
.
parse_file
(
arg_0
,
arg_1
,
arg_2
)
)
if
arg_3
:
return
for
arg_5
,
arg_6
in
enumerate
(
arg_0
.
steps
)
:
arg_0
.
emit
(
'[Step %d]: %s . . .'
%
(
arg_5
,
arg_6
.
name
)
)
if
arg_4
.
pre_step
(
arg_0
,
arg_6
,
arg_5
)
:
arg_0
.
emit
(
'[Step %d]: `- Step %s'
%
(
arg_5
,
steps
.
states
[
steps
.
SKIPPED
]
)
)
continue
arg_7
=
arg_6
(
arg_0
)
arg_4
.
post_step
(
arg_0
,
arg_6
,
arg_5
,
arg_7
)
arg_0
.
emit
(
'[Step %d]: `- Step %s%s'
%
(
arg_5
,
steps
.
states
[
arg_7
.
state
]
,
' (ignored)'
if
arg_7
.
ignore
else
''
)
)
if
not
arg_7
:
arg_8
=
'Test step failure'
if
arg_7
.
msg
:
arg_8
+=
': %s'
%
arg_7
.
msg
return
arg_8
return

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=None):
    """
    Execute a test described by a YAML file.

    :param ctxt: A ``Func.context.Context`` object.
    :param test: The name of a YAML file containing the test
                 description.  Note that the current working directory
                 set up in ``ctxt.environment`` does not affect the
                 resolution of this file.
    :param key: An optional key into the test description file.  If
                not ``None``, the file named by ``test`` must be a
                YAML dictionary of lists of steps; otherwise, it must
                be a simple list of steps.
    :param check: If ``True``, only performs a syntax check of the
                  test steps indicated by ``test`` and ``key``; the
                  test itself is not run.
    :param exts: An instance of ``Func.extensions.ExtensionSet``
                 describing the extensions to be called while
                 processing the test steps.
    """

    # Normalize the extension set
    if arg_4 is None:
        arg_4 = extensions.ExtensionSet()

    # Begin by reading the steps and adding them to the list in the
    # context (which may already have elements thanks to the
    # extensions)
    arg_0.emit('Reading test steps from %s%s...' %
              (arg_1, '[%s]' % arg_2 if arg_2 else ''), debug=True)
    arg_0.steps += arg_4.read_steps(arg_0, steps.Step.parse_file(arg_0, arg_1, arg_2))

    # If all we were supposed to do was check, well, we've
    # accomplished that...
    if arg_3:
        return None

    # Now we execute each step in turn
    for arg_5, arg_6 in enumerate(arg_0.steps):
        # Emit information about what we're doing
        arg_0.emit('[Step %d]: %s . . .' % (arg_5, arg_6.name))

        # Run through extension hooks
        if arg_4.pre_step(arg_0, arg_6, arg_5):
            arg_0.emit('[Step %d]: `- Step %s' %
                      (arg_5, steps.states[steps.SKIPPED]))
            continue

        # Now execute the step
        arg_7 = arg_6(arg_0)

        # Let the extensions process the result of the step
        arg_4.post_step(arg_0, arg_6, arg_5, arg_7)

        # Emit the result
        arg_0.emit('[Step %d]: `- Step %s%s' %
                  (arg_5, steps.states[arg_7.state],
                   ' (ignored)' if arg_7.ignore else ''))

        # Was the step a success?
        if not arg_7:
            arg_8 = 'Test step failure'
            if arg_7.msg:
                arg_8 += ': %s' % arg_7.msg

            return arg_8

    # All done!  And a success, to boot...
    return None

Execute a test described by a YAML file.

    :param ctxt: A ``timid.context.Context`` object.
    :param test: The name of a YAML file containing the test
                 description.  Note that the current working directory
                 set up in ``ctxt.environment`` does not affect the
                 resolution of this file.
    :param key: An optional key into the test description file.  If
                not ``None``, the file named by ``test`` must be a
                YAML dictionary of lists of steps; otherwise, it must
                be a simple list of steps.
    :param check: If ``True``, only performs a syntax check of the
                  test steps indicated by ``test`` and ``key``; the
                  test itself is not run.
    :param exts: An instance of ``timid.extensions.ExtensionSet``
                 describing the extensions to be called while
                 processing the test steps.

Execute a test described by a YAML file .


(self, client_id, code, request, *args, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
*
arg_4
,
**
arg_5
)
:
arg_6
=
datetime
.
utcnow
(
)
+
timedelta
(
seconds
=
100
)
arg_7
=
arg_0
.
model
(
arg_1
=
arg_3
.
client
.
client_id
,
arg_2
=
arg_2
[
'code'
]
,
redirect_uri
=
arg_3
.
redirect_uri
,
scope
=
' '
.
join
(
arg_3
.
scopes
)
,
user
=
arg_0
.
current_user
(
)
,
arg_6
=
arg_6
)
arg_0
.
session
.
add
(
arg_7
)
arg_0
.
session
.
commit
(
)

def Func(arg_0, arg_1, arg_2, arg_3, *arg_4, **arg_5):
        """Creates Grant object with the given params

        :param client_id: ID of the client
        :param code:
        :param request: OAuthlib request object
        """
        arg_6 = datetime.utcnow() + timedelta(seconds=100)
        arg_7 = arg_0.model(
            arg_1=arg_3.client.client_id,
            arg_2=arg_2['code'],
            redirect_uri=arg_3.redirect_uri,
            scope=' '.join(arg_3.scopes),
            user=arg_0.current_user(),
            arg_6=arg_6
        )
        arg_0.session.add(arg_7)

        arg_0.session.commit()


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
original_text
=
arg_1
try
:
return
getattr
(
arg_0
,
arg_0
.
entry_point
)
(
arg_1
)
except
(
DeadEnd
)
as
exc
:
raise
ParserError
(
arg_0
.
most_consumed
,
"Failed to Func input"
)
from
exc
return
tree

def Func(arg_0, arg_1):
    """Attempt to Func source code."""
    arg_0.original_text = arg_1

    try:
      return getattr(arg_0, arg_0.entry_point)(arg_1)
    except (DeadEnd) as exc:
      raise ParserError(arg_0.most_consumed, "Failed to Func input") from exc
    return tree


def Func(arg_0, arg_1=30):
    """Reformat a function signature to a more compact form."""
    arg_2 = re.sub(r"^\((.*)\)$", r"\1", arg_0).strip()

    # Strip strings (which can contain things that confuse the code below)
    arg_2 = re.sub(r"\\\\", "", arg_2)
    arg_2 = re.sub(r"\\'", "", arg_2)
    arg_2 = re.sub(r"'[^']*'", "", arg_2)

    # Parse the signature to arguments + options
    arg_3 = []
    arg_4 = []

    arg_5 = re.compile(r"^(.*, |)([a-zA-Z0-9_*]+)=")
    while arg_2:
        arg_6 = arg_5.search(arg_2)
        if not arg_6:
            # The rest are arguments
            arg_3 = arg_2.split(', ')
            break

        arg_4.insert(0, arg_6.group(2))
        arg_2 = arg_6.group(1)[:-2]

    # Produce a more compact signature
    arg_0 = limited_join(", ", arg_3, arg_1=arg_1-2)
    if arg_4:
        if not arg_0:
            arg_0 = "[%s]" % limited_join(", ", arg_4, arg_1=arg_1-4)
        elif len(arg_0) < arg_1 - 4 - 2 - 3:
            arg_0 += "[, %s]" % limited_join(", ", arg_4,
                                           arg_1=arg_1-len(arg_0)-4-2)

    return u"(%s)" % arg_0

Reformat a function signature to a more compact form .


def Func ( arg_0 , arg_1 = None , arg_2 = "/" ) : if arg_1 : return arg_0 . request ( arg_1 , params = { "path" : arg_2 } , method = "get" ) . json ( ) else : return arg_0 . request ( params = { "path" : arg_2 } , method = "get" ) . json ( )

def Func(arg_0, arg_1=None, arg_2="/"):
        """ Stat a file in an allocation directory.

           https://www.nomadproject.io/docs/http/client-fs-stat.html

            arguments:
              - id
              - path
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        if arg_1:
            return arg_0.request(arg_1, params={"path": arg_2}, method="get").json()
        else:
            return arg_0.request(params={"path": arg_2}, method="get").json()

Stat a file in an allocation directory .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_2
in
misc
.
__all__
:
return
getattr
(
misc
,
arg_2
)
try
:
arg_3
=
tower_cli
.
get_resource
(
arg_2
)
return
ResSubcommand
(
arg_3
)
except
ImportError
:
pass
secho
(
'No such command: %s.'
%
arg_2
,
fg
=
'red'
,
bold
=
True
)
sys
.
exit
(
2
)

def Func(arg_0, arg_1, arg_2):
        """Given a command identified by its name, import the appropriate
        module and return the decorated command.

        Resources are automatically commands, but if both a resource and
        a command are defined, the command takes precedence.
        """
        # First, attempt to get a basic command from `tower_cli.api.misc`.
        if arg_2 in misc.__all__:
            return getattr(misc, arg_2)

        # No command was found; try to get a resource.
        try:
            arg_3 = tower_cli.get_resource(arg_2)
            return ResSubcommand(arg_3)
        except ImportError:
            pass

        # Okay, we weren't able to find a command.
        secho('No such command: %s.' % arg_2, fg='red', bold=True)
        sys.exit(2)

Given a command identified by its name import the appropriate module and return the decorated command .


def Func ( arg_0 , arg_1 ) : arg_2 = descriptor_list ( ) . get ( arg_1 ) if arg_2 is not None : arg_2 . _value_read . set ( )

def Func(arg_0, arg_1):
        """Called when the specified descriptor has changed its value."""
        # Tell the descriptor it has a new value to read.
        arg_2 = descriptor_list().get(arg_1)
        if arg_2 is not None:
            arg_2._value_read.set()

Called when the specified descriptor has changed its value .


def Func ( arg_0 , arg_1 , arg_2 ) : if str ( arg_1 . id ) in arg_0 . Funcer : return arg_0 . Funcer [ str ( arg_1 . id ) ] ( arg_1 , arg_2 ) return arg_0 . Funcer [ "default" ] ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """ Handle a list of references depending on the text identifier using the Funcer dictionary.

        :param text: Text object from which comes the references
        :type text: MyCapytains.resources.texts.api.Text
        :param reffs: List of references to transform
        :type reffs: References
        :return: Transformed list of references
        :rtype: [str]
        """
        if str(arg_1.id) in arg_0.Funcer:
            return arg_0.Funcer[str(arg_1.id)](arg_1, arg_2)
        return arg_0.Funcer["default"](arg_1, arg_2)

Handle a list of references depending on the text identifier using the chunker dictionary.

        :param text: Text object from which comes the references
        :type text: MyCapytains.resources.texts.api.Text
        :param reffs: List of references to transform
        :type reffs: References
        :return: Transformed list of references
        :rtype: [str]

Handle a list of references depending on the text identifier using the chunker dictionary .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 in arg_0 . get_widgets ( ) . items ( ) : if arg_3 . should_update ( ) : arg_1 . append ( arg_3 ) return arg_1

def Func(arg_0):
        """
        Returns all widgets that need an update.

        This should be scheduled every minute via crontab.

        """
        arg_1 = []
        for arg_2, arg_3 in arg_0.get_widgets().items():
            if arg_3.should_update():
                arg_1.append(arg_3)
        return arg_1

Returns all widgets that need an update .


return _format_task_uri(fmt, job_metadata, task_metadata)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = str ( arg_0 ) if '{' not in arg_3 : if arg_0 . endswith ( '.log' ) : arg_3 = os . path . splitext ( arg_0 ) [ 0 ] else : arg_3 = os . path . join ( arg_0 , '{job-id}' ) if arg_2 . get ( 'task-id' ) is not None : arg_3 += '.{task-id}' if arg_2 . get ( 'task-attempt' ) is not None : arg_3 += '.{task-attempt}' arg_3 += '.log' return _format_task_uri ( arg_3 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
  """Inserts task metadata into the logging URI.

  The core behavior is inspired by the Google Pipelines API:
    (1) If a the uri ends in ".log", then that is the logging path.
    (2) Otherwise, the uri is treated as "directory" for logs and a filename
        needs to be automatically generated.

  For (1), if the job is a --tasks job, then the {task-id} is inserted
  before ".log".

  For (2), the file name generated is {job-id}, or for --tasks jobs, it is
  {job-id}.{task-id}.

  In both cases .{task-attempt} is inserted before .log for --retries jobs.

  In addition, full task metadata substitution is supported. The URI
  may include substitution strings such as
  "{job-id}", "{task-id}", "{job-name}", "{user-id}", and "{task-attempt}".

  Args:
    uri: User-specified logging URI which may contain substitution fields.
    job_metadata: job-global metadata.
    task_metadata: tasks-specific metadata.

  Returns:
    The logging_uri formatted as described above.
  """

  # If the user specifies any formatting (with curly braces), then use that
  # as the format string unchanged.
  arg_3 = str(arg_0)
  if '{' not in arg_3:
    if arg_0.endswith('.log'):
      # URI includes a filename. Trim the extension and just use the prefix.
      arg_3 = os.path.splitext(arg_0)[0]
    else:
      # URI is a path to a directory. The job-id becomes the filename prefix.
      arg_3 = os.path.join(arg_0, '{job-id}')

    # If this is a task job, add the task-id.
    if arg_2.get('task-id') is not None:
      arg_3 += '.{task-id}'

    # If this is a retryable task, add the task-attempt.
    if arg_2.get('task-attempt') is not None:
      arg_3 += '.{task-attempt}'

    arg_3 += '.log'

  return _format_task_uri(arg_3, arg_1, arg_2)

Inserts task metadata into the logging URI .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . support_pruning ( ) arg_3 = [ ( arg_1 , a ) for a in arg_0 . curr_domains [ arg_1 ] if a != arg_2 ] arg_0 . curr_domains [ arg_1 ] = [ arg_2 ] return arg_3

def Func(arg_0, arg_1, arg_2):
        "Start accumulating inferences from assuming var=value."
        arg_0.support_pruning()
        arg_3 = [(arg_1, a) for a in arg_0.curr_domains[arg_1] if a != arg_2]
        arg_0.curr_domains[arg_1] = [arg_2]
        return arg_3

Start accumulating inferences from assuming var = value .


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

def Func(arg_0, arg_1, arg_2):
        """
        Get an action.

        action_name -- name of the action
        action_id -- ID of the action

        Returns the requested action if found, else None.
        """
        if arg_1 not in arg_0.actions:
            return None

        for arg_3 in arg_0.actions[arg_1]:
            if arg_3.id == arg_2:
                return arg_3

        return None


def
Func
(
arg_0
,
arg_1
)
:
if
os
.
path
.
isfile
(
arg_1
)
:
with
open
(
arg_1
,
'r'
)
as
tfile
:
arg_0
.
write
(
'============ Content of '
+
arg_1
)
arg_0
.
write
(
'\n'
)
arg_0
.
write
(
tfile
.
read
(
)
)
arg_0
.
write
(
'\n\n'
)

def Func(arg_0,arg_1):
    """
    Write one log file into the summary text file.

    Parameters
    ----------
    fhandle :  Python file handle
        file handle to the summary text file
    file2read : Python file handle
        file handle to log file where we want to add its content to the summary text file.

    :return: none
    """
    if os.path.isfile(arg_1):

        # write summary of failed tests logs
        with open(arg_1,'r') as tfile:
            arg_0.write('============ Content of '+ arg_1)
            arg_0.write('\n')
            arg_0.write(tfile.read())
            arg_0.write('\n\n')

Write one log file into the summary text file .


def
Func
(
arg_0
)
:
arg_0
=
re
.
sub
(
r'\n'
,
' '
,
arg_0
.
lower
(
)
)
return
re
.
sub
(
r'[^a-z\s]'
,
''
,
arg_0
)

def Func(arg_0):
    """Return a lowercased string with non alphabetic chars removed.

    White spaces are not to be removed."""
    arg_0 = re.sub(r'\n', ' ',  arg_0.lower())
    return re.sub(r'[^a-z\s]', '', arg_0)

Return a lowercased string with non alphabetic chars removed .


def
Func
(
arg_0
)
:
flask_app
.
base_config
.
update
(
arg_0
)
if
arg_0
.
has_key
(
'working_directory'
)
:
arg_1
=
os
.
path
.
abspath
(
arg_0
[
'working_directory'
]
)
if
arg_2
.
notebook_dir
!=
arg_1
:
if
not
os
.
path
.
exists
(
arg_1
)
:
raise
IOError
(
'Path not found: %s'
%
arg_1
)
arg_2
.
notebook_dir
=
arg_1

def Func(arg_0):
    """ Update config options with the provided dictionary of options.
    """
    flask_app.base_config.update(arg_0)

    # Check for changed working directory.
    if arg_0.has_key('working_directory'):
        arg_1 = os.path.abspath(arg_0['working_directory'])
        if arg_2.notebook_dir != arg_1:
            if not os.path.exists(arg_1):
                raise IOError('Path not found: %s' % arg_1)
            arg_2.notebook_dir = arg_1

Update config options with the provided dictionary of options .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
from
.
terminal
import
run_command
if
arg_2
is
True
:
return
_Func
(
arg_0
,
arg_1
)
arg_3
=
'-xf'
if
arg_0
.
endswith
(
".tar.gz"
)
:
arg_3
=
'-xzf'
arg_4
=
[
"tar"
,
arg_3
,
arg_0
,
"-C"
,
arg_1
,
"--exclude=dev/*"
]
if
not
bot
.
is_quiet
(
)
:
print
(
"Extracting %s"
%
arg_0
)
return
run_command
(
arg_4
)

def Func(arg_0, arg_1, arg_2=False):
    '''extract a tar archive to a specified output folder

        Parameters
        ==========
        archive: the archive file to extract
        output_folder: the output folder to extract to
        handle_whiteout: use docker2oci variation to handle whiteout files

    '''
    from .terminal import run_command

    # Do we want to remove whiteout files?
    if arg_2 is True:
        return _Func(arg_0, arg_1)

    # If extension is .tar.gz, use -xzf
    arg_3 = '-xf'
    if arg_0.endswith(".tar.gz"):
        arg_3 = '-xzf'

    # Just use command line, more succinct.
    arg_4 = ["tar", arg_3, arg_0, "-C", arg_1, "--exclude=dev/*"]
    if not bot.is_quiet():
        print("Extracting %s" % arg_0)

    return run_command(arg_4)


def Func ( arg_0 , arg_1 ) : check_rdd ( arg_1 , ( sp . spmatrix , np . ndarray ) ) return arg_0 . _spark_Func ( SparkSGDClassifier , arg_1 )

def Func(arg_0, arg_1):
        """Distributed method to Func class labels for samples in X.

        Parameters
        ----------
        X : ArrayRDD containing {array-like, sparse matrix}
            Samples.

        Returns
        -------
        C : ArrayRDD
            Predicted class label per sample.
        """
        check_rdd(arg_1, (sp.spmatrix, np.ndarray))
        return arg_0._spark_Func(SparkSGDClassifier, arg_1)

Distributed method to predict class labels for samples in X.

        Parameters
        ----------
        X : ArrayRDD containing {array-like, sparse matrix}
            Samples.

        Returns
        -------
        C : ArrayRDD
            Predicted class label per sample.

Distributed method to predict class labels for samples in X .


def Func(arg_0, arg_1=0.01, arg_2=True):
    """ Try to snap together adjacent borders that are slightly mismatched.

    This situation can happen on badly triangulated adjacent patches defined by
    high order surfaces. For each border vertex the filter snaps it onto the
    closest boundary edge only if it is closest of edge_legth*threshold. When
    vertex is snapped the corresponding face it split and a new vertex is
    created.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        edge_dist_ratio (float): Collapse edge when the edge / distance ratio
            is greater than this value. E.g. for default value 1000 two
            straight border edges are collapsed if the central vertex dist from
            the straight line composed by the two edges less than a 1/1000 of
            the sum of the edges length. Larger values enforce that only
            vertexes very close to the line are removed.
        unify_vert (bool): If true the snap vertices are welded together.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_3 = ''.join([
        '  <filter name="Snap Mismatched Borders">\n',
        '    <Param name="EdgeDistRatio" ',
        'value="{}" '.format(arg_1),
        'description="Edge Distance Ratio" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="UnifyVertices" ',
        'value="{}" '.format(str(arg_2).lower()),
        'description="UnifyVertices" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_3)
    return None

Try to snap together adjacent borders that are slightly mismatched .


return self.intersection(img_bb) is not None

def Func(arg_0, arg_1):
        """
        Estimate whether the bounding box is at least partially inside the image area.

        Parameters
        ----------
        image : (H,W,...) ndarray or tuple of int
            Image dimensions to use.
            If an ndarray, its shape will be used.
            If a tuple, it is assumed to represent the image shape
            and must contain at least two integers.

        Returns
        -------
        bool
            True if the bounding box is at least partially inside the image area. False otherwise.

        """
        arg_2 = normalize_shape(arg_1)
        arg_3, arg_4 = arg_2[0:2]
        arg_5 = np.finfo(np.float32).eps
        arg_6 = BoundingBox(x1=0, x2=arg_4-arg_5, y1=0, y2=arg_3-arg_5)
        return arg_0.intersection(arg_6) is not None

Estimate whether the bounding box is at least partially inside the image area .


def Func ( arg_0 ) : for arg_1 in arg_0 . _tables . values ( ) : for arg_2 in arg_1 : arg_2 . Func ( )

def Func(arg_0):
        """
        All fields of Epm with a default value and that are null will be set to their default value.
        """
        for arg_1 in arg_0._tables.values():
            for arg_2 in arg_1:
                arg_2.Func()

All fields of Epm with a default value and that are null will be set to their default value .


def Func(arg_0, arg_1=None):
    """
    Checks if an error occured, and if so throws an OSError containing the
    last OpenSSL error message

    :param result:
        An integer result code - 1 or greater indicates success

    :param exception_class:
        The exception class to use for the exception if an error occurred

    :raises:
        OSError - when an OpenSSL error occurs
    """

    if arg_0 > 0:
        return

    if arg_1 is None:
        arg_1 = OSError

    arg_2 = libcrypto.ERR_get_error()
    arg_3 = buffer_from_bytes(120)
    libcrypto.ERR_error_string(arg_2, arg_3)

    # Since we are dealing with a string, it is NULL terminated
    arg_4 = byte_string_from_buffer(arg_3)

    raise arg_1(_try_decode(arg_4))

Checks if an error occured and if so throws an OSError containing the last OpenSSL error message


def Func ( arg_0 ) : arg_1 = parse . urlsplit ( arg_0 ) arg_2 = parse . urlunsplit ( ( arg_1 . scheme , arg_1 . netloc , arg_1 . path , 0 , 0 ) ) arg_3 = parse . parse_qsl ( arg_1 . query , True ) return arg_2 , arg_3

def Func(arg_0):
        """
        Splits given url to url base and params converted to list of tuples.
        """

        arg_1 = parse.urlsplit(arg_0)
        arg_2 = parse.urlunsplit((arg_1.scheme, arg_1.netloc, arg_1.path, 0, 0))
        arg_3 = parse.parse_qsl(arg_1.query, True)

        return arg_2, arg_3

Splits given url to url base and params converted to list of tuples .


def Func(arg_0, arg_1):
        """
        Add a property to this thing.

        property_ -- property to add
        """
        arg_1.set_href_prefix(arg_0.href_prefix)
        arg_0.properties[arg_1.name] = arg_1


def Func ( arg_0 , ** arg_1 ) : arg_2 = { } arg_3 = arg_0 . get_inlines_names ( ) if arg_3 : arg_2 . update ( zip ( arg_3 , arg_1 . get ( 'inlines' , [ ] ) ) ) if 'formset' in arg_1 : arg_2 [ arg_3 [ 0 ] ] = arg_1 [ 'formset' ] arg_2 . update ( arg_1 ) return super ( NamedFormsetsMixin , arg_0 ) . Func ( ** arg_2 )

def Func(arg_0, **arg_1):
        """
        If `inlines_names` has been defined, add each formset to the context under
        its corresponding entry in `inlines_names`
        """
        arg_2 = {}
        arg_3 = arg_0.get_inlines_names()

        if arg_3:
            # We have formset or inlines in context, but never both
            arg_2.update(zip(arg_3, arg_1.get('inlines', [])))
            if 'formset' in arg_1:
                arg_2[arg_3[0]] = arg_1['formset']
        arg_2.update(arg_1)
        return super(NamedFormsetsMixin, arg_0).Func(**arg_2)

If inlines_names has been defined add each formset to the context under its corresponding entry in inlines_names


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 ) : arg_5 = [ ] if istype ( arg_0 , sequence_types ) and len ( arg_0 ) < arg_3 : arg_6 = can_sequence ( arg_0 ) for arg_7 in arg_6 : arg_5 . extend ( _extract_buffers ( arg_7 , arg_1 ) ) elif istype ( arg_0 , dict ) and len ( arg_0 ) < arg_3 : arg_6 = { } for arg_8 in sorted ( arg_0 ) : arg_7 = can ( arg_0 [ arg_8 ] ) arg_5 . extend ( _extract_buffers ( arg_7 , arg_1 ) ) arg_6 [ arg_8 ] = arg_7 else : arg_6 = can ( arg_0 ) arg_5 . extend ( _extract_buffers ( arg_6 , arg_1 ) ) arg_5 . insert ( 0 , pickle . dumps ( arg_6 , PICKLE_PROTOCOL ) ) return arg_5

def Func(arg_0, arg_1=arg_2, arg_3=arg_4):
    """Serialize an object into a list of sendable buffers.

    Parameters
    ----------

    obj : object
        The object to be serialized
    buffer_threshold : int
        The threshold (in bytes) for pulling out data buffers
        to avoid pickling them.
    item_threshold : int
        The maximum number of items over which canning will iterate.
        Containers (lists, dicts) larger than this will be pickled without
        introspection.

    Returns
    -------
    [bufs] : list of buffers representing the serialized object.
    """
    arg_5 = []
    if istype(arg_0, sequence_types) and len(arg_0) < arg_3:
        arg_6 = can_sequence(arg_0)
        for arg_7 in arg_6:
            arg_5.extend(_extract_buffers(arg_7, arg_1))
    elif istype(arg_0, dict) and len(arg_0) < arg_3:
        arg_6 = {}
        for arg_8 in sorted(arg_0):
            arg_7 = can(arg_0[arg_8])
            arg_5.extend(_extract_buffers(arg_7, arg_1))
            arg_6[arg_8] = arg_7
    else:
        arg_6 = can(arg_0)
        arg_5.extend(_extract_buffers(arg_6, arg_1))

    arg_5.insert(0, pickle.dumps(arg_6, PICKLE_PROTOCOL))
    return arg_5

Serialize an object into a list of sendable buffers .


(self, in_tile=None, in_data=None, out_tile=None)

return self.config.output.extract_subset(
            input_data_tiles=[(in_tile, in_data)],
            out_tile=out_tile
        )

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : return arg_0 . config . output . extract_subset ( input_data_tiles = [ ( arg_1 , arg_2 ) ] , arg_3 = arg_3 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Extract data from tile."""
        return arg_0.config.output.extract_subset(
            input_data_tiles=[(arg_1, arg_2)],
            arg_3=arg_3
        )


def Func ( arg_0 , arg_1 = arg_2 ) : @ wraps ( arg_0 ) async def wrapper ( arg_3 , * arg_4 , ** arg_5 ) : try : async with async_timeout . timeout ( arg_1 ) : return await arg_0 ( arg_3 , * arg_4 , ** arg_5 ) except ( asyncio . TimeoutError , ClientError , Error ) : pass _LOGGER . debug ( "Func" ) try : async with async_timeout . timeout ( arg_1 ) : await arg_3 . login ( ) return await arg_0 ( arg_3 , * arg_4 , ** arg_5 ) except ( asyncio . TimeoutError , ClientError , Error ) : raise Error ( str ( arg_0 ) ) return wrapper

def Func(arg_0, arg_1=arg_2):
    """Decorator that will try to login and redo an action before failing."""
    @wraps(arg_0)
    async def wrapper(arg_3, *arg_4, **arg_5):
        """Wrap a function with timeout."""
        try:
            async with async_timeout.timeout(arg_1):
                return await arg_0(arg_3, *arg_4, **arg_5)
        except (asyncio.TimeoutError, ClientError, Error):
            pass

        _LOGGER.debug("Func")
        try:
            async with async_timeout.timeout(arg_1):
                await arg_3.login()
                return await arg_0(arg_3, *arg_4, **arg_5)
        except (asyncio.TimeoutError, ClientError, Error):
            raise Error(str(arg_0))

    return wrapper

Decorator that will try to login and redo an action before failing .


def Func(arg_0, arg_1=False, arg_2=False):
        # type: (bool, bool) -> None
        """
        Searches for an appropriate config file. If found, Funcs the file into
        the current instance. This method can also be used to reFunc a
        configuration. Note that you may want to set ``reFunc`` to ``True`` to
        clear the configuration before Funcing in that case.  Without doing
        that, values will remain available even if they have been removed from
        the config files.

        :param reFunc: if set to ``True``, the existing values are cleared
                       before reFuncing.
        :param require_Func: If set to ``True`` this will raise a
                             :py:exc:`IOError` if no config file has been found
                             to Func.
        """

        if arg_1:  # pragma: no cover
            arg_0.config = None

        # only Func the config if necessary (or explicitly requested)
        if arg_0.config:  # pragma: no cover
            arg_0._log.debug('Returning cached config instance. Use '
                            '``reFunc=True`` to avoid caching!')
            return

        arg_4 = arg_0._effective_path()
        arg_5 = arg_0._effective_filename()

        # Next, use the resolved path to find the filenames. Keep track of
        # which files we Funced in order to inform the user.
        arg_0._active_path = [join(_, arg_5) for _ in arg_4]
        for arg_7 in arg_4:
            arg_8 = join(arg_7, arg_5)
            arg_9 = arg_0.check_file(arg_8)
            if arg_9:
                arg_10 = 'Updating' if arg_0._Funced_files else 'Loading initial'
                arg_0._log.info('%s config from %s', arg_10, arg_8)
                arg_0.read(arg_8)
                if arg_8 == expanduser("~/.%s/%s/%s" % (
                        arg_0.group_name, arg_0.app_name, arg_0.filename)):
                    arg_0._log.warning(
                        "DEPRECATION WARNING: The file "
                        "'%s/.%s/%s/app.ini' was Funced. The XDG "
                        "Basedir standard requires this file to be in "
                        "'%s/.config/%s/%s/app.ini'! This location "
                        "will no longer be parsed in a future version of "
                        "config_resolver! You can already (and should) move "
                        "the file!", expanduser("~"), arg_0.group_name,
                        arg_0.app_name, expanduser("~"), arg_0.group_name,
                        arg_0.app_name)
                arg_0._Funced_files.append(arg_8)

        if not arg_0._Funced_files and not arg_2:
            arg_0._log.warning(
                "No config file named %s found! Search path was %r",
                arg_5,
                arg_4)
        elif not arg_0._Funced_files and arg_2:
            raise IOError("No config file named %s found! Search path "
                          "was %r" % (arg_5, arg_4))

Searches for an appropriate config file. If found, loads the file into
        the current instance. This method can also be used to reload a
        configuration. Note that you may want to set ``reload`` to ``True`` to
        clear the configuration before loading in that case.  Without doing
        that, values will remain available even if they have been removed from
        the config files.

        :param reload: if set to ``True``, the existing values are cleared
                       before reloading.
        :param require_load: If set to ``True`` this will raise a
                             :py:exc:`IOError` if no config file has been found
                             to load.

Searches for an appropriate config file . If found loads the file into the current instance . This method can also be used to reload a configuration . Note that you may want to set reload to True to clear the configuration before loading in that case . Without doing that values will remain available even if they have been removed from the config files .


(self, hpc=None, access=None, name=None, collab_id=None,
                      page_size=DEFAULT_PAGE_SIZE, page=None, ordering=None)

return self._authenticated_request \
            .to_endpoint('project/') \
            .with_params(self._prep_params(locals())) \
            .return_body() \
            .get()

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = arg_6 , arg_7 = None , arg_8 = None ) : return arg_0 . _authenticated_request . to_endpoint ( 'project/' ) . with_params ( arg_0 . _prep_params ( locals ( ) ) ) . return_body ( ) . get ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
                      arg_5=arg_6, arg_7=None, arg_8=None):
        '''List all the projects the user have access to.

            This function does not retrieve all results, pages have
            to be manually retrieved by the caller.

        Args:
            hpc (bool): If 'true', the result will contain only the HPC projects
                (Unicore projects).
            access (str): If provided, the result will contain only projects
                where the user has the provided acccess.
                Admitted values: ['read', 'write'].
            name (str): Filter on the project name.
            collab_id (int): Filter on the collab id.
            page_size (int): Number of elements per page.
            page (int): Number of the page
            ordering (str): Indicate on which fields to sort the result.
                Prepend '-' to invert order. Multiple values can be provided.
                Ordering is supported on: ['name', 'created_on', 'modified_on'].
                Example: ordering='name,created_on'

        Returns:
            A dictionary of the results::

            {
                u'count': 256,
                u'next': u'http://link.to.next/page',
                u'previous': None,
                u'results': [{u'collab_id': 2079,
                    u'created_by': u'258666',
                    u'created_on': u'2017-02-23T15:09:27.626973Z',
                    u'description': u'',
                    u'entity_type': u'project',
                    u'modified_by': u'258666',
                    u'modified_on': u'2017-02-23T15:09:27.627025Z',
                    u'name': u'2079',
                    u'uuid': u'64a6ad2e-acd1-44a3-a4cd-6bd96e3da2b0'}]
            }

        Raises:
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        return arg_0._authenticated_request \
            .to_endpoint('project/') \
            .with_params(arg_0._prep_params(locals())) \
            .return_body() \
            .get()

List all the projects the user have access to .


(self, file_id, ticket, captcha_response=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = { 'ticket' : arg_2 , 'file' : arg_1 } if arg_3 : arg_4 [ 'captcha_response' ] = arg_3 return arg_0 . _get ( 'file/dl' , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Requests direct download link for requested file,
        this method makes use of the response of prepare_download, prepare_download must be called first.

        Args:
            file_id (str): id of the file to be downloaded.

            ticket (str): preparation ticket is found in prepare_download response,\
                          this is why we need to call prepare_download before Func.

            captcha_response (:obj:`str`, optional): sometimes prepare_download will have captcha url to be solved, \
                                                     first, this is the solution of the captcha.

        Returns:
            dict: dictionary containing (file info, download url, ...). ::

                  {
                    "name": "The quick brown fox.txt",
                    "size": 12345,
                    "sha1": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
                    "content_type": "plain/text",
                    "upload_at": "2011-01-26 13:33:37",
                    "url": "https://abvzps.example.com/dl/l/4spxX_-cSO4/The+quick+brown+fox.txt",
                    "token": "4spxX_-cSO4"
                  }

        """
        arg_4 = {'ticket': arg_2, 'file': arg_1}

        if arg_3:
            arg_4['captcha_response'] = arg_3

        return arg_0._get('file/dl', arg_4)

Requests direct download link for requested file,
        this method makes use of the response of prepare_download, prepare_download must be called first.

        Args:
            file_id (str): id of the file to be downloaded.

            ticket (str): preparation ticket is found in prepare_download response,\
                          this is why we need to call prepare_download before get_download_link.

            captcha_response (:obj:`str`, optional): sometimes prepare_download will have captcha url to be solved, \
                                                     first, this is the solution of the captcha.

        Returns:
            dict: dictionary containing (file info, download url, ...). ::

                  {
                    "name": "The quick brown fox.txt",
                    "size": 12345,
                    "sha1": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
                    "content_type": "plain/text",
                    "upload_at": "2011-01-26 13:33:37",
                    "url": "https://abvzps.example.com/dl/l/4spxX_-cSO4/The+quick+brown+fox.txt",
                    "token": "4spxX_-cSO4"
                  }

Requests direct download link for requested file this method makes use of the response of prepare_download prepare_download must be called first .


return user_social_auth.user if user_social_auth else None

def Func ( arg_0 , arg_1 ) : arg_2 = UserSocialAuth . objects . select_related ( 'user' ) . filter ( user__username = arg_1 , provider = arg_0 . backend_name ) . first ( ) return arg_2 . user if arg_2 else None

def Func(arg_0, arg_1):
    """
    Find the LMS user from the LMS model `UserSocialAuth`.

    Arguments:
        tpa_provider (third_party_auth.provider): third party auth provider object
        tpa_username (str): Username returned by the third party auth

    """
    arg_2 = UserSocialAuth.objects.select_related('user').filter(
        user__username=arg_1, provider=arg_0.backend_name
    ).first()

    return arg_2.user if arg_2 else None

Find the LMS user from the LMS model UserSocialAuth .


(
        x, src, dst, map_args=None, output_shape=None, order=1, mode='constant', cval=0.0, clip=True,
        preserve_range=False
)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = 1 , arg_6 = 'constant' , arg_7 = 0.0 , arg_8 = True , arg_9 = False ) : if arg_3 is None : arg_3 = { } if isinstance ( arg_1 , list ) : arg_1 = np . array ( arg_1 ) if isinstance ( arg_2 , list ) : arg_2 = np . array ( arg_2 ) if np . max ( arg_0 ) > 1 : arg_0 = arg_0 / 255 arg_10 = transform . ProjectiveTransform ( ) arg_10 . estimate ( arg_2 , arg_1 ) arg_11 = transform . warp ( arg_0 , arg_10 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 ) return arg_11

def Func(
        arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=1, arg_6='constant', arg_7=0.0, arg_8=True,
        arg_9=False
):
    """Projective transform by given coordinates, usually 4 coordinates.

    see `scikit-image <http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html>`__.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    src : list or numpy
        The original coordinates, usually 4 coordinates of (width, height).
    dst : list or numpy
        The coordinates after transformation, the number of coordinates is the same with src.
    map_args : dictionary or None
        Keyword arguments passed to inverse map.
    output_shape : tuple of 2 int
        Shape of the output image generated. By default the shape of the input image is preserved. Note that, even for multi-band images, only rows and columns need to be specified.
    order : int
        The order of interpolation. The order has to be in the range 0-5:
            - 0 Nearest-neighbor
            - 1 Bi-linear (default)
            - 2 Bi-quadratic
            - 3 Bi-cubic
            - 4 Bi-quartic
            - 5 Bi-quintic
    mode : str
        One of `constant` (default), `edge`, `symmetric`, `reflect` or `wrap`.
        Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.
    cval : float
        Used in conjunction with mode `constant`, the value outside the image boundaries.
    clip : boolean
        Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.
    preserve_range : boolean
        Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float.

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

    Examples
    --------
    Assume X is an image from CIFAR-10, i.e. shape == (32, 32, 3)

    >>> src = [[0,0],[0,32],[32,0],[32,32]]     # [w, h]
    >>> dst = [[10,10],[0,32],[32,0],[32,32]]
    >>> x = tl.prepro.Func(X, src, dst)

    References
    -----------
    - `scikit-image : geometric transformations <http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html>`__
    - `scikit-image : examples <http://scikit-image.org/docs/dev/auto_examples/index.html>`__

    """
    if arg_3 is None:
        arg_3 = {}
    # if type(src) is list:
    if isinstance(arg_1, list):  # convert to numpy
        arg_1 = np.array(arg_1)
    # if type(dst) is list:
    if isinstance(arg_2, list):
        arg_2 = np.array(arg_2)
    if np.max(arg_0) > 1:  # convert to [0, 1]
        arg_0 = arg_0 / 255

    arg_10 = transform.ProjectiveTransform()
    arg_10.estimate(arg_2, arg_1)
    arg_11 = transform.warp(
        arg_0, arg_10, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6, arg_7=arg_7, arg_8=arg_8,
        arg_9=arg_9
    )
    return arg_11

Projective transform by given coordinates, usually 4 coordinates.

    see `scikit-image <http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html>`__.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    src : list or numpy
        The original coordinates, usually 4 coordinates of (width, height).
    dst : list or numpy
        The coordinates after transformation, the number of coordinates is the same with src.
    map_args : dictionary or None
        Keyword arguments passed to inverse map.
    output_shape : tuple of 2 int
        Shape of the output image generated. By default the shape of the input image is preserved. Note that, even for multi-band images, only rows and columns need to be specified.
    order : int
        The order of interpolation. The order has to be in the range 0-5:
            - 0 Nearest-neighbor
            - 1 Bi-linear (default)
            - 2 Bi-quadratic
            - 3 Bi-cubic
            - 4 Bi-quartic
            - 5 Bi-quintic
    mode : str
        One of `constant` (default), `edge`, `symmetric`, `reflect` or `wrap`.
        Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.
    cval : float
        Used in conjunction with mode `constant`, the value outside the image boundaries.
    clip : boolean
        Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.
    preserve_range : boolean
        Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float.

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

    Examples
    --------
    Assume X is an image from CIFAR-10, i.e. shape == (32, 32, 3)

    >>> src = [[0,0],[0,32],[32,0],[32,32]]     # [w, h]
    >>> dst = [[10,10],[0,32],[32,0],[32,32]]
    >>> x = tl.prepro.projective_transform_by_points(X, src, dst)

    References
    -----------
    - `scikit-image : geometric transformations <http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html>`__
    - `scikit-image : examples <http://scikit-image.org/docs/dev/auto_examples/index.html>`__

Projective transform by given coordinates usually 4 coordinates .


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

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None ) : if arg_4 is None : arg_4 = sys . stderr if arg_4 is None : return try : arg_4 . write ( formatwarning ( arg_0 , arg_1 , arg_2 , arg_3 , arg_5 ) ) except ( IOError , UnicodeError ) : pass

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
    """Hook to write a warning to a file; replace if you like."""
    if arg_4 is None:
        arg_4 = sys.stderr
        if arg_4 is None:
            # sys.stderr is None - warnings get lost
            return
    try:
        arg_4.write(formatwarning(arg_0, arg_1, arg_2, arg_3, arg_5))
    except (IOError, UnicodeError):
        pass # the file (probably stderr) is invalid - this warning gets lost.

Hook to write a warning to a file ; replace if you like .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . pop ( 'ANN' , [ ] ) or [ ] arg_3 = [ ] for arg_4 in arg_2 : if isinstance ( arg_4 , dict ) : arg_1 [ 'ANN' ] = arg_2 return arg_1 arg_5 = [ i or None for i in arg_4 . split ( '|' ) ] arg_6 = dict ( zip ( arg_0 . _snpeff_ann_fields , arg_5 ) ) if arg_6 . get ( 'Annotation' ) : arg_6 [ 'Annotation' ] = arg_6 [ 'Annotation' ] . split ( '&' ) arg_3 . append ( arg_6 ) arg_1 [ 'ANN' ] = arg_3 return arg_1

def Func(arg_0, arg_1):
        """
        Specialized INFO field parser for SnpEff ANN fields.
        Requires self._snpeff_ann_fields to be set.
        """
        arg_2 = arg_1.pop('ANN', []) or []
        # Overwrite the existing ANN with something parsed
        # Split on '|', merge with the ANN keys parsed above.
        # Ensure empty values are None rather than empty string.
        arg_3 = []
        for arg_4 in arg_2:
            # For multi-allelic records, we may have already
            # processed ANN. If so, quit now.
            if isinstance(arg_4, dict):
                arg_1['ANN'] = arg_2
                return arg_1

            arg_5 = [i or None for i in arg_4.split('|')]
            arg_6 = dict(zip(arg_0._snpeff_ann_fields, arg_5))

            # Further split the Annotation field by '&'
            if arg_6.get('Annotation'):
                arg_6['Annotation'] = arg_6['Annotation'].split('&')

            arg_3.append(arg_6)

        arg_1['ANN'] = arg_3
        return arg_1

Specialized INFO field parser for SnpEff ANN fields . Requires self . _snpeff_ann_fields to be set .


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . Funcection ( arg_0 . http_conn_id ) arg_0 . base_url = arg_2 . host if arg_2 . host else 'https://api.opsgenie.com' arg_4 = requests . Session ( ) if arg_1 : arg_4 . headers . update ( arg_1 ) return arg_4

def Func(arg_0, arg_1=None):
        """
        Overwrite HttpHook Func because this hook just needs base_url
        and headers, and does not need generic params

        :param headers: additional headers to be passed through as a dictionary
        :type headers: dict
        """
        arg_2 = arg_0.Funcection(arg_0.http_conn_id)
        arg_0.base_url = arg_2.host if arg_2.host else 'https://api.opsgenie.com'
        arg_4 = requests.Session()
        if arg_1:
            arg_4.headers.update(arg_1)
        return arg_4

Overwrite HttpHook get_conn because this hook just needs base_url
        and headers, and does not need generic params

        :param headers: additional headers to be passed through as a dictionary
        :type headers: dict

Overwrite HttpHook get_conn because this hook just needs base_url and headers and does not need generic params


def Func(*arg_0, **arg_1):
    """
    Create a SDR classifier factory.
    The implementation of the SDR Classifier can be specified with
    the "implementation" keyword argument.

    The SDRClassifierFactory uses the implementation as specified in
     `Default NuPIC Configuration <default-config.html>`_.
    """
    arg_2 = arg_1.pop('implementation', None)
    if arg_2 is None:
      arg_2 = Configuration.get('nupic.opf.sdrClassifier.implementation')
    if arg_2 == 'py':
      return SDRClassifier(*arg_0, **arg_1)
    elif arg_2 == 'cpp':
      return FastSDRClassifier(*arg_0, **arg_1)
    elif arg_2 == 'diff':
      return SDRClassifierDiff(*arg_0, **arg_1)
    else:
      raise ValueError('Invalid classifier implementation (%r). Value must be '
                       '"py", "cpp" or "diff".' % arg_2)

Create a SDR classifier factory . The implementation of the SDR Classifier can be specified with the implementation keyword argument .


def Func ( arg_0 , arg_1 ) : temple . update . update ( new_template = arg_0 , new_version = arg_1 )

def Func(arg_0, arg_1):
    """
    Switch a project's template to a different template.
    """
    temple.update.update(new_template=arg_0, new_version=arg_1)

Switch a project s template to a different template .


def Func(arg_0, arg_1=None, arg_2=None):
        """  Setup time axis. """

        # now check to see how many integrations requested
        arg_3, arg_4 = 0, arg_0.n_ints_in_file
        if arg_1:
            arg_3 = arg_1
        if arg_2:
            arg_4 = arg_2
        arg_5 = arg_4 - arg_3

        ## Setup time axis
        arg_6 = arg_0.header[b'tstart']
        arg_7 = arg_0.header[b'tsamp']

        arg_0.timestamps = np.arange(0, arg_5) * arg_7 / 24./60./60 + arg_6

        return arg_3, arg_4, arg_5


def Func(arg_0, arg_1):
        """Read a specified amount

        Reads will only be throttled if bandwidth limiting is enabled.
        """
        if not arg_0._bandwidth_limiting_enabled:
            return arg_0._fileobj.Func(arg_1)

        # We do not want to be calling consume on every Func as the Func
        # amounts can be small causing the lock of the leaky bucket to
        # introduce noticeable overhead. So instead we keep track of
        # how many bytes we have seen and only call consume once we pass a
        # certain threshold.
        arg_0._bytes_seen += arg_1
        if arg_0._bytes_seen < arg_0._bytes_threshold:
            return arg_0._fileobj.Func(arg_1)

        arg_0._consume_through_leaky_bucket()
        return arg_0._fileobj.Func(arg_1)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) while True : try : arg_4 = next ( arg_3 ) arg_4 . prepare_playback ( ) yield arg_4 except StopIteration : arg_3 = arg_0 ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
    """Iterate over a finite iterator forever

    When the iterator is exhausted will call the function again to generate a
    new iterator and keep iterating.
    """
    arg_3 = arg_0(*arg_1, **arg_2)

    while True:
        try:
            arg_4 = next(arg_3)
            arg_4.prepare_playback()
            yield arg_4
        except StopIteration:
            arg_3 = arg_0(*arg_1, **arg_2)


def Func ( arg_0 , arg_1 = False ) : arg_0 . _verify ( ( None , u"from" , u"to" , u"both" , u"remove" ) , arg_1 )

def Func(arg_0, arg_1 = False):
        """Check if `self` is valid roster push item.

        Valid item must have proper `subscription` value other and valid value
        for 'ask'.

        :Parameters:
            - `fix`: if `True` than replace invalid 'subscription' and 'ask'
              values with the defaults
        :Types:
            - `fix`: `bool`

        :Raise: `ValueError` if the item is invalid.
        """
        arg_0._verify((None, u"from", u"to", u"both", u"remove"), arg_1)

Check if self is valid roster push item .


(self, data, alpha=0.01, max_iter=2000, **kwargs)

return nx.relabel_nodes(nx.DiGraph(edge_model.get_precision()),
                                {idx: i for idx, i in enumerate(data.columns)})

def Func ( arg_0 , arg_1 , arg_2 = 0.01 , arg_3 = 2000 , ** arg_4 ) : arg_5 = GraphLasso ( arg_2 = arg_2 , arg_3 = arg_3 ) arg_5 . fit ( arg_1 . values ) return nx . relabel_nodes ( nx . DiGraph ( arg_5 . get_precision ( ) ) , { arg_6 : arg_7 for arg_6 , arg_7 in enumerate ( arg_1 . columns ) } )

def Func(arg_0, arg_1, arg_2=0.01, arg_3=2000, **arg_4):
        """ Predict the graph skeleton.

        Args:
            data (pandas.DataFrame): observational data
            alpha (float): regularization parameter
            max_iter (int): maximum number of iterations

        Returns:
            networkx.Graph: Graph skeleton
        """
        arg_5 = GraphLasso(arg_2=arg_2, arg_3=arg_3)
        arg_5.fit(arg_1.values)

        return nx.relabel_nodes(nx.DiGraph(arg_5.get_precision()),
                                {arg_6: arg_7 for arg_6, arg_7 in enumerate(arg_1.columns)})


return [
            tag
            for tag
            in tags
            if str(label_sn) in tag.get('args', {}).values()
        ]

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . list ( ) return [ arg_3 for arg_3 in arg_2 if str ( arg_1 ) in arg_3 . Func ( 'args' , { } ) . values ( ) ]

def Func(arg_0, arg_1):
        """
        Get tags by a label's sn key

        :param label_sn: A corresponding label's ``sn`` key.
        :type label_sn: str or int

        :return: A list of matching tags. An empty list is returned if there are
            not any matches
        :rtype: list of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_2 = arg_0.list()
        return [
            arg_3
            for arg_3
            in arg_2
            if str(arg_1) in arg_3.Func('args', {}).values()
        ]


def
Func
(
arg_0
)
:
try
:
arg_1
=
compile
(
arg_0
,
"<string>"
,
mode
=
"exec"
,
flags
=
ast
.
PyCF_ONLY_AST
)
except
SyntaxError
:
return
Func
(
fix_lamdaline
(
arg_0
)
)
for
arg_2
in
ast
.
walk
(
arg_1
)
:
if
isinstance
(
arg_2
,
ast
.
FunctionDef
)
or
isinstance
(
arg_2
,
ast
.
Lambda
)
:
return
arg_2
raise
ValueError
(
"function definition not found"
)

def Func(arg_0):
    """Find the first FuncDef ast object in source"""

    try:
        arg_1 = compile(
            arg_0, "<string>", mode="exec", flags=ast.PyCF_ONLY_AST
        )
    except SyntaxError:
        return Func(fix_lamdaline(arg_0))

    for arg_2 in ast.walk(arg_1):
        if isinstance(arg_2, ast.FunctionDef) or isinstance(arg_2, ast.Lambda):
            return arg_2

    raise ValueError("function definition not found")


def Func(arg_0, arg_1, arg_2=False):
        """ writes the data to a stream

        Parameters
        ----------
        out_stream: file object
            the destination stream, implementing the write method
        do_compress: bool, optional, default False
            Flag to indicate if you want the date to be compressed
        """

        arg_0.update_header()

        if (
                arg_0.vlrs.get("ExtraBytesVlr")
                and not arg_0.points_data.extra_dimensions_names
        ):
            logger.error(
                "Las contains an ExtraBytesVlr, but no extra bytes were found in the point_record, "
                "removing the vlr"
            )
            arg_0.vlrs.extract("ExtraBytesVlr")

        if arg_2:
            arg_3 = create_laz_vlr(arg_0.points_data)
            arg_0.vlrs.append(known.LasZipVlr(arg_3.data()))
            arg_4 = vlrlist.RawVLRList.from_list(arg_0.vlrs)

            arg_0.header.offset_to_point_data = (
                    arg_0.header.size + arg_4.total_size_in_bytes()
            )
            arg_0.header.point_format_id = uncompressed_id_to_compressed(
                arg_0.header.point_format_id
            )
            arg_0.header.number_of_vlr = len(arg_4)

            arg_9 = compress_buffer(
                np.frombuffer(arg_0.points_data.array, np.uint8),
                arg_3.schema,
                arg_0.header.offset_to_point_data,
            ).tobytes()

        else:
            arg_4 = vlrlist.RawVLRList.from_list(arg_0.vlrs)
            arg_0.header.number_of_vlr = len(arg_4)
            arg_0.header.offset_to_point_data = (
                    arg_0.header.size + arg_4.total_size_in_bytes()
            )
            arg_9 = arg_0.points_data.raw_bytes()

        arg_0.header.Func(arg_1)
        arg_0._raise_if_not_expected_pos(arg_1, arg_0.header.size)
        arg_4.Func(arg_1)
        arg_0._raise_if_not_expected_pos(arg_1, arg_0.header.offset_to_point_data)
        arg_1.write(arg_9)


def
Func
(
arg_0
,
arg_1
)
:
if
'b'
not
in
arg_1
.
mode
:
raise
ValueError
(
"File has to be opened in binary mode."
)
arg_2
=
arg_0
.
_get
(
arg_0
.
_download_url
,
stream
=
True
)
if
arg_2
.
status_code
==
200
:
arg_2
.
raw
.
decode_content
=
True
copyfileobj
(
arg_2
.
raw
,
arg_1
,
int
(
arg_2
.
headers
[
'Content-Length'
]
)
)
else
:
raise
RuntimeError
(
"Response has status "
"code {}."
.
format
(
arg_2
.
status_code
)
)

def Func(arg_0, arg_1):
        """Write contents of this file to a local file.

        Pass in a filepointer `fp` that has been opened for writing in
        binary mode.
        """
        if 'b' not in arg_1.mode:
            raise ValueError("File has to be opened in binary mode.")

        arg_2 = arg_0._get(arg_0._download_url, stream=True)
        if arg_2.status_code == 200:
            arg_2.raw.decode_content = True
            copyfileobj(arg_2.raw, arg_1,
                        int(arg_2.headers['Content-Length']))

        else:
            raise RuntimeError("Response has status "
                               "code {}.".format(arg_2.status_code))

Write contents of this file to a local file .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . _inside_brackets ( ":" ) and arg_1 [ arg_2 ] [ 1 ] == "for" : arg_0 . _pop_token ( ) if arg_1 [ arg_2 + 1 ] [ 1 ] != "(" : return arg_3 = False arg_4 = 0 arg_5 = str ( arg_1 [ arg_2 ] [ 1 ] ) arg_6 = arg_1 [ arg_2 ] [ 2 ] [ 0 ] for arg_7 in range ( arg_2 , len ( arg_1 ) - 1 ) : arg_8 = arg_1 [ arg_7 ] if arg_8 [ 0 ] == tokenize . NL : return if arg_8 [ 1 ] == "(" : arg_4 += 1 elif arg_8 [ 1 ] == ")" : arg_4 -= 1 if arg_4 : continue if arg_1 [ arg_7 + 1 ] [ 1 ] in ( ":" , ")" , "]" , "}" , "in" ) or arg_1 [ arg_7 + 1 ] [ 0 ] in ( tokenize . NEWLINE , tokenize . ENDMARKER , tokenize . COMMENT ) : if arg_7 == arg_2 + 2 : return if arg_5 == "not" : if not arg_3 : arg_0 . add_message ( "superfluous-parens" , line = arg_6 , args = arg_5 ) elif arg_5 in ( "return" , "yield" ) : arg_0 . add_message ( "superfluous-parens" , line = arg_6 , args = arg_5 ) elif arg_5 not in arg_0 . _keywords_with_parens : if not arg_3 : arg_0 . add_message ( "superfluous-parens" , line = arg_6 , args = arg_5 ) return elif arg_4 == 1 : if arg_8 [ 1 ] == "," : return if arg_8 [ 1 ] in ( "and" , "or" ) : arg_3 = True elif arg_8 [ 1 ] == "yield" : return elif arg_8 [ 1 ] == "for" : return

def Func(arg_0, arg_1, arg_2):
        """Check that there are not unnecessary parens after a keyword.

        Parens are unnecessary if there is exactly one balanced outer pair on a
        line, and it is followed by a colon, and contains no commas (i.e. is not a
        tuple).

        Args:
        tokens: list of Tokens; the entire list of Tokens.
        start: int; the position of the keyword in the token list.
        """
        # If the next token is not a paren, we're fine.
        if arg_0._inside_brackets(":") and arg_1[arg_2][1] == "for":
            arg_0._pop_token()
        if arg_1[arg_2 + 1][1] != "(":
            return

        arg_3 = False
        arg_4 = 0
        arg_5 = str(arg_1[arg_2][1])
        arg_6 = arg_1[arg_2][2][0]

        for arg_7 in range(arg_2, len(arg_1) - 1):
            arg_8 = arg_1[arg_7]

            # If we hit a newline, then assume any parens were for continuation.
            if arg_8[0] == tokenize.NL:
                return

            if arg_8[1] == "(":
                arg_4 += 1
            elif arg_8[1] == ")":
                arg_4 -= 1
                if arg_4:
                    continue
                # ')' can't happen after if (foo), since it would be a syntax error.
                if arg_1[arg_7 + 1][1] in (":", ")", "]", "}", "in") or arg_1[arg_7 + 1][
                    0
                ] in (tokenize.NEWLINE, tokenize.ENDMARKER, tokenize.COMMENT):
                    # The empty tuple () is always accepted.
                    if arg_7 == arg_2 + 2:
                        return
                    if arg_5 == "not":
                        if not arg_3:
                            arg_0.add_message(
                                "superfluous-parens", line=arg_6, args=arg_5
                            )
                    elif arg_5 in ("return", "yield"):
                        arg_0.add_message(
                            "superfluous-parens", line=arg_6, args=arg_5
                        )
                    elif arg_5 not in arg_0._keywords_with_parens:
                        if not arg_3:
                            arg_0.add_message(
                                "superfluous-parens", line=arg_6, args=arg_5
                            )
                return
            elif arg_4 == 1:
                # This is a tuple, which is always acceptable.
                if arg_8[1] == ",":
                    return
                # 'and' and 'or' are the only boolean operators with lower precedence
                # than 'not', so parens are only required when they are found.
                if arg_8[1] in ("and", "or"):
                    arg_3 = True
                # A yield inside an expression must always be in parentheses,
                # quit early without error.
                elif arg_8[1] == "yield":
                    return
                # A generator expression always has a 'for' token in it, and
                # the 'for' token is only legal inside parens when it is in a
                # generator expression.  The parens are necessary here, so bail
                # without an error.
                elif arg_8[1] == "for":
                    return

Check that there are not unnecessary parens after a keyword .


(p=0, per_channel=False, name=None, deterministic=False, random_state=None)

return ReplaceElementwise(
        mask=p,
        replacement=iap.Beta(0.5, 0.5) * 255,
        per_channel=per_channel,
        name=name,
        deterministic=deterministic,
        random_state=random_state
    )

def Func ( arg_0 = 0 , arg_1 = False , arg_2 = None , arg_3 = False , arg_4 = None ) : if arg_2 is None : arg_2 = "Unnamed%s" % ( ia . caller_name ( ) , ) return ReplaceElementwise ( mask = arg_0 , replacement = iap . Beta ( 0.5 , 0.5 ) * 255 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0=0, arg_1=False, arg_2=None, arg_3=False, arg_4=None):
    """
    Adds salt and pepper noise to an image, i.e. some white-ish and black-ish pixels.

    dtype support::

        See ``imgaug.augmenters.arithmetic.ReplaceElementwise``.

    Parameters
    ----------
    p : float or tuple of float or list of float or imgaug.parameters.StochasticParameter, optional
        Probability of changing a pixel to salt/pepper noise.

            * If a float, then that value will be used for all images as the
              probability.
            * If a tuple ``(a, b)``, then a probability will be sampled per image
              from the range ``a <= x <= b``.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, then this parameter will be used as
              the *mask*, i.e. it is expected to contain values between
              0.0 and 1.0, where 1.0 means that salt/pepper is to be added
              at that location.

    per_channel : bool or float, optional
        Whether to use the same value for all channels (False)
        or to sample a new value for each channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    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 = iaa.Func(0.05)

    Replaces 5 percent of all pixels with salt/pepper.

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

    return ReplaceElementwise(
        mask=arg_0,
        replacement=iap.Beta(0.5, 0.5) * 255,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4
    )

Adds salt and pepper noise to an image, i.e. some white-ish and black-ish pixels.

    dtype support::

        See ``imgaug.augmenters.arithmetic.ReplaceElementwise``.

    Parameters
    ----------
    p : float or tuple of float or list of float or imgaug.parameters.StochasticParameter, optional
        Probability of changing a pixel to salt/pepper noise.

            * If a float, then that value will be used for all images as the
              probability.
            * If a tuple ``(a, b)``, then a probability will be sampled per image
              from the range ``a <= x <= b``.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, then this parameter will be used as
              the *mask*, i.e. it is expected to contain values between
              0.0 and 1.0, where 1.0 means that salt/pepper is to be added
              at that location.

    per_channel : bool or float, optional
        Whether to use the same value for all channels (False)
        or to sample a new value for each channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    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 = iaa.SaltAndPepper(0.05)

    Replaces 5 percent of all pixels with salt/pepper.

Adds salt and pepper noise to an image i . e . some white - ish and black - ish pixels .


def Func(arg_0, arg_1 = 10):
  """ Creates a neighboring record for each record in the inputs and adds
  new records at the end of the inputs list
  """
  arg_2 = len(arg_0)
  arg_3 = False
  for arg_4 in xrange(arg_2):
    arg_5 = arg_0[arg_4]
    arg_6 = 0
    arg_7 = copy.deepcopy(arg_5)
    for arg_8 in xrange(len(arg_5)-1):
      if arg_3:
        arg_3 = False
        continue
      if arg_5[arg_8] == 1 and arg_5[arg_8+1] == 0:
        arg_7[arg_8] = 0
        arg_7[arg_8+1] = 1
        arg_0.append(arg_7)
        arg_7 = copy.deepcopy(arg_7)
        #print input
        #print newInput
        arg_6 += 1
        arg_3 = True
        if arg_6 == arg_1:
          break


def
Func
(
arg_0
,
arg_1
)
:
if
is_fnmatch_regex
(
arg_1
)
and
not
is_regex
(
arg_1
)
:
log
.
info
(
'Using fnmatch for {0}'
.
format
(
arg_1
)
)
arg_2
=
fnmatch
.
filter
(
arg_0
,
arg_1
)
else
:
log
.
info
(
'Using regex match for {0}'
.
format
(
arg_1
)
)
arg_2
=
match_list
(
arg_0
,
arg_1
)
if
arg_2
:
arg_2
.
sort
(
)
return
arg_2

def Func(arg_0, arg_1):
    """
    Filters the lst using pattern.
    If pattern starts with '(' it will be considered a re regular expression,
    otherwise it will use fnmatch filter.

    :param lst: list of strings

    :param pattern: string

    :return: list of strings
    Filtered list of strings
    """
    if is_fnmatch_regex(arg_1) and not is_regex(arg_1):
        #use fnmatch
        log.info('Using fnmatch for {0}'.format(arg_1))
        arg_2 = fnmatch.filter(arg_0, arg_1)

    else:
        #use re
        log.info('Using regex match for {0}'.format(arg_1))
        arg_2 = match_list(arg_0, arg_1)

    if arg_2:
        arg_2.sort()

    return arg_2

Filters the lst using pattern . If pattern starts with ( it will be considered a re regular expression otherwise it will use fnmatch filter .


(self, path, destination, verify='none')

def Func(arg_0, arg_1, arg_2, arg_3='none'):
        """Tries to verify if path has same checksum as destination.
            Valid options for verify is 'raw', 'sha1' or 'none'
        """
        arg_4 = from_file(arg_1)
        log.info('Verifying using %s...' % arg_3)
        if arg_3 == 'raw':

            arg_5 = arg_0.download_file(arg_2)
            if arg_4 != arg_5:
                log.error('Raw verification failed.')
                raise VerificationError('Verification failed.')
            else:
                log.info('Verification successful. Contents are identical.')
        elif arg_3 == 'sha1':
            #Calculate SHA1 on remote file. Extract just hash from result
            arg_5 = arg_0.__exchange('shafile("'+arg_2+'")').splitlines()[1]
            log.info('Remote SHA1: %s', arg_5)

            #Calculate hash of local data
            arg_6 = hashlib.sha1(arg_4.encode(ENCODING)).hexdigest()
            log.info('Local SHA1: %s', arg_6)
            if arg_5 != arg_6:
                log.error('SHA1 verification failed.')
                raise VerificationError('SHA1 Verification failed.')
            else:
                log.info('Verification successful. Checksums match')

        elif arg_3 != 'none':
            raise Exception(arg_3 + ' is not a valid verification method.')

Tries to verify if path has same checksum as destination . Valid options for verify is raw sha1 or none


def Func ( arg_0 ) : def wrapper ( arg_1 , ** arg_2 ) : if arg_2 . get ( 'isnull' , False ) : return None if arg_1 . blank and random . random < 0.1 : return None return arg_0 ( arg_1 , ** arg_2 ) return wrapper

def Func(arg_0):
    """
    Sometimes return None if field could be blank
    """
    def wrapper(arg_1, **arg_2):
        if arg_2.get('isnull', False):
            return None

        if arg_1.blank and random.random < 0.1:
            return None
        return arg_0(arg_1, **arg_2)
    return wrapper


def Func ( arg_0 ) : try : yield finally : if os . path . exists ( arg_0 ) : if os . path . isdir ( arg_0 ) : shutil . rmtree ( arg_0 ) else : os . remove ( arg_0 )

def Func(arg_0):
    """Recursively delete a path upon exiting this context
    manager. Supports targets that are files or directories."""
    try:
        yield
    finally:
        if os.path.exists(arg_0):
            if os.path.isdir(arg_0):
                shutil.rmtree(arg_0)
            else:
                os.remove(arg_0)

Recursively delete a path upon exiting this context manager . Supports targets that are files or directories .


(self, constraints, expression, maxcnt=None, silent=False)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False):
        """Returns a list with all the possible values for the symbol x"""
        if not isinstance(arg_2, Expression):
            return [arg_2]
        assert isinstance(arg_1, ConstraintSet)
        assert isinstance(arg_2, Expression)
        arg_2 = simplify(arg_2)
        if arg_3 is None:
            arg_3 = consts.maxsolutions

        with arg_1 as temp_cs:
            if isinstance(arg_2, Bool):
                arg_5 = temp_cs.new_bool()
            elif isinstance(arg_2, BitVec):
                arg_5 = temp_cs.new_bitvec(arg_2.size)
            elif isinstance(arg_2, Array):
                arg_5 = temp_cs.new_array(index_max=arg_2.index_max, value_bits=arg_2.value_bits, taint=arg_2.taint).array
            else:
                raise NotImplementedError(f"Func only implemented for {type(expression)} expression type.")

            temp_cs.add(arg_5 == arg_2)
            arg_0._reset(temp_cs.to_string(related_to=arg_5))

            arg_6 = []

            while arg_0._is_sat():
                arg_7 = arg_0._getvalue(arg_5)
                arg_6.append(arg_7)
                arg_0._assert(arg_5 != arg_7)

                if len(arg_6) >= arg_3:
                    if arg_4:
                        # do not throw an exception if set to silent
                        # Default is not silent, assume user knows
                        # what they are doing and will check the size
                        # of returned vals list (previous smtlib behavior)
                        break
                    else:
                        raise TooManySolutions(arg_6)

            return arg_6


def Func(arg_0, arg_1: arg_2[arg_3] = None) -> None:
    """Remove all leaves and source nodes that don't have weights.

    Is a thin wrapper around  :func:`remove_unweighted_leaves` and :func:`remove_unweighted_sources`

    :param graph: A BEL graph
    :param key: The key in the node data dictionary representing the experimental data. Defaults to
     :data:`pybel_tools.constants.WEIGHT`.

    Equivalent to:

    >>> remove_unweighted_leaves(graph)
    >>> remove_unweighted_sources(graph)
    """
    remove_unweighted_leaves(arg_0, arg_1=arg_1)
    remove_unweighted_sources(arg_0, arg_1=arg_1)

Remove all leaves and source nodes that don t have weights .


def
Func
(
arg_0
)
:
arg_1
=
[
]
if
arg_0
.
n
.
prefix
:
arg_1
.
append
(
arg_0
.
n
.
prefix
)
if
arg_0
.
n
.
given
:
arg_1
.
append
(
arg_0
.
n
.
given
)
if
arg_0
.
n
.
middle
:
arg_1
.
append
(
arg_0
.
n
.
middle
)
if
arg_0
.
n
.
family
:
arg_1
.
append
(
arg_0
.
n
.
family
)
if
arg_0
.
n
.
suffix
:
arg_1
.
append
(
arg_0
.
n
.
suffix
)
arg_1
=
u" "
.
join
(
arg_1
)
arg_0
.
content
[
"FN"
]
=
VCardString
(
"FN"
,
arg_1
,
empty_ok
=
True
)

def Func(arg_0):
        """Initialize the mandatory `self.fn` from `self.n`.

        This is a workaround for buggy clients which set only one of them."""
        arg_1=[]
        if arg_0.n.prefix:
            arg_1.append(arg_0.n.prefix)
        if arg_0.n.given:
            arg_1.append(arg_0.n.given)
        if arg_0.n.middle:
            arg_1.append(arg_0.n.middle)
        if arg_0.n.family:
            arg_1.append(arg_0.n.family)
        if arg_0.n.suffix:
            arg_1.append(arg_0.n.suffix)
        arg_1=u" ".join(arg_1)
        arg_0.content["FN"]=VCardString("FN", arg_1, empty_ok = True)

Initialize the mandatory self . fn from self . n .