Question: checks to make sure that the card passes a luhn mod - 10 checksum

def Func ( arg_0 ) : arg_1 = 0 arg_2 = len ( arg_0 ) arg_3 = arg_2 & 1 for arg_4 in range ( 0 , arg_2 ) : arg_5 = int ( arg_0 [ arg_4 ] ) if not ( ( arg_4 & 1 ) ^ arg_3 ) : arg_5 *= 2 if arg_5 > 9 : arg_5 -= 9 arg_1 += arg_5 return ( arg_1 % 10 ) == 0

Stop the timer

        Returns:
            The time the timer was stopped


Question: Print current cluster status information .

def Func ( arg_0 , arg_1 = False ) : if arg_0 . _retrieved_at + arg_0 . REFRESH_INTERVAL < time . time ( ) : arg_2 = h2o . api ( "GET /3/Cloud" ) arg_0 . _fill_from_h2ocluster ( arg_2 ) arg_3 = sum ( arg_12 [ "num_cpus" ] for arg_12 in arg_0 . nodes ) arg_4 = sum ( arg_12 [ "cpus_allowed" ] for arg_12 in arg_0 . nodes ) arg_5 = sum ( arg_12 [ "free_mem" ] for arg_12 in arg_0 . nodes ) arg_6 = sum ( not arg_12 [ "healthy" ] for arg_12 in arg_0 . nodes ) arg_7 = "locked" if arg_0 . locked else "accepting new members" if arg_6 == 0 : arg_7 += ", healthy" else : arg_7 += ", %d nodes are not healthy" % arg_6 arg_8 = arg_0 . list_api_extensions ( ) H2ODisplay ( [ [ "H2O cluster uptime:" , get_human_readable_time ( arg_0 . cloud_uptime_millis ) ] , [ "H2O cluster timezone:" , arg_0 . cloud_internal_timezone ] , [ "H2O data parsing timezone:" , arg_0 . datafile_parser_timezone ] , [ "H2O cluster version:" , arg_0 . version ] , [ "H2O cluster version age:" , "{} {}" . format ( arg_0 . build_age , ( "!!!" if arg_0 . build_too_old else "" ) ) ] , [ "H2O cluster name:" , arg_0 . cloud_name ] , [ "H2O cluster total nodes:" , arg_0 . cloud_size ] , [ "H2O cluster free memory:" , get_human_readable_bytes ( arg_5 ) ] , [ "H2O cluster total cores:" , str ( arg_3 ) ] , [ "H2O cluster allowed cores:" , str ( arg_4 ) ] , [ "H2O cluster status:" , arg_7 ] , [ "H2O connection url:" , h2o . connection ( ) . base_url ] , [ "H2O connection proxy:" , h2o . connection ( ) . proxy ] , [ "H2O internal security:" , arg_0 . internal_security_enabled ] , [ "H2O API Extensions:" , ', ' . join ( arg_8 ) ] , [ "Python version:" , "%d.%d.%d %s" % tuple ( sys . version_info [ : 4 ] ) ] , ] ) if arg_1 : arg_9 = [ "h2o" , "healthy" , "last_ping" , "num_cpus" , "sys_load" , "mem_value_size" , "free_mem" , "pojo_mem" , "swap_mem" , "free_disk" , "max_disk" , "pid" , "num_keys" , "tcps_active" , "open_fds" , "rpcs_active" ] arg_10 = [ "Nodes info:" ] + [ "Node %d" % ( arg_13 + 1 ) for arg_13 in range ( len ( arg_0 . nodes ) ) ] arg_11 = [ [ arg_14 ] for arg_14 in arg_9 ] for arg_12 in arg_0 . nodes : for arg_13 , arg_14 in enumerate ( arg_9 ) : arg_11 [ arg_13 ] . append ( arg_12 [ arg_14 ] ) H2ODisplay ( arg_11 = arg_11 , arg_10 = arg_10 )

this factory also requires the editor token


Question: Parses data from Wikipedia page markup .

def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . markup arg_0 . disambiguation = arg_0 . Func_disambiguation ( arg_2 ) arg_0 . categories = arg_0 . Func_categories ( arg_2 ) arg_0 . links = arg_0 . Func_links ( arg_2 ) if not arg_1 : arg_2 = arg_0 . convert_pre ( arg_2 ) arg_2 = arg_0 . convert_li ( arg_2 ) arg_2 = arg_0 . convert_table ( arg_2 ) arg_2 = replace_entities ( arg_2 ) arg_2 = arg_2 . replace ( "{{Cite" , "{{cite" ) arg_2 = re . sub ( "\{\{ {1,2}cite" , "{{cite" , arg_2 ) arg_0 . references , arg_2 = arg_0 . Func_references ( arg_2 ) arg_2 = re . sub ( "\n+(\{\{legend)" , "\\1" , arg_2 ) arg_0 . images , arg_2 = arg_0 . Func_images ( arg_2 ) arg_0 . images . extend ( arg_0 . Func_gallery_images ( arg_2 ) ) arg_0 . paragraphs = arg_0 . Func_paragraphs ( arg_2 ) arg_0 . tables = arg_0 . Func_tables ( arg_2 ) arg_0 . translations = arg_0 . Func_translations ( arg_2 ) arg_0 . important = arg_0 . Func_important ( arg_2 )

Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.


Question: Get 3D markers .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : return arg_0 . _Func ( RT3DMarkerPosition , arg_1 , arg_2 , arg_3 )

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


Question: Seek through the file to find how many data blocks there are in the file

def Func ( arg_0 ) : arg_0 . file_obj . seek ( 0 ) arg_1 , arg_2 = arg_0 . read_header ( ) arg_0 . file_obj . seek ( arg_2 ) arg_3 = int ( arg_1 [ 'BLOCSIZE' ] ) arg_4 = int ( arg_1 [ 'NBITS' ] ) arg_0 . file_obj . seek ( int ( arg_1 [ 'BLOCSIZE' ] ) , 1 ) arg_5 = 1 arg_6 = False while not arg_6 : try : arg_7 , arg_8 = arg_0 . read_header ( ) arg_0 . file_obj . seek ( arg_8 ) arg_0 . file_obj . seek ( arg_7 [ 'BLOCSIZE' ] , 1 ) arg_5 += 1 except EndOfFileError : arg_6 = True break arg_0 . file_obj . seek ( 0 ) return arg_5

Return True if we should retry, False otherwise.


Question: API call to create a new version of a template

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None ) : if ( arg_5 ) : arg_8 = { 'name' : arg_1 , 'subject' : arg_2 , 'html' : arg_5 , 'text' : arg_3 } else : arg_8 = { 'name' : arg_1 , 'subject' : arg_2 , 'text' : arg_3 } if arg_6 : arg_9 = arg_0 . TEMPLATES_SPECIFIC_LOCALE_VERSIONS_ENDPOINT % ( arg_4 , arg_6 ) else : arg_9 = arg_0 . TEMPLATES_NEW_VERSION_ENDPOINT % arg_4 return arg_0 . _api_request ( arg_9 , arg_0 . HTTP_POST , arg_8 = arg_8 , arg_7 = arg_7 )


Question: Update this organisations information . Returns a new organisation object .

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . fetch_json ( uri_path = arg_0 . base_uri , http_method = 'PUT' , arg_1 = arg_1 or { } ) return arg_0 . create_organisation ( arg_2 )

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

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


Question: Check if two XML elements are equal .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if None in ( arg_0 , arg_1 ) or arg_0 . tag != arg_1 . tag : return False arg_3 = arg_0 . items ( ) arg_3 . sort ( ) arg_4 = arg_1 . items ( ) arg_4 . sort ( ) if not arg_2 : if arg_0 . text != arg_1 . text : return False if arg_3 != arg_4 : return False if len ( arg_0 ) != len ( arg_1 ) : return False for arg_5 , arg_6 in zip ( arg_0 , arg_1 ) : if arg_5 . tag != arg_6 . tag : return False if not arg_2 : if arg_0 . text != arg_1 . text : return False if not Func ( arg_5 , arg_6 ) : return False return True


Question: Parse a file string or list of strings containing parameter bindings .

def Func ( arg_0 , arg_1 = False ) : if isinstance ( arg_0 , ( list , tuple ) ) : arg_0 = '\n' . join ( arg_0 ) _validate_skip_unknown ( arg_1 ) if isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = set ( arg_1 ) arg_2 = config_parser . ConfigParser ( arg_0 , ParserDelegate ( arg_1 ) ) for arg_3 in arg_2 : if isinstance ( arg_3 , config_parser . BindingStatement ) : arg_4 , arg_5 , arg_6 , arg_7 , arg_8 = arg_3 if not arg_6 : arg_9 = '{}/{}' . format ( arg_4 , arg_5 ) if arg_4 else arg_5 with utils . try_with_location ( arg_8 ) : bind_parameter ( ( arg_9 , 'gin.macro' , 'value' ) , arg_7 ) continue if not _should_skip ( arg_5 , arg_1 ) : with utils . try_with_location ( arg_8 ) : bind_parameter ( ( arg_4 , arg_5 , arg_6 ) , arg_7 ) elif isinstance ( arg_3 , config_parser . ImportStatement ) : if arg_1 : try : __import__ ( arg_3 . module ) _IMPORTED_MODULES . add ( arg_3 . module ) except ImportError : arg_10 = 'Skipping import of unknown module `%s` (skip_unknown=%r).' logging . info ( arg_10 , arg_3 . module , arg_1 ) else : with utils . try_with_location ( arg_3 . location ) : __import__ ( arg_3 . module ) _IMPORTED_MODULES . add ( arg_3 . module ) elif isinstance ( arg_3 , config_parser . IncludeStatement ) : with utils . try_with_location ( arg_3 . location ) : Func_file ( arg_3 . filename , arg_1 ) else : raise AssertionError ( 'Unrecognized statement type {}.' . format ( arg_3 ) )

Deletes a transfer job. This is a soft delete. After a transfer job is
        deleted, the job and all the transfer executions are subject to garbage
        collection. Transfer jobs become eligible for garbage collection
        30 days after soft delete.

        :param job_name: (Required) Name of the job to be deleted
        :type job_name: str
        :param project_id: (Optional) the ID of the project that owns the Transfer
            Job. If set to None or missing, the default project_id from the GCP
            connection is used.
        :type project_id: str
        :rtype: None


Question: r \ s +

def Func ( arg_0 , arg_1 ) : arg_0 . add_token ( 'SPACE' , arg_1 ) arg_0 . pos += len ( arg_1 ) pass

This runs the pyeebls.eebls function using the given inputs.

    Parameters
    ----------

    times,mags : np.array
        The input magnitude time-series to search for transits.

    nfreq : int
        The number of frequencies to use when searching for transits.

    freqmin : float
        The minimum frequency of the period-search -> max period that will be
        used for the search.

    stepsize : float
        The step-size in frequency to use to generate a frequency-grid.

    nbins : int
        The number of phase bins to use.

    minduration : float
        The minimum fractional transit duration that will be considered.

    maxduration : float
        The maximum fractional transit duration that will be considered.

    Returns
    -------

    dict
        Returns a dict of the form::

            {
                'power':           the periodogram power array,
                'bestperiod':      the best period found,
                'bestpower':       the highest peak of the periodogram power,
                'transdepth':      transit depth found by eebls.f,
                'transduration':   transit duration found by eebls.f,
                'transingressbin': transit ingress bin found by eebls.f,
                'transegressbin':  transit egress bin found by eebls.f,
            }


Question: Calls implmentation to get a render context passes it to the drawqueues render function then calls self . rendering_finished

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . create_rcontext ( arg_1 , arg_2 ) arg_3 . Func ( arg_4 ) arg_0 . Funcing_finished ( arg_1 , arg_2 , arg_4 ) return arg_4

Unregister an extension code.  For testing only.


Question: Updates settings of a Cloud SQL instance .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_0 . get_conn ( ) . instances ( ) . patch ( project = arg_3 , arg_2 = arg_2 , arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) arg_5 = arg_4 [ "name" ] arg_0 . _wait_for_operation_to_complete ( arg_3 = arg_3 , arg_5 = arg_5 )

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 source files update time

def Func ( arg_0 ) : if not exists ( Post . src_dir ) : logger . error ( SourceDirectoryNotFound . __doc__ ) sys . exit ( SourceDirectoryNotFound . exit_code ) arg_1 = [ ] for arg_2 in ls ( Post . src_dir ) : if arg_2 . endswith ( src_ext ) : arg_1 . append ( join ( Post . src_dir , arg_2 ) ) if exists ( config . filepath ) : arg_1 . append ( config . filepath ) arg_3 = dict ( ( p , stat ( p ) . st_mtime ) for p in arg_1 ) return arg_3

Fetch the events pages of a given group.


