Question: Destroy nDestroy synapses on the specified segment but don t destroy synapses to the excludeCells .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = sorted ( ( arg_10 for arg_10 in arg_1 . synapsesForSegment ( arg_3 ) if arg_10 . presynapticCell not in arg_5 ) , key = lambda s : s . _ordinal ) for arg_7 in xrange ( arg_4 ) : if len ( arg_6 ) == 0 : break arg_8 = None arg_9 = float ( "inf" ) for arg_10 in arg_6 : if arg_10 . permanence < arg_9 - EPSILON : arg_8 = arg_10 arg_9 = arg_10 . permanence arg_1 . destroySynapse ( arg_8 ) arg_6 . remove ( arg_8 )

Load a configuration module and return a Config


Question: Returns head coach data by game .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _year_info_pq ( arg_1 , 'Coach' ) . text ( ) arg_3 = r'(\S+?) \((\d+)-(\d+)-(\d+)\)' arg_4 = [ ] arg_5 = True while arg_5 : arg_5 = re . search ( arg_3 , arg_2 ) arg_6 , arg_7 , arg_8 , arg_9 = arg_5 . groups ( ) arg_10 = arg_5 . end ( 4 ) + 1 arg_11 = arg_11 [ arg_10 : ] arg_12 = int ( arg_7 ) + int ( arg_8 ) + int ( arg_9 ) arg_4 . append ( ( arg_6 , arg_12 ) ) arg_13 = [ cID for cID , games in arg_4 for _ in range ( games ) ] return np . array ( arg_13 [ : : - 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: Decorator for methods that need many retries because of intermittent failures such as AWS calls via boto which has a non - back - off retry .

def Func ( arg_0 ) : def retry_func ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = 1 while True : try : return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) break except OSError as exc : logger . error ( 'assuming OSError unrecoverable' ) raise except FailedExtraction as exc : logger . error ( 'FAIL(%d)' , arg_4 , exc_info = True ) raise except FailedVerification as exc : logger . warn ( 'FAIL(%d)' , arg_4 , exc_info = True ) if arg_4 >= arg_1 . config [ 'tries' ] : if arg_1 . config . get ( 'suppress_failures' ) : logger . warn ( 'suppressing failure and breaking out of this loop; data may be corrupt, downstream will have to cope' ) break else : raise except Exception as exc : logger . warn ( 'FAIL(%d): having I/O trouble with S3' , arg_4 , exc_info = True ) if arg_4 >= arg_1 . config [ 'tries' ] : raise logger . warn ( 'RETRYING (%d left)' , arg_1 . config [ 'tries' ] - arg_4 ) time . sleep ( 3 * arg_4 ) arg_4 += 1 return retry_func

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

    https://iexcloud.io/docs/api/#sector-performance
    8am-5pm ET Mon-Fri

    Args:
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result


Question: Organization data validation

def Func ( arg_0 ) : if arg_0 is None : return False if 'id' in arg_0 and not arg_0 . get ( 'id' ) : return False if 'name' in arg_0 and not arg_0 . get ( 'name' ) : return False return True

Prepare received data for representation.

        Args:
            data (dict): values to represent (ex. {'001' : 130})
            number_to_keep (int): number of elements to show individually.

        Returns:
            dict: processed data to show.


Question: May generate and add a PDFPage separately or use this to generate a default page .

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_0 . page = PDFPage ( arg_0 . orientation_default , arg_0 . layout_default , arg_0 . margins ) else : arg_0 . page = arg_1 arg_0 . page . _set_index ( len ( arg_0 . pages ) ) arg_0 . pages . append ( arg_0 . page ) arg_2 = arg_0 . font arg_0 . set_font ( font = arg_2 ) arg_0 . session . _reset_colors ( )

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: Read one byte in stream

def Func ( arg_0 ) -> bool : if arg_0 . read_eof ( ) : return False arg_0 . _stream . incpos ( ) return True

Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.


Question: Get letters from string only .

def Func ( arg_0 ) : arg_1 = "" for arg_2 in arg_0 : if arg_2 . isalpha ( ) : arg_1 += arg_2 return arg_1

Accept a publication request at form value 'epub


Question: Returns the column of the cursor in the input buffer excluding the contribution by the prompt or - 1 if there is no such column .

def Func ( arg_0 ) : arg_1 = arg_0 . _get_input_buffer_cursor_prompt ( ) if arg_1 is None : return - 1 else : arg_2 = arg_0 . _control . textCursor ( ) return arg_2 . columnNumber ( ) - len ( arg_1 )

Set a decrypted value by key in a giraffez configuration file.

        :param str key: The key used to lookup the encrypted value
        :param value: Value to set at the given key, can be any value that is
            YAML serializeable.


Question: Apply a specified mutant to the source code

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = filename_and_mutation_id_from_pk ( int ( arg_0 ) ) update_line_numbers ( arg_3 ) arg_5 = Context ( arg_4 = arg_4 , arg_3 = arg_3 , arg_1 = arg_1 , ) mutate_file ( arg_2 = arg_2 , arg_5 = arg_5 , ) if arg_5 . number_of_performed_mutations == 0 : raise RuntimeError ( 'No mutations performed.' )

Launches GBDX workflow.

        Args:
            workflow (dict): Dictionary specifying workflow tasks.

        Returns:
            Workflow id (str).


Question: Output a link tag to a css stylesheet .

def Func ( arg_0 ) : if not arg_0 . startswith ( 'http://' ) and not arg_0 [ : 1 ] == '/' : arg_0 = settings . STATIC_URL + arg_0 return '<link href="{src}" rel="stylesheet">' . format ( src = arg_0 )

Inform the widget about the encoding of the underlying character stream.


Question: Extract arguments for model from the environment and return as a tuple that is ready to be passed to the model .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = inspect . getfullargspec ( arg_1 ) if arg_3 . varargs : logger . warning ( "ABI: A vararg model must be a unary function." ) arg_4 = len ( arg_3 . args ) - len ( arg_2 ) if inspect . ismethod ( arg_1 ) : arg_4 -= 1 def resolve_argument ( arg_5 ) : if isinstance ( arg_5 , str ) : return arg_0 . _cpu . read_register ( arg_5 ) else : return arg_0 . _cpu . read_int ( arg_5 ) arg_6 = arg_0 . get_arguments ( ) arg_7 = map ( resolve_argument , arg_6 ) from . . models import isvariadic if isvariadic ( arg_1 ) : arg_8 = arg_2 + ( arg_7 , ) else : arg_8 = arg_2 + tuple ( islice ( arg_7 , arg_4 ) ) return arg_8

write lines, one by one, separated by \n to device


Question: Extract Packed Floating - Point Values

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_3 = arg_3 . read ( ) arg_1 . write ( Operators . EXTRACT ( arg_2 . read ( ) , arg_3 * 128 , ( arg_3 + 1 ) * 128 ) )


Question: Calculate the concurrence .

def Func ( arg_0 ) : arg_1 = np . array ( arg_0 ) if arg_1 . ndim == 1 : arg_1 = outer ( arg_0 ) if len ( arg_0 ) != 4 : raise Exception ( "Concurrence is only defined for more than two qubits" ) arg_2 = np . fliplr ( np . diag ( [ - 1 , 1 , 1 , - 1 ] ) ) arg_3 = arg_1 . dot ( arg_2 ) . dot ( arg_1 . conj ( ) ) . dot ( arg_2 ) arg_4 = la . eigh ( arg_3 , eigvals_only = True ) arg_4 = np . sqrt ( np . maximum ( arg_4 , 0 ) ) return max ( 0.0 , arg_4 [ - 1 ] - np . sum ( arg_4 [ 0 : - 1 ] ) )

Call the restful endpoint to merge two RAMON objects into one.

        Arguments:
            token (str): The token to inspect
            channel (str): The channel to inspect
            ids (int[]): the list of the IDs to merge
            delete (bool : False): Whether to delete after merging.

        Returns:
            json: The ID as returned by ndstore


Question: Discard deposit changes .

def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or arg_0 . pid with db . session . begin_nested ( ) : before_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) arg_2 , arg_3 = arg_0 . fetch_published ( ) arg_0 . model . json = deepcopy ( arg_3 . model . json ) arg_0 . model . json [ '$schema' ] = arg_0 . build_deposit_schema ( arg_3 ) flag_modified ( arg_0 . model , 'json' ) db . session . merge ( arg_0 . model ) after_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) return arg_0 . __class__ ( arg_0 . model . json , arg_4 = arg_0 . model )

DRF view to list all catalogs.

        Arguments:
            request (HttpRequest): Current request

        Returns:
            (Response): DRF response object containing course catalogs.


Question: Get the frequencies for FFT bins

def Func ( arg_0 , arg_1 = 22050 , ** arg_2 ) : arg_3 = 2 * ( arg_0 - 1 ) arg_4 = core . fft_frequencies ( arg_1 = arg_1 , arg_3 = arg_3 ) arg_5 = arg_4 [ - 1 ] arg_4 -= 0.5 * ( arg_4 [ 1 ] - arg_4 [ 0 ] ) arg_4 = np . append ( np . maximum ( 0 , arg_4 ) , [ arg_5 ] ) return arg_4

Drop a node from the network

        :param node: node to drop
        :type node: Node


Question: Renders a javascript snippet suitable for use as a mapbox - gl heatmap paint entry

def Func ( arg_0 ) : arg_1 = { 'heatmap-radius' : VectorStyle . get_style_value ( arg_0 . radius ) , 'heatmap-opacity' : VectorStyle . get_style_value ( arg_0 . opacity ) , 'heatmap-color' : VectorStyle . get_style_value ( arg_0 . color ) , 'heatmap-intensity' : VectorStyle . get_style_value ( arg_0 . intensity ) , 'heatmap-weight' : VectorStyle . get_style_value ( arg_0 . weight ) } return arg_1

Load the configuration.

    :param under_test:
        Tell us if we only have to load the configuration file (True)
        or load the configuration file and initate the output directory
        if it does not exist (False).
    :type under_test: bool

    :param custom:
        A dict with the configuration index (from .PyFunceble.yaml) to update.
    :type custom: dict

    .. warning::
        If :code:`custom` is given, the given :code:`dict` overwrite
        the last value of the given configuration indexes.


Question: Returns the SQL literal of the cell as a string .

def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return None if isinstance ( arg_0 , datetime ) : return arg_0 . isoformat ( ) return str ( arg_0 )

Read the file and perform any transforms to get a loaded image


Question: Sets the document data license . Raises value error if malformed value CardinalityError if already defined .

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . doc_data_lics_set : arg_0 . doc_data_lics_set = True if validations . validate_data_lics ( arg_2 ) : arg_1 . data_license = document . License . from_identifier ( arg_2 ) return True else : raise SPDXValueError ( 'Document::DataLicense' ) else : raise CardinalityError ( 'Document::DataLicense' )

Stop the timer

        Returns:
            The time the timer was stopped


Question: Given a spec for an app returns the value of the build field for docker - compose . If the path is relative it is expanded and added to the path of the app s repo .

def Func ( arg_0 ) : if os . path . isabs ( arg_0 [ 'build' ] ) : return arg_0 [ 'build' ] return os . path . join ( Repo ( arg_0 [ 'repo' ] ) . local_path , arg_0 [ 'build' ] )

Cycles through notifications with latest results from data feeds.


Question: Unpack a directory using the same interface as for archives

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : if not arg_11 . path . isdir ( arg_0 ) : raise UnrecognizedFormat ( "%s is not a directory" % ( arg_0 , ) ) arg_4 = { arg_0 : ( '' , arg_1 ) } for arg_5 , arg_6 , arg_7 in arg_11 . walk ( arg_0 ) : arg_8 , arg_9 = arg_4 [ arg_5 ] for arg_10 in arg_6 : arg_4 [ arg_11 . path . join ( arg_5 , arg_10 ) ] = arg_8 + arg_10 + '/' , arg_11 . path . join ( arg_9 , arg_10 ) for arg_14 in arg_7 : arg_15 = arg_8 + arg_14 arg_16 = arg_11 . path . join ( arg_9 , arg_14 ) arg_16 = arg_2 ( arg_8 + arg_14 , arg_16 ) if not arg_16 : continue ensure_directory ( arg_16 ) arg_14 = arg_11 . path . join ( arg_5 , arg_14 ) shutil . copyfile ( arg_14 , arg_16 ) shutil . copystat ( arg_14 , arg_16 )

Get an access token from the provider token URI.

        :param code: Authorization code.
        :type code: str
        :return: Dict containing access token, refresh token, etc.
        :rtype: dict


Question: Build a mongo query across multiple cases . Translate query options from a form into a complete mongo query dictionary .

def Func ( arg_0 , arg_1 = None , arg_2 = 'snv' , arg_3 = [ 'clinical' ] ) : arg_1 = arg_1 or { } arg_4 = { } LOG . debug ( "Building a mongo query for %s" % arg_1 ) if arg_1 . get ( 'hgnc_symbols' ) : arg_4 [ 'hgnc_symbols' ] = { '$in' : arg_1 [ 'hgnc_symbols' ] } arg_4 [ 'variant_type' ] = { '$in' : arg_3 } arg_4 [ 'category' ] = arg_2 arg_5 = arg_1 . get ( 'rank_score' ) or 15 arg_4 [ 'rank_score' ] = { '$gte' : arg_5 } LOG . debug ( "Querying %s" % arg_4 ) return arg_4

