Question: A helper function that decorates a function to retain the current request context . This is useful when working with greenlets . The moment the function is decorated a copy of the request context is created and then pushed when the function is called .

def Func ( arg_0 ) : arg_1 = _request_ctx_stack . top if arg_1 is None : raise RuntimeError ( 'This decorator can only be used at local scopes ' 'when a request context is on the stack.  For instance within ' 'view functions.' ) arg_2 = arg_1 . copy ( ) def wrapper ( * arg_3 , ** arg_4 ) : with arg_2 : return arg_0 ( * arg_3 , ** arg_4 ) return update_wrapper ( wrapper , arg_0 )

Add a node to run on failure.

        =====API DOCS=====
        Add a node to run on failure.

        :param parent: Primary key of parent node to associate failure node to.
        :type parent: int
        :param child: Primary key of child node to be associated.
        :type child: int
        :param `**kwargs`: Fields used to create child node if ``child`` is not provided.
        :returns: Dictionary of only one key "changed", which indicates whether the association succeeded.
        :rtype: dict

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


Question: Set input values on task

def Func ( arg_0 , ** arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : if hasattr ( arg_3 , 'value' ) : arg_3 = arg_3 . value arg_0 . inputs . __Funcattr__ ( arg_2 , arg_3 )

Returns a decorator to swallow a requests exception for modules that
        are not accessible without logging in, and turn it into an Unavailable
        exception.


Question: Prune the cache

def Func ( ) : arg_0 = folders . cacheDirectory ( ) def fullpath ( arg_1 ) : return os . path . join ( arg_0 , arg_1 ) def getMTimeSafe ( arg_1 ) : try : return os . stat ( arg_1 ) . st_mtime except FileNotFoundError : import time return time . clock ( ) fsutils . mkDirP ( arg_0 ) arg_2 = getMaxCachedModules ( ) for arg_1 in sorted ( [ arg_1 for arg_1 in os . listdir ( arg_0 ) if os . path . isfile ( fullpath ( arg_1 ) ) and not arg_1 . endswith ( '.json' ) and not arg_1 . endswith ( '.locked' ) ] , key = lambda arg_1 : getMTimeSafe ( fullpath ( arg_1 ) ) , reverse = True ) [ arg_2 : ] : cache_logger . debug ( 'cleaning up cache file %s' , arg_1 ) removeFromCache ( arg_1 ) cache_logger . debug ( 'cache pruned to %s items' , arg_2 )

Send data synchronous to an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: PLC storage address
    :param value: value to write to the storage address of the PLC
    :param Type data_type: type of the data given to the PLC,
        according to PLCTYPE constants


Question: Return a rasterio . io . MemoryFile instance from input .

def Func ( arg_0 = None , arg_1 = None ) : arg_2 = MemoryFile ( ) arg_1 . update ( width = arg_0 . shape [ - 2 ] , height = arg_0 . shape [ - 1 ] ) with arg_2 . open ( ** arg_1 ) as dataset : dataset . write ( arg_0 ) return arg_2

Checks to see if Spark worker and HDFS datanode are still running.


Question: This drives the overall parallel period processing for a list of LCs .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = 'hat-sql' , arg_6 = None , arg_7 = ( 'gls' , 'pdm' , 'mav' , 'win' ) , arg_8 = ( { } , { } , { } , { } ) , arg_9 = 10.0 , arg_10 = False , arg_11 = arg_12 , arg_13 = 1 , arg_14 = None , arg_15 = None , arg_16 = 500 , arg_17 = True ) : if not os . path . exists ( arg_1 ) : os . makedirs ( arg_1 ) if ( arg_14 is not None ) and ( arg_15 is None ) : arg_0 = arg_0 [ arg_14 : ] elif ( arg_14 is None ) and ( arg_15 is not None ) : arg_0 = arg_0 [ : arg_15 ] elif ( arg_14 is not None ) and ( arg_15 is not None ) : arg_0 = arg_0 [ arg_14 : arg_14 + arg_15 ] arg_18 = [ ( x , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_10 , arg_9 , arg_11 , arg_16 , arg_17 ) for x in arg_0 ] with ProcessPoolExecutor ( max_workers = arg_13 ) as executor : arg_19 = executor . map ( _runpf_worker , arg_18 ) arg_20 = [ x for x in arg_19 ] return arg_20

Checks if a key exists in a bucket

        :param key: S3 key that will point to the file
        :type key: str
        :param bucket_name: Name of the bucket in which the file is stored
        :type bucket_name: str


Question: Decorator that converts arguments via annotations .

def Func ( arg_0 ) : arg_1 = inspect . signature ( arg_0 ) . parameters . items ( ) @ wraps ( arg_0 ) def wrapper ( * arg_2 , ** arg_3 ) : arg_2 = list ( arg_2 ) arg_4 = [ ] arg_5 = { } for arg_6 , arg_7 in arg_1 : arg_8 = arg_7 . annotation if arg_8 is inspect . _empty : arg_8 = lambda arg_10 : arg_10 if arg_7 . kind is arg_7 . POSITIONAL_OR_KEYWORD : if arg_2 : arg_9 = arg_2 . pop ( 0 ) arg_4 . append ( arg_8 ( arg_9 ) ) elif arg_7 . kind is arg_7 . VAR_POSITIONAL : for arg_10 in arg_2 : arg_4 . append ( arg_8 ( arg_10 ) ) else : for arg_11 , arg_12 in arg_3 . items ( ) : arg_13 , arg_14 = arg_8 ( arg_11 , arg_12 ) arg_5 [ arg_13 ] = arg_14 return arg_0 ( * arg_4 , ** arg_5 ) return wrapper

Return the generation index of the first generation in the given
    swarm that does not have numParticles particles in it, either still in the
    running state or completed. This does not include orphaned particles.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:  A string representation of the sorted list of encoders in this
                 swarm. For example '__address_encoder.__gym_encoder'
    minNumParticles: minium number of partices required for a full
                  generation.

    retval:  generation index, or None if no particles at all.


Question: stpd generation using Stepper class

def Func ( arg_0 ) : arg_0 . log . info ( "Making stpd-file: %s" , arg_0 . stpd ) arg_1 = Stepper ( arg_0 . core , rps_schedule = arg_0 . load_profile . schedule if arg_0 . load_profile . is_rps ( ) else None , http_ver = arg_0 . http_ver , ammo_file = arg_0 . ammo_file , instances_schedule = arg_0 . load_profile . schedule if arg_0 . load_profile . is_instances ( ) else None , instances = arg_0 . instances , loop_limit = arg_0 . loop_limit , ammo_limit = arg_0 . ammo_limit , uris = arg_0 . uris , headers = [ header . strip ( '[]' ) for header in arg_0 . headers ] , autocases = arg_0 . autocases , enum_ammo = arg_0 . enum_ammo , ammo_type = arg_0 . ammo_type , chosen_cases = arg_0 . chosen_cases , use_cache = arg_0 . use_caching ) with open ( arg_0 . stpd , 'w' , arg_0 . file_cache ) as os : arg_1 . write ( os )

Query the Hub's TaskRecord database

        This will return a list of task record dicts that match `query`

        Parameters
        ----------

        query : mongodb query dict
            The search dict. See mongodb query docs for details.
        keys : list of strs [optional]
            The subset of keys to be returned.  The default is to fetch everything but buffers.
            'msg_id' will *always* be included.


Question: Return all tags with the given name .

def Func ( arg_0 , arg_1 = None ) -> List [ 'Tag' ] : arg_2 = arg_0 . _lststr arg_3 = arg_0 . _type_to_spans if arg_1 : if arg_1 in _tag_extensions : arg_4 = arg_2 [ 0 ] return [ Tag ( arg_2 , arg_3 , arg_5 , 'ExtensionTag' ) for arg_5 in arg_3 [ 'ExtensionTag' ] if arg_4 . startswith ( '<' + arg_1 , arg_5 [ 0 ] ) ] Func = [ ] else : Func = [ Tag ( arg_2 , arg_3 , arg_5 , 'ExtensionTag' ) for arg_5 in arg_3 [ 'ExtensionTag' ] ] arg_7 = Func . append arg_8 = arg_0 . _span [ 0 ] arg_9 = arg_0 . _shadow if arg_1 : arg_10 = reversed ( [ m for m in regex_compile ( START_TAG_PATTERN . replace ( rb'{name}' , rb'(?P<name>' + arg_1 . encode ( ) + rb')' ) ) . finditer ( arg_9 ) ] ) arg_11 = regex_compile ( END_TAG_PATTERN . replace ( b'{name}' , arg_1 . encode ( ) ) ) . search else : arg_10 = reversed ( [ m for m in START_TAG_FINDITER ( arg_9 ) ] ) arg_12 = arg_9 [ : ] arg_13 = arg_3 . setdefault ( 'Tag' , [ ] ) arg_14 = { ( arg_17 [ 0 ] , arg_17 [ 1 ] ) : arg_17 for arg_17 in arg_13 } . get arg_15 = arg_13 . append for arg_16 in arg_10 : if arg_16 [ 'self_closing' ] : arg_17 , arg_18 = arg_16 . span ( ) arg_5 = [ arg_8 + arg_17 , arg_8 + arg_18 ] else : if arg_1 : arg_19 = arg_11 ( arg_12 , arg_16 . end ( ) ) else : arg_19 = search ( END_TAG_PATTERN . replace ( b'{name}' , arg_16 [ 'name' ] ) , arg_12 ) if arg_19 : arg_17 , arg_18 = arg_19 . span ( ) arg_12 [ arg_17 : arg_18 ] = b'_' * ( arg_18 - arg_17 ) arg_5 = [ arg_8 + arg_16 . start ( ) , arg_8 + arg_18 ] else : arg_17 , arg_18 = arg_16 . span ( ) arg_5 = [ arg_8 + arg_17 , arg_8 + arg_18 ] arg_20 = arg_14 ( ( arg_5 [ 0 ] , arg_5 [ 1 ] ) ) if arg_20 is None : arg_15 ( arg_5 ) else : arg_5 = arg_20 arg_7 ( Tag ( arg_2 , arg_3 , arg_5 , 'Tag' ) ) return sorted ( Func , key = attrgetter ( '_span' ) )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

    task : tuple
        This is used to pass args to the `periodicvar_recovery` function::

            task[0] = period-finding result pickle to work on
            task[1] = simbasedir
            task[2] = period_tolerance

    Returns
    -------

    dict
        This is the dict produced by the `periodicvar_recovery` function for the
        input period-finding result pickle.


Question: Shift Packed Data Right Logical

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . read ( ) arg_3 = Operators . ITEBV ( arg_2 . size , Operators . UGT ( arg_3 , 63 ) , 64 , arg_3 ) arg_3 = Operators . EXTRACT ( arg_3 , 0 , 64 ) if arg_1 . size == 64 : arg_1 . write ( arg_1 . read ( ) >> arg_3 ) else : arg_4 = Operators . EXTRACT ( arg_1 . read ( ) , 64 , 64 ) >> arg_3 arg_5 = Operators . EXTRACT ( arg_1 . read ( ) , 0 , 64 ) >> arg_3 arg_1 . write ( Operators . CONCAT ( 128 , arg_4 , arg_5 ) )

Dump a PKCS12 object as a string.

        For more information, see the :c:func:`PKCS12_create` man page.

        :param passphrase: The passphrase used to encrypt the structure. Unlike
            some other passphrase arguments, this *must* be a string, not a
            callback.
        :type passphrase: :py:data:`bytes`

        :param iter: Number of times to repeat the encryption step.
        :type iter: :py:data:`int`

        :param maciter: Number of times to repeat the MAC step.
        :type maciter: :py:data:`int`

        :return: The string representation of the PKCS #12 structure.
        :rtype:


Question: Decorator for making functions appear as interactively defined .

def Func ( arg_0 ) : if isinstance ( arg_0 , FunctionType ) : arg_1 = __import__ ( '__main__' ) arg_0 = FunctionType ( arg_0 . __code__ , arg_1 . __dict__ , arg_0 . __name__ , arg_0 . __defaults__ , ) arg_0 . __module__ = '__main__' return arg_0

Randomly crop an image and corresponding keypoints without influence scales, given by ``keypoint_random_resize_shortestedge``.

    Parameters
    -----------
    image : 3 channel image
        The given image for augmentation.
    annos : list of list of floats
        The keypoints annotation of people.
    mask : single channel image or None
        The mask if available.
    size : tuple of int
        The size of returned image.

    Returns
    ----------
    preprocessed image, annotation, mask


Question: Signs the inputs starting at the specified index .

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_1 . hash : raise with_context ( exc = ValueError ( 'Cannot sign inputs without a bundle hash!' ) , context = { 'bundle' : arg_1 , 'key_index' : arg_0 . key_index , 'start_index' : arg_2 , } , ) from iota . crypto . signing import SignatureFragmentGenerator arg_3 = ( SignatureFragmentGenerator ( arg_0 , arg_1 . hash ) ) for arg_4 in range ( arg_0 . security_level ) : try : arg_5 = arg_1 [ arg_2 + arg_4 ] except IndexError as e : raise with_context ( exc = e , context = { 'bundle' : arg_1 , 'key_index' : arg_0 . key_index , 'current_index' : arg_2 + arg_4 , } , ) if arg_5 . value > 0 : raise with_context ( exc = ValueError ( 'Attempting to sign non-input transaction #{i} ' '(value={value}).' . format ( i = arg_5 . current_index , value = arg_5 . value , ) , ) , context = { 'bundle' : arg_1 , 'key_index' : arg_0 . key_index , 'start_index' : arg_2 , } , ) if arg_5 . signature_message_fragment : raise with_context ( exc = ValueError ( 'Attempting to sign input transaction #{i}, ' 'but it has a non-empty fragment ' '(is it already signed?).' . format ( i = arg_5 . current_index , ) , ) , context = { 'bundle' : arg_1 , 'key_index' : arg_0 . key_index , 'start_index' : arg_2 , } , ) arg_5 . signature_message_fragment = next ( arg_3 )