Question: Handle memory operations from unicorn .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : assert arg_2 in ( UC_MEM_WRITE , UC_MEM_READ , UC_MEM_FETCH ) if arg_2 == UC_MEM_WRITE : arg_0 . _cpu . write_int ( arg_3 , arg_5 , arg_4 * 8 ) elif arg_2 == UC_MEM_READ : arg_5 = arg_0 . _cpu . read_bytes ( arg_3 , arg_4 ) if arg_3 in arg_0 . _should_be_written : return True arg_0 . _should_be_written [ arg_3 ] = arg_5 arg_0 . _should_try_again = True return False return True


Question: Build and execute login request

def Func ( arg_0 ) : arg_1 = "%s/auth.cgi?api=SYNO.API.Auth&version=2" % ( arg_0 . base_url , ) arg_2 = "method=login&%s" % ( arg_0 . _encode_credentials ( ) ) arg_3 = "%s&%s&session=Core&format=cookie" % ( arg_1 , arg_2 ) arg_4 = arg_0 . _execute_get_url ( arg_3 , False ) if arg_4 is not None : arg_0 . access_token = arg_4 [ "data" ] [ "sid" ] arg_0 . _debuglog ( "Authentication Succesfull, token: " + str ( arg_0 . access_token ) ) return True else : arg_0 . _debuglog ( "Authentication Failed" ) return False

A list of row indices to remove. There are two caveats. First, this is
    a potentially slow operation. Second, pattern indices will shift if
    patterns before them are removed.


Question: Returns True when point 1 and point 2 overlap . There is an r treshold in which point 1 and point 2 are considered to overlap .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = 5 ) : if abs ( arg_3 - arg_1 ) < arg_5 and abs ( arg_4 - arg_2 ) < arg_5 : return True else : return False

This is the refresh method that overloads the prototype in
            BlockchainObject.


Question: Layered feed - forward network .

def Func ( arg_0 , arg_1 ) : arg_2 = map ( lambda n : [ 0.0 for i in range ( n ) ] , arg_1 ) arg_3 = [ ] def predict ( arg_4 ) : unimplemented ( ) return predict

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: Take care of command line options

def Func ( ) : arg_0 = docopt ( __doc__ , version = "Find Known Secrets {0}" . format ( __version__ ) ) logger . debug ( arg_0 ) if arg_0 [ "here" ] : go ( ) else : arg_1 = arg_0 [ "--secrets" ] arg_2 = Searcher ( source = arg_0 [ "--source" ] , arg_1 = arg_1 ) arg_2 . go ( )

Reshape input and output dimensions of operator.

        Arg:
            input_dims (tuple): new subsystem input dimensions.
            output_dims (tuple): new subsystem output dimensions.

        Returns:
            Operator: returns self with reshaped input and output dimensions.

        Raises:
            QiskitError: if combined size of all subsystem input dimension or
            subsystem output dimensions is not constant.


Question: Create the lines for an excel file with verified variants for an institute

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = [ ] for arg_5 in arg_3 [ 'samples' ] : arg_6 = [ ] arg_6 . append ( arg_3 [ 'institute' ] ) arg_6 . append ( arg_3 [ '_id' ] ) arg_6 . append ( arg_3 [ 'category' ] ) arg_6 . append ( arg_3 [ 'variant_type' ] ) arg_6 . append ( arg_3 [ 'display_name' ] [ : 30 ] ) arg_7 = arg_3 [ 'case_obj' ] [ 'display_name' ] arg_8 = '/' . join ( [ '' , arg_3 [ 'institute' ] , arg_7 , arg_3 [ '_id' ] ] ) arg_6 . append ( arg_8 ) arg_6 . append ( arg_3 . get ( 'validation' ) ) arg_6 . append ( arg_7 ) arg_9 = next ( ind for ind in arg_3 [ 'case_obj' ] [ 'individuals' ] if ind [ 'individual_id' ] == arg_5 [ 'sample_id' ] ) if arg_9 [ 'phenotype' ] == 2 : arg_6 . append ( ' ' . join ( [ arg_5 . get ( 'display_name' ) , '(A)' ] ) ) else : arg_6 . append ( arg_5 . get ( 'display_name' ) ) arg_6 . append ( '' . join ( [ 'chr' , arg_3 [ 'chromosome' ] , ':' , str ( arg_3 [ 'position' ] ) ] ) ) arg_6 . append ( '>' . join ( [ arg_3 . get ( 'reference' ) [ : 10 ] , arg_3 . get ( 'alternative' ) [ : 10 ] ] ) ) arg_10 = [ ] arg_11 = [ ] arg_12 = [ ] for arg_13 in arg_3 . get ( 'genes' ) : arg_10 . append ( arg_13 . get ( 'hgnc_symbol' , '' ) ) arg_12 . append ( arg_13 . get ( 'functional_annotation' ) ) for arg_14 in arg_13 . get ( 'transcripts' ) : if arg_14 . get ( 'is_canonical' ) and arg_14 . get ( 'protein_sequence_name' ) : arg_11 . append ( urllib . parse . unquote ( arg_14 . get ( 'protein_sequence_name' ) ) ) arg_6 . append ( ',' . join ( arg_11 ) ) arg_6 . append ( ',' . join ( arg_12 ) ) arg_6 . append ( ',' . join ( arg_10 ) ) arg_6 . append ( arg_3 . get ( 'rank_score' ) ) arg_6 . append ( arg_3 . get ( 'cadd_score' ) ) arg_6 . append ( arg_5 . get ( 'genotype_call' ) ) arg_6 . append ( arg_5 [ 'allele_depths' ] [ 0 ] ) arg_6 . append ( arg_5 [ 'allele_depths' ] [ 1 ] ) arg_6 . append ( arg_5 [ 'genotype_quality' ] ) for arg_15 in arg_1 : if arg_3 . get ( arg_15 ) : arg_6 . append ( arg_3 . get ( arg_15 ) ) else : arg_6 . append ( '-' ) arg_2 . append ( arg_6 ) return arg_2


Question: Open stream create output and finally write the stream to output .

def Func ( arg_0 , arg_1 ) : global arg_6 arg_2 = False for arg_3 in range ( args . retry_open ) : try : arg_4 , arg_5 = open_stream ( arg_1 ) arg_2 = True break except StreamError as err : log . error ( "Try {0}/{1}: Could not open stream {2} ({3})" , arg_3 + 1 , args . retry_open , arg_1 , err ) if not arg_2 : console . exit ( "Could not open stream {0}, tried {1} times, exiting" , arg_1 , args . retry_open ) arg_6 = create_output ( arg_0 ) try : arg_6 . open ( ) except ( IOError , OSError ) as err : if isinstance ( arg_6 , PlayerOutput ) : console . exit ( "Failed to start player: {0} ({1})" , args . player , err ) else : console . exit ( "Failed to open output: {0} ({1})" , args . output , err ) with closing ( arg_6 ) : log . debug ( "Writing stream to output" ) read_stream ( arg_4 , arg_6 , arg_5 ) return True

Load roster from an XML file.

        Can be used before the connection is started to load saved
        roster copy, for efficient retrieval of versioned roster.

        :Parameters:
            - `source`: file name or a file object
        :Types:
            - `source`: `str` or file-like object


Question: Returns a list of the dicom files within root_path

def Func ( arg_0 ) : arg_1 = set ( ) try : for arg_2 in get_all_files ( arg_0 ) : if is_dicom_file ( arg_2 ) : arg_1 . add ( arg_2 ) except IOError as ioe : raise IOError ( 'Error reading file {0}.' . format ( arg_2 ) ) from ioe return arg_1

Return True if we should retry, False otherwise.


Question: Find a XML element via xpath .

def Func ( arg_0 ) : def xpath_find ( arg_1 ) : validate ( ET . iselement , arg_1 ) arg_1 = arg_1 . find ( arg_0 ) if arg_1 is None : raise ValueError ( "XPath '{0}' did not return an element" . format ( arg_0 ) ) return validate ( ET . iselement , arg_1 ) return transform ( xpath_find )

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: Sets the review comment . Raises CardinalityError if already set . OrderError if no reviewer defined before .

def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_1 . reviews ) != 0 : if not arg_0 . review_comment_set : arg_0 . review_comment_set = True arg_1 . reviews [ - 1 ] . comment = arg_2 return True else : raise CardinalityError ( 'ReviewComment' ) else : raise OrderError ( 'ReviewComment' )

Return list of GATT characteristics that have been discovered for this
        service.


Question: Validate the display data .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if not isinstance ( arg_1 , basestring ) : raise TypeError ( 'source must be a str, got: %r' % arg_1 ) if not isinstance ( arg_2 , dict ) : raise TypeError ( 'data must be a dict, got: %r' % arg_2 ) if arg_3 is not None : if not isinstance ( arg_3 , dict ) : raise TypeError ( 'metadata must be a dict, got: %r' % arg_2 )

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


Question: Sets the file SPDX Identifier . Raises OrderError if no package or no file defined . Raises SPDXValueError if malformed value . Raises CardinalityError if more than one spdx_id set .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if not arg_0 . file_spdx_id_set : arg_0 . file_spdx_id_set = True if validations . validate_file_spdx_id ( arg_2 ) : arg_0 . file ( arg_1 ) . spdx_id = arg_2 return True else : raise SPDXValueError ( 'File::SPDXID' ) else : raise CardinalityError ( 'File::SPDXID' ) else : raise OrderError ( 'File::SPDXID' )

Attach an observer.

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

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


Question: Draws the submenu and its background . Note that this leaves the OpenGL state set to 2d drawing .

def Func ( arg_0 ) : arg_0 . window . set2d ( ) if isinstance ( arg_0 . bg , Layer ) : arg_0 . bg . _Func ( ) elif hasattr ( arg_0 . bg , "Func" ) and callable ( arg_0 . bg . Func ) : arg_0 . bg . Func ( ) elif isinstance ( arg_0 . bg , list ) or isinstance ( arg_0 . bg , tuple ) : arg_0 . bg_vlist . Func ( GL_QUADS ) elif callable ( arg_0 . bg ) : arg_0 . bg ( ) elif isinstance ( arg_0 . bg , Background ) : if not arg_0 . bg . initialized : arg_0 . bg . init_bg ( ) arg_0 . bg . reFunc_bg ( ) arg_0 . bg . initialized = True elif arg_0 . bg == "blank" : pass else : raise TypeError ( "Unknown background type" ) arg_0 . window . set2d ( ) for arg_3 in arg_0 . widgets . values ( ) : if arg_3 . do_reFunc : arg_3 . on_reFunc ( ) arg_3 . do_reFunc = False arg_0 . batch2d . Func ( ) for arg_3 in arg_0 . widgets . values ( ) : arg_3 . Func ( )

This will output the nginx HTTP config string for specific port spec


Question: z value as like a seed

def Func ( arg_0 , arg_1 = 0.0 , arg_2 = 0.05 , arg_3 = 1 , arg_4 = 0.25 , arg_5 = 2.0 ) : import noise arg_6 = np . empty ( arg_0 , dtype = 'float32' ) for arg_7 in range ( arg_0 [ 0 ] ) : for arg_8 in range ( arg_0 [ 1 ] ) : arg_9 = noise . snoise3 ( arg_8 * arg_2 , arg_7 * arg_2 , arg_1 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 ) arg_6 [ arg_8 , arg_7 ] = arg_9 arg_6 = arg_6 * 0.5 + 0.5 if __debug__ : assert arg_6 . min ( ) >= 0. and arg_6 . max ( ) <= 1.0 return arg_6

Apply all filters to issues and pull requests.

        :param dict older_tag: All issues before this tag's date will be
                               excluded. May be special value, if new tag is
                               the first tag. (Means **older_tag** is when
                               the repo  was created.)
        :param dict newer_tag: All issues after this tag's date  will be
                               excluded. May be title of unreleased section.
        :rtype: list(dict), list(dict)
        :return: Filtered issues and pull requests.


Question: Sets byte if parity even .

def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . PF , 1 , 0 ) )

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted


Question: getPrimaryKeys - Returns all primary keys matching current filterset .

def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . _get_connection ( ) arg_3 = len ( arg_0 . filters ) arg_4 = len ( arg_0 . notFilters ) if arg_3 + arg_4 == 0 : arg_2 = arg_0 . _get_connection ( ) arg_5 = arg_2 . smembers ( arg_0 . _get_ids_key ( ) ) elif arg_4 == 0 : if arg_3 == 1 : ( arg_6 , arg_7 ) = arg_0 . filters [ 0 ] arg_5 = arg_2 . smembers ( arg_0 . _get_key_for_index ( arg_6 , arg_7 ) ) else : arg_8 = [ arg_0 . _get_key_for_index ( arg_6 , arg_7 ) for arg_6 , arg_7 in arg_0 . filters ] arg_5 = arg_2 . sinter ( arg_8 ) else : arg_9 = [ arg_0 . _get_key_for_index ( arg_6 , arg_7 ) for arg_6 , arg_7 in arg_0 . notFilters ] if arg_3 == 0 : arg_5 = arg_2 . sdiff ( arg_0 . _get_ids_key ( ) , * arg_9 ) else : arg_8 = [ arg_0 . _get_key_for_index ( arg_6 , arg_7 ) for arg_6 , arg_7 in arg_0 . filters ] arg_10 = arg_0 . _getTempKey ( ) arg_11 = arg_2 . pipeline ( ) arg_11 . sinterstore ( arg_10 , * arg_8 ) arg_11 . sdiff ( arg_10 , * arg_9 ) arg_11 . delete ( arg_10 ) arg_5 = arg_11 . execute ( ) [ 1 ] arg_5 = [ int ( _key ) for _key in arg_5 ] if arg_1 is False : return list ( arg_5 ) else : arg_5 = list ( arg_5 ) arg_5 . sort ( ) return arg_5

