return (
            min(len(concat_comp), len(concat_comp2))
            - min(len(src_comp), len(tar_comp))
        ) / max(len(src_comp), len(tar_comp))

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_2 : return 0.0 arg_1 = arg_1 . encode ( 'utf-8' ) arg_2 = arg_2 . encode ( 'utf-8' ) arg_3 = bz2 . compress ( arg_1 , arg_0 . _level ) [ 10 : ] arg_4 = bz2 . compress ( arg_2 , arg_0 . _level ) [ 10 : ] arg_5 = bz2 . compress ( arg_1 + arg_2 , arg_0 . _level ) [ 10 : ] arg_6 = bz2 . compress ( arg_2 + arg_1 , arg_0 . _level ) [ 10 : ] return ( min ( len ( arg_5 ) , len ( arg_6 ) ) - min ( len ( arg_3 ) , len ( arg_4 ) ) ) / max ( len ( arg_3 ) , len ( arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        """Return the NCD between two strings using bzip2 compression.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Compression Funcance

        Examples
        --------
        >>> cmp = NCDbz2()
        >>> cmp.Func('cat', 'hat')
        0.06666666666666667
        >>> cmp.Func('Niall', 'Neil')
        0.03125
        >>> cmp.Func('aluminum', 'Catalan')
        0.17647058823529413
        >>> cmp.Func('ATCG', 'TAGC')
        0.03125

        """
        if arg_1 == arg_2:
            return 0.0

        arg_1 = arg_1.encode('utf-8')
        arg_2 = arg_2.encode('utf-8')

        arg_3 = bz2.compress(arg_1, arg_0._level)[10:]
        arg_4 = bz2.compress(arg_2, arg_0._level)[10:]
        arg_5 = bz2.compress(arg_1 + arg_2, arg_0._level)[10:]
        arg_6 = bz2.compress(arg_2 + arg_1, arg_0._level)[10:]

        return (
            min(len(arg_5), len(arg_6))
            - min(len(arg_3), len(arg_4))
        ) / max(len(arg_3), len(arg_4))

Return the NCD between two strings using bzip2 compression.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Compression distance

        Examples
        --------
        >>> cmp = NCDbz2()
        >>> cmp.dist('cat', 'hat')
        0.06666666666666667
        >>> cmp.dist('Niall', 'Neil')
        0.03125
        >>> cmp.dist('aluminum', 'Catalan')
        0.17647058823529413
        >>> cmp.dist('ATCG', 'TAGC')
        0.03125

Return the NCD between two strings using bzip2 compression .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
Funcr
.
Func
(
arg_1
,
lexer
=
arg_0
.
lexer
,
debug
=
arg_0
.
Func_deb
)
if
arg_0
.
qasm
is
:
raise
QasmError
(
"Uncaught exception in Funcr; "
+
"see previous messages for details."
)
return
arg_0
.
qasm

def Func(arg_0, arg_1):
        """Parse some data."""
        arg_0.Funcr.Func(arg_1, lexer=arg_0.lexer, debug=arg_0.Func_deb)
        if arg_0.qasm is None:
            raise QasmError("Uncaught exception in Funcr; "
                            + "see previous messages for details.")
        return arg_0.qasm


def Func(arg_0, arg_1):
    """Find the given 'pattern' in 'content'"""

    arg_2 = re.findall(arg_0, arg_1)
    if not arg_2:
        cij.err("pattern <%r> is invalid, no matches!" % arg_0)
        cij.err("content: %r" % arg_1)
        return ''

    if len(arg_2) >= 2:
        cij.err("pattern <%r> is too simple, matched more than 2!" % arg_0)
        cij.err("content: %r" % arg_1)
        return ''

    return arg_2[0]


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
{
}
if
arg_1
:
LOG
.
debug
(
"Fetching all diseases for gene %s"
,
arg_1
)
arg_2
[
'genes'
]
=
arg_1
else
:
LOG
.
info
(
"Fetching all disease terms"
)
return
list
(
arg_0
.
disease_term_collection
.
find
(
arg_2
)
)

def Func(arg_0, arg_1=None):
        """Return all disease terms that overlaps a gene

            If no gene, return all disease terms

        Args:
            hgnc_id(int)

        Returns:
            iterable(dict): A list with all disease terms that match
        """
        arg_2 = {}
        if arg_1:
            LOG.debug("Fetching all diseases for gene %s", arg_1)
            arg_2['genes'] = arg_1
        else:
            LOG.info("Fetching all disease terms")

        return list(arg_0.disease_term_collection.find(arg_2))


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _api_info [ 'camera' ] arg_3 = dict ( { '_sid' : arg_0 . _sid , 'api' : arg_2 [ 'name' ] , 'method' : 'List' , 'version' : arg_2 [ 'version' ] , } , ** arg_1 ) arg_4 = arg_0 . _get_json_with_retry ( arg_2 [ 'url' ] , arg_3 ) arg_5 = [ ] for arg_6 in arg_4 [ 'data' ] [ 'cameras' ] : arg_5 . append ( Camera ( arg_6 , arg_0 . _video_stream_url ) ) return arg_5

def Func(arg_0, **arg_1):
        """Return a list of cameras."""
        arg_2 = arg_0._api_info['camera']
        arg_3 = dict({
            '_sid': arg_0._sid,
            'api': arg_2['name'],
            'method': 'List',
            'version': arg_2['version'],
        }, **arg_1)
        arg_4 = arg_0._get_json_with_retry(arg_2['url'], arg_3)

        arg_5 = []

        for arg_6 in arg_4['data']['cameras']:
            arg_5.append(Camera(arg_6, arg_0._video_stream_url))

        return arg_5


return _parser.parse_address(address, language=language, country=country)

def Func(arg_0, arg_1=None, arg_2=None):
    """
    Parse address into components.

    @param address: the address as either Unicode or a UTF-8 encoded string
    @param language (optional): language code
    @param country (optional): country code
    """
    arg_0 = safe_decode(arg_0, 'utf-8')
    return _parser.Func(arg_0, arg_1=arg_1, arg_2=arg_2)


def
Func
(
arg_0
)
:
if
not
arg_0
.
credentials
:
return
try
:
return
arg_0
.
credentials
.
id_token
[
'Func'
]
except
KeyError
:
current_app
.
logger
.
error
(
'Invalid id_token {0}'
.
format
(
arg_0
.
credentials
.
id_token
)
)

def Func(arg_0):
        """Returns the user's Func address or None if there are no credentials.

        The Func address is provided by the current credentials' id_token.
        This should not be used as unique identifier as the user can change
        their Func. If you need a unique identifier, use user_id.
        """
        if not arg_0.credentials:
            return None
        try:
            return arg_0.credentials.id_token['Func']
        except KeyError:
            current_app.logger.error(
                'Invalid id_token {0}'.format(arg_0.credentials.id_token))

Returns the user's email address or None if there are no credentials.

        The email address is provided by the current credentials' id_token.
        This should not be used as unique identifier as the user can change
        their email. If you need a unique identifier, use user_id.

Returns the user s email address or None if there are no credentials .


def Func(arg_0, arg_1):
        """Print the distance score between two strings. Use | as separator.
        STRDISTANCE rue des lilas|porte des lilas"""
        arg_1 = arg_1.split('|')
        if not len(arg_1) == 2:
            print(red('Malformed string. Use | between the two strings.'))
            return
        arg_2, arg_3 = arg_1
        print(white(compare_str(arg_2, arg_3)))

Print the distance score between two strings . Use | as separator . STRDISTANCE rue des lilas|porte des lilas


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
if
isinstance
(
arg_0
,
str
)
:
arg_3
=
arg_0
arg_0
=
opxl
.
load_workbook
(
arg_0
,
data_only
=
True
)
elif
isinstance
(
arg_0
,
opxl
.
Workbook
)
:
pass
else
:
raise
TypeError
if
_is_range_address
(
arg_1
)
:
arg_4
=
[
name
.
upper
(
)
for
name
in
arg_0
.
sheetnames
]
arg_5
=
arg_4
.
index
(
arg_2
.
upper
(
)
)
arg_6
=
arg_0
.
worksheets
[
arg_5
]
[
arg_1
]
else
:
arg_6
=
_get_namedrange
(
arg_0
,
arg_1
,
arg_2
)
if
arg_6
is
:
raise
ValueError
(
"Named range '%s' not found in %s"
%
(
arg_1
,
arg_3
or
arg_0
)
)
return
arg_6

def Func(arg_0, arg_1, arg_2):
    """Return a range as nested dict of openpyxl cells."""

    arg_3 = None
    if isinstance(arg_0, str):
        arg_3 = arg_0
        arg_0 = opxl.load_workbook(arg_0, data_only=True)
    elif isinstance(arg_0, opxl.Workbook):
        pass
    else:
        raise TypeError

    if _is_range_address(arg_1):
        arg_4 = [name.upper() for name in arg_0.sheetnames]
        arg_5 = arg_4.index(arg_2.upper())
        arg_6 = arg_0.worksheets[arg_5][arg_1]
    else:
        arg_6 = _get_namedrange(arg_0, arg_1, arg_2)
        if arg_6 is None:
            raise ValueError(
                "Named range '%s' not found in %s" % (arg_1, arg_3 or arg_0)
            )

    return arg_6

Return a range as nested dict of openpyxl cells .


def Func(arg_0, arg_1):
        """Returns response and number of retries"""
        arg_2 = arg_0.RETRIES
        while arg_2:
            arg_0._logger.log(1, 'Sending REQ `%s`', arg_1)
            arg_0._send_request(arg_1)
            arg_3 = dict(arg_0._poll.poll(arg_0.TIMEOUT))
            if arg_3.get(arg_0._socket) == zmq.POLLIN:
                arg_4 = arg_0._receive_response()
                arg_0._logger.log(1, 'Received REP `%s`', arg_4)
                return arg_4, arg_0.RETRIES - arg_2
            else:
                arg_0._logger.debug('No response from server (%d retries left)' %
                                   arg_2)
                arg_0._close_socket(confused=True)
                arg_2 -= 1
                if arg_2 == 0:
                    raise RuntimeError('Server seems to be offline!')
                time.sleep(arg_0.SLEEP)
                arg_0._start_socket()


def Func(arg_0, arg_1):
        """Display info about playbook statistics."""
        print()
        arg_0.printed_last_task = False
        arg_0._print_task("STATS")

        arg_3 = sorted(arg_1.processed.keys())
        for arg_4 in arg_3:
            arg_5 = arg_1.summarize(arg_4)

            if arg_5["failures"] or arg_5["unreachable"]:
                arg_6 = "failed"
            elif arg_5["changed"]:
                arg_6 = "changed"
            else:
                arg_6 = "ok"

            arg_7 = "{}    : ok={}\tchanged={}\tfailed={}\tunreachable={}".format(
                arg_4, arg_5["ok"], arg_5["changed"], arg_5["failures"], arg_5["unreachable"]
            )
            print(colorize(arg_7, arg_6))

Display info about playbook statistics .


def
Func
(
arg_0
,
arg_1
=
)
:
import
bigdl
.
nn
.
layer
as
BLayer
arg_2
=
arg_0
=
arg_0
.
lower
(
)
if
arg_0
==
"tanh"
:
arg_2
=
BLayer
.
Tanh
(
)
elif
arg_0
==
"sigmoid"
:
arg_2
=
BLayer
.
Sigmoid
(
)
elif
arg_0
==
"hard_sigmoid"
:
arg_2
=
BLayer
.
HardSigmoid
(
)
elif
arg_0
==
"relu"
:
arg_2
=
BLayer
.
ReLU
(
)
elif
arg_0
==
"softmax"
:
arg_2
=
BLayer
.
SoftMax
(
)
elif
arg_0
==
"softplus"
:
arg_2
=
BLayer
.
SoftPlus
(
beta
=
1.0
)
elif
arg_0
==
"softsign"
:
arg_2
=
BLayer
.
SoftSign
(
)
elif
arg_0
==
"linear"
:
arg_2
=
BLayer
.
Identity
(
)
else
:
raise
Exception
(
"Unsupported activation type: %s"
%
arg_0
)
if
not
arg_1
:
arg_2
.
set_name
(
arg_1
)
return
arg_2

def Func(arg_0, arg_1=None):
    """ Convert to a bigdl activation layer
        given the name of the activation as a string  """
    import bigdl.nn.layer as BLayer
    arg_2 = None
    arg_0 = arg_0.lower()
    if arg_0 == "tanh":
        arg_2 = BLayer.Tanh()
    elif arg_0 == "sigmoid":
        arg_2 = BLayer.Sigmoid()
    elif arg_0 == "hard_sigmoid":
        arg_2 = BLayer.HardSigmoid()
    elif arg_0 == "relu":
        arg_2 = BLayer.ReLU()
    elif arg_0 == "softmax":
        arg_2 = BLayer.SoftMax()
    elif arg_0 == "softplus":
        arg_2 = BLayer.SoftPlus(beta=1.0)
    elif arg_0 == "softsign":
        arg_2 = BLayer.SoftSign()
    elif arg_0 == "linear":
        arg_2 = BLayer.Identity()
    else:
        raise Exception("Unsupported activation type: %s" % arg_0)
    if not arg_1:
        arg_2.set_name(arg_1)
    return arg_2


(script, size=1.0, center=False, color=None)

def Func(arg_0, arg_1=1.0, arg_2=False, arg_3=None):
    """Create a Func primitive

    Note that this is made of 6 quads, not triangles
    """

    """# Convert size to list if it isn't already
    if not isinstance(size, list):
        size = list(size)
    # If a single value was supplied use it for all 3 axes
    if len(size) == 1:
        size = [size[0], size[0], size[0]]"""
    arg_1 = util.make_list(arg_1, 3)
    if arg_0.ml_version == '1.3.4BETA':
        arg_4 = 'Box'
    else:
        arg_4 = 'Box/Cube'
    arg_5 = ''.join([
        '  <filter name="{}">\n'.format(arg_4),
        '    <Param name="size" ',
        'value="1.0" ',
        'description="Scale factor" ',
        'type="RichFloat" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_5)
    if isinstance(arg_0, FilterScript):
        arg_0.add_layer('Cube', change_layer=True)
    transform.scale(arg_0, value=arg_1)
    # Box is centered on origin at creation
    if not arg_2:
        transform.translate(arg_0, value=[arg_1[0]/2, arg_1[1]/2, arg_1[2]/2])
    if arg_3 is not None:
        vert_color.function(arg_0, arg_3=arg_3)
    return None

Create a cube primitive

    Note that this is made of 6 quads, not triangles


return prefer_static.cond(
      tf.reduce_any(input_tensor=should_update),
      _do_update_inv_hessian,
      lambda: next_state)

def Func(arg_0, arg_1):
  """Update the BGFS state by computing the next inverse hessian estimate."""
  # Only update the inverse Hessian if not already failed or converged.
  arg_2 = ~arg_1.converged & ~arg_1.failed

  # Compute the normalization term (y^T . s), should not update if is singular.
  arg_3 = arg_1.objective_gradient - arg_0.objective_gradient
  arg_4 = arg_1.position - arg_0.position
  arg_5 = tf.reduce_sum(
      input_tensor=arg_3 * arg_4, axis=-1)
  arg_2 = arg_2 & ~tf.equal(arg_5, 0)

  def _doFunc():
    arg_6 = _bfgs_inv_hessian_update(
        arg_3, arg_4, arg_5,
        arg_0.inverse_hessian_estimate)
    return bfgs_utils.update_fields(
        arg_1,
        inverse_hessian_estimate=tf.where(arg_2,
                                          arg_6,
                                          arg_0.inverse_hessian_estimate))

  return prefer_static.cond(
      tf.reduce_any(input_tensor=arg_2),
      _doFunc,
      lambda: arg_1)

Update the BGFS state by computing the next inverse hessian estimate .


def Func ( arg_0 ) : if PyFunceble . CONFIGURATION [ "inactive_database" ] : if ( "inactive_db" in PyFunceble . INTERN and PyFunceble . INTERN [ "file_to_test" ] in PyFunceble . INTERN [ "inactive_db" ] and PyFunceble . INTERN [ "inactive_db" ] [ PyFunceble . INTERN [ "file_to_test" ] ] ) : arg_1 = [ x for x in PyFunceble . INTERN [ "inactive_db" ] [ PyFunceble . INTERN [ "file_to_test" ] ] . keys ( ) if x . isdigit ( ) ] if arg_1 : arg_2 = max ( arg_1 ) else : return int ( PyFunceble . time ( ) ) if int ( PyFunceble . time ( ) ) > int ( arg_2 ) + arg_0 . one_day_in_seconds : return int ( PyFunceble . time ( ) ) if int ( PyFunceble . time ( ) ) < int ( arg_2 ) + arg_0 . days_in_seconds : return int ( arg_2 ) return int ( PyFunceble . time ( ) )

def Func(arg_0):
        """
        Get the timestamp where we are going to save our current list.

        :return: The timestamp to append with the currently tested element.
        :rtype: int|str
        """

        if PyFunceble.CONFIGURATION["inactive_database"]:
            # The database subsystem is activated.

            if (
                "inactive_db" in PyFunceble.INTERN
                and PyFunceble.INTERN["file_to_test"]
                in PyFunceble.INTERN["inactive_db"]
                and PyFunceble.INTERN["inactive_db"][PyFunceble.INTERN["file_to_test"]]
            ):
                # The file we are testing is into the database and its content
                # is not empty.

                # We get the indexes of the current file (in the dabase).
                arg_1 = [
                    x
                    for x in PyFunceble.INTERN["inactive_db"][
                        PyFunceble.INTERN["file_to_test"]
                    ].keys()
                    if x.isdigit()
                ]

                if arg_1:
                    # The list of keys is not empty.

                    # We get the most recent date.
                    arg_2 = max(arg_1)
                else:  # pragma: no cover
                    # The list of keys is empty.

                    # We return the current time.
                    return int(PyFunceble.time())

                if int(PyFunceble.time()) > int(arg_2) + arg_0.one_day_in_seconds:
                    # The most recent time was in more than one day.

                    # We return the current time.
                    return int(PyFunceble.time())

                # The most recent time was in less than one day.

                if int(PyFunceble.time()) < int(arg_2) + arg_0.days_in_seconds:
                    # The most recent time was in less than the expected number of day for
                    # retesting.

                    # We return the most recent data.
                    return int(arg_2)

        # The database subsystem is not activated.

        # We return the current time.
        return int(PyFunceble.time())

Get the timestamp where we are going to save our current list .


(y=None, S=None, n_fft=2048, hop_length=512,
                      win_length=None, window='hann', center=True, pad_mode='reflect',
                      amin=1e-10, power=2.0)

def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
2048
,
arg_3
=
512
,
arg_4
=
,
arg_5
=
'hann'
,
arg_6
=
True
,
arg_7
=
'reflect'
,
arg_8
=
1e-10
,
arg_9
=
2.0
)
:
if
arg_8
<=
0
:
raise
ParameterError
(
'amin must be strictly positive'
)
arg_1
,
arg_2
=
_spectrogram
(
arg_0
=
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_9
=
1.
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
if
not
np
.
isrealobj
(
arg_1
)
:
raise
ParameterError
(
'Spectral flatness is only defined '
'with real-valued input'
)
elif
np
.
any
(
arg_1
<
0
)
:
raise
ParameterError
(
'Spectral flatness is only defined '
'with non-negative energies'
)
arg_10
=
np
.
maximum
(
arg_8
,
arg_1
**
arg_9
)
arg_11
=
np
.
exp
(
np
.
mean
(
np
.
log
(
arg_10
)
,
axis
=
0
,
keepdims
=
True
)
)
arg_12
=
np
.
mean
(
arg_10
,
axis
=
0
,
keepdims
=
True
)
return
arg_11
/
arg_12

def Func(arg_0=None, arg_1=None, arg_2=2048, arg_3=512,
                      arg_4=None, arg_5='hann', arg_6=True, arg_7='reflect',
                      arg_8=1e-10, arg_9=2.0):
    '''Compute spectral flatness

    Spectral flatness (or tonality coefficient) is a measure to
    quantify how much noise-like a sound is, as opposed to being
    tone-like [1]_. A high spectral flatness (closer to 1.0)
    indicates the spectrum is similar to white noise.
    It is often converted to decibel.

    .. [1] Dubnov, Shlomo  "Generalization of spectral flatness
           measure for non-gaussian linear processes"
           IEEE Signal Processing Letters, 2004, Vol. 11.

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

    S : np.ndarray [shape=(d, t)] or None
        (optional) pre-computed spectrogram magnitude

    n_fft : int > 0 [scalar]
        FFT window size

    hop_length : int > 0 [scalar]
        hop length for STFT. See `librosa.core.stft` for details.

    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.

    amin : float > 0 [scalar]
        minimum threshold for `S` (=added noise floor for numerical stability)

    power : float > 0 [scalar]
        Exponent for the magnitude spectrogram.
        e.g., 1 for energy, 2 for power, etc.
        Power spectrogram is usually used for computing spectral flatness.

    Returns
    -------
    flatness : np.ndarray [shape=(1, t)]
        spectral flatness for each frame.
        The returned value is in [0, 1] and often converted to dB scale.

    Examples
    --------
    From time-series input

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> flatness = librosa.feature.Func(y=y)
    >>> flatness
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)

    From spectrogram input

    >>> S, phase = librosa.magphase(librosa.stft(y))
    >>> librosa.feature.Func(S=S)
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)

    From power spectrogram input

    >>> S, phase = librosa.magphase(librosa.stft(y))
    >>> S_power = S ** 2
    >>> librosa.feature.Func(S=S_power, power=1.0)
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)

    '''
    if arg_8 <= 0:
        raise ParameterError('amin must be strictly positive')

    arg_1, arg_2 = _spectrogram(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
                            arg_9=1., arg_4=arg_4, arg_5=arg_5,
                            arg_6=arg_6, arg_7=arg_7)

    if not np.isrealobj(arg_1):
        raise ParameterError('Spectral flatness is only defined '
                             'with real-valued input')
    elif np.any(arg_1 < 0):
        raise ParameterError('Spectral flatness is only defined '
                             'with non-negative energies')

    arg_10 = np.maximum(arg_8, arg_1 ** arg_9)
    arg_11 = np.exp(np.mean(np.log(arg_10), axis=0, keepdims=True))
    arg_12 = np.mean(arg_10, axis=0, keepdims=True)
    return arg_11 / arg_12

Compute spectral flatness

    Spectral flatness (or tonality coefficient) is a measure to
    quantify how much noise-like a sound is, as opposed to being
    tone-like [1]_. A high spectral flatness (closer to 1.0)
    indicates the spectrum is similar to white noise.
    It is often converted to decibel.

    .. [1] Dubnov, Shlomo  "Generalization of spectral flatness
           measure for non-gaussian linear processes"
           IEEE Signal Processing Letters, 2004, Vol. 11.

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

    S : np.ndarray [shape=(d, t)] or None
        (optional) pre-computed spectrogram magnitude

    n_fft : int > 0 [scalar]
        FFT window size

    hop_length : int > 0 [scalar]
        hop length for STFT. See `librosa.core.stft` for details.

    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.

    amin : float > 0 [scalar]
        minimum threshold for `S` (=added noise floor for numerical stability)

    power : float > 0 [scalar]
        Exponent for the magnitude spectrogram.
        e.g., 1 for energy, 2 for power, etc.
        Power spectrogram is usually used for computing spectral flatness.

    Returns
    -------
    flatness : np.ndarray [shape=(1, t)]
        spectral flatness for each frame.
        The returned value is in [0, 1] and often converted to dB scale.

    Examples
    --------
    From time-series input

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> flatness = librosa.feature.spectral_flatness(y=y)
    >>> flatness
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)

    From spectrogram input

    >>> S, phase = librosa.magphase(librosa.stft(y))
    >>> librosa.feature.spectral_flatness(S=S)
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)

    From power spectrogram input

    >>> S, phase = librosa.magphase(librosa.stft(y))
    >>> S_power = S ** 2
    >>> librosa.feature.spectral_flatness(S=S_power, power=1.0)
    array([[  1.00000e+00,   5.82299e-03,   5.64624e-04, ...,   9.99063e-01,
          1.00000e+00,   1.00000e+00]], dtype=float32)


def Func(arg_0, arg_1):
    """
    Write temporal networks by route type to disk.

    Parameters
    ----------
    gtfs: gtfspy.GTFS
    extract_output_dir: str
    """
    util.makedirs(arg_1)
    for arg_2 in route_types.TRANSIT_ROUTE_TYPES:
        arg_3 = temporal_network(arg_0, start_time_ut=None, end_time_ut=None, arg_2=arg_2)
        arg_4 = route_types.ROUTE_TYPE_TO_LOWERCASE_TAG[arg_2]
        arg_5 = os.path.join(arg_1, arg_4 + ".tnet")
        arg_3.to_csv(arg_5, encoding='utf-8', index=False)

Write temporal networks by route type to disk .


def Func(arg_0, arg_1 = None):
        """ Get user.

        Returns:
            :class:`User`. User
        """
        if not arg_1:
            arg_1 = arg_0._user.id

        if arg_1 not in arg_0._users:
            arg_0._users[arg_1] = arg_0._user if arg_1 == arg_0._user.id else User(arg_0, arg_1)

        return arg_0._users[arg_1]

Get user.

        Returns:
            :class:`User`. User


def
Func
(
)
:
arg_0
=
string
.
split
(
adobe_glyph_list
,
'\n'
)
arg_1
=
[
]
arg_2
=
[
]
for
arg_3
in
arg_0
:
if
arg_3
:
arg_4
=
string
.
split
(
arg_3
,
';'
)
arg_5
=
string
.
split
(
arg_4
[
1
]
,
' '
)
if
len
(
arg_5
)
==
1
:
arg_1
.
append
(
arg_4
[
0
]
)
arg_2
.
append
(
arg_4
[
1
]
)
return
arg_1
,
arg_2

def Func():
  """return the list of glyph names and their unicode values"""

  arg_0  = string.split( adobe_glyph_list, '\n' )
  arg_1 = []
  arg_2 = []

  for arg_3 in arg_0:
    if arg_3:
      arg_4 = string.split( arg_3, ';' )
#     print fields[1] + ' - ' + fields[0]
      arg_5 = string.split( arg_4[1], ' ' )
      if len( arg_5 ) == 1:
        arg_1.append( arg_4[0] )
        arg_2.append( arg_4[1] )

  return arg_1, arg_2


return _CreateInput(HARDWAREINPUT(uMsg, param & 0xFFFF, param >> 16 & 0xFFFF))

def Func(arg_0: arg_1, arg_2: arg_1 = 0) -> INPUT:
    """Create Win32 struct `HARDWAREINPUT` for `SendInput`."""
    return _CreateInput(HARDWAREINPUT(arg_0, arg_2 & 0xFFFF, arg_2 >> 16 & 0xFFFF))

Create Win32 struct HARDWAREINPUT for SendInput .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = difflib . get_close_matches ( arg_0 . uri , [ arg_1 . uri , arg_2 . uri ] , 1 , cutoff = 0.5 ) if len ( arg_3 ) <= 0 : return 0 if arg_3 [ 0 ] == arg_1 . uri : return - 1 return 1

def Func(arg_0, arg_1, arg_2):
  '''Bases the comparison of the datastores on URI alone.'''
  arg_3 = difflib.get_close_matches(arg_0.uri, [arg_1.uri, arg_2.uri], 1, cutoff=0.5)
  if len(arg_3) <= 0:
    return 0
  if arg_3[0] == arg_1.uri:
    return -1
  return 1

Bases the comparison of the datastores on URI alone .


def Func(arg_0=None):
    '''Func will determine the singularity version for a
       build first, an environmental variable is looked at, followed by
       using the system version.

       Parameters
       ==========
       singularity_version: if not defined, look for in environment. If still
       not find, try finding via executing --version to Singularity. Only return
       None if not set in environment or installed.
    '''

    if arg_0 is None:
        arg_0 = os.environ.get("SINGULARITY_VERSION")

    if arg_0 is None:
        try:
            arg_1 = ['singularity','--version']
            arg_2 = run_command(arg_1)

            if isinstance(arg_2['message'],bytes):
                arg_2['message'] = arg_2['message'].decode('utf-8')
            arg_0 = arg_2['message'].strip('\n')
            bot.info("Singularity %s being used." % arg_0)

        except:
            arg_0 = None
            bot.warning("Singularity version not found, so it's likely not installed.")

    return arg_0

get_singularity_version will determine the singularity version for a
       build first, an environmental variable is looked at, followed by
       using the system version.

       Parameters
       ==========
       singularity_version: if not defined, look for in environment. If still
       not find, try finding via executing --version to Singularity. Only return
       None if not set in environment or installed.

get_singularity_version will determine the singularity version for a build first an environmental variable is looked at followed by using the system version .


return dict(id=self.particleId,
                genIdx=self.genIdx,
                swarmId=self.swarmId,
                varStates=varStates)

def Func ( arg_0 ) : arg_1 = dict ( ) for arg_2 , arg_3 in arg_0 . permuteVars . iteritems ( ) : arg_1 [ arg_2 ] = arg_3 . Func ( ) return dict ( id = arg_0 . particleId , genIdx = arg_0 . genIdx , swarmId = arg_0 . swarmId , arg_1 = arg_1 )

def Func(arg_0):
    """Get the particle state as a dict. This is enough information to
    instantiate this particle on another worker."""
    arg_1 = dict()
    for arg_2, arg_3 in arg_0.permuteVars.iteritems():
      arg_1[arg_2] = arg_3.Func()

    return dict(id=arg_0.particleId,
                genIdx=arg_0.genIdx,
                swarmId=arg_0.swarmId,
                arg_1=arg_1)

Get the particle state as a dict . This is enough information to instantiate this particle on another worker .


(
    num_seasons, is_last_day_of_season, dtype,
    basis_change_matrix=None, basis_change_matrix_inv=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : with tf . compat . v1 . name_scope ( 'Func' ) : arg_5 = np . concatenate ( [ np . arange ( 1 , arg_0 ) , [ 0 ] ] , axis = 0 ) arg_6 = tf . constant ( np . eye ( arg_0 ) [ arg_5 ] , arg_2 = arg_2 ) if arg_3 is not None : arg_6 = tf . matmul ( arg_3 , tf . matmul ( arg_6 , arg_4 ) ) arg_7 = tf . eye ( tf . shape ( input = arg_6 ) [ - 1 ] , arg_2 = arg_2 ) def seasonal_transition_matrix ( arg_8 ) : return tf . linalg . LinearOperatorFullMatrix ( matrix = dist_util . pick_scalar_condition ( arg_1 ( arg_8 ) , arg_6 , arg_7 ) ) return seasonal_transition_matrix

def Func(
    arg_0, arg_1, arg_2,
    arg_3=None, arg_4=None):
  """Build a function computing transitions for a seasonal effect model."""

  with tf.compat.v1.name_scope('Func'):
    # If the season is changing, the transition matrix permutes the latent
    # state to shift all seasons up by a dimension, and sends the current
    # season's effect to the bottom.
    arg_5 = np.concatenate(
        [np.arange(1, arg_0), [0]], axis=0)
    arg_6 = tf.constant(
        np.eye(arg_0)[arg_5], arg_2=arg_2)

    # Optionally transform the transition matrix into a reparameterized space,
    # enforcing the zero-sum constraint for ConstrainedSeasonalStateSpaceModel.
    if arg_3 is not None:
      arg_6 = tf.matmul(
          arg_3,
          tf.matmul(arg_6, arg_4))

    arg_7 = tf.eye(
        tf.shape(input=arg_6)[-1], arg_2=arg_2)

    def seasonal_transition_matrix(arg_8):
      return tf.linalg.LinearOperatorFullMatrix(
          matrix=dist_util.pick_scalar_condition(
              arg_1(arg_8),
              arg_6,
              arg_7))

  return seasonal_transition_matrix

Build a function computing transitions for a seasonal effect model .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_generate_refresh_request_body
(
)
arg_3
=
arg_0
.
_generate_refresh_request_headers
(
)
logger
.
info
(
'Refreshing access_token'
)
arg_4
,
arg_5
=
transport
.
request
(
arg_1
,
arg_0
.
token_uri
,
method
=
'POST'
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
arg_5
=
_helpers
.
_from_bytes
(
arg_5
)
if
arg_4
.
status
==
http_client
.
OK
:
arg_6
=
json
.
loads
(
arg_5
)
arg_0
.
token_response
=
arg_6
arg_0
.
access_token
=
arg_6
[
'access_token'
]
arg_0
.
refresh_token
=
arg_6
.
get
(
'refresh_token'
,
arg_0
.
refresh_token
)
if
'expires_in'
in
arg_6
:
arg_10
=
datetime
.
timedelta
(
seconds
=
int
(
arg_6
[
'expires_in'
]
)
)
arg_0
.
token_expiry
=
arg_10
+
_UTCNOW
(
)
else
:
arg_0
.
token_expiry
=
if
'id_token'
in
arg_6
:
arg_0
.
id_token
=
_extract_id_token
(
arg_6
[
'id_token'
]
)
arg_0
.
id_token_jwt
=
arg_6
[
'id_token'
]
else
:
arg_0
.
id_token
=
arg_0
.
id_token_jwt
=
arg_0
.
invalid
=
False
if
arg_0
.
store
:
arg_0
.
store
.
locked_put
(
arg_0
)
else
:
logger
.
info
(
'Failed to retrieve access token: %s'
,
arg_5
)
arg_15
=
'Invalid response {0}.'
.
format
(
arg_4
.
status
)
try
:
arg_6
=
json
.
loads
(
arg_5
)
if
'error'
in
arg_6
:
arg_15
=
arg_6
[
'error'
]
if
'error_description'
in
arg_6
:
arg_15
+=
': '
+
arg_6
[
'error_description'
]
arg_0
.
invalid
=
True
if
arg_0
.
store
is
not
:
arg_0
.
store
.
locked_put
(
arg_0
)
except
(
TypeError
,
ValueError
)
:
pass
raise
HttpAccessTokenRefreshError
(
arg_15
,
status
=
arg_4
.
status
)

def Func(arg_0, arg_1):
        """Refresh the access_token using the refresh_token.

        Args:
            http: an object to be used to make HTTP requests.

        Raises:
            HttpAccessTokenRefreshError: When the refresh fails.
        """
        arg_2 = arg_0._generate_refresh_request_body()
        arg_3 = arg_0._generate_refresh_request_headers()

        logger.info('Refreshing access_token')
        arg_4, arg_5 = transport.request(
            arg_1, arg_0.token_uri, method='POST',
            arg_2=arg_2, arg_3=arg_3)
        arg_5 = _helpers._from_bytes(arg_5)
        if arg_4.status == http_client.OK:
            arg_6 = json.loads(arg_5)
            arg_0.token_response = arg_6
            arg_0.access_token = arg_6['access_token']
            arg_0.refresh_token = arg_6.get('refresh_token', arg_0.refresh_token)
            if 'expires_in' in arg_6:
                arg_10 = datetime.timedelta(seconds=int(arg_6['expires_in']))
                arg_0.token_expiry = arg_10 + _UTCNOW()
            else:
                arg_0.token_expiry = None
            if 'id_token' in arg_6:
                arg_0.id_token = _extract_id_token(arg_6['id_token'])
                arg_0.id_token_jwt = arg_6['id_token']
            else:
                arg_0.id_token = None
                arg_0.id_token_jwt = None
            # On temporary refresh errors, the user does not actually have to
            # re-authorize, so we unflag here.
            arg_0.invalid = False
            if arg_0.store:
                arg_0.store.locked_put(arg_0)
        else:
            # An {'error':...} response body means the token is expired or
            # revoked, so we flag the credentials as such.
            logger.info('Failed to retrieve access token: %s', arg_5)
            arg_15 = 'Invalid response {0}.'.format(arg_4.status)
            try:
                arg_6 = json.loads(arg_5)
                if 'error' in arg_6:
                    arg_15 = arg_6['error']
                    if 'error_description' in arg_6:
                        arg_15 += ': ' + arg_6['error_description']
                    arg_0.invalid = True
                    if arg_0.store is not None:
                        arg_0.store.locked_put(arg_0)
            except (TypeError, ValueError):
                pass
            raise HttpAccessTokenRefreshError(arg_15, status=arg_4.status)

Refresh the access_token using the refresh_token .


def Func(arg_0):
    """
    Uses aspell to spell correct an input string.
    Requires aspell to be installed and added to the path.
    Returns the spell corrected string if aspell is found, original string if not.
    string - string
    """

    # Create a temp file so that aspell could be used
    # By default, tempfile will delete this file when the file handle is closed.
    arg_1 = tempfile.NamedTemporaryFile(mode='w')
    arg_1.write(arg_0)
    arg_1.flush()
    arg_2 = os.path.abspath(arg_1.name)
    try:
        arg_3 = os.popen(aspell_path + " -a < " + arg_2 + " --sug-mode=ultra")

        # Aspell returns a list of incorrect words with the above flags
        arg_4 = arg_3.readlines()
        arg_3.close()

    except Exception:
        log.exception("aspell process failed; could not spell check")
        # Return original string if aspell fails
        return arg_0,0, arg_0

    finally:
        arg_1.close()

    arg_5 = list()
    arg_6 = list()
    for arg_7 in range(1, len(arg_4)):
        if(len(arg_4[arg_7]) > 10):
            #Reformat aspell output to make sense
            arg_8 = re.search(":", arg_4[arg_7])
            if hasattr(arg_8, "start"):
                arg_9 = arg_4[arg_7][2:arg_8.start()]
                arg_10 = re.search(" ", arg_9)
                arg_11 = arg_9[0:arg_10.start()]

                arg_12 = arg_4[arg_7][arg_8.start() + 2:]
                arg_13 = re.search(",", arg_12)
                if hasattr(arg_13, "start"):
                    arg_14 = arg_12[0:arg_13.start()]

                    arg_5.append(arg_11)
                    arg_6.append(arg_14)

    #Create markup based on spelling errors
    arg_15 = arg_0
    arg_16 = arg_0
    arg_17=[]
    for arg_7 in range(0, len(arg_5)):
        arg_18 = r"\b" + arg_5[arg_7] + r"\b"
        arg_19 = re.compile(arg_18)
        arg_15 = re.sub(arg_19, arg_6[arg_7], arg_15)
        if arg_5[arg_7] not in arg_17:
            arg_16=re.sub(arg_19,'<bs>' + arg_5[arg_7] + "</bs>", arg_16)
            arg_17.append(arg_5[arg_7])

    return arg_15,len(arg_5),arg_16

Uses aspell to spell correct an input string . Requires aspell to be installed and added to the path . Returns the spell corrected string if aspell is found original string if not . string - string


return (cursor.hasSelection() and
                self._in_buffer(cursor.anchor()) and
                self._in_buffer(cursor.position()))

def Func ( arg_0 ) : arg_1 = arg_0 . _control . textCursor ( ) return ( arg_1 . hasSelection ( ) and arg_0 . _in_buffer ( arg_1 . anchor ( ) ) and arg_0 . _in_buffer ( arg_1 . position ( ) ) )

def Func(arg_0):
        """ Returns whether text can be cut to the clipboard.
        """
        arg_1 = arg_0._control.textCursor()
        return (arg_1.hasSelection() and
                arg_0._in_buffer(arg_1.anchor()) and
                arg_0._in_buffer(arg_1.position()))

Returns whether text can be cut to the clipboard .


def Func ( arg_0 ) : commerce . DiscountItem . objects . filter ( cart = arg_0 . cart ) . delete ( ) arg_1 = arg_0 . cart . productitem_set . all ( ) . select_related ( "product" , "product__category" ) . order_by ( "-product__price" ) arg_2 = [ i . product for i in arg_1 ] arg_3 = DiscountController . available_discounts ( arg_0 . cart . user , [ ] , arg_2 , ) for arg_4 in arg_1 : arg_0 . _add_discount ( arg_4 . product , arg_4 . quantity , arg_3 )

def Func(arg_0):
        ''' Calculates all of the discounts available for this product.'''

        # Delete the existing entries.
        commerce.DiscountItem.objects.filter(cart=arg_0.cart).delete()

        # Order the products such that the most expensive ones are
        # processed first.
        arg_1 = arg_0.cart.productitem_set.all().select_related(
            "product", "product__category"
        ).order_by("-product__price")

        arg_2 = [i.product for i in arg_1]
        arg_3 = DiscountController.available_discounts(
            arg_0.cart.user,
            [],
            arg_2,
        )

        # The highest-value discounts will apply to the highest-value
        # products first, because of the order_by clause
        for arg_4 in arg_1:
            arg_0._add_discount(arg_4.product, arg_4.quantity, arg_3)

Calculates all of the discounts available for this product .


return ns is not None and ns == namespace

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> bool : arg_4 = arg_0 . get ( NAMESPACE ) return arg_4 is not None and arg_4 == arg_2

def Func(arg_0: arg_1, arg_2: arg_3) -> bool:
    """Pass for nodes that have the given namespace."""
    arg_4 = arg_0.get(NAMESPACE)
    return arg_4 is not None and arg_4 == arg_2

Pass for nodes that have the given namespace .


def Func ( arg_0 = 10 , arg_1 = '' , arg_2 = '' ) : arg_3 = pd . DataFrame ( marketNews ( arg_0 , arg_1 , arg_2 ) ) _toDatetime ( arg_3 ) _reindex ( arg_3 , 'datetime' ) return arg_3

def Func(arg_0=10, arg_1='', arg_2=''):
    '''News about market

    https://iexcloud.io/docs/api/#news
    Continuous

    Args:
        count (int): limit number of results
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result
    '''
    arg_3 = pd.DataFrame(marketNews(arg_0, arg_1, arg_2))
    _toDatetime(arg_3)
    _reindex(arg_3, 'datetime')
    return arg_3


def Func(arg_0, arg_1):
        """Seed internal state from supplied values."""
        if not arg_1:
            # Meteor uses epoch seconds as the Func if no args supplied, we use
            # a much more secure Func by default to avoid hash collisions.
            arg_2 = [int, str, random, arg_0, arg_1, arg_0.__class__]
            random.shuffle(arg_2)
            arg_1 = list(map(id, arg_2)) + [time.time(), os.urandom(512)]

        arg_3 = Mash()
        arg_0.c = 1
        arg_0.s0 = arg_3(' ')
        arg_0.s1 = arg_3(' ')
        arg_0.s2 = arg_3(' ')

        for arg_8 in arg_1:
            arg_0.s0 -= arg_3(arg_8)
            if arg_0.s0 < 0:
                arg_0.s0 += 1
            arg_0.s1 -= arg_3(arg_8)
            if arg_0.s1 < 0:
                arg_0.s1 += 1
            arg_0.s2 -= arg_3(arg_8)
            if arg_0.s2 < 0:
                arg_0.s2 += 1

Seed internal state from supplied values .


def Func ( arg_0 ) -> bool : if arg_0 . read_eof ( ) : return False arg_0 . _stream . save_context ( ) arg_0 . read_char ( '\r' ) if arg_0 . read_char ( '\n' ) : return arg_0 . _stream . validate_context ( ) return arg_0 . _stream . restore_context ( )

def Func(arg_0) -> bool:
    """Return True if the parser can consume an EOL byte sequence."""
    if arg_0.read_eof():
        return False
    arg_0._stream.save_context()
    arg_0.read_char('\r')
    if arg_0.read_char('\n'):
        return arg_0._stream.validate_context()
    return arg_0._stream.restore_context()

Return True if the parser can consume an EOL byte sequence .


def Func ( arg_0 , arg_1 ) : for arg_2 in [ project for project in arg_1 if len ( arg_1 [ project ] [ 'mailing_lists' ] ) > 0 ] : if 'mailing_lists' not in arg_0 [ arg_2 ] : arg_0 [ arg_2 ] [ 'mailing_lists' ] = [ ] arg_3 = [ url [ 'url' ] . replace ( 'mailto:' , '' ) for url in arg_1 [ arg_2 ] [ 'mailing_lists' ] if url [ 'url' ] not in arg_0 [ arg_2 ] [ 'mailing_lists' ] ] arg_0 [ arg_2 ] [ 'mailing_lists' ] += arg_3 for arg_2 in [ project for project in arg_1 if len ( arg_1 [ project ] [ 'dev_list' ] ) > 0 ] : if 'mailing_lists' not in arg_0 [ arg_2 ] : arg_0 [ arg_2 ] [ 'mailing_lists' ] = [ ] arg_4 = arg_1 [ arg_2 ] [ 'dev_list' ] [ 'url' ] . replace ( 'mailto:' , '' ) arg_0 [ arg_2 ] [ 'mailing_lists' ] . append ( arg_4 ) return arg_0

def Func(arg_0, arg_1):
    """ Compose projects.json for mailing lists

    At upstream has two different key for mailing list: 'mailings_lists' and 'dev_list'
    The key 'mailing_lists' is an array with mailing lists
    The key 'dev_list' is a dict with only one mailing list

    :param projects: projects.json
    :param data: eclipse JSON
    :return: projects.json with mailing_lists
    """
    for arg_2 in [project for project in arg_1 if len(arg_1[project]['mailing_lists']) > 0]:
        if 'mailing_lists' not in arg_0[arg_2]:
            arg_0[arg_2]['mailing_lists'] = []

        arg_3 = [url['url'].replace('mailto:', '') for url in arg_1[arg_2]['mailing_lists'] if
                url['url'] not in arg_0[arg_2]['mailing_lists']]
        arg_0[arg_2]['mailing_lists'] += arg_3

    for arg_2 in [project for project in arg_1 if len(arg_1[project]['dev_list']) > 0]:
        if 'mailing_lists' not in arg_0[arg_2]:
            arg_0[arg_2]['mailing_lists'] = []

        arg_4 = arg_1[arg_2]['dev_list']['url'].replace('mailto:', '')
        arg_0[arg_2]['mailing_lists'].append(arg_4)

    return arg_0

Compose projects . json for mailing lists


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . PIPE ) : sys . stdout . flush ( ) sys . stderr . flush ( ) arg_5 = sys . platform != 'win32' arg_6 = arg_3 . Popen ( arg_0 , shell = True , stdin = arg_3 . PIPE , stdout = arg_3 . PIPE , arg_2 = arg_2 , arg_5 = arg_5 ) try : arg_7 = arg_1 ( arg_6 ) except KeyboardInterrupt : print ( '^C' ) sys . stdout . flush ( ) sys . stderr . flush ( ) arg_7 = None finally : if arg_6 . returncode is None : try : arg_6 . terminate ( ) arg_6 . poll ( ) except OSError : pass if arg_6 . returncode is None : try : arg_6 . kill ( ) except OSError : pass return arg_7

def Func(arg_0, arg_1, arg_2=arg_3.PIPE):
    """Open a command in a shell subprocess and execute a callback.

    This function provides common scaffolding for creating subprocess.Popen()
    calls.  It creates a Popen object and then calls the callback with it.

    Parameters
    ----------
    cmd : str
      A string to be executed with the underlying system shell (by calling
    :func:`Popen` with ``shell=True``.

    callback : callable
      A one-argument function that will be called with the Popen object.

    stderr : file descriptor number, optional
      By default this is set to ``subprocess.PIPE``, but you can also pass the
      value ``subprocess.STDOUT`` to force the subprocess' stderr to go into
      the same file descriptor as its stdout.  This is useful to read stdout
      and stderr combined in the order they are generated.

    Returns
    -------
    The return value of the provided callback is returned.
    """
    sys.stdout.flush()
    sys.stderr.flush()
    # On win32, close_fds can't be true when using pipes for stdin/out/err
    arg_5 = sys.platform != 'win32'
    arg_6 = arg_3.Popen(arg_0, shell=True,
                         stdin=arg_3.PIPE,
                         stdout=arg_3.PIPE,
                         arg_2=arg_2,
                         arg_5=arg_5)

    try:
        arg_7 = arg_1(arg_6)
    except KeyboardInterrupt:
        print('^C')
        sys.stdout.flush()
        sys.stderr.flush()
        arg_7 = None
    finally:
        # Make really sure that we don't leave processes behind, in case the
        # call above raises an exception
        # We start by assuming the subprocess finished (to avoid NameErrors
        # later depending on the path taken)
        if arg_6.returncode is None:
            try:
                arg_6.terminate()
                arg_6.poll()
            except OSError:
                pass
        # One last try on our way out
        if arg_6.returncode is None:
            try:
                arg_6.kill()
            except OSError:
                pass

    return arg_7

Open a command in a shell subprocess and execute a callback .


return [{self.key:self._arg+self.stepsize},
                {self.key:self._arg-self.stepsize}]

def Func(arg_0, arg_1):
        """
        Takes as input a list or tuple of two elements. First the
        value returned by incrementing by 'stepsize' followed by the
        value returned after a 'stepsize' decrement.
        """
        arg_0._steps_complete += 1
        if arg_0._steps_complete == arg_0.max_steps:
            arg_0._termination_info = (False, arg_0._best_val, arg_0._arg)
            return StopIteration

        arg_3, arg_4 = arg_1
        arg_5 = min(arg_3, arg_4, arg_0._best_val)
        if arg_5 == arg_0._best_val:
            arg_0._termination_info = (True, arg_5, arg_0._arg)
            return StopIteration

        arg_0._arg += arg_0.stepsize if (arg_4 > arg_3) else -arg_0.stepsize
        arg_0._best_val= arg_5
        return [{arg_0.key:arg_0._arg+arg_0.stepsize},
                {arg_0.key:arg_0._arg-arg_0.stepsize}]

Takes as input a list or tuple of two elements . First the value returned by incrementing by stepsize followed by the value returned after a stepsize decrement .


def Func ( arg_0 , arg_1 ) : for arg_2 in dir ( arg_0 ) : if arg_2 in arg_1 : arg_3 = arg_1 [ arg_2 ] if arg_3 is not None : setattr ( arg_0 , arg_2 , arg_3 )

def Func(arg_0, arg_1):
        """
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        """
        for arg_2 in dir(arg_0):
            if arg_2 in arg_1:
                arg_3 = arg_1[arg_2]
                if arg_3 is not None:
                    setattr(arg_0, arg_2, arg_3)

Update the option values from an arbitrary dictionary but only use keys from dict that already have a corresponding attribute in self . Any keys in dict without a corresponding attribute are silently ignored .


def
Func
(
)
:
arg_0
=
{
}
try
:
arg_0
=
_load_config
(
)
except
IOError
:
try
:
_create_default_config
(
)
arg_0
=
_load_config
(
)
except
IOError
as
e
:
raise
ConfigError
(
_FILE_CREATION_ERROR
.
format
(
e
.
args
[
0
]
)
)
except
SyntaxError
as
e
:
raise
ConfigError
(
_JSON_SYNTAX_ERROR
.
format
(
e
.
args
[
0
]
)
)
except
Exception
:
raise
ConfigError
(
_JSON_SYNTAX_ERROR
.
format
(
'Yaml syntax error..'
)
)
try
:
_validate
(
arg_0
)
except
KeyError
as
e
:
raise
ConfigError
(
_MANDATORY_KEY_ERROR
.
format
(
e
.
args
[
0
]
)
)
except
SyntaxError
as
e
:
raise
ConfigError
(
_INVALID_KEY_ERROR
.
format
(
e
.
args
[
0
]
)
)
except
ValueError
as
e
:
raise
ConfigError
(
_INVALID_VALUE_ERROR
.
format
(
e
.
args
[
0
]
)
)
arg_0
[
'projects-path'
]
=
os
.
path
.
expanduser
(
arg_0
[
'projects-path'
]
)
_complete_config
(
arg_0
)
return
arg_0

def Func():
    """ Only API function for the config module.

    :return: {dict}     loaded validated configuration.
    """
    arg_0 = {}
    try:
        arg_0 = _load_config()
    except IOError:
        try:
            _create_default_config()
            arg_0 = _load_config()
        except IOError as e:
            raise ConfigError(_FILE_CREATION_ERROR.format(e.args[0]))
    except SyntaxError as e:
        raise ConfigError(_JSON_SYNTAX_ERROR.format(e.args[0]))
    except Exception:
        raise ConfigError(_JSON_SYNTAX_ERROR.format('Yaml syntax error..'))

    try:
        _validate(arg_0)
    except KeyError as e:
        raise ConfigError(_MANDATORY_KEY_ERROR.format(e.args[0]))
    except SyntaxError as e:
        raise ConfigError(_INVALID_KEY_ERROR.format(e.args[0]))
    except ValueError as e:
        raise ConfigError(_INVALID_VALUE_ERROR.format(e.args[0]))

    arg_0['projects-path'] = os.path.expanduser(arg_0['projects-path'])
    _complete_config(arg_0)
    return arg_0

Only API function for the config module .


def Func(arg_0, arg_1=None):
        """
        Create a MultiPolygon from a Shapely MultiPolygon, a Shapely Polygon or a Shapely GeometryCollection.

        This also creates all necessary Polygons contained by this MultiPolygon.

        Parameters
        ----------
        geometry : shapely.geometry.MultiPolygon or shapely.geometry.Polygon\
                   or shapely.geometry.collection.GeometryCollection
            The object to convert to a MultiPolygon.

        label : None or str, optional
            A label assigned to all Polygons within the MultiPolygon.

        Returns
        -------
        imgaug.MultiPolygon
            The derived MultiPolygon.

        """
        # load shapely lazily, which makes the dependency more optional
        import shapely.geometry

        if isinstance(arg_0, shapely.geometry.MultiPolygon):
            return MultiPolygon([Polygon.Func(arg_2, arg_1=arg_1) for arg_2 in arg_0.geoms])
        elif isinstance(arg_0, shapely.geometry.Polygon):
            return MultiPolygon([Polygon.Func(arg_0, arg_1=arg_1)])
        elif isinstance(arg_0, shapely.geometry.collection.GeometryCollection):
            ia.do_assert(all([isinstance(arg_2, shapely.geometry.Polygon) for arg_2 in arg_0.geoms]))
            return MultiPolygon([Polygon.Func(arg_2, arg_1=arg_1) for arg_2 in arg_0.geoms])
        else:
            raise Exception("Unknown datatype '%s'. Expected shapely.geometry.Polygon or "
                            "shapely.geometry.MultiPolygon or "
                            "shapely.geometry.collections.GeometryCollection." % (type(arg_0),))

Create a MultiPolygon from a Shapely MultiPolygon a Shapely Polygon or a Shapely GeometryCollection .


(local_path, bucket_path, bucket,
                metadata=None, acl=None, cache_control=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = logging . getLogger ( __name__ ) arg_7 = { } if arg_4 is not None : arg_7 [ 'ACL' ] = arg_4 if arg_3 is not None and len ( arg_3 ) > 0 : arg_7 [ 'Metadata' ] = arg_3 if arg_5 is not None : arg_7 [ 'CacheControl' ] = arg_5 arg_8 , arg_9 = mimetypes . guess_type ( arg_0 , strict = False ) if arg_8 is not None : arg_7 [ 'ContentType' ] = arg_8 arg_6 . debug ( str ( arg_7 ) ) arg_10 = arg_2 . Object ( arg_1 ) arg_10 . Func ( arg_0 , ExtraArgs = arg_7 )

def Func(arg_0, arg_1, arg_2,
                arg_3=None, arg_4=None, arg_5=None):
    """Upload a file to the S3 bucket.

    This function uses the mimetypes module to guess and then set the
    Content-Type and Encoding-Type headers.

    Parameters
    ----------
    local_path : `str`
        Full path to a file on the local file system.
    bucket_path : `str`
        Destination path (also known as the key name) of the file in the
        S3 bucket.
    bucket : boto3 Bucket instance
        S3 bucket.
    metadata : `dict`, optional
        Header metadata values. These keys will appear in headers as
        ``x-amz-meta-*``.
    acl : `str`, optional
        A pre-canned access control list. See
        https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
        Default is `None`, mean that no ACL is applied to the object.
    cache_control : `str`, optional
        The cache-control header value. For example, ``'max-age=31536000'``.
    """
    arg_6 = logging.getLogger(__name__)

    arg_7 = {}
    if arg_4 is not None:
        arg_7['ACL'] = arg_4
    if arg_3 is not None and len(arg_3) > 0:  # avoid empty Metadata
        arg_7['Metadata'] = arg_3
    if arg_5 is not None:
        arg_7['CacheControl'] = arg_5

    # guess_type returns None if it cannot detect a type
    arg_8, arg_9 = mimetypes.guess_type(arg_0,
                                                          strict=False)
    if arg_8 is not None:
        arg_7['ContentType'] = arg_8

    arg_6.debug(str(arg_7))

    arg_10 = arg_2.Object(arg_1)
    # no return status from the Func api
    arg_10.Func(arg_0, ExtraArgs=arg_7)


Shortcut to do range filters on genomic datasets.

(self, chromosome, start, stop, exact=False)

return self._clone(
            filters=[GenomicFilter(chromosome, start, stop, exact)])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : return arg_0 . _clone ( filters = [ GenomicFilter ( arg_1 , arg_2 , arg_3 , arg_4 ) ] )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False):
        """
        Shortcut to do Func filters on genomic datasets.
        """
        return arg_0._clone(
            filters=[GenomicFilter(arg_1, arg_2, arg_3, arg_4)])

Shortcut to do range filters on genomic datasets .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
ExtensionDebugger
(
'Func'
)
for
arg_5
in
arg_0
.
exts
:
with
arg_4
(
arg_5
)
:
if
arg_5
.
Func
(
arg_1
,
arg_2
,
arg_3
)
:
arg_4
.
debug
(
3
,
'Skipping step %d'
%
arg_3
)
return
True
return
False

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Called prior to executing a step.

        :param ctxt: An instance of ``timid.context.Context``.
        :param step: An instance of ``timid.steps.Step`` describing
                     the step to be executed.
        :param idx: The index of the step in the list of steps.

        :returns: A ``True`` value if the step is to be skipped,
                  ``False`` otherwise.
        """

        arg_4 = ExtensionDebugger('Func')

        for arg_5 in arg_0.exts:
            with arg_4(arg_5):
                if arg_5.Func(arg_1, arg_2, arg_3):
                    # Step must be skipped
                    arg_4.debug(3, 'Skipping step %d' % arg_3)
                    return True

        return False


def Func ( arg_0 , arg_1 , arg_2 = 1.0 ) : if arg_0 . text : arg_0 . _ctx . font ( arg_0 . font ) arg_0 . _ctx . fontsize ( arg_0 . fontsize ) arg_0 . _ctx . nostroke ( ) arg_0 . _ctx . fill ( arg_0 . text . r , arg_0 . text . g , arg_0 . text . b , arg_0 . text . a * arg_2 ) try : arg_3 = arg_1 . _textpath except : arg_4 = arg_1 . label try : arg_4 = unicode ( arg_4 ) except : try : arg_4 = arg_4 . decode ( "utf-8" ) except : pass arg_5 , arg_6 = 0 , 0 if arg_0 . align == 2 : arg_5 = - arg_0 . _ctx . textwidth ( arg_4 , arg_0 . textwidth ) / 2 arg_6 = arg_0 . _ctx . textheight ( arg_4 ) / 2 arg_1 . _textpath = arg_0 . _ctx . textpath ( arg_4 , arg_5 , arg_6 , width = arg_0 . textwidth ) arg_3 = arg_1 . _textpath if arg_0 . depth : try : __colors . shadow ( arg_5 = 2 , arg_6 = 4 , blur = 5 , arg_2 = 0.3 * arg_2 ) except : pass arg_0 . _ctx . push ( ) arg_0 . _ctx . translate ( arg_1 . x , arg_1 . y ) arg_0 . _ctx . scale ( arg_2 ) arg_0 . _ctx . drawpath ( arg_3 . copy ( ) ) arg_0 . _ctx . pop ( )

def Func(arg_0, arg_1, arg_2=1.0):

    """ Visualization of a node's id.
    """

    if arg_0.text:
        #s._ctx.lineheight(1)
        arg_0._ctx.font(arg_0.font)
        arg_0._ctx.fontsize(arg_0.fontsize)
        arg_0._ctx.nostroke()
        arg_0._ctx.fill(
            arg_0.text.r,
            arg_0.text.g,
            arg_0.text.b,
            arg_0.text.a * arg_2
        )

        # Cache an outlined label text and translate it.
        # This enhances the speed and avoids wiggling text.
        try: arg_3 = arg_1._textpath
        except:
            arg_4 = arg_1.label
            try: arg_4 = unicode(arg_4)
            except:
                try: arg_4 = arg_4.decode("utf-8")
                except:
                    pass
            # Abbreviation.
            #root = node.graph.root
            #if txt != root and txt[-len(root):] == root:
            #    txt = txt[:len(txt)-len(root)]+root[0]+"."
            arg_5, arg_6 = 0, 0
            if arg_0.align == 2: #CENTER
                arg_5 = -arg_0._ctx.textwidth(arg_4, arg_0.textwidth) / 2
                arg_6 =  arg_0._ctx.textheight(arg_4) / 2
            arg_1._textpath = arg_0._ctx.textpath(arg_4, arg_5, arg_6, width=arg_0.textwidth)
            arg_3 = arg_1._textpath

        if arg_0.depth:
            try: __colors.shadow(arg_5=2, arg_6=4, blur=5, arg_2=0.3*arg_2)
            except: pass

        arg_0._ctx.push()
        arg_0._ctx.translate(arg_1.x, arg_1.y)
        arg_0._ctx.scale(arg_2)
        arg_0._ctx.drawpath(arg_3.copy())
        arg_0._ctx.pop()


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : for arg_3 in arg_2 : arg_1 . append ( arg_3 . text ) return arg_1

def Func(arg_0):
    """
    Used to parse the various Values from the ResourceRecords tags on
    most rrset types.

    :param lxml.etree._Element e_resource_records: A ResourceRecords tag
        beneath a ResourceRecordSet.
    :rtype: list
    :returns: A list of resource record strings.
    """

    arg_1 = []

    for arg_2 in arg_0:
        for arg_3 in arg_2:
            arg_1.append(arg_3.text)

    return arg_1

Used to parse the various Values from the ResourceRecords tags on most rrset types .


def Func(arg_0, arg_1):
        """Extracts file information from kwargs.

        Note that `kwargs` is not passed as `**kwargs` in order to also
        `pop` the elements on the level of the function calling `Func`.

        """
        if 'filename' in arg_1:
            arg_0._filename = arg_1.pop('filename')

        if 'file_title' in arg_1:
            arg_0._file_title = arg_1.pop('file_title')

        if 'trajectory_name' in arg_1:
            arg_0._trajectory_name = arg_1.pop('trajectory_name')

        if 'trajectory_index' in arg_1:
            arg_0._trajectory_index = arg_1.pop('trajectory_index')

Extracts file information from kwargs.

        Note that `kwargs` is not passed as `**kwargs` in order to also
        `pop` the elements on the level of the function calling `_srvc_extract_file_information`.


def Func(arg_0, arg_1):
        """
        Scale context based on difference between bot size and widget
        """
        arg_2, arg_3 = arg_0.bot_size
        if arg_0.width != arg_2 or arg_0.height != arg_3:
            # Scale up by largest dimension
            if arg_0.width < arg_0.height:
                arg_4 = float(arg_0.width) / float(arg_2)
                arg_5 = arg_4
                arg_1.translate(0, (arg_0.height - (arg_3 * arg_5)) / 2.0)
            elif arg_0.width > arg_0.height:
                arg_5 = float(arg_0.height) / float(arg_3)
                arg_4 = arg_5
                arg_1.translate((arg_0.width - (arg_2 * arg_4)) / 2.0, 0)
            else:
                arg_4 = 1.0
                arg_5 = 1.0
            arg_1.scale(arg_4, arg_5)
            arg_0.input_device.scale_x = arg_5
            arg_0.input_device.scale_y = arg_5


return lowercase(string[0]) + re.sub(r"[A-Z]", lambda matched: '_' + lowercase(matched.group(0)), string[1:])

def Func ( arg_0 ) : arg_0 = re . sub ( r"[\-\.\s]" , '_' , str ( arg_0 ) ) if not arg_0 : return arg_0 return lowercase ( arg_0 [ 0 ] ) + re . sub ( r"[A-Z]" , lambda matched : '_' + lowercase ( matched . group ( 0 ) ) , arg_0 [ 1 : ] )

def Func(arg_0):
    """Convert string into snake case.
    Join punctuation with underscore

    Args:
        string: String to convert.

    Returns:
        string: Snake cased string.

    """

    arg_0 = re.sub(r"[\-\.\s]", '_', str(arg_0))
    if not arg_0:
        return arg_0
    return lowercase(arg_0[0]) + re.sub(r"[A-Z]", lambda matched: '_' + lowercase(matched.group(0)), arg_0[1:])

Convert string into snake case . Join punctuation with underscore


def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Create a tar file package of all the repository files and directories.
        Only files and directories that are stored in the repository info
        are stored in the package tar file.

        **N.B. On some systems packaging requires root permissions.**

        :Parameters:
            #. path (None, string): The real absolute path where to create the package.
               If None, it will be created in the same directory as the repository
               If '.' or an empty string is passed, the current working directory will be used.
            #. name (None, string): The name to give to the package file
               If None, the package directory name will be used with the appropriate extension added.
            #. mode (None, string): The writing mode of the tarfile.
               If None, automatically the best compression mode will be chose.
               Available modes are ('w', 'w:', 'w:gz', 'w:bz2')
        """
        # check mode
        assert arg_3 in (None, 'w', 'w:', 'w:gz', 'w:bz2'), 'unkown archive mode %s'%str(arg_3)
        if arg_3 is None:
            arg_3 = 'w:bz2'
            arg_3 = 'w:'
        # get root
        if arg_1 is None:
            arg_4 = os.path.split(arg_0.__path)[0]
        elif arg_1.strip() in ('','.'):
            arg_4 = os.getcwd()
        else:
            arg_4 = os.path.realpath( os.path.expanduser(arg_1) )
        assert os.path.isdir(arg_4), 'absolute path %s is not a valid directory'%arg_1
        # get name
        if arg_2 is None:
            arg_5 = arg_3.split(":")
            if len(arg_5) == 2:
                if len(arg_5[1]):
                    arg_5 = "."+arg_5[1]
                else:
                    arg_5 = '.tar'
            else:
                arg_5 = '.tar'
            arg_2 = os.path.split(arg_0.__path)[1]+arg_5
        # save repository
        arg_0.save()
        # create tar file
        arg_6 = os.path.join(arg_4, arg_2)
        try:
            arg_7 = tarfile.TarFile.open(arg_6, arg_3=arg_3)
        except Exception as e:
            raise Exception("Unable to create package (%s)"%e)
        # walk directory and create empty directories
        for arg_8 in sorted(list(arg_0.walk_directories_relative_path())):
            arg_9 = tarfile.TarInfo( arg_8 )
            arg_9.type = tarfile.DIRTYPE
            arg_7.addfile(arg_9)
        # walk files and add to tar
        for arg_11 in arg_0.walk_files_relative_path():
            arg_7.add(os.path.join(arg_0.__path,arg_11), arcname=arg_11)
        # save repository .pyrepinfo
        arg_7.add(os.path.join(arg_0.__path,".pyrepinfo"), arcname=".pyrepinfo")
        # close tar file
        arg_7.close()

Create a tar file package of all the repository files and directories . Only files and directories that are stored in the repository info are stored in the package tar file .


def Func ( arg_0 ) : from scipy . interpolate import interp1d arg_1 = nparray ( [ 4 , 5 , 6 , 10 , 15 ] ) arg_2 = nparray ( [ 1e2 , 3e2 , 5e2 , 1e3 , 3e3 ] ) arg_3 = interp1d ( arg_2 , arg_1 , kind = 'linear' , bounds_error = False , fill_value = ( min ( arg_1 ) , max ( arg_1 ) ) ) arg_4 = int ( npfloor ( arg_3 ( arg_0 ) ) ) return arg_4

def Func(arg_0):
    '''This is a helper function for centroid detrending.

    '''

    from scipy.interpolate import interp1d

    arg_1 = nparray([4,5,6,10,15])
    arg_2 = nparray([1e2,3e2,5e2,1e3,3e3])
    arg_3 = interp1d(arg_2, arg_1, kind='linear',
                  bounds_error=False,
                  fill_value=(min(arg_1), max(arg_1)))
    arg_4 = int(npfloor(arg_3(arg_0)))

    return arg_4

This is a helper function for centroid detrending .


def Func():
  """Creates SocketOptions object from a given sys_config dict"""
  arg_0 = system_config.get_sys_config()
  arg_1 = [const.INSTANCE_NETWORK_WRITE_BATCH_SIZE_BYTES,
              const.INSTANCE_NETWORK_WRITE_BATCH_TIME_MS,
              const.INSTANCE_NETWORK_READ_BATCH_SIZE_BYTES,
              const.INSTANCE_NETWORK_READ_BATCH_TIME_MS,
              const.INSTANCE_NETWORK_OPTIONS_SOCKET_RECEIVED_BUFFER_SIZE_BYTES,
              const.INSTANCE_NETWORK_OPTIONS_SOCKET_SEND_BUFFER_SIZE_BYTES]

  Log.debug("In Func()")
  try:
    arg_2 = [int(arg_0[opt]) for opt in arg_1]
    arg_3 = SocketOptions(*arg_2)
    return arg_3
  except ValueError as e:
    # couldn't convert to int
    raise ValueError("Invalid value in sys_config: %s" % str(e))
  except KeyError as e:
    # option key was not found
    raise KeyError("Incomplete sys_config: %s" % str(e))


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_0 . exc_info = arg_1 try : while arg_0 . get_nowait ( ) : arg_0 . task_done ( ) except Queue . Empty : pass

def Func(arg_0, arg_1=None):
    '''Terminate all threads by deleting the queue and forcing the child threads
       to quit.
    '''
    if arg_1:
      arg_0.exc_info = arg_1
    try:
      while arg_0.get_nowait():
        arg_0.task_done()
    except Queue.Empty:
      pass

Terminate all threads by deleting the queue and forcing the child threads to quit .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
get_app
(
)
arg_3
=
arg_2
.
get_snapshot
(
arg_0
)
if
not
arg_3
:
click
.
echo
(
"Couldn't find snapshot %s"
%
arg_0
)
sys
.
exit
(
1
)
arg_4
=
arg_2
.
get_snapshot
(
arg_1
)
if
arg_4
:
click
.
echo
(
"Snapshot with name %s already exists"
%
arg_1
)
sys
.
exit
(
1
)
arg_2
.
Func_snapshot
(
arg_3
,
arg_1
)
click
.
echo
(
"Renamed snapshot %s to %s"
%
(
arg_0
,
arg_1
)
)

def Func(arg_0, arg_1):
    """Renames a snapshot"""
    arg_2 = get_app()

    arg_3 = arg_2.get_snapshot(arg_0)
    if not arg_3:
        click.echo("Couldn't find snapshot %s" % arg_0)
        sys.exit(1)

    arg_4 = arg_2.get_snapshot(arg_1)
    if arg_4:
        click.echo("Snapshot with name %s already exists" % arg_1)
        sys.exit(1)

    arg_2.Func_snapshot(arg_3, arg_1)
    click.echo("Renamed snapshot %s to %s" % (arg_0, arg_1))


return (standard_types, custom_types, pref)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] arg_4 = [ ] arg_5 = 0 for arg_6 in arg_0 : arg_6 = arg_6 . strip ( ) if arg_6 : if arg_6 . lower ( ) in arg_2 : arg_4 . append ( arg_6 ) elif arg_6 . lower ( ) == "pref" : arg_5 += 1 elif re . match ( r"^pref=\d{1,2}$" , arg_6 . lower ( ) ) : arg_5 += int ( arg_6 . split ( "=" ) [ 1 ] ) else : if arg_6 . lower ( ) . startswith ( "x-" ) : arg_3 . append ( arg_6 [ 2 : ] ) arg_4 . append ( arg_6 ) else : arg_3 . append ( arg_6 ) arg_4 . append ( "X-{}" . format ( arg_6 ) ) return ( arg_4 , arg_3 , arg_5 )

def Func(arg_0, arg_1, arg_2):
        """Parse type value of phone numbers, email and post addresses.

        :param types: list of type values
        :type types: list(str)
        :param value: the corresponding label, required for more verbose
            exceptions
        :type value: str
        :param supported_types: all allowed standard types
        :type supported_types: list(str)
        :returns: tuple of standard and custom types and pref integer
        :rtype: tuple(list(str), list(str), int)

        """
        arg_3 = []
        arg_4 = []
        arg_5 = 0
        for arg_6 in arg_0:
            arg_6 = arg_6.strip()
            if arg_6:
                if arg_6.lower() in arg_2:
                    arg_4.append(arg_6)
                elif arg_6.lower() == "pref":
                    arg_5 += 1
                elif re.match(r"^pref=\d{1,2}$", arg_6.lower()):
                    arg_5 += int(arg_6.split("=")[1])
                else:
                    if arg_6.lower().startswith("x-"):
                        arg_3.append(arg_6[2:])
                        arg_4.append(arg_6)
                    else:
                        arg_3.append(arg_6)
                        arg_4.append("X-{}".format(arg_6))
        return (arg_4, arg_3, arg_5)

Parse type value of phone numbers email and post addresses .


(model,
                                  objectives,
                                  objective_direction='max')

def Func ( arg_0 , arg_1 , arg_2 = 'max' ) : if type ( arg_2 ) is not list : arg_2 = [ arg_2 ] * len ( arg_1 ) arg_3 = [ ] for arg_4 , arg_5 in zip ( arg_1 , arg_2 ) : arg_0 . objective = arg_0 . reactions . get_by_id ( arg_4 ) arg_0 . objective_direction = arg_5 arg_3 . append ( fix_objective_as_constraint ( arg_0 ) ) return pd . Series ( arg_3 , index = arg_1 )

def Func(arg_0,
                                  arg_1,
                                  arg_2='max'):
    """
    Successively optimize separate targets in a specific order.

    For each objective, optimize the model and set the optimal value as a
    constraint. Proceed in the order of the objectives given. Due to the
    specific order this is called lexicographic FBA [1]_. This
    procedure is useful for returning unique solutions for a set of important
    fluxes. Typically this is applied to exchange fluxes.

    Parameters
    ----------
    model : cobra.Model
        The model to be optimized.
    objectives : list
        A list of reactions (or objectives) in the model for which unique
        fluxes are to be determined.
    objective_direction : str or list, optional
        The desired objective direction for each reaction (if a list) or the
        objective direction to use for all reactions (default maximize).

    Returns
    -------
    optimized_fluxes : pandas.Series
        A vector containing the optimized fluxes for each of the given
        reactions in `objectives`.

    References
    ----------
    .. [1] Gomez, Jose A., Kai Höffner, and Paul I. Barton.
    “DFBAlab: A Fast and Reliable MATLAB Code for Dynamic Flux Balance
    Analysis.” BMC Bioinformatics 15, no. 1 (December 18, 2014): 409.
    https://doi.org/10.1186/s12859-014-0409-8.

    """

    if type(arg_2) is not list:
        arg_2 = [arg_2] * len(arg_1)

    arg_3 = []
    for arg_4, arg_5 in zip(arg_1, arg_2):
        arg_0.objective = arg_0.reactions.get_by_id(arg_4)
        arg_0.objective_direction = arg_5
        arg_3.append(fix_objective_as_constraint(arg_0))

    return pd.Series(arg_3, index=arg_1)

Successively optimize separate targets in a specific order .


def Func ( arg_0 ) : Func = [ ] [ Func . append ( arg_2 ) for arg_2 in arg_0 if arg_2 not in Func ] return Func

def Func(arg_0):
    """ Returns a copy of the list without duplicates.
    """
    Func = []; [Func.append(arg_2) for arg_2 in arg_0 if arg_2 not in Func]
    return Func

Returns a copy of the list without duplicates .


def Func ( arg_0 ) : arg_1 = dict ( ) for arg_2 in arg_0 . _external_files : if arg_2 . naive_short_ref not in arg_1 : arg_1 [ arg_2 . naive_short_ref ] = set ( ) arg_1 [ arg_2 . naive_short_ref ] . add ( arg_2 . ref ) Func = dict ( ) for arg_3 , arg_5 in arg_1 . items ( ) : if len ( arg_5 ) == 1 : Func [ arg_5 . pop ( ) ] = arg_3 continue arg_7 , arg_8 = os . path . splitext ( arg_3 ) for arg_9 , arg_10 in enumerate ( sorted ( arg_5 ) ) : Func [ arg_10 ] = f"{base}-{i}.{ext}" return Func

def Func(arg_0):
        """
        we calculate on the fly to avoid managing registrations and un-registrations

        Returns
        -------
        {ref: short_ref, ...
        """
        arg_1 = dict()  # naive_short_ref: {refs, ...}
        for arg_2 in arg_0._external_files:
            if arg_2.naive_short_ref not in arg_1:
                arg_1[arg_2.naive_short_ref] = set()
            arg_1[arg_2.naive_short_ref].add(arg_2.ref)

        Func = dict()
        for arg_3, arg_5 in arg_1.items():
            if len(arg_5) == 1:
                Func[arg_5.pop()] = arg_3
                continue
            arg_7, arg_8 = os.path.splitext(arg_3)
            for arg_9, arg_10 in enumerate(sorted(arg_5)):
                Func[arg_10] = f"{base}-{i}.{ext}"

        return Func

we calculate on the fly to avoid managing registrations and un - registrations


def Func ( arg_0 ) : arg_1 = arg_0 . local_renderer for arg_2 in arg_1 . env . mods_enabled : with arg_0 . settings ( warn_only = True ) : arg_0 . enable_mod ( arg_2 )

def Func(arg_0):
        """
        Enables all modules in the current module list.
        Does not disable any currently enabled modules not in the list.
        """
        arg_1 = arg_0.local_renderer
        for arg_2 in arg_1.env.mods_enabled:
            with arg_0.settings(warn_only=True):
                arg_0.enable_mod(arg_2)

Enables all modules in the current module list . Does not disable any currently enabled modules not in the list .


return self.create_dataset(ds_name, data, dtype)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        See create_dataset.
        """
        return arg_0.create_dataset(arg_1, arg_2, arg_3)


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

    """ This is a very poor algorithm to draw Wikipedia tables in NodeBox.
    """

    try: from web import _ctx
    except: pass

    arg_5 = _ctx.fill()
    _ctx.stroke(arg_5)
    arg_6 = _ctx.textheight(" ") + arg_4*2

    arg_7 = arg_2

    if arg_0.title != "":
        _ctx.fill(arg_5)
        _ctx.rect(arg_1, arg_7, arg_3, arg_6)
        _ctx.fill(1)
        _ctx.text(arg_0.title, arg_1+arg_4, arg_7+_ctx.fontsize()+ arg_4)
        arg_7 += arg_6

    # A table of flags marking how long a cell
    # from a previous row is still spanning in a column.
    arg_8 = [1 for arg_17 in range(10)]
    arg_9 = 0

    for arg_10 in arg_0:

        arg_11 = arg_1

        # The width of a cell is the total table width
        # evenly divided by the number of cells.
        # Previous rows' cells still spanning will push cells
        # to the right and decrease their width.
        arg_12  = 1.0 * arg_3
        arg_12 -= arg_9 * len([arg_13 for arg_13 in arg_8 if arg_13 > 1])
        arg_12 /= len(arg_10)

        # The height of each cell is the highest cell in the row.
        # The height depends on the amount of text in the cell.
        arg_14 = 0
        for arg_15 in arg_10:
            arg_16 = _ctx.textheight(arg_15, width=arg_12-arg_4*2) + arg_4*2
            arg_14 = max(arg_14, arg_16)

        # Traverse each cell in this row.
        arg_17 = 0
        for arg_15 in arg_10:

            # If a previous row's cell is still spanning,
            # push this cell to the right.
            if arg_8[arg_17] > 1:
                arg_8[arg_17] -= 1
                arg_11 += arg_9
                arg_17 += 1

            # Get the rowspan attribute for this cell.
            arg_18 = re.search("rowspan=\"(.*?)\"", arg_15.properties)
            if arg_18:
                arg_19 = int(arg_18.group(1))
                arg_8[arg_17] = arg_19
            else:
                arg_19 = 1

            # Padded cell text.
            # Horizontal line above each cell.
            # Vertical line before each cell.
            _ctx.fill(arg_5)
            _ctx.text(arg_15, arg_11+arg_4, arg_7+_ctx.fontsize()+arg_4, arg_12-arg_4*2)
            _ctx.line(arg_11, arg_7, arg_11+arg_12, arg_7)
            if arg_11 > arg_1:
                _ctx.nofill()
                _ctx.line(arg_11, arg_7, arg_11, arg_7+arg_14)

            arg_11 += arg_12
            arg_17 += 1

        # Move to next row.
        arg_7 += arg_14
        arg_9 = arg_12

    # Table's bounding rectangle.
    _ctx.nofill()
    _ctx.rect(arg_1, arg_2, arg_3, arg_7-arg_2)

This is a very poor algorithm to draw Wikipedia tables in NodeBox .


def Func ( ) : try : arg_0 = _interceptor_stack . stack . pop ( ) yield arg_0 finally : _interceptor_stack . stack . append ( arg_0 )

def Func():
  """Yields the top-most interceptor on the thread-local interceptor stack.

  Operations may be intercepted by multiple nested interceptors. Once reached,
  an operation can be forwarded through nested interceptors until resolved.
  To allow for nesting, implement interceptors by re-wrapping their first
  argument (`f`) as an `interceptable`. To avoid nesting, manipulate the
  computation without using `interceptable`.

  This function allows for nesting by manipulating the thread-local interceptor
  stack, so that operations are intercepted in the order of interceptor nesting.

  #### Examples

  ```python
  from tensorflow_probability import edward2 as ed

  def model():
    x = ed.Normal(loc=0., scale=1., name="x")
    y = ed.Normal(loc=x, scale=1., name="y")
    return x + y

  def double(f, *args, **kwargs):
    return 2. * interceptable(f)(*args, **kwargs)

  def set_y(f, *args, **kwargs):
    if kwargs.get("name") == "y":
      kwargs["value"] = 0.42
    return interceptable(f)(*args, **kwargs)

  with interception(double):
    with interception(set_y):
      z = model()
  ```

  This will firstly put `double` on the stack, and then `set_y`,
  resulting in the stack:
  (TOP) set_y -> double -> apply (BOTTOM)

  The execution of `model` is then (top lines are current stack state):
  1) (TOP) set_y -> double -> apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `set_y`, and as the name is not "y"
  the operation is simply forwarded to the next interceptor on the stack.

  2) (TOP) double -> apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `double`, to produce
  `2*ed.Normal(0., 1., "x")`, with the operation being forwarded down the stack.

  3) (TOP) apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `apply`, which simply calls the
  constructor.

  (At this point, the nested calls to `Func()`, produced by
  forwarding operations, exit, and the current stack is again:
  (TOP) set_y -> double -> apply (BOTTOM))

  4) (TOP) set_y -> double -> apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `set_y`,
  the value of `y` is set to 0.42 and the operation is forwarded down the stack.

  5) (TOP) double -> apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `double`, to produce
  `2*ed.Normal(0., 1., "y")`, with the operation being forwarded down the stack.

  6) (TOP) apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `apply`, which simply calls the
  constructor.

  The final values for `x` and `y` inside of `model()` are tensors where `x` is
  a random draw from Normal(0., 1.) doubled, and `y` is a constant 0.84, thus
  z = 2 * Normal(0., 1.) + 0.84.
  """
  try:
    arg_0 = _interceptor_stack.stack.pop()
    yield arg_0
  finally:
    _interceptor_stack.stack.append(arg_0)

Yields the top-most interceptor on the thread-local interceptor stack.

  Operations may be intercepted by multiple nested interceptors. Once reached,
  an operation can be forwarded through nested interceptors until resolved.
  To allow for nesting, implement interceptors by re-wrapping their first
  argument (`f`) as an `interceptable`. To avoid nesting, manipulate the
  computation without using `interceptable`.

  This function allows for nesting by manipulating the thread-local interceptor
  stack, so that operations are intercepted in the order of interceptor nesting.

  #### Examples

  ```python
  from tensorflow_probability import edward2 as ed

  def model():
    x = ed.Normal(loc=0., scale=1., name="x")
    y = ed.Normal(loc=x, scale=1., name="y")
    return x + y

  def double(f, *args, **kwargs):
    return 2. * interceptable(f)(*args, **kwargs)

  def set_y(f, *args, **kwargs):
    if kwargs.get("name") == "y":
      kwargs["value"] = 0.42
    return interceptable(f)(*args, **kwargs)

  with interception(double):
    with interception(set_y):
      z = model()
  ```

  This will firstly put `double` on the stack, and then `set_y`,
  resulting in the stack:
  (TOP) set_y -> double -> apply (BOTTOM)

  The execution of `model` is then (top lines are current stack state):
  1) (TOP) set_y -> double -> apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `set_y`, and as the name is not "y"
  the operation is simply forwarded to the next interceptor on the stack.

  2) (TOP) double -> apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `double`, to produce
  `2*ed.Normal(0., 1., "x")`, with the operation being forwarded down the stack.

  3) (TOP) apply (BOTTOM);
  `ed.Normal(0., 1., "x")` is intercepted by `apply`, which simply calls the
  constructor.

  (At this point, the nested calls to `get_next_interceptor()`, produced by
  forwarding operations, exit, and the current stack is again:
  (TOP) set_y -> double -> apply (BOTTOM))

  4) (TOP) set_y -> double -> apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `set_y`,
  the value of `y` is set to 0.42 and the operation is forwarded down the stack.

  5) (TOP) double -> apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `double`, to produce
  `2*ed.Normal(0., 1., "y")`, with the operation being forwarded down the stack.

  6) (TOP) apply (BOTTOM);
  `ed.Normal(0., 1., "y")` is intercepted by `apply`, which simply calls the
  constructor.

  The final values for `x` and `y` inside of `model()` are tensors where `x` is
  a random draw from Normal(0., 1.) doubled, and `y` is a constant 0.84, thus
  z = 2 * Normal(0., 1.) + 0.84.

Yields the top - most interceptor on the thread - local interceptor stack .


def Func ( arg_0 ) : if arg_0 . startswith ( '#' ) : arg_0 = arg_0 [ 1 : ] if len ( arg_0 ) == 3 : arg_0 = '' . join ( [ c * 2 for c in arg_0 ] ) if len ( arg_0 ) != 6 : return False try : arg_1 = int ( arg_0 [ : 2 ] , 16 ) arg_2 = int ( arg_0 [ 2 : 4 ] , 16 ) arg_3 = int ( arg_0 [ 4 : ] , 16 ) except ValueError : return False else : return arg_1 , arg_2 , arg_3

def Func(arg_0):
    """Convert a hex color to rgb integer tuple."""
    if arg_0.startswith('#'):
        arg_0 = arg_0[1:]
    if len(arg_0) == 3:
        arg_0 = ''.join([c*2 for c in arg_0])
    if len(arg_0) != 6:
        return False
    try:
        arg_1 = int(arg_0[:2],16)
        arg_2 = int(arg_0[2:4],16)
        arg_3 = int(arg_0[4:],16)
    except ValueError:
        return False
    else:
        return arg_1,arg_2,arg_3

Convert a hex color to rgb integer tuple .


def Func ( arg_0 ) : arg_0 . daf . file . Func ( ) for arg_1 in arg_0 . segments : if hasattr ( arg_1 , '_data' ) : del arg_1 . _data

def Func(arg_0):
        """Close this file."""
        arg_0.daf.file.Func()
        for arg_1 in arg_0.segments:
            if hasattr(arg_1, '_data'):
                del arg_1._data


def Func ( arg_0 , arg_1 , arg_2 ) : assert isinstance ( arg_2 , HDCProtocol ) assert isinstance ( arg_1 , Proposal ) if arg_1 . height >= arg_0 . cm . height : assert arg_1 . lockset . is_valid arg_0 . last_active_protocol = arg_2

def Func(arg_0, arg_1, arg_2):
        "called to inform about synced peers"
        assert isinstance(arg_2, HDCProtocol)
        assert isinstance(arg_1, Proposal)
        if arg_1.height >= arg_0.cm.height:
            assert arg_1.lockset.is_valid
            arg_0.last_active_protocol = arg_2


(cls, ifc: IfContainer, ctx: SerializerCtx)

return cls.ifTmpl.render(
            indent=getIndent(ctx.indent),
            cond=cond,
            ifTrue=asHdl(ifTrue),
            elIfs=elIfs,
            ifFalse=asHdl(ifFalse))

def Func ( arg_0 , arg_1 : Func , arg_3 : arg_4 ) : arg_5 = arg_3 . withIndent ( ) def asHdl ( arg_6 ) : return [ arg_0 . asHdl ( arg_7 , arg_5 ) for arg_7 in arg_6 ] try : arg_8 = arg_0 . condAsHdl ( arg_1 . cond , True , arg_3 ) except UnsupportedEventOpErr as e : arg_8 = None if arg_8 is None : assert not arg_1 . elIfs assert not arg_1 . ifFalse arg_9 = [ arg_0 . asHdl ( arg_7 , arg_3 ) for arg_7 in arg_1 . ifTrue ] return "\n" . join ( arg_9 ) arg_10 = [ ] arg_11 = arg_1 . ifTrue arg_12 = arg_1 . ifFalse if arg_12 is None : arg_12 = [ ] for arg_13 , arg_6 in arg_1 . elIfs : try : arg_10 . append ( ( arg_0 . condAsHdl ( arg_13 , True , arg_3 ) , asHdl ( arg_6 ) ) ) except UnsupportedEventOpErr as e : if len ( arg_1 . elIfs ) == 1 and not arg_12 : arg_12 = arg_6 else : raise e return arg_0 . ifTmpl . render ( indent = getIndent ( arg_3 . indent ) , arg_8 = arg_8 , arg_11 = asHdl ( arg_11 ) , arg_10 = arg_10 , arg_12 = asHdl ( arg_12 ) )

def Func(arg_0, arg_1: Func, arg_3: arg_4):
        """
        Srialize IfContainer instance
        """
        arg_5 = arg_3.withIndent()

        def asHdl(arg_6):
            return [arg_0.asHdl(arg_7, arg_5) for arg_7 in arg_6]

        try:
            arg_8 = arg_0.condAsHdl(arg_1.cond, True, arg_3)
        except UnsupportedEventOpErr as e:
            arg_8 = None

        if arg_8 is None:
            assert not arg_1.elIfs
            assert not arg_1.ifFalse
            arg_9 = [arg_0.asHdl(arg_7, arg_3) for arg_7 in arg_1.ifTrue]
            return "\n".join(arg_9)

        arg_10 = []
        arg_11 = arg_1.ifTrue
        arg_12 = arg_1.ifFalse
        if arg_12 is None:
            arg_12 = []

        for arg_13, arg_6 in arg_1.elIfs:
            try:
                arg_10.append((arg_0.condAsHdl(arg_13, True, arg_3), asHdl(arg_6)))
            except UnsupportedEventOpErr as e:
                if len(arg_1.elIfs) == 1 and not arg_12:
                    # register expression is in valid format and this
                    # is just register with asynchronous reset or etc...
                    arg_12 = arg_6
                else:
                    raise e

        return arg_0.ifTmpl.render(
            indent=getIndent(arg_3.indent),
            arg_8=arg_8,
            arg_11=asHdl(arg_11),
            arg_10=arg_10,
            arg_12=asHdl(arg_12))


return '\n'.join([
            "%s: ACL '%s' is defined as follows:" % (msg.user, name),
            "allow: %s" % ', '.join(self._acl[name]['allow']),
            "deny: %s" % ', '.join(self._acl[name]['deny'])
        ])

def Func(arg_0, arg_1, arg_2):
        """Show current allow and deny blocks for the given acl."""
        arg_3 = arg_2[0] if len(arg_2) > 0 else None
        if arg_3 is None:
            return "%s: The following ACLs are defined: %s" % (arg_1.user, ', '.join(arg_0._acl.keys()))

        if arg_3 not in arg_0._acl:
            return "Sorry, couldn't find an acl named '%s'" % arg_3

        return '\n'.join([
            "%s: ACL '%s' is defined as follows:" % (arg_1.user, arg_3),
            "allow: %s" % ', '.join(arg_0._acl[arg_3]['allow']),
            "deny: %s" % ', '.join(arg_0._acl[arg_3]['deny'])
        ])

Show current allow and deny blocks for the given acl .


(self, cv_id, cve_id, values, ext_ref=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
for
arg_5
,
arg_6
,
arg_7
in
arg_3
:
if
arg_6
not
in
arg_0
.
languages
:
raise
ValueError
(
'Language not present: {}'
.
format
(
arg_6
)
)
arg_0
.
controlled_vocabularies
[
arg_1
]
[
1
]
[
arg_2
]
=
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Add an entry to a controlled vocabulary.

        :param str cv_id: Name of the controlled vocabulary to add an entry.
        :param str cve_id: Name of the entry.
        :param list values: List of values of the form:
            ``(value, lang_ref, description)`` where description can be
            ``None``.
        :param str ext_ref: External reference.
        :throws KeyError: If there is no controlled vocabulary with that id.
        :throws ValueError: If a language in one of the entries doesn't exist.
        """
        for arg_5, arg_6, arg_7 in arg_3:
            if arg_6 not in arg_0.languages:
                raise ValueError('Language not present: {}'.format(arg_6))
        arg_0.controlled_vocabularies[arg_1][1][arg_2] = (arg_3, arg_4)