Registers metrics to context

    :param context: Topology Context


Question: Scan for concrete bytes in all mapped memory . Successively yield addresses of all matches .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , bytes ) : arg_1 = [ bytes ( [ c ] ) for c in arg_1 ] for arg_2 in sorted ( arg_0 . maps ) : for arg_3 in arg_2 : if arg_3 + len ( arg_1 ) >= arg_2 . end : break arg_4 = arg_2 [ arg_3 : arg_3 + len ( arg_1 ) ] if issymbolic ( arg_4 [ 0 ] ) : break if arg_4 == arg_1 : yield arg_3

r'''Method to calculate pressure-dependent gas viscosity
        at temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate gas viscosity, [K]
        P : float
            Pressure at which to calculate gas viscosity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        mu : float
            Viscosity of the gas at T and P, [Pa*]


Question: Load a constraint satisfaction problem from a . cnf file .

def Func ( arg_0 ) : arg_0 = iter ( arg_0 ) arg_1 = ConstraintSatisfactionProblem ( dimod . BINARY ) arg_2 = arg_8 = 0 arg_3 = re . compile ( _PROBLEM_REGEX ) for arg_4 in arg_0 : arg_5 = arg_3 . findall ( arg_4 ) if arg_5 : if len ( arg_5 ) > 1 : raise ValueError arg_6 , arg_7 = arg_5 [ 0 ] arg_8 , arg_2 = int ( arg_6 ) , int ( arg_7 ) break arg_9 = re . compile ( _CLAUSE_REGEX ) for arg_4 in arg_0 : if arg_9 . match ( arg_4 ) is not None : arg_10 = [ int ( arg_13 ) for arg_13 in arg_4 . split ( ' ' ) [ : - 1 ] ] arg_11 = [ abs ( arg_13 ) for arg_13 in arg_10 ] arg_12 = _cnf_or ( arg_10 ) arg_1 . add_constraint ( arg_12 , arg_11 ) for arg_13 in range ( 1 , arg_8 + 1 ) : arg_1 . add_variable ( arg_13 ) for arg_13 in arg_1 . variables : if arg_13 > arg_8 : arg_14 = ( "given .cnf file's header defines variables [1, {}] and {} clauses " "but constraints a reference to variable {}" ) . format ( arg_8 , arg_2 , arg_13 ) raise ValueError ( arg_14 ) if len ( arg_1 ) != arg_2 : arg_14 = ( "given .cnf file's header defines {} " "clauses but the file contains {}" ) . format ( arg_2 , len ( arg_1 ) ) raise ValueError ( arg_14 ) return arg_1

Remove groups from the model.

        Members of each group are not removed
        from the model (i.e. metabolites, reactions, and genes in the group
        stay in the model after any groups containing them are removed).

        Parameters
        ----------
        group_list : list
            A list of `cobra.Group` objects to remove from the model.


Question: Force an audio signal down to mono .

def Func ( arg_0 ) : util . valid_audio ( arg_0 , mono = False ) if arg_0 . ndim > 1 : arg_0 = np . mean ( arg_0 , axis = 0 ) return arg_0


Question: standalone command line access point

def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = sys . argv [ 1 : ] from getopt import getopt arg_1 = "hdi" arg_2 = ( "help" , "duplicates=" , "ignore-comments" , "ignore-imports" , "ignore-docstrings" , ) arg_3 = 4 arg_4 = False arg_5 = False arg_6 = False arg_7 , arg_8 = getopt ( arg_0 , arg_1 , arg_2 ) for arg_9 , arg_10 in arg_7 : if arg_9 in ( "-d" , "--duplicates" ) : arg_3 = int ( arg_10 ) elif arg_9 in ( "-h" , "--help" ) : usage ( ) elif arg_9 in ( "-i" , "--ignore-comments" ) : arg_4 = True elif arg_9 in ( "--ignore-docstrings" , ) : arg_5 = True elif arg_9 in ( "--ignore-imports" , ) : arg_6 = True if not arg_8 : usage ( 1 ) arg_11 = Similar ( arg_3 , arg_4 , arg_5 , arg_6 ) for arg_12 in arg_8 : with open ( arg_12 ) as stream : arg_11 . append_stream ( arg_12 , stream ) arg_11 . run ( ) sys . exit ( 0 )

Write the index.html file for this report.


Question: Reads configuration returns a ConfigParser object .

def Func ( ) : arg_0 = pkgrs . resource_filename ( 'latools' , 'latools.cfg' ) arg_1 = configparser . ConfigParser ( ) arg_1 . read ( arg_0 ) return arg_0 , arg_1

Send data synchronous to an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: PLC storage address
    :param value: value to write to the storage address of the PLC
    :param Type data_type: type of the data given to the PLC,
        according to PLCTYPE constants


Question: How many total branches are there?

def Func ( arg_0 ) : arg_1 = arg_0 . parser . exit_counts ( ) return sum ( [ arg_2 for arg_2 in arg_1 . values ( ) if arg_2 > 1 ] )

Deserialize a dataframe.

    Parameters
    ----------
    reader : file
        File-like object to read from. Must be opened in binary mode.
    data_type_id : dict
        Serialization format of the raw data.
        See the azureml.DataTypeIds class for constants.

    Returns
    -------
    pandas.DataFrame
        Dataframe object.


Question: Get URL to allow others to join a group conversation .

async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . GetGroupConversationUrlResponse ( ) await arg_0 . _pb_request ( 'conversations/getgroupconversationurl' , arg_1 , arg_2 ) return arg_2

Returns the maximum delay for the InferenceElements in the inference
    dictionary

    Parameters:
    -----------------------------------------------------------------------
    inferences:   A dictionary where the keys are InferenceElements


Question: Prepare persistent identifiers .

def Func ( arg_0 ) : arg_0 . pids = [ ] for arg_2 in arg_0 . pid_fetchers : arg_3 = arg_2 ( None , arg_0 . revisions [ - 1 ] [ 1 ] ) if arg_3 : arg_0 . pids . append ( arg_3 )

Opens a stream and reads 8192 bytes from it.

    This is useful to check if a stream actually has data
    before opening the output.


Question: Translates a tile in the padded image to the unpadded image .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . ishape . intersection ( [ arg_0 . ishape , arg_1 ] ) return arg_2 . translate ( - arg_0 . pad )

Gets a list of snapshots for a cluster

        :param cluster_identifier: unique identifier of a cluster
        :type cluster_identifier: str


Question: Transform a QuantumChannel to the SuperOp representation .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 == 'SuperOp' : return arg_1 if arg_0 == 'Operator' : return _from_operator ( 'SuperOp' , arg_1 , arg_2 , arg_3 ) if arg_0 == 'Choi' : return _choiFunc ( arg_1 , arg_2 , arg_3 ) if arg_0 == 'Kraus' : return _krausFunc ( arg_1 , arg_2 , arg_3 ) if arg_0 == 'Chi' : arg_1 = _chi_to_choi ( arg_1 , arg_2 , arg_3 ) return _choiFunc ( arg_1 , arg_2 , arg_3 ) if arg_0 == 'PTM' : return _ptmFunc ( arg_1 , arg_2 , arg_3 ) if arg_0 == 'Stinespring' : return _stinespringFunc ( arg_1 , arg_2 , arg_3 ) raise QiskitError ( 'Invalid QuantumChannel {}' . format ( arg_0 ) )

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Return the number of nodes that match the pattern .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . _filetree if arg_2 is None else arg_2 arg_4 = 0 if isinstance ( arg_3 , dict ) : arg_5 = arg_3 . keys ( ) arg_4 += len ( filter_list ( arg_5 , arg_1 ) ) for arg_6 in arg_5 : arg_4 += arg_0 . Func ( arg_1 , arg_3 [ arg_6 ] ) else : arg_4 = len ( filter_list ( arg_3 , arg_1 ) ) return arg_4


Question: Setup the rate limit handler .

def Func ( arg_0 , arg_1 = False , arg_2 = arg_3 , arg_4 = arg_5 , arg_6 = arg_7 ) : arg_0 . rate_limit = None arg_0 . rate_limit_reset_ts = None arg_0 . sleep_for_rate = arg_1 arg_0 . rate_limit_header = arg_4 arg_0 . rate_limit_reset_header = arg_6 if arg_2 > arg_0 . MAX_RATE_LIMIT : arg_10 = "Minimum rate to sleep value exceeded (%d)." arg_10 += "High values might cause the client to sleep forever." arg_10 += "Reset to %d." arg_0 . min_rate_to_sleep = arg_0 . MAX_RATE_LIMIT logger . warning ( arg_10 , arg_2 , arg_0 . MAX_RATE_LIMIT ) else : arg_0 . min_rate_to_sleep = arg_2

Converts xml response to service bus metrics objects

        The xml format for MetricProperties
<entry>
    <id>https://sbgm.windows.net/Metrics(\'listeners.active\')</id>
    <title/>
    <updated>2014-10-09T11:56:50Z</updated>
    <author>
        <name/>
    </author>
    <content type="application/xml">
        <m:properties>
            <d:Name>listeners.active</d:Name>
            <d:PrimaryAggregation>Average</d:PrimaryAggregation>
            <d:Unit>Count</d:Unit>
            <d:DisplayName>Active listeners</d:DisplayName>
        </m:properties>
    </content>
</entry>

        The xml format for MetricValues
    <entry>
        <id>https://sbgm.windows.net/MetricValues(datetime\'2014-10-02T00:00:00Z\')</id>
        <title/>
        <updated>2014-10-09T18:38:28Z</updated>
        <author>
            <name/>
        </author>
        <content type="application/xml">
            <m:properties>
                <d:Timestamp m:type="Edm.DateTime">2014-10-02T00:00:00Z</d:Timestamp>
                <d:Min m:type="Edm.Int64">-118</d:Min>
                <d:Max m:type="Edm.Int64">15</d:Max>
                <d:Average m:type="Edm.Single">-78.44444</d:Average>
                <d:Total m:type="Edm.Int64">0</d:Total>
            </m:properties>
        </content>
    </entry>


Question: Clear out the database

def Func ( ) : from airflow import models from alembic . migration import MigrationContext log . info ( "Dropping tables that exist" ) models . base . Base . metadata . drop_all ( settings . engine ) arg_0 = MigrationContext . configure ( settings . engine ) if arg_0 . _version . exists ( settings . engine ) : arg_0 . _version . drop ( settings . engine ) from flask_appbuilder . models . sqla import Base Base . metadata . drop_all ( settings . engine ) initdb ( )

Obtiene los dataframes de los datos de PVPC con resampling diario y mensual.


Question: Build Gromacs topology files from pdb .

def Func ( arg_0 = None , arg_1 = 'protein' , arg_2 = 'system.top' , arg_3 = 'top' , arg_4 = "posres.itp" , arg_5 = "oplsaa" , arg_6 = "tip4p" , ** arg_7 ) : arg_8 = realpath ( arg_0 ) arg_9 = arg_1 + '.pdb' if arg_4 is None : arg_4 = arg_1 + '_posres.itp' arg_7 . update ( { 'f' : arg_8 , 'o' : arg_9 , 'p' : arg_2 , 'i' : arg_4 , 'ff' : arg_5 , 'water' : arg_6 } ) with in_dir ( arg_3 ) : logger . info ( "[{dirname!s}] Building Func {top!r} from struct = {struct!r}" . format ( ** vars ( ) ) ) gromacs . pdb2gmx ( ** arg_7 ) return { 'top' : realpath ( arg_3 , arg_2 ) , 'struct' : realpath ( arg_3 , arg_9 ) , 'posres' : realpath ( arg_3 , arg_4 ) }

Clean enterprise channel worker user form field

        Returns:
            str: the cleaned value of channel user username for transmitting courses metadata.


Question: Returns the section as a dict . Values are converted to int float bool as required .

def Func ( arg_0 , arg_1 ) : if ( arg_1 not in arg_0 . _sections and arg_1 not in arg_0 . airflow_defaults . _sections ) : return None arg_2 = copy . deepcopy ( arg_0 . airflow_defaults . _sections [ arg_1 ] ) if arg_1 in arg_0 . _sections : arg_2 . update ( copy . deepcopy ( arg_0 . _sections [ arg_1 ] ) ) arg_3 = 'AIRFLOW__{S}__' . format ( S = arg_1 . upper ( ) ) for arg_4 in sorted ( os . environ . keys ( ) ) : if arg_4 . startswith ( arg_3 ) : arg_5 = arg_4 . replace ( arg_3 , '' ) . lower ( ) arg_2 [ arg_5 ] = arg_0 . _get_env_var_option ( arg_1 , arg_5 ) for arg_5 , arg_6 in iteritems ( arg_2 ) : try : arg_6 = int ( arg_6 ) except ValueError : try : arg_6 = float ( arg_6 ) except ValueError : if arg_6 . lower ( ) in ( 't' , 'true' ) : arg_6 = True elif arg_6 . lower ( ) in ( 'f' , 'false' ) : arg_6 = False arg_2 [ arg_5 ] = arg_6 return arg_2

The index of the deepest character readed.


Question: Set one section in a Project description

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get ( arg_1 ) if arg_3 is None : raise KeyError ( 'No section "%s"' % arg_1 ) if arg_2 is None : arg_2 = type ( arg_3 ) ( ) elif arg_1 in CLASS_SECTIONS : if isinstance ( arg_2 , str ) : arg_2 = { 'typename' : aliases . resolve ( arg_2 ) } elif isinstance ( arg_2 , type ) : arg_2 = { 'typename' : class_name . class_name ( arg_2 ) } elif not isinstance ( arg_2 , dict ) : raise TypeError ( 'Expected dict, str or type, got "%s"' % arg_2 ) arg_4 = arg_2 . get ( 'typename' ) if arg_4 : arg_5 = 's' if arg_1 == 'driver' else '' arg_6 = 'bibliopixel.' + arg_1 + arg_5 importer . import_symbol ( arg_4 , arg_6 ) elif arg_1 == 'shape' : if not isinstance ( arg_2 , ( list , int , tuple , str ) ) : raise TypeError ( 'Expected shape, got "%s"' % arg_2 ) elif type ( arg_3 ) is not type ( arg_2 ) : raise TypeError ( 'Expected %s but got "%s" of type %s' % ( type ( arg_3 ) , arg_2 , type ( arg_2 ) ) ) arg_0 [ arg_1 ] = arg_2

View decorator which terminates stale TPA sessions.

    This decorator forces the user to obtain a new session
    the first time they access the decorated view. This prevents
    TPA-authenticated users from hijacking the session of another
    user who may have been previously logged in using the same
    browser window.

    This decorator should be used in conjunction with the
    enterprise_login_required decorator.

    Usage::
        @enterprise_login_required
        @force_fresh_session()
        def my_view(request, enterprise_uuid):
            # Some functionality ...

        OR

        class MyView(View):
            ...
            @method_decorator(enterprise_login_required)
            @method_decorator(force_fresh_session)
            def get(self, request, enterprise_uuid):
                # Some functionality ...


Question: Setter for path property

def Func ( arg_0 , arg_1 ) : if not arg_1 . endswith ( '/' ) : arg_0 . _Func = '{v}/' . format ( v = arg_1 ) else : arg_0 . _Func = arg_1

Generate RENEWING time.

    [:rfc:`2131#section-4.4.5`]::

        T1
        defaults to (0.5 * duration_of_lease).  T2 defaults to (0.875 *
        duration_of_lease).  Times T1 and T2 SHOULD be chosen with some
        random "fuzz" around a fixed value, to avoid synchronization of
        client reacquisition.


Question: Internal function that tracks beats in an onset strength envelope .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_1 <= 0 : raise ParameterError ( 'bpm must be strictly positive' ) arg_5 = round ( 60.0 * arg_2 / arg_1 ) arg_6 = __beat_local_score ( arg_0 , arg_5 ) arg_7 , arg_8 = __beat_track_dp ( arg_6 , arg_5 , arg_3 ) arg_9 = [ __last_beat ( arg_8 ) ] while arg_7 [ arg_9 [ - 1 ] ] >= 0 : arg_9 . append ( arg_7 [ arg_9 [ - 1 ] ] ) arg_9 = np . array ( arg_9 [ : : - 1 ] , dtype = int ) arg_9 = __trim_beats ( arg_6 , arg_9 , arg_4 ) return arg_9

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: Objective and gradient for the rosenbrock function

Look through the jobs table and reactivate all that are already in the
    running state by setting their _eng_allocate_new_workers fields to True;
    used by Nupic Scheduler as part of its failure-recovery procedure.


Question: Generate the annotations JSON for Ideogram .

def Func ( arg_0 : arg_1 ) -> Mapping [ str , Mapping [ str , Any ] ] : import bio2bel_hgnc from bio2bel_hgnc . models import HumanGene arg_0 : arg_1 = arg_0 . copy ( ) enrich_protein_and_rna_origins ( arg_0 ) collapse_all_variants ( arg_0 ) arg_2 : Set [ Gene ] = get_nodes_by_function ( arg_0 , GENE ) arg_3 = { gene . name for gene in arg_2 if gene . namespace . lower ( ) == 'hgnc' } arg_4 = { } arg_5 = bio2bel_hgnc . Manager ( ) arg_6 = ( arg_5 . session . query ( HumanGene . symbol , HumanGene . location ) . filter ( HumanGene . symbol . in_ ( arg_3 ) ) . all ( ) ) for arg_7 in arg_6 : arg_4 [ arg_7 . symbol ] = { 'name' : arg_7 . symbol , 'chr' : ( arg_7 . location . split ( 'q' ) [ 0 ] if 'q' in arg_7 . location else arg_7 . location . split ( 'p' ) [ 0 ] ) , } arg_9 = get_df ( ) for arg_10 , ( arg_11 , arg_8 , arg_12 , arg_13 ) in arg_9 [ arg_9 [ 'Symbol' ] . isin ( arg_3 ) ] . iterrows ( ) : arg_4 [ arg_8 ] [ 'start' ] = arg_12 arg_4 [ arg_8 ] [ 'stop' ] = arg_13 return arg_4

Only scott should do this. Upload new version to site.


Question: default is to wait for the child applications to close .

async def Func ( arg_0 , arg_1 ) : try : await asyncio . wait ( arg_0 . application_futures . values ( ) , return_when = asyncio . ALL_COMPLETED , timeout = arg_0 . application_close_timeout ) except asyncio . TimeoutError : pass


Question: Send zipfile to TMC for given exercise

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . post ( arg_1 . return_url , arg_3 = arg_3 , files = { "submission[file]" : ( 'submission.zip' , arg_2 ) } , data = { "commit" : "Submit" } ) return arg_0 . _to_json ( arg_4 )

Convert reflection coefficients to inverse sine parameters.

    :param k: reflection coefficients
    :return: inverse sine parameters

    .. seealso:: :func:`is2rc`, :func:`rc2poly`, :func:`rc2acC`, :func:`rc2lar`.

    Reference: J.R. Deller, J.G. Proakis, J.H.L. Hansen, "Discrete-Time
       Processing of Speech Signals", Prentice Hall, Section 7.4.5.


Question: Read the data stream and decode the AttributeReference structure into its parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_2_0 ) : if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : raise exceptions . VersionNotSupported ( "KMIP {} does not support the AttributeReference " "object." . format ( arg_2 . value ) ) super ( AttributeReference , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . VENDOR_IDENTIFICATION , arg_6 ) : arg_0 . _vendor_identification = primitives . TextString ( tag = arg_3 . Tags . VENDOR_IDENTIFICATION ) arg_0 . _vendor_identification . Func ( arg_6 , arg_2 = arg_2 ) else : raise exceptions . InvalidKmipEncoding ( "The AttributeReference encoding is missing the vendor " "identification string." ) if arg_0 . is_tag_next ( arg_3 . Tags . ATTRIBUTE_NAME , arg_6 ) : arg_0 . _attribute_name = primitives . TextString ( tag = arg_3 . Tags . ATTRIBUTE_NAME ) arg_0 . _attribute_name . Func ( arg_6 , arg_2 = arg_2 ) else : raise exceptions . InvalidKmipEncoding ( "The AttributeReference encoding is missing the attribute " "name string." ) arg_0 . is_oversized ( arg_6 )

Run according to options in sys.argv and diff classifiers.


Question: Accept a publication request at form value epub

def Func ( arg_0 ) : if 'epub' not in arg_0 . POST : raise httpexceptions . HTTPBadRequest ( "Missing EPUB in POST body." ) arg_1 = asbool ( arg_0 . POST . get ( 'pre-publication' ) ) arg_2 = arg_0 . POST [ 'epub' ] . file try : arg_3 = cnxepub . EPUB . from_file ( arg_2 ) except : raise httpexceptions . HTTPBadRequest ( 'Format not recognized.' ) with db_connect ( ) as db_conn : with db_conn . cursor ( ) as cursor : arg_2 . seek ( 0 ) arg_4 , arg_5 = add_publication ( cursor , arg_3 , arg_2 , arg_1 ) arg_6 , arg_7 = poke_publication_state ( arg_4 ) arg_8 = { 'publication' : arg_4 , 'mapping' : arg_5 , 'state' : arg_6 , 'messages' : arg_7 , } return arg_8

Condition to stop when any batch member converges, or all have failed.


Question: Establish an ssh tunnel for each local host and port that can be used to communicate with the state host .

def Func ( arg_0 ) : arg_1 = [ ] for ( arg_2 , arg_3 ) in arg_0 . hostportlist : arg_4 = arg_0 . pick_unused_port ( ) arg_0 . tunnel . append ( subprocess . Popen ( ( 'ssh' , arg_0 . tunnelhost , '-NL127.0.0.1:%d:%s:%d' % ( arg_4 , arg_2 , arg_3 ) ) ) ) arg_1 . append ( ( '127.0.0.1' , arg_4 ) ) return arg_1

Remove rows with NAs from the H2OFrame.

        :returns: new H2OFrame with all rows from the original frame containing any NAs removed.


Question: Decorator for rruleset methods which may invalidate the cached length .

def Func ( arg_0 ) : def inner_func ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 ( arg_1 , * arg_2 , ** arg_3 ) arg_1 . _invalidate_cache ( ) return arg_4 return inner_func


Question: Policy shared context dictionary

def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 ) : arg_4 = [ 'policy' ] if arg_1 is not None : arg_4 . append ( arg_1 ) with arg_0 . _executor . Func ( '.' . join ( arg_4 ) , arg_2 ) as policy_context : yield policy_context

Processes and saves a resized thumbnail version of the image.


Question: return True if callback is an instance of a class

def Func ( arg_0 ) : arg_1 = False arg_2 = arg_0 . callback if arg_0 . is_class ( ) : return False arg_1 = not inspect . isfunction ( arg_2 ) and not inspect . ismethod ( arg_2 ) return arg_1

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: All keys in DB or all keys matching a glob

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_2 = arg_0 . root . walkfiles ( ) else : arg_2 = [ Path ( arg_3 ) for arg_3 in glob . glob ( arg_0 . root / arg_1 ) ] return [ arg_0 . _normalized ( arg_3 ) for arg_3 in arg_2 if arg_3 . isfile ( ) ]

Sets the annotation SPDX Identifier.
        Raises CardinalityError if already set. OrderError if no annotator
        defined before.


Question: This returns an array of each sector and performance for the current trading day . Performance is based on each sector ETF .

def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = pd . DataFrame ( sectorPerformance ( arg_0 , arg_1 ) ) _toDatetime ( arg_2 ) _reindex ( arg_2 , 'name' ) return arg_2

Improve QTextCursor.atBlockStart to ignore spaces


Question: Finds the first operator in the list converts it and its operands to a OptreeNode then returns a new list with the operator and operands replaced by the new OptreeNode .

def Func ( arg_0 ) : arg_1 = 0 while arg_1 < len ( arg_0 ) : if isinstance ( arg_0 [ arg_1 ] , OperatorNode ) : break else : arg_1 += 1 if arg_1 == len ( arg_0 ) : raise OperatorError ( "No operator found" ) arg_2 = arg_0 [ arg_1 ] arg_3 = arg_2 . operator arg_4 = arg_1 - arg_3 . cardinality if arg_4 < 0 : raise OperatorError ( "Insufficient operands for operator {0}" . format ( arg_3 . symbol ) ) return arg_0 [ : arg_4 ] + [ OptreeNode ( arg_2 , tuple ( arg_0 [ arg_4 : arg_1 ] ) ) ] + arg_0 [ arg_1 + 1 : ]

Obtiene los dataframes de los datos de PVPC con resampling diario y mensual.


Question: Convert a long integer to a byte string .

def Func ( arg_0 , arg_1 = 0 ) : arg_2 = b'' arg_3 = struct . pack while arg_0 > 0 : arg_2 = arg_3 ( '>I' , arg_0 & 0xffffffff ) + arg_2 arg_0 = arg_0 >> 32 for arg_4 in range ( len ( arg_2 ) ) : if arg_2 [ arg_4 ] != '\000' : break else : arg_2 = '\000' arg_4 = 0 arg_2 = arg_2 [ arg_4 : ] if arg_1 > 0 and len ( arg_2 ) % arg_1 : arg_2 = ( arg_1 - len ( arg_2 ) % arg_1 ) * '\000' + arg_2 return arg_2

Run stochastic volatility model.

    This model estimates the volatility of a returns series over time.
    Returns are assumed to be T-distributed. lambda (width of
    T-distributed) is assumed to follow a random-walk.

    Parameters
    ----------
    data : pandas.Series
        Return series to model.
    samples : int, optional
        Posterior samples to draw.

    Returns
    -------
    model : pymc.Model object
        PyMC3 model containing all random variables.
    trace : pymc3.sampling.BaseTrace object
        A PyMC3 trace object that contains samples for each parameter
        of the posterior.

    See Also
    --------
    plot_stoch_vol : plotting of tochastic volatility model


Question: Insert additional nodes with length = 0 into the subtree in such a way that all non - leaf nodes have only 2 descendants i . e . the tree becomes a fully resolved binary tree .

def Func ( arg_0 ) : def _Func ( arg_1 ) : arg_2 = Node ( length = arg_0 . _length_formatter ( arg_0 . _length_parser ( '0' ) ) ) while len ( arg_1 . descendants ) > 1 : arg_2 . add_descendant ( arg_1 . descendants . pop ( ) ) arg_1 . descendants . append ( arg_2 ) arg_0 . visit ( _Func , lambda arg_1 : len ( arg_1 . descendants ) > 2 )


Question: call each func from reversed func list .

def Func ( arg_0 : arg_1 , * arg_2 , ** arg_3 ) : arg_4 = None for arg_5 in reversed ( arg_0 ) : arg_4 = arg_5 ( * arg_2 , ** arg_3 ) return arg_4

Return a list of all enrollments for the passed section_id.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index


Question: Validates API Root information . Raises errors for required properties .

def Func ( arg_0 ) : if not arg_0 . _title : arg_1 = "No 'title' in API Root for request '{}'" raise ValidationError ( arg_1 . format ( arg_0 . url ) ) if not arg_0 . _versions : arg_1 = "No 'versions' in API Root for request '{}'" raise ValidationError ( arg_1 . format ( arg_0 . url ) ) if arg_0 . _max_content_length is None : arg_1 = "No 'max_content_length' in API Root for request '{}'" raise ValidationError ( arg_1 . format ( arg_0 . url ) )

Awake one process waiting to receive data on fd


Question: This method schedules the tasks for a single DAG by looking at the active DAG runs and adding task instances that should run to the queue .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = DagRun . find ( dag_id = arg_1 . dag_id , state = State . RUNNING , arg_3 = arg_3 ) arg_5 = [ ] for arg_6 in arg_4 : arg_0 . log . info ( "Examining DAG run %s" , arg_6 ) if arg_6 . execution_date > timezone . utcnow ( ) : arg_0 . log . error ( "Execution date is in future: %s" , arg_6 . execution_date ) continue if len ( arg_5 ) >= arg_1 . max_active_runs : arg_0 . log . info ( "Number of active dag runs reached max_active_run." ) break if arg_6 . is_backfill : continue arg_6 . dag = arg_1 arg_6 . verify_integrity ( arg_3 = arg_3 ) arg_6 . update_state ( arg_3 = arg_3 ) if arg_6 . state == State . RUNNING : make_transient ( arg_6 ) arg_5 . append ( arg_6 ) for arg_6 in arg_5 : arg_0 . log . debug ( "Examining active DAG run: %s" , arg_6 ) arg_7 = arg_6 . get_task_instances ( state = ( State . NONE , State . UP_FOR_RETRY , State . UP_FOR_RESCHEDULE ) ) for arg_8 in arg_7 : arg_9 = arg_1 . get_task ( arg_8 . task_id ) arg_8 . task = arg_9 if arg_8 . are_dependencies_met ( dep_context = DepContext ( flag_upstream_failed = True ) , arg_3 = arg_3 ) : arg_0 . log . debug ( 'Queuing task: %s' , arg_8 ) arg_2 . append ( arg_8 . key )

Clean up stats file, if configured to do so.


Question: Print an error message and exit .

def Func ( arg_0 , * arg_1 ) : print ( arg_0 % arg_1 , file = sys . stderr ) sys . exit ( 1 )


Question: Add a new store to your MailChimp account .

def Func ( arg_0 , arg_1 ) : if 'id' not in arg_1 : raise KeyError ( 'The store must have an id' ) if 'list_id' not in arg_1 : raise KeyError ( 'The store must have a list_id' ) if 'name' not in arg_1 : raise KeyError ( 'The store must have a name' ) if 'currency_code' not in arg_1 : raise KeyError ( 'The store must have a currency_code' ) if not re . match ( r"^[A-Z]{3}$" , arg_1 [ 'currency_code' ] ) : raise ValueError ( 'The currency_code must be a valid 3-letter ISO 4217 currency code' ) arg_2 = arg_0 . _mc_client . _post ( url = arg_0 . _build_path ( ) , arg_1 = arg_1 ) if arg_2 is not None : arg_0 . store_id = arg_2 [ 'id' ] else : arg_0 . store_id = None return arg_2

This is a parallel worker for running period-recovery.

    Parameters
    ----------

    task : tuple
        This is used to pass args to the `periodicvar_recovery` function::

            task[0] = period-finding result pickle to work on
            task[1] = simbasedir
            task[2] = period_tolerance

    Returns
    -------

    dict
        This is the dict produced by the `periodicvar_recovery` function for the
        input period-finding result pickle.


Question: Solve linear system AX = B using CHOLESKY method .

def Func ( arg_0 , arg_1 , arg_2 = 'scipy' ) : if arg_2 == 'numpy_solver' : arg_3 = _numpy_solver ( arg_0 , arg_1 ) return arg_3 elif arg_2 == 'numpy' : arg_3 , arg_4 = _numpy_cholesky ( arg_0 , arg_1 ) return arg_3 elif arg_2 == 'scipy' : import scipy . linalg arg_5 = scipy . linalg . cholesky ( arg_0 ) arg_3 = scipy . linalg . cho_solve ( ( arg_5 , False ) , arg_1 ) else : raise ValueError ( 'method must be numpy_solver, numpy_cholesky or cholesky_inplace' ) return arg_3

Creates a tempfile and starts the given editor, returns the data afterwards.


Question: Set the interval of recording for each indicator .

def Func ( arg_0 , arg_1 , arg_2 ) : return callBigDlFunc ( arg_0 . bigdl_type , "summarySetTrigger" , arg_0 . value , arg_1 , arg_2 )

Return the license name from an ExtractedLicense or None


Question: Initialize an object from dict .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : assert isinstance ( arg_0 , dict ) and 'type' in arg_0 assert isinstance ( arg_2 , dict ) or arg_2 is None arg_3 = arg_0 . copy ( ) arg_4 = arg_3 . pop ( 'type' ) if mmcv . is_str ( arg_4 ) : if arg_1 is not None : arg_4 = getattr ( arg_1 , arg_4 ) else : arg_4 = sys . modules [ arg_4 ] elif not isinstance ( arg_4 , type ) : raise TypeError ( 'type must be a str or valid type, but got {}' . format ( type ( arg_4 ) ) ) if arg_2 is not None : for arg_5 , arg_6 in arg_2 . items ( ) : arg_3 . setdefault ( arg_5 , arg_6 ) return arg_4 ( ** arg_3 )

Calculate the modelled progress state for the given time moment.

        :returns: tuple (x, v) of the progress level and progress speed.


Question: Called when a dangerous action is about to be done to make sure it s okay . prompt is printed ; user response is returned .

def Func ( arg_0 , arg_1 , arg_2 ) : while True : try : arg_0 . write_Func ( arg_1 , arg_2 ) arg_3 = arg_0 . readline ( '' ) . strip ( ) . lower ( ) except EOFError : return arg_2 if arg_3 in ( 'y' , 'yes' ) : return True elif arg_3 in ( 'n' , 'no' ) : return False else : arg_0 . msg ( "Please answer y or n." ) pass pass return arg_2

Unregister an extension code.  For testing only.


Question: Get checkpoint parent dir .

def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 , "savedmodels" ) arg_1 = os . path . abspath ( arg_1 ) return arg_1

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: Called when the up key is pressed . Returns whether to continue processing the event .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _get_prompt_cursor ( ) if arg_0 . _get_cursor ( ) . blockNumber ( ) == arg_2 . blockNumber ( ) : if arg_0 . _history_locked ( ) and not arg_1 : return False arg_3 = arg_0 . _get_input_buffer_cursor_column ( ) arg_4 = arg_0 . input_buffer if arg_0 . _history_index == len ( arg_0 . _history ) or ( arg_0 . _history_prefix and arg_3 != len ( arg_0 . _history_prefix ) ) : arg_0 . _history_index = len ( arg_0 . _history ) arg_0 . _history_prefix = arg_4 [ : arg_3 ] arg_0 . history_previous ( arg_0 . _history_prefix , as_prefix = not arg_1 ) arg_7 = arg_0 . _get_prompt_cursor ( ) if arg_0 . _history_prefix : arg_7 . movePosition ( QtGui . QTextCursor . Right , n = len ( arg_0 . _history_prefix ) ) else : arg_7 . movePosition ( QtGui . QTextCursor . EndOfLine ) arg_0 . _set_cursor ( arg_7 ) return False return True

Calculate a t-test score for the difference between two samples.

    Args:
        sample1: one sample.
        sample2: the other sample.

    Returns:
        The t-test score, as a float.


Question: Workhorse for translating particles . See get_particles_featuring for docs .

def Func ( arg_0 , arg_1 = 1e9 , arg_2 = '' , arg_3 = 'calc' , arg_4 = 'calc' , arg_5 = 'guess' , arg_6 = 0 , arg_7 = True ) : if arg_2 is not None : arg_8 = arg_2 + 'translate-particles' arg_9 = arg_2 + 'addsub_burn' arg_10 = arg_2 + 'addsub_polish' else : arg_8 , arg_9 , arg_10 = [ None ] * 3 RLOG . info ( 'Translate Particles:' ) opt . burn ( arg_0 , mode = 'do-particles' , n_loop = 4 , fractol = 0.1 , arg_2 = arg_8 , arg_1 = arg_1 , include_rad = False , dowarn = False ) opt . burn ( arg_0 , mode = 'do-particles' , n_loop = 4 , fractol = 0.05 , arg_2 = arg_8 , arg_1 = arg_1 , include_rad = True , dowarn = False ) RLOG . info ( 'Start add-subtract' ) addsub . add_subtract ( arg_0 , tries = 30 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 ) if arg_2 is not None : states . save ( arg_0 , arg_2 = arg_2 + 'translate-addsub' ) if arg_7 : RLOG . info ( 'Final Burn:' ) opt . burn ( arg_0 , mode = 'burn' , n_loop = 3 , fractol = 3e-4 , arg_2 = arg_9 , arg_1 = arg_1 , arg_6 = arg_6 , dowarn = False ) RLOG . info ( 'Final Polish:' ) arg_11 = opt . burn ( arg_0 , mode = 'polish' , n_loop = 4 , fractol = 3e-4 , arg_2 = arg_10 , arg_1 = arg_1 , arg_6 = arg_6 , dowarn = False ) if not arg_11 [ 'converged' ] : RLOG . warn ( 'Optimization did not converge; consider re-running' )

Creates an AAAA record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :keyword int weight: *For weighted record sets only*. Among resource record
            sets that have the same combination of DNS name and type, a value
            that determines what portion of traffic for the current resource
            record set is routed to the associated location. Ranges from 0-255.
        :keyword str region: *For latency-based record sets*. The Amazon EC2 region
            where the resource that is specified in this resource record set
            resides.
        :keyword str set_identifier: *For weighted and latency resource record
            sets only*. An identifier that differentiates among multiple
            resource record sets that have the same combination of DNS name
            and type. 1-128 chars.
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created AAAAResourceRecordSet instance.


Question: Parse a hub key into a dictionary of component parts

def Func ( arg_0 ) : if arg_0 is None : raise ValueError ( 'Not a valid key' ) arg_1 = re . match ( PATTERN , arg_0 ) if not arg_1 : arg_1 = re . match ( PATTERN_S0 , arg_0 ) if not arg_1 : raise ValueError ( 'Not a valid key' ) return dict ( map ( normalise_part , zip ( [ arg_2 for arg_2 in PARTS_S0 . keys ( ) ] , arg_1 . groups ( ) ) ) ) return dict ( zip ( PARTS . keys ( ) , arg_1 . groups ( ) ) )

Format the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.


Question: Return all causative variants for an institute

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ ] if arg_2 : arg_4 = arg_0 . case_collection . find_one ( { "_id" : arg_2 } ) arg_3 = [ causative for causative in arg_4 [ 'causatives' ] ] elif arg_1 : arg_5 = arg_0 . case_collection . aggregate ( [ { '$match' : { 'collaborators' : arg_1 , 'causatives' : { '$exists' : True } } } , { '$unwind' : '$causatives' } , { '$group' : { '_id' : '$causatives' } } ] ) arg_3 = [ item [ '_id' ] for item in arg_5 ] return arg_3


Question: Returns the indices of cells that belong to a column .

def Func ( arg_0 , arg_1 ) : arg_0 . _validateColumn ( arg_1 ) arg_2 = arg_0 . cellsPerColumn * arg_1 arg_3 = arg_2 + arg_0 . cellsPerColumn return range ( arg_2 , arg_3 )

Show Program Landing page for the Enterprise's Program.

        Render the Enterprise's Program Enrollment page for a specific program.
        The Enterprise and Program are both selected by their respective UUIDs.

        Unauthenticated learners will be redirected to enterprise-linked SSO.

        A 404 will be raised if any of the following conditions are met:
            * No enterprise customer UUID query parameter ``enterprise_uuid`` found in request.
            * No enterprise customer found against the enterprise customer
                uuid ``enterprise_uuid`` in the request kwargs.
            * No Program can be found given ``program_uuid`` either at all or associated with
                the Enterprise..


Question: Returns the merged nextflow params string from a dictionary object .

def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 . processes : logger . debug ( "[{}] Adding parameters: {}" . format ( arg_2 . template , arg_2 . params ) ) for arg_3 , arg_4 in arg_2 . params . items ( ) : arg_1 [ arg_3 ] = arg_4 [ "default" ] arg_5 = "\n\t" + "\n\t" . join ( [ "{} = {}" . format ( arg_3 , arg_4 ) for arg_3 , arg_4 in arg_1 . items ( ) ] ) return arg_5

Return the value to player; 1 for win, -1 for loss, 0 otherwise.


Question: Return a valid docker_path for a local file path .

def Func ( arg_0 , arg_1 ) : arg_1 = directory_fmt ( arg_1 ) arg_2 , arg_3 = _local_uri_rewriter ( arg_1 ) arg_4 = arg_3 [ len ( 'file' ) : ] arg_5 = os . path . join ( arg_0 . _relative_path , arg_3 ) return arg_4 , arg_5

Create required links from a sensor region to a classifier region.


Question: r This function handles the calculation of a mixture s acentric factor . Calculation is based on the omegas provided for each pure component . Will automatically select a method to use if no Method is provided ; returns None if insufficient data is available .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False ) : def list_methods ( ) : arg_5 = [ ] if none_and_length_check ( [ arg_1 , arg_0 ] ) : arg_5 . append ( 'SIMPLE' ) arg_5 . append ( 'NONE' ) return arg_5 if arg_4 : return list_methods ( ) if not arg_3 : arg_3 = list_methods ( ) [ 0 ] if arg_3 == 'SIMPLE' : arg_6 = mixing_simple ( arg_1 , arg_0 ) elif arg_3 == 'NONE' : arg_6 = None else : raise Exception ( 'Failure in in function' ) return arg_6

Returns the value specified in the XDG_CONFIG_HOME environment variable
        or the appropriate default.


Question: Setup logging for the application and aiohttp .

def Func ( arg_0 , arg_1 : arg_2 ) : arg_3 = getattr ( logging , arg_1 ) arg_4 = ( 'aiohttp.access' , 'aiohttp.internal' , 'aiohttp.server' , 'aiohttp.web' , arg_0 . name ) for arg_5 in arg_4 : setup_logger ( arg_5 = arg_5 , stream = sys . stderr , arg_3 = arg_3 )

Parse a hub key into a dictionary of component parts

    :param key: str, a hub key
    :returns: dict, hub key split into parts
    :raises: ValueError


Question: Start the heartbeating and call the callback if the kernel dies .

def Func ( arg_0 , arg_1 ) : if not arg_0 . _beating : arg_0 . _kernel_alive = True def ping_or_dead ( ) : arg_0 . hb_stream . flush ( ) if arg_0 . _kernel_alive : arg_0 . _kernel_alive = False arg_0 . hb_stream . send ( b'ping' ) arg_0 . hb_stream . flush ( ) else : try : arg_1 ( ) except : pass finally : arg_0 . stop_hb ( ) def beat_received ( arg_3 ) : arg_0 . _kernel_alive = True arg_0 . hb_stream . on_recv ( beat_received ) arg_4 = ioloop . IOLoop . instance ( ) arg_0 . _hb_periodic_callback = ioloop . PeriodicCallback ( ping_or_dead , arg_0 . time_to_dead * 1000 , arg_4 ) arg_4 . add_timeout ( time . time ( ) + arg_0 . first_beat , arg_0 . _really_Func ) arg_0 . _beating = True

creates a new, empty table in the dataset;
        If the table already exists, update the existing table.
        Since BigQuery does not natively allow table upserts, this is not an
        atomic operation.

        :param dataset_id: the dataset to upsert the table into.
        :type dataset_id: str
        :param table_resource: a table resource. see
            https://cloud.google.com/bigquery/docs/reference/v2/tables#resource
        :type table_resource: dict
        :param project_id: the project to upsert the table into.  If None,
            project will be self.project_id.
        :return:


Question: Return all items with a given name and parent folder id .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = dict ( ) arg_4 [ 'name' ] = arg_1 arg_4 [ 'folderId' ] = arg_2 if arg_3 : arg_4 [ 'token' ] = arg_3 arg_5 = arg_0 . request ( 'midas.item.searchbynameandfolder' , arg_4 ) return arg_5 [ 'items' ]

This method is called before first step of simulation.


Question: Execute a patch request and return the result

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_3 = arg_0 . _get_headers ( arg_3 ) arg_5 = ( lambda : requests . patch ( arg_0 . _get_qualified_route ( arg_1 ) , arg_3 = arg_3 , arg_2 = arg_2 , verify = False , proxies = arg_0 . proxies ) ) arg_6 = check_for_rate_limiting ( arg_5 ( ) , arg_5 ) return arg_0 . _handle_response ( arg_6 , arg_4 )

Returns a list of categories the page belongs to.

        # A Wikipedia category link looks like:
        # [[Category:Computing]]
        # This indicates the page is included in the given category.
        # If "Category" is preceded by ":" this indicates a link to a category.


Question: Return best matching substring of corpus .

def Func ( arg_0 , arg_1 , arg_2 = 4 , arg_3 = 3 , arg_4 = False ) : def ratio ( arg_5 , arg_6 ) : return SequenceMatcher ( None , arg_5 , arg_6 ) . ratio ( ) def scan_corpus ( arg_2 ) : arg_7 = [ ] arg_8 = 0 while arg_8 + arg_21 - arg_2 <= len ( arg_1 ) : arg_7 . append ( ratio ( arg_0 , arg_1 [ arg_8 : arg_8 - 1 + arg_21 ] ) ) arg_8 += arg_2 return arg_7 def index_max ( arg_9 ) : return max ( range ( len ( arg_9 ) ) , key = arg_9 . __getitem__ ) def adjust_left_right_positions ( ) : arg_10 , arg_11 = [ arg_22 ] * 2 arg_12 , arg_13 = [ arg_22 + arg_21 ] * 2 arg_14 = arg_7 [ round_decimal ( arg_10 / arg_2 ) ] arg_15 = arg_7 [ round_decimal ( arg_12 / arg_2 ) ] for arg_16 in range ( arg_3 ) : arg_17 = ratio ( arg_0 , arg_1 [ arg_10 - arg_16 : arg_12 ] ) if arg_17 > arg_14 : arg_14 = arg_17 arg_11 = arg_10 - arg_16 arg_18 = ratio ( arg_0 , arg_1 [ arg_10 + arg_16 : arg_12 ] ) if arg_18 > arg_14 : arg_14 = arg_18 arg_11 = arg_10 + arg_16 arg_19 = ratio ( arg_0 , arg_1 [ arg_10 : arg_12 - arg_16 ] ) if arg_19 > arg_15 : arg_15 = arg_19 arg_13 = arg_12 - arg_16 arg_20 = ratio ( arg_0 , arg_1 [ arg_10 : arg_12 + arg_16 ] ) if arg_20 > arg_15 : arg_15 = arg_20 arg_13 = arg_12 + arg_16 return arg_11 , arg_13 , ratio ( arg_0 , arg_1 [ arg_11 : arg_13 ] ) if not arg_4 : arg_0 = arg_0 . lower ( ) arg_1 = arg_1 . lower ( ) arg_21 = len ( arg_0 ) if arg_3 >= arg_21 / 2 : print ( "Warning: flex exceeds length of query / 2. Setting to default." ) arg_3 = 3 arg_7 = scan_corpus ( arg_2 ) arg_22 = index_max ( arg_7 ) * arg_2 arg_23 , arg_24 , arg_25 = adjust_left_right_positions ( ) return arg_1 [ arg_23 : arg_24 ] . strip ( ) , arg_25

Create a platform without an ELF loaded.

        :param str arch: The architecture of the new platform
        :rtype: Linux


Question: Decimal to binary conversion .

def Func ( arg_0 ) : arg_1 = [ ] while arg_0 : arg_1 . append ( _BYTES_TO_BITS [ arg_0 & 255 ] ) arg_0 >>= 8 arg_1 . reverse ( ) return '' . join ( arg_1 ) or 32 * '0'

Returns any parameters needed for Akamai HD player verification.

        Algorithm originally documented by KSV, source:
        http://stream-recorder.com/forum/showpost.php?p=43761&postcount=13


Question: Return the primary control channel of this qubit .

def Func ( arg_0 ) -> ControlChannel : if arg_0 . _Funcs : return arg_0 . _Funcs [ 0 ] else : raise PulseError ( "No Func channels in q[%d]" % arg_0 . _index )

Downloads a MP4 or WebM file that is associated with the video at the URL passed.

        :param str url: URL of the video to be downloaded
        :return str: Filename of the file in local storage


Question: Contextmanager for easily computing timings .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if six . PY3 : arg_3 = time . perf_counter ( ) else : arg_3 = time . time ( ) yield if six . PY3 : arg_4 = time . perf_counter ( ) else : arg_4 = time . time ( ) arg_5 = arg_4 - arg_3 arg_0 . timing ( arg_1 , value = arg_5 * 1000.0 , arg_2 = arg_2 )

Discard deposit changes.

        #. The signal :data:`invenio_records.signals.before_record_update` is
            sent before the edit execution.

        #. It restores the last published version.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the edit execution.

        #. The deposit index is updated.

        Status required: ``'draft'``.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.


Question: Given an owner and a name try to find similar names

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] arg_5 = _node_names ( arg_0 ) for arg_6 in arg_5 : if arg_6 == arg_1 : continue arg_7 = _string_distance ( arg_1 , arg_6 ) if arg_7 <= arg_2 : arg_4 . append ( ( arg_6 , arg_7 ) ) arg_8 = [ arg_6 for ( arg_6 , _ ) in heapq . nsmallest ( arg_3 , arg_4 , key = operator . itemgetter ( 1 ) ) ] return sorted ( arg_8 )


Question: Record index records for a single document .

def Func ( arg_0 , arg_1 ) : if not arg_1 . body . clean_visible : logger . warn ( 'stream item %s has no clean_visible part, ' 'skipping keyword Funcing' , arg_1 . stream_id ) return arg_2 = defaultdict ( int ) arg_2 [ arg_3 ] = 1 arg_4 = defaultdict ( int ) arg_5 = arg_0 . collect_words ( arg_1 ) for arg_6 , arg_7 in arg_5 . iteritems ( ) : ( arg_6 , arg_8 ) = arg_0 . make_hash_kw ( arg_6 ) arg_2 [ arg_8 ] += arg_7 arg_4 [ arg_6 ] = arg_8 if arg_0 . hash_docs : ( arg_9 , arg_10 ) = key_for_stream_item ( arg_1 ) arg_11 = [ ( ( h , arg_9 , arg_10 ) , n ) for ( h , n ) in arg_2 . iteritems ( ) if h != arg_3 ] arg_0 . client . put ( HASH_TF_INDEX_TABLE , * arg_11 ) if arg_0 . hash_frequencies : arg_11 = [ ( ( h , ) , 1 ) for h in arg_2 . iterkeys ( ) ] arg_0 . client . increment ( HASH_FREQUENCY_TABLE , * arg_11 ) if arg_0 . hash_keywords : arg_11 = [ ( ( h , t ) , 1 ) for ( t , h ) in arg_4 . iteritems ( ) ] arg_0 . client . increment ( HASH_KEYWORD_INDEX_TABLE , * arg_11 )

Return True if we should retry, False otherwise.


Question: Just validates the given signed value . Returns True if the signature exists and is valid False otherwise .

def Func ( arg_0 , arg_1 , arg_2 = None ) : try : arg_0 . unsign ( arg_1 , arg_2 = arg_2 ) return True except BadSignature : return False


Question: Get type information for a Python object

def Func ( arg_0 ) : if isinstance ( arg_0 , primitive_types ) : return ( 'primitive' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , sequence_types ) : return ( 'sequence' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , array_types ) : return ( 'array' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , key_value_types ) : return ( 'key-value' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , types . ModuleType ) : return ( 'module' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , ( types . FunctionType , types . MethodType ) ) : return ( 'function' , type ( arg_0 ) . __name__ ) if isinstance ( arg_0 , type ) : if hasattr ( arg_0 , '__dict__' ) : return ( 'class' , arg_0 . __name__ ) if isinstance ( type ( arg_0 ) , type ) : if hasattr ( arg_0 , '__dict__' ) : arg_1 = type ( arg_0 ) . __name__ if arg_1 == 'classobj' : arg_1 = arg_0 . __name__ return ( 'class' , '{}' . format ( arg_1 ) ) if arg_1 == 'instance' : arg_1 = arg_0 . __class__ . __name__ return ( 'instance' , '{} instance' . format ( arg_1 ) ) return ( 'unknown' , type ( arg_0 ) . __name__ )

Propagate "clk" clock and reset "rst" signal to all subcomponents


Question: Encodes the stored data to XML and returns a string .

def Func ( arg_0 , arg_1 = True , arg_2 = True ) : return etree . tostring ( arg_0 . to_xml ( ) , encoding = arg_0 . encoding , xml_declaration = arg_2 , pretty_print = arg_1 )

Takes a record and returns true if record meets filter criteria,
  false otherwise


Question: Like takewhile but takes a peekable iterable and doesn t consume the non - matching item .

def Func ( arg_0 , arg_1 ) : while True : try : if not arg_0 ( arg_1 . peek ( ) ) : break yield next ( arg_1 ) except StopIteration : break

Parses a file and returns a document object.
        File, a file like object.


Question: Perform an ADC read with the provided mux gain data_rate and mode values . Returns the signed integer result of the read .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = ADS1x15_CONFIG_OS_SINGLE arg_5 |= ( arg_1 & 0x07 ) << ADS1x15_CONFIG_MUX_OFFSET if arg_2 not in ADS1x15_CONFIG_GAIN : raise ValueError ( 'Gain must be one of: 2/3, 1, 2, 4, 8, 16' ) arg_5 |= ADS1x15_CONFIG_GAIN [ arg_2 ] arg_5 |= arg_4 if arg_3 is None : arg_3 = arg_0 . _data_rate_default ( ) arg_5 |= arg_0 . _data_rate_config ( arg_3 ) arg_5 |= ADS1x15_CONFIG_COMP_QUE_DISABLE arg_0 . _device . writeList ( ADS1x15_POINTER_CONFIG , [ ( arg_5 >> 8 ) & 0xFF , arg_5 & 0xFF ] ) time . sleep ( 1.0 / arg_3 + 0.0001 ) arg_6 = arg_0 . _device . readList ( ADS1x15_POINTER_CONVERSION , 2 ) return arg_0 . _conversion_value ( arg_6 [ 1 ] , arg_6 [ 0 ] )

Open the editor at the given filename, linenumber, column and
    show an error message. This is used for correcting syntax errors.
    The current implementation only has special support for the VIM editor,
    and falls back on the 'editor' hook if VIM is not used.

    Call ip.set_hook('fix_error_editor',youfunc) to use your own function,


Question: Convert field value pairs into regular message .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = arg_1 . DESCRIPTOR for arg_4 in arg_0 : try : arg_5 = arg_3 . fields_by_camelcase_name . get ( arg_4 , None ) if not arg_5 : raise ParseError ( 'Message type "{0}" has no field named "{1}".' . format ( arg_3 . full_name , arg_4 ) ) if arg_4 in arg_2 : raise ParseError ( 'Message type "{0}" should not have multiple "{1}" fields.' . format ( arg_1 . DESCRIPTOR . full_name , arg_4 ) ) arg_2 . append ( arg_4 ) if arg_5 . containing_oneof is not None : arg_6 = arg_5 . containing_oneof . name if arg_6 in arg_2 : raise ParseError ( 'Message type "{0}" should not have multiple "{1}" ' 'oneof fields.' . format ( arg_1 . DESCRIPTOR . full_name , arg_6 ) ) arg_2 . append ( arg_6 ) arg_7 = arg_0 [ arg_4 ] if arg_7 is None : arg_1 . ClearField ( arg_5 . name ) continue if _IsMapEntry ( arg_5 ) : arg_1 . ClearField ( arg_5 . name ) _ConvertMapFieldValue ( arg_7 , arg_1 , arg_5 ) elif arg_5 . label == descriptor . FieldDescriptor . LABEL_REPEATED : arg_1 . ClearField ( arg_5 . name ) if not isinstance ( arg_7 , list ) : raise ParseError ( 'repeated field {0} must be in [] which is ' '{1}.' . format ( arg_4 , arg_7 ) ) if arg_5 . cpp_type == descriptor . FieldDescriptor . CPPTYPE_MESSAGE : for arg_8 in arg_7 : arg_9 = getattr ( arg_1 , arg_5 . name ) . add ( ) if ( arg_8 is None and arg_9 . DESCRIPTOR . full_name != 'google.protobuf.Value' ) : raise ParseError ( 'null is not allowed to be used as an element' ' in a repeated field.' ) _ConvertMessage ( arg_8 , arg_9 ) else : for arg_8 in arg_7 : if arg_8 is None : raise ParseError ( 'null is not allowed to be used as an element' ' in a repeated field.' ) getattr ( arg_1 , arg_5 . name ) . append ( _ConvertScalarFieldValue ( arg_8 , arg_5 ) ) elif arg_5 . cpp_type == descriptor . FieldDescriptor . CPPTYPE_MESSAGE : arg_9 = getattr ( arg_1 , arg_5 . name ) _ConvertMessage ( arg_7 , arg_9 ) else : setattr ( arg_1 , arg_5 . name , _ConvertScalarFieldValue ( arg_7 , arg_5 ) ) except ParseError as e : if arg_5 and arg_5 . containing_oneof is None : raise ParseError ( 'Failed to parse {0} field: {1}' . format ( arg_4 , e ) ) else : raise ParseError ( str ( e ) ) except ValueError as e : raise ParseError ( 'Failed to parse {0} field: {1}.' . format ( arg_4 , e ) ) except TypeError as e : raise ParseError ( 'Failed to parse {0} field: {1}.' . format ( arg_4 , e ) )


Question: Utility for ripping apart github s Link header field . It s kind of ugly .

def Func ( arg_0 ) : if not arg_0 : return dict ( ) return dict ( [ ( arg_1 . split ( '; ' ) [ 1 ] [ 5 : - 1 ] , arg_1 . split ( '; ' ) [ 0 ] [ 1 : - 1 ] , ) for arg_1 in arg_0 . split ( ', ' ) ] )

Return a CLI profile class.

    .. versionadded:: 1.1.6

    :return: A CLI Profile
    :rtype: azure.cli.core._profile.Profile
    :raises: ImportError if azure-cli-core package is not available


Question: Compares the app deptree file hashes with the hashes stored in the cache .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_hashes ( ) for arg_3 , arg_4 in arg_1 . items ( ) : arg_5 = arg_0 . get_hash ( arg_4 [ 'path' ] ) if arg_5 != arg_2 [ arg_4 [ 'path' ] ] : return False return True

If n2 is a perfect square, return its square root, else raise error.


Question: Create a command that calls the given function .

def Func ( arg_0 ) : class FuncCommand ( BaseCommand ) : def run ( arg_1 ) : arg_0 ( ) update_package_data ( arg_1 . distribution ) return FuncCommand

Dump a certificate revocation list to a buffer.

    :param type: The file type (one of ``FILETYPE_PEM``, ``FILETYPE_ASN1``, or
        ``FILETYPE_TEXT``).
    :param CRL crl: The CRL to dump.

    :return: The buffer with the CRL.
    :rtype: bytes


Question: Change the given swarm s state to newState . If newState is completed then bestModelId and bestErrScore must be provided .

def Func ( arg_0 , arg_1 , arg_2 ) : assert ( arg_2 in [ 'active' , 'completing' , 'completed' , 'killed' ] ) arg_3 = arg_0 . _state [ 'swarms' ] [ arg_1 ] if arg_3 [ 'status' ] == arg_2 : return if arg_3 [ 'status' ] == 'completed' and arg_2 == 'completing' : return arg_0 . _dirty = True arg_3 [ 'status' ] = arg_2 if arg_2 == 'completed' : ( arg_5 , arg_6 ) = arg_0 . _hsObj . _resultsDB . bestModelIdAndErrScore ( arg_1 ) arg_3 [ 'bestModelId' ] = arg_5 arg_3 [ 'bestErrScore' ] = arg_6 if arg_2 != 'active' and arg_1 in arg_0 . _state [ 'activeSwarms' ] : arg_0 . _state [ 'activeSwarms' ] . remove ( arg_1 ) if arg_2 == 'killed' : arg_0 . _hsObj . killSwarmParticles ( arg_1 ) arg_7 = arg_3 [ 'sprintIdx' ] arg_0 . isSprintActive ( arg_7 ) arg_8 = arg_0 . _state [ 'sprints' ] [ arg_7 ] arg_9 = dict ( active = 0 , completing = 0 , completed = 0 , killed = 0 ) arg_10 = [ ] arg_11 = [ ] for arg_12 in arg_0 . _state [ 'swarms' ] . itervalues ( ) : if arg_12 [ 'sprintIdx' ] != arg_7 : continue arg_9 [ arg_12 [ 'status' ] ] += 1 if arg_12 [ 'status' ] == 'completed' : arg_10 . append ( arg_12 [ 'bestModelId' ] ) arg_11 . append ( arg_12 [ 'bestErrScore' ] ) if arg_9 [ 'active' ] > 0 : arg_13 = 'active' elif arg_9 [ 'completing' ] > 0 : arg_13 = 'completing' else : arg_13 = 'completed' arg_8 [ 'status' ] = arg_13 if arg_13 == 'completed' : if len ( arg_11 ) > 0 : arg_14 = numpy . array ( arg_11 ) . argmin ( ) arg_8 [ 'bestModelId' ] = arg_10 [ arg_14 ] arg_8 [ 'bestErrScore' ] = arg_11 [ arg_14 ] else : arg_8 [ 'bestModelId' ] = 0 arg_8 [ 'bestErrScore' ] = numpy . inf arg_15 = numpy . inf for arg_16 in range ( arg_7 ) : if arg_0 . _state [ 'sprints' ] [ arg_16 ] [ 'status' ] == 'completed' : ( arg_17 , arg_6 ) = arg_0 . bestModelInCompletedSprint ( arg_16 ) if arg_6 is None : arg_6 = numpy . inf else : arg_6 = numpy . inf if arg_6 < arg_15 : arg_15 = arg_6 if arg_8 [ 'bestErrScore' ] >= arg_15 : arg_0 . _state [ 'lastGoodSprint' ] = arg_7 - 1 if arg_0 . _state [ 'lastGoodSprint' ] is not None and not arg_0 . anyGoodSprintsActive ( ) : arg_0 . _state [ 'searchOver' ] = True

Convenience function to efficiently construct a MultivariateNormalDiag.


Question: Write the cobra model to a file in JSON format .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False , ** arg_4 ) : arg_5 = model_to_dict ( arg_0 , arg_2 = arg_2 ) arg_5 [ u"version" ] = JSON_SPEC if arg_3 : arg_6 = { "indent" : 4 , "separators" : ( "," , ": " ) , "sort_keys" : True , "allow_nan" : False } else : arg_6 = { "indent" : 0 , "separators" : ( "," , ":" ) , "sort_keys" : False , "allow_nan" : False } arg_6 . update ( ** arg_4 ) if isinstance ( arg_1 , string_types ) : with open ( arg_1 , "w" ) as file_handle : json . dump ( arg_5 , file_handle , ** arg_6 ) else : json . dump ( arg_5 , arg_1 , ** arg_6 )


Question: Returns all events that have an occurrence within the given month & year .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = False , arg_6 = False ) : arg_7 = arg_0 . _get_kwargs ( arg_3 , arg_4 ) arg_8 , arg_9 = arg_0 . get_first_and_last ( arg_1 , arg_2 ) arg_10 = [ ] if arg_5 : arg_10 . append ( "location" ) if arg_6 : arg_10 . append ( "cancellations" ) arg_11 = Q ( repeat = "YEARLY" ) arg_12 = Q ( start_date__month = arg_2 ) arg_13 = Q ( end_date__month = arg_2 ) arg_14 = Q ( start_date__year = arg_1 ) arg_15 = Q ( end_date__year = arg_1 ) return arg_0 . model . objects . filter ( arg_11 & ( arg_12 | arg_13 ) | ( ~ Q ( repeat = "NEVER" ) ) | ( ( arg_14 | arg_15 ) & ( arg_12 | arg_15 ) ) , Q ( end_repeat = None ) | Q ( end_repeat__gte = arg_8 ) , start_date__lte = arg_9 ) . filter ( ** arg_7 ) . prefetch_related ( * arg_10 ) . order_by ( 'start_date' ) . distinct ( )

Update the profile picture for the current user.

        Args:
            image (file): a file-like object to read the image from


Question: Run processes which push the routing dump of the RIPE in a redis database . The dump has been splitted in multiple files and each process run on one of this files .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] while len ( arg_2 ) > 0 : while len ( arg_2 ) > 0 and len ( arg_3 ) < arg_0 : arg_4 = arg_2 . pop ( ) arg_3 . append ( service_start ( service = arg_1 , param = [ '-f' , arg_4 , '-d' , imported_day ] ) ) while len ( arg_3 ) == arg_0 : time . sleep ( sleep_timer ) arg_3 = update_running_pids ( arg_3 ) while len ( arg_3 ) > 0 : time . sleep ( sleep_timer ) arg_3 = update_running_pids ( arg_3 )

Handle disco error response.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`


Question: Return an array with the axes transposed .

def Func ( arg_0 , * arg_1 ) : if len ( arg_1 ) == 0 : arg_2 = arange ( arg_0 . ndim - 1 , - 1 , - 1 ) else : arg_2 = asarray ( argpack ( arg_1 ) ) isFuncable ( arg_2 , range ( arg_0 . ndim ) ) arg_3 = arg_0 . split arg_4 , arg_5 = arg_2 [ : arg_3 ] , arg_2 [ arg_3 : ] arg_6 = sort ( arg_5 [ arg_5 < arg_3 ] ) arg_7 = sort ( arg_4 [ arg_4 >= arg_3 ] ) arg_8 = sort ( arg_4 [ arg_4 < arg_3 ] ) arg_9 = sort ( arg_5 [ arg_5 >= arg_3 ] ) arg_10 = r_ [ arg_8 , arg_7 , arg_6 , arg_9 ] arg_11 = argsort ( arg_10 ) arg_12 = arg_11 [ arg_2 ] arg_13 , arg_14 = arg_12 [ : arg_3 ] , arg_12 [ arg_3 : ] - arg_3 arg_15 = arg_0 . swap ( arg_6 , arg_7 - arg_3 ) arg_15 = arg_15 . keys . Func ( tuple ( arg_13 . tolist ( ) ) ) arg_15 = arg_15 . values . Func ( tuple ( arg_14 . tolist ( ) ) ) return arg_15


Question: Lists the files and folders of a specific directory default is the current working directory .

def Func ( arg_0 , arg_1 = '' ) : arg_2 = arg_0 . _ftp . pwd ( ) arg_0 . cd ( arg_1 ) arg_3 = [ ] arg_0 . _ftp . retrlines ( 'LIST' , lambda a : arg_3 . append ( a ) ) arg_4 = filter ( lambda a : a . split ( ) [ 0 ] . startswith ( '-' ) , arg_3 ) arg_5 = filter ( lambda a : a . split ( ) [ 0 ] . startswith ( 'd' ) , arg_3 ) arg_4 = map ( lambda a : ' ' . join ( a . split ( ) [ 8 : ] ) , arg_4 ) arg_5 = map ( lambda a : ' ' . join ( a . split ( ) [ 8 : ] ) , arg_5 ) arg_0 . _ftp . cwd ( arg_2 ) return arg_4 , arg_5

Generate RENEWING time.

    [:rfc:`2131#section-4.4.5`]::

        T1
        defaults to (0.5 * duration_of_lease).  T2 defaults to (0.875 *
        duration_of_lease).  Times T1 and T2 SHOULD be chosen with some
        random "fuzz" around a fixed value, to avoid synchronization of
        client reacquisition.


Question: Replaces an element at supplied index .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . concat ( [ arg_0 [ : arg_1 ] , tf . expand_dims ( arg_2 , axis = 0 ) , arg_0 [ ( arg_1 + 1 ) : ] ] , axis = 0 ) return arg_3

update secrets will take a secrets credential file
        either located at .sregistry or the environment variable
        SREGISTRY_CLIENT_SECRETS and update the current client
        secrets as well as the associated API base.


Question: Return a new function with the given meta . If the function f already has a meta map then merge the

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 . Map ] ) : if not isinstance ( arg_1 , arg_3 . Map ) : raise TypeError ( "meta must be a map" ) if inspect . iscoroutinefunction ( arg_0 ) : @ functools . wraps ( arg_0 ) async def arg_7 ( * arg_5 , ** arg_6 ) : return await arg_0 ( * arg_5 , ** arg_6 ) else : @ functools . wraps ( arg_0 ) def arg_7 ( * arg_5 , ** arg_6 ) : return arg_0 ( * arg_5 , ** arg_6 ) arg_7 . meta = ( arg_0 . meta . update ( arg_1 ) if hasattr ( arg_0 , "meta" ) and isinstance ( arg_0 . meta , arg_3 . Map ) else arg_1 ) arg_7 . with_meta = partial ( Func , arg_7 ) return arg_7

Destroy nDestroy synapses on the specified segment, but don't destroy
    synapses to the "excludeCells".


Question: Coerces content or all values of content if it is a dict to a string . The function will throw if content contains non - string or non - numeric types .

def Func ( arg_0 , arg_1 = 'json' ) : arg_2 = Func if isinstance ( arg_0 , six . string_types ) : return arg_0 elif isinstance ( arg_0 , six . integer_types + ( float , ) ) : return str ( arg_0 ) elif isinstance ( arg_0 , ( list , tuple ) ) : return [ arg_2 ( arg_4 , '{0}[{1}]' . format ( arg_1 , arg_3 ) ) for arg_3 , arg_4 in enumerate ( arg_0 ) ] elif isinstance ( arg_0 , dict ) : return { arg_5 : arg_2 ( arg_6 , '{0}[{1}]' . format ( arg_1 , arg_5 ) ) for arg_5 , arg_6 in list ( arg_0 . items ( ) ) } else : arg_7 = type ( arg_0 ) arg_8 = 'Type {0} used for parameter {1} is not a number or a string' . format ( arg_7 , arg_1 ) raise AirflowException ( arg_8 )

Return output for the combined time and result summary statistics.


Question: read all the data . If reverse = True the x axis is flipped .

def Func ( arg_0 , arg_1 = True ) : raise NotImplementedError ( 'To be implemented' ) arg_0 . filfile . seek ( int ( arg_0 . datastart ) ) arg_2 = np . fromfile ( arg_0 . filfile , dtype = arg_0 . dtype ) . reshape ( arg_0 . blocksize , arg_0 . channels ) if arg_1 : arg_2 = arg_2 [ : , : : - 1 ] return arg_2

Generates a random sample from the Poisson probability distribution and
    returns its value and the log of the probability of sampling that value.


Question: Save report data in the given directory

def Func ( arg_0 , arg_1 = "output" ) : arg_2 = arg_0 [ "aggregate_reports" ] arg_3 = arg_0 [ "forensic_reports" ] if os . path . exists ( arg_1 ) : if not os . path . isdir ( arg_1 ) : raise ValueError ( "{0} is not a directory" . format ( arg_1 ) ) else : os . makedirs ( arg_1 ) with open ( "{0}" . format ( os . path . join ( arg_1 , "aggregate.json" ) ) , "w" , newline = "\n" , encoding = "utf-8" ) as agg_json : agg_json . write ( json . dumps ( arg_2 , ensure_ascii = False , indent = 2 ) ) with open ( "{0}" . format ( os . path . join ( arg_1 , "aggregate.csv" ) ) , "w" , newline = "\n" , encoding = "utf-8" ) as agg_csv : arg_4 = parsed_aggregate_reports_to_csv ( arg_2 ) agg_csv . write ( arg_4 ) with open ( "{0}" . format ( os . path . join ( arg_1 , "forensic.json" ) ) , "w" , newline = "\n" , encoding = "utf-8" ) as for_json : for_json . write ( json . dumps ( arg_3 , ensure_ascii = False , indent = 2 ) ) with open ( "{0}" . format ( os . path . join ( arg_1 , "forensic.csv" ) ) , "w" , newline = "\n" , encoding = "utf-8" ) as for_csv : arg_4 = parsed_forensic_reports_to_csv ( arg_3 ) for_csv . write ( arg_4 ) arg_5 = os . path . join ( arg_1 , "samples" ) if not os . path . exists ( arg_5 ) : os . makedirs ( arg_5 ) arg_6 = [ ] for arg_7 in arg_3 : arg_8 = arg_7 [ "sample" ] arg_9 = 0 arg_10 = arg_7 [ "parsed_sample" ] arg_11 = arg_10 [ "filename_safe_subject" ] arg_12 = arg_11 while arg_12 in arg_6 : arg_9 += 1 arg_12 = "{0} ({1})" . format ( arg_11 , arg_9 ) arg_6 . append ( arg_12 ) arg_12 = "{0}.eml" . format ( arg_12 ) arg_13 = os . path . join ( arg_5 , arg_12 ) with open ( arg_13 , "w" , newline = "\n" , encoding = "utf-8" ) as sample_file : sample_file . write ( arg_8 )

Generates a jobs_pending progress bar widget.


Question: Similar to from_arrays but convenient for a DataFrame of length 1 .

def Func ( ** arg_0 ) : import numpy as np return from_arrays ( ** { arg_1 : np . array ( [ arg_2 ] ) for arg_1 , arg_2 in arg_0 . items ( ) } )

Initializes eventlet and starts wait for workers to exit.

        Spawns the workers returned from serve_rpc


Question: r Access descriptor value by descriptor name or instance .

def Func ( arg_0 ) : if arg_0 . _Func_to_value is None : arg_0 . _Func_to_value = { str ( d ) : v for d , v in zip ( arg_0 . _descriptors , arg_0 . _values ) } return GetValueByName ( arg_0 . _Func_to_value )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: This internal helper does the common work for set_ocsp_server_callback and set_ocsp_client_callback which is almost all of it .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _ocsp_helper = arg_1 arg_0 . _ocsp_callback = arg_1 . callback if arg_2 is None : arg_0 . _ocsp_data = _ffi . NULL else : arg_0 . _ocsp_data = _ffi . new_handle ( arg_2 ) arg_6 = _lib . SSL_CTX_set_tlsext_status_cb ( arg_0 . _context , arg_0 . _ocsp_callback ) _openssl_assert ( arg_6 == 1 ) arg_6 = _lib . SSL_CTX_set_tlsext_status_arg ( arg_0 . _context , arg_0 . _ocsp_data ) _openssl_assert ( arg_6 == 1 )

Remove cards from watchlist.

        :params trade_id: Trade id.


Question: Return a ConfigNode object representing a child node with the specified relative path .

def Func ( arg_0 , arg_1 ) : if arg_0 . _path : arg_1 = '{}.{}' . format ( arg_0 . _path , arg_1 ) return ConfigNode ( root = arg_0 . _root , arg_1 = arg_1 )

Upload all po files to GDocs ignoring conflicts.
        This method looks for all msgids in po_files and sends them
        as ods to GDocs Spreadsheet.


Question: Import run_sql .

def Func ( ) : try : from invenio . dbquery import run_sql except ImportError : from invenio . legacy . dbquery import run_sql return run_sql

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Splicing URLs according to video ID to get video details

def Func ( arg_0 ) : arg_1 = [ "" ] * 256 for arg_2 , arg_3 in enumerate ( arg_1 ) : arg_4 = arg_2 for arg_5 in range ( 8 ) : arg_4 = - 306674912 ^ unsigned_right_shitf ( arg_4 , 1 ) if 1 & arg_4 else unsigned_right_shitf ( arg_4 , 1 ) arg_1 [ arg_2 ] = arg_4 def tmp ( ) : arg_6 = random . random ( ) arg_7 = "/video/urls/v/1/toutiao/mp4/{video_id}?r={random_num}" . format ( arg_0 = arg_0 , random_num = str ( arg_6 ) [ 2 : ] ) arg_8 = arg_11 = arg_10 = - 1 arg_5 , arg_9 = 0 , len ( arg_7 ) while arg_5 < arg_9 : arg_8 = ord ( arg_7 [ arg_5 ] ) arg_5 += 1 if arg_8 < 128 : arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ arg_8 ) ] else : if arg_8 < 2048 : arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 192 | arg_8 >> 6 & 31 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | 63 & arg_8 ) ) ] else : if 55296 <= arg_8 < 57344 : arg_8 = ( 1023 & arg_8 ) + 64 arg_5 += 1 arg_11 = 1023 & arg_4 . url ( arg_5 ) arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 240 | arg_8 >> 8 & 7 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | arg_8 >> 2 & 63 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | arg_11 >> 6 & 15 | ( 3 & arg_8 ) << 4 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | 63 & arg_11 ) ) ] else : arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 224 | arg_8 >> 12 & 15 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | arg_8 >> 6 & 63 ) ) ] arg_10 = unsigned_right_shitf ( arg_10 , 8 ) ^ arg_1 [ 255 & ( arg_10 ^ ( 128 | 63 & arg_8 ) ) ] return "https://ib.365yg.com{path}&s={param}" . format ( arg_7 = arg_7 , param = unsigned_right_shitf ( arg_10 ^ - 1 , 0 ) ) while 1 : arg_12 = tmp ( ) if arg_12 . split ( "=" ) [ - 1 ] [ 0 ] != "-" : return arg_12

Stop streaming samples from device and delete samples buffer


Question: List existing reliable dictionaries .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Cluster . from_sfclient ( arg_0 ) arg_4 = arg_3 . get_application ( arg_1 ) . get_service ( arg_2 ) for arg_5 in arg_4 . get_dictionaries ( ) : print ( arg_5 . name )

This internal helper does the common work for
        ``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is
        almost all of it.


Question: Add a MARCXML datafield as a new child to a XML document .

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = '' , arg_4 = [ ] , arg_5 = '' ) : if arg_5 : arg_6 = etree . Element ( "controlfield" , attrib = { "tag" : arg_1 , } ) arg_6 . text = unicode ( arg_5 ) else : arg_6 = etree . Element ( "datafield" , attrib = { "tag" : arg_1 , "ind1" : arg_2 , "ind2" : arg_3 , } ) for arg_8 , arg_9 in arg_4 : arg_10 = etree . SubElement ( arg_6 , "subfield" , attrib = { "code" : arg_8 } ) arg_10 . text = arg_9 arg_0 . append ( arg_6 ) return arg_0

Return the RSSI signal strength in decibels.


Question: Extract a member from the archive to the current working directory using its full name . Its file information is extracted as accurately as possible . member may be a filename or a RarInfo object . You can specify a different directory using path .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if isinstance ( arg_1 , RarInfo ) : arg_1 = arg_1 . filename if arg_2 is None : arg_2 = os . getcwd ( ) arg_0 . _Func_members ( [ arg_1 ] , arg_2 , arg_3 ) return os . path . join ( arg_2 , arg_1 )

Propagate "clk" clock and reset "rst" signal to all subcomponents


Question: Find a handler for the line_info by trying checkers .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . checkers : if arg_2 . enabled : arg_3 = arg_2 . check ( arg_1 ) if arg_3 : return arg_3 return arg_0 . get_handler_by_name ( 'normal' )


Question: Update all displayed values

def Func ( arg_0 , arg_1 ) : arg_2 = gridlib . GridTableMessage ( arg_0 , gridlib . GRIDTABLE_REQUEST_VIEW_GET_VALUES ) arg_1 . ProcessTableMessage ( arg_2 )

An intelligent wrapper for ``open``.

    Parameters
    ----------
    name_or_fdesc : string-type or open file descriptor
        If a string type, refers to the path to a file on disk.

        If an open file descriptor, it is returned as-is.

    mode : string
        The mode with which to open the file.
        See ``open`` for details.

    fmt : string ['auto', 'jams', 'json', 'jamz']
        The encoding for the input/output stream.

        If `auto`, the format is inferred from the filename extension.

        Otherwise, use the specified coding.

    See Also
    --------
    open
    gzip.open


Question: return a list of Is where the data first crosses above threshold .

def Func ( arg_0 , arg_1 ) : arg_2 = np . where ( arg_0 > arg_1 ) [ 0 ] arg_2 = np . concatenate ( ( [ 0 ] , arg_2 ) ) arg_3 = arg_2 [ : - 1 ] - arg_2 [ 1 : ] + 1 return arg_2 [ np . where ( arg_3 ) [ 0 ] + 1 ]

Requests the logging manager to configure logging.

    :param extract:

        If naming data should be extracted from the trajectory


Question: Parse a single command .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] arg_4 = arg_2 for arg_5 in arg_0 . elements : arg_6 = arg_5 [ 'bracket' ] arg_7 = arg_0 . _brackets [ arg_6 ] arg_8 = None arg_9 = None for arg_10 , arg_11 in enumerate ( arg_1 [ arg_4 : ] , start = arg_4 ) : if arg_11 == arg_5 [ 'bracket' ] : arg_8 = arg_10 break elif arg_11 == '\n' : if arg_5 [ 'required' ] is True : arg_12 = arg_0 . _parse_whitespace_argument ( arg_1 [ arg_4 : ] , arg_0 . name ) return ParsedCommand ( arg_0 . name , [ { 'index' : arg_5 [ 'index' ] , 'name' : arg_5 [ 'name' ] , 'content' : arg_12 . strip ( ) } ] , arg_2 , arg_1 [ arg_2 : arg_10 ] ) else : break if arg_8 is None and arg_5 [ 'required' ] is False : continue elif arg_8 is None and arg_5 [ 'required' ] is True : arg_13 = ( 'Parsing command {0} at index {1:d}, ' 'did not detect element {2:d}' . format ( arg_0 . name , arg_2 , arg_5 [ 'index' ] ) ) raise CommandParserError ( arg_13 ) arg_14 = 1 for arg_10 , arg_11 in enumerate ( arg_1 [ arg_8 + 1 : ] , start = arg_8 + 1 ) : if arg_11 == arg_6 : arg_14 += 1 elif arg_11 == arg_7 : arg_14 -= 1 if arg_14 == 0 : arg_9 = arg_10 break if arg_14 > 0 : arg_13 = ( 'Parsing command {0} at index {1:d}, ' 'did not find closing bracket for required ' 'command element {2:d}' . format ( arg_0 . name , arg_2 , arg_5 [ 'index' ] ) ) raise CommandParserError ( arg_13 ) arg_15 = arg_1 [ arg_8 + 1 : arg_9 ] arg_16 = { 'index' : arg_5 [ 'index' ] , 'name' : arg_5 [ 'name' ] , 'content' : arg_15 . strip ( ) } arg_3 . append ( arg_16 ) arg_4 = arg_9 + 1 arg_17 = arg_1 [ arg_2 : arg_4 ] arg_18 = ParsedCommand ( arg_0 . name , arg_3 , arg_2 , arg_17 ) return arg_18

Generate a header for a tag section with specific parameters.

        :param str newer_tag_name: Name (title) of newer tag.
        :param str newer_tag_link: Tag name of newer tag, used for links.
                               Could be same as **newer_tag_name** or some
                               specific value, like `HEAD`.
        :param datetime newer_tag_time: Date and time when
                                        newer tag was created.
        :param str older_tag_link: Tag name of older tag, used for links.
        :param str project_url: URL for current project.
        :rtype: str
        :return: Generated ready-to-add tag section.


Question: Return a standardized canonical tautomer SMILES string given a SMILES string .

def Func ( arg_0 ) : arg_1 = Chem . MolFromSmiles ( arg_0 , sanitize = False ) arg_1 = Standardizer ( ) . standardize ( arg_1 ) arg_2 = TautomerCanonicalizer ( ) . canonicalize ( arg_1 ) return Chem . MolToSmiles ( arg_2 , isomericSmiles = True )

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.


Question: Get the s3 object with the S3 URL . Return None if not exist .

def Func ( arg_0 , arg_1 ) : try : return arg_0 . s3 . head_object ( Bucket = arg_1 . bucket , Key = arg_1 . path ) except BotoClient . ClientError as e : if e . response [ 'ResponseMetadata' ] [ 'HTTPStatusCode' ] == 404 : return None else : raise e

Returns assignment data for the given course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.course_assignments


Question: Generate a number of plots for analyzing a strategy s transactions .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 'infer' , arg_5 = False ) : arg_1 = utils . check_intraday ( arg_4 , arg_0 , arg_1 , arg_2 ) arg_6 = 6 if arg_3 is not None else 4 arg_7 = plt . figure ( figsize = ( 14 , arg_6 * 6 ) ) arg_8 = gridspec . GridSpec ( arg_6 , 3 , wspace = 0.5 , hspace = 0.5 ) arg_9 = plt . subplot ( arg_8 [ 0 , : ] ) arg_10 = plt . subplot ( arg_8 [ 1 , : ] , sharex = arg_9 ) arg_11 = plt . subplot ( arg_8 [ 2 , : ] ) arg_12 = plt . subplot ( arg_8 [ 3 , : ] ) plotting . plot_turnover ( arg_0 , arg_2 , arg_1 , arg_15 = arg_9 ) plotting . plot_daily_volume ( arg_0 , arg_2 , arg_15 = arg_10 ) try : plotting . plot_daily_turnover_hist ( arg_2 , arg_1 , arg_15 = arg_11 ) except ValueError : warnings . warn ( 'Unable to generate turnover plot.' , UserWarning ) plotting . plot_txn_time_hist ( arg_2 , arg_15 = arg_12 ) if arg_3 is not None : arg_13 = plt . subplot ( arg_8 [ 4 , : ] ) plotting . plot_slippage_sweep ( arg_3 , arg_1 , arg_2 , arg_15 = arg_13 ) arg_14 = plt . subplot ( arg_8 [ 5 , : ] ) plotting . plot_slippage_sensitivity ( arg_3 , arg_1 , arg_2 , arg_15 = arg_14 ) for arg_15 in arg_7 . axes : plt . setp ( arg_15 . get_xticklabels ( ) , visible = True ) if arg_5 : return arg_7

Overriding the default JSONEncoder.default for NDB support.


Question: Returns a list of values ordered identically to keys

def Func ( arg_0 , arg_1 , * arg_2 ) : arg_2 = list_or_args ( arg_1 , arg_2 ) arg_3 = { } arg_4 = { } for arg_5 in arg_2 : arg_6 = arg_0 . get_server_name ( arg_5 ) arg_3 [ arg_6 ] = arg_3 . get ( arg_6 , [ ] ) arg_3 [ arg_6 ] . append ( arg_5 ) for arg_6 , arg_7 in iteritems ( arg_3 ) : arg_8 = arg_0 . connections [ arg_6 ] . Func ( arg_7 ) arg_4 . update ( dict ( zip ( arg_7 , arg_8 ) ) ) arg_9 = [ ] for arg_5 in arg_2 : arg_9 . append ( arg_4 . get ( arg_5 , None ) ) return arg_9


Question: Get the value in the request either through query parameters or posted data from a key .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_0 . method in [ 'GET' , 'DELETE' ] : return arg_0 . query_params . get ( arg_1 , arg_0 . data . get ( arg_1 , arg_2 ) ) return arg_0 . data . get ( arg_1 , arg_0 . query_params . get ( arg_1 , arg_2 ) )

Set the data type of the cluster.

        Parameters:
        -----------
        cluster_dtype : numpy.dtype or equivalent
            Defines the dtype of the cluster array.


Question: Write or append data into the given file path .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_2 or not path . isfile ( arg_0 . file ) : with open ( arg_0 . file , "w" , encoding = "utf-8" , newline = "\n" ) as file : if arg_1 and isinstance ( arg_1 , str ) : file . Func ( arg_1 ) else : with open ( arg_0 . file , "a" , encoding = "utf-8" , newline = "\n" ) as file : if arg_1 and isinstance ( arg_1 , str ) : file . Func ( arg_1 )


Question: Return the element in table_name with Object ID eid . If None is found will raise a KeyError exception .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . table ( arg_1 ) . get ( arg_2 = arg_2 ) if arg_3 is None : raise KeyError ( 'Could not find {} with eid {}.' . format ( arg_1 , arg_2 ) ) return arg_3

Respond when the server indicates that the client is out of sync.

        The server can request a sync when this client sends a message that
        fails the check() on the server.  If the reason for the failure isn't
        very serious, then the server can decide to send it as usual in the
        interest of a smooth gameplay experience.  When this happens, the
        server sends out an extra response providing the clients with the
        information they need to resync themselves.


Question: upload a media on twitter

async def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , ** arg_6 ) : if isinstance ( arg_1 , str ) : arg_7 = urlparse ( arg_1 ) if arg_7 . scheme . startswith ( 'http' ) : arg_8 = await arg_0 . _session . get ( arg_1 ) else : arg_9 = urlparse ( arg_1 ) . path . strip ( " \"'" ) arg_8 = await utils . execute ( open ( arg_9 , 'rb' ) ) elif hasattr ( arg_1 , 'read' ) or isinstance ( arg_1 , bytes ) : arg_8 = arg_1 else : raise TypeError ( "Func input must be a file object or a " "filename or binary data or an aiohttp request" ) arg_10 = await utils . get_size ( arg_8 ) if arg_4 is not None : arg_11 = False else : arg_11 = await arg_0 . _size_test ( arg_10 , arg_5 ) if isinstance ( arg_8 , aiohttp . ClientResponse ) : arg_8 = arg_8 . content if arg_4 or ( arg_11 and arg_4 is None ) : arg_12 = arg_8 , arg_10 , arg_1 , arg_2 , arg_3 arg_13 = await arg_0 . _chunked_upload ( * arg_12 , ** arg_6 ) else : arg_13 = await arg_0 . upload . media . upload . post ( arg_8 = arg_8 , ** arg_6 ) if not hasattr ( arg_1 , 'read' ) and not getattr ( arg_8 , 'closed' , True ) : arg_8 . close ( ) return arg_13

Generate a path value of type result_type.

    result_type can either be bytes or text_type


Question: Writes a report from multiple samples .

def Func ( arg_0 , arg_1 , arg_2 ) : with open ( arg_1 , "w" ) as fh , open ( ".report.json" , "w" ) as json_rep : fh . write ( "Sample,Total length,Total trimmed,%,5end Trim,3end Trim," "bad_reads\\n" ) for arg_3 , arg_4 in arg_0 . items ( ) : fh . write ( "{},{}\\n" . format ( arg_3 , "," . join ( [ str ( arg_5 ) for arg_5 in arg_4 . values ( ) ] ) ) ) arg_6 = { "tableRow" : [ { "sample" : arg_2 , "data" : [ { "header" : "trimmed" , "value" : arg_4 [ "total_trim_perc" ] , "table" : "qc" , "columnBar" : True } , ] } ] , "plotData" : [ { "sample" : arg_2 , "data" : { "sparkline" : arg_4 [ "clean_len" ] } } ] , "badReads" : arg_4 [ "bad_reads" ] } json_rep . write ( json . dumps ( arg_6 , separators = ( "," , ":" ) ) )

Overriding the default JSONEncoder.default for NDB support.


Question: Re - calculates the position of the Label .

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . size arg_3 , arg_4 = arg_0 . pos arg_0 . _label . anchor_x = "left" arg_0 . _label . x = arg_3 + arg_1 / 2. + arg_1 arg_0 . _label . y = arg_4 + arg_2 / 2. + arg_2 * .15 arg_0 . _label . _update ( )

Return True if we should retry, False otherwise.


Question: Return a new Streamlet by applying map_function to each element of this Streamlet .

def Func ( arg_0 , arg_1 ) : from heronpy . streamlet . impl . Funcbolt import MapStreamlet arg_2 = MapStreamlet ( arg_1 , arg_0 ) arg_0 . _add_child ( arg_2 ) return arg_2

Gets the unique backends that are available.

    Returns:
        list: Unique available backends.

    Raises:
        QiskitError: No backends available.


Question: Remove groups from the model .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , string_types ) or hasattr ( arg_1 , "id" ) : warn ( "need to pass in a list" ) arg_1 = [ arg_1 ] for arg_2 in arg_1 : if arg_2 . id not in arg_0 . groups : LOGGER . warning ( "%r not in %r. Ignored." , arg_2 , arg_0 ) else : arg_0 . groups . remove ( arg_2 ) arg_2 . _model = None


Question: Flip an image horizontally or vertically .

def Func ( arg_0 , arg_1 = 'horizontal' ) : assert arg_1 in [ 'horizontal' , 'vertical' ] if arg_1 == 'horizontal' : return np . flip ( arg_0 , axis = 1 ) else : return np . flip ( arg_0 , axis = 0 )

Verify course ID and retrieve course details.


Question: Installs Vagrant from the most recent package available from their homepage .

def Func ( arg_0 ) : from burlap . system import get_arch , distrib_family arg_1 = arg_0 . local_renderer arg_2 = urlopen ( arg_1 . env . download_url ) . read ( ) print ( len ( arg_2 ) ) arg_3 = DOWNLOAD_LINK_PATTERN . findall ( arg_2 ) print ( arg_3 ) arg_4 = get_arch ( ) arg_5 = distrib_family ( ) if arg_5 == DEBIAN : arg_6 = '.deb' arg_3 = [ match for match in arg_3 if match . endswith ( arg_6 ) and arg_4 in match ] print ( 'matches:' , arg_3 ) assert arg_3 , "No matches found." assert len ( arg_3 ) == 1 , "Too many matches found: %s" % ( ', ' . join ( arg_3 ) ) arg_1 . env . final_download_url = arg_3 [ 0 ] arg_1 . env . local_filename = '/tmp/vagrant%s' % arg_6 arg_1 . run ( 'wget -O {local_filename} {final_download_url}' ) arg_1 . sudo ( 'dpkg -i {local_filename}' ) else : raise NotImplementedError ( 'Unsupported family: %s' % arg_5 )

Condition to stop when any batch member converges, or all have failed.


Question: Construct a datetime from a given date and a given time .

def Func ( arg_0 , arg_1 , arg_2 ) : if not isinstance ( arg_1 , _date_class ) : raise TypeError ( "date argument must be a date instance" ) if not isinstance ( arg_2 , _time_class ) : raise TypeError ( "time argument must be a time instance" ) return arg_0 ( arg_1 . year , arg_1 . month , arg_1 . day , arg_2 . hour , arg_2 . minute , arg_2 . second , arg_2 . microsecond , arg_2 . tzinfo )

Sets the review comment. Raises CardinalityError if
        already set. OrderError if no reviewer defined before.


Question: Purge the stash from all keys

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : arg_0 . _assert_valid_stash ( ) if not arg_1 : raise GhostError ( "The `force` flag must be provided to perform a stash Func. " "I mean, you don't really want to just delete everything " "without precautionary measures eh?" ) audit ( storage = arg_0 . _storage . db_path , action = 'PURGE' , message = json . dumps ( dict ( ) ) ) for arg_3 in arg_0 . list ( arg_2 = arg_2 ) : arg_0 . delete ( arg_3 )

Override of clean method to perform additional validation


Question: Obtain the encrypted masterkey

def Func ( arg_0 ) : if not arg_0 . unlocked ( ) : raise WalletLocked arg_1 = AESCipher ( arg_0 . password ) return "{}${}" . format ( arg_0 . _derive_checksum ( arg_0 . masterkey ) , arg_1 . encrypt ( arg_0 . masterkey ) )

Create a traceback for an Octave evaluation error.


Question: Render data with template return html unicodes . parameters template str the template s filename data dict the data to render

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . global_data . copy ( ) arg_3 . update ( arg_2 ) try : arg_4 = arg_0 . env . get_template ( arg_1 ) . Func ( ** arg_3 ) except TemplateNotFound : raise JinjaTemplateNotFound return arg_4

Gets the level for the variant.

        :param int level: the current variant level
        :param int variant: the value for this level if variant

        :returns: a level for the object and one for the function
        :rtype: int * int