(model, reaction, side, flux_coefficient_cutoff=0.001,
                     solver=None)

def Func(arg_0, arg_1, arg_2, arg_3=0.001,
                     arg_4=None):
    """Assesses the ability of the model to provide sufficient precursors,
    or absorb products, for a reaction operating at, or beyond,
    the specified cutoff.

    Parameters
    ----------
    model : cobra.Model
        The cobra model to assess production capacity for

    reaction : reaction identifier or cobra.Reaction
        The reaction to assess

    side : basestring
        Side of the reaction, 'products' or 'reactants'

    flux_coefficient_cutoff :  float
        The minimum flux that reaction must carry to be considered active.

    solver : basestring
        Solver name. If None, the default solver will be used.

    Returns
    -------
    bool or dict
        True if the precursors can be simultaneously produced at the
        specified cutoff. False, if the model has the capacity to produce
        each individual precursor at the specified threshold  but not all
        precursors at the required level simultaneously. Otherwise a
        dictionary of the required and the produced fluxes for each reactant
        that is not produced in sufficient quantities.

    """
    arg_1 = arg_0.reactions.get_by_any(arg_1)[0]
    arg_5 = dict(reactants='produced', products='capacity')[arg_2]
    arg_6 = attrgetter(arg_2)
    with arg_0 as arg_7:
        arg_7.objective = arg_1
        if _optimize_or_value(arg_7, arg_4=arg_4) >= arg_3:
            return True
        arg_9 = {}
        # build the demand reactions and add all at once
        arg_10 = {}
        for arg_11 in arg_6(arg_1):
            arg_12 = arg_1.metabolites[arg_11]
            arg_13 = arg_7.add_boundary(arg_11, type='demand')
            arg_13.metabolites[arg_11] = arg_12
            arg_10[arg_13] = (arg_11, arg_12)
        # First assess whether all precursors can be produced simultaneously
        arg_15 = Reaction("joint_demand")
        for arg_16 in arg_10:
            arg_15 += arg_16
        arg_7.add_reactions([arg_15])
        arg_7.objective = arg_15
        if _optimize_or_value(arg_7, arg_4=arg_4) >= arg_3:
            return True

        # Otherwise assess the ability of the model to produce each precursor
        # individually.  Now assess the ability of the model to produce each
        # reactant for a reaction
        for arg_16, (arg_11, arg_12) in iteritems(arg_10):
            # Calculate the maximum amount of the
            with arg_7:
                arg_7.objective = arg_16
                arg_17 = _optimize_or_value(arg_7, arg_4=arg_4)
            # metabolite that can be produced.
            if arg_3 > arg_17:
                # Scale the results to a single unit
                arg_9.update({
                    arg_11: {
                        'required': arg_3 / abs(arg_12),
                        arg_5: arg_17 / abs(arg_12)
                    }})
        if len(arg_9) == 0:
            arg_9 = False
        return arg_9

Assesses the ability of the model to provide sufficient precursors or absorb products for a reaction operating at or beyond the specified cutoff .


def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is not None : arg_4 = np . array ( arg_2 ) if arg_4 . ndim == 1 : arg_4 = np . diag ( arg_4 ) arg_5 = np . array ( [ vectorize ( m ) . conj ( ) for m in arg_1 ] ) . reshape ( len ( arg_1 ) , arg_1 [ 0 ] . size ) if arg_2 is not None : arg_5 = np . dot ( arg_4 , arg_5 ) arg_6 = np . array ( arg_0 ) if arg_2 is not None : arg_6 = np . dot ( arg_4 , arg_0 ) arg_7 = arg_5 . T . conj ( ) arg_8 = np . linalg . pinv ( np . dot ( arg_7 , arg_5 ) ) arg_9 = devectorize ( np . dot ( arg_8 , np . dot ( arg_7 , arg_6 ) ) ) if arg_3 is not None : arg_9 = arg_3 * arg_9 / np . trace ( arg_9 ) return arg_9

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """
    Reconstruct a matrix through linear inversion.

    Args:
        freqs (list[float]): list of observed frequences.
        ops (list[np.array]): list of corresponding projectors.
        weights (list[float] or array_like):
            weights to be used for weighted fitting.
        trace (float or None): trace of returned operator.

    Returns:
        numpy.array: A numpy array of the reconstructed operator.
    """
    # get weights matrix
    if arg_2 is not None:
        arg_4 = np.array(arg_2)
        if arg_4.ndim == 1:
            arg_4 = np.diag(arg_4)

    # Get basis S matrix
    arg_5 = np.array([vectorize(m).conj()
                  for m in arg_1]).reshape(len(arg_1), arg_1[0].size)
    if arg_2 is not None:
        arg_5 = np.dot(arg_4, arg_5)  # W.S

    # get frequencies vec
    arg_6 = np.array(arg_0)  # |f>
    if arg_2 is not None:
        arg_6 = np.dot(arg_4, arg_0)  # W.|f>
    arg_7 = arg_5.T.conj()  # S^*.W^*
    arg_8 = np.linalg.pinv(np.dot(arg_7, arg_5))  # (S^*.W^*.W.S)^-1

    # linear inversion of freqs
    arg_9 = devectorize(np.dot(arg_8, np.dot(arg_7, arg_6)))
    # renormalize to input trace value
    if arg_3 is not None:
        arg_9 = arg_3 * arg_9 / np.trace(arg_9)
    return arg_9

Reconstruct a matrix through linear inversion .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
dict
(
[
(
k
,
v
)
for
k
,
v
in
arg_0
.
items
(
)
if
k
in
KJ_SPECS
]
)
arg_3
=
init_key_jar
(
**
arg_2
)
if
arg_0
[
'type'
]
==
'internal'
:
arg_4
=
InternalSigningService
(
arg_1
,
arg_3
)
elif
arg_0
[
'type'
]
==
'web'
:
arg_3
.
issuer_keys
[
arg_0
[
'iss'
]
]
=
arg_3
.
issuer_keys
[
''
]
del
arg_3
.
issuer_keys
[
''
]
arg_4
=
WebSigningServiceClient
(
arg_0
[
'iss'
]
,
arg_0
[
'url'
]
,
arg_1
,
arg_3
)
else
:
raise
ValueError
(
'Unknown signer type: {}'
.
format
(
arg_0
[
'type'
]
)
)
return
arg_4

def Func(arg_0, arg_1):
    """
    Given configuration initiate a SigningService instance

    :param config: The signing service configuration
    :param entity_id: The entity identifier
    :return: A SigningService instance
    """

    arg_2 = dict([(k, v) for k, v in arg_0.items() if k in KJ_SPECS])
    arg_3 = init_key_jar(**arg_2)

    if arg_0['type'] == 'internal':
        arg_4 = InternalSigningService(arg_1, arg_3)
    elif arg_0['type'] == 'web':
        arg_3.issuer_keys[arg_0['iss']] = arg_3.issuer_keys['']
        del arg_3.issuer_keys['']
        arg_4 = WebSigningServiceClient(arg_0['iss'], arg_0['url'],
                                         arg_1, arg_3)
    else:
        raise ValueError('Unknown signer type: {}'.format(arg_0['type']))

    return arg_4


def Func(arg_0, arg_1=None, arg_2=True):
    """Calculates the internal energy of the AMPAL object.

    Parameters
    ----------
    ampal_obj: AMPAL Object
        Any AMPAL object with a `get_atoms` method.
    ff: BuffForceField, optional
        The force field to be used for scoring. If no force field is
        provided then the most current version of the BUDE force field
        will be used.
    assign_ff: bool, optional
        If true, then force field assignment on the AMPAL object will be
        will be updated.

    Returns
    -------
    BUFF_score: BUFFScore
        A BUFFScore object with information about each of the interactions and
        the atoms involved.
    """
    if arg_1 is None:
        arg_1 = FORCE_FIELDS['bude_2016v1']
    if arg_2:
        assign_force_field(arg_0, arg_1)
    arg_3 = find_intra_ampal(arg_0, arg_1.distance_cutoff)
    arg_4 = score_interactions(arg_3, arg_1)
    return arg_4

Calculates the internal energy of the AMPAL object .


def Func ( arg_0 , arg_1 = '' , arg_2 = 0 ) : cv2 . Func ( arg_1 , imread ( arg_0 ) ) cv2 . waitKey ( arg_2 )