Add an entry to a controlled vocabulary .


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

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """optik callback for printing some help about a particular message"""
        arg_0.linter.msgs_store.help_message(utils._splitstrip(arg_3))
        sys.exit(0)


def
Func
(
arg_0
)
:
if
isinstance
(
arg_0
.
data_to_print
,
list
)
:
arg_1
=
{
}
arg_2
=
[
]
arg_3
=
[
"Percentage"
,
"HTTP"
]
arg_4
=
[
"FullHosts"
,
"PlainDomain"
]
if
arg_0
.
template
.
lower
(
)
==
"json"
:
if
not
PyFunceble
.
CONFIGURATION
[
"no_files"
]
and
arg_0
.
output
:
return
arg_0
.
_json_print
(
)
return
if
arg_0
.
template
not
in
arg_3
and
arg_0
.
template
not
in
arg_4
:
arg_0
.
header
(
True
)
arg_2
=
arg_0
.
_size_from_header
(
arg_0
.
currently_used_header
)
elif
arg_0
.
template
in
arg_4
:
for
Func
in
arg_0
.
data_to_print
:
arg_2
.
append
(
str
(
len
(
Func
)
)
)
else
:
arg_2
=
arg_0
.
_size_from_header
(
arg_0
.
headers
[
arg_0
.
template
]
)
arg_1
=
arg_0
.
_data_constructor
(
arg_2
)
arg_0
.
_before_header
(
)
for
Func
in
arg_0
.
_header_constructor
(
arg_1
,
False
)
:
if
arg_0
.
template
.
lower
(
)
in
PyFunceble
.
STATUS
[
"list"
]
[
"generic"
]
or
arg_0
.
template
in
[
"Less"
,
"Percentage"
]
:
if
not
arg_0
.
only_on_file
:
arg_6
=
arg_0
.
_colorify
(
Func
)
print
(
arg_6
)
if
not
PyFunceble
.
CONFIGURATION
[
"no_files"
]
and
arg_0
.
output
:
File
(
arg_0
.
output
)
.
write
(
Func
+
"\n"
)
else
:
raise
Exception
(
"Please review Prints().data()"
)