Receive TCP response, looping to get whole thing or timeout.


Question: Touch a file .

def Func ( arg_0 , arg_1 = 0o666 , arg_2 = None , ** arg_3 ) : arg_4 = os . O_CREAT | os . O_APPEND with os . fdopen ( os . open ( arg_0 , arg_4 = arg_4 , arg_1 = arg_1 , arg_2 = arg_2 ) ) as f : os . utime ( f . fileno ( ) if os . utime in os . supports_fd else arg_0 , arg_2 = None if os . supports_fd else arg_2 , ** arg_3 , )

ASCII adjust after addition.

        Adjusts the sum of two unpacked BCD values to create an unpacked BCD
        result. The AL register is the implied source and destination operand
        for this instruction. The AAA instruction is only useful when it follows
        an ADD instruction that adds (binary addition) two unpacked BCD values
        and stores a byte result in the AL register. The AAA instruction then
        adjusts the contents of the AL register to contain the correct 1-digit
        unpacked BCD result.
        If the addition produces a decimal carry, the AH register is incremented
        by 1, and the CF and AF flags are set. If there was no decimal carry,
        the CF and AF flags are cleared and the AH register is unchanged. In either
        case, bits 4 through 7 of the AL register are cleared to 0.

        This instruction executes as described in compatibility mode and legacy mode.
        It is not valid in 64-bit mode.
        ::
                IF ((AL AND 0FH) > 9) Operators.OR(AF  =  1)
                THEN
                    AL  =  (AL + 6);
                    AH  =  AH + 1;
                    AF  =  1;
                    CF  =  1;
                ELSE
                    AF  =  0;
                    CF  =  0;
                FI;
                AL  =  AL AND 0FH;
        :param cpu: current CPU.


Question: Remove any existing task instances for the perf test DAGs .

def Func ( ) : arg_0 = settings . Session ( ) arg_1 = TaskInstance arg_2 = ( arg_0 . query ( arg_1 ) . filter ( arg_1 . dag_id . in_ ( DAG_IDS ) ) . all ( ) ) for arg_3 in arg_2 : logging . info ( 'Deleting TaskInstance :: {}' . format ( arg_3 ) ) arg_0 . delete ( arg_3 ) arg_0 . commit ( )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Set attributes to dictionary values .

def Func ( arg_0 , arg_1 = { } ) : if isinstance ( arg_1 , dict ) : for arg_2 in arg_1 . keys ( ) : if not hasattr ( arg_0 , arg_2 ) or not callable ( getattr ( arg_0 , arg_2 ) ) : setattr ( arg_0 , arg_2 , arg_1 [ arg_2 ] )


Question: Return an image resized .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = None , arg_5 = None , arg_6 = 'RGB' , arg_7 = None ) : if arg_1 <= 0 : raise ValueError ( 'x must be greater than zero' ) if arg_2 <= 0 : raise ValueError ( 'y must be greater than zero' ) from PIL import Image arg_7 = Image . ANTIALIAS if arg_7 is None else arg_7 if not isinstance ( arg_7 , numbers . Number ) : try : arg_7 = getattr ( Image , arg_7 . upper ( ) ) except : raise ValueError ( "(1) Didn't understand resample=%s" % arg_7 ) if not isinstance ( arg_7 , numbers . Number ) : raise ValueError ( "(2) Didn't understand resample=%s" % arg_7 ) arg_8 = arg_1 , arg_2 if arg_3 : return arg_0 . Func ( arg_8 , arg_7 = arg_7 ) arg_9 = Image . new ( arg_6 , arg_8 ) arg_10 = [ d1 / d2 for d1 , d2 in zip ( arg_8 , arg_0 . size ) ] if arg_10 [ 0 ] < arg_10 [ 1 ] : arg_11 = ( arg_8 [ 0 ] , int ( arg_0 . size [ 1 ] * arg_10 [ 0 ] ) ) else : arg_11 = ( int ( arg_0 . size [ 0 ] * arg_10 [ 1 ] ) , arg_8 [ 1 ] ) arg_0 = arg_0 . Func ( arg_11 , arg_7 = arg_7 ) if arg_5 is None : arg_12 = int ( ( arg_1 - arg_11 [ 0 ] ) / 2 ) elif arg_5 : arg_12 = 0 else : arg_12 = arg_1 - arg_11 [ 0 ] if arg_4 is None : arg_13 = int ( ( arg_2 - arg_11 [ 1 ] ) / 2 ) elif arg_4 : arg_13 = 0 else : arg_13 = arg_2 - arg_11 [ 1 ] arg_9 . paste ( arg_0 , box = ( arg_12 , arg_13 ) ) return arg_9

Read attribute from sysfs and return as string


Question: Harmonic salience function .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = True , arg_6 = arg_7 . nan , arg_9 = 'linear' , arg_10 = 0 ) : if arg_4 is None : arg_4 = arg_7 . average if arg_3 is None : arg_3 = arg_7 . ones ( ( len ( arg_2 ) , ) ) else : arg_3 = arg_7 . array ( arg_3 , dtype = float ) arg_11 = interp_harmonics ( arg_0 , arg_1 , arg_2 , arg_9 = arg_9 , arg_10 = arg_10 ) if arg_4 is arg_7 . average : arg_12 = arg_4 ( arg_11 , arg_10 = 0 , arg_3 = arg_3 ) else : arg_12 = arg_4 ( arg_11 , arg_10 = 0 ) if arg_5 : arg_13 = scipy . signal . argrelmax ( arg_0 , arg_10 = 0 ) arg_14 = arg_7 . empty ( arg_0 . shape ) arg_14 . fill ( arg_6 ) arg_14 [ arg_13 [ 0 ] , arg_13 [ 1 ] ] = arg_12 [ arg_13 [ 0 ] , arg_13 [ 1 ] ] arg_12 = arg_14 return arg_12

Clears out the current store and gets a cookie. Set the cross site
        request forgery token for each subsequent request.

        :return: A response having cleared the current store.
        :rtype: requests.Response


Question: List the filepath of the archives stored in dirpath

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 , arg_4 in os . walk ( arg_0 . dirpath ) : for arg_5 in arg_4 : arg_6 = os . path . join ( arg_2 , arg_5 ) arg_1 . append ( arg_6 ) return arg_1

Creates a random graph where the edges have different types.

    This method calls :func:`.minimal_random_graph`, and then adds
    a loop to each vertex with ``prob_loop`` probability. It then
    calls :func:`.set_types_random` on the resulting graph.

    Parameters
    ----------
    num_vertices : int (optional, default: 250)
        The number of vertices in the graph.
    prob_loop : float (optional, default: 0.5)
        The probability that a loop gets added to a vertex.
    **kwargs :
        Any parameters to send to :func:`.minimal_random_graph` or
        :func:`.set_types_random`.

    Returns
    -------
    :class:`.QueueNetworkDiGraph`
        A graph with the position of the vertex set as a property.
        The position property is called ``pos``. Also, the ``edge_type``
        edge property is set for each edge.

    Examples
    --------
    The following generates a directed graph with 50 vertices where half
    the edges are type 1 and 1/4th are type 2 and 1/4th are type 3:

    >>> import queueing_tool as qt
    >>> pTypes = {1: 0.5, 2: 0.25, 3: 0.25}
    >>> g = qt.generate_random_graph(100, proportions=pTypes, seed=17)
    >>> non_loops = [e for e in g.edges() if e[0] != e[1]]
    >>> p1 = np.sum([g.ep(e, 'edge_type') == 1 for e in non_loops])
    >>> float(p1) / len(non_loops) # doctest: +ELLIPSIS
    0.486...
    >>> p2 = np.sum([g.ep(e, 'edge_type') == 2 for e in non_loops])
    >>> float(p2) / len(non_loops) # doctest: +ELLIPSIS
    0.249...
    >>> p3 = np.sum([g.ep(e, 'edge_type') == 3 for e in non_loops])
    >>> float(p3) / len(non_loops) # doctest: +ELLIPSIS
    0.264...

    To make an undirected graph with 25 vertices where there are 4
    different edge types with random proportions:

    >>> p = np.random.rand(4)
    >>> p = p / sum(p)
    >>> p = {k + 1: p[k] for k in range(4)}
    >>> g = qt.generate_random_graph(num_vertices=25, is_directed=False, proportions=p)

    Note that none of the edge types in the above example are 0. It is
    recommended use edge type indices starting at 1, since 0 is
    typically used for terminal edges.


Question: REST Add soundtouch audio effects to a Call

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

Loads NIPS 2011 conference papers.

  The NIPS 1987-2015 data set is in the form of a 11,463 x 5,812 matrix of
  per-paper word counts, containing 11,463 words and 5,811 NIPS conference
  papers (Perrone et al., 2016). We subset to papers in 2011 and words appearing
  in at least two documents and having a total word count of at least 10.

  Built from the Observations Python package.

  Args:
    path: str.
      Path to directory which either stores file or otherwise file will
      be downloaded and extracted there. Filename is `NIPS_1987-2015.csv`.

  Returns:
    bag_of_words: np.ndarray of shape [num_documents, num_words]. Each element
      denotes the number of occurrences of a specific word in a specific
      document.
    words: List of strings, denoting the words for `bag_of_words`'s columns.


Question: Report startup info to stdout .

def Func ( arg_0 ) : print ( arg_0 . Func_message . format ( service = arg_0 . service , host = arg_0 . host , port = arg_0 . port , ) ) sys . stdout . flush ( )

Turn a mongodb-style search dict into an SQL query.


Question: Deal with the incoming packets

def Func ( arg_0 , * arg_1 , ** arg_2 ) : while True : try : arg_3 , arg_4 = arg_0 . _queue . popleft ( ) arg_5 = get_ip ( arg_4 , arg_4 . src ) arg_6 = get_ip ( arg_4 , arg_4 . dst ) arg_7 = intern ( '%s:%s' % ( arg_5 , arg_4 . data . sport ) ) arg_8 = intern ( '%s:%s' % ( arg_6 , arg_4 . data . dport ) ) arg_9 = intern ( '%s<->%s' % ( arg_7 , arg_8 ) ) arg_10 = arg_0 . _streams . get ( arg_9 ) if arg_10 is None : arg_10 = Stream ( arg_7 , arg_8 ) arg_0 . _streams [ arg_9 ] = arg_10 setattr ( arg_4 , 'timestamp' , arg_3 ) arg_12 = arg_10 . push ( arg_4 ) if not arg_12 : continue for arg_13 in arg_0 . _handlers : try : arg_13 ( arg_10 ) except Exception as ex : print ( 'handler exception: %s' % ex ) except Exception : time . sleep ( 0.00001 )

Helper function to get sample names from subset.

        Parameters
        ----------
        subset : str
            Subset name. If None, returns all samples.

        Returns
        -------
        List of sample names


Question: Takes data from the store and integrates into the application .