def Func(arg_0, arg_1='', arg_2=0):
    """Show an image.

    Args:
        img (str or ndarray): The image to be displayed.
        win_name (str): The window name.
        wait_time (int): Value of waitKey param.
    """
    cv2.Func(arg_1, imread(arg_0))
    cv2.waitKey(arg_2)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 = arg_0 . _process_kwargs ( name = arg_0 . default_name , register = False , ** arg_2 ) return arg_1 . remote_app ( ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Creates a remote app only."""
        arg_2 = arg_0._process_kwargs(
            name=arg_0.default_name, register=False, **arg_2)
        return arg_1.remote_app(**arg_2)


def Func(arg_0, arg_1):
        """ Process a file object.
        """
        if sys.version_info[0] >= 3:
            arg_2 = arg_1.__next__
        else:
            arg_2 = arg_1.next
        for arg_3 in tokenize.generate_tokens(arg_2):
            arg_0.process_token(*arg_3)
        arg_0.make_index()


def Func ( arg_0 ) : arg_1 , arg_2 = str ( arg_0 ) . rsplit ( '.' , 1 ) try : return getattr ( __import__ ( arg_1 , fromlist = [ arg_2 ] ) , arg_2 ) except ( ImportError , AttributeError ) : raise FunctionNotFound ( arg_0 )

def Func(arg_0):
    """
    Given a Python function name, return the function it refers to.
    """
    arg_1, arg_2 = str(arg_0).rsplit('.', 1)
    try:
        return getattr(__import__(arg_1, fromlist=[arg_2]), arg_2)
    except (ImportError, AttributeError):
        raise FunctionNotFound(arg_0)

Given a Python function name return the function it refers to .


return inferenceElement in InferenceElement.__temporalInferenceElements

def Func ( arg_0 ) : if arg_1 . __temporalInferenceElements is None : arg_1 . __temporalInferenceElements = set ( [ arg_1 . prediction ] ) return arg_0 in arg_1 . __temporalInferenceElements

def Func(arg_0):
    """ Returns True if the inference from this timestep is predicted the input
    for the NEXT timestep.

    NOTE: This should only be checked IF THE MODEL'S INFERENCE TYPE IS ALSO
    TEMPORAL. That is, a temporal model CAN have non-temporal inference elements,
    but a non-temporal model CANNOT have temporal inference elements
    """
    if arg_1.__temporalInferenceElements is None:
      arg_1.__temporalInferenceElements = \
                                set([arg_1.prediction])

    return arg_0 in arg_1.__temporalInferenceElements

Returns True if the inference from this timestep is predicted the input for the NEXT timestep .


return (
        _wildcard_compare(candidate.content_type, pattern.content_type) and
        _wildcard_compare(candidate.content_subtype, pattern.content_subtype)
    )

def Func(arg_0, arg_1):
    """Is ``candidate`` an exact match or sub-type of ``pattern``?"""
    def _wildcard_compare(arg_2, arg_3):
        return arg_3 == '*' or arg_2 == arg_3

    return (
        _wildcard_compare(arg_0.content_type, arg_1.content_type) and
        _wildcard_compare(arg_0.content_subtype, arg_1.content_subtype)
    )

Is candidate an exact match or sub - type of pattern ?


def Func(arg_0, arg_1):
        """Get a list of variable names from the user's namespace.

        Parameters
        ----------
        names : list of strings
          A list of names of variables to be read from the user namespace.

        Returns
        -------
        A dict, keyed by the input names and with the repr() of each value.
        """
        arg_2 = {}
        arg_3 = arg_0.user_ns
        for arg_4 in arg_1:
            try:
                arg_5 = repr(arg_3[arg_4])
            except:
                arg_5 = arg_0._simple_error()
            arg_2[arg_4] = arg_5
        return arg_2

Get a list of variable names from the user s namespace .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_1 [ 1 ] is not None and 'force' in arg_1 [ 1 ] : arg_3 , arg_4 = super ( Bucket , arg_0 ) . Func ( * arg_1 , ** arg_2 ) if arg_3 : mimicdb . backend . sadd ( tpl . bucket % arg_0 . name , arg_3 . name ) mimicdb . backend . hmset ( tpl . key % ( arg_0 . name , arg_3 . name ) , dict ( size = arg_3 . size , md5 = arg_3 . etag . strip ( '"' ) ) ) return arg_3 , arg_4 arg_3 = None if mimicdb . backend . sismember ( tpl . bucket % arg_0 . name , arg_1 [ 0 ] ) : arg_3 = Key ( arg_0 ) arg_3 . name = arg_1 [ 0 ] return arg_3 , None

def Func(arg_0, *arg_1, **arg_2):
        """Return None if key is not in the bucket set.

        Pass 'force' in the headers to check S3 for the key, and after fetching
        the key from S3, save the metadata and key to the bucket set.
        """
        if arg_1[1] is not None and 'force' in arg_1[1]:
            arg_3, arg_4 = super(Bucket, arg_0).Func(*arg_1, **arg_2)

            if arg_3:
                mimicdb.backend.sadd(tpl.bucket % arg_0.name, arg_3.name)
                mimicdb.backend.hmset(tpl.key % (arg_0.name, arg_3.name),
                                    dict(size=arg_3.size,
                                         md5=arg_3.etag.strip('"')))
            return arg_3, arg_4

        arg_3 = None

        if mimicdb.backend.sismember(tpl.bucket % arg_0.name, arg_1[0]):
            arg_3 = Key(arg_0)
            arg_3.name = arg_1[0]

        return arg_3, None

Return None if key is not in the bucket set .


(queue_url,
                    receipt_handle,
                    client=None,
                    raiseonfail=False)

def Func(arg_0,
                    arg_1,
                    arg_2=None,
                    arg_3=False):
    """This deletes a message from the queue, effectively acknowledging its
    receipt.

    Call this only when all messages retrieved from the queue have been
    processed, since this will prevent redelivery of these messages to other
    queue workers pulling fromn the same queue channel.

    Parameters
    ----------

    queue_url : str
        The SQS URL of the queue where we got the messages from. This should be
        the same queue used to retrieve the messages in `sqs_get_item`.

    receipt_handle : str
        The receipt handle of the queue message that we're responding to, and
        will acknowledge receipt of. This will be present in each message
        retrieved using `sqs_get_item`.

    client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its operations. Alternatively, pass in an existing `boto3.Client`
        instance to re-use it here.

    raiseonfail : bool
        If True, will re-raise whatever Exception caused the operation to fail
        and break out immediately.

    Returns
    -------

    Nothing.

    """

    if not arg_2:
        arg_2 = boto3.client('sqs')

    try:

        arg_2.delete_message(
            QueueUrl=arg_0,
            ReceiptHandle=arg_1
        )

    except Exception as e:

        LOGEXCEPTION(
            'could not delete message with receipt handle: '
            '%s from queue: %s' % (arg_1, arg_0)
        )

        if arg_3:
            raise

This deletes a message from the queue effectively acknowledging its receipt .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . GET . get ( 'tpa_hint' ) if arg_1 : arg_2 = Registry . get_from_pipeline ( arg_1 ) . provider_id return get_enterprise_customer_for_sso ( arg_2 )

def Func(arg_0, arg_1):  # pylint: disable=invalid-name
    """
    Get the EnterpriseCustomer associated with a running pipeline.
    """
    arg_2 = arg_0.GET.get('tpa_hint')
    if arg_1:
        arg_2 = Registry.get_from_pipeline(arg_1).provider_id
    return get_enterprise_customer_for_sso(arg_2)

Get the EnterpriseCustomer associated with a running pipeline .


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Get siblings of a browsed subreference

        .. note:: Since 1.0.0c, there is no more prevnext dict. Nemo uses the list of original\
        chunked references to retrieve next and previous, or simply relies on the resolver to get siblings\
        when the subreference is not found in given original chunks.

        :param objectId: Id of the object
        :param subreference: Subreference of the object
        :param passage: Current Passage
        :return: Previous and next references
        :rtype: (str, str)
        """
        arg_4 = [reff for reff, _ in arg_0.get_reffs(arg_1)]
        if arg_2 in arg_4:
            arg_5 = arg_4.index(arg_2)
            # Not the first item and not the last one
            if 0 < arg_5 < len(arg_4) - 1:
                return arg_4[arg_5-1], arg_4[arg_5+1]
            elif arg_5 == 0 and arg_5 < len(arg_4) - 1:
                return None, arg_4[1]
            elif arg_5 > 0 and arg_5 == len(arg_4) - 1:
                return arg_4[arg_5-1], None
            else:
                return None, None
        else:
            return arg_3.siblingsId


(self,
                  grant_type,
                  client_id,
                  client_secret,
                  redirect_uri,
                  code,
                  **params)

return self._make_json_response({
            'access_token': access_token,
            'token_type': token_type,
            'expires_in': expires_in,
            'refresh_token': refresh_token
        })

def Func(arg_0,
                  arg_1,
                  arg_2,
                  arg_3,
                  arg_4,
                  arg_5,
                  **arg_6):
        """Generate access token HTTP response.

        :param grant_type: Desired grant type. Must be "authorization_code".
        :type grant_type: str
        :param client_id: Client ID.
        :type client_id: str
        :param client_secret: Client secret.
        :type client_secret: str
        :param redirect_uri: Client redirect URI.
        :type redirect_uri: str
        :param code: Authorization code.
        :type code: str
        :rtype: requests.Response
        """

        # Ensure proper grant_type
        if arg_1 != 'authorization_code':
            return arg_0._make_json_error_response('unsupported_grant_type')

        # Check conditions
        arg_7 = arg_0.validate_client_id(arg_2)
        arg_8 = arg_0.validate_client_secret(arg_2,
                                                             arg_3)
        arg_9 = arg_0.validate_redirect_uri(arg_2,
                                                           arg_4)

        arg_10 = arg_6.get('scope', '')
        arg_11 = arg_0.validate_scope(arg_2, arg_10)
        arg_12 = arg_0.from_authorization_code(arg_2, arg_5, arg_10)
        arg_13 = arg_12 is not None

        # Return proper error responses on invalid conditions
        if not (arg_7 and arg_8):
            return arg_0._make_json_error_response('invalid_client')

        if not arg_13 or not arg_9:
            return arg_0._make_json_error_response('invalid_grant')

        if not arg_11:
            return arg_0._make_json_error_response('invalid_scope')

        # Discard original authorization code
        arg_0.discard_authorization_code(arg_2, arg_5)

        # Generate access tokens once all conditions have been met
        arg_14 = arg_0.generate_access_token()
        arg_15 = arg_0.token_type
        arg_16 = arg_0.token_expires_in
        arg_17 = arg_0.generate_refresh_token()

        # Save information to be used to validate later requests
        arg_0.persist_token_information(arg_2=arg_2,
                                       arg_10=arg_10,
                                       arg_14=arg_14,
                                       arg_15=arg_15,
                                       arg_16=arg_16,
                                       arg_17=arg_17,
                                       arg_12=arg_12)

        # Return json response
        return arg_0._make_json_response({
            'access_token': arg_14,
            'token_type': arg_15,
            'expires_in': arg_16,
            'refresh_token': arg_17
        })


def Func(arg_0):
        """
        Creates the virtual environment.
        """
        arg_1 = arg_0.local_renderer

#         if self.virtualenv_exists():
#             print('virtualenv exists')
#             return

        print('Creating new virtual environment...')
        with arg_0.settings(warn_only=True):
            arg_2 = '[ ! -d {virtualenv_dir} ] && virtualenv --no-site-packages {virtualenv_dir} || true'
            if arg_0.is_local:
                arg_1.run_or_local(arg_2)
            else:
                arg_1.sudo(arg_2)


def Func ( arg_0 ) : arg_1 = Task . objects . get ( pk = arg_0 [ 'id' ] ) if arg_1 . allow_overlap : arg_1 . run ( arg_0 ) else : if not arg_1 . running : arg_1 . running = True arg_1 . save ( ) try : arg_1 . run ( arg_0 ) finally : arg_1 . running = False arg_1 . save ( )

def Func(arg_0):
    """Internal ``RUN_TASK`` consumer to run the task's callable"""
    arg_1 = Task.objects.get(pk=arg_0['id'])
    if arg_1.allow_overlap:
        arg_1.run(arg_0)
    else:
        if not arg_1.running:
            arg_1.running = True
            arg_1.save()
            try:
                arg_1.run(arg_0)
            finally:
                arg_1.running = False
                arg_1.save()

Internal RUN_TASK consumer to run the task s callable


return mir_eval.pattern.evaluate(ref_patterns, est_patterns, **kwargs)

def Func(arg_0, arg_1, **arg_2):
    r'''Pattern detection evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.Func.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='Func_jku')[0]
    >>> est_ann = est_jam.search(namespace='Func_jku')[0]
    >>> scores = jams.eval.Func(ref_ann, est_ann)
    '''

    arg_3 = 'Func_jku'
    arg_0 = coerce_annotation(arg_0, arg_3)
    arg_1 = coerce_annotation(arg_1, arg_3)

    arg_4 = Func_to_mireval(arg_0)
    arg_5 = Func_to_mireval(arg_1)

    return mir_eval.Func.evaluate(arg_4, arg_5, **arg_2)

r'''Pattern detection evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.pattern.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='pattern_jku')[0]
    >>> est_ann = est_jam.search(namespace='pattern_jku')[0]
    >>> scores = jams.eval.pattern(ref_ann, est_ann)


def Func(arg_0, arg_1):
        """Create the Flow object.

        The Flow is calculated lazily since we don't know where this app is
        running until it receives a request, at which point redirect_uri can be
        calculated and then the Flow object can be constructed.

        Args:
            request_handler: webapp.RequestHandler, the request handler.
        """
        if arg_0.flow is None:
            arg_2 = arg_1.request.relative_url(
                arg_0._callback_path)  # Usually /oauth2callback
            arg_0.flow = client.OAuth2WebServerFlow(
                arg_0._client_id, arg_0._client_secret, arg_0._scope,
                arg_2=arg_2, user_agent=arg_0._user_agent,
                auth_uri=arg_0._auth_uri, token_uri=arg_0._token_uri,
                revoke_uri=arg_0._revoke_uri, **arg_0._kwargs)


def Func ( arg_0 ) : arg_1 = 'uncertain_significance' arg_2 = False arg_3 = [ ] arg_4 = [ ] arg_5 = [ ] arg_6 = False arg_7 = [ ] arg_8 = [ ] for arg_9 in arg_0 : if arg_9 . startswith ( 'PVS' ) : arg_2 = True elif arg_9 . startswith ( 'PS' ) : arg_3 . append ( arg_9 ) elif arg_9 . startswith ( 'PM' ) : arg_4 . append ( arg_9 ) elif arg_9 . startswith ( 'PP' ) : arg_5 . append ( arg_9 ) elif arg_9 . startswith ( 'BA' ) : arg_6 = True elif arg_9 . startswith ( 'BS' ) : arg_7 . append ( arg_9 ) elif arg_9 . startswith ( 'BP' ) : arg_8 . append ( arg_9 ) arg_10 = is_pathogenic ( arg_2 , arg_3 , arg_4 , arg_5 ) arg_11 = is_likely_pathogenic ( arg_2 , arg_3 , arg_4 , arg_5 ) arg_12 = is_benign ( arg_6 , arg_7 ) arg_13 = is_likely_benign ( arg_7 , arg_8 ) if ( arg_10 or arg_11 ) : if ( arg_12 or arg_13 ) : arg_1 = 'uncertain_significance' elif arg_10 : arg_1 = 'pathogenic' else : arg_1 = 'likely_pathogenic' else : if arg_12 : arg_1 = 'benign' if arg_13 : arg_1 = 'likely_benign' return arg_1

def Func(arg_0):
    """Use the algorithm described in ACMG paper to get a ACMG calssification

    Args:
        acmg_terms(set(str)): A collection of prediction terms

    Returns:
        prediction(int):
                0 - Uncertain Significanse
                1 - Benign
                2 - Likely Benign
                3 - Likely Pathogenic
                4 - Pathogenic
    """
    arg_1 = 'uncertain_significance'
    # This variable indicates if Pathogenecity Very Strong exists
    arg_2 = False
    # Collection of terms with Pathogenecity Strong
    arg_3 = []
    # Collection of terms with Pathogenecity moderate
    arg_4 = []
    # Collection of terms with Pathogenecity supporting
    arg_5 = []
    # This variable indicates if Benign impact stand-alone exists
    arg_6 = False
    # Collection of terms with Benign evidence Strong
    arg_7 = []
    # Collection of terms with supporting Benign evidence
    arg_8 = []
    for arg_9 in arg_0:
        if arg_9.startswith('PVS'):
            arg_2 = True
        elif arg_9.startswith('PS'):
            arg_3.append(arg_9)
        elif arg_9.startswith('PM'):
            arg_4.append(arg_9)
        elif arg_9.startswith('PP'):
            arg_5.append(arg_9)
        elif arg_9.startswith('BA'):
            arg_6 = True
        elif arg_9.startswith('BS'):
            arg_7.append(arg_9)
        elif arg_9.startswith('BP'):
            arg_8.append(arg_9)

    # We need to start by checking for Pathogenecity
    arg_10 = is_pathogenic(arg_2, arg_3, arg_4, arg_5)
    arg_11 = is_likely_pathogenic(arg_2, arg_3, arg_4, arg_5)
    arg_12 = is_benign(arg_6, arg_7)
    arg_13 = is_likely_benign(arg_7, arg_8)

    if (arg_10 or arg_11):
        if (arg_12 or arg_13):
            arg_1 = 'uncertain_significance'
        elif arg_10:
            arg_1 = 'pathogenic'
        else:
            arg_1 = 'likely_pathogenic'
    else:
        if arg_12:
            arg_1 = 'benign'
        if arg_13:
            arg_1 = 'likely_benign'

    return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == [ arg_0 . _keys [ 'menu' ] ] : if arg_0 . _urwid_loop . widget == arg_0 . _tabbed_window : arg_0 . _show_menu ( ) else : arg_0 . _hide_menu ( ) elif arg_1 == [ arg_0 . _keys [ 'quit' ] ] : arg_0 . _coroutine_queue . put ( arg_0 . _client . disconnect ( ) ) else : return arg_1

def Func(arg_0, arg_1, arg_2):
        """Handle global keybindings."""
        if arg_1 == [arg_0._keys['menu']]:
            if arg_0._urwid_loop.widget == arg_0._tabbed_window:
                arg_0._show_menu()
            else:
                arg_0._hide_menu()
        elif arg_1 == [arg_0._keys['quit']]:
            arg_0._coroutine_queue.put(arg_0._client.disconnect())
        else:
            return arg_1


def Func(arg_0, arg_1=None):
    """One step backward Levinson recursion

    :param anxt:
    :param enxt:
    :return:
        * acur the P'th order prediction polynomial based on the P+1'th order prediction polynomial, anxt.
        * ecur the the P'th order prediction error  based on the P+1'th order prediction error, enxt.

    ..  * knxt the P+1'th order reflection coefficient.

    """
    #% Some preliminaries first
    #if nargout>=2 & nargin<2
    #    raise ValueError('Insufficient number of input arguments');
    if arg_0[0] != 1:
        raise ValueError('At least one of the reflection coefficients is equal to one.')
    arg_0 = arg_0[1:] #  Drop the leading 1, it is not needed
                    #  in the step down

    # Extract the k+1'th reflection coefficient
    arg_2 = arg_0[-1]
    if arg_2 == 1.0:
        raise ValueError('At least one of the reflection coefficients is equal to one.')

    # A Matrix formulation from Stoica is used to avoid looping
    arg_3 = (arg_0[0:-1]-arg_2*numpy.conj(arg_0[-2::-1]))/(1.-abs(arg_2)**2)
    arg_4 = None
    if arg_1 is not None:
        arg_4 = arg_1/(1.-numpy.dot(arg_2.conj().transpose(),arg_2))

    arg_3 = numpy.insert(arg_3, 0, 1)

    return arg_3, arg_4


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Handles addition and removal of nodes.
        """
        arg_0._delete_nodes(arg_4.removed)
        arg_0._add_nodes(arg_4.added)


def Func(arg_0, arg_1):
    """ Extracts start row from the bookmark information
    """
    arg_2 = json.loads(arg_1)

    arg_3 = os.path.realpath(arg_0._filename)

    arg_4 = arg_2.get('filepath', None)

    if arg_4 != arg_3:
      print ("Ignoring bookmark due to mismatch between File's "
             "filename realpath vs. bookmark; realpath: %r; bookmark: %r") % (
        arg_3, arg_2)
      return 0
    else:
      return arg_2['currentRow']


Run the environment for one time step. If the
        actions and exogenous changes are independent, this method will
        do.  If there are interactions between them, you'll need to
        override this method.

def Func ( arg_0 ) : if not arg_0 . is_done ( ) : arg_1 = [ arg_2 . program ( arg_0 . percept ( arg_2 ) ) for arg_2 in arg_0 . agents ] for ( arg_2 , arg_3 ) in zip ( arg_0 . agents , arg_1 ) : arg_0 . execute_action ( arg_2 , arg_3 ) arg_0 . exogenous_change ( )

def Func(arg_0):
        """Run the environment for one time Func. If the
        actions and exogenous changes are independent, this method will
        do.  If there are interactions between them, you'll need to
        override this method."""
        if not arg_0.is_done():
            arg_1 = [arg_2.program(arg_0.percept(arg_2))
                       for arg_2 in arg_0.agents]
            for (arg_2, arg_3) in zip(arg_0.agents, arg_1):
                arg_0.execute_action(arg_2, arg_3)
            arg_0.exogenous_change()

Run the environment for one time step . If the actions and exogenous changes are independent this method will do . If there are interactions between them you ll need to override this method .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
API_METHODS
for
arg_3
in
arg_1
.
split
(
'.'
)
:
arg_2
=
arg_2
.
get
(
arg_3
)
if
arg_2
is
:
break
if
isinstance
(
arg_2
,
str
)
:
logger
.
debug
(
'%r: %r'
,
arg_1
,
arg_2
)
return
True
return
False

def Func(arg_0, arg_1):
        """Whether a given method exists in the known API.

        Arguments:
          method (:py:class:`str`): The name of the method.

        Returns:
          :py:class:`bool`: Whether the method is in the known API.

        """
        arg_2 = arg_0.API_METHODS
        for arg_3 in arg_1.split('.'):
            arg_2 = arg_2.get(arg_3)
            if arg_2 is None:
                break
        if isinstance(arg_2, str):
            logger.debug('%r: %r', arg_1, arg_2)
            return True
        return False

Whether a given method exists in the known API .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . Func_pos ( arg_1 ) if arg_2 is None : return None return arg_0 . ring [ arg_0 . _sorted_keys [ arg_2 ] ]

def Func(arg_0, arg_1):
        """Given a string key a corresponding node in the hash ring is returned.

        If the hash ring is empty, `None` is returned.
        """
        arg_2 = arg_0.Func_pos(arg_1)
        if arg_2 is None:
            return None
        return arg_0.ring[arg_0._sorted_keys[arg_2]]

Given a string key a corresponding node in the hash ring is returned .


def Func ( arg_0 ) : for arg_1 in [ 'ins' , 'del' ] : for arg_2 in arg_0 . xpath ( 'descendant-or-self::%s' % arg_1 ) : if not _contains_block_level_tag ( arg_2 ) : continue _move_el_inside_block ( arg_2 , arg_1 = arg_1 ) arg_2 . drop_tag ( )

def Func(arg_0):
    """fixup_ins_del_tags that works on an lxml document in-place
    """
    for arg_1 in ['ins', 'del']:
        for arg_2 in arg_0.xpath('descendant-or-self::%s' % arg_1):
            if not _contains_block_level_tag(arg_2):
                continue
            _move_el_inside_block(arg_2, arg_1=arg_1)
            arg_2.drop_tag()

fixup_ins_del_tags that works on an lxml document in - place


return tfd.Independent(tfd.Normal(*args, **kwargs),
                         reinterpreted_batch_ndims=1)

def Func ( * arg_0 , ** arg_1 ) : return tfd . Independent ( tfd . Normal ( * arg_0 , ** arg_1 ) , reinterpreted_batch_ndims = 1 )

def Func(*arg_0, **arg_1):
  """Convenience function to efficiently construct a MultivariateNormalDiag."""
  # Faster than using `tfd.MultivariateNormalDiag`.
  return tfd.Independent(tfd.Normal(*arg_0, **arg_1),
                         reinterpreted_batch_ndims=1)

Convenience function to efficiently construct a MultivariateNormalDiag .


return FirebaseUser(self.email, token, self.provider, user_id)

def Func ( arg_0 ) : arg_1 = arg_0 . authenticator . create_token ( arg_0 . extra ) arg_2 = arg_0 . extra . get ( 'id' ) return FirebaseUser ( arg_0 . email , arg_1 , arg_0 . provider , arg_2 )

def Func(arg_0):
        """
        Method that gets the authenticated user. The returning user has
        the token, email and the provider data.
        """
        arg_1 = arg_0.authenticator.create_token(arg_0.extra)
        arg_2 = arg_0.extra.get('id')
        return FirebaseUser(arg_0.email, arg_1, arg_0.provider, arg_2)

Method that gets the authenticated user . The returning user has the token email and the provider data .


def
Func
(
arg_0
,
arg_1
)
:
with
arg_0
.
lock
:
if
arg_0
.
in_use
:
raise
StreamParseError
(
"StreamReader.Func() is not reentrant!"
)
arg_0
.
in_use
=
True
try
:
if
not
arg_0
.
_started
:
if
len
(
arg_1
)
>
1
:
arg_0
.
parser
.
Func
(
arg_1
[
:
1
]
)
arg_1
=
arg_1
[
1
:
]
arg_0
.
_started
=
True
if
arg_1
:
arg_0
.
parser
.
Func
(
arg_1
)
else
:
arg_0
.
parser
.
close
(
)
except
ElementTree
.
ParseError
,
err
:
arg_0
.
handler
.
stream_parse_error
(
unicode
(
err
)
)
finally
:
arg_0
.
in_use
=
False

def Func(arg_0, arg_1):
        """Feed the parser with a chunk of data. Apropriate methods
        of `handler` will be called whenever something interesting is
        found.

        :Parameters:
            - `data`: the chunk of data to parse.
        :Types:
            - `data`: `str`"""
        with arg_0.lock:
            if arg_0.in_use:
                raise StreamParseError("StreamReader.Func() is not reentrant!")
            arg_0.in_use = True
            try:
                if not arg_0._started:
                    # workaround for lxml bug when fed with a big chunk at once
                    if len(arg_1) > 1:
                        arg_0.parser.Func(arg_1[:1])
                        arg_1 = arg_1[1:]
                    arg_0._started = True
                if arg_1:
                    arg_0.parser.Func(arg_1)
                else:
                    arg_0.parser.close()
            except ElementTree.ParseError, err:
                arg_0.handler.stream_parse_error(unicode(err))
            finally:
                arg_0.in_use = False

Feed the parser with a chunk of data . Apropriate methods of handler will be called whenever something interesting is found .


def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : if arg_2 is None : arg_2 = format_from_extension ( arg_1 ) with file ( arg_1 , 'wb' ) as fp : arg_0 . Func_like ( fp , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """ Save the object to file given by filename.
        """
        if arg_2 is None:
            # try to derive protocol from file extension
            arg_2 = format_from_extension(arg_1)
        with file(arg_1, 'wb') as fp:
            arg_0.Func_like(fp, arg_2, **arg_3)

Save the object to file given by filename .


Get all events for this report. Additional arguments may also be
        specified that will be passed to the query function.

return self.__api.events(query=EqualsOperator("report", self.hash_),
                                 **kwargs)

def Func ( arg_0 , ** arg_1 ) : return arg_0 . __api . Func ( query = EqualsOperator ( "report" , arg_0 . hash_ ) , ** arg_1 )

def Func(arg_0, **arg_1):
        """Get all Func for this report. Additional arguments may also be
        specified that will be passed to the query function.
        """
        return arg_0.__api.Func(query=EqualsOperator("report", arg_0.hash_),
                                 **arg_1)

Get all events for this report . Additional arguments may also be specified that will be passed to the query function .


(cls, fp, selector_handler=None, strict=False, debug=False)

return cls.from_yamlstring(fp.read(), selector_handler=selector_handler, strict=strict, debug=debug)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = False ) : return arg_0 . from_yamlstring ( arg_1 . read ( ) , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=False):
        """
        Create a Parselet instance from a file containing
        the Parsley script as a YAML object

        >>> import parslepy
        >>> with open('parselet.yml') as fp:
        ...     parslepy.Parselet.Func(fp)
        ...
        <parslepy.base.Parselet object at 0x2014e50>

        :param file fp: an open file-like pointer containing the Parsley script
        :rtype: :class:`.Parselet`

        Other arguments: same as for :class:`.Parselet` contructor
        """

        return arg_0.from_yamlstring(arg_1.read(), arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Create a Parselet instance from a file containing
        the Parsley script as a YAML object

        >>> import parslepy
        >>> with open('parselet.yml') as fp:
        ...     parslepy.Parselet.from_yamlfile(fp)
        ...
        <parslepy.base.Parselet object at 0x2014e50>

        :param file fp: an open file-like pointer containing the Parsley script
        :rtype: :class:`.Parselet`

        Other arguments: same as for :class:`.Parselet` contructor


def Func(arg_0, arg_1):
        """
        Configure the room using the provided data.
        Do nothing if the provided form is of type 'cancel'.

        :Parameters:
            - `form`: the configuration parameters. Should be a 'submit' form made by filling-in
              the configuration form retireved using `self.request_configuration_form` or
              a 'cancel' form.
        :Types:
            - `form`: `Form`

        :return: id of the request stanza or `None` if a 'cancel' form was provieded.
        :returntype: `unicode`
        """

        if arg_1.type == "cancel":
            return None
        elif arg_1.type != "submit":
            raise ValueError("A 'submit' form required to configure a room")
        arg_2 = Iq(to_jid = arg_0.room_jid.bare(), stanza_type = "set")
        arg_3 = arg_2.new_query(MUC_OWNER_NS, "query")
        arg_1.as_xml(arg_3)
        arg_0.manager.stream.set_response_handlers(
                arg_2, arg_0.process_configuration_success, arg_0.process_configuration_error)
        arg_0.manager.stream.send(arg_2)
        return arg_2.get_id()

Configure the room using the provided data . Do nothing if the provided form is of type cancel .


return (
            self._first_attrs
            and isinstance(node, astroid.Name)
            and node.name == self._first_attrs[-1]
        )

def Func ( arg_0 , arg_1 ) : return ( arg_0 . _first_attrs and isinstance ( arg_1 , astroid . Name ) and arg_1 . name == arg_0 . _first_attrs [ - 1 ] )

def Func(arg_0, arg_1):
        """Check if astroid.Name corresponds to first attribute variable name

        Name is `self` for method, `cls` for classmethod and `mcs` for metaclass.
        """
        return (
            arg_0._first_attrs
            and isinstance(arg_1, astroid.Name)
            and arg_1.name == arg_0._first_attrs[-1]
        )

Check if astroid . Name corresponds to first attribute variable name


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] if arg_1 : arg_2 . append ( arg_0 . attribute_factory . create_attribute ( enums . AttributeType . OPERATION_POLICY_NAME , arg_1 ) ) return arg_2

def Func(arg_0, arg_1=None):
        '''
         Build a list of common attributes that are shared across
         symmetric as well as asymmetric objects
        '''
        arg_2 = []

        if arg_1:
            arg_2.append(
                arg_0.attribute_factory.create_attribute(
                    enums.AttributeType.OPERATION_POLICY_NAME,
                    arg_1
                )
            )

        return arg_2


return render_template(
        'dashboard/dashboard_general.html', institute=institute_id, query=slice_query, panel=panel, **data)

def Func():
    """Display the Scout dashboard."""
    arg_0 = current_user.institutes
    if not 'admin' in current_user.roles:
        arg_0 = current_user.institutes
        if not arg_0:
            flash('Not allowed to see information - please visit the dashboard later!')
            return redirect(url_for('cases.dahboard_general.html'))

    LOG.debug('User accessible institutes: {}'.format(arg_0))
    arg_1 = [inst for inst in store.institutes(arg_0)]

    # Insert a entry that displays all institutes in the beginning of the array
    arg_1.insert(0, {'_id': None, 'display_name': 'All institutes'})

    arg_2 = None
    arg_3 = None
    arg_4=1
    if request.method=='POST':
        arg_2 = request.form.get('institute')
        arg_3 = request.form.get('query')
        arg_4=request.form.get('pane_id')

    elif request.method=='GET':
        arg_2 = request.args.get('institute')
        arg_3 = request.args.get('query')

    # User should be restricted to their own institute if:
    #1) Their default institute when the page is first loaded
    #2) if they ask for an institute that they don't belong to
    #3) if they want perform a query on all institutes

    if not arg_2:
        arg_2 = arg_0[0]
    elif (not current_user.is_admin) and (arg_3 and arg_2 == 'None'):
        arg_2 = arg_0[0]
    elif (not arg_2 in arg_0) and not (arg_2 == 'None'):
        arg_2 = arg_0[0]

    LOG.info("Fetch all cases with institute: %s", arg_2)

    arg_5 = get_dashboard_info(store, arg_2, arg_3)
    arg_5['institutes'] = arg_1
    arg_5['choice'] = arg_2
    arg_6 = arg_5['total_cases']

    LOG.info("Found %s cases", arg_6)
    if arg_6 == 0:
        flash('no cases found for institute {} (with that query) - please visit the dashboard later!'.format(arg_2), 'info')
#        return redirect(url_for('cases.Func'))

    return render_template(
        'dashboard/dashboard_general.html', institute=arg_2, query=arg_3, arg_4=arg_4, **arg_5)


def Func ( arg_0 , arg_1 ) : arg_0 . modules . add ( arg_1 ) arg_0 . save_reduce ( subimport , ( arg_1 . __name__ , ) , arg_1 = arg_1 )

def Func(arg_0, arg_1):
    """
    Save a module as an import
    """
    arg_0.modules.add(arg_1)
    arg_0.save_reduce(subimport, (arg_1.__name__,), arg_1=arg_1)


def Func ( ) : yield from _TO_COLOR_USER . items ( ) for arg_0 , arg_1 in _TO_COLOR . items ( ) : if arg_0 not in _TO_COLOR_USER : yield arg_0 , arg_1

def Func():
    """Return an iteration over all name, color pairs in tables"""
    yield from _TO_COLOR_USER.items()
    for arg_0, arg_1 in _TO_COLOR.items():
        if arg_0 not in _TO_COLOR_USER:
            yield arg_0, arg_1

Return an iteration over all name color pairs in tables


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

def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_2 . pop ( 'force' , None ) : arg_3 = arg_2 . get ( 'headers' , { } ) arg_3 [ 'force' ] = True arg_2 [ 'headers' ] = arg_3 return super ( Bucket , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Return the key from MimicDB.

        :param boolean force: If true, API call is forced to S3
        """
        if arg_2.pop('force', None):
            arg_3 = arg_2.get('headers', {})
            arg_3['force'] = True
            arg_2['headers'] = arg_3

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


(y=None, sr=22050, S=None, lag=1, max_size=1,
                   ref=None,
                   detrend=False, center=True,
                   feature=None, aggregate=None,
                   centering=None,
                   **kwargs)

def Func(arg_0=None, arg_1=22050, arg_2=None, arg_3=1, arg_4=1,
                   arg_5=None,
                   arg_6=False, arg_7=True,
                   arg_8=None, arg_9=None,
                   arg_10=None,
                   **arg_11):
    """Compute a spectral flux onset strength envelope.

    Onset strength at time `t` is determined by:

    `mean_f max(0, S[f, t] - ref[f, t - lag])`

    where `ref` is `S` after local max filtering along the frequency
    axis [1]_.

    By default, if a time series `y` is provided, S will be the
    log-power Mel spectrogram.

    .. [1] Böck, Sebastian, and Gerhard Widmer.
           "Maximum filter vibrato suppression for onset detection."
           16th International Conference on Digital Audio Effects,
           Maynooth, Ireland. 2013.

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

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

    S        : np.ndarray [shape=(d, m)]
        pre-computed (log-power) spectrogram

    lag      : int > 0
        time lag for computing differences

    max_size : int > 0
        size (in frequency bins) of the local max filter.
        set to `1` to disable filtering.

    ref : None or np.ndarray [shape=(d, m)]
        An optional pre-computed reference spectrum, of the same shape as `S`.
        If not provided, it will be computed from `S`.
        If provided, it will override any local max filtering governed by `max_size`.

    detrend : bool [scalar]
        Filter the onset strength to remove the DC component

    center : bool [scalar]
        Shift the onset function by `n_fft / (2 * hop_length)` frames

    feature : function
        Function for computing time-series features, eg, scaled spectrograms.
        By default, uses `librosa.feature.melspectrogram` with `fmax=11025.0`

    aggregate : function
        Aggregation function to use when combining onsets
        at different frequency bins.

        Default: `np.mean`

    kwargs : additional keyword arguments
        Additional parameters to `feature()`, if `S` is not provided.

    Returns
    -------
    onset_envelope   : np.ndarray [shape=(m,)]
        vector containing the onset strength envelope

    Raises
    ------
    ParameterError
        if neither `(y, sr)` nor `S` are provided

        or if `lag` or `max_size` are not positive integers

    See Also
    --------
    onset_detect
    Func_multi

    Examples
    --------
    First, load some audio and plot the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      duration=10.0)
    >>> D = np.abs(librosa.stft(y))
    >>> times = librosa.frames_to_time(np.arange(D.shape[1]))
    >>> plt.figure()
    >>> ax1 = plt.subplot(2, 1, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(D, ref=np.max),
    ...                          y_axis='log', x_axis='time')
    >>> plt.title('Power spectrogram')

    Construct a standard onset function

    >>> onset_env = librosa.onset.Func(y=y, sr=sr)
    >>> plt.subplot(2, 1, 2, sharex=ax1)
    >>> plt.plot(times, 2 + onset_env / onset_env.max(), alpha=0.8,
    ...          label='Mean (mel)')

    Median aggregation, and custom mel options

    >>> onset_env = librosa.onset.Func(y=y, sr=sr,
    ...                                          aggregate=np.median,
    ...                                          fmax=8000, n_mels=256)
    >>> plt.plot(times, 1 + onset_env / onset_env.max(), alpha=0.8,
    ...          label='Median (custom mel)')

    Constant-Q spectrogram instead of Mel

    >>> onset_env = librosa.onset.Func(y=y, sr=sr,
    ...                                          feature=librosa.cqt)
    >>> plt.plot(times, onset_env / onset_env.max(), alpha=0.8,
    ...          label='Mean (CQT)')
    >>> plt.legend(frameon=True, framealpha=0.75)
    >>> plt.ylabel('Normalized strength')
    >>> plt.yticks([])
    >>> plt.axis('tight')
    >>> plt.tight_layout()

    """

    if arg_9 is False:
        raise ParameterError('aggregate={} cannot be False when computing full-spectrum onset strength.')

    arg_12 = Func_multi(arg_0=arg_0,
                                   arg_1=arg_1,
                                   arg_2=arg_2,
                                   arg_3=arg_3,
                                   arg_4=arg_4,
                                   arg_5=arg_5,
                                   arg_6=arg_6,
                                   arg_7=arg_7,
                                   arg_8=arg_8,
                                   arg_9=arg_9,
                                   channels=None,
                                   **arg_11)

    return arg_12[0]

Compute a spectral flux onset strength envelope.

    Onset strength at time `t` is determined by:

    `mean_f max(0, S[f, t] - ref[f, t - lag])`

    where `ref` is `S` after local max filtering along the frequency
    axis [1]_.

    By default, if a time series `y` is provided, S will be the
    log-power Mel spectrogram.

    .. [1] Böck, Sebastian, and Gerhard Widmer.
           "Maximum filter vibrato suppression for onset detection."
           16th International Conference on Digital Audio Effects,
           Maynooth, Ireland. 2013.

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

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

    S        : np.ndarray [shape=(d, m)]
        pre-computed (log-power) spectrogram

    lag      : int > 0
        time lag for computing differences

    max_size : int > 0
        size (in frequency bins) of the local max filter.
        set to `1` to disable filtering.

    ref : None or np.ndarray [shape=(d, m)]
        An optional pre-computed reference spectrum, of the same shape as `S`.
        If not provided, it will be computed from `S`.
        If provided, it will override any local max filtering governed by `max_size`.

    detrend : bool [scalar]
        Filter the onset strength to remove the DC component

    center : bool [scalar]
        Shift the onset function by `n_fft / (2 * hop_length)` frames

    feature : function
        Function for computing time-series features, eg, scaled spectrograms.
        By default, uses `librosa.feature.melspectrogram` with `fmax=11025.0`

    aggregate : function
        Aggregation function to use when combining onsets
        at different frequency bins.

        Default: `np.mean`

    kwargs : additional keyword arguments
        Additional parameters to `feature()`, if `S` is not provided.

    Returns
    -------
    onset_envelope   : np.ndarray [shape=(m,)]
        vector containing the onset strength envelope

    Raises
    ------
    ParameterError
        if neither `(y, sr)` nor `S` are provided

        or if `lag` or `max_size` are not positive integers

    See Also
    --------
    onset_detect
    onset_strength_multi

    Examples
    --------
    First, load some audio and plot the spectrogram

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      duration=10.0)
    >>> D = np.abs(librosa.stft(y))
    >>> times = librosa.frames_to_time(np.arange(D.shape[1]))
    >>> plt.figure()
    >>> ax1 = plt.subplot(2, 1, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(D, ref=np.max),
    ...                          y_axis='log', x_axis='time')
    >>> plt.title('Power spectrogram')

    Construct a standard onset function

    >>> onset_env = librosa.onset.onset_strength(y=y, sr=sr)
    >>> plt.subplot(2, 1, 2, sharex=ax1)
    >>> plt.plot(times, 2 + onset_env / onset_env.max(), alpha=0.8,
    ...          label='Mean (mel)')

    Median aggregation, and custom mel options

    >>> onset_env = librosa.onset.onset_strength(y=y, sr=sr,
    ...                                          aggregate=np.median,
    ...                                          fmax=8000, n_mels=256)
    >>> plt.plot(times, 1 + onset_env / onset_env.max(), alpha=0.8,
    ...          label='Median (custom mel)')

    Constant-Q spectrogram instead of Mel

    >>> onset_env = librosa.onset.onset_strength(y=y, sr=sr,
    ...                                          feature=librosa.cqt)
    >>> plt.plot(times, onset_env / onset_env.max(), alpha=0.8,
    ...          label='Mean (CQT)')
    >>> plt.legend(frameon=True, framealpha=0.75)
    >>> plt.ylabel('Normalized strength')
    >>> plt.yticks([])
    >>> plt.axis('tight')
    >>> plt.tight_layout()

Compute a spectral flux onset strength envelope .


def Func ( arg_0 ) : signal . signal ( signal . SIGINT , arg_0 . shutdown ) arg_0 . spawn ( arg_0 . config . process_to_monitor , timeout = 0 ) return arg_0 . _is_sigsegv ( arg_0 . return_code )

def Func(arg_0):
        """
        Run command once and check exit code
        """
        signal.signal(signal.SIGINT, arg_0.shutdown)
        arg_0.spawn(arg_0.config.process_to_monitor, timeout=0)
        return arg_0._is_sigsegv(arg_0.return_code)


(self, file_path='', date=(datetime.date.today()),
        organization='llnl')

def Func ( arg_0 , arg_1 = '' , arg_2 = ( arg_3 . date . today ( ) ) , arg_5 = 'llnl' ) : with open ( arg_1 , 'w+' ) as out : out . write ( 'date,organization,stargazers\n' ) arg_6 = sorted ( arg_0 . stargazers ) for arg_7 in arg_6 : out . write ( arg_7 + ',' + str ( arg_0 . stargazers [ arg_7 ] ) + '\n' ) out . close ( )

def Func(arg_0, arg_1='', arg_2=(arg_3.date.today()),
        arg_5='llnl'):
        """
        Writes stargazers data to file.
        """
        with open(arg_1, 'w+') as out:
            out.write('date,organization,stargazers\n')
            arg_6 = sorted(arg_0.stargazers)#sort based on lowercase
            for arg_7 in arg_6:
                out.write(arg_7 + ',' + str(arg_0.stargazers[arg_7]) + '\n')
        out.close()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . parse_json ( arg_1 ) for arg_3 in arg_2 [ 'order' ] : yield arg_2 [ 'posts' ] [ arg_3 ]

def Func(arg_0, arg_1):
        """Parse posts and returns in order."""

        arg_2 = arg_0.parse_json(arg_1)

        # Posts are not sorted. The order is provided by
        # 'order' key.
        for arg_3 in arg_2['order']:
            yield arg_2['posts'][arg_3]


def Func ( arg_0 ) : with open ( arg_0 , "r" ) as color_file : arg_1 = json . load ( color_file ) arg_2 = { c [ "name" ] : c [ "hex" ] for c in arg_1 } return arg_2

def Func(arg_0):
    """Parse a JSON color file.

    The JSON has to be in the following format:

    .. code:: json

       [{"name": "COLOR_NAME", "hex": "#HEX"}, ...]

    :param str path: the path to the JSON color file
    """
    with open(arg_0, "r") as color_file:
        arg_1 = json.load(color_file)

    # transform raw color list into color dict
    arg_2 = {c["name"]: c["hex"] for c in arg_1}
    return arg_2


(sr, fmin, n_bins=84, bins_per_octave=12,
                       tuning=0.0, window='hann', filter_scale=1)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
84
,
arg_3
=
12
,
arg_4
=
0.0
,
arg_5
=
'hann'
,
arg_6
=
1
)
:
if
arg_1
<=
0
:
raise
ParameterError
(
'fmin must be positive'
)
if
arg_3
<=
0
:
raise
ParameterError
(
'bins_per_octave must be positive'
)
if
arg_6
<=
0
:
raise
ParameterError
(
'filter_scale must be positive'
)
if
arg_2
<=
0
or
not
isinstance
(
arg_2
,
int
)
:
raise
ParameterError
(
'n_bins must be a positive integer'
)
arg_7
=
2.0
**
(
float
(
arg_4
)
/
arg_3
)
arg_1
=
arg_7
*
arg_1
arg_8
=
float
(
arg_6
)
/
(
2.0
**
(
1.
/
arg_3
)
1
)
arg_9
=
arg_1
*
(
2.0
**
(
np
.
arange
(
arg_2
,
dtype
=
float
)
/
arg_3
)
)
if
arg_9
[
1
]
*
(
1
+
0.5
*
window_bandwidth
(
arg_5
)
/
arg_8
)
>
arg_0
/
2.0
:
raise
ParameterError
(
'Filter pass-band lies beyond Nyquist'
)
arg_10
=
arg_8
*
arg_0
/
arg_9
return
arg_10

def Func(arg_0, arg_1, arg_2=84, arg_3=12,
                       arg_4=0.0, arg_5='hann', arg_6=1):
    r'''Return length of each filter in a constant-Q basis.

    Parameters
    ----------
    sr : number > 0 [scalar]
        Audio sampling rate

    fmin : float > 0 [scalar]
        Minimum frequency bin.

    n_bins : int > 0 [scalar]
        Number of frequencies.  Defaults to 7 octaves (84 bins).

    bins_per_octave : int > 0 [scalar]
        Number of bins per octave

    tuning : float in `[-0.5, +0.5)` [scalar]
        Tuning deviation from A440 in fractions of a bin

    window : str or callable
        Window function to use on filters

    filter_scale : float > 0 [scalar]
        Resolution of filter windows. Larger values use longer windows.

    Returns
    -------
    lengths : np.ndarray
        The length of each filter.

    Notes
    -----
    This function caches at level 10.

    See Also
    --------
    constant_q
    librosa.core.cqt
    '''

    if arg_1 <= 0:
        raise ParameterError('fmin must be positive')

    if arg_3 <= 0:
        raise ParameterError('bins_per_octave must be positive')

    if arg_6 <= 0:
        raise ParameterError('filter_scale must be positive')

    if arg_2 <= 0 or not isinstance(arg_2, int):
        raise ParameterError('n_bins must be a positive integer')

    arg_7 = 2.0**(float(arg_4) / arg_3)

    arg_1 = arg_7 * arg_1

    # Q should be capitalized here, so we suppress the name warning
    # pylint: disable=invalid-name
    arg_8 = float(arg_6) / (2.0**(1. / arg_3) - 1)

    # Compute the frequencies
    arg_9 = arg_1 * (2.0 ** (np.arange(arg_2, dtype=float) / arg_3))

    if arg_9[-1] * (1 + 0.5 * window_bandwidth(arg_5) / arg_8) > arg_0 / 2.0:
        raise ParameterError('Filter pass-band lies beyond Nyquist')

    # Convert frequencies to filter lengths
    arg_10 = arg_8 * arg_0 / arg_9

    return arg_10

r Return length of each filter in a constant - Q basis .


return {'country_code': country_code, 'region_code': region_code}

def Func(arg_0, arg_1):
        """
        Seek and return the region information.
        Returns dict containing country_code and region_code.

        :arg ipnum: Result of ip2long conversion
        """
        arg_2 = None
        arg_3 = None
        arg_4 = arg_0._seek_country(arg_1)

        def get_region_code(arg_5):
            arg_6 = chr(arg_5 // 26 + 65)
            arg_7 = chr(arg_5 % 26 + 65)
            return ''.join([arg_6, arg_7])

        if arg_0._databaseType == const.REGION_EDITION_REV0:
            arg_8 = arg_4 - const.STATE_BEGIN_REV0
            if arg_8 >= 1000:
                arg_3 = 'US'
                arg_2 = get_region_code(arg_8 - 1000)
            else:
                arg_3 = const.COUNTRY_CODES[arg_8]
        elif arg_0._databaseType == const.REGION_EDITION_REV1:
            arg_8 = arg_4 - const.STATE_BEGIN_REV1
            if arg_8 < const.US_OFFSET:
                pass
            elif arg_8 < const.CANADA_OFFSET:
                arg_3 = 'US'
                arg_2 = get_region_code(arg_8 - const.US_OFFSET)
            elif arg_8 < const.WORLD_OFFSET:
                arg_3 = 'CA'
                arg_2 = get_region_code(arg_8 - const.CANADA_OFFSET)
            else:
                arg_9 = (arg_8 - const.WORLD_OFFSET) // const.FIPS_RANGE
                if arg_9 < len(const.COUNTRY_CODES):
                    arg_3 = const.COUNTRY_CODES[arg_9]
        elif arg_0._databaseType in const.CITY_EDITIONS:
            arg_10 = arg_0._get_record(arg_1)
            arg_2 = arg_10.get('region_code')
            arg_3 = arg_10.get('country_code')

        return {'country_code': arg_3, 'region_code': arg_2}

Seek and return the region information . Returns dict containing country_code and region_code .


def Func ( arg_0 , arg_1 ) : if not arg_0 . properties . message_id : arg_0 . properties . message_id = str ( uuid . uuid4 ( ) ) if not arg_0 . message . annotations : arg_0 . message . annotations = { } arg_0 . message . annotations [ arg_6 . AMQPSymbol ( arg_0 . _x_OPT_SCHEDULED_ENQUEUE_TIME ) ] = arg_1

def Func(arg_0, arg_1):
        """Add a specific enqueue time to the message.

        :param Func_time: The Funcd time to enqueue the message.
        :type Func_time: ~datetime.datetime
        """
        if not arg_0.properties.message_id:
            arg_0.properties.message_id = str(uuid.uuid4())
        if not arg_0.message.annotations:
            arg_0.message.annotations = {}
        arg_0.message.annotations[arg_6.AMQPSymbol(arg_0._x_OPT_SCHEDULED_ENQUEUE_TIME)] = arg_1

Add a specific enqueue time to the message.

        :param schedule_time: The scheduled time to enqueue the message.
        :type schedule_time: ~datetime.datetime

Add a specific enqueue time to the message .


def Func(arg_0, arg_1, arg_2=True):
        """
        Load a state from storage identified by `state_id`.

        :param state_id: The state reference of what to load
        :return: The deserialized state
        :rtype: State
        """
        return arg_0._store.Func(f'{self._prefix}{state_id:08x}{self._suffix}', arg_2=arg_2)

Load a state from storage identified by state_id .


Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the screensaver method.

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

def Func(arg_0=None, arg_1=arg_2, arg_3=False):
    """
    Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the Func method.
    """
    return Giphy(arg_1=arg_1, arg_3=arg_3).Func(arg_0=arg_0)

Shorthand for creating a Giphy api wrapper with the given api key and then calling the screensaver method .


def Func ( ) : arg_0 = { } for arg_1 in list ( threading . _active . keys ( ) ) : arg_2 = threading . _active [ arg_1 ] arg_3 = arg_2 . getName ( ) if arg_3 not in list ( arg_0 . keys ( ) ) : arg_0 [ arg_3 ] = arg_1 pass pass return arg_0

def Func():
    '''Invert threading._active'''
    arg_0 = {}
    for arg_1 in list(threading._active.keys()):
        arg_2 = threading._active[arg_1]
        arg_3 = arg_2.getName()
        if arg_3 not in list(arg_0.keys()):
            arg_0[arg_3] = arg_1
            pass
        pass
    return arg_0


expression_terminal = identifier
                           | terminal
                           | option_group
                           | repetition_group
                           | grouping_group
                           | special_handling ;

return alternation([
      self.identifier,
      self.terminal,
      self.option_group,
      self.repetition_group,
      self.grouping_group,
      self.special_handling
    ])(text)

def Func(arg_0, arg_1):
    """Func = identifier
                           | terminal
                           | option_group
                           | repetition_group
                           | grouping_group
                           | special_handling ;
    """
    arg_0._attempting(arg_1)
    return alternation([
      arg_0.identifier,
      arg_0.terminal,
      arg_0.option_group,
      arg_0.repetition_group,
      arg_0.grouping_group,
      arg_0.special_handling
    ])(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = BNode ( ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . DisjunctiveLicenseSet ) arg_0 . graph . add ( arg_3 ) arg_4 = arg_0 . licenses_from_tree ( arg_1 ) for arg_5 in arg_4 : arg_6 = ( arg_2 , arg_0 . spdx_namespace . member , arg_5 ) arg_0 . graph . add ( arg_6 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return a node representing a disjunction of licenses.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.DisjunctiveLicenseSet)
        arg_0.graph.add(arg_3)
        arg_4 = arg_0.licenses_from_tree(arg_1)
        for arg_5 in arg_4:
            arg_6 = (arg_2, arg_0.spdx_namespace.member, arg_5)
            arg_0.graph.add(arg_6)
        return arg_2

Return a node representing a disjunction of licenses .


(self, major_axis : dim.Length, unit_luminosity='eps', kpc_per_arcsec=None, exposure_time=None)

def Func ( arg_0 , arg_1 : arg_2 . Length , arg_4 = 'eps' , arg_5 = None , arg_6 = None ) : if arg_0 . has_light_profile : return sum ( map ( lambda p : p . Func ( arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) , arg_0 . light_profiles ) ) else : return None

def Func(arg_0, arg_1 : arg_2.Length, arg_4='eps', arg_5=None, arg_6=None):
        """Compute the total luminosity of the galaxy's light profiles, within an ellipse of specified major axis. This
        is performed via integration of each light profile and is centred, oriented and aligned with each light
        model's individual geometry.

        See *light_profiles.luminosity_within_ellipse* for details of how this is performed.

        Parameters
        ----------
        major_axis : float
            The major-axis radius of the ellipse.
        unit_luminosity : str
            The units the luminosity is returned in (eps | counts).
        exposure_time : float
            The exposure time of the observation, which converts luminosity from electrons per second units to counts.
        """
        if arg_0.has_light_profile:
            return sum(map(lambda p: p.Func(arg_1=arg_1, arg_4=arg_4,
                                                                          arg_5=arg_5, arg_6=arg_6),
                           arg_0.light_profiles))
        else:
            return None

Compute the total luminosity of the galaxy s light profiles within an ellipse of specified major axis . This is performed via integration of each light profile and is centred oriented and aligned with each light model s individual geometry .


(self, responder, request, command, identifier)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Run the responser function. If it succeeds, add the _answer key.
        If it fails with an error known to the command, serialize the
        error.

        """
        arg_5 = defer.maybeDeferred(arg_1, **arg_2)

        def _addIdentifier(arg_6):
            """Return the response with an ``_answer`` key.

            """
            arg_6["_answer"] = arg_4
            return arg_6

        def _serializeFailure(arg_7):
            """
            If the failure is serializable by this AMP command, serialize it.
            """
            arg_8 = arg_7.trap(*arg_3.allErrors)
            arg_6 = {
                "_error_code": arg_3.allErrors[arg_8],
                "_error_description": str(arg_7.value),
                "_error": arg_4
            }
            return arg_6

        arg_5.addCallbacks(_addIdentifier, _serializeFailure)
        return arg_5

Run the responser function . If it succeeds add the _answer key . If it fails with an error known to the command serialize the error .


def Func(arg_0):
    """Given a port spec, update the hosts file specified at
    constants.HOST_PATH to contain the port mappings specified
    in the spec. Any existing Dusty configurations are replaced."""
    logging.info('Updating hosts file to match port spec')
    arg_1 = arg_0['hosts_file']
    arg_2 = config_file.read(constants.HOSTS_PATH)
    arg_3 = config_file.remove_current_dusty_config(arg_2)
    arg_4 = arg_3 + _dusty_hosts_config(arg_1)
    config_file.write(constants.HOSTS_PATH, arg_4)

Given a port spec update the hosts file specified at constants . HOST_PATH to contain the port mappings specified in the spec . Any existing Dusty configurations are replaced .


def Func(arg_0):
    """
    Return a list of zoom levels.

    Following inputs are converted:
    - int --> [int]
    - dict{min, max} --> range(min, max + 1)
    - [int] --> [int]
    - [int, int] --> range(smaller int, bigger int + 1)
    """
    if isinstance(arg_0, dict):
        if any([arg_1 not in arg_0 for arg_1 in ["min", "max"]]):
            raise MapcheteConfigError("min and max zoom required")
        arg_2 = _validate_zoom(arg_0["min"])
        arg_3 = _validate_zoom(arg_0["max"])
        if arg_2 > arg_3:
            raise MapcheteConfigError(
                "max zoom must not be smaller than min zoom")
        return list(range(arg_2, arg_3 + 1))
    elif isinstance(arg_0, list):
        if len(arg_0) == 1:
            return arg_0
        elif len(arg_0) == 2:
            arg_2, arg_3 = sorted([_validate_zoom(z) for z in arg_0])
            return list(range(arg_2, arg_3 + 1))
        else:
            return arg_0
    else:
        return [_validate_zoom(arg_0)]


def Func(arg_0, arg_1, arg_2, arg_3):
    """
      returns a tensorflow operation for computing the Region of Interest Pooling

      @arg input: feature maps on which to perform the pooling operation
      @arg rois: list of regions of interest in the format (feature map index, upper left, bottom right)
      @arg pool_width: size of the pooling sections
    """
    # TODO(maciek): ops scope
    arg_4 = Func_module.Func(arg_0, arg_1, arg_2=arg_2, arg_3=arg_3)
    arg_5, arg_6 = arg_4[0], arg_4[1]
    return arg_5


def Func(arg_0, arg_1):
        """
        Calculate the phase's magnetic contribution to heat capacity at the
        specified temperature.

        :param T: [K] temperature

        :returns: [J/mol/K] The magnetic heat capacity of the compound phase.

        Dinsdale, A. T. (1991). SGTE data for pure elements. Calphad, 15(4),
        317–425. http://doi.org/10.1016/0364-5916(91)90030-N
        """

        arg_2 = arg_1 / arg_0.Tc_mag

        if arg_2 <= 1.0:
            arg_3 = (arg_0._B_mag*(2*arg_2**3 + 2*arg_2**9/3 + 2*arg_2**15/5))/arg_0._D_mag
        else:
            arg_3 = (2*arg_2**-5 + 2*arg_2**-15/3 + 2*arg_2**-25/5)/arg_0._D_mag

        arg_4 = R*math.log(arg_0.beta0_mag + 1)*arg_3

        return arg_4

Calculate the phase s magnetic contribution to heat capacity at the specified temperature .


return 2*_sltr.GeV2joule(self.E)*_spc.epsilon_0 / (self.beta*_spc.elementary_charge)**2

def Func ( arg_0 ) : return 2 * _sltr . GeV2joule ( arg_0 . E ) * _spc . epsilon_0 / ( arg_0 . beta * _spc . elementary_charge ) ** 2

def Func(arg_0):
        """
        The plasma density in SI units.
        """
        return 2*_sltr.GeV2joule(arg_0.E)*_spc.epsilon_0 / (arg_0.beta*_spc.elementary_charge)**2


def Func ( arg_0 , arg_1 = None ) : for arg_2 in arg_0 . children ( arg_1 , reverse = True ) : return arg_2

def Func(arg_0, arg_1=None):
        """
        Returns the Func child of this node.

        :param name: If specified, only consider elements with this tag name
        :rtype: :class:`XmlElement`
        """
        for arg_2 in arg_0.children(arg_1, reverse=True):
            return arg_2

Returns the last child of this node.

        :param name: If specified, only consider elements with this tag name
        :rtype: :class:`XmlElement`


(self, instance, database, project_id=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Deletes a database from a Cloud SQL instance.

        :param instance: Database instance ID. This does not include the project ID.
        :type instance: str
        :param database: Name of the database to be deleted in the instance.
        :type database: str
        :param project_id: Project ID of the project that contains the instance. If set
            to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """
        arg_4 = arg_0.get_conn().databases().delete(
            project=arg_3,
            arg_1=arg_1,
            arg_2=arg_2
        ).execute(num_retries=arg_0.num_retries)
        arg_5 = arg_4["name"]
        arg_0._wait_for_operation_to_complete(arg_3=arg_3,
                                             arg_5=arg_5)

Deletes a database from a Cloud SQL instance .


def Func(arg_0, arg_1):
        """Copy an existing notebook and return its notebook_id."""
        arg_2, arg_3 = arg_0.get_notebook_object(arg_1)
        arg_4 = arg_3.metadata.name + '-Copy'
        arg_5, arg_4 = arg_0.increment_filename(arg_4)
        arg_3.metadata.name = arg_4
        arg_1 = arg_0.new_notebook_id(arg_4)
        arg_0.save_notebook_object(arg_1, arg_3)
        return arg_1

Copy an existing notebook and return its notebook_id .


def Func(arg_0, arg_1, arg_2):
        """ Adds genomic coordinated-related filters to the query object

        Args:
            query(dict): a dictionary of query filters specified by the users
            mongo_query(dict): the query that is going to be submitted to the database

        Returns:
            mongo_query(dict): returned object contains coordinate filters

        """
        LOG.debug('Adding genomic coordinates to the query')
        arg_3 = arg_1['chrom']
        arg_2['chromosome'] = arg_3

        if (arg_1.get('start') and arg_1.get('end')):
            arg_2['position'] = {'$lte': int(arg_1['end'])}
            arg_2['end'] = {'$gte': int(arg_1['start'])}

        return arg_2

Adds genomic coordinated - related filters to the query object


def Func ( arg_0 , arg_1 ) : arg_2 = set_mkl_thread_limit ( 1 ) with h5py . File ( arg_0 . database . input , 'r' ) as io5 : arg_3 = io5 [ "bootsarr" ] [ : ] arg_4 = io5 [ "bootsmap" ] [ : , 0 ] arg_5 = io5 [ "quartets" ] [ arg_1 : arg_1 + arg_0 . _chunksize ] arg_6 = arg_3 [ : ] == 78 arg_7 = np . zeros ( ( arg_5 . shape [ 0 ] , 4 ) , dtype = np . uint16 ) arg_8 = np . zeros ( ( arg_5 . shape [ 0 ] , 16 , 16 ) , dtype = np . uint16 ) for arg_9 in xrange ( arg_5 . shape [ 0 ] ) : arg_10 = arg_5 [ arg_9 ] arg_11 = arg_3 [ arg_10 ] arg_12 = np . any ( arg_6 [ arg_10 ] , axis = 0 ) arg_12 += np . all ( arg_11 == arg_11 [ 0 ] , axis = 0 ) arg_13 , arg_14 = calculate ( arg_11 , arg_4 , arg_12 , TESTS ) arg_7 [ arg_9 ] = arg_5 [ arg_9 ] [ arg_13 ] arg_8 [ arg_9 ] = arg_14 set_mkl_thread_limit ( arg_2 ) return arg_7 , arg_8

def Func(arg_0, arg_1):
    """
    Worker to distribute work to jit funcs. Wraps everything on an
    engine to run single-threaded to maximize efficiency for
    multi-processing.
    """

    ## set the thread limit on the remote engine
    arg_2 = set_mkl_thread_limit(1)

    ## open seqarray view, the modified arr is in bootstarr
    with h5py.File(arg_0.database.input, 'r') as io5:
        arg_3 = io5["bootsarr"][:]
        arg_4 = io5["bootsmap"][:, 0]
        arg_5 = io5["quartets"][arg_1:arg_1+arg_0._chunksize]

        ## create an N-mask array of all seq cols
        arg_6 = arg_3[:] == 78

    ## init arrays to fill with results
    arg_7 = np.zeros((arg_5.shape[0], 4), dtype=np.uint16)
    arg_8 = np.zeros((arg_5.shape[0], 16, 16), dtype=np.uint16)

    ## fill arrays with results as we compute them. This iterates
    ## over all of the quartet sets in this sample chunk. It would
    ## be nice to have this all numbified.
    for arg_9 in xrange(arg_5.shape[0]):
        arg_10 = arg_5[arg_9]
        arg_11 = arg_3[arg_10]

        ## these axis calls cannot be numbafied, but I can't
        ## find a faster way that is JIT compiled, and I've
        ## really, really, really tried. Tried again now that
        ## numba supports axis args for np.sum. Still can't
        ## get speed improvements by numbifying this loop.
        arg_12 = np.any(arg_6[arg_10], axis=0)
        arg_12 += np.all(arg_11 == arg_11[0], axis=0)

        ## here are the jitted funcs
        arg_13, arg_14 = calculate(arg_11, arg_4, arg_12, TESTS)

        ## store results
        arg_7[arg_9] = arg_5[arg_9][arg_13]
        arg_8[arg_9] = arg_14

    ## reset thread limit
    set_mkl_thread_limit(arg_2)

    ## return results...
    return arg_7, arg_8

Worker to distribute work to jit funcs . Wraps everything on an engine to run single - threaded to maximize efficiency for multi - processing .


def Func(arg_0):
        """Checks if we can create the project"""
        # Check for python module collision
        arg_0.try_import(arg_0.project_name)

        # Is the name a valid identifier?
        arg_0.validate_name(arg_0.project_name)

        # Make sure we don't mess with existing directories
        if os.path.exists(arg_0.project_name):
            print("Directory {} already exist. Aborting.".format(arg_0.project_name))
            return False

        if os.path.exists('manage.py'):
            print("A manage.py file already exist in the current directory. Aborting.")
            return False

        return True


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 . shape [ 0 ] arg_5 = np . mean ( np . square ( arg_1 [ 0 : arg_3 ] ) . mean ( axis = 1 ) . T . view ( ) - np . square ( arg_1 [ 0 : arg_3 ] . mean ( axis = 1 ) ) . T . view ( ) ) arg_6 = np . square ( arg_2 ) . sum ( axis = 1 ) / arg_3 arg_7 = arg_4 * arg_5 * arg_6 / arg_3 arg_8 = arg_0 - arg_7 return arg_8

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Helper functions that implements bias correction

    Parameters
    ----------
    V_IJ : ndarray
        Intermediate result in the computation.

    inbag : ndarray
        The inbag matrix that fit the data. If set to `None` (default) it
        will be inferred from the forest. However, this only works for trees
        for which bootstrapping was set to `True`. That is, if sampling was
        done with replacement. Otherwise, users need to provide their own
        inbag matrix.

    pred_centered : ndarray
        Centered predictions that are an intermediate result in the
        computation.

    n_trees : int
        The number of trees in the forest object.
    """
    arg_4 = arg_1.shape[0]
    arg_5 = np.mean(np.square(arg_1[0:arg_3]).mean(axis=1).T.view() -
                    np.square(arg_1[0:arg_3].mean(axis=1)).T.view())
    arg_6 = np.square(arg_2).sum(axis=1) / arg_3
    arg_7 = arg_4 * arg_5 * arg_6 / arg_3
    arg_8 = arg_0 - arg_7
    return arg_8


def Func(arg_0, arg_1, arg_2, arg_3):
        """Handle DELETE deposit file.

        Permission required: `update_permission_factory`.

        :param pid: Pid object (from url).
        :param record: Record object resolved from the pid.
        :param key: Unique identifier for the file in the deposit.
        """
        try:
            del arg_2.files[str(arg_3)]
            arg_2.commit()
            db.session.commit()
            return make_response('', 204)
        except KeyError:
            abort(404, 'The specified object does not exist or has already '
                  'been Funcd.')


(x0, y0, t0, t1, s0, c0, flip, cs, ss, cmd)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):

    """ Raph Levien's code draws fast LINETO segments.
    """

    for arg_10 in range(0, 100):
        arg_11 = arg_10 * .01
        arg_12, arg_13 = eval_cornu(arg_2 + arg_11 * (arg_3 - arg_2))
        arg_12 *= arg_6
        arg_12 -= arg_4
        arg_13 -= arg_5
        #print '%', c, s
        arg_14 = arg_13 * arg_7 - arg_12 * arg_8
        arg_15 = arg_12 * arg_7 + arg_13 * arg_8
        print_pt(arg_0 + arg_14, arg_1 + arg_15, arg_9)
        arg_9 = 'lineto'
    return arg_9

Raph Levien s code draws fast LINETO segments .


def
Func
(
arg_0
,
arg_1
=
,
**
arg_2
)
:
if
arg_1
is
:
arg_1
=
plt
.
gca
(
)
arg_3
=
FuncFormatter
(
utils
.
percentage
)
arg_1
.
xaxis
.
set_major_formatter
(
FuncFormatter
(
arg_3
)
)
arg_1
.
tick_params
(
axis
=
'x'
,
which
=
'major'
)
arg_4
=
pd
.
DataFrame
(
ep
.
aggregate_returns
(
arg_0
,
'yearly'
)
)
arg_1
.
axvline
(
100
*
arg_4
.
values
.
mean
(
)
,
color
=
'steelblue'
,
linestyle
=
'--'
,
lw
=
4
,
alpha
=
0.7
)
(
100
*
arg_4
.
sort_index
(
ascending
=
False
)
)
.
plot
(
arg_1
=
arg_1
,
kind
=
'barh'
,
alpha
=
0.70
,
**
arg_2
)
arg_1
.
axvline
(
0.0
,
color
=
'black'
,
linestyle
=
'-'
,
lw
=
3
)
arg_1
.
set_ylabel
(
'Year'
)
arg_1
.
set_xlabel
(
'Returns'
)
arg_1
.
set_title
(
"Annual returns"
)
arg_1
.
legend
(
[
'Mean'
]
,
frameon
=
True
,
framealpha
=
0.5
)
return
arg_1

def Func(arg_0, arg_1=None, **arg_2):
    """
    Plots a bar graph of returns by year.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_1 is None:
        arg_1 = plt.gca()

    arg_3 = FuncFormatter(utils.percentage)
    arg_1.xaxis.set_major_formatter(FuncFormatter(arg_3))
    arg_1.tick_params(axis='x', which='major')

    arg_4 = pd.DataFrame(
        ep.aggregate_returns(
            arg_0,
            'yearly'))

    arg_1.axvline(
        100 *
        arg_4.values.mean(),
        color='steelblue',
        linestyle='--',
        lw=4,
        alpha=0.7)
    (100 * arg_4.sort_index(ascending=False)
     ).plot(arg_1=arg_1, kind='barh', alpha=0.70, **arg_2)
    arg_1.axvline(0.0, color='black', linestyle='-', lw=3)

    arg_1.set_ylabel('Year')
    arg_1.set_xlabel('Returns')
    arg_1.set_title("Annual returns")
    arg_1.legend(['Mean'], frameon=True, framealpha=0.5)
    return arg_1


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/ConferenceUndeaf/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Conference Undeaf helper
        """
        arg_2 = '/' + arg_0.api_version + '/ConferenceUndeaf/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0):
        """
        Returns the darkest color from the list.

        Knowing the contrast between a light and a dark swatch
        can help us decide how to display readable typography.

        """
        arg_1, arg_2 = (1.0, 1.0, 1.0), 3.0
        for arg_3 in arg_0:
            if arg_3.r + arg_3.g + arg_3.b < arg_2:
                arg_1, arg_2 = arg_3, arg_3.r + arg_3.g + arg_3.b

        return arg_1

Returns the darkest color from the list .


def
Func
(
arg_0
)
:
arg_1
=
1
try
:
arg_2
=
open
(
arg_0
,
"r"
)
arg_2
.
close
(
)
except
:
arg_1
=
sys
.
stderr
.
write
(
arg_0
+
" couldn't be accessed\n"
)
return
arg_1

def  Func( arg_0 ):
    """checks that a given file exists"""
    arg_1 = 1
    try:
        arg_2 = open( arg_0, "r" )
        arg_2.close()
    except:
        arg_1 = None
        sys.stderr.write( arg_0 + " couldn't be accessed\n" )

    return arg_1


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 . _get_schema_folder ( ) , "examples" , "invalid" ) return list ( _get_json_content_from_folder ( arg_1 ) )

def Func(arg_0):
        """Return a list of examples which violate the schema."""
        arg_1 = os.path.join(arg_0._get_schema_folder(), "examples", "invalid")
        return list(_get_json_content_from_folder(arg_1))

Return a list of examples which violate the schema .


def Func(arg_0, arg_1):
    """
    Calculates string edit distance between string 1 and string 2.
    Deletion, insertion, substitution, and transposition all increase edit distance.
    """
    arg_2 = {}
    arg_3 = len(arg_0)
    arg_4 = len(arg_1)
    for arg_5 in xrange(-1, arg_3 + 1):
        arg_2[(arg_5, -1)] = arg_5 + 1
    for arg_6 in xrange(-1, arg_4 + 1):
        arg_2[(-1, arg_6)] = arg_6 + 1

    for arg_5 in xrange(arg_3):
        for arg_6 in xrange(arg_4):
            if arg_0[arg_5] == arg_1[arg_6]:
                arg_7 = 0
            else:
                arg_7 = 1
            arg_2[(arg_5, arg_6)] = min(
                arg_2[(arg_5 - 1, arg_6)] + 1, # deletion
                arg_2[(arg_5, arg_6 - 1)] + 1, # insertion
                arg_2[(arg_5 - 1, arg_6 - 1)] + arg_7, # substitution
            )
            if arg_5 and arg_6 and arg_0[arg_5] == arg_1[arg_6 - 1] and arg_0[arg_5 - 1] == arg_1[arg_6]:
                arg_2[(arg_5, arg_6)] = min(arg_2[(arg_5, arg_6)], arg_2[arg_5 - 2, arg_6 - 2] + arg_7) # transposition

    return arg_2[arg_3 - 1, arg_4 - 1]

Calculates string edit distance between string 1 and string 2 . Deletion insertion substitution and transposition all increase edit distance .


def Func ( arg_0 ) : arg_1 = "{}{}" . format ( os . urandom ( 32 ) , time . time ( ) ) arg_2 = generate_key ( ensure_bytes ( arg_1 ) ) with open ( arg_0 , "wb" ) as f : f . write ( base64 . b64encode ( arg_2 ) ) os . chmod ( arg_0 , 0o400 )

def Func(arg_0):
    """
    Creates a new encryption key in the path provided and sets the file
    permissions.  Setting the file permissions currently does not work
    on Windows platforms because of the differences in how file
    permissions are read and modified.
    """
    arg_1 = "{}{}".format(os.urandom(32), time.time())
    arg_2 = generate_key(ensure_bytes(arg_1))
    with open(arg_0, "wb") as f:
        f.write(base64.b64encode(arg_2))
    os.chmod(arg_0, 0o400)

Creates a new encryption key in the path provided and sets the file permissions . Setting the file permissions currently does not work on Windows platforms because of the differences in how file permissions are read and modified .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
list_id
=
arg_1
if
'name'
not
in
arg_2
:
raise
KeyError
(
'The list merge field must have a name'
)
if
'type'
not
in
arg_2
:
raise
KeyError
(
'The list merge field must have a type'
)
arg_3
=
arg_0
.
_mc_client
.
_post
(
url
=
arg_0
.
_build_path
(
arg_1
,
'merge-fields'
)
,
arg_2
=
arg_2
)
if
arg_3
is
not
:
arg_0
.
merge_id
=
arg_3
[
'merge_id'
]
else
:
arg_0
.
merge_id
=
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Add a new merge field for a specific list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "type": string*
        }
        """
        arg_0.list_id = arg_1
        if 'name' not in arg_2:
            raise KeyError('The list merge field must have a name')
        if 'type' not in arg_2:
            raise KeyError('The list merge field must have a type')
        arg_3 = arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'merge-fields'), arg_2=arg_2)
        if arg_3 is not None:
            arg_0.merge_id = arg_3['merge_id']
        else:
            arg_0.merge_id = None
        return arg_3

Add a new merge field for a specific list .


def Func(arg_0, arg_1):
        """Validates a VLAN ID.

        :param value: The VLAN ID to Func against.
        :raises TagValidationError: Raised if the VLAN ID is invalid.
        """
        try:
            arg_2 = int(arg_1)
            assert arg_2 >= arg_0.MIN_VLAN_ID
            assert arg_2 <= arg_0.MAX_VLAN_ID
        except Exception:
            arg_3 = ("Invalid vlan_id. Got '%(vlan_id)s'. "
                   "vlan_id should be an integer between %(min)d and %(max)d "
                   "inclusive." % {'vlan_id': arg_1,
                                   'min': arg_0.MIN_VLAN_ID,
                                   'max': arg_0.MAX_VLAN_ID})
            raise TagValidationError(arg_1, arg_3)
        return True

Validates a VLAN ID.

        :param value: The VLAN ID to validate against.
        :raises TagValidationError: Raised if the VLAN ID is invalid.


def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return [ ] arg_1 = arg_0 . getModel ( ) return arg_1 . Funcr . Func ( arg_0 )

def Func(arg_0):
		'''
			Func - Save all objects in this list
		'''
		if len(arg_0) == 0:
			return []
		arg_1 = arg_0.getModel()
		return arg_1.Funcr.Func(arg_0)


def Func(arg_0, arg_1):
    """Checks if file already exists and ask the user if it should
    be overwritten if it does."""

    log.debug("Checking file output")

    if os.path.isfile(arg_0) and not arg_1:
        if sys.stdin.isatty():
            arg_2 = console.ask("File {0} already exists! Overwrite it? [y/N] ",
                                 arg_0)

            if arg_2.lower() != "y":
                sys.exit()
        else:
            log.error("File {0} already exists, use --force to overwrite it.".format(arg_0))
            sys.exit()

    return FileOutput(arg_0)

Checks if file already exists and ask the user if it should be overwritten if it does .


return '{}/{}{}'.format(instance_id_hash, filename_hash, ext)

def Func ( arg_0 , arg_1 ) : arg_1 , arg_2 = os . path . splitext ( arg_1 . lower ( ) ) arg_3 = hashlib . md5 ( str ( arg_0 . id ) ) . hexdigest ( ) arg_4 = '' . join ( random . sample ( hashlib . md5 ( arg_1 . encode ( 'utf-8' ) ) . hexdigest ( ) , 8 ) ) return '{}/{}{}' . format ( arg_3 , arg_4 , arg_2 )

def Func(arg_0, arg_1):
    """Generates likely unique image path using md5 hashes"""
    arg_1, arg_2 = os.path.splitext(arg_1.lower())
    arg_3 = hashlib.md5(str(arg_0.id)).hexdigest()
    arg_4 = ''.join(random.sample(hashlib.md5(arg_1.encode('utf-8')).hexdigest(), 8))
    return '{}/{}{}'.format(arg_3, arg_4, arg_2)


def Func(arg_0, arg_1, arg_2):
        """Add a control-number 00x for given tag with value."""
        record_add_field(arg_0.record,
                         arg_1,
                         controlfield_value=arg_2)

Add a control - number 00x for given tag with value .


(window, n, slope=1.0, angle=None, zero_mean=False)

def Func ( arg_0 , arg_1 , arg_2 = 1.0 , arg_3 = None , arg_4 = False ) : if arg_3 is None : arg_3 = np . arctan ( arg_2 ) arg_5 = np . diag ( get_window ( arg_0 , arg_1 , fftbins = False ) ) if not np . isclose ( arg_3 , np . pi / 4 ) : arg_5 = scipy . ndimage . rotate ( arg_5 , 45 - arg_3 * 180 / np . pi , order = 5 , prefilter = False ) np . clip ( arg_5 , 0 , None , out = arg_5 ) arg_5 /= arg_5 . sum ( ) if arg_4 : arg_5 -= arg_5 . mean ( ) return arg_5

def Func(arg_0, arg_1, arg_2=1.0, arg_3=None, arg_4=False):
    '''Build a two-dimensional diagonal filter.

    This is primarily used for smoothing recurrence or self-similarity matrices.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        The window function to use for the filter.

        See `get_window` for details.

        Note that the window used here should be non-negative.

    n : int > 0
        the length of the filter

    slope : float
        The slope of the diagonal filter to produce

    angle : float or None
        If given, the slope parameter is ignored,
        and angle directly sets the orientation of the filter (in radians).
        Otherwise, angle is inferred as `arctan(slope)`.

    zero_mean : bool
        If True, a zero-mean filter is used.
        Otherwise, a non-negative averaging filter is used.

        This should be enabled if you want to enhance paths and suppress
        blocks.

    Returns
    -------
    kernel : np.ndarray, shape=[(m, m)]
        The 2-dimensional filter kernel

    Notes
    -----
    This function caches at level 10.
    '''

    if arg_3 is None:
        arg_3 = np.arctan(arg_2)

    arg_5 = np.diag(get_window(arg_0, arg_1, fftbins=False))

    if not np.isclose(arg_3, np.pi/4):
        arg_5 = scipy.ndimage.rotate(arg_5, 45 - arg_3 * 180 / np.pi,
                                   order=5, prefilter=False)

    np.clip(arg_5, 0, None, out=arg_5)
    arg_5 /= arg_5.sum()

    if arg_4:
        arg_5 -= arg_5.mean()

    return arg_5

Build a two - dimensional diagonal filter .