def Func(arg_0):  #  pragma: no cover  pylint: disable=inconsistent-return-statements
        """
        Management and input of data to the table.

        :raises:
            :code:`Exception`
                When self.data_to_print is not a list.
        """

        if isinstance(arg_0.data_to_print, list):
            # The data to print is a list.

            # We initiate the data we are going to print.
            arg_1 = {}

            # We initiate the size we are going to print.
            arg_2 = []

            # We initiate a variable which will list the list of
            # alone case.
            arg_3 = ["Percentage", "HTTP"]

            # we initiate a variable which will list the list of
            # template which does not need a header.
            arg_4 = ["FullHosts", "PlainDomain"]

            if arg_0.template.lower() == "json":
                # The template is the json template.

                if not PyFunceble.CONFIGURATION["no_files"] and arg_0.output:
                    # * We are allowed to generate file.
                    # and
                    # * The given output is not empty.

                    # We print the json file.
                    return arg_0._json_print()

                # We return nothing.
                return None

            if arg_0.template not in arg_3 and arg_0.template not in arg_4:
                # * The template is not in the list of alone case.
                # and
                # * THe template is not in the list of template without header.

                # We get the template we should use.
                # Note: We basically only need the self.currently_used_header to be filled.
                arg_0.header(True)

                # And we get the size from the header.
                arg_2 = arg_0._size_from_header(arg_0.currently_used_header)
            elif arg_0.template in arg_4:
                # The template is in the list of template which does not need a header.

                for Func in arg_0.data_to_print:
                    # We loop through the list of data to print.

                    # And we construct the (spacement) size of the data to print.
                    arg_2.append(str(len(Func)))
            else:
                # We get the size from the given template name.
                arg_2 = arg_0._size_from_header(arg_0.headers[arg_0.template])

            # We construct and format the data to print.
            arg_1 = arg_0._data_constructor(arg_2)

            # We print the before header section.
            arg_0._before_header()

            for Func in arg_0._header_constructor(arg_1, False):
                # We loop through the formatted data.

                if arg_0.template.lower() in PyFunceble.STATUS["list"][
                    "generic"
                ] or arg_0.template in ["Less", "Percentage"]:
                    # * The template is in the list of generic status.
                    # or
                    # * The template is in a specific list.

                    if not arg_0.only_on_file:
                        # We are authorized to print on screen.

                        # We colorify the data to print.
                        arg_6 = arg_0._colorify(Func)

                        # And we print the data.
                        print(arg_6)
                if not PyFunceble.CONFIGURATION["no_files"] and arg_0.output:
                    # * We are authorized to print on any file.
                    # and
                    # * The output is given.

                    # We write our data into the printed file.
                    File(arg_0.output).write(Func + "\n")
        else:
            # This should never happend. If it's happens then there's a big issue
            # around data_to_print.
            raise Exception("Please review Prints().data()")