Set a smoothing Gaussian kernel given its FWHM in mm.


Question: Calculate the mol mass of the compound

def Func ( arg_0 ) : try : return sum ( [ arg_2 * elements_and_molecular_Funcs [ arg_1 ] for arg_1 , arg_2 in arg_0 . elements . items ( ) ] ) except KeyError as e : warn ( "The element %s does not appear in the periodic table" % e )

Returns a DataFrame of offensive team splits for a season.

        :year: int representing the season.
        :returns: Pandas DataFrame of split data.


Question: _rem_id_from_keys - Remove primary key from table internal

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 . _get_connection ( ) arg_2 . srem ( arg_0 . _get_ids_key ( ) , arg_1 )

Returns a list of two actions per gcs bucket to mount.


Question: terminates the underlying x3270 subprocess . Once called this Emulator instance must no longer be used .

def Func ( arg_0 ) : if not arg_0 . is_Funcd : log . debug ( "terminal client Funcd" ) try : arg_0 . exec_command ( b"Quit" ) except BrokenPipeError : pass except socket . error as e : if e . errno != errno . ECONNRESET : raise arg_0 . app . close ( ) arg_0 . is_Funcd = True

Provide a label for a list of labels.

    The items in the list of labels are assumed to be either instances of
    :class:`Label`, or dicts with at least the key `label` in them. These will
    be passed to the :func:`dict_to_label` function.

    This method tries to find a label by looking if there's
    a pref label for the specified language. If there's no pref label,
    it looks for an alt label. It disregards hidden labels.

    While matching languages, preference will be given to exact matches. But,
    if no exact match is present, an inexact match will be attempted. This might
    be because a label in language `nl-BE` is being requested, but only `nl` or
    even `nl-NL` is present. Similarly, when requesting `nl`, a label with
    language `nl-NL` or even `nl-Latn-NL` will also be considered,
    providing no label is present that has an exact match with the
    requested language.

    If language 'any' was specified, all labels will be considered,
    regardless of language.

    To find a label without a specified language, pass `None` as language.

    If a language or None was specified, and no label could be found, this
    method will automatically try to find a label in some other language.

    Finally, if no label could be found, None is returned.

    :param string language: The preferred language to receive the label in. This
        should be a valid IANA language tag.
    :param boolean sortLabel: Should sortLabels be considered or not? If True,
        sortLabels will be preferred over prefLabels. Bear in mind that these
        are still language dependent. So, it's possible to have a different
        sortLabel per language.
    :rtype: A :class:`Label` or `None` if no label could be found.


Question: Create a node for spdx . file .

def Func ( arg_0 , arg_1 ) : arg_2 = URIRef ( 'http://www.spdx.org/files#{id}' . format ( id = str ( arg_1 . spdx_id ) ) ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . File ) arg_0 . graph . add ( arg_3 ) arg_4 = ( arg_2 , arg_0 . spdx_namespace . fileName , Literal ( arg_1 . name ) ) arg_0 . graph . add ( arg_4 ) if arg_1 . has_optional_field ( 'comment' ) : arg_5 = ( arg_2 , RDFS . comment , Literal ( arg_1 . comment ) ) arg_0 . graph . add ( arg_5 ) if arg_1 . has_optional_field ( 'type' ) : arg_6 = arg_0 . spdx_namespace [ arg_0 . FILE_TYPES [ arg_1 . type ] ] arg_7 = ( arg_2 , arg_0 . spdx_namespace . fileType , arg_6 ) arg_0 . graph . add ( arg_7 ) arg_0 . graph . add ( ( arg_2 , arg_0 . spdx_namespace . checksum , arg_0 . create_checksum_node ( arg_1 . chk_sum ) ) ) arg_8 = arg_0 . license_or_special ( arg_1 . conc_lics ) arg_9 = ( arg_2 , arg_0 . spdx_namespace . licenseConcluded , arg_8 ) arg_0 . graph . add ( arg_9 ) arg_10 = map ( arg_0 . license_or_special , arg_1 . licenses_in_file ) for arg_11 in arg_10 : arg_12 = ( arg_2 , arg_0 . spdx_namespace . licenseInfoInFile , arg_11 ) arg_0 . graph . add ( arg_12 ) if arg_1 . has_optional_field ( 'license_comment' ) : arg_5 = ( arg_2 , arg_0 . spdx_namespace . licenseComments , Literal ( arg_1 . license_comment ) ) arg_0 . graph . add ( arg_5 ) arg_13 = arg_0 . to_special_value ( arg_1 . copyright ) arg_14 = ( arg_2 , arg_0 . spdx_namespace . copyrightText , arg_13 ) arg_0 . graph . add ( arg_14 ) if arg_1 . has_optional_field ( 'notice' ) : arg_15 = ( arg_2 , arg_0 . spdx_namespace . noticeText , arg_1 . notice ) arg_0 . graph . add ( arg_15 ) arg_16 = map ( lambda c : Literal ( c ) , arg_1 . contributors ) arg_17 = [ ( arg_2 , arg_0 . spdx_namespace . fileContributor , node ) for node in arg_16 ] for arg_12 in arg_17 : arg_0 . graph . add ( arg_12 ) return arg_2

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: Set s the package s description . Raises CardinalityError if description already set . Raises OrderError if no package previously defined .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_desc_set : arg_0 . package_desc_set = True arg_1 . package . description = arg_2 else : raise CardinalityError ( 'Package::Description' )


Question: Returns the number of keys in the current database

def Func ( arg_0 ) : arg_1 = 0 for arg_2 , arg_3 in iteritems ( arg_0 . redises ) : if arg_2 . find ( '_slave' ) == - 1 : continue arg_1 += arg_3 . dbsize ( ) return arg_1


Question: Derivative of the covariance matrix over the parameters of L .

def Func ( arg_0 ) : arg_1 = arg_0 . L arg_0 . _grad_Lu [ : ] = 0 for arg_3 in range ( len ( arg_0 . _tril1 [ 0 ] ) ) : arg_4 = arg_0 . _tril1 [ 0 ] [ arg_3 ] arg_5 = arg_0 . _tril1 [ 1 ] [ arg_3 ] arg_0 . _grad_Lu [ arg_4 , : , arg_3 ] = arg_1 [ : , arg_5 ] arg_0 . _grad_Lu [ : , arg_4 , arg_3 ] += arg_1 [ : , arg_5 ] arg_6 = len ( arg_0 . _tril1 [ 0 ] ) for arg_3 in range ( len ( arg_0 . _diag [ 0 ] ) ) : arg_4 = arg_0 . _diag [ 0 ] [ arg_3 ] arg_5 = arg_0 . _diag [ 1 ] [ arg_3 ] arg_0 . _grad_Lu [ arg_4 , : , arg_6 + arg_3 ] = arg_1 [ arg_4 , arg_5 ] * arg_1 [ : , arg_5 ] arg_0 . _grad_Lu [ : , arg_4 , arg_6 + arg_3 ] += arg_1 [ arg_4 , arg_5 ] * arg_1 [ : , arg_5 ] return { "Lu" : arg_0 . _grad_Lu }


Question: Constructs the Continuous MDR feature map from the provided training data .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . feature_map = defaultdict ( lambda : arg_0 . default_label ) arg_0 . overall_mean_trait_value = np . mean ( arg_2 ) arg_0 . mdr_matrix_values = defaultdict ( list ) for arg_6 in range ( arg_1 . shape [ 0 ] ) : arg_7 = tuple ( arg_1 [ arg_6 ] ) arg_0 . mdr_matrix_values [ arg_7 ] . append ( arg_2 [ arg_6 ] ) for arg_7 in arg_0 . mdr_matrix_values : arg_8 = np . mean ( arg_0 . mdr_matrix_values [ arg_7 ] ) if arg_8 > arg_0 . overall_mean_trait_value : arg_0 . feature_map [ arg_7 ] = 1 elif arg_8 == arg_0 . overall_mean_trait_value : arg_0 . feature_map [ arg_7 ] = arg_0 . tie_break else : arg_0 . feature_map [ arg_7 ] = 0 arg_0 . feature_map = dict ( arg_0 . feature_map ) arg_0 . mdr_matrix_values = dict ( arg_0 . mdr_matrix_values ) return arg_0

Attach an observer.

        Args:
            observer (func): A function to be called when new messages arrive

        Returns:
            :class:`Stream`. Current instance to allow chaining


Question: Searches files satisfying query

def Func ( arg_0 , arg_1 , arg_2 = 0 ) : if arg_2 > 0 : print ( "Funcing " + arg_1 ) arg_1 = arg_1 . lower ( ) arg_3 = ng ( arg_1 , arg_0 . slb ) arg_4 = set ( ) for arg_5 in arg_3 : if arg_5 in arg_0 . ngrams . keys ( ) : for arg_6 in arg_0 . ngrams [ arg_5 ] : arg_4 . add ( arg_6 ) arg_0 . qocument = arg_4 arg_7 = { } for arg_6 in arg_4 : for arg_8 in arg_0 . D [ arg_6 ] . keys ( ) : if not arg_8 in arg_7 . keys ( ) : arg_7 [ arg_8 ] = 0 arg_7 [ arg_8 ] = arg_7 [ arg_8 ] + arg_0 . D [ arg_6 ] [ arg_8 ] arg_9 = sorted ( arg_7 . items ( ) , key = operator . itemgetter ( 1 ) , reverse = True ) return [ arg_0 . elements [ arg_10 [ 0 ] ] for arg_10 in arg_9 ]

Returns a DataFrame of offensive team splits for a season.

        :year: int representing the season.
        :returns: Pandas DataFrame of split data.


Question: reload - Reload all objects in this list . Updates in - place . To just fetch all these objects again use refetch

def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return [ ] arg_1 = [ ] for arg_2 in arg_0 : arg_3 = None try : arg_3 = arg_2 . Func ( ) except Exception as e : arg_3 = e arg_1 . append ( arg_3 ) return arg_1

Check if hdl process has event depenency on signal


Question: Get all data contained in hashed category hashroot as dict

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . keys ( arg_1 + "/*" ) arg_2 . sort ( ) arg_3 = len ( arg_2 ) and arg_2 [ - 1 ] or '' if arg_3 . endswith ( 'xx' ) : arg_2 = [ arg_3 ] + arg_2 [ : - 1 ] arg_4 = { } for arg_5 in arg_2 : try : arg_4 . update ( arg_0 [ arg_5 ] ) except KeyError : print "Corrupt" , arg_5 , "deleted - hset is not threadsafe!" del arg_0 [ arg_5 ] arg_0 . uncache ( arg_5 ) return arg_4

Generic IOP reader that interpolates the iop to the common wavelengths defined in the constructor

        :param file_name: filename and path of the csv file
        :returns interpolated iop


Question: Create a project

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = { 'title' : arg_1 , 'description' : arg_2 , 'currency' : arg_3 , 'budget' : arg_4 , 'jobs' : arg_5 } arg_7 = make_post_request ( arg_0 , 'projects' , arg_8 = arg_6 ) arg_8 = arg_7 . json ( ) if arg_7 . status_code == 200 : arg_6 = arg_8 [ 'result' ] arg_9 = Project ( arg_6 ) arg_9 . url = urljoin ( arg_0 . url , 'projects/%s' % arg_9 . seo_url ) return arg_9 else : raise ProjectNotCreatedException ( message = arg_8 [ 'message' ] , error_code = arg_8 [ 'error_code' ] , request_id = arg_8 [ 'request_id' ] , )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Get all providers registered .

def Func ( arg_0 , ** arg_1 ) : if 'ids' in arg_1 : arg_2 = [ arg_0 . concept_scheme_uri_map . get ( id , id ) for id in arg_1 [ 'ids' ] ] arg_3 = [ arg_0 . providers [ k ] for k in arg_0 . providers . keys ( ) if k in arg_2 ] else : arg_3 = list ( arg_0 . providers . values ( ) ) if 'subject' in arg_1 : arg_3 = [ p for p in arg_3 if arg_1 [ 'subject' ] in p . metadata [ 'subject' ] ] return arg_3


Question: Fit all the transforms one after the other and transform the data then use fit_transform on transformed data using the final estimator .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 , arg_2 = arg_0 . _pre_transform ( arg_1 , ** arg_2 ) if hasattr ( arg_0 . steps [ - 1 ] [ - 1 ] , 'Func' ) : return arg_0 . steps [ - 1 ] [ - 1 ] . Func ( arg_3 , ** arg_2 ) else : return arg_0 . steps [ - 1 ] [ - 1 ] . fit ( arg_3 , ** arg_2 ) . transform ( arg_3 )

Read attribute from sysfs and return as string