def Func ( arg_0 ) : _serialize_into_store ( arg_0 ) arg_1 = { } with transaction . atomic ( ) : arg_2 = _profile_models [ arg_0 ] arg_3 = [ ] for arg_4 , arg_5 in six . iteritems ( arg_2 ) : arg_6 = _self_referential_fk ( arg_5 ) arg_7 = Q ( arg_4 = arg_5 . morango_model_name ) for arg_8 in arg_5 . morango_model_dependencies : arg_7 |= Q ( arg_4 = arg_8 . morango_model_name ) if arg_6 : arg_9 = Store . objects . filter ( arg_13 = False , arg_0 = arg_0 ) . filter ( arg_7 ) . char_ids_list ( ) arg_10 = Store . objects . filter ( arg_13 = True , arg_0 = arg_0 ) . filter ( Q ( _self_ref_fk__in = arg_9 ) | Q ( _self_ref_fk = '' ) ) . filter ( arg_7 ) while len ( arg_10 ) > 0 : for arg_11 in arg_10 : try : arg_12 = arg_11 . _deserialize_store_model ( arg_1 ) if arg_12 : with mute_signals ( signals . pre_save , signals . post_save ) : arg_12 . save ( update_dirty_bit_to = False ) arg_11 . dirty_bit = False arg_11 . save ( update_fields = [ 'dirty_bit' ] ) except exceptions . ValidationError : arg_3 . append ( arg_11 . id ) arg_9 = Store . objects . filter ( arg_13 = False , arg_0 = arg_0 ) . filter ( arg_7 ) . char_ids_list ( ) arg_10 = Store . objects . filter ( arg_13 = True , arg_0 = arg_0 , _self_ref_fk__in = arg_9 ) . filter ( arg_7 ) else : arg_14 = [ ] arg_15 = arg_5 . _meta . fields for arg_11 in Store . objects . filter ( arg_4 = arg_4 , arg_0 = arg_0 , arg_13 = True ) : try : arg_12 = arg_11 . _deserialize_store_model ( arg_1 ) if arg_12 : for arg_16 in arg_15 : arg_17 = getattr ( arg_12 , arg_16 . attname ) arg_18 = arg_16 . get_db_prep_value ( arg_17 , connection ) arg_14 . append ( arg_18 ) except exceptions . ValidationError : arg_3 . append ( arg_11 . id ) if arg_14 : arg_19 = len ( arg_14 ) // len ( arg_15 ) arg_20 = tuple ( [ '%s' for _ in range ( len ( arg_15 ) ) ] ) arg_21 = [ str ( arg_20 ) for _ in range ( arg_19 ) ] with connection . cursor ( ) as cursor : DBBackend . _bulk_insert_into_app_models ( cursor , arg_5 . _meta . db_table , arg_15 , arg_14 , arg_21 ) Store . objects . exclude ( id__in = arg_3 ) . filter ( arg_0 = arg_0 , arg_13 = True ) . update ( arg_13 = False )

Fail for edges with citations whose references are one of the given PubMed identifiers.

    :param pmids: A PubMed identifier or list of PubMed identifiers to filter against


Question: Return list of 5 - tuples describing how to turn a into b .

def Func ( arg_0 ) : if arg_0 . opcodes is not None : return arg_0 . opcodes arg_1 = arg_7 = 0 arg_0 . opcodes = answer = [ ] for arg_3 , arg_4 , arg_5 in arg_0 . get_matching_blocks ( ) : arg_6 = '' if arg_1 < arg_3 and arg_7 < arg_4 : arg_6 = 'replace' elif arg_1 < arg_3 : arg_6 = 'delete' elif arg_7 < arg_4 : arg_6 = 'insert' if arg_6 : answer . append ( ( arg_6 , arg_1 , arg_3 , arg_7 , arg_4 ) ) arg_1 , arg_7 = arg_3 + arg_5 , arg_4 + arg_5 if arg_5 : answer . append ( ( 'equal' , arg_3 , arg_1 , arg_4 , arg_7 ) ) return answer

Verify a certificate in a context.

        .. versionadded:: 0.15

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.


Question: Adds a subgraph to the graph .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , ( godot . subgraph . Subgraph , godot . cluster . Cluster ) ) : arg_2 = str ( arg_1 ) if arg_1 . startswith ( "cluster" ) : arg_3 = godot . cluster . Cluster ( ID = arg_2 ) else : arg_3 = godot . subgraph . Subgraph ( ID = arg_2 ) else : arg_3 = arg_1 arg_3 . default_node = arg_0 . default_node arg_3 . default_edge = arg_0 . default_edge if isinstance ( arg_3 , godot . subgraph . Subgraph ) : arg_0 . subgraphs . append ( arg_3 ) elif isinstance ( arg_3 , godot . cluster . Cluster ) : arg_0 . clusters . append ( arg_3 ) else : raise return arg_3

Attempt to re-establish a connection using previously acquired tokens.

        If the Skype token is valid but the registration token is invalid, a new endpoint will be registered.

        Raises:
            .SkypeAuthException: if the token file cannot be used to authenticate


Question: Is the directory a wanted test directory?

def Func ( arg_0 , arg_1 ) : arg_2 = op_basename ( arg_1 ) if ispackage ( arg_1 ) : arg_3 = ( not arg_0 . exclude or not filter ( None , [ exc . search ( arg_2 ) for exc in arg_0 . exclude ] ) ) else : arg_3 = ( arg_0 . matches ( arg_2 ) or ( arg_0 . config . srcDirs and arg_2 in arg_0 . config . srcDirs ) ) arg_4 = arg_0 . plugins . Func ( arg_1 ) if arg_4 is not None : log . debug ( "Plugin setting selection of %s to %s" , arg_1 , arg_4 ) arg_3 = arg_4 log . debug ( "Func %s? %s" , arg_1 , arg_3 ) return arg_3