Management and input of data to the table .


return mir_eval.display.piano_roll(times, midi=midi, **kwargs)

def Func ( arg_0 , ** arg_1 ) : arg_2 , arg_3 = arg_0 . to_interval_values ( ) return mir_eval . display . Func ( arg_2 , arg_3 = arg_3 , ** arg_1 )

def Func(arg_0, **arg_1):
    '''Plotting wrapper for piano rolls'''
    arg_2, arg_3 = arg_0.to_interval_values()

    return mir_eval.display.Func(arg_2, arg_3=arg_3, **arg_1)


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in arg_0 . items ( ) : arg_4 = arg_2 . split ( "/" ) if len ( arg_4 ) == 1 : arg_1 [ arg_2 ] = arg_3 else : if not arg_4 [ 0 ] in arg_1 : arg_1 [ arg_4 [ 0 ] ] = Func ( { "/" . join ( arg_4 [ 1 : ] ) : arg_3 } ) else : arg_5 = Func ( { "/" . join ( arg_4 [ 1 : ] ) : arg_3 } ) if not arg_4 [ 1 ] in arg_1 [ arg_4 [ 0 ] ] : arg_1 [ arg_4 [ 0 ] ] [ arg_4 [ 1 ] ] = arg_5 [ arg_4 [ 1 ] ] else : arg_1 [ arg_4 [ 0 ] ] [ arg_4 [ 1 ] ] . update ( arg_5 [ arg_4 [ 1 ] ] ) return arg_1