Question: Default exception handling that kicks in when an exception occurs that is not caught . In debug mode the exception will be re - raised immediately otherwise it is logged and the handler for a 500 internal server error is used . If no such handler exists a default 500 internal server error message is displayed .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = sys . exc_info ( ) got_request_exception . send ( arg_0 , exception = arg_1 ) arg_5 = arg_0 . error_handler_spec [ None ] . get ( 500 ) if arg_0 . propagate_exceptions : if arg_3 is arg_1 : reraise ( arg_2 , arg_3 , arg_4 ) else : raise arg_1 arg_0 . log_exception ( ( arg_2 , arg_3 , arg_4 ) ) if arg_5 is None : return InternalServerError ( ) return arg_5 ( arg_1 )

Replaces all occurrences of 'old' with 'new'


Question: Send a JSON POST request with the given request headers additional URL query parameters and the given JSON in the request body . The extra query parameters are merged with any which already exist in the URL . The json and data parameters may not both be given .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , ** arg_4 ) : if len ( arg_4 ) > 1 : raise InvalidArgumentsError ( "Too many extra args ({} > 1)" . format ( len ( arg_4 ) ) ) if arg_4 : arg_5 = next ( iter ( arg_4 ) ) if arg_5 not in ( "json" , "data" ) : raise InvalidArgumentsError ( "Invalid kwarg: " + arg_5 ) arg_6 = arg_0 . session . Func ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , ** arg_4 ) arg_6 . raise_for_status ( ) return _to_json ( arg_6 )

This function hides the error message when all values are correct.


Question: Returns an ogr . Geometry instance optionally created from a geojson str or dict . The spatial reference may also be provided .

def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'geojson' , None ) or len ( arg_0 ) and arg_0 [ 0 ] try : arg_3 = arg_1 . pop ( 'srs' , None ) or arg_2 . srs . wkt except AttributeError : arg_3 = SpatialReference ( 4326 ) if hasattr ( arg_2 , 'keys' ) : arg_4 = ogr . CreateFuncFromJson ( json . dumps ( arg_2 ) ) elif hasattr ( arg_2 , 'startswith' ) : arg_5 = arg_2 [ 0 ] if arg_2 else ' ' arg_6 = arg_5 if isinstance ( arg_5 , int ) else ord ( arg_5 ) if arg_6 in ( 0 , 1 ) : arg_4 = ogr . CreateFuncFromWkb ( arg_2 ) elif arg_2 . startswith ( '{' ) : arg_4 = ogr . CreateFuncFromJson ( arg_2 ) elif arg_2 . startswith ( '<gml' ) : arg_4 = ogr . CreateFuncFromGML ( arg_2 ) else : raise ValueError ( 'Invalid geometry value: %s' % arg_2 ) elif hasattr ( arg_2 , 'wkb' ) : arg_4 = ogr . CreateFuncFromWkb ( bytes ( arg_2 . wkb ) ) else : arg_4 = ogr . Func ( * arg_0 , ** arg_1 ) if arg_4 : if not isinstance ( arg_3 , SpatialReference ) : arg_3 = SpatialReference ( arg_3 ) arg_4 . AssignSpatialReference ( arg_3 ) return arg_4


Question: Try and convert matching Elements to unicode strings .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' ) : arg_4 = arg_0 . select ( arg_1 , arg_2 ) if arg_4 is not None : if isinstance ( arg_4 , ( list , tuple ) ) : if not len ( arg_4 ) : return return [ arg_0 . _Func_single ( arg_5 ) for arg_5 in arg_4 ] else : return arg_0 . _Func_single ( arg_4 ) else : if arg_0 . DEBUG : print ( arg_3 , "selector did not match anything; return None" ) return None

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: Yield a layer for all gates of this circuit .

def Func ( arg_0 ) : for arg_1 in arg_0 . topological_op_nodes ( ) : arg_2 = DAGCircuit ( ) for arg_3 in arg_0 . qregs . values ( ) : arg_2 . add_qreg ( arg_3 ) for arg_4 in arg_0 . cregs . values ( ) : arg_2 . add_creg ( arg_4 ) arg_5 = [ ] arg_6 = copy . copy ( arg_1 . op ) arg_7 = copy . copy ( arg_1 . qargs ) arg_8 = copy . copy ( arg_1 . cargs ) arg_9 = copy . copy ( arg_1 . condition ) arg_10 = arg_0 . _bits_in_condition ( arg_9 ) arg_2 . apply_operation_back ( arg_6 , arg_7 , arg_8 , arg_9 ) if arg_1 . name not in [ "barrier" , "snapshot" , "save" , "load" , "noise" ] : arg_5 . append ( list ( arg_7 ) ) arg_11 = { "graph" : arg_2 , "partition" : arg_5 } yield arg_11

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: Home assistant url

def Func ( arg_0 ) : arg_1 = super ( ExecuteHomeAssistant , arg_0 ) . Func ( ) if not arg_0 . data . get ( 'event' ) : raise InvalidConfig ( extra_body = 'Event option is required for HomeAsistant on {} device.' . format ( arg_0 . name ) ) arg_1 += '/api/events/{}' . format ( arg_0 . data [ 'event' ] ) return arg_1

Returns a list of the dicom files within root_path

    Parameters
    ----------
    root_path: str
    Path to the directory to be recursively searched for DICOM files.

    Returns
    -------
    dicoms: set
    Set of DICOM absolute file paths


Question: Start the kernel coordinating with the GTK event loop

def Func ( arg_0 ) : from . gui . gtkembed import GTKEmbed arg_1 = GTKEmbed ( arg_0 ) arg_1 . start ( )

This function populates the internal tableOfContents list with the contents
        of the zip file TOC. If the server does not support ranged requests, this will raise
        and exception. It will also throw an exception if the TOC cannot be found.


Question: Return a human readable format of a list .

def Func ( arg_0 ) : assert isinstance ( arg_0 , list ) arg_1 = 'Available Keys:' for arg_2 in arg_0 : arg_1 += '\n  - {0}' . format ( arg_2 ) return arg_1

Returns ON-OFF for all Stokes parameters given a cross_pols noise diode measurement


Question: Keep the row of the data corresponding to the maximal value in a column

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_2 , arg_5 [ arg_2 ] ] = None ) : if arg_3 is None : arg_0 = arg_0 [ arg_0 [ arg_1 ] == arg_0 [ arg_1 ] . max ( ) ] . reset_index ( drop = True ) else : arg_6 = arg_0 . groupby ( arg_3 ) [ arg_1 ] . transform ( 'max' ) arg_0 = ( arg_0 . loc [ arg_0 [ arg_1 ] == arg_6 , : ] . drop_duplicates ( ) . reset_index ( drop = True ) ) return arg_0

Starts closing the HighFive master. The server will be closed and
        all queued job sets will be cancelled.


Question: Wrapper that allow graceful exits of single runs

def Func ( arg_0 ) : try : arg_1 = arg_0 [ 'graceful_exit' ] if arg_1 : sigint_handling . start ( ) if sigint_handling . hit : arg_2 = ( sigint_handling . SIGINT , None ) else : arg_2 = _single_run ( arg_0 ) if sigint_handling . hit : arg_2 = ( sigint_handling . SIGINT , arg_2 ) return arg_2 return _single_run ( arg_0 ) except : arg_3 = logging . getLogger ( 'pypet' ) arg_3 . exception ( 'ERROR occurred during a single run! ' ) raise

Overriding the default JSONEncoder.default for NDB support.


Question: Create or update a VM scale set .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = False , arg_6 = True , ** arg_7 ) : arg_8 = arg_0 . _Func_initial ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = True , ** arg_7 ) def get_long_running_output ( arg_9 ) : arg_10 = arg_0 . _deserialize ( 'VirtualMachineScaleSet' , arg_9 ) if arg_5 : arg_11 = ClientRawResponse ( arg_10 , arg_9 ) return arg_11 return arg_10 arg_12 = arg_7 . get ( 'long_running_operation_timeout' , arg_0 . config . long_running_operation_timeout ) if arg_6 is True : arg_13 = ARMPolling ( arg_12 , ** arg_7 ) elif arg_6 is False : arg_13 = NoPolling ( ) else : arg_13 = arg_6 return LROPoller ( arg_0 . _client , arg_8 , get_long_running_output , arg_13 )

Read a varint from file, parse it, and return the decoded integer.


Question: Sign the certificate with this key and digest type .

def Func ( arg_0 , arg_1 , arg_2 ) : if not isinstance ( arg_1 , PKey ) : raise TypeError ( "pkey must be a PKey instance" ) if arg_1 . _only_public : raise ValueError ( "Key only has public part" ) if not arg_1 . _initialized : raise ValueError ( "Key is uninitialized" ) arg_3 = _lib . EVP_get_digestbyname ( _byte_string ( arg_2 ) ) if arg_3 == _ffi . NULL : raise ValueError ( "No such digest method" ) arg_4 = _lib . X509_Func ( arg_0 . _x509 , arg_1 . _pkey , arg_3 ) _openssl_assert ( arg_4 > 0 )

Helper function to get offset argument.
    Raises exception if argument is missing.
    Returns the offset argument.


Question: Send a request to MatchMaker and return its response

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = Headers ( ) arg_6 = { 'X-Auth-Token' : arg_1 } if arg_3 : arg_6 [ 'Content-Type' ] = arg_3 if arg_4 : arg_6 [ 'Accept' ] = arg_4 arg_7 = arg_5 or { 'timestamp' : datetime . datetime . now ( ) . timestamp ( ) } arg_8 = None try : LOG . info ( 'Sending {} request to MME url {}. Data sent: {}' . format ( arg_2 , arg_0 , arg_7 ) ) arg_9 = requests . request ( arg_2 = arg_2 , arg_0 = arg_0 , arg_6 = arg_6 , arg_5 = json . dumps ( arg_7 ) ) arg_8 = arg_9 . json ( ) LOG . info ( 'MME server response was:{}' . format ( arg_8 ) ) if isinstance ( arg_8 , str ) : arg_8 = { 'message' : arg_8 , } elif isinstance ( arg_8 , list ) : return arg_8 arg_8 [ 'status_code' ] = arg_9 . status_code except Exception as err : LOG . info ( 'An error occurred while sending HTTP request to server ({})' . format ( err ) ) arg_8 = { 'message' : str ( err ) } return arg_8

Unsigned divide.

        Divides (unsigned) the value in the AX register, DX:AX register pair,
        or EDX:EAX or RDX:RAX register pair (dividend) by the source operand
        (divisor) and stores the result in the AX (AH:AL), DX:AX, EDX:EAX or
        RDX:RAX registers. The source operand can be a general-purpose register
        or a memory location. The action of this instruction depends of the
        operand size (dividend/divisor). Division using 64-bit operand is
        available only in 64-bit mode. Non-integral results are truncated
        (chopped) towards 0. The reminder is always less than the divisor in
        magnitude. Overflow is indicated with the #DE (divide error) exception
        rather than with the CF flag::

            IF SRC  =  0
                THEN #DE; FI;(* divide error *)
            IF OperandSize  =  8 (* word/byte operation *)
                THEN
                    temp  =  AX / SRC;
                    IF temp > FFH
                        THEN #DE; (* divide error *) ;
                        ELSE
                            AL  =  temp;
                            AH  =  AX MOD SRC;
                    FI;
                ELSE IF OperandSize  =  16 (* doubleword/word operation *)
                    THEN
                        temp  =  DX:AX / SRC;
                        IF temp > FFFFH
                            THEN #DE; (* divide error *) ;
                        ELSE
                            AX  =  temp;
                            DX  =  DX:AX MOD SRC;
                        FI;
                    FI;
                ELSE If OperandSize = 32 (* quadword/doubleword operation *)
                    THEN
                        temp  =  EDX:EAX / SRC;
                        IF temp > FFFFFFFFH
                            THEN #DE; (* divide error *) ;
                        ELSE
                            EAX  =  temp;
                            EDX  =  EDX:EAX MOD SRC;
                        FI;
                    FI;
                ELSE IF OperandSize = 64 (*Doublequadword/quadword operation*)
                    THEN
                        temp = RDX:RAX / SRC;
                        IF temp > FFFFFFFFFFFFFFFFH
                            THEN #DE; (* Divide error *)
                        ELSE
                            RAX = temp;
                            RDX = RDX:RAX MOD SRC;
                        FI;
                    FI;
            FI;

        :param cpu: current CPU.
        :param src: source operand.


Question: Return the collections of handlers handling the exception in arguments .

def Func ( arg_0 : arg_1 . node_classes . NodeNG , arg_4 = arg_5 ) -> List [ arg_1 . ExceptHandler ] : arg_6 = find_try_except_wrapper_node ( arg_0 ) if isinstance ( arg_6 , arg_1 . TryExcept ) : return [ arg_7 for arg_7 in arg_6 . handlers if error_of_type ( arg_7 , arg_4 ) ] return None


Question: Converts given J H Ks mags to an SDSS r magnitude value .

def Func ( arg_0 , arg_1 , arg_2 ) : return convert_constants ( arg_0 , arg_1 , arg_2 , SDSSR_JHK , SDSSR_JH , SDSSR_JK , SDSSR_HK , SDSSR_J , SDSSR_H , SDSSR_K )


Question: Generates a frequency count of each rating on the scale ratings is a list of scores Returns a list of frequencies

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_0 = [ int ( arg_5 ) for arg_5 in arg_0 ] if arg_1 is None : arg_1 = min ( arg_0 ) if arg_2 is None : arg_2 = max ( arg_0 ) arg_3 = int ( arg_2 - arg_1 + 1 ) arg_4 = [ 0 for x in range ( arg_3 ) ] for arg_5 in arg_0 : arg_4 [ arg_5 - arg_1 ] += 1 return arg_4

Attempt to detect if a device at this address is present on the I2C
        bus.  Will send out the device's address for writing and verify an ACK
        is received.  Returns true if the ACK is received, and false if not.


Question: Verify SSH variables and construct exported variables

def Func ( ) : arg_0 = arg_1 . Func_to_dict ( PREFIX , REQUIRED ) if "KEY" in arg_0 : arg_0 [ "KEY" ] = arg_1 . util . expand_path ( arg_0 [ "KEY" ] ) if arg_1 . ENV . get ( "SSH_PORT" ) is None : arg_1 . ENV [ "SSH_PORT" ] = "22" arg_1 . warn ( "cij.ssh.Func: SSH_PORT was not set, assigned: %r" % ( arg_1 . ENV . get ( "SSH_PORT" ) ) ) if arg_1 . ENV . get ( "SSH_CMD_TIME" ) is None : arg_1 . ENV [ "SSH_CMD_TIME" ] = "1" arg_1 . warn ( "cij.ssh.Func: SSH_CMD_TIME was not set, assigned: %r" % ( arg_1 . ENV . get ( "SSH_CMD_TIME" ) ) ) return 0

Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @register_file_reader(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.


Question: Delete ContentMetadataItemTransmision models associated with the given content metadata items .

def Func ( arg_0 , arg_1 ) : arg_2 = apps . get_model ( 'integrated_channel' , 'ContentMetadataItemTransmission' ) arg_2 . objects . filter ( enterprise_customer = arg_0 . enterprise_configuration . enterprise_customer , integrated_channel_code = arg_0 . enterprise_configuration . channel_code ( ) , content_id__in = arg_1 ) . delete ( )

Compute the average size of the largest cluster

    Helper function for :func:`microcanonical_averages`

    Parameters
    ----------

    max_cluster_size : 1-D :py:class:`numpy.ndarray` of int
        Each entry is the ``max_cluster_size`` field of the output of
        :func:`sample_states`:
        The size of the largest cluster (absolute number of sites).

    alpha: float
        Significance level.

    Returns
    -------

    ret : dict
        Largest cluster statistics

    ret['max_cluster_size'] : float
        Average size of the largest cluster (absolute number of sites)

    ret['max_cluster_size_ci'] : 1-D :py:class:`numpy.ndarray` of float, size 2
        Lower and upper bounds of the normal confidence interval of the average
        size of the largest cluster (absolute number of sites)

    See Also
    --------

    sample_states : largest cluster detection

    microcanonical_averages : largest cluster statistics


Question: Enable event loop integration with Tk .

def Func ( arg_0 , arg_1 = None ) : arg_0 . _current_gui = arg_4 if arg_1 is None : import Tkinter arg_1 = Tkinter . Tk ( ) arg_1 . withdraw ( ) arg_0 . _apps [ arg_4 ] = arg_1 return arg_1

Overriding the default JSONEncoder.default for NDB support.


Question: Create the Certificate

def Func ( arg_0 ) : arg_1 = { "name" : arg_0 . name , "type" : arg_0 . type , "dns_names" : arg_0 . dns_names , "private_key" : arg_0 . private_key , "leaf_certificate" : arg_0 . leaf_certificate , "certificate_chain" : arg_0 . certificate_chain } arg_2 = arg_0 . get_data ( "certificates/" , arg_7 = POST , arg_1 = arg_1 ) if arg_2 : arg_0 . id = arg_2 [ 'certificate' ] [ 'id' ] arg_0 . not_after = arg_2 [ 'certificate' ] [ 'not_after' ] arg_0 . sha1_fingerprint = arg_2 [ 'certificate' ] [ 'sha1_fingerprint' ] arg_0 . Funcd_at = arg_2 [ 'certificate' ] [ 'Funcd_at' ] arg_0 . type = arg_2 [ 'certificate' ] [ 'type' ] arg_0 . dns_names = arg_2 [ 'certificate' ] [ 'dns_names' ] arg_0 . state = arg_2 [ 'certificate' ] [ 'state' ] return arg_0

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Integrate the mass profiles s convergence profile to compute the total mass within a circle of \ specified radius . This is centred on the mass profile .

def Func ( arg_0 , arg_1 : arg_2 . Length , arg_4 = 'angular' , arg_5 = None , arg_6 = None ) : arg_0 . check_units_of_radius_and_critical_surface_density ( arg_1 = arg_1 , arg_6 = arg_6 ) arg_7 = arg_0 . new_profile_with_units_converted ( unit_length = arg_1 . unit_length , arg_4 = 'angular' , arg_5 = arg_5 , arg_6 = arg_6 ) arg_8 = arg_2 . Mass ( value = quad ( arg_7 . mass_integral , a = 0.0 , b = arg_1 , args = ( 1.0 , ) ) [ 0 ] , arg_4 = 'angular' ) return arg_8 . convert ( arg_4 = arg_4 , arg_6 = arg_6 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Perform a droplet action .

def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = arg_0 . get_data ( "droplets/%s/actions/" % arg_0 . id , type = POST , arg_1 = arg_1 ) if arg_2 : return arg_3 else : arg_3 = arg_3 [ u'action' ] arg_4 = Action ( token = arg_0 . token ) for arg_5 in arg_3 . keys ( ) : setattr ( arg_4 , arg_5 , arg_3 [ arg_5 ] ) return arg_4

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: File size in bytes .

def Func ( arg_0 ) : try : return arg_0 . _stat . st_Func except : arg_0 . _stat = arg_0 . stat ( ) return arg_0 . Func

Build transition noise distribution for a ConstrainedSeasonalSSM.


Question: Return the list containing the names of the modules available in the given folder .

def Func ( arg_0 ) : if arg_0 == '' : arg_0 = '.' if os . path . isdir ( arg_0 ) : arg_1 = os . listdir ( arg_0 ) elif arg_0 . endswith ( '.egg' ) : try : arg_1 = [ f for f in zipimporter ( arg_0 ) . _files ] except : arg_1 = [ ] else : arg_1 = [ ] if not arg_1 : return [ ] arg_2 = os . path . isfile arg_3 = os . path . join arg_4 = os . path . basename def is_importable_file ( arg_0 ) : arg_5 , arg_6 = os . path . splitext ( arg_0 ) return import_re . match ( arg_0 ) and py3compat . isidentifier ( arg_5 ) arg_1 = [ arg_7 for arg_7 in arg_1 if arg_2 ( arg_3 ( arg_0 , arg_7 , '__init__.py' ) ) or is_importable_file ( arg_7 ) ] return [ arg_4 ( arg_7 ) . split ( '.' ) [ 0 ] for arg_7 in arg_1 ]

Update the rate limit and the time to reset
        from the response headers.

        :param: response: the response object


Question: Read auth from pip config .

def Func ( arg_0 = '~/.pypirc' ) : arg_1 = ConfigParser ( ) if arg_1 . read ( os . path . expanduser ( arg_0 ) ) : try : arg_2 = arg_1 . get ( 'pypi' , 'username' ) arg_3 = arg_1 . get ( 'pypi' , 'password' ) return arg_2 , arg_3 except ConfigError : notify . warning ( "No PyPI credentials in '{}'," " will fall back to '~/.netrc'..." . format ( arg_0 ) ) return None

Overriding the default JSONEncoder.default for NDB support.


Question: Check if input dimension corresponds to qubit subsystems .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 is None : arg_1 = arg_2 elif np . product ( arg_1 ) != arg_2 : raise QiskitError ( "dimensions do not match size." ) if isinstance ( arg_1 , ( int , np . integer ) ) : arg_3 = int ( np . log2 ( arg_1 ) ) if 2 ** arg_3 == arg_2 : return arg_3 * ( 2 , ) return ( arg_1 , ) return tuple ( 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: Get a list of all the cards in the game

def Func ( arg_0 , arg_1 : arg_2 = None ) : arg_3 = arg_0 . api . CARDS return arg_0 . _get_model ( arg_3 , arg_1 = 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: Create simulation model and connect it with interfaces of original unit and decorate it with agents

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 ] = None , arg_5 = arg_6 ( ) , arg_7 : arg_8 = None , arg_9 = None ) : if arg_2 is None : arg_2 = toSimModel ( arg_0 , arg_5 = arg_5 , arg_7 = arg_7 ) else : toSimModel ( arg_0 ) if arg_9 : arg_9 ( arg_0 , arg_2 ) reconnectUnitSignalsToModel ( arg_0 , arg_2 ) arg_10 = arg_2 ( ) arg_11 = autoAddAgents ( arg_0 ) return arg_0 , arg_10 , arg_11


Question: Compute the hamming distance between two images

def Func ( arg_0 , arg_1 ) : arg_2 = average_hash ( arg_0 ) arg_3 = average_hash ( arg_1 ) return hash_Func ( arg_2 , arg_3 )

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: Compute the inverse constant - Q transform .

def Func ( arg_0 , arg_1 = 22050 , arg_2 = 512 , arg_3 = None , arg_4 = 12 , arg_5 = 0.0 , arg_6 = 1 , arg_7 = 1 , arg_8 = 0.01 , arg_9 = 'hann' , arg_10 = True , arg_11 = None , arg_12 = arg_13 . Deprecated ( ) , arg_15 = 'fft' ) : if arg_3 is None : arg_3 = note_to_hz ( 'C1' ) arg_16 = len ( arg_0 ) arg_17 = cqt_frequencies ( arg_16 , arg_3 , arg_4 = arg_4 , arg_5 = arg_5 ) [ - arg_4 : ] arg_18 = min ( arg_16 , arg_4 ) arg_19 , arg_20 , arg_21 = __cqt_filter_fft ( arg_1 , np . min ( arg_17 ) , arg_18 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 = arg_8 , arg_9 = arg_9 ) if arg_2 > min ( arg_21 ) : warnings . warn ( 'hop_length={} exceeds minimum CQT filter length={:.3f}.\n' 'This will probably cause unpleasant acoustic artifacts. ' 'Consider decreasing your hop length or increasing the frequency resolution of your CQT.' . format ( arg_2 , min ( arg_21 ) ) ) arg_19 = arg_19 . todense ( ) * arg_20 / arg_21 [ : , np . newaxis ] arg_22 = arg_19 . H arg_23 = int ( np . ceil ( float ( arg_16 ) / arg_4 ) ) arg_24 = None for arg_25 in range ( arg_23 - 1 , - 1 , - 1 ) : arg_26 = slice ( - ( arg_25 + 1 ) * arg_4 - 1 , - ( arg_25 ) * arg_4 - 1 ) arg_27 = arg_0 [ arg_26 ] arg_28 = arg_22 [ : , - arg_27 . shape [ 0 ] : ] arg_29 = arg_2 // 2 ** arg_25 if arg_10 : arg_30 = np . sqrt ( arg_21 [ - arg_27 . shape [ 0 ] : , np . newaxis ] ) / arg_20 else : arg_30 = arg_21 [ - arg_27 . shape [ 0 ] : , np . newaxis ] * np . sqrt ( 2 ** arg_25 ) / arg_20 arg_31 = arg_28 . dot ( arg_27 / arg_30 ) arg_32 = istft ( arg_31 , arg_9 = 'ones' , arg_2 = arg_29 ) if arg_24 is None : arg_24 = arg_32 else : arg_24 = audio . resample ( arg_24 , 1 , 2 , arg_10 = True , arg_15 = arg_15 , fix = False ) arg_24 [ : len ( arg_32 ) ] += arg_32 if arg_11 : arg_24 = arg_13 . fix_length ( arg_24 , arg_11 ) return arg_24

Cycles through notifications with latest results from data feeds.


Question: Registers its metrics to a given metrics collector with a given interval

def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 , arg_4 in arg_0 . metrics . items ( ) : arg_1 . register_metric ( arg_3 , arg_4 , arg_2 )

Releases renderer resources associated with this image.


Question: Median absolute error regression loss

def Func ( arg_0 , arg_1 ) : ModelBase . _check_targets ( arg_0 , arg_1 ) return ( arg_1 - arg_0 ) . abs ( ) . median ( )


Question: Shorthand access to the color table scheme selector method .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_0 . color_scheme_table . set_active_scheme ( * arg_1 , ** arg_2 ) arg_0 . Colors = arg_0 . color_scheme_table . active_colors if hasattr ( arg_0 , 'pdb' ) and arg_0 . pdb is not None : arg_0 . pdb . Func ( * arg_1 , ** arg_2 )

Returns a list of the dicom files within root_path

    Parameters
    ----------
    root_path: str
    Path to the directory to be recursively searched for DICOM files.

    Returns
    -------
    dicoms: set
    Set of DICOM absolute file paths


Question: Retrieves a list of all servers bound to the specified data center .

def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . _perform_request ( '/datacenters/%s/servers?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) return arg_3

Returns mappable data for a random subset of voxels.

    May be useful as a baseline in predictive analyses--e.g., to compare
    performance of a more principled feature selection method with simple
    random selection.

    Args:
        dataset: A Dataset instance
        n_voxels: An integer specifying the number of random voxels to select.

    Returns:
        A 2D numpy array with (randomly-selected) voxels in rows and mappables
        in columns.


Question: Embed hyperlinks to documentation into example code

def Func ( arg_0 , arg_1 ) : if arg_1 is not None : return if not arg_0 . builder . config . plot_gallery : return if arg_0 . builder . name not in [ 'html' , 'readthedocs' ] : return print ( 'Embedding documentation hyperlinks in examples..' ) arg_2 = arg_0 . config . sphinx_gallery_conf arg_3 = arg_2 [ 'gallery_dirs' ] if not isinstance ( arg_3 , list ) : arg_3 = [ arg_3 ] for arg_4 in arg_3 : _Func ( arg_0 , arg_2 , arg_4 )

Fetch the events pages of a given group.


Question: Parse an RFC 2822 addr - spec .

def Func ( arg_0 ) : arg_1 = [ ] arg_0 . gotonext ( ) while arg_0 . pos < len ( arg_0 . field ) : if arg_0 . field [ arg_0 . pos ] == '.' : arg_1 . append ( '.' ) arg_0 . pos += 1 elif arg_0 . field [ arg_0 . pos ] == '"' : arg_1 . append ( '"%s"' % arg_0 . getquote ( ) ) elif arg_0 . field [ arg_0 . pos ] in arg_0 . atomends : break else : arg_1 . append ( arg_0 . getatom ( ) ) arg_0 . gotonext ( ) if arg_0 . pos >= len ( arg_0 . field ) or arg_0 . field [ arg_0 . pos ] != '@' : return '' . join ( arg_1 ) arg_1 . append ( '@' ) arg_0 . pos += 1 arg_0 . gotonext ( ) return '' . join ( arg_1 ) + arg_0 . getdomain ( )


Question: Fetch jobIDs for jobs in the table with optional fields given a specific clientInfo

def Func ( arg_0 , arg_1 , arg_2 = [ ] ) : arg_3 = [ arg_0 . _jobs . pubToDBNameDict [ x ] for x in arg_2 ] arg_4 = ',' . join ( [ 'job_id' ] + arg_3 ) with ConnectionFactory . get ( ) as conn : arg_5 = 'SELECT %s FROM %s ' 'WHERE client_info = %%s ' ' AND status != %%s' % ( arg_4 , arg_0 . jobsTableName ) conn . cursor . execute ( arg_5 , [ arg_1 , arg_0 . STATUS_COMPLETED ] ) arg_6 = conn . cursor . fetchall ( ) return arg_6

End the blockade event and return to a steady state


Question: Return a list of task runs for a given project ID .

def Func ( arg_0 , arg_1 = 100 , arg_2 = 0 , arg_3 = None ) : if arg_3 is not None : arg_4 = dict ( arg_1 = arg_1 , arg_3 = arg_3 ) else : arg_4 = dict ( arg_1 = arg_1 , arg_2 = arg_2 ) print ( OFFSET_WARNING ) arg_4 [ 'project_id' ] = arg_0 try : arg_5 = _pybossa_req ( 'get' , 'taskrun' , arg_4 = arg_4 ) if type ( arg_5 ) . __name__ == 'list' : return [ TaskRun ( arg_6 ) for arg_6 in arg_5 ] else : raise TypeError except : raise

Decorator for methods accepting old_path and new_path.


Question: Logical compare .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . read ( ) & arg_2 . read ( ) arg_0 . SF = ( arg_3 & ( 1 << ( arg_1 . size - 1 ) ) ) != 0 arg_0 . ZF = arg_3 == 0 arg_0 . PF = arg_0 . _calculate_parity_flag ( arg_3 ) arg_0 . CF = False arg_0 . OF = False


Question: Processes a level of segmentation and converts it into times .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : assert arg_0 [ 0 ] == 0 and arg_0 [ - 1 ] == arg_2 - 1 assert len ( arg_0 ) - 1 == len ( arg_1 ) arg_5 = np . concatenate ( ( [ 0 ] , arg_3 [ arg_0 ] , [ arg_4 ] ) ) arg_6 = np . max ( arg_1 ) + 1 arg_1 = np . concatenate ( ( [ arg_6 ] , arg_1 , [ arg_6 ] ) ) arg_5 , arg_1 = remove_empty_segments ( arg_5 , arg_1 ) assert np . allclose ( [ arg_5 [ 0 ] ] , [ 0 ] ) and np . allclose ( [ arg_5 [ - 1 ] ] , [ arg_4 ] ) return arg_5 , arg_1

Set a property value or remove a property.

        value == None means 'remove property'.
        Raise HTTP_FORBIDDEN if property is read-only, or not supported.

        When dry_run is True, this function should raise errors, as in a real
        run, but MUST NOT change any data.

        This default implementation

        - raises HTTP_FORBIDDEN, if trying to modify a locking property
        - raises HTTP_FORBIDDEN, if trying to modify an immutable {DAV:}
          property
        - handles Windows' Win32LastModifiedTime to set the getlastmodified
          property, if enabled
        - stores everything else as dead property, if a property manager is
          present.
        - raises HTTP_FORBIDDEN, else

        Removing a non-existing prop is NOT an error.

        Note: RFC 4918 states that {DAV:}displayname 'SHOULD NOT be protected'

        A resource provider may override this method, to update supported custom
        live properties.


Question: Return a Droplet by its ID .

def Func ( arg_0 , arg_1 ) : return Droplet . get_object ( api_token = arg_0 . token , arg_1 = arg_1 )

Add members found in prior versions up till the next major release

    These members are to be considered deprecated. When a new major
    release is made, these members are removed.


Question: Decorator . Abortable worker . If wrapped task will be cancelled by dispatcher decorator will send ftp codes of successful interrupt .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) async def wrapper ( arg_1 , arg_2 , arg_3 ) : try : await arg_0 ( arg_1 , arg_2 , arg_3 ) except asyncio . CancelledError : arg_2 . response ( "426" , "transfer aborted" ) arg_2 . response ( "226" , "abort successful" ) return wrapper

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: A helper function to compute validation related metrics

def Func ( arg_0 ) : if ( arg_0 . _validation_iterator is None ) or ( arg_0 . _Func is None ) : raise AttributeError ( 'Validation is not setup.' ) arg_1 = 0.0 arg_2 = [ 0.0 ] * len ( arg_0 . _Func ) arg_0 . _sess . run ( arg_0 . _validation_iterator . initializer ) while True : try : arg_3 = arg_0 . _sess . run ( arg_0 . _Func ) for arg_4 , arg_5 in enumerate ( arg_3 ) : arg_2 [ arg_4 ] += arg_5 arg_1 += 1.0 except tf . errors . OutOfRangeError : break for arg_4 , arg_5 in enumerate ( arg_2 ) : arg_2 [ arg_4 ] = arg_2 [ arg_4 ] / arg_1 return zip ( arg_0 . _Func , arg_2 )

Drop a node from the network

        :param node: node to drop
        :type node: Node


Question: Send email using backend specified in EMAIL_BACKEND .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = None , arg_7 = 'mixed' , arg_8 = 'utf-8' , ** arg_9 ) : arg_10 , arg_11 = configuration . conf . get ( 'email' , 'EMAIL_BACKEND' ) . rsplit ( '.' , 1 ) arg_12 = importlib . import_module ( arg_10 ) arg_13 = getattr ( arg_12 , arg_11 ) arg_0 = get_email_address_list ( arg_0 ) arg_0 = ", " . join ( arg_0 ) return arg_13 ( arg_0 , arg_1 , arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , ** arg_9 )

Sequentially update the actors, the world, and the messaging system.
        The theater terminates once all of the actors indicate that they are done.


Question: Generates a URL - safe token for the given user action time tuple .

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = None ) : arg_4 = hmac . new ( _helpers . _to_bytes ( arg_0 , encoding = 'utf-8' ) ) arg_4 . update ( _helpers . _to_bytes ( str ( arg_1 ) , encoding = 'utf-8' ) ) arg_4 . update ( DELIMITER ) arg_4 . update ( _helpers . _to_bytes ( arg_2 , encoding = 'utf-8' ) ) arg_4 . update ( DELIMITER ) arg_3 = _helpers . _to_bytes ( str ( arg_3 or int ( time . time ( ) ) ) , encoding = 'utf-8' ) arg_4 . update ( arg_3 ) arg_5 = arg_4 . digest ( ) arg_6 = base64 . urlsafe_b64encode ( arg_5 + DELIMITER + arg_3 ) return arg_6