r'''Method to calculate heat capacity of a solid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to calculate heat capacity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Cp : float
            Heat capacity of the solid at T, [J/mol/K]


Question: Returns number of cols in a given Tensor .

def Func ( arg_0 ) : if tf . compat . dimension_value ( arg_0 . shape [ - 1 ] ) is not None : return tf . compat . dimension_value ( arg_0 . shape [ - 1 ] ) return tf . shape ( input = arg_0 ) [ - 1 ]

Show Program Landing page for the Enterprise's Program.

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

        Unauthenticated learners will be redirected to enterprise-linked SSO.

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


Question: Logs an error if there is no newline char at the end of the file .

def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_1 ) < 3 or arg_1 [ - 2 ] : arg_2 ( arg_0 , len ( arg_1 ) - 2 , 'whitespace/ending_newline' , 5 , 'Could not find a newline character at the end of the file.' )


Question: Upload a new file to an existing project .

def Func ( arg_0 ) : arg_1 = _setup_osf ( arg_0 ) if arg_1 . username is None or arg_1 . password is None : sys . exit ( 'To Func a file you need to provide a username and' ' password.' ) arg_2 = arg_1 . project ( arg_0 . project ) arg_3 , arg_4 = split_storage ( arg_0 . destination ) arg_5 = arg_2 . storage ( arg_3 ) if arg_0 . recursive : if not os . path . isdir ( arg_0 . source ) : raise RuntimeError ( "Expected source ({}) to be a directory when " "using recursive mode." . format ( arg_0 . source ) ) arg_6 , arg_7 = os . path . split ( arg_0 . source ) for arg_8 , arg_6 , arg_9 in os . walk ( arg_0 . source ) : arg_10 = os . path . relpath ( arg_8 , arg_0 . source ) for arg_11 in arg_9 : arg_12 = os . path . join ( arg_8 , arg_11 ) with open ( arg_12 , 'rb' ) as fp : arg_13 = os . path . join ( arg_4 , arg_7 , arg_10 , arg_11 ) arg_5 . create_file ( arg_13 , fp , force = arg_0 . force , update = arg_0 . update ) else : with open ( arg_0 . source , 'rb' ) as fp : arg_5 . create_file ( arg_4 , fp , force = arg_0 . force , update = arg_0 . update )

Print out stats about how files are getting processed.

        :param known_file_paths: a list of file paths that may contain Airflow
            DAG definitions
        :type known_file_paths: list[unicode]
        :return: None


Question: Create a new contact .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = choose_address_book_from_list ( "Select address book for new contact" , arg_0 ) if arg_3 is None : print ( "Error: address book list is empty" ) sys . exit ( 1 ) if arg_1 : try : arg_4 = CarddavObject . from_user_input ( arg_3 , arg_1 , config . get_supported_private_objects ( ) , config . get_preferred_vcard_version ( ) , config . localize_dates ( ) ) except ValueError as err : print ( err ) sys . exit ( 1 ) else : arg_4 . write_to_file ( ) if arg_2 : modify_existing_contact ( arg_4 ) else : print ( "Creation successful\n\n%s" % arg_4 . print_vcard ( ) ) else : create_new_contact ( arg_3 )

Gets the base class for the custom database back-end.

    This should be the Django PostgreSQL back-end. However,
    some people are already using a custom back-end from
    another package. We are nice people and expose an option
    that allows them to configure the back-end we base upon.

    As long as the specified base eventually also has
    the PostgreSQL back-end as a base, then everything should
    work as intended.


Question: Visit a Call node .

def Func ( arg_0 , arg_1 ) : try : for arg_2 in arg_1 . func . infer ( ) : if arg_2 is astroid . Uninferable : continue elif arg_2 . root ( ) . name == OPEN_MODULE : if getattr ( arg_1 . func , "name" , None ) in OPEN_FILES : arg_0 . _check_open_mode ( arg_1 ) elif arg_2 . root ( ) . name == UNITTEST_CASE : arg_0 . _check_redundant_assert ( arg_1 , arg_2 ) elif isinstance ( arg_2 , astroid . ClassDef ) : if arg_2 . qname ( ) == THREADING_THREAD : arg_0 . _check_bad_thread_instantiation ( arg_1 ) elif arg_2 . qname ( ) == SUBPROCESS_POPEN : arg_0 . _check_for_preexec_fn_in_popen ( arg_1 ) elif isinstance ( arg_2 , astroid . FunctionDef ) : arg_3 = arg_2 . qname ( ) if arg_3 == COPY_COPY : arg_0 . _check_shallow_copy_environ ( arg_1 ) elif arg_3 in ENV_GETTERS : arg_0 . _check_env_function ( arg_1 , arg_2 ) elif arg_3 == SUBPROCESS_RUN and PY35 : arg_0 . _check_for_check_kw_in_run ( arg_1 ) arg_0 . _check_deprecated_method ( arg_1 , arg_2 ) except astroid . InferenceError : return

Creates an image for running Raspbian in a QEMU virtual machine.

        Based on the guide at:

            https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Emulating-Jessie-image-with-4.1.x-kernel


Question: print information about outdated modules return 0 if there is nothing to be done and nonzero otherwise

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 : arg_3 = colorama . Style . DIM arg_4 = colorama . Style . NORMAL arg_5 = colorama . Style . BRIGHT arg_6 = colorama . Fore . YELLOW arg_7 = colorama . Fore . RED arg_8 = colorama . Fore . GREEN arg_9 = colorama . Style . RESET_ALL else : arg_3 = arg_5 = arg_6 = arg_7 = arg_8 = arg_9 = u'' arg_10 = 0 from yotta . lib import access from yotta . lib import access_common from yotta . lib import sourceparse for arg_11 , arg_12 in arg_0 . items ( ) : if arg_12 . isTestDependency ( ) : continue try : arg_13 = access . latestSuitableVersion ( arg_11 , '*' , registry = 'modules' , quiet = True ) except access_common . Unavailable as e : arg_13 = None if not arg_12 : arg_14 = u' ' + arg_9 + arg_5 + arg_7 + u"missing" + arg_9 else : arg_14 = arg_3 + u'@%s' % ( arg_12 . version ) if not arg_13 : print ( u'%s%s%s%s not available from the registry%s' % ( arg_7 , arg_11 , arg_14 , arg_4 , arg_9 ) ) arg_10 = 2 continue elif not arg_12 or arg_12 . version < arg_13 : arg_15 = '' if arg_12 : arg_16 = [ x for x in arg_1 if x . name == arg_11 and not sourceparse . parseSourceURL ( x . nonShrinkwrappedVersionReq ( ) ) . semanticSpecMatches ( arg_13 ) ] arg_17 = [ x for x in arg_1 if x . name == arg_11 and x . isShrinkwrapped ( ) and not sourceparse . parseSourceURL ( x . versionReq ( ) ) . semanticSpecMatches ( arg_13 ) ] if len ( arg_16 ) : arg_15 = ' (update prevented by specifications: %s)' % ( ', ' . join ( [ '%s from %s' % ( x . version_req , x . specifying_module ) for x in arg_16 ] ) ) if len ( arg_17 ) : arg_15 += ' yotta-shrinkwrap.json prevents update' if arg_12 . version . major ( ) < arg_13 . major ( ) : arg_18 = arg_8 elif arg_12 . version . minor ( ) < arg_13 . minor ( ) : arg_18 = arg_6 else : arg_18 = arg_7 else : arg_18 = arg_7 print ( u'%s%s%s latest: %s%s%s%s' % ( arg_11 , arg_14 , arg_9 , arg_18 , arg_13 . version , arg_15 , arg_9 ) ) if not arg_10 : arg_10 = 1 return arg_10

Presenter to force yaml.dump to use multi-line string style.


Question: Estimate tx gas . Use the max of calculation using safe method and web3 if operation == CALL or use just the safe calculation otherwise

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 , arg_4 : arg_5 , arg_6 : arg_7 , arg_8 : arg_5 ) -> arg_5 : arg_9 = 1000 arg_10 = 35000 arg_11 = ( arg_0 . Func_with_safe ( arg_1 , arg_3 , arg_4 , arg_6 , arg_8 ) + arg_9 + arg_10 ) if SafeOperation ( arg_8 ) == SafeOperation . CALL : try : arg_12 = ( arg_0 . Func_with_web3 ( arg_1 , arg_3 , arg_4 , arg_6 ) + arg_9 + arg_10 ) except ValueError : arg_12 = 0 return max ( arg_11 , arg_12 ) else : return arg_11

Generate a single "A or B or C" regex from a list of shell globs.

    :param globs: Patterns to be processed by :mod:`fnmatch`.
    :type globs: iterable of :class:`~__builtins__.str`

    :param prefix: If ``True``, then :meth:`~re.RegexObject.match` will
        perform prefix matching rather than exact string matching.
    :type prefix: :class:`~__builtins__.bool`

    :rtype: :class:`re.RegexObject`


Question: Asserts that val contains only the given item or items .

def Func ( arg_0 , * arg_1 ) : if len ( arg_1 ) == 0 : raise ValueError ( 'one or more args must be given' ) else : arg_2 = [ ] for arg_3 in arg_0 . val : if arg_3 not in arg_1 : arg_2 . append ( arg_3 ) if arg_2 : arg_0 . _err ( 'Expected <%s> to contain only %s, but did contain %s.' % ( arg_0 . val , arg_0 . _fmt_items ( arg_1 ) , arg_0 . _fmt_items ( arg_2 ) ) ) arg_4 = [ ] for arg_3 in arg_1 : if arg_3 not in arg_0 . val : arg_4 . append ( arg_3 ) if arg_4 : arg_0 . _err ( 'Expected <%s> to contain only %s, but did not contain %s.' % ( arg_0 . val , arg_0 . _fmt_items ( arg_1 ) , arg_0 . _fmt_items ( arg_4 ) ) ) return arg_0


Question: Guesses an appropriate MODS XML genre type .

def Func ( arg_0 ) : arg_1 = { 'conference' : 'conference publication' , 'book chapter' : 'bibliography' , 'unpublished' : 'article' } arg_2 = str ( arg_0 . type ) . lower ( ) return arg_1 . get ( arg_2 , arg_2 )

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


Question: Returns Hugo Larochelle s binary static MNIST tf . data . Dataset .

def Func ( arg_0 , arg_1 ) : arg_2 = download ( arg_0 , FILE_TEMPLATE . format ( split = arg_1 ) ) arg_3 = tf . data . TextLineDataset ( arg_2 ) arg_4 = lambda string : np . array ( [ c == b"1" for c in string . split ( ) ] ) def _parser ( arg_5 ) : arg_6 = tf . compat . v1 . py_func ( arg_4 , [ arg_5 ] , tf . bool ) arg_7 = tf . reshape ( arg_6 , [ 28 , 28 , 1 ] ) return tf . cast ( arg_7 , dtype = tf . float32 ) , tf . constant ( 0 , tf . int32 ) return arg_3 . map ( _parser )

Call the timeout handlers due.

        :Return: (next_event_timeout, sources_handled) tuple.
            next_event_timeout is number of seconds until the next timeout
            event, sources_handled is number of handlers called.


Question: Delete a subnet .

def Func ( arg_0 , arg_1 ) : LOG . info ( "Func %s for tenant %s" % ( arg_1 , arg_0 . tenant_id ) ) with arg_0 . session . begin ( ) : arg_2 = db_api . subnet_find ( arg_0 , arg_1 = arg_1 , scope = db_api . ONE ) if not arg_2 : raise n_exc . SubnetNotFound ( subnet_id = arg_1 ) if not arg_0 . is_admin : if STRATEGY . is_provider_network ( arg_2 . network_id ) : if arg_2 . tenant_id == arg_0 . tenant_id : raise n_exc . NotAuthorized ( subnet_id = arg_1 ) else : raise n_exc . SubnetNotFound ( subnet_id = arg_1 ) _Func ( arg_0 , arg_2 )

Remove all binary files in the adslib directory.


Question: get scheduler location

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = False arg_4 = { "result" : None } if arg_2 : arg_3 = True else : def arg_2 ( arg_5 ) : arg_4 [ "result" ] = arg_5 arg_0 . _Func_with_watch ( arg_1 , arg_2 , arg_3 ) return arg_4 [ "result" ]

issue a command to read the archive records after a known time stamp.


Question: Returns the HTML produced from enclosing each item in contents in a tag of type tagname

def Func ( arg_0 , arg_1 ) : return u'' . join ( tag ( arg_0 , arg_2 ) for arg_2 in arg_1 )

Set the focus to position or raise IndexError.


Question: Get repository data

def Func ( arg_0 ) : arg_1 = urijoin ( arg_0 . base_url , 'repos' , arg_0 . owner , arg_0 . repository ) arg_2 = arg_0 . fetch ( arg_1 ) Func = arg_2 . text return Func

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: Strip all color codes from a string . Returns empty string for falsey inputs .

def Func ( arg_0 : arg_1 ) -> str : return codepat . sub ( '' , str ( arg_0 ) if ( arg_0 or ( arg_0 == 0 ) ) else '' )

This will output the nginx HTTP config string for specific port spec


Question: Returns true if the name looks like a URL

def Func ( arg_0 ) : if ':' not in arg_0 : return False arg_1 = arg_0 . split ( ':' , 1 ) [ 0 ] . lower ( ) return arg_1 in [ 'http' , 'https' , 'file' , 'ftp' ] + vcs . all_schemes


Question: Create copy of this context with increased indent

def Func ( arg_0 , arg_1 = 1 ) : arg_2 = copy ( arg_0 ) arg_2 . indent += arg_1 return arg_2

Import a HDF5 file into a numpy array.

    Arguments:
        hdf5_filename:  A string filename of a HDF5 datafile

    Returns:
        A numpy array with data from the HDF5 file


Question: Main method to run the automatic pipeline creation

def Func ( arg_0 , arg_1 ) : arg_0 . forks = arg_0 . define_pipeline_string ( arg_0 . process_descriptions , arg_1 , True , True , arg_0 . count_forks , arg_1 , arg_0 . forks ) arg_0 . pipeline_string = arg_0 . build_pipeline_string ( arg_0 . forks ) return arg_0 . pipeline_string

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


Question: write a package diagram

def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in enumerate ( sorted ( arg_1 . modules ( ) , key = lambda x : x . title ) ) : arg_0 . printer . emit_node ( arg_2 , label = arg_0 . get_title ( arg_3 ) , shape = "box" ) arg_3 . fig_id = arg_2 for arg_5 in arg_1 . get_relationships ( "depends" ) : arg_0 . printer . emit_edge ( arg_5 . from_object . fig_id , arg_5 . to_object . fig_id , ** arg_0 . pkg_edges )

Fetch the events pages of a given group.


Question: REBINDING state .

def Func ( arg_0 ) : logger . debug ( 'In state: Func' ) arg_0 . current_state = STATE_Func if arg_0 . script is not None : arg_0 . script . script_init ( arg_0 . client . lease , arg_0 . current_state ) arg_0 . script . script_go ( ) else : set_net ( arg_0 . client . lease )

Deletes the video

        Authentication is required

        Params:
            entry: video entry fetch via 'fetch_video()'

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Sets the connection string for all edges .

def Func ( arg_0 , arg_1 ) : if arg_1 : arg_2 = "->" else : arg_2 = "--" for arg_3 in [ e for g in arg_0 . all_graphs for e in g . edges ] : arg_3 . conn = arg_2

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: Sets file copyright text .

def Func ( arg_0 , arg_1 , arg_2 ) : try : for arg_3 , arg_3 , arg_4 in arg_0 . graph . triples ( ( arg_1 , arg_2 , None ) ) : arg_0 . builder . set_file_copyright ( arg_0 . doc , six . text_type ( arg_4 ) ) except CardinalityError : arg_0 . more_than_one_error ( 'file copyright text' )

Init openstack neutron mq

        1. Check if enable listening neutron notification
        2. Create consumer

        :param mq: class ternya.mq.MQ


Question: Return True if the propositional logic expression is true in the model and False if it is false . If the model does not specify the value for every proposition this may return None to indicate not obvious ; this may happen even when the expression is tautological .

def Func ( arg_0 , arg_1 = { } ) : arg_2 , arg_3 = arg_0 . op , arg_0 . args if arg_0 == TRUE : return True elif arg_0 == FALSE : return False elif is_prop_symbol ( arg_2 ) : return arg_1 . get ( arg_0 ) elif arg_2 == '~' : arg_4 = Func ( arg_3 [ 0 ] , arg_1 ) if arg_4 is None : return None else : return not arg_4 elif arg_2 == '|' : arg_5 = False for arg_6 in arg_3 : arg_4 = Func ( arg_6 , arg_1 ) if arg_4 is True : return True if arg_4 is None : arg_5 = None return arg_5 elif arg_2 == '&' : arg_5 = True for arg_6 in arg_3 : arg_4 = Func ( arg_6 , arg_1 ) if arg_4 is False : return False if arg_4 is None : arg_5 = None return arg_5 arg_4 , arg_7 = arg_3 if arg_2 == '>>' : return Func ( ~ arg_4 | arg_7 , arg_1 ) elif arg_2 == '<<' : return Func ( arg_4 | ~ arg_7 , arg_1 ) arg_8 = Func ( arg_4 , arg_1 ) if arg_8 is None : return None arg_9 = Func ( arg_7 , arg_1 ) if arg_9 is None : return None if arg_2 == '<=>' : return arg_8 == arg_9 elif arg_2 == '^' : return arg_8 != arg_9 else : raise ValueError , "illegal operator in logic expression" + str ( arg_0 )

Writes the passed chunk and flushes it to the client.


Question: Handle the file path changing .

def Func ( arg_0 , arg_1 ) : arg_0 . name = basename ( arg_1 ) arg_0 . graph = arg_0 . editor_input . load ( )

Takes perf attribution data over a period of time and computes annualized
    multifactor alpha, multifactor sharpe, risk exposures.


Question: Update self . _type_to_spans according to the added length .

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 ) -> None : arg_4 , arg_5 = arg_0 . _span for arg_6 in arg_0 . _type_to_spans . values ( ) : for arg_7 in arg_6 : if arg_1 < arg_7 [ 1 ] or arg_7 [ 1 ] == arg_1 == arg_5 : arg_7 [ 1 ] += arg_3 if arg_1 < arg_7 [ 0 ] or arg_7 [ 0 ] == arg_1 != arg_4 : arg_7 [ 0 ] += arg_3

Download a Google Drive file from  and place it in root.

    Args:
        file_id (str): id of file to be downloaded
        root (str): Directory to place downloaded file in
        filename (str, optional): Name to save the file under. If None, use the id of the file.
        md5 (str, optional): MD5 checksum of the download. If None, do not check


Question: Go through the env var map transferring the values to this object as attributes .

def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . evar_defs . items ( ) : if arg_2 . is_required and arg_2 . name not in os . environ : raise RuntimeError ( ( "Missing required environment variable: {evar_name}\n" "{help_txt}" ) . format ( evar_name = arg_2 . name , help_txt = arg_2 . help_txt ) ) if arg_2 . name in os . environ : arg_0 [ arg_1 ] = os . environ . get ( arg_2 . name ) else : arg_0 [ arg_1 ] = arg_2 . default_val for arg_3 in arg_2 . filters : arg_4 = arg_0 . get ( arg_1 ) arg_5 = arg_3 ( arg_4 , arg_2 ) arg_0 [ arg_1 ] = arg_5 arg_0 . _filter_all ( )

Call the segmenter in order to split text in sentences.

        Args:
            text (str): Text to be segmented.

        Returns:
            dict, int: A dict containing a list of dicts with the offsets of
                each sentence; an integer representing the response code.


Question: Apply a named transformation to a set of foci .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 in arg_0 . transformations : return transform ( arg_2 , arg_0 . transformations [ arg_1 ] ) else : logger . info ( "No transformation named '%s' found; coordinates left " "untransformed." % arg_1 ) return arg_2


Question: Stores the trajectory to disk and recursively all data in the tree .

def Func ( arg_0 , arg_1 = False , arg_2 = arg_3 . STORE_DATA , arg_5 = None ) : if arg_0 . _is_run : if arg_0 . _new_nodes or arg_0 . _new_links : arg_0 . _storage_service . store ( arg_3 . SINGLE_RUN , arg_0 , trajectory_name = arg_0 . v_name , recursive = not arg_1 , arg_2 = arg_2 , arg_5 = arg_5 ) else : arg_0 . _storage_service . store ( arg_3 . TRAJECTORY , arg_0 , trajectory_name = arg_0 . v_name , arg_1 = arg_1 , arg_2 = arg_2 , arg_5 = arg_5 ) arg_0 . _stored = True

Clean enterprise channel worker user form field

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


Question: Import external dict to internal dict

def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : arg_0 . set_parm ( arg_2 , arg_3 )

Run stochastic volatility model.

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

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

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

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


Question: Sets the response that the adapter will return for the specified command .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 not in arg_0 . responses : arg_0 . responses [ arg_1 ] = deque ( ) arg_0 . responses [ arg_1 ] . append ( arg_2 ) return arg_0

Return an open file-object to the index file


Question: This operation gets rollup data for Service Bus metrics notification hub . Rollup data includes the time granularity for the telemetry aggregation as well as the retention settings for each time granularity .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _perform_get ( arg_0 . _get_get_metrics_rollup_hub_path ( arg_1 , arg_2 , arg_3 ) , None ) return _MinidomXmlToObject . convert_response_to_feeds ( arg_4 , partial ( _ServiceBusManagementXmlSerializer . xml_to_metrics , object_type = MetricRollups ) )

Releases renderer resources associated with this image.


Question: Upload an image that can be later attached to a chat message .

async def Func ( arg_0 , arg_1 , arg_2 = None , * , arg_3 = False ) : arg_4 = arg_2 or os . path . basename ( arg_1 . name ) arg_5 = arg_1 . read ( ) arg_6 = await arg_0 . _base_request ( IMAGE_UPLOAD_URL , 'application/x-www-form-urlencoded;charset=UTF-8' , 'json' , json . dumps ( { "protocolVersion" : "0.8" , "createSessionRequest" : { "fields" : [ { "external" : { "name" : "file" , "filename" : arg_4 , "put" : { } , "size" : len ( arg_5 ) } } ] } } ) ) try : arg_7 = arg_0 . _get_upload_session_status ( arg_6 ) [ 'externalFieldTransfers' ] [ 0 ] [ 'putInfo' ] [ 'url' ] except KeyError : raise exceptions . NetworkError ( 'image upload failed: can not acquire an upload url' ) arg_6 = await arg_0 . _base_request ( arg_7 , 'application/octet-stream' , 'json' , arg_5 ) try : arg_8 = ( arg_0 . _get_upload_session_status ( arg_6 ) [ 'additionalInfo' ] [ 'uploader_service.GoogleRupioAdditionalInfo' ] [ 'completionInfo' ] [ 'customerSpecificInfo' ] ) arg_9 = arg_8 [ 'photoid' ] arg_10 = arg_8 [ 'url' ] except KeyError : raise exceptions . NetworkError ( 'image upload failed: can not fetch upload info' ) arg_11 = UploadedImage ( arg_9 = arg_9 , arg_10 = arg_10 ) return arg_11 if arg_3 else arg_11 . image_id

Write outputs to output tap file.

    :param outputs: (iter) some outputs.


Question: Render the widget as an HTML string .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : if arg_0 . has_template_widget_Funcing : return super ( ClearableFileInputWithImagePreview , arg_0 ) . Func ( arg_1 , arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) else : arg_5 = arg_0 . get_context ( arg_1 , arg_2 , arg_3 ) return Func_to_string ( arg_0 . template_name , 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: Populate Filterbank instance with data from HDF5 file

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = True ) : print ( "Warning: this function will be deprecated in the future. Please use Waterfall to open HDF5 files." ) arg_0 . header = { } arg_0 . filename = arg_1 arg_0 . h5 = h5py . File ( arg_1 ) for arg_9 , arg_10 in arg_0 . h5 [ b'data' ] . attrs . items ( ) : if six . PY3 : arg_9 = bytes ( arg_9 , 'ascii' ) if arg_9 == b'src_raj' : arg_0 . header [ arg_9 ] = Angle ( arg_10 , unit = 'hr' ) elif arg_9 == b'src_dej' : arg_0 . header [ arg_9 ] = Angle ( arg_10 , unit = 'deg' ) else : arg_0 . header [ arg_9 ] = arg_10 arg_0 . n_ints_in_file = arg_0 . h5 [ b"data" ] . shape [ 0 ] arg_12 , arg_13 , arg_14 , arg_15 = arg_0 . _setup_freqs ( arg_2 = arg_2 , arg_3 = arg_3 ) arg_16 , arg_17 , arg_18 = arg_0 . _setup_time_axis ( arg_4 = arg_4 , arg_5 = arg_5 ) if arg_6 : arg_0 . data = arg_0 . h5 [ b"data" ] [ arg_16 : arg_17 , : , arg_14 : arg_15 ] arg_0 . file_size_bytes = os . path . getsize ( arg_0 . filename ) else : print ( "Skipping data load..." ) arg_0 . data = np . array ( [ 0 ] ) arg_0 . n_ints_in_file = 0 arg_0 . file_size_bytes = os . path . getsize ( arg_0 . filename )

Attempts to fetch streams repeatedly
       until some are returned or limit hit.


Question: Job version of move_files for one file

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . fileStore . getLocalTempDir ( ) arg_5 = arg_0 . fileStore . readGlobalFile ( arg_2 , os . path . join ( arg_4 , arg_1 ) ) copy_files ( [ arg_5 ] , arg_3 )

Return new rrule with same attributes except for those attributes given new
           values by whichever keyword arguments are specified.


Question: Convert the record to a dictionary using field names as keys .

def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) for arg_3 , arg_4 in enumerate ( arg_0 . _field_names ) : arg_2 [ arg_4 ] = arg_1 [ arg_3 ] if arg_3 < len ( arg_1 ) else None return arg_2

Checks if a data is csr, csc, bsr, or dia Scipy sparse matrix


Question: Calculate scores for all leaves until there are none removes edges until there are and repeats until all nodes have been scored . Also yields the current graph at every step so you can make a cool animation of how the graph changes throughout the course of the algorithm

def Func ( arg_0 ) -> Iterable [ BELGraph ] : yield arg_0 . get_remaining_graph ( ) while not arg_0 . done_chomping ( ) : while not list ( arg_0 . iter_leaves ( ) ) : arg_0 . remove_random_edge ( ) yield arg_0 . get_remaining_graph ( ) arg_0 . score_leaves ( ) yield arg_0 . get_remaining_graph ( )


Question: Configure the set of plugins with the given options and config instance . After configuration disabled plugins are removed from the plugins list .

def Func ( arg_0 , arg_1 , arg_2 ) : log . debug ( "Configuring plugins" ) arg_0 . config = arg_2 arg_3 = PluginProxy ( 'Func' , arg_0 . _plugins ) arg_3 ( arg_1 , arg_2 ) arg_4 = [ plug for plug in arg_0 . _plugins if plug . enabled ] arg_0 . plugins = arg_4 arg_0 . sort ( ) log . debug ( "Plugins enabled: %s" , arg_4 )

Process current member with 'op' operation.


Question: Process an unavailable presence from a MUC room .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_from ( ) arg_3 = arg_2 . bare ( ) . as_unicode ( ) arg_4 = arg_0 . rooms . get ( arg_3 ) if not arg_4 : return False arg_4 . process_unavailable_presence ( MucPresence ( arg_1 ) ) return True

Dump a certificate revocation list to a buffer.

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

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


Question: Displays help for each command

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] if len ( arg_2 ) == 0 : arg_4 = sorted ( arg_0 . _bot . dispatcher . commands . items ( ) , key = itemgetter ( 0 ) ) arg_4 = filter ( lambda x : x [ 1 ] . is_subcmd is False , arg_4 ) if arg_0 . _should_filter_Func_commands ( arg_1 . user ) : arg_4 = filter ( lambda x : x [ 1 ] . admin_only is False , arg_4 ) for arg_5 , arg_6 in arg_4 : arg_3 . append ( arg_0 . _get_short_Func_for_command ( arg_5 ) ) else : arg_5 = '!' + arg_2 [ 0 ] arg_3 = [ arg_0 . _get_Func_for_command ( arg_5 ) ] return '\n' . join ( arg_3 )

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: The Check Name Availability operation checks if a new job collection with the given name may be created or if it is unavailable . The result of the operation is a Boolean true or false .

def Func ( arg_0 , arg_1 , arg_2 ) : _validate_not_none ( 'cloud_service_id' , arg_1 ) _validate_not_none ( 'job_collection_id' , arg_2 ) arg_3 = arg_0 . _get_cloud_services_path ( arg_1 , "scheduler" , "jobCollections" ) arg_3 += "?op=checknameavailability&resourceName=" + arg_2 return arg_0 . _perform_post ( arg_3 , None , AvailabilityResponse )


Question: Write FIR Filter Header Files Mark Wickert February 2015

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


Question: In general you don t need to overwrite this method .

def Func ( arg_0 , arg_1 ) : arg_0 . set_signal ( ) arg_0 . check_exclusive_mode ( ) arg_2 = arg_0 . Handle ( arg_0 ) arg_3 = 0 while arg_3 < arg_1 . threads : arg_4 = threading . Thread ( target = arg_0 . worker , args = [ arg_2 ] ) if arg_1 . once is True or arg_1 . no_daemon is True : arg_4 . daemon = False else : arg_4 . daemon = True arg_4 . start ( ) arg_3 += 1 if arg_1 . once is False : while True : if threading . active_count ( ) > 1 : sleep ( 1 ) else : if threading . current_thread ( ) . name == "MainThread" : sys . exit ( 0 ) pass

Returns participation data for the given sis_course_id.

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


Question: This makes an attempt to calculate the number of coarse channels in a given file .

def Func ( arg_0 , arg_1 = None ) : arg_2 = int ( arg_0 . header [ b'nchans' ] ) if arg_1 is not None : arg_3 = abs ( arg_0 . f_stop - arg_0 . f_start ) arg_4 = int ( arg_3 / arg_1 ) return arg_4 elif arg_2 >= 2 ** 20 : if arg_2 % 2 ** 20 == 0 : arg_4 = arg_2 // 2 ** 20 return arg_4 elif arg_0 . header [ b'telescope_id' ] == 6 : arg_5 = 2.9296875 arg_3 = abs ( arg_0 . f_stop - arg_0 . f_start ) arg_4 = int ( arg_3 / arg_5 ) return arg_4 else : logger . warning ( "Couldn't figure out n_coarse_chan" ) elif arg_0 . header [ b'telescope_id' ] == 6 and arg_2 < 2 ** 20 : arg_5 = 2.9296875 arg_3 = abs ( arg_0 . f_stop - arg_0 . f_start ) arg_4 = int ( arg_3 / arg_5 ) return arg_4 else : logger . warning ( "This function currently only works for hires BL Parkes or GBT data." )


Question: Add an item to the cache .

def Func ( arg_0 , arg_1 ) : arg_0 . _lock . acquire ( ) try : arg_2 = arg_1 . update_state ( ) if arg_2 != 'purged' : if len ( arg_0 . _items_list ) >= arg_0 . max_items : arg_0 . purge_items ( ) arg_0 . _items [ arg_1 . address ] = arg_1 arg_0 . _items_list . append ( arg_1 ) arg_0 . _items_list . sort ( ) return arg_1 . state finally : arg_0 . _lock . release ( )

Stop streaming samples from device and delete samples buffer


Question: Print emphasized error the given txt message

def Func ( arg_0 ) : print ( "%s# %s%s%s" % ( PR_ERR_CC , get_time_stamp ( ) , arg_0 , PR_NC ) ) sys . stdout . flush ( )

This method is called before first step of simulation.


Question: Load any stored cookies for the plugin that have not expired .

def Func ( arg_0 ) : if not arg_0 . session or not arg_0 . cache : raise RuntimeError ( "Cannot loaded cached cookies in unbound plugin" ) arg_1 = [ ] for arg_2 , arg_3 in arg_0 . cache . get_all ( ) . items ( ) : if arg_2 . startswith ( "__cookie" ) : arg_4 = requests . cookies . create_cookie ( ** arg_3 ) arg_0 . session . http . cookies . set_cookie ( arg_4 ) arg_1 . append ( arg_4 . name ) if arg_1 : arg_0 . logger . debug ( "Restored cookies: {0}" . format ( ", " . join ( arg_1 ) ) ) return arg_1

Load a skeleton definition from a file.

        Parameters
        ----------
        source : str or file
            A filename or file-like object that contains text information
            describing a skeleton. See :class:`pagoda.parser.Parser` for more
            information about the format of the text file.


Question: Returns the list of defined names for the document .

def Func ( arg_0 ) : global _old_definitions arg_1 = [ ] arg_2 = arg_0 [ 'path' ] arg_3 = jedi . names ( arg_0 [ 'code' ] , arg_2 , 'utf-8' ) for arg_4 in arg_3 : arg_5 = _extract_def ( arg_4 , arg_2 ) if arg_4 . type != 'import' : arg_1 . append ( arg_5 ) arg_1 = [ arg_4 . to_dict ( ) for arg_4 in arg_1 ] return arg_1

Writes the value given to the bit in the address specified.

        :param value: The value to write.
        :type value: int
        :param bit_num: The bit number to write to.
        :type bit_num: int
        :param address: The address to write to.
        :type address: int


Question: Stops the notebook deployment for this project if it exists .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = get_project_or_local ( arg_0 . obj . get ( 'project' ) ) if not arg_2 and not click . confirm ( "Are sure you want to Func notebook " "for project `{}/{}`" . format ( arg_3 , arg_4 ) ) : click . echo ( 'Existing without Funcping notebook.' ) sys . exit ( 1 ) if arg_1 is None : arg_1 = True try : PolyaxonClient ( ) . project . Func_notebook ( arg_3 , arg_4 , arg_1 ) Printer . print_success ( 'Notebook is being deleted' ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func notebook project `{}`.' . format ( arg_4 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 )

Import a HDF5 file into a numpy array.

    Arguments:
        hdf5_filename:  A string filename of a HDF5 datafile

    Returns:
        A numpy array with data from the HDF5 file


Question: r Converts any unicode based IRI to an acceptable ASCII URI . Werkzeug always uses utf - 8 URLs internally because this is what browsers and HTTP do as well . In some places where it accepts an URL it also accepts a unicode IRI and converts it into a URI .

def Func ( arg_0 , arg_1 = 'utf-8' , arg_2 = 'strict' , arg_3 = False ) : if isinstance ( arg_0 , tuple ) : arg_0 = url_unparse ( arg_0 ) if arg_3 : try : arg_4 = to_native ( arg_0 ) arg_5 = to_native ( arg_0 ) . encode ( 'ascii' ) if arg_5 . split ( ) == [ arg_5 ] : return arg_4 except UnicodeError : pass arg_0 = url_parse ( to_unicode ( arg_0 , arg_1 , arg_2 ) ) arg_6 = arg_0 . encode_netloc ( ) arg_7 = url_quote ( arg_0 . path , arg_1 , arg_2 , '/:~+%' ) arg_8 = url_quote ( arg_0 . query , arg_1 , arg_2 , '%&[]:;$*()+,!?*/=' ) arg_9 = url_quote ( arg_0 . fragment , arg_1 , arg_2 , '=%&[]:;$()+,!?*/' ) return to_native ( url_unparse ( ( arg_0 . scheme , arg_6 , arg_7 , arg_8 , arg_9 ) ) )

Execute the enrich phase for a given backend section

    :param config: a Mordred config object
    :param backend_section: the backend section where the enrich phase is executed


Question: Reconstitutes clusters from . utemp and htemp files and writes them to chunked files for aligning in muscle .

def Func ( arg_0 , arg_1 , arg_2 ) : if os . path . exists ( arg_0 . tmpdir ) : shutil . rmtree ( arg_0 . tmpdir ) os . mkdir ( arg_0 . tmpdir ) arg_3 = arg_1 . load_balanced_view ( ) arg_4 = time . time ( ) arg_5 = " building clusters     | {} | s6 |" arg_6 = datetime . timedelta ( seconds = int ( time . time ( ) - arg_4 ) ) progressbar ( 3 , 0 , arg_5 . format ( arg_6 ) , spacer = arg_0 . _spacer ) arg_7 = os . path . join ( arg_0 . dirs . across , arg_0 . name + ".utemp" ) arg_8 = os . path . join ( arg_0 . dirs . across , arg_0 . name + ".utemp.sort" ) arg_9 = "" if not os . path . exists ( arg_8 ) or arg_2 : LOGGER . info ( "building reads file -- loading utemp file into mem" ) arg_9 = arg_3 . apply ( sort_seeds , * ( arg_7 , arg_8 ) ) while 1 : arg_6 = datetime . timedelta ( seconds = int ( time . time ( ) - arg_4 ) ) progressbar ( 3 , 0 , arg_5 . format ( arg_6 ) , spacer = arg_0 . _spacer ) if arg_9 . ready ( ) : break else : time . sleep ( 0.1 ) arg_10 = arg_3 . apply ( count_seeds , arg_8 ) while 1 : arg_6 = datetime . timedelta ( seconds = int ( time . time ( ) - arg_4 ) ) progressbar ( 3 , 1 , arg_5 . format ( arg_6 ) , spacer = arg_0 . _spacer ) if arg_10 . ready ( ) : break else : time . sleep ( 0.1 ) arg_11 = arg_10 . result ( ) arg_12 = arg_3 . apply ( sub_Func , * ( arg_0 , arg_8 , arg_11 ) ) while 1 : arg_6 = datetime . timedelta ( seconds = int ( time . time ( ) - arg_4 ) ) progressbar ( 3 , 2 , arg_5 . format ( arg_6 ) , spacer = arg_0 . _spacer ) if arg_12 . ready ( ) : break else : time . sleep ( 0.1 ) arg_6 = datetime . timedelta ( seconds = int ( time . time ( ) - arg_4 ) ) progressbar ( 3 , 3 , arg_5 . format ( arg_6 ) , spacer = arg_0 . _spacer ) print ( "" ) for arg_13 in [ arg_9 , arg_10 , arg_12 ] : try : if not arg_13 . successful ( ) : raise IPyradWarningExit ( arg_13 . result ( ) ) except AttributeError : pass

Return True if we should retry, False otherwise.


Question: Upload a bundle from an unsigned JSON document

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , dict ) : arg_2 = arg_1 else : arg_2 = json . Func ( arg_1 ) for arg_3 , arg_4 in arg_2 . items ( ) : arg_5 = KeyJar ( ) if isinstance ( arg_4 , dict ) : arg_5 . import_jwks ( arg_4 , issuer = arg_3 ) else : arg_5 . import_jwks_as_json ( arg_4 , issuer = arg_3 ) arg_0 . bundle [ arg_3 ] = arg_5 return arg_0

Returns true if the host is reachable. In some cases, it may not be reachable a tunnel
    must be used.


Question: Compile a list of circuits into a qobj .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = 1024 , arg_7 = 10 , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = None , arg_12 = False ) : warnings . warn ( 'qiskit.Func() is deprecated and will be removed in Qiskit Terra 0.9. ' 'Please use qiskit.Funcr.transpile() to transform circuits ' 'and qiskit.Funcr.assemble() to produce a runnable qobj.' , DeprecationWarning ) arg_13 = transpile ( arg_0 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , seed_transpiler = arg_10 , arg_1 = arg_1 , arg_11 = arg_11 ) arg_14 = assemble ( arg_13 , qobj_header = None , arg_6 = arg_6 , arg_7 = arg_7 , seed_simulator = arg_8 , arg_12 = arg_12 , arg_9 = arg_9 , arg_2 = arg_2 ) return arg_14

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: Groups execution steps by solid in topological order of the solids .

def Func ( arg_0 ) : arg_1 = _coalesce_solid_order ( arg_0 ) arg_2 = defaultdict ( list ) for arg_3 , arg_4 in itertools . groupby ( arg_0 . topological_steps ( ) , lambda x : x . solid_name ) : arg_2 [ arg_3 ] += list ( arg_4 ) return OrderedDict ( [ ( arg_3 , arg_2 [ arg_3 ] ) for arg_3 in arg_1 ] )

Return a list of all enrollments for the passed section_id.

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


Question: Fetch changes from the default remote repository .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None , arg_4 = None ) : if arg_1 is None : raise ValueError ( "Path to the working copy is needed to Func from a remote repository." ) if arg_4 is not None : arg_5 = 'git Func %s' % arg_4 else : arg_5 = 'git Func' with cd ( arg_1 ) : if arg_2 and arg_3 is None : run_as_root ( arg_5 ) elif arg_2 : sudo ( arg_5 , arg_3 = arg_3 ) else : run ( arg_5 )

Set the rotation of this body using a rotation matrix.

        Parameters
        ----------
        rotation : sequence of 9 floats
            The desired rotation matrix for this body.


Question: Send DDL to truncate the specified table

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = super ( PostgresDbWriter , arg_0 ) . Func ( arg_1 ) arg_0 . execute ( arg_2 ) if arg_3 : arg_0 . execute ( arg_3 )

A generator yielding all protobuf object data in the file. It is the
        main parser of the stream encoding.


Question: update a base based on an image name meaning detecting a particular registry and if necessary updating the self . base . When the image name is parsed the base will be given to remove the registry .

def Func ( arg_0 , arg_1 ) : arg_2 = None if "gcr.io" in arg_1 : arg_2 = 'gcr.io' arg_0 . _set_base ( default_base = arg_2 ) arg_0 . _update_secrets ( ) return arg_2

Begin writing output tap files.

    :param tapPath: (string) base name of the output tap files to write.


Question: Retrieves the status of an in progress or completed design run

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = routes . get_data_view_design_status ( arg_1 , arg_2 ) arg_4 = arg_0 . _get ( arg_3 ) . json ( ) arg_5 = arg_4 [ "data" ] return ProcessStatus ( result = arg_5 . get ( "result" ) , progress = arg_5 . get ( "progress" ) , arg_5 = arg_5 . get ( "status" ) , messages = arg_5 . get ( "messages" ) )

Returns protobuf mapcontainer. Read from translation file.


Question: Main method to render screen view

def Func ( arg_0 ) : arg_0 . term_width , arg_0 . term_height = get_terminal_size ( ) arg_0 . log . debug ( "Terminal size: %sx%s" , arg_0 . term_width , arg_0 . term_height ) arg_0 . right_panel_width = int ( ( arg_0 . term_width - len ( arg_0 . RIGHT_PANEL_SEPARATOR ) ) * ( float ( arg_0 . info_panel_percent ) / 100 ) ) - 1 if arg_0 . right_panel_width > 0 : arg_0 . left_panel_width = arg_0 . term_width - arg_0 . right_panel_width - len ( arg_0 . RIGHT_PANEL_SEPARATOR ) - 2 else : arg_0 . right_panel_width = 0 arg_0 . left_panel_width = arg_0 . term_width - 1 arg_0 . log . debug ( "Left/right panels width: %s/%s" , arg_0 . left_panel_width , arg_0 . right_panel_width ) arg_5 = [ ] if arg_0 . right_panel_width : arg_5 = [ ] arg_0 . log . debug ( "There are %d info widgets" % len ( arg_0 . info_widgets ) ) for arg_6 , arg_7 in sorted ( arg_0 . info_widgets . iteritems ( ) , key = lambda item : ( item [ 1 ] . get_index ( ) , item [ 0 ] ) ) : arg_0 . log . debug ( "Rendering info widget #%s: %s" , arg_6 , arg_7 ) arg_8 = arg_7 . render ( arg_0 ) . strip ( ) if arg_8 : arg_5 += arg_8 . split ( "\n" ) arg_5 += [ "" ] arg_9 = arg_0 . __render_left_panel ( ) arg_0 . log . debug ( "Composing final screen output" ) arg_10 = [ ] for arg_11 in range ( 1 , arg_0 . term_height ) : arg_12 = " " if arg_11 > 1 and arg_9 : arg_13 = arg_9 . pop ( 0 ) arg_14 = arg_0 . markup . clean_markup ( arg_13 ) arg_13 += ( ' ' * ( arg_0 . left_panel_width - len ( arg_14 ) ) ) arg_12 += arg_13 else : arg_12 += ' ' * arg_0 . left_panel_width if arg_0 . right_panel_width : arg_12 += arg_0 . markup . RESET arg_12 += arg_0 . markup . WHITE arg_12 += arg_0 . RIGHT_PANEL_SEPARATOR arg_12 += arg_0 . markup . RESET arg_15 = arg_0 . __get_right_line ( arg_5 ) arg_12 += arg_15 arg_10 . append ( arg_12 ) return arg_0 . markup . new_line . join ( arg_10 ) + arg_0 . markup . new_line

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: Recursively iterate lists and tuples

def Func ( arg_0 ) : from collections import Iterable for arg_1 in arg_0 : if isinstance ( arg_1 , Iterable ) and not isinstance ( arg_1 , ( str , bytes ) ) : yield from flatten ( arg_1 ) else : yield arg_1

Output some information on CUDA-enabled devices on your computer,
    including current memory usage. Modified to only get number of devices.

    It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1
    from C to Python with ctypes, so it can run without compiling
    anything. Note that this is a direct translation with no attempt to
    make the code Pythonic. It's meant as a general demonstration on how
    to obtain CUDA device information from Python without resorting to
    nvidia-smi or a compiled Python extension.

    .. note:: Author: Jan Schlüter, https://gist.github.com/63a664160d016a491b2cbea15913d549.git


Question: Transfer the image

def Func ( arg_0 , arg_1 ) : return arg_0 . get_data ( "images/%s/actions/" % arg_0 . id , type = POST , params = { "type" : "Func" , "region" : arg_1 } )

Read attribute from sysfs and return as string


Question: Compute the Hausdorff Distance between two meshes sampling one of the two and finding for each sample the closest point over the other mesh .

def Func ( arg_0 , arg_1 = 1 , arg_2 = 0 , arg_3 = False , arg_4 = True , arg_5 = True , arg_6 = False , arg_7 = True , arg_8 = 1000 , arg_9 = 10 ) : arg_10 = 2 * arg_9 arg_11 = '' . join ( [ '  <filter name="Hausdorff Distance">\n' , '    <Param name="SampledMesh" ' , 'value="{:d}" ' . format ( arg_1 ) , 'description="Sampled Mesh" ' , 'type="RichMesh" ' , '/>\n' , '    <Param name="TargetMesh" ' , 'value="{:d}" ' . format ( arg_2 ) , 'description="Target Mesh" ' , 'type="RichMesh" ' , '/>\n' , '    <Param name="SaveSample" ' , 'value="{}" ' . format ( str ( arg_3 ) . lower ( ) ) , 'description="Save Samples" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="SampleVert" ' , 'value="{}" ' . format ( str ( arg_4 ) . lower ( ) ) , 'description="Sample Vertexes" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="SampleEdge" ' , 'value="{}" ' . format ( str ( arg_5 ) . lower ( ) ) , 'description="Sample Edges" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="SampleFauxEdge" ' , 'value="{}" ' . format ( str ( arg_6 ) . lower ( ) ) , 'description="Sample FauxEdge" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="SampleFace" ' , 'value="{}" ' . format ( str ( arg_7 ) . lower ( ) ) , 'value="%s" ' % str ( arg_7 ) . lower ( ) + 'description="Sample Faces" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="SampleNum" ' , 'value="{:d}" ' . format ( arg_8 ) , 'description="Number of samples" ' , 'type="RichInt" ' , '/>\n' , '    <Param name="MaxDist" ' , 'value="{}" ' . format ( arg_9 ) , 'value="%s" ' % arg_9 + 'description="Max Distance" ' , 'min="0" ' , 'max="{}" ' . format ( arg_10 ) , 'type="RichAbsPerc" ' , '/>\n' , '  </filter>\n' ] ) util . write_filter ( arg_0 , arg_11 ) if isinstance ( arg_0 , FilterScript ) : arg_0 . parse_hausdorff = True if isinstance ( arg_0 , FilterScript ) and arg_3 : arg_0 . add_layer ( 'Hausdorff Closest Points' ) arg_0 . add_layer ( 'Hausdorff Sample Point' ) return None

Returns an authorized http instance.

        Must only be called from within an @oauth_required decorated method, or
        from within an @oauth_aware decorated method where has_credentials()
        returns True.

        Args:
            *args: Positional arguments passed to httplib2.Http constructor.
            **kwargs: Positional arguments passed to httplib2.Http constructor.


Question: Allocate or reallocate a floating IP .

def Func ( arg_0 , arg_1 ) : LOG . info ( 'Func %s for tenant %s and body %s' % ( id , arg_0 . tenant_id , arg_1 ) ) arg_2 = arg_1 . get ( 'floating_network_id' ) if not arg_2 : raise n_exc . BadRequest ( resource = 'floating_ip' , msg = 'floating_network_id is required.' ) arg_3 = arg_1 . get ( 'fixed_ip_address' ) arg_4 = arg_1 . get ( 'floating_ip_address' ) arg_5 = arg_1 . get ( 'port_id' ) arg_6 = None arg_7 = { } arg_8 = _get_network ( arg_0 , arg_2 ) if arg_5 : arg_6 = _get_port ( arg_0 , arg_5 ) arg_9 = _get_fixed_ip ( arg_0 , arg_3 , arg_6 ) arg_7 = { arg_6 . id : { 'port' : arg_6 , 'fixed_ip' : arg_9 } } arg_10 = _allocate_ip ( arg_0 , arg_8 , arg_6 , arg_4 , ip_types . FLOATING ) _create_flip ( arg_0 , arg_10 , arg_7 ) return v . _make_floating_ip_dict ( arg_10 , arg_5 )

Return single program by name, or None if not found.

        Arguments:
            program_title(string): Program title as seen by students and in Course Catalog Admin

        Returns:
            dict: Program data provided by Course Catalog API


Question: Headless window currently don t support double buffering . We only increment the frame counter here .

def Func ( arg_0 ) : arg_0 . frames += 1 if arg_0 . headless_frames and arg_0 . frames >= arg_0 . headless_frames : arg_0 . close ( )

Raise an exception if string doesn't match a part's regex

    :param string: str
    :param part: a key in the PARTS dict
    :raises: ValueError, TypeError


Question: Returns a set of VIFs from get_instances return value .

def Func ( arg_0 ) : LOG . debug ( "Getting interfaces from Xapi" ) with arg_0 . sessioned ( ) as session : arg_1 = arg_0 . get_instances ( session ) arg_2 = session . xenapi . VIF . get_all_records ( ) arg_3 = set ( ) for arg_4 , arg_5 in arg_2 . iteritems ( ) : arg_6 = arg_1 . get ( arg_5 [ "VM" ] ) if not arg_6 : continue arg_7 = arg_6 . uuid arg_3 . add ( VIF ( arg_7 , arg_5 , arg_4 ) ) return arg_3

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: Convert an astropy . Angle to the ridiculous sigproc angle format string .

def Func ( arg_0 ) : arg_1 = str ( arg_0 ) if '.' in arg_1 : if 'h' in arg_1 : arg_2 , arg_3 , arg_4 , arg_5 = int ( arg_1 [ 0 : arg_1 . index ( 'h' ) ] ) , int ( arg_1 [ arg_1 . index ( 'h' ) + 1 : arg_1 . index ( 'm' ) ] ) , int ( arg_1 [ arg_1 . index ( 'm' ) + 1 : arg_1 . index ( '.' ) ] ) , float ( arg_1 [ arg_1 . index ( '.' ) : arg_1 . index ( 's' ) ] ) if 'd' in arg_1 : arg_2 , arg_3 , arg_4 , arg_5 = int ( arg_1 [ 0 : arg_1 . index ( 'd' ) ] ) , int ( arg_1 [ arg_1 . index ( 'd' ) + 1 : arg_1 . index ( 'm' ) ] ) , int ( arg_1 [ arg_1 . index ( 'm' ) + 1 : arg_1 . index ( '.' ) ] ) , float ( arg_1 [ arg_1 . index ( '.' ) : arg_1 . index ( 's' ) ] ) else : if 'h' in arg_1 : arg_2 , arg_3 , arg_4 = int ( arg_1 [ 0 : arg_1 . index ( 'h' ) ] ) , int ( arg_1 [ arg_1 . index ( 'h' ) + 1 : arg_1 . index ( 'm' ) ] ) , int ( arg_1 [ arg_1 . index ( 'm' ) + 1 : arg_1 . index ( 's' ) ] ) if 'd' in arg_1 : arg_2 , arg_3 , arg_4 = int ( arg_1 [ 0 : arg_1 . index ( 'd' ) ] ) , int ( arg_1 [ arg_1 . index ( 'd' ) + 1 : arg_1 . index ( 'm' ) ] ) , int ( arg_1 [ arg_1 . index ( 'm' ) + 1 : arg_1 . index ( 's' ) ] ) arg_5 = 0 arg_6 = str ( arg_2 ) . zfill ( 2 ) + str ( arg_3 ) . zfill ( 2 ) + str ( arg_4 ) . zfill ( 2 ) + '.' + str ( arg_5 ) . split ( "." ) [ - 1 ] return np . float64 ( arg_6 ) . tostring ( )

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


Question: Builds the downstream pipeline of the current process

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) : if arg_2 in arg_1 : if arg_1 [ arg_2 ] [ 2 ] is not None : if len ( arg_1 [ arg_2 ] [ 2 ] . split ( "|" ) ) > 1 : arg_8 = arg_1 [ arg_2 ] [ 2 ] . split ( "|" ) for arg_9 in arg_8 : if arg_9 in arg_6 : arg_5 += 1 arg_4 . append ( arg_1 [ arg_2 ] [ 2 ] ) arg_0 . define_pipeline_string ( arg_1 , arg_9 , False , True , arg_5 , arg_6 , arg_7 ) return arg_4 else : if arg_1 [ arg_2 ] [ 2 ] in arg_6 : arg_4 . append ( arg_1 [ arg_2 ] [ 2 ] . split ( "|" ) [ 0 ] ) arg_0 . Func ( arg_1 , arg_1 [ arg_2 ] [ 2 ] . split ( "|" ) [ 0 ] , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) return arg_4 else : return arg_4

For a 2D array and mask, map the values of all unmasked pixels to a 1D array.

    The pixel coordinate origin is at the top left corner of the 2D array and goes right-wards and downwards, such
    that for an array of shape (3,3) where all pixels are unmasked:

    - pixel [0,0] of the 2D array will correspond to index 0 of the 1D array.
    - pixel [0,1] of the 2D array will correspond to index 1 of the 1D array.
    - pixel [1,0] of the 2D array will correspond to index 4 of the 1D array.

    Parameters
     ----------
    mask : ndarray
        A 2D array of bools, where *False* values mean unmasked and are included in the mapping.
    array_2d : ndarray
        The 2D array of values which are mapped to a 1D array.

    Returns
    --------
    ndarray
        A 1D array of values mapped from the 2D array with dimensions (total_unmasked_pixels).

    Examples
    --------
    mask = np.array([[True, False, True],
                     [False, False, False]
                     [True, False, True]])

    array_2d = np.array([[1.0, 2.0, 3.0],
                          [4.0, 5.0, 6.0],
                          [7.0, 8.0, 9.0]])

    array_1d = map_2d_array_to_masked_1d_array_from_array_2d_and_mask(mask=mask, array_2d=array_2d)


Question: Remove rows with NAs from the H2OFrame .

def Func ( arg_0 ) : arg_1 = H2OFrame . _expr ( expr = ExprNode ( "na.omit" , arg_0 ) , cache = arg_0 . _ex . _cache ) arg_1 . _ex . _cache . nrows = - 1 return arg_1

Run stochastic volatility model.

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

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

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

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


Question: Collect entry points .

def Func ( ) : arg_0 = dict ( ) for arg_1 in iter_entry_points ( group = 'invenio_migrator.things' ) : arg_0 [ arg_1 . name ] = arg_1 . load ( ) return arg_0

issue a command to read the archive records after a known time stamp.


Question: Yields all parents of this element back to the root element .

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . parent while arg_2 is not None : if arg_1 is None or arg_2 . tagname == arg_1 : yield arg_2 arg_2 = arg_2 . parent


Question: Read the contents of a stream as a Lisp expression .

def Func ( arg_0 , arg_1 : arg_2 = None , arg_3 : arg_4 = None , arg_5 : arg_6 = arg_7 , arg_8 : arg_9 = False , ) -> Iterable [ ReaderForm ] : arg_10 = StreamReader ( arg_0 ) arg_11 = ReaderContext ( arg_10 , arg_1 = arg_1 , arg_3 = arg_3 , arg_5 = arg_5 ) while True : arg_12 = _Func_next ( arg_11 ) if arg_12 is arg_11 . eof : if arg_8 : raise EOFError return if arg_12 is COMMENT or isinstance ( arg_12 , Comment ) : continue yield arg_12

Adjust contrast of an Image.

    Args:
        img (PIL Image): PIL Image to be adjusted.
        contrast_factor (float): How much to adjust the contrast. Can be any
            non negative number. 0 gives a solid gray image, 1 gives the
            original image while 2 increases the contrast by a factor of 2.

    Returns:
        PIL Image: Contrast adjusted image.


Question: Main executor of the split_fasta template .

def Func ( arg_0 , arg_1 , arg_2 ) : logger . info ( "Starting script" ) arg_3 = open ( arg_1 , "rU" ) arg_4 = ( x [ 1 ] for x in groupby ( arg_3 , lambda line : line [ 0 ] == ">" ) ) arg_5 = 0 for arg_6 in arg_4 : arg_7 = arg_6 . __next__ ( ) [ 1 : ] . strip ( ) arg_8 = "" . join ( s . strip ( ) for s in arg_4 . __next__ ( ) ) if len ( arg_8 ) >= arg_2 : with open ( arg_0 + '_' + arg_7 . replace ( " " , "_" ) . replace ( "=" , "_" ) + '.fasta' , "w" ) as output_file : output_file . write ( ">" + arg_0 + "_" + arg_7 . replace ( " " , "_" ) . replace ( "=" , "_" ) + "\\n" + arg_8 + "\\n" ) arg_5 += 1 arg_3 . close ( ) logger . info ( "{} sequences sucessfully splitted." . format ( arg_5 ) )

Turn a mongodb-style search dict into an SQL query.


Question: Read the data encoding the Nonce struct and decode it into its constituent parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( Nonce , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . NONCE_ID , arg_6 ) : arg_0 . _nonce_id = primitives . ByteString ( tag = arg_3 . Tags . NONCE_ID ) arg_0 . _nonce_id . Func ( arg_6 , arg_2 = arg_2 ) else : raise ValueError ( "Nonce encoding missing the nonce ID." ) if arg_0 . is_tag_next ( arg_3 . Tags . NONCE_VALUE , arg_6 ) : arg_0 . _nonce_value = primitives . ByteString ( tag = arg_3 . Tags . NONCE_VALUE ) arg_0 . _nonce_value . Func ( arg_6 , arg_2 = arg_2 ) else : raise ValueError ( "Nonce encoding missing the nonce value." ) arg_0 . is_oversized ( arg_6 )

Class decorator that makes sure the passed apps are not present in
    INSTALLED_APPS.