def Func(arg_0):
    """Reverse tree flattening."""
    arg_1 = {}
    for arg_2, arg_3 in arg_0.items():
        arg_4 = arg_2.split("/")
        # we are at the end of a branch
        if len(arg_4) == 1:
            arg_1[arg_2] = arg_3
        # there are more branches
        else:
            # create new dict
            if not arg_4[0] in arg_1:
                arg_1[arg_4[0]] = Func({"/".join(arg_4[1:]): arg_3})
            # add keys to existing dict
            else:
                arg_5 = Func({"/".join(arg_4[1:]): arg_3})
                if not arg_4[1] in arg_1[arg_4[0]]:
                    arg_1[arg_4[0]][arg_4[1]] = arg_5[arg_4[1]]
                else:
                    arg_1[arg_4[0]][arg_4[1]].update(arg_5[arg_4[1]])
    return arg_1


def Func(arg_0, arg_1):
        arg_2 = ""
        """
        Generate a short title for an object, indent it depending on
        the object's depth in the hierarchy.
        """
        if hasattr(arg_1, 'get_absolute_url'):
            arg_2 = '<input type="hidden" class="medialibrary_file_path" value="%s" />' % arg_1.get_absolute_url()

        arg_3 = ''
        if not getattr(arg_1, 'feincms_editable', True):
            arg_3 = ' tree-item-not-editable'

        arg_2 += '  ' % (
            arg_1.id, arg_3, 14 + arg_1.level * 18)
        #        r += ''
        if hasattr(arg_1, 'short_title'):
            arg_2 += arg_1.short_title()
        else:
            arg_2 += unicode(arg_1)
            #        r += ''
        return mark_safe(arg_2)

Generate a short title for an object indent it depending on the object s depth in the hierarchy .


def Func ( arg_0 ) : arg_1 = { 'key_file' : arg_0 . pop ( 'key_file' , None ) , 'http_auth' : arg_0 . pop ( 'http_auth' , None ) , 'project' : arg_0 . get ( 'project' , None ) , 'user_agent' : arg_0 . pop ( 'user_agent' , None ) , 'api_version' : arg_0 . pop ( 'api_version' , 'v1' ) } return ( arg_1 , arg_0 )

def Func(arg_0):
    """Helper to get creds out of kwargs."""
    arg_1 = {
        'key_file': arg_0.pop('key_file', None),
        'http_auth': arg_0.pop('http_auth', None),
        'project': arg_0.get('project', None),
        'user_agent': arg_0.pop('user_agent', None),
        'api_version': arg_0.pop('api_version', 'v1')
    }
    return (arg_1, arg_0)