Returns a list of the dicom files within root_path

    Parameters
    ----------
    root_path: str
    Path to the directory to be recursively searched for DICOM files.

    Returns
    -------
    dicoms: set
    Set of DICOM absolute file paths


Question: Write data to the log file if active

def Func ( arg_0 , arg_1 , arg_2 = 'input' ) : if arg_0 . log_active and arg_1 : arg_3 = arg_0 . logfile . write if arg_2 == 'input' : if arg_0 . timestamp : arg_3 ( str_to_unicode ( time . strftime ( '# %a, %d %b %Y %H:%M:%S\n' , time . localtime ( ) ) ) ) arg_3 ( arg_1 ) elif arg_2 == 'output' and arg_0 . log_output : arg_4 = u'\n' . join ( [ u'#[Out]# %s' % s for s in arg_1 . splitlines ( ) ] ) arg_3 ( u'%s\n' % arg_4 ) arg_0 . logfile . flush ( )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Parses arguments for the command .

def Func ( arg_0 , arg_1 = None ) : arg_2 = vars ( arg_0 . create_argument_parser ( ) . parse_args ( arg_1 ) ) arg_3 = None if arg_0 . requires_seed : arg_4 = arg_2 . pop ( 'seed_file' ) arg_3 = ( arg_0 . seed_from_filepath ( arg_4 ) if arg_4 else arg_0 . prompt_for_seed ( ) ) arg_2 [ 'api' ] = Iota ( adapter = arg_2 . pop ( 'uri' ) , arg_3 = arg_3 , testnet = arg_2 . pop ( 'testnet' ) , ) return arg_2

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: Run Gene Set Enrichment Analysis .

Drop a node from the network

        :param node: node to drop
        :type node: Node


Question: Show entire demo on screen block by block

def Func ( arg_0 ) : arg_1 = arg_0 . title arg_2 = arg_0 . title arg_3 = arg_0 . nblocks arg_4 = arg_0 . _silent arg_5 = arg_0 . marquee for arg_6 , arg_7 in enumerate ( arg_0 . src_blocks_colored ) : if arg_4 [ arg_6 ] : print >> io . stdout , arg_5 ( '<%s> SILENT block # %s (%s remaining)' % ( arg_2 , arg_6 , arg_3 - arg_6 - 1 ) ) else : print >> io . stdout , arg_5 ( '<%s> block # %s (%s remaining)' % ( arg_2 , arg_6 , arg_3 - arg_6 - 1 ) ) print >> io . stdout , arg_7 , sys . stdout . flush ( )

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: Comparison for x coordinate

def Func ( arg_0 , arg_1 ) : arg_0 . _is_coordinate ( arg_1 ) if arg_0 . x > arg_1 . x : return True else : return False

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: Get 6D data with euler rotations .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = [ ] arg_5 = arg_4 . append for arg_6 in range ( arg_1 . body_count ) : arg_3 , arg_7 = QRTPacket . _get_exact ( RT6DBodyPosition , arg_2 , arg_3 ) arg_3 , arg_8 = QRTPacket . _get_exact ( RT6DBodyEuler , arg_2 , arg_3 ) arg_5 ( ( arg_7 , arg_8 ) ) return arg_4

Returns the nth rest sequence of coll, or coll if i is 0.


Question: Try to create a Distribution path_or_module . o path_or_module may be a module object .

def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_0 , ModuleType ) : try : return Installed ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : __import__ ( arg_0 ) except ImportError : pass else : try : return Installed ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass if os . path . isfile ( arg_0 ) : try : return SDist ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : return BDist ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : return Wheel ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass if os . path . isdir ( arg_0 ) : try : return Develop ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass

Try to merge processes as much is possible

    :param processes: list of processes instances


Question: Get the decryption for col .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 if arg_1 != arg_0 . model . _meta . db_table or arg_2 != arg_0 : return DecryptedCol ( arg_1 , arg_0 , arg_2 ) else : return arg_0 . cached_col

main execution loop. query weather data and post to online service.


Question: Check HTTP reponse for known errors

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 . status == 401 : raise trolly . Unauthorised ( arg_1 , arg_2 ) if arg_2 . status != 200 : raise trolly . ResourceUnavailable ( arg_1 , arg_2 )

URL reconstruction according to PEP 333.
    @see https://www.python.org/dev/peps/pep-3333/#url-reconstruction


Question: Check self . data . Raise InvalidConfig on error

def Func ( arg_0 ) : if ( arg_0 . data . get ( 'content-type' ) or arg_0 . data . get ( 'body' ) ) and arg_0 . data . get ( 'method' , '' ) . lower ( ) not in CONTENT_TYPE_METHODS : raise InvalidConfig ( extra_body = 'The body/content-type option only can be used with the {} methods. The device is {}. ' 'Check the configuration file.' . format ( ', ' . join ( CONTENT_TYPE_METHODS ) , arg_0 . name ) ) arg_0 . data [ 'content-type' ] = CONTENT_TYPE_ALIASES . get ( arg_0 . data . get ( 'content-type' ) , arg_0 . data . get ( 'content-type' ) ) arg_2 = CONTENT_TYPE_ALIASES [ 'form' ] if arg_0 . data . get ( 'body' ) and ( arg_0 . data . get ( 'content-type' ) or arg_2 ) == arg_2 : try : arg_0 . data [ 'body' ] = json . loads ( arg_0 . data [ 'body' ] ) except JSONDecodeError : raise InvalidConfig ( extra_body = 'Invalid JSON body on {} device.' . format ( arg_0 . name ) )

Creates the variational distribution for LDA.

  Args:
    activation: Activation function to use.
    num_topics: The number of topics.
    layer_sizes: The number of hidden units per layer in the encoder.

  Returns:
    lda_variational: A function that takes a bag-of-words Tensor as
      input and returns a distribution over topics.


Question: Updates the current configuration with the values in conf_dict .

def Func ( arg_0 , arg_1 , arg_2 = None ) : for arg_3 in arg_1 : if arg_3 . startswith ( '_' ) : continue arg_4 = arg_1 [ arg_3 ] if arg_4 is Namespace : continue if arg_2 : arg_3 = arg_2 + '.' + arg_3 if isinstance ( arg_4 , Namespace ) : for arg_3 , arg_4 in arg_4 . iteritems ( arg_3 ) : arg_0 . set ( arg_3 , arg_4 ) elif callable ( arg_4 ) : arg_4 = arg_4 ( ) if arg_4 is not None : arg_0 . set ( arg_3 , arg_4 ) else : arg_0 . set ( arg_3 , arg_4 )

Regenerates the primary or secondary access key for the specified
        storage account.

        service_name:
            Name of the storage service account.
        key_type:
            Specifies which key to regenerate. Valid values are:
            Primary, Secondary


Question: check if aws conn exists already or create one and return it

def Func ( arg_0 ) : if not arg_0 . conn : arg_0 . conn = arg_0 . get_client_type ( 'athena' ) return arg_0 . conn

Remove all binary files in the adslib directory.


Question: Get the default local IP address .

def Func ( ) : arg_0 = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) try : arg_0 . connect ( ( '10.255.255.255' , 1 ) ) arg_1 = arg_0 . getsockname ( ) [ 0 ] except ( socket . error , IndexError ) : arg_1 = '127.0.0.1' finally : arg_0 . close ( ) return arg_1

Return a circuit with a barrier before last measurements.


Question: Completed human transaction

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . transactions : if arg_2 . depth == 0 : arg_1 . append ( arg_2 ) return tuple ( arg_1 )

Configure the Outstation's database of input point definitions.

            Configure two Analog points (group/variation 30.1) at indexes 1 and 2.
            Configure two Binary points (group/variation 1.2) at indexes 1 and 2.


Question: Parse and sort an Accept header .

def Func ( arg_0 ) : def sort ( arg_1 ) : return float ( arg_1 [ 1 ] . get ( 'q' , 1 ) ) return OrderedDict ( sorted ( _splitHeaders ( arg_0 ) , key = sort , reverse = True ) )


Question: Print operational metrics for the scheduler test .

def Func ( arg_0 ) : arg_1 = settings . Session ( ) arg_2 = TaskInstance arg_3 = ( arg_1 . query ( arg_2 ) . filter ( arg_2 . dag_id . in_ ( DAG_IDS ) ) . all ( ) ) arg_4 = [ x for x in arg_3 if x . state == State . SUCCESS ] arg_5 = [ ( arg_8 . dag_id , arg_8 . task_id , arg_8 . execution_date , ( arg_8 . queued_dttm - arg_0 . start_date ) . total_seconds ( ) , ( arg_8 . start_date - arg_0 . start_date ) . total_seconds ( ) , ( arg_8 . end_date - arg_0 . start_date ) . total_seconds ( ) , arg_8 . duration ) for arg_8 in arg_4 ] arg_6 = pd . DataFrame ( arg_5 , columns = [ 'dag_id' , 'task_id' , 'execution_date' , 'queue_delay' , 'start_delay' , 'land_time' , 'duration' ] ) print ( 'Performance Results' ) print ( '###################' ) for arg_7 in DAG_IDS : print ( 'DAG {}' . format ( arg_7 ) ) print ( arg_6 [ arg_6 [ 'dag_id' ] == arg_7 ] ) print ( '###################' ) if len ( arg_3 ) > len ( arg_4 ) : print ( "WARNING!! The following task instances haven't completed" ) print ( pd . DataFrame ( [ ( arg_8 . dag_id , arg_8 . task_id , arg_8 . execution_date , arg_8 . state ) for arg_8 in filter ( lambda x : x . state != State . SUCCESS , arg_3 ) ] , columns = [ 'dag_id' , 'task_id' , 'execution_date' , 'state' ] ) ) arg_1 . commit ( )

Decorator. Abortable worker. If wrapped task will be cancelled by
    dispatcher, decorator will send ftp codes of successful interrupt.

    ::

        >>> @worker
        ... async def worker(self, connection, rest):
        ...     ...


Question: Asserts that val contains the given sequence of items in order .

def Func ( arg_0 , * arg_1 ) : if len ( arg_1 ) == 0 : raise ValueError ( 'one or more args must be given' ) else : try : for arg_2 in xrange ( len ( arg_0 . val ) - len ( arg_1 ) + 1 ) : for arg_3 in xrange ( len ( arg_1 ) ) : if arg_0 . val [ arg_2 + arg_3 ] != arg_1 [ arg_3 ] : break else : return arg_0 except TypeError : raise TypeError ( 'val is not iterable' ) arg_0 . _err ( 'Expected <%s> to contain sequence %s, but did not.' % ( arg_0 . val , arg_0 . _fmt_items ( arg_1 ) ) )

Connect to the stream

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


Question: Read the state file if it exists .

def Func ( arg_0 , arg_1 ) : try : arg_2 = open ( arg_1 , 'r' ) arg_3 = json . load ( arg_2 ) arg_0 . vpc_id = arg_3 [ 'vpcID' ] arg_0 . sg_id = arg_3 [ 'sgID' ] arg_0 . sn_ids = arg_3 [ 'snIDs' ] arg_0 . instances = arg_3 [ 'instances' ] except Exception as e : logger . debug ( "Caught exception while reading state file: {0}" . format ( e ) ) raise e logger . debug ( "Done reading state from the local state file." )

Remove rows with NAs from the H2OFrame.

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


Question: Adds all necessary parameters to the traj container .

def Func ( arg_0 ) : arg_0 . f_add_parameter ( 'steps' , 10000 , comment = 'Number of time steps to simulate' ) arg_0 . f_add_parameter ( 'dt' , 0.01 , comment = 'Step size' ) arg_0 . f_add_parameter ( ArrayParameter , 'initial_conditions' , np . array ( [ 0.0 , 0.0 , 0.0 ] ) , comment = 'Our initial conditions, as default we will start from' ' origin!' ) arg_0 . f_add_parameter ( 'diff_name' , 'diff_lorenz' , comment = 'Name of our differential equation' ) if arg_0 . diff_name == 'diff_lorenz' : arg_0 . f_add_parameter ( 'func_params.sigma' , 10.0 ) arg_0 . f_add_parameter ( 'func_params.beta' , 8.0 / 3.0 ) arg_0 . f_add_parameter ( 'func_params.rho' , 28.0 ) elif arg_0 . diff_name == 'diff_roessler' : arg_0 . f_add_parameter ( 'func_params.a' , 0.1 ) arg_0 . f_add_parameter ( 'func_params.c' , 14.0 ) else : raise ValueError ( 'I don\'t know what %s is.' % arg_0 . diff_name )

write lines, one by one, separated by \n to device


Question: Decorator used to change the return value from PJFFactory . fuzzed it makes the structure printable

def Func ( arg_0 ) : def func_wrapper ( arg_1 , arg_2 , arg_3 ) : if arg_3 : arg_4 = "\\x%02x" else : arg_4 = "\\u%04x" arg_5 = re . compile ( r"(\\\\x[a-fA-F0-9]{2})" ) arg_6 = re . compile ( r"(\\u[a-fA-F0-9]{4})" ) def encode_decode_all ( arg_7 , arg_8 = True ) : if type ( arg_7 ) == dict : for arg_9 in arg_7 : if type ( arg_7 [ arg_9 ] ) in [ dict , list ] : if arg_8 : arg_7 [ arg_9 ] = encode_decode_all ( arg_7 [ arg_9 ] ) else : arg_7 [ arg_9 ] = encode_decode_all ( arg_7 [ arg_9 ] , arg_8 = False ) elif type ( arg_7 [ arg_9 ] ) == str : if arg_8 : arg_7 [ arg_9 ] = decode ( arg_7 [ arg_9 ] ) else : arg_7 [ arg_9 ] = encode ( arg_7 [ arg_9 ] ) elif type ( arg_7 ) == list : arg_10 = [ ] for arg_11 in arg_7 : if type ( arg_11 ) == str : if arg_8 : arg_10 . append ( decode ( arg_11 ) ) else : arg_10 . append ( encode ( arg_11 ) ) elif type ( arg_11 ) in [ dict , list ] : if arg_8 : arg_10 . append ( encode_decode_all ( arg_11 ) ) else : arg_10 . append ( encode_decode_all ( arg_11 , arg_8 = False ) ) else : arg_10 . append ( arg_11 ) return arg_10 else : if arg_8 : return decode ( arg_7 ) else : return encode ( arg_7 ) return arg_7 def decode ( arg_12 ) : arg_13 = "" . join ( arg_4 % ord ( c ) if c not in p else c for c in arg_12 ) if sys . version_info >= ( 3 , 0 ) : return str ( arg_13 ) else : for arg_14 in arg_6 . findall ( arg_13 ) : arg_13 = arg_13 . replace ( arg_14 , arg_14 . decode ( "unicode_escape" ) ) return unicode ( arg_13 ) def encode ( arg_12 ) : for arg_14 in arg_5 . findall ( arg_12 ) : if sys . version_info >= ( 3 , 0 ) : arg_12 = arg_12 . replace ( arg_14 , bytes ( str ( arg_14 ) . replace ( "\\\\x" , "\\x" ) , "utf-8" ) . decode ( "unicode_escape" ) ) else : arg_12 = arg_12 . replace ( arg_14 , str ( arg_14 ) . replace ( "\\\\x" , "\\x" ) . decode ( "string_escape" ) ) return arg_12 if arg_2 : return encode_decode_all ( "{0}" . format ( json . dumps ( encode_decode_all ( arg_0 ( arg_1 ) ) , arg_2 = 5 ) ) , arg_8 = False ) else : return encode_decode_all ( "{0}" . format ( json . dumps ( encode_decode_all ( arg_0 ( arg_1 ) ) ) ) , arg_8 = False ) return func_wrapper

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


Question: Check that the server is returning a valid Content - Type

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . replace ( ' ' , '' ) . split ( ';' ) arg_4 = arg_1 . replace ( ' ' , '' ) . split ( ';' ) return ( all ( arg_5 in arg_4 for arg_5 in arg_3 ) and ( arg_4 [ 0 ] == 'application/vnd.oasis.taxii+json' or arg_4 [ 0 ] == 'application/vnd.oasis.stix+json' ) )

Returns the filename which is effectively used by the application. If
        overridden by an environment variable, it will return that filename.


Question: returns a fully qualified app domain name

def Func ( arg_0 , arg_1 = None ) : from . generic import get_site_proto arg_1 = arg_1 or get_site_proto ( ) arg_2 = '{proto}://{domain}' . format ( arg_1 = arg_1 , arg_0 = arg_0 ) return arg_2

Create a tar file based on the list of files passed


Question: Return a datetime object from an iso 8601 representation . Return None if string is non conforming .

def Func ( arg_0 ) : arg_1 = DATE_ISO_REGEX . match ( arg_0 ) if arg_1 : arg_2 = datetime . datetime ( year = int ( arg_1 . group ( DATE_ISO_YEAR_GRP ) ) , month = int ( arg_1 . group ( DATE_ISO_MONTH_GRP ) ) , day = int ( arg_1 . group ( DATE_ISO_DAY_GRP ) ) , hour = int ( arg_1 . group ( DATE_ISO_HOUR_GRP ) ) , second = int ( arg_1 . group ( DATE_ISO_SEC_GRP ) ) , minute = int ( arg_1 . group ( DATE_ISO_MIN_GRP ) ) ) return arg_2 else : return None

Process current member with 'op' operation.


Question: Wait for a particular UI event to occur ; this can be built upon in NativeUIElement for specific convenience methods .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = arg_0 . _matchOther arg_5 = None arg_6 = None arg_7 = None if 'callback' in arg_3 : arg_4 = arg_3 [ 'callback' ] del arg_3 [ 'callback' ] if 'args' in arg_3 : if not isinstance ( arg_3 [ 'args' ] , tuple ) : arg_8 = 'Notification callback args not given as a tuple' raise TypeError ( arg_8 ) arg_6 = arg_3 [ 'args' ] del arg_3 [ 'args' ] if 'kwargs' in arg_3 : if not isinstance ( arg_3 [ 'kwargs' ] , dict ) : arg_8 = 'Notification callback kwargs not given as a dict' raise TypeError ( arg_8 ) arg_7 = arg_3 [ 'kwargs' ] del arg_3 [ 'kwargs' ] if arg_3 : if arg_7 : arg_7 . update ( arg_3 ) else : arg_7 = arg_3 else : arg_6 = ( arg_5 , ) arg_7 = arg_3 return arg_0 . _setNotification ( arg_1 , arg_2 , arg_4 , arg_6 , arg_7 )


Question: Load the configuration .

def Func ( arg_0 = False , arg_1 = None ) : if "config_loaded" not in INTERN : Load ( CURRENT_DIRECTORY ) if not arg_0 : DirectoryStructure ( ) INTERN . update ( { "config_loaded" : True } ) if arg_1 and isinstance ( arg_1 , dict ) : CONFIGURATION . update ( 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: Encode body of request to bytes and update content - type if required .

def Func ( arg_0 ) : if isinstance ( arg_0 . body , text_type ) : arg_1 = arg_0 . headers . get ( 'content-type' , 'text/plain' ) . split ( ';' ) if len ( arg_1 ) == 2 : arg_2 , arg_3 = arg_1 arg_3 = arg_3 . split ( '=' ) [ 1 ] arg_0 . body = arg_0 . body . encode ( arg_3 ) else : arg_2 = arg_1 [ 0 ] if ( arg_2 == 'application/x-www-form-urlencoded' or 'x-amz-' in arg_2 ) : arg_0 . body = arg_0 . body . encode ( ) else : arg_0 . body = arg_0 . body . encode ( 'utf-8' ) arg_0 . headers [ 'content-type' ] = arg_2 + '; charset=utf-8'


Question: Assumes that start and stop are already in buffer coordinates . value is a byte iterable . value_len is fractional .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : assert arg_2 >= arg_1 and arg_4 >= 0 arg_5 = arg_2 - arg_1 if arg_5 < arg_4 : arg_0 . _insert_zeros ( arg_2 , arg_2 + arg_4 - arg_5 ) arg_0 . _copy_to_range ( arg_1 , arg_3 , arg_4 ) elif arg_5 > arg_4 : arg_0 . _del_range ( arg_2 - ( arg_5 - arg_4 ) , arg_2 ) arg_0 . _copy_to_range ( arg_1 , arg_3 , arg_4 ) else : arg_0 . _copy_to_range ( arg_1 , arg_3 , arg_4 )

Given a lib2to3 node, return its string representation.


Question: Run a dataset query against Citrination .

def Func ( arg_0 , arg_1 ) : arg_0 . _validate_search_query ( arg_1 ) return arg_0 . _execute_search_query ( arg_1 , DatasetSearchResult )

Sequentially update the actors, the world, and the messaging system.
        The theater terminates once all of the actors indicate that they are done.


Question: A decorator for a function implementing dispatch_fn for dispatch_key .

def Func ( arg_0 , arg_1 = None ) : def apply_decorator ( arg_2 ) : if arg_1 is None : arg_0 . __multi_default__ = arg_2 else : arg_0 . __multi__ [ arg_1 ] = arg_2 return arg_2 return apply_decorator


Question: Resolves environment from . cpenv file ... recursively walks up the tree in attempt to find a . cpenv file

def Func ( arg_0 , arg_1 ) : if not os . path . exists ( arg_1 ) : raise ResolveError if os . path . isfile ( arg_1 ) : arg_1 = os . path . dirname ( arg_1 ) for arg_2 , arg_3 , arg_3 in walk_up ( arg_1 ) : if is_redirecting ( arg_2 ) : arg_4 = redirect_to_env_paths ( unipath ( arg_2 , '.cpenv' ) ) arg_5 = Resolver ( * arg_4 ) return arg_5 . resolve ( ) raise ResolveError

Set a smoothing Gaussian kernel given its FWHM in mm.


Question: Send a password reset to the user s email address .

def Func ( arg_0 ) : arg_1 = Site . objects . get_current ( ) arg_0 . password_reset_notification ( user = arg_0 , arg_1 = arg_1 ) . notify ( )


Question: Triggers specific class methods using a simple reflection mechanism based on the given input dictionary params .

def Func ( arg_0 , arg_1 ) : for arg_2 in sorted ( arg_1 ) : arg_3 = arg_1 [ arg_2 ] arg_4 = arg_0 if arg_2 . startswith ( 'response_' ) or arg_2 . startswith ( 'reply_' ) : arg_2 = arg_2 . replace ( 'response_' , '' ) . replace ( 'reply_' , '' ) if hasattr ( arg_0 , '_response' ) : arg_4 = arg_0 . _response arg_5 = getattr ( arg_4 , arg_2 , None ) arg_6 = arg_2 in dir ( arg_4 ) arg_7 = ismethod ( arg_5 ) and not isfunction ( arg_5 ) if not arg_7 and not arg_6 : raise PookInvalidArgument ( 'Unsupported argument: {}' . format ( arg_2 ) ) if arg_7 : arg_5 ( arg_3 ) else : setattr ( arg_4 , arg_2 , arg_3 )

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: Gets the response and generates the _Response object

def Func ( arg_0 ) : arg_1 = arg_0 . _httprequest . status ( ) arg_2 = arg_0 . _httprequest . status_text ( ) arg_3 = arg_0 . _httprequest . get_all_response_headers ( ) arg_4 = [ ] for arg_5 in arg_3 . split ( '\n' ) : if ( arg_5 . startswith ( '\t' ) or arg_5 . startswith ( ' ' ) ) and arg_4 : arg_4 [ - 1 ] += arg_5 else : arg_4 . append ( arg_5 ) arg_6 = [ ] for arg_5 in arg_4 : if ':' in arg_5 : arg_7 = arg_5 . find ( ':' ) arg_6 . append ( ( arg_5 [ : arg_7 ] . lower ( ) , arg_5 [ arg_7 + 1 : ] . strip ( ) ) ) arg_8 = arg_0 . _httprequest . response_body ( ) arg_9 = len ( arg_8 ) return _Response ( arg_1 , arg_2 , arg_9 , arg_6 , arg_8 )


Question: Return icon for index .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . sourceModel ( ) if not arg_2 : return None return arg_2 . Func ( arg_0 . mapToSource ( arg_1 ) )

Stop the heartbeating and cancel all related callbacks.


Question: Waits for an asynchronous operation to complete .

def Func ( arg_0 , arg_1 , arg_2 = 'Succeeded' , arg_3 = 30 , arg_4 = 5 , arg_5 = arg_6 , arg_7 = arg_8 , arg_9 = arg_10 ) : arg_11 = arg_3 // arg_4 + 1 arg_12 = time . time ( ) for arg_13 in range ( int ( arg_11 ) ) : arg_14 = arg_0 . get_operation_status ( arg_1 ) arg_15 = time . time ( ) - arg_12 if arg_14 . status == arg_2 : if arg_7 is not None : arg_7 ( arg_15 ) return arg_14 elif arg_14 . error : if arg_9 is not None : arg_16 = AzureAsyncOperationHttpError ( _ERROR_ASYNC_OP_FAILURE , arg_14 . status , arg_14 ) arg_9 ( arg_15 , arg_16 ) return arg_14 else : if arg_5 is not None : arg_5 ( arg_15 ) time . sleep ( arg_4 ) if arg_9 is not None : arg_16 = AzureAsyncOperationHttpError ( _ERROR_ASYNC_OP_TIMEOUT , arg_14 . status , arg_14 ) arg_9 ( arg_15 , arg_16 ) return arg_14


Question: Perform inference for a single step . Given an SDR input and a weight matrix return a predicted distribution .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 [ arg_1 ] . sum ( axis = 0 ) arg_3 = arg_3 - numpy . max ( arg_3 ) arg_4 = numpy . exp ( arg_3 ) arg_5 = arg_4 / numpy . sum ( arg_4 ) return arg_5

Rename this conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be renamed.


Question: Returns a link dictionary .

def Func ( arg_0 , arg_1 = True ) : if arg_1 : return arg_0 . _links . copy ( ) else : return arg_0 . _links

Return the number of bytes transmitted in 1 second.


Question: Parse a Confluence summary JSON list .

def Func ( arg_0 ) : arg_1 = json . loads ( arg_0 ) arg_2 = arg_1 [ 'results' ] for arg_3 in arg_2 : yield arg_3

Inform the widget about the encoding of the underlying character stream.


Question: Handle marking messages as read and keeping client active .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _coroutine_queue . put ( arg_0 . _client . set_active ( ) ) arg_0 . _coroutine_queue . put ( arg_0 . _conversation . update_read_timestamp ( ) ) return super ( ) . Func ( arg_1 , arg_2 )

source record and index must have been set


Question: Decorator so that functions can be written to work on Series but may still be called with DataFrames .

def Func ( arg_0 ) : def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . ndim == 1 : return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) elif arg_1 . ndim == 2 : return arg_1 . apply ( arg_0 , * arg_2 , ** arg_3 ) return wrapper


Question: Standardizes continuous features and expands categorical features .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 ) : arg_9 = [ ] for arg_10 , arg_11 in enumerate ( arg_2 ) : arg_12 = [ ] for arg_13 , arg_14 in enumerate ( arg_11 ) : arg_15 = arg_4 [ arg_13 ] if arg_13 == arg_0 : arg_16 = arg_8 [ arg_14 ] arg_12 . append ( arg_16 ) elif arg_15 in arg_6 : pass elif arg_15 in arg_7 : for arg_17 in arg_3 [ arg_15 ] : if arg_14 == arg_17 : arg_18 = 1.0 else : arg_18 = - 1.0 arg_12 . append ( arg_18 ) else : arg_19 = float ( ( arg_14 - arg_5 [ arg_15 ] [ 'mean' ] ) / arg_5 [ arg_15 ] [ 'std_dev' ] ) arg_12 . append ( arg_19 ) arg_9 . append ( arg_12 ) arg_20 = [ ] for arg_15 in arg_4 : if arg_15 in arg_6 : pass elif ( arg_15 in arg_7 ) and ( arg_15 is not arg_1 ) : for arg_17 in arg_3 [ arg_15 ] : arg_21 = '{}_{}' . format ( arg_15 , arg_17 ) arg_20 . append ( arg_21 ) else : arg_20 . append ( arg_15 ) return arg_9 , arg_20

Returns how the result count compares to the query options.

        The return value is negative if too few results were found, zero if enough were found, and
        positive if too many were found.

        Returns:
            int: -1, 0, or 1.


Question: Attempt to sum MultivariateNormal distributions .

def Func ( arg_0 ) : arg_1 = [ tensor for distribution in arg_0 for tensor in distribution . _graph_parents ] with tf . compat . v1 . name_scope ( 'Func' , values = arg_1 ) : if all ( [ isinstance ( arg_2 , tfd . MultivariateNormalDiag ) for arg_2 in arg_0 ] ) : return tfd . MultivariateNormalDiag ( loc = sum ( [ arg_2 . mean ( ) for arg_2 in arg_0 ] ) , scale_diag = tf . sqrt ( sum ( [ arg_2 . scale . diag ** 2 for arg_2 in arg_0 ] ) ) ) else : raise NotImplementedError ( 'Sums of distributions other than MultivariateNormalDiag are not ' 'currently implemented. (given: {})' . format ( arg_0 ) )

This method is called before first step of simulation.


Question: Emulate a single instruction .

def Func ( arg_0 , arg_1 ) : while True : arg_0 . reset ( ) for arg_2 in arg_0 . _should_be_mapped : arg_3 , arg_4 = arg_0 . _should_be_mapped [ arg_2 ] arg_0 . _emu . mem_map ( arg_2 , arg_3 , arg_4 ) for arg_5 , arg_6 in arg_0 . _should_be_written . items ( ) : for arg_7 , arg_8 in enumerate ( arg_6 , start = arg_5 ) : if issymbolic ( arg_8 ) : from . . native . cpu . abstractcpu import ConcretizeMemory raise ConcretizeMemory ( arg_0 . _cpu . memory , arg_7 , 8 , "Concretizing for emulation" ) arg_0 . _emu . mem_write ( arg_5 , b'' . join ( arg_6 ) ) arg_0 . _should_try_again = False arg_0 . _step ( arg_1 ) if not arg_0 . _should_try_again : break

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: yield all file paths under input_dir

def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 in os . walk ( arg_0 ) : for arg_4 in arg_3 : arg_5 = os . path . join ( arg_1 , arg_4 ) yield arg_5

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: The list from pypi is really a list of versions . We want a list of packages with the list of versions stored inline . This converts the list from pypi into one we can use .

def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 : arg_3 = arg_2 [ 'name' ] arg_4 = arg_2 [ 'summary' ] arg_5 = arg_2 [ 'version' ] arg_6 = arg_2 [ '_pypi_ordering' ] if arg_6 is None : arg_6 = 0 if arg_3 not in arg_1 . keys ( ) : arg_1 [ arg_3 ] = { 'name' : arg_3 , 'summary' : arg_4 , 'versions' : [ arg_5 ] , 'score' : arg_6 , } else : arg_1 [ arg_3 ] [ 'versions' ] . append ( arg_5 ) if arg_5 == highest_version ( arg_1 [ arg_3 ] [ 'versions' ] ) : arg_1 [ arg_3 ] [ 'summary' ] = arg_4 arg_1 [ arg_3 ] [ 'score' ] = arg_6 arg_7 = sorted ( arg_1 . values ( ) , key = lambda x : x [ 'score' ] , reverse = True , ) return arg_7

Check if hdl process has event depenency on signal


Question: Format an experiment result memory object for measurement level 0 .

def Func ( arg_0 ) : arg_1 = _list_to_complex_array ( arg_0 ) if not 2 <= len ( arg_1 . shape ) <= 3 : raise QiskitError ( 'Level zero memory is not of correct shape.' ) return arg_1

Return True if we should retry. False otherwise.

  Args:
    exception: An exception to test for transience.

  Returns:
    True if we should retry. False otherwise.


Question: Remove a listener from the emitter .

def Func ( arg_0 , arg_1 , arg_2 ) : with contextlib . suppress ( ValueError ) : arg_0 . _listeners [ arg_1 ] . remove ( arg_2 ) return True with contextlib . suppress ( ValueError ) : arg_0 . _once [ arg_1 ] . remove ( arg_2 ) return True return False

Sets the review comment. Raises CardinalityError if
        already set. OrderError if no reviewer defined before.
        Raises SPDXValueError if comment is not free form text.


Question: Given a dictionary of variable attribute data from get_details display the data in the terminal .

def Func ( arg_0 ) : arg_1 = ( arg_2 for arg_2 in list ( arg_0 . keys ( ) ) if arg_2 . startswith ( 'META_' ) ) for arg_2 in arg_1 : arg_3 = arg_2 [ 5 : ] . capitalize ( ) pprint ( '{0}: {1}' . format ( arg_3 , arg_0 . pop ( arg_2 ) ) ) pprint ( arg_0 )

Remove all binary files in the adslib directory.


Question: We use VBox directly instead of Docker Machine because it shaves about 0 . 5 seconds off the runtime of this check .

def Func ( ) : arg_0 = check_output_demoted ( [ 'VBoxManage' , 'list' , 'vms' ] ) for arg_1 in arg_0 . splitlines ( ) : if '"{}"' . format ( constants . VM_MACHINE_NAME ) in arg_1 : return True return False

Delete the specified InactivityAlert

        :param tag_id: The tag ID to delete
        :type tag_id: str

        :raises: This will raise a
            :class:`ServerException <logentries_api.exceptions.ServerException>`
            if there is an error from Logentries


Question: Asserts that val is iterable and contains duplicate items .

def Func ( arg_0 ) : try : if len ( arg_0 . val ) != len ( set ( arg_0 . val ) ) : return arg_0 except TypeError : raise TypeError ( 'val is not iterable' ) arg_0 . _err ( 'Expected <%s> to contain duplicates, but did not.' % arg_0 . val )


Question: A property factory that will dispatch the to a specific validator function that will validate the user s input to ensure critical parameters are of a specific type .

def Func ( arg_0 ) : def getter ( arg_1 ) : return arg_1 . __dict__ [ arg_0 ] def setter ( arg_1 , arg_2 ) : validate_input ( arg_1 . __class__ . __name__ , arg_0 , arg_2 ) arg_1 . __dict__ [ arg_0 ] = arg_2 return property ( fget = getter , fset = setter )

Replace all the tracks in a playlist, overwriting its existing tracks.
        This powerful request can be useful for replacing tracks, re-ordering existing tracks, or clearing the playlist.

        Parameters
        ----------
        playlist : Union[str, PLaylist]
            The playlist to modify
        tracks : Sequence[Union[str, Track]]
            Tracks to place in the playlist


Question: Draw all line strings onto a given image .

def Func ( arg_0 , arg_1 , arg_2 = ( 0 , 255 , 0 ) , arg_3 = None , arg_4 = None , arg_5 = 1.0 , arg_6 = None , arg_7 = None , arg_8 = 1 , arg_9 = None , arg_10 = None , arg_11 = True , arg_12 = False ) : for arg_13 in arg_0 . line_strings : arg_1 = arg_13 . Func ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_11 = arg_11 , arg_12 = arg_12 ) return arg_1

Handle the kernel's death by asking if the user wants to restart.


Question: \ Received registration acknowledgement from the BotnetBot as well as the name of the command channel so join up and indicate that registration succeeded

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_0 . channel = arg_4 arg_0 . conn . join ( arg_0 . channel ) arg_0 . registered . set ( )


Question: given a config dict with streamcorpus_pipeline as a key find all keys under streamcorpus_pipeline that end with _path and if the value of that key is a relative path convert it to an absolute path using the value provided by root_path

def Func ( arg_0 ) : if not 'streamcorpus_pipeline' in arg_0 : logger . critical ( 'bad config: %r' , arg_0 ) raise ConfigurationError ( 'missing "streamcorpus_pipeline" from config' ) arg_1 = arg_0 [ 'streamcorpus_pipeline' ] . pop ( 'root_path' , None ) if not arg_1 : arg_1 = os . getcwd ( ) if not arg_1 . startswith ( '/' ) : arg_1 = os . path . join ( os . getcwd ( ) , arg_1 ) def recursive_abs_path ( arg_2 , arg_1 ) : for arg_3 , arg_4 in arg_2 . items ( ) : if isinstance ( arg_4 , basestring ) : if arg_3 . endswith ( 'path' ) : if re . match ( '^http.?://' , arg_4 ) : continue if not arg_4 . startswith ( '/' ) : arg_2 [ arg_3 ] = os . path . join ( arg_1 , arg_4 ) elif isinstance ( arg_4 , dict ) : recursive_abs_path ( arg_4 , arg_1 ) recursive_abs_path ( arg_0 , arg_1 ) arg_0 [ 'root_path' ] = arg_1

Fill entire strip by giving individual RGB values instead of tuple


Question: run child process to get OWPL output

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = dict ( INPUT_FILE = arg_1 , OUTPUT_FILE = arg_2 , PIPELINE_ROOT = arg_3 ) arg_5 = pipeline_cmd_templates [ arg_0 ] % arg_4 print arg_5 print 'creating %s' % arg_2 arg_6 = time . time ( ) arg_7 = subprocess . Popen ( arg_5 , stderr = subprocess . PIPE , shell = True ) arg_8 , arg_9 = arg_7 . communicate ( ) assert arg_7 . returncode == 0 and 'Exception' not in arg_9 , arg_9 arg_10 = time . time ( ) - arg_6 print 'created %s in %.1f sec' % ( arg_2 , arg_10 ) '''    postproc_cmd = postproc_cmd_templates[tagger_id] % params    print postproc_cmd    ## replace this with log.info()    print 'creating %s' % tmp_ner_raw_path    start_time = time.time()    gpg_child = subprocess.Popen(        postproc_cmd,        stderr=subprocess.PIPE, shell=True)    s_out, errors = gpg_child.communicate()    assert gpg_child.returncode == 0 and 'Exception' not in errors, errors    elapsed = time.time() - start_time    ## replace this with log.info()    print 'created %s in %.1f sec' % (tmp_ner_path, elapsed)    '''

Check the spacing of a single equals sign.


Question: Check if the node is being used as an iterator .

def Func ( arg_0 ) : arg_1 = arg_0 . parent if isinstance ( arg_1 , astroid . For ) : return True if isinstance ( arg_1 , astroid . Comprehension ) : if arg_1 . iter == arg_0 : return True elif isinstance ( arg_1 , astroid . Call ) : if isinstance ( arg_1 . func , astroid . Name ) : arg_2 = arg_1 . func . lookup ( arg_1 . func . name ) [ 0 ] if _is_builtin ( arg_2 ) and arg_1 . func . name in _ACCEPTS_ITERATOR : return True elif isinstance ( arg_1 . func , astroid . Attribute ) : if arg_1 . func . attrname in ATTRIBUTES_ACCEPTS_ITERATOR : return True arg_3 = utils . safe_infer ( arg_1 . func ) if arg_3 : if arg_3 . qname ( ) in _BUILTIN_METHOD_ACCEPTS_ITERATOR : return True arg_4 = arg_3 . root ( ) if arg_4 and arg_4 . name == "itertools" : return True elif isinstance ( arg_1 , astroid . Assign ) and isinstance ( arg_1 . targets [ 0 ] , ( astroid . List , astroid . Tuple ) ) : if len ( arg_1 . targets [ 0 ] . elts ) > 1 : return True elif ( isinstance ( arg_1 , astroid . Compare ) and len ( arg_1 . ops ) == 1 and arg_1 . ops [ 0 ] [ 0 ] == "in" ) : return True elif isinstance ( arg_1 , astroid . YieldFrom ) : return True if isinstance ( arg_1 , astroid . Starred ) : return True return False

Uploads file to GDocs spreadsheet.
        Content type can be provided as argument, default is ods.


Question: Generates python code for a clause repeated 1 or more times .

def Func ( arg_0 , arg_1 : arg_2 . Rep0N ) -> [ ast . stmt ] : arg_4 = arg_0 . visit ( arg_1 . pt ) if isinstance ( arg_4 , ast . expr ) : return ( arg_0 . _clause ( arg_4 ) + arg_0 . visit_Rep0N ( arg_1 ) ) arg_0 . in_loop += 1 arg_4 = arg_0 . _clause ( arg_0 . visit ( arg_1 . pt ) ) arg_0 . in_loop -= 1 return arg_0 . _clause ( arg_0 . visit ( arg_1 . pt ) ) + [ ast . While ( ast . Name ( 'True' , ast . Load ( ) ) , arg_4 , [ ] ) ]

Save the state of hooks in the sys module.

        This has to be called after self.user_module is created.


Question: Move the selected object

def Func ( arg_0 , arg_1 ) : if DEBUG : print "move!" if arg_0 . current and not arg_0 . overlay : arg_2 = arg_0 . current arg_3 , arg_4 = arg_0 . start arg_5 , arg_6 = wx . GetMousePosition ( ) arg_5 , arg_6 = ( arg_5 + arg_3 , arg_6 + arg_4 ) if arg_1 . ShiftDown ( ) : arg_5 = arg_5 / GRID_SIZE [ 0 ] * GRID_SIZE [ 0 ] arg_6 = arg_6 / GRID_SIZE [ 1 ] * GRID_SIZE [ 1 ] arg_7 , arg_8 = arg_2 . obj . pos arg_9 , arg_10 = ( arg_5 - arg_7 ) , ( arg_6 - arg_8 ) for arg_11 in arg_0 . selection : arg_5 , arg_6 = arg_11 . pos arg_5 = arg_5 + arg_9 arg_6 = arg_6 + arg_10 arg_11 . pos = ( wx . Point ( arg_5 , arg_6 ) ) elif arg_0 . overlay : arg_2 = arg_0 . current arg_12 = arg_1 . GetPosition ( ) if arg_1 . GetEventObject ( ) != arg_2 : arg_12 = arg_1 . GetEventObject ( ) . ClientToScreen ( arg_12 ) arg_12 = arg_2 . ScreenToClient ( arg_12 ) arg_13 = wx . RectPP ( arg_0 . pos , arg_12 ) arg_14 = wx . ClientDC ( arg_2 ) arg_15 = wx . DCOverlay ( arg_0 . overlay , arg_14 ) arg_15 . Clear ( ) arg_14 . SetPen ( wx . Pen ( "blue" , 2 ) ) if 'wxMac' in wx . PlatformInfo : arg_14 . SetBrush ( wx . Brush ( wx . Colour ( 0xC0 , 0xC0 , 0xC0 , 0x80 ) ) ) else : arg_14 . SetBrush ( wx . TRANSPARENT_BRUSH ) arg_14 . DrawRectangleRect ( arg_13 ) del arg_15

Use ``\\r`` to overdraw the current line with the given text.

        This function transparently handles tracking how much overdrawing is
        necessary to erase the previous line when used consistently.

        :param text: The text to be outputted
        :param newline: Whether to start a new line and reset the length count.
        :type text: :class:`~__builtins__.str`
        :type newline: :class:`~__builtins__.bool`


Question: Wrap simpler AST generators to return a GeneratedPyAST .

def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapped_ast_generator ( arg_1 : arg_2 , arg_3 : arg_4 ) -> GeneratedPyAST : return GeneratedPyAST ( node = arg_0 ( arg_1 , arg_3 ) ) return wrapped_ast_generator

Attaches a bundle object

        :param bundle: :class:`flask_journey.BlueprintBundle` object
        :raises:
            - IncompatibleBundle if the bundle is not of type `BlueprintBundle`
            - ConflictingPath if a bundle already exists at bundle.path
            - MissingBlueprints if the bundle doesn't contain any blueprints


Question: Creates a 2D quad VAO using 2 triangles with normals and texture coordinates .

Resets the builder's state to allow building new annotations.