Question: The submit method takes the command string to be executed upon instantiation of a resource most often to start a pilot .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = "parsl.auto" ) : arg_5 = arg_0 . launcher ( arg_1 , arg_3 , 1 ) arg_6 , arg_7 = arg_0 . create_instance ( arg_1 = arg_5 ) arg_0 . provisioned_blocks += 1 arg_0 . resources [ arg_7 ] = { "job_id" : arg_7 , "status" : translate_table [ arg_6 [ 'status' ] ] } return arg_7

Compares and exchanges.

        Compares the value in the AL, AX, EAX or RAX register (depending on the
        size of the operand) with the first operand (destination operand). If
        the two values are equal, the second operand (source operand) is loaded
        into the destination operand. Otherwise, the destination operand is
        loaded into the AL, AX, EAX or RAX register.

        The ZF flag is set if the values in the destination operand and
        register AL, AX, or EAX are equal; otherwise it is cleared. The CF, PF,
        AF, SF, and OF flags are set according to the results of the comparison
        operation::

        (* accumulator  =  AL, AX, EAX or RAX,  depending on whether *)
        (* a byte, word, a doubleword or a 64bit comparison is being performed*)
        IF accumulator  ==  DEST
        THEN
            ZF  =  1
            DEST  =  SRC
        ELSE
            ZF  =  0
            accumulator  =  DEST
        FI;

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


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

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_2_0 ) : if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : raise exceptions . VersionNotSupported ( "KMIP {} does not support the Attributes object." . format ( arg_2 . value ) ) super ( Attributes , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) while True : if len ( arg_6 ) < 3 : break arg_7 = struct . unpack ( '!I' , b'\x00' + arg_6 . peek ( 3 ) ) [ 0 ] if arg_3 . is_enum_value ( arg_3 . Tags , arg_7 ) : arg_7 = arg_3 . Tags ( arg_7 ) if not arg_3 . is_attribute ( arg_7 , arg_2 = arg_2 ) : raise exceptions . AttributeNotSupported ( "Attribute {} is not supported by KMIP {}." . format ( arg_7 . name , arg_2 . value ) ) arg_8 = arg_0 . _factory . create_attribute_value_by_enum ( arg_7 , None ) arg_8 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _attributes . append ( arg_8 ) else : break arg_0 . is_oversized ( arg_6 )

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


Question: Clean up a bunch of loose files .

def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-tmp-umap1.fastq" ) arg_3 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-tmp-umap2.fastq" ) arg_4 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + "-unmapped.bam" ) arg_5 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + ".sam" ) arg_6 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-split1.fastq" ) arg_7 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-split2.fastq" ) arg_8 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-refmap_derep.fastq" ) for arg_9 in [ arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 ] : try : os . remove ( arg_9 ) except : pass

Retrieve the last analog data value received for the specified pin.

        :param pin: Selected pin

        :return: The last value entered into the analog response table.


Question: Produce a function that always returns a supplied value .

def Func ( arg_0 : arg_1 ) -> Callable [ ... , arg_1 ] : def Funced ( * arg_2 , ** arg_3 ) : return arg_0 return Funced

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: Returns Hermite - Gauss quadrature points for even functions

def Func ( arg_0 = 20 ) : arg_1 , arg_2 = np . polynomial . hermite . hermgauss ( arg_0 * 2 ) arg_1 = arg_1 [ arg_0 : ] arg_2 = arg_2 [ arg_0 : ] * np . exp ( arg_1 * arg_1 ) return arg_1 , arg_2

Serve a json representation of internal agentstate as meta data


Question: Read local file chunk

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 == 0 : return StringIO ( ) arg_4 = None with open ( arg_1 , 'rb' ) as f : f . seek ( arg_2 ) arg_4 = f . read ( arg_3 ) if not arg_4 : raise Failure ( 'Unable to read data from source: %s' % arg_1 ) return StringIO ( arg_4 )

Detect crs string format and parse into crs object with appropriate function.

    Arguments:

    - *text*: The crs text representation of unknown type.
    - *strict* (optional): When True, the parser is strict about names having to match
        exactly with upper and lowercases. Default is not strict (False).

    Returns:

    - CRS object.


Question: Genius idea by Alexey Lavrenyuk

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : logger . debug ( "Original JMX: %s" , os . path . realpath ( arg_1 ) ) with open ( arg_1 , 'r' ) as src_jmx : arg_4 = src_jmx . readlines ( ) try : arg_5 = arg_4 . pop ( - 1 ) if "WorkBenchGui" in arg_4 [ - 5 ] : logger . info ( "WorkBench checkbox enabled...bypassing" ) arg_6 = 6 else : arg_6 = 2 while arg_6 > 0 : arg_5 = arg_4 . pop ( - 1 ) + arg_5 arg_6 -= 1 logger . debug ( "Closing statement: %s" , arg_5 ) except Exception as exc : raise RuntimeError ( "Failed to find the end of JMX XML: %s" % exc ) arg_7 = resource_string ( __name__ , 'config/jmeter_var_template.xml' ) arg_8 = [ ] for arg_9 , arg_10 in arg_3 . iteritems ( ) : arg_8 . append ( arg_7 % ( arg_9 , arg_9 , arg_10 ) ) arg_11 = "\n" . join ( arg_8 ) if arg_0 . jmeter_ver >= 2.13 : arg_12 = '<connectTime>true</connectTime>' else : arg_12 = '' if arg_0 . ext_log in [ 'errors' , 'all' ] : arg_13 = { 'errors' : 'true' , 'all' : 'false' } arg_14 = 'jmeter_writer_ext.xml' arg_15 = { 'jtl' : arg_0 . jtl_file , 'udv' : arg_11 , 'ext_log' : arg_0 . ext_log_file , 'ext_level' : arg_13 [ arg_0 . ext_log ] , 'save_connect' : arg_12 } else : arg_14 = 'jmeter_writer.xml' arg_15 = { 'jtl' : arg_0 . jtl_file , 'udv' : arg_11 , 'save_connect' : arg_12 } arg_16 = resource_string ( __name__ , 'config/' + arg_14 ) try : arg_17 = arg_0 . core . mkstemp ( '.jmx' , 'modified_' , os . path . dirname ( os . path . realpath ( arg_1 ) ) ) except OSError as exc : logger . debug ( "Can't create modified jmx near original: %s" , exc ) arg_17 = arg_0 . core . mkstemp ( '.jmx' , 'modified_' ) logger . debug ( "Modified JMX: %s" , arg_17 ) with open ( arg_17 , "wb" ) as fh : fh . write ( '' . join ( arg_4 ) ) fh . write ( arg_16 % arg_15 ) fh . write ( arg_5 ) return arg_17

Produces a TidyPy configuration that incorporates the configuration files
    stored in the current user's home directory.

    :param project_path: the path to the project that is going to be analyzed
    :type project_path: str
    :param use_cache:
        whether or not to use cached versions of any remote/referenced TidyPy
        configurations. If not specified, defaults to ``True``.
    :type use_cache: bool
    :rtype: dict


Question: Test if the graph is connected .

def Func ( arg_0 ) : try : return nx . is_weakly_connected ( arg_0 . graph ) except nx . exception . NetworkXException : return False

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: Runs the model to generate multivariate normal distribution .

def Func ( arg_0 , arg_1 ) : del arg_1 with tf . compat . v1 . name_scope ( arg_0 . _name ) : return tfd . MultivariateNormalDiag ( arg_0 . loc , arg_0 . scale_diag )

Set the rotation state of the camera

        :param x: viewport x pos
        :param y: viewport y pos


Question: return the parser for the current name

def Func ( arg_0 ) : arg_1 = arg_0 . module arg_2 = arg_0 . subcommands if arg_2 : arg_3 = inspect . getdoc ( arg_1 ) Func = Parser ( description = arg_3 , arg_1 = arg_1 ) arg_5 = Func . add_subparsers ( ) for arg_6 , arg_7 in arg_2 . items ( ) : arg_6 = arg_6 . replace ( "_" , "-" ) arg_8 = inspect . getdoc ( arg_7 ) arg_9 = arg_5 . add_parser ( arg_6 , arg_7 = arg_7 , help = arg_8 ) else : Func = Parser ( arg_7 = arg_0 . callbacks [ arg_0 . function_name ] , arg_1 = arg_1 ) return Func

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


Question: Dictionary of actual parameters of the model .

def Func ( arg_0 ) : arg_1 = { "model_id" : "name" , "response_column" : "column_name" , "training_frame" : "name" , "validation_frame" : "name" } arg_2 = { } for arg_3 in arg_0 . parms : if arg_3 in arg_1 . keys ( ) : arg_2 [ arg_3 ] = arg_0 . parms [ arg_3 ] [ "actual_value" ] . get ( arg_1 [ arg_3 ] , None ) else : arg_2 [ arg_3 ] = arg_0 . parms [ arg_3 ] [ "actual_value" ] return arg_2

Read data synchronous from an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: data name
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**


Question: List all hosted zones associated with this connection s account . Since this method returns a generator you can pull as many or as few entries as you d like without having to query and receive every hosted zone you may have .

def Func ( arg_0 , arg_1 = 100 ) : return arg_0 . _do_autopaginating_api_call ( path = 'hostedzone' , params = { 'maxitems' : arg_1 } , method = 'GET' , parser_func = xml_parsers . Func_parser , next_marker_xpath = "./{*}NextMarker" , next_marker_param_name = "marker" , )

Run the report.

        See `coverage.report()` for arguments.


Question: return a class by its name raise KeyError if not found

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . Funcs ( ) : if arg_2 . node . name == arg_1 : return arg_2 raise KeyError ( arg_1 )

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


Question: Renders the template and fires the signal

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . render ( arg_1 ) templateFunced . send ( arg_2 , arg_0 = arg_0 , arg_1 = arg_1 ) return arg_3

Return True if this new candidate representation satisfies all our overlap
    rules. Since we know that neighboring representations differ by at most
    one bit, we compute running overlaps.


Question: Parse a list of validator names or n - tuples checking for errors .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : if isinstance ( arg_2 , str ) : arg_3 = [ ] elif len ( arg_2 ) > 1 : arg_3 = arg_2 [ 1 : ] arg_2 = arg_2 [ 0 ] else : raise ValidationError ( "You must pass either an n-tuple or a string to define a validator" , validator = arg_2 ) arg_4 = "validate_%s" % str ( arg_2 ) arg_1 . append ( ( arg_4 , arg_3 ) ) return arg_1

Configure the Outstation's database of input point definitions.

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


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

def Func ( arg_0 ) : try : arg_1 = initializers . load_tiff ( arg_0 . filename ) arg_1 = initializers . normalize ( arg_1 , invert = arg_0 . invert , scale = arg_0 . exposure , dtype = arg_0 . float_precision ) except IOError as e : log . error ( "Could not find image '%s'" % arg_0 . filename ) raise e return arg_1

Read attribute from sysfs and return as string


Question: Begin processing a batch operations request .

def Func ( arg_0 , arg_1 ) : if 'operations' not in arg_1 : raise KeyError ( 'The batch must have operations' ) for arg_2 in arg_1 [ 'operations' ] : if 'method' not in arg_2 : raise KeyError ( 'The batch operation must have a method' ) if arg_2 [ 'method' ] not in [ 'GET' , 'POST' , 'PUT' , 'PATCH' , 'DELETE' ] : raise ValueError ( 'The batch operation method must be one of "GET", "POST", "PUT", "PATCH", ' 'or "DELETE", not {0}' . format ( arg_2 [ 'method' ] ) ) if 'path' not in arg_2 : raise KeyError ( 'The batch operation must have a path' ) return arg_0 . _mc_client . _post ( url = arg_0 . _build_path ( ) , arg_1 = arg_1 )

Init openstack neutron mq

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

        :param mq: class ternya.mq.MQ


Question: This is how an instance is created when we read a MatlabObject from a MAT file .

def Func ( arg_0 , arg_1 ) : arg_2 = OctaveUserClass . __new__ ( arg_0 ) arg_2 . _address = '%s_%s' % ( arg_2 . _name , id ( arg_2 ) ) arg_2 . _ref ( ) . push ( arg_2 . _address , arg_1 ) return arg_2

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


Question: This function gets the Fortney mass - radius relation for planets .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'massjupiter' , arg_4 = 'radiusjupiter' ) : arg_5 = { 0.3 : MASSESRADII_0_3GYR , 1.0 : MASSESRADII_1_0GYR , 4.5 : MASSESRADII_4_5GYR } if arg_0 not in arg_5 : print ( 'given age not in Fortney 2007, returning...' ) return Func = arg_5 [ arg_0 ] if ( arg_1 in Func ) and ( arg_2 in Func [ arg_1 ] ) : print ( 'getting % Gyr M-R for planet dist %s AU, ' 'core mass %s Mearth...' % ( arg_0 , arg_1 , arg_2 ) ) arg_7 = Func [ arg_1 ] [ arg_2 ] arg_8 = { 'mass' : array ( arg_7 [ arg_3 ] ) , 'radius' : array ( arg_7 [ arg_4 ] ) } return arg_8

A free-text query resolver by Wolfram|Alpha. Returns the first
	result, if available.


Question: Destroy the record

def Func ( arg_0 ) : return arg_0 . get_data ( "domains/%s/records/%s" % ( arg_0 . domain , arg_0 . id ) , type = DELETE , )


Question: interface helper function

def Func ( arg_0 , arg_1 , arg_2 : [ arg_3 , arg_4 , arg_5 ] , arg_6 = None ) : if not isinstance ( arg_2 , ( arg_3 , list , set , tuple ) ) : raise BaseException ( 'Invalid type of method: %s' % type ( arg_2 ) . __name__ ) if isinstance ( arg_2 , arg_3 ) : arg_2 = { arg_2 } arg_0 . _interface [ arg_1 ] = [ { 'method' : arg_2 , 'url' : arg_6 } ]

Fetch the events pages of a given group.


Question: Convert an OpenSSL native context error failure into a Python exception .

def Func ( arg_0 ) : arg_1 = [ _lib . X509_STORE_CTX_get_error ( arg_0 . _store_ctx ) , _lib . X509_STORE_CTX_get_error_depth ( arg_0 . _store_ctx ) , _native ( _ffi . string ( _lib . X509_verify_cert_error_string ( _lib . X509_STORE_CTX_get_error ( arg_0 . _store_ctx ) ) ) ) , ] arg_2 = _lib . X509_STORE_CTX_get_current_cert ( arg_0 . _store_ctx ) arg_3 = _lib . X509_dup ( arg_2 ) arg_4 = X509 . _from_raw_x509_ptr ( arg_3 ) return X509StoreContextError ( arg_1 , arg_4 )

simple timer. returns a time object, or a string.


Question: Checks if one the parameters in group_node is explored .

def Func ( arg_0 , arg_1 ) : arg_2 = False for arg_3 in arg_0 . f_get_explored_parameters ( ) : if arg_3 in arg_1 : arg_2 = True break return arg_2

Checks a Security OSStatus error code and throws an exception if there is an
    error to report

    :param error:
        An OSStatus

    :param exception_class:
        The exception class to use for the exception if an error occurred

    :raises:
        OSError - when the OSStatus contains an error


Question: Retrieves the number of commits to a repo in the organization . If it is the first time getting commits for a repo it will get all commits and save them to JSON . If there are previous commits saved it will only get commits that have not been saved to disk since the last date of commits .

def Func ( arg_0 , arg_1 , arg_2 = 'llnl' ) : arg_3 = ( '../github-data/' + arg_2 + '/' + arg_1 . name + '/commits' ) arg_4 = False if not os . path . exists ( arg_3 ) : arg_5 = arg_1 . iter_commits ( ) arg_4 = True else : arg_6 = os . listdir ( arg_3 ) arg_7 = str ( arg_6 [ - 1 ] [ : - 5 ] ) if arg_7 == str ( datetime . date . today ( ) ) : if len ( arg_6 ) > 2 : arg_7 = str ( arg_6 [ - 2 ] [ : - 5 ] ) else : arg_5 = arg_1 . iter_commits ( ) arg_4 = True if not arg_4 : arg_5 = arg_1 . iter_commits ( since = arg_7 ) for arg_8 in arg_5 : arg_0 . commits_json [ arg_1 . name ] . append ( arg_8 . to_json ( ) ) arg_9 = 0 for arg_8 in arg_1 . iter_commits ( ) : arg_9 += 1 return arg_9

Helper method to clean up DAG file processors to avoid leaving orphan processes.


Question: Return line with imports on separate lines .

def Func ( arg_0 ) : assert '\\' not in arg_0 assert '(' not in arg_0 assert ')' not in arg_0 assert ';' not in arg_0 assert '#' not in arg_0 assert not arg_0 . lstrip ( ) . startswith ( 'from' ) arg_1 = get_line_ending ( arg_0 ) if not arg_1 : return arg_0 ( arg_2 , arg_3 ) = re . split ( pattern = r'\bimport\b' , string = arg_0 , maxsplit = 1 ) arg_2 += 'import ' assert arg_1 return '' . join ( [ arg_2 + arg_4 . strip ( ) + arg_1 for arg_4 in sorted ( arg_3 . split ( ',' ) ) ] )

Create a tuning job

        :param config: the config for tuning
        :type config: dict
        :param wait_for_completion: if the program should keep running until job finishes
        :type wait_for_completion: bool
        :param check_interval: the time interval in seconds which the operator
            will check the status of any SageMaker job
        :type check_interval: int
        :param max_ingestion_time: the maximum ingestion time in seconds. Any
            SageMaker jobs that run longer than this will fail. Setting this to
            None implies no timeout for any SageMaker job.
        :type max_ingestion_time: int
        :return: A response to tuning job creation


Question: Write the numeric array

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = BytesIO ( ) write_var_header ( arg_3 , arg_1 ) if not isinstance ( arg_2 , basestring ) and arg_1 [ 'dims' ] [ 0 ] > 1 : arg_2 = list ( chain . from_iterable ( izip ( * arg_2 ) ) ) write_elements ( arg_3 , arg_1 [ 'mtp' ] , arg_2 ) arg_4 = arg_3 . getvalue ( ) arg_3 . close ( ) write_var_data ( arg_0 , arg_4 )

Notify learners about a program in which they've been enrolled.

        Args:
            enterprise_customer: The EnterpriseCustomer being linked to
            program_details: Details about the specific program the learners were enrolled in
            users: An iterable of the users or pending users who were enrolled


Question: check whether the given sub metric is in important_sub_metrics list

def Func ( arg_0 , arg_1 ) : if not arg_0 . important_sub_metrics : return False if arg_1 in arg_0 . important_sub_metrics : return True arg_2 = arg_1 . split ( '.' ) if arg_2 [ - 1 ] in arg_0 . important_sub_metrics : return True return False

Initialize all ephemerals used by derived classes.


Question: pass in a word string that you would like to see probable matches for .

def Func ( arg_0 , arg_1 ) : if ( arg_1 not in arg_0 . transmissions ) : raise NoMatchError ( 'no matches found' ) else : arg_2 = arg_0 . transmissions [ arg_1 ] return sorted ( ( ( arg_3 , arg_4 ) for arg_3 , arg_4 in arg_2 . iteritems ( ) if arg_4 != 0 ) , reverse = True )

Returns the scaled x positions of the points as doubles


Question: Check if record is deleted .

def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or arg_0 . revisions [ - 1 ] [ 1 ] return any ( arg_2 == 'deleted' for arg_2 in arg_1 . get ( 'collections' , [ ] ) )


Question: Returns list of MS Bot Framework compatible states of the RichMessage instance nested controls .

def Func ( arg_0 ) -> list : arg_1 = [ control . Func ( ) for control in arg_0 . controls ] return arg_1

Get base-64 encoded data as a string for the given image. Fallback to return
    fallback_image_file if cannot get the image data or img is None.
    @param {Image} img - The PIL Image to get src data for
    @param {String} fallback_image_file - The filename of the image file,
        to be used when image data capture fails
    @return {String} The base-64 encoded image data string, or path to the file
        itself if not supported.


Question: Wrapper function for scoop that does not configure logging

def Func ( arg_0 ) : try : try : arg_1 = scoop . IS_ORIGIN except AttributeError : arg_1 = True if not arg_1 : _configure_niceness ( arg_0 ) _configure_logging ( arg_0 ) return _single_run ( arg_0 ) except Exception : scoop . logger . exception ( 'ERROR occurred during a single run!' ) raise


Question: Generate the composite rotation matrix that rotates the slab normal .

def Func ( arg_0 ) : arg_1 = arg_0 . param_dict [ arg_0 . lbl_theta ] arg_2 = np . array ( [ [ np . cos ( arg_1 ) , - np . sin ( arg_1 ) , 0 ] , [ np . sin ( arg_1 ) , np . cos ( arg_1 ) , 0 ] , [ 0 , 0 , 1 ] ] ) arg_3 = arg_0 . param_dict [ arg_0 . lbl_phi ] arg_4 = np . array ( [ [ np . cos ( arg_3 ) , 0 , np . sin ( arg_3 ) ] , [ 0 , 1 , 0 ] , [ - np . sin ( arg_3 ) , 0 , np . cos ( arg_3 ) ] ] ) return np . dot ( arg_4 , arg_2 )

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


Question: Compute a pairwise distance measure between all rows of two numeric H2OFrames .

def Func ( arg_0 , arg_1 , arg_2 = None ) : assert_is_type ( arg_1 , H2OFrame ) if arg_2 is None : arg_2 = "l2" return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 , arg_2 ) ) . _frame ( )

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: Retrieves the contents of the specified file .

def Func ( arg_0 ) : with _FILE_CACHE_LOCK : if arg_0 not in arg_1 : arg_1 [ arg_0 ] = _Func ( arg_0 ) return arg_1 [ arg_0 ]

Translates round trip symbols to sectors.

    Parameters
    ----------
    round_trips : pd.DataFrame
        DataFrame with one row per round trip trade.
        - See full explanation in round_trips.extract_round_trips
    sector_mappings : dict or pd.Series, optional
        Security identifier to sector mapping.
        Security ids as keys, sectors as values.

    Returns
    -------
    sector_round_trips : pd.DataFrame
        Round trips with symbol names replaced by sector names.


Question: Get all states of given object

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) arg_4 = [ ] if arg_3 . AXEnabled : arg_4 . append ( "enabled" ) if arg_3 . AXFocused : arg_4 . append ( "focused" ) else : try : if arg_3 . AXFocused : arg_4 . append ( "focusable" ) except : pass if re . match ( "AXCheckBox" , arg_3 . AXRole , re . M | re . U | re . L ) or re . match ( "AXRadioButton" , arg_3 . AXRole , re . M | re . U | re . L ) : if arg_3 . AXValue : arg_4 . append ( "checked" ) return arg_4

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: Gets the CRC32c checksum of an object in Google Cloud Storage .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . log . info ( 'Retrieving the crc32c checksum of ' 'object_name: %s in bucket_name: %s' , arg_2 , arg_1 ) arg_3 = arg_0 . get_conn ( ) arg_4 = arg_3 . get_bucket ( arg_1 = arg_1 ) arg_5 = arg_4 . get_blob ( blob_name = arg_2 ) arg_5 . reload ( ) arg_6 = arg_5 . crc32c arg_0 . log . info ( 'The crc32c checksum of %s is %s' , arg_2 , arg_6 ) return arg_6

Remove the MUC specific stanza payload element.


Question: Wrapper for etree . SubElement that takes care of unsupported nsmap option .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if use_lxml : return etree . SubElement ( arg_0 , arg_1 , arg_2 = arg_2 ) return etree . SubElement ( arg_0 , arg_1 )

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


Question: Half - duplex SPI read . If assert_ss is true the SS line will be asserted low the specified length of bytes will be clocked in the MISO line and if deassert_ss is true the SS line will be put back high . Bytes which are read will be returned as a bytearray object .

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : if arg_0 . _miso is None : raise RuntimeError ( 'Read attempted with no MISO pin specified.' ) if arg_2 and arg_0 . _ss is not None : arg_0 . _gpio . set_low ( arg_0 . _ss ) arg_4 = bytearray ( arg_1 ) for arg_5 in range ( arg_1 ) : for arg_6 in range ( 8 ) : arg_0 . _gpio . output ( arg_0 . _sclk , not arg_0 . _clock_base ) if arg_0 . _Func_leading : if arg_0 . _gpio . is_high ( arg_0 . _miso ) : arg_4 [ arg_5 ] |= arg_0 . _Func_shift ( arg_0 . _mask , arg_6 ) else : arg_4 [ arg_5 ] &= ~ arg_0 . _Func_shift ( arg_0 . _mask , arg_6 ) arg_0 . _gpio . output ( arg_0 . _sclk , arg_0 . _clock_base ) if not arg_0 . _Func_leading : if arg_0 . _gpio . is_high ( arg_0 . _miso ) : arg_4 [ arg_5 ] |= arg_0 . _Func_shift ( arg_0 . _mask , arg_6 ) else : arg_4 [ arg_5 ] &= ~ arg_0 . _Func_shift ( arg_0 . _mask , arg_6 ) if arg_3 and arg_0 . _ss is not None : arg_0 . _gpio . set_high ( arg_0 . _ss ) return arg_4

Get or set `Settings._wrapped`

    :param str path: a python module file,
        if user set it,write config to `Settings._wrapped`
    :param str with_path: search path
    :return: A instance of `Settings`


Question: Exit with error code and message .

def Func ( arg_0 , arg_1 = 1 ) : sys . stderr . write ( 'ERROR: {}\n' . format ( arg_0 ) ) sys . stderr . flush ( ) sys . exit ( arg_1 )

Form for selecting products from an individual product category.

    Arguments:
        category_id (castable to int): The id of the category to display.

    Returns:
        redirect or render:
            If the form has been sucessfully submitted, redirect to
            ``dashboard``. Otherwise, render
            ``registrasion/product_category.html`` with data::

                {
                    "category": category,         # An inventory.Category for
                                                  # category_id
                    "discounts": discounts,       # A list of
                                                  # DiscountAndQuantity
                    "form": products_form,        # A form for selecting
                                                  # products
                    "voucher_form": voucher_form, # A form for entering a
                                                  # voucher code
                }


Question: This method fixes a bug in Python s SGMLParser .

def Func ( arg_0 , arg_1 ) : try : arg_2 = int ( arg_1 ) except ValueError : return if not 0 <= arg_2 <= 127 : return return arg_0 . convert_codepoint ( arg_2 )

Updates a player's state when a payload with opcode ``playerUpdate`` is received.


Question: Symmetrizes a Csiszar - function in log - space .

def Func ( arg_0 , arg_1 , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , "Func" , [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_2 = "logu" ) return 0.5 * ( arg_1 ( arg_0 ) + dual_csiszar_function ( arg_0 , arg_1 ) )

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


Question: Adds the price

def Func ( arg_0 , arg_1 : arg_2 . Price ) : from decimal import Decimal arg_4 = arg_0 . get_price_repository ( ) arg_5 = ( arg_4 . query . filter ( arg_2 . Price . namespace == arg_1 . namespace ) . filter ( arg_2 . Price . symbol == arg_1 . symbol ) . filter ( arg_2 . Price . date == arg_1 . date ) . filter ( arg_2 . Price . time == arg_1 . time ) . first ( ) ) if arg_5 : arg_6 = Decimal ( arg_1 . value ) / Decimal ( arg_1 . denom ) arg_0 . logger . info ( f"Exists: {price}" ) if arg_1 . currency != arg_5 . currency : raise ValueError ( f"The currency is different for price {price}!" ) if arg_5 . value != arg_1 . value : arg_5 . value = arg_1 . value arg_0 . logger . info ( f"Updating to {new_value}." ) if arg_5 . denom != arg_1 . denom : arg_5 . denom = arg_1 . denom else : arg_0 . session . add ( arg_1 ) arg_0 . logger . info ( f"Added {price}" )

An intelligent wrapper for ``open``.

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

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

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

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

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

        Otherwise, use the specified coding.

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


Question: Creates file group and returns FileGroup instance .

def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in enumerate ( arg_1 ) : if isinstance ( arg_4 , File ) : arg_5 = 'files[{index}]' . format ( arg_3 = arg_3 ) arg_2 [ arg_5 ] = six . text_type ( arg_4 ) else : raise InvalidParamError ( 'all items have to be ``File`` instance' ) if not arg_2 : raise InvalidParamError ( 'set of files is empty' ) arg_6 = uploading_request ( 'POST' , 'group/' , arg_2 = arg_2 ) arg_7 = arg_0 . construct_from ( arg_6 ) return arg_7


Question: Returns a list of includes to be given to cnxepub . collation . collate .

def Func ( ) : arg_0 = [ ] arg_1 = '{baseUrl}/api/exercises?q={field}:"{{itemCode}}"' arg_2 = get_current_registry ( ) . settings arg_3 = arg_2 . get ( 'embeddables.exercise.base_url' , None ) arg_4 = [ match . split ( ',' , 1 ) for match in aslist ( arg_2 . get ( 'embeddables.exercise.match' , '' ) , flatten = False ) ] arg_5 = arg_2 . get ( 'embeddables.exercise.token' , None ) arg_6 = arg_2 . get ( 'mathmlcloud.url' , None ) arg_7 = arg_2 . get ( 'memcache_servers' ) if arg_7 : arg_7 = arg_7 . split ( ) else : arg_7 = None if arg_3 and arg_4 : arg_8 = None if arg_7 : arg_8 = memcache . Client ( arg_7 , debug = 0 ) for ( arg_9 , arg_10 ) in arg_4 : arg_11 = arg_1 . format ( baseUrl = arg_3 , field = arg_10 ) arg_0 . append ( exercise_callback_factory ( arg_9 , arg_11 , arg_8 , arg_5 , arg_6 ) ) return arg_0

Start listening for incoming connections.


Question: Return a dictionary with all arrays sizes .

def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_3 = { } for arg_4 , arg_5 in arg_0 . variables . items ( ) : arg_6 , arg_7 = arg_5 if arg_7 is None : continue arg_3 [ arg_4 ] = reduce ( operator . mul , arg_7 , 1 ) if arg_1 : arg_8 = arg_0 . datatypes_size [ arg_6 ] arg_3 [ arg_4 ] *= arg_8 if arg_2 : return { arg_9 : arg_0 . subs_consts ( arg_10 ) for arg_9 , arg_10 in arg_3 . items ( ) } else : return arg_3

Returns an invoice object for a given cart at its current revision.
        If such an invoice does not exist, the cart is validated, and if valid,
        an invoice is generated.


Question: Much like parse . quote in that it returns a URL encoded string for the given value protecting the safe characters ; but this version also ensures the value is UTF - 8 encoded .

def Func ( arg_0 , arg_1 = '/:' ) : if isinstance ( arg_0 , six . text_type ) : arg_0 = arg_0 . encode ( 'utf8' ) elif not isinstance ( arg_0 , six . string_types ) : arg_0 = str ( arg_0 ) return parse . Func ( arg_0 , arg_1 )

Show an image.

    Args:
        img (str or ndarray): The image to be displayed.
        win_name (str): The window name.
        wait_time (int): Value of waitKey param.


Question: Stop when connection is lost .

def Func ( arg_0 , arg_1 ) : if arg_1 : arg_0 . log . exception ( 'disconnected due to exception' ) else : arg_0 . log . info ( 'disconnected because of close/abort.' ) arg_0 . _closed . set ( )

Enables uniform interface to value and batch jacobian calculation.

  Works in both eager and graph modes.

  Arguments:
    f: The scalar function to evaluate.
    x: The value at which to compute the value and the batch jacobian.

  Returns:
    A tuple (f(x), J(x)), where J(x) is the batch jacobian.


Question: Returns the environment for actions that copy logging files .

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_1 . endswith ( '.log' ) : raise ValueError ( 'Logging URI must end in ".log": {}' . format ( arg_1 ) ) arg_3 = arg_1 [ : - len ( '.log' ) ] return { 'LOGGING_PATH' : '{}.log' . format ( arg_3 ) , 'STDOUT_PATH' : '{}-stdout.log' . format ( arg_3 ) , 'STDERR_PATH' : '{}-stderr.log' . format ( arg_3 ) , 'USER_PROJECT' : arg_2 , }


Question: Rewrite a dsv file filtering the rows .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_1 = DictFilter ( arg_1 ) rewrite ( arg_0 , arg_1 , ** arg_2 ) return arg_1 . removed

Create and connect to socket for TCP communication with hub.


Question: Create a polygon from a Shapely polygon .

def Func ( arg_0 , arg_1 = None ) : import shapely . geometry ia . do_assert ( isinstance ( arg_0 , shapely . geometry . Polygon ) ) if arg_0 . exterior is None or len ( arg_0 . exterior . coords ) == 0 : return Polygon ( [ ] , arg_1 = arg_1 ) arg_2 = np . float32 ( [ [ x , y ] for ( x , y ) in arg_0 . exterior . coords ] ) return Polygon ( arg_2 , arg_1 = arg_1 )

Add an HTTP header to response object.

        Arguments:
          name (str): HTTP header field name
          value (str): HTTP header field value


Question: Return a iterable with hgnc_genes .

def Func ( arg_0 , arg_1 , arg_2 = '37' ) : arg_3 = arg_0 . hgnc_collection . find ( { 'hgnc_symbol' : arg_1 , 'build' : arg_2 } ) if arg_3 . count ( ) == 0 : arg_3 = arg_0 . hgnc_collection . find ( { 'aliases' : arg_1 , 'build' : arg_2 } ) return arg_3

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


Question: Recursively converts dictionary keys to strings .

def Func ( arg_0 ) : if not isinstance ( arg_0 , dict ) : return arg_0 return dict ( ( str ( arg_1 ) , Func ( arg_2 ) ) for arg_1 , arg_2 in arg_0 . items ( ) )

iterator for the most significant key phrases


Question: Returns a number widget for the specified metric s cumulative total .

def Func ( arg_0 ) : arg_1 = get_gecko_params ( arg_0 , days_back = 7 ) arg_2 = Metric . objects . get ( uid = arg_1 [ 'uid' ] ) try : arg_3 = arg_2 . statistics . filter ( frequency = arg_1 [ 'frequency' ] ) . order_by ( '-date_time' ) [ 0 ] except IndexError : return ( 0 , 0 ) try : arg_4 = arg_2 . statistics . filter ( frequency = arg_1 [ 'frequency' ] , date_time__lte = arg_3 . date_time - timedelta ( days = arg_1 [ 'days_back' ] ) ) . order_by ( '-date_time' ) [ 0 ] except IndexError : return ( arg_3 . cumulative_count , 0 ) if arg_1 [ 'cumulative' ] else ( arg_3 . count , 0 ) return ( arg_3 . cumulative_count , arg_4 . cumulative_count ) if arg_1 [ 'cumulative' ] else ( arg_3 . count , arg_4 . count )

Initialize configuration.

        :param app: An instance of :class:`~flask.Flask`.


Question: Receive NAK in REBINDING state .

def Func ( arg_0 , arg_1 ) : logger . debug ( "C3.1. Received NAK?, in RENEWING state." ) if arg_0 . process_received_nak ( arg_1 ) : logger . debug ( "C3.1: T. Received NAK, in RENEWING state, " "raise INIT." ) raise arg_0 . INIT ( )

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: return a normalized version of a profile matrix

def Func ( arg_0 , arg_1 = False , arg_2 = True ) : if arg_1 : arg_3 = arg_0 . max ( axis = 1 ) arg_4 = np . exp ( arg_0 . T - arg_3 ) . T else : arg_3 = 0.0 arg_4 = arg_0 arg_5 = arg_4 . sum ( axis = 1 ) return ( np . copy ( np . einsum ( 'ai,a->ai' , arg_4 , 1.0 / arg_5 ) ) , ( np . log ( arg_5 ) + arg_3 ) if arg_2 else None )

Get the EnterpriseCustomer associated with a running pipeline.


Question: iterate through ner_xml_path to fuse with i_chunk into o_chunk

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_2 . __iter__ ( ) arg_5 = xml . dom . minidom . parse ( open ( arg_1 ) ) for arg_6 in arg_5 . getElementsByTagName ( 'FILENAME' ) : arg_7 = arg_4 . next ( ) arg_8 = arg_6 . attributes . get ( 'stream_id' ) . value if arg_7 . stream_id is None : assert not arg_8 , 'out of sync: None != %r' % arg_8 logger . critical ( 'si.stream_id is None... ignoring' ) continue assert arg_8 and arg_8 == arg_7 . stream_id , '%s != %s' % ( arg_8 , arg_7 . stream_id ) if not arg_7 . body : continue arg_9 = Tagging ( ) arg_9 . tagger_id = arg_0 . tagger_id '''            ## get this one file out of its FILENAME tags            tagged_doc_parts = list(files(ner_dom.toxml()))            if not tagged_doc_parts:                continue            tagged_doc = tagged_doc_parts[0][1]            ## hack            hope_original = make_clean_visible(tagged_doc, '')            open(ner_xml_path + '-clean', 'wb').write(hope_original.encode('utf-8'))            print ner_xml_path + '-clean'            ''' arg_9 . generation_time = streamcorpus . make_stream_time ( ) arg_7 . body . taggings [ arg_0 . tagger_id ] = arg_9 arg_14 , arg_15 , arg_16 = arg_0 . get_sentences ( arg_6 ) arg_7 . body . sentences [ arg_0 . tagger_id ] = arg_14 arg_7 . body . relations [ arg_0 . tagger_id ] = arg_15 arg_7 . body . attributes [ arg_0 . tagger_id ] = arg_16 logger . debug ( 'finished aligning tokens %s' % arg_7 . stream_id ) '''            for num, sent in enumerate(sentences):                for tok in sent.tokens:                    print '%d\t%d\t%s' % (num, tok.offsets[OffsetType.LINES].first, repr(tok.token))            ''' if 'align_labels_by' in arg_0 . config and arg_0 . config [ 'align_labels_by' ] : assert 'aligner_data' in arg_0 . config , 'config missing "aligner_data"' arg_17 = AlignmentStrategies [ arg_0 . config [ 'align_labels_by' ] ] arg_17 ( arg_7 , arg_0 . config [ 'aligner_data' ] ) gc . collect ( ) try : arg_3 . add ( arg_7 ) except MemoryError , exc : arg_18 = traceback . format_exc ( exc ) arg_18 += make_memory_info_msg ( ) logger . critical ( arg_18 ) raise PipelineOutOfMemory ( arg_18 ) try : arg_3 . close ( ) logger . info ( 'finished chunk for %r' % arg_1 ) except MemoryError , exc : arg_18 = traceback . format_exc ( exc ) arg_18 += make_memory_info_msg ( ) logger . critical ( arg_18 ) raise PipelineOutOfMemory ( arg_18 )


Question: Wait till a window does not exist .

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = 30 ) : arg_4 = 0 while arg_4 < arg_3 : if not arg_0 . guiexist ( arg_1 , arg_2 ) : return 1 time . sleep ( 1 ) arg_4 += 1 return 0

Required to allow using custom USER_DETAILS_SERIALIZER in
        JWTSerializer. Defining it here to avoid circular imports


Question: r Asserts all items are of the same base type .

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_1 arg_3 = False for arg_4 in arg_0 : if arg_4 is not None : arg_5 = base_dtype ( arg_4 . dtype ) if not arg_1 : arg_1 = arg_5 elif arg_1 != arg_5 : arg_3 = True break if arg_3 : arg_1 = arg_2 arg_6 = None arg_7 = lambda x : x . name if hasattr ( x , 'name' ) else str ( x ) for arg_4 in arg_0 : if arg_4 is not None : arg_5 = base_dtype ( arg_4 . dtype ) if not arg_1 : arg_1 = arg_5 arg_6 = arg_7 ( arg_4 ) elif arg_1 != arg_5 : raise ValueError ( '{}, type={}, must be of the same type ({}){}.' . format ( arg_7 ( arg_4 ) , arg_5 , arg_1 , ( ( ' as {}' . format ( arg_6 ) ) if arg_6 else '' ) ) ) return arg_1 else : return arg_1

Returns a PDF response with a template rendered with the given context.


Question: Press button . Check DEFAULT_DELAY .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . src . lower ( ) if arg_3 [ arg_2 ] + arg_0 . settings . get ( 'delay' , DEFAULT_DELAY ) > time . time ( ) : return arg_3 [ arg_2 ] = time . time ( ) arg_0 . execute ( arg_1 )

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


Question: Return a pkg_resources . Distribution built from self . egg_info_path

def Func ( arg_0 ) : arg_1 = arg_0 . egg_info_path ( '' ) . rstrip ( '/' ) arg_2 = os . path . dirname ( arg_1 ) arg_3 = pkg_resources . PathMetadata ( arg_2 , arg_1 ) arg_4 = os . path . splitext ( os . path . basename ( arg_1 ) ) [ 0 ] return pkg_resources . Distribution ( os . path . dirname ( arg_1 ) , project_name = arg_4 , arg_3 = arg_3 )

Create a citation timeline counter from the graph.


Question: Builds a scope and request body into a WSGI environ object .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> dict : arg_4 = { "REQUEST_METHOD" : arg_0 [ "method" ] , "SCRIPT_NAME" : arg_0 . get ( "root_path" , "" ) , "PATH_INFO" : arg_0 [ "path" ] , "QUERY_STRING" : arg_0 [ "query_string" ] . decode ( "ascii" ) , "SERVER_PROTOCOL" : f"HTTP/{scope['http_version']}" , "wsgi.version" : ( 1 , 0 ) , "wsgi.url_scheme" : arg_0 . get ( "scheme" , "http" ) , "wsgi.input" : io . BytesIO ( arg_2 ) , "wsgi.errors" : sys . stdout , "wsgi.multithread" : True , "wsgi.multiprocess" : True , "wsgi.run_once" : False , } arg_5 = arg_0 . get ( "server" ) or ( "localhost" , 80 ) arg_4 [ "SERVER_NAME" ] = arg_5 [ 0 ] arg_4 [ "SERVER_PORT" ] = arg_5 [ 1 ] if arg_0 . get ( "client" ) : arg_4 [ "REMOTE_ADDR" ] = arg_0 [ "client" ] [ 0 ] for arg_6 , arg_7 in arg_0 . get ( "headers" , [ ] ) : arg_6 = arg_6 . decode ( "latin1" ) if arg_6 == "content-length" : arg_8 = "CONTENT_LENGTH" elif arg_6 == "content-type" : arg_8 = "CONTENT_TYPE" else : arg_8 = f"HTTP_{name}" . upper ( ) . replace ( "-" , "_" ) arg_7 = arg_7 . decode ( "latin1" ) if arg_8 in arg_4 : arg_7 = arg_4 [ arg_8 ] + "," + arg_7 arg_4 [ arg_8 ] = arg_7 return arg_4

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


Question: Inserts HTML using the specified cursor then returns its plain text version .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . beginEditBlock ( ) arg_1 . removeSelectedText ( ) arg_3 = arg_1 . position ( ) arg_0 . _insert_html ( arg_1 , arg_2 ) arg_4 = arg_1 . position ( ) arg_1 . setPosition ( arg_3 , QtGui . QTextCursor . KeepAnchor ) arg_5 = arg_1 . selection ( ) . toPlainText ( ) arg_1 . setPosition ( arg_4 ) arg_1 . endEditBlock ( ) return arg_5

Register all messages from a checker.

        :param BaseChecker checker:


Question: Checks for the existence of a file in Google Cloud Storage .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_conn ( ) arg_4 = arg_3 . get_bucket ( arg_1 = arg_1 ) arg_5 = arg_4 . blob ( blob_name = arg_2 ) return arg_5 . Func ( )

This will return a single tr element, with all tds already populated.


Question: Augmenter that always executes exactly one of its children .

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = None ) : return SomeOf ( n = 1 , arg_0 = arg_0 , random_order = False , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = 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: Returns a list of the filtered lists for the given board This filters the trello lists according to the configuration values of trello . include_lists and trello . exclude_lists .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . api_request ( "/1/boards/{board_id}/lists/open" . format ( board_id = arg_1 ) , fields = 'name' ) arg_3 = arg_0 . config . get ( 'include_lists' , to_type = aslist ) if arg_3 : arg_2 = [ l for l in arg_2 if l [ 'name' ] in arg_3 ] arg_4 = arg_0 . config . get ( 'exclude_lists' , to_type = aslist ) if arg_4 : arg_2 = [ l for l in arg_2 if l [ 'name' ] not in arg_4 ] return arg_2

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: Returns the components of this name as a sequence of 2 - tuples .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in range ( _lib . X509_NAME_entry_count ( arg_0 . _name ) ) : arg_3 = _lib . X509_NAME_get_entry ( arg_0 . _name , arg_2 ) arg_4 = _lib . X509_NAME_ENTRY_get_object ( arg_3 ) arg_5 = _lib . X509_NAME_ENTRY_get_data ( arg_3 ) arg_6 = _lib . OBJ_obj2nid ( arg_4 ) arg_7 = _lib . OBJ_nid2sn ( arg_6 ) arg_8 = _ffi . buffer ( _lib . ASN1_STRING_data ( arg_5 ) , _lib . ASN1_STRING_length ( arg_5 ) ) [ : ] arg_1 . append ( ( _ffi . string ( arg_7 ) , arg_8 ) ) return arg_1

Retrieve the list of courses contained within this catalog.

        Only courses with active course runs are returned. A course run is considered active if it is currently
        open for enrollment, or will open in the future.


Question: Enable support for negotiating SRTP keying material .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , bytes ) : raise TypeError ( "profiles must be a byte string." ) _openssl_assert ( _lib . SSL_CTX_Func ( arg_0 . _context , arg_1 ) == 0 )

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


Question: Convert a gene panel with hgnc symbols to a new one with hgnc ids .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . obj [ 'adapter' ] arg_3 = [ "hgnc_id" , "hgnc_symbol" , "disease_associated_transcripts" , "reduced_penetrance" , "genetic_disease_models" , "mosaicism" , "database_entry_version" ] arg_4 = parse_genes ( arg_1 ) arg_2 . add_hgnc_id ( arg_4 ) click . echo ( "#{0}" . format ( '\t' . join ( arg_3 ) ) ) for arg_5 in arg_4 : if arg_5 . get ( 'hgnc_id' ) : arg_6 = [ ] for arg_7 in arg_3 : arg_6 . append ( str ( arg_5 [ arg_7 ] ) if arg_5 . get ( arg_7 ) else '' ) click . echo ( '\t' . join ( arg_6 ) )


Question: Parse the given ChangeLog data into a list of Hashes .

def Func ( arg_0 ) : arg_1 = re . compile ( "^## .+$" , re . MULTILINE ) . split ( arg_0 ) arg_2 = re . findall ( "^## .+?$" , arg_0 , re . MULTILINE ) arg_1 . pop ( 0 ) arg_3 = [ ] def func ( arg_4 , arg_5 ) : arg_6 = Func_heading ( arg_4 ) arg_6 [ "content" ] = arg_5 arg_3 . append ( arg_6 ) list ( map ( func , arg_2 , arg_1 ) ) return arg_3

Reads the current "best model" for the job and returns whether or not the
    current model is better than the "best model" stored for the job

    Returns: (isBetter, storedBest, origResultsStr)

    isBetter:
      True if the current model is better than the stored "best model"
    storedResults:
      A dict of the currently stored results in the jobs table record
    origResultsStr:
      The json-encoded string that currently resides in the "results" field
      of the jobs record (used to create atomicity)


Question: distribute Heron packages to all nodes

def Func ( arg_0 , arg_1 ) : Log . info ( "Distributing heron package to nodes (this might take a while)..." ) arg_2 = arg_0 [ Role . MASTERS ] arg_3 = arg_0 [ Role . SLAVES ] arg_4 = tempfile . NamedTemporaryFile ( suffix = ".tmp" ) . name Log . debug ( "TAR file %s to %s" % ( arg_1 [ "heron_dir" ] , arg_4 ) ) make_tarfile ( arg_4 , arg_1 [ "heron_dir" ] ) arg_5 = arg_2 . union ( arg_3 ) scp_package ( arg_4 , arg_5 , arg_1 )

Temporal distance probability density function.

        Returns
        -------
        non_delta_peak_split_points: numpy.array
        non_delta_peak_densities: numpy.array
            len(density) == len(temporal_distance_split_points_ordered) -1
        delta_peak_loc_to_probability_mass : dict


Question: Return a key with its parameters if it was found .

def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_0 . _assert_valid_stash ( ) arg_3 = arg_0 . _storage . Func ( arg_1 ) . copy ( ) if not arg_3 . Func ( 'value' ) : return None if arg_2 : arg_3 [ 'value' ] = arg_0 . _decrypt ( arg_3 [ 'value' ] ) audit ( storage = arg_0 . _storage . db_path , action = 'GET' , message = json . dumps ( dict ( arg_1 = arg_1 ) ) ) return arg_3

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Return the list of file to delete .

def Func ( arg_0 ) : arg_1 = PyFunceble . OUTPUT_DIRECTORY + PyFunceble . OUTPUTS [ "parent_directory" ] if not arg_1 . endswith ( PyFunceble . directory_separator ) : arg_1 += PyFunceble . directory_separator arg_2 = [ ] for arg_3 , arg_4 , arg_5 in PyFunceble . walk ( arg_1 ) : for arg_6 in arg_5 : if arg_6 not in [ ".gitignore" , ".keep" ] : if arg_3 . endswith ( PyFunceble . directory_separator ) : arg_2 . append ( arg_3 + arg_6 ) else : arg_2 . append ( arg_3 + PyFunceble . directory_separator + arg_6 ) return arg_2

Return arithmetic-geometric mean.

    Iterates between arithmetic & geometric means until they converge to
    a single value (rounded to 12 digits).

    Cf. https://en.wikipedia.org/wiki/Arithmetic-geometric_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The arithmetic-geometric mean of nums

    Examples
    --------
    >>> agmean([1, 2, 3, 4])
    2.3545004777751077
    >>> agmean([1, 2])
    1.4567910310469068
    >>> agmean([0, 5, 1000])
    2.9753977059954195e-13


Question: Factory for GromacsCommand derived types .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 ) : arg_5 = { 'command_name' : arg_1 , 'driver' : arg_2 , '__doc__' : property ( arg_3 . _get_gmx_docs ) } return type ( arg_0 , ( arg_3 , ) , arg_5 )

Called when there is an error in the websocket


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

def Func ( arg_0 , arg_1 ) : if not arg_0 or not re . match ( '^(' + PARTS [ arg_1 ] + ')$' , arg_0 ) : raise ValueError ( '{} should match {}' . format ( arg_1 , PARTS [ arg_1 ] ) )

Try to merge processes as much is possible

    :param processes: list of processes instances


Question: Recursively finds size of objects

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = sys . getsizeof ( arg_1 ) if arg_2 is None : arg_2 = set ( ) arg_4 = id ( arg_1 ) if arg_4 in arg_2 : return 0 arg_2 . add ( arg_4 ) if isinstance ( arg_1 , dict ) : arg_3 += sum ( [ arg_0 . Func ( arg_5 , arg_2 ) for arg_5 in arg_1 . values ( ) ] ) arg_3 += sum ( [ arg_0 . Func ( arg_6 , arg_2 ) for arg_6 in arg_1 . keys ( ) ] ) elif hasattr ( arg_1 , '__dict__' ) : arg_3 += arg_0 . Func ( arg_1 . __dict__ , arg_2 ) elif hasattr ( arg_1 , '__iter__' ) and not isinstance ( arg_1 , ( str , bytes , bytearray ) ) : arg_3 += sum ( [ arg_0 . Func ( arg_7 , arg_2 ) for arg_7 in arg_1 ] ) return arg_3


Question: Prints the current state .

def Func ( arg_0 ) : def tile_string ( arg_1 ) : if arg_1 > 0 : return '% 5d' % ( 2 ** arg_1 , ) return "     " arg_2 = '-' * 25 print ( arg_2 ) for arg_3 in range ( 4 ) : print ( "|" + "|" . join ( [ tile_string ( arg_4 ) for arg_4 in arg_0 . _state [ arg_3 , : ] ] ) + "|" ) print ( arg_2 )

Delete previous webhooks. If local ngrok tunnel, create a webhook.


Question: Does the given complex contain the member?

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_5 ) -> bool : return any ( arg_7 == arg_4 for arg_6 , arg_7 , arg_8 in arg_0 . out_edges ( arg_2 , arg_8 = True ) if arg_8 [ RELATION ] == HAS_COMPONENT )

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

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


Question: Build Entity and Architecture instance out of netlist representation

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = Entity ( arg_1 ) arg_4 . _name = arg_1 + "_inst" for arg_6 , arg_7 in arg_0 . params . items ( ) : arg_4 . generics . append ( arg_7 ) if isinstance ( arg_2 , set ) : arg_8 = arg_2 else : arg_8 = set ( arg_2 ) for arg_9 in arg_2 : arg_10 = portItemfromSignal ( arg_9 , arg_4 ) arg_10 . registerInternSig ( arg_9 ) arg_4 . ports . append ( arg_10 ) arg_9 . hidden = False removeUnconnectedSignals ( arg_0 ) markVisibilityOfSignals ( arg_0 , arg_1 , arg_0 . signals , arg_8 ) for arg_12 in arg_3 . beforeHdlArchGeneration : arg_12 ( arg_0 ) arg_13 = Architecture ( arg_4 ) for arg_14 in statements_to_HWProcesses ( arg_0 . statements ) : arg_13 . processes . append ( arg_14 ) for arg_9 in arg_0 . signals : if arg_9 not in arg_8 and not arg_9 . hidden : arg_13 . variables . append ( arg_9 ) for arg_15 in arg_0 . subUnits : arg_13 . componentInstances . append ( arg_15 ) for arg_16 in distinctBy ( arg_0 . subUnits , lambda x : x . name ) : arg_13 . components . append ( arg_16 ) arg_0 . synthesised = True return [ arg_4 , arg_13 ]

Return a dict of keys that differ with another config object.


Question: Get an mro for a type or classic class

def Func ( arg_0 ) : if not isinstance ( arg_0 , type ) : class arg_0 ( arg_0 , object ) : pass return arg_0 . __mro__ [ 1 : ] return arg_0 . __mro__

Drop a node from the network

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


Question: Parse a zonefile into a dict

def Func ( arg_0 , arg_1 = False ) : arg_0 = remove_comments ( arg_0 ) arg_0 = flatten ( arg_0 ) arg_0 = remove_class ( arg_0 ) arg_0 = add_default_name ( arg_0 ) arg_2 = parse_lines ( arg_0 , arg_1 = arg_1 ) return arg_2

Default exchange proposal function, for replica exchange MC.

  With probability `prob_exchange` propose combinations of replica for exchange.
  When exchanging, create combinations of adjacent replicas in
  [Replica Exchange Monte Carlo](
  https://en.wikipedia.org/wiki/Parallel_tempering)

  ```
  exchange_fn = default_exchange_proposed_fn(prob_exchange=0.5)
  exchange_proposed = exchange_fn(num_replica=3)

  exchange_proposed.eval()
  ==> [[0, 1]]  # 1 exchange, 0 <--> 1

  exchange_proposed.eval()
  ==> []  # 0 exchanges
  ```

  Args:
    prob_exchange: Scalar `Tensor` giving probability that any exchanges will
      be generated.

  Returns:
    default_exchange_proposed_fn_: Python callable which take a number of
      replicas (a Python integer), and return combinations of replicas for
      exchange as an [n, 2] integer `Tensor`, `0 <= n <= num_replica // 2`,
      with *unique* values in the set `{0, ..., num_replica}`.


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

def Func ( arg_0 ) : arg_1 = arg_0 . _fd . read ( 1 ) if arg_1 == b'' : return 0 while ( bytearray ( arg_1 ) [ - 1 ] & 0x80 ) >> 7 == 1 : arg_2 = arg_0 . _fd . read ( 1 ) if arg_2 == b'' : raise EOFError ( 'unexpected EOF.' ) arg_1 += arg_2 arg_3 , arg_4 = decodeVarint ( arg_1 , 0 ) return arg_3


Question: Send a Set metric with the specified unique value

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 ) : if arg_0 . _should_send_metric ( arg_1 , arg_3 ) : arg_2 = str ( arg_2 ) arg_0 . _request ( Set ( arg_0 . _create_metric_name_for_request ( arg_1 ) , arg_2 , arg_3 ) . to_request ( ) )

Drop a node from the network

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


Question: Initialise the logging by adding an observer to the global log publisher .

def Func ( arg_0 ) : arg_1 = LogLevelFilterPredicate ( LogLevel . levelWithName ( arg_0 ) ) arg_1 . setLogLevelForNamespace ( 'twisted.web.client._HTTP11ClientFactory' , LogLevel . warn ) arg_2 = FilteringLogObserver ( textFileLogObserver ( sys . stdout ) , [ arg_1 ] ) globalLogPublisher . addObserver ( arg_2 )

Returns read only property for band nodata value, assuming single
        band rasters for now.


Question: Retrieve the last analog data value received for the specified pin .

def Func ( arg_0 , arg_1 ) : with arg_0 . data_lock : arg_2 = arg_0 . _command_handler . analog_response_table [ arg_1 ] [ arg_0 . _command_handler . RESPONSE_TABLE_PIN_DATA_VALUE ] return arg_2


Question: Obtain keying material for application use .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = _no_zero_allocator ( "unsigned char[]" , arg_2 ) arg_5 = _ffi . NULL arg_6 = 0 arg_7 = 0 if arg_3 is not None : arg_5 = arg_3 arg_6 = len ( arg_3 ) arg_7 = 1 arg_8 = _lib . SSL_Func ( arg_0 . _ssl , arg_4 , arg_2 , arg_1 , len ( arg_1 ) , arg_5 , arg_6 , arg_7 ) _openssl_assert ( arg_8 == 1 ) return _ffi . buffer ( arg_4 , arg_2 ) [ : ]

Remove `self` from the containing `DiscoItems` object.


Question: Script to find the header size of a filterbank file

def Func ( arg_0 ) : arg_1 = open ( arg_0 , 'rb' ) arg_1 . seek ( 0 ) arg_2 = arg_1 . read ( 1000 ) arg_3 = arg_2 . find ( 'HEADER_END' ) + len ( 'HEADER_END' ) return arg_3

Return True if we should retry. False otherwise.

  Args:
    exception: An exception to test for transience.

  Returns:
    True if we should retry. False otherwise.


Question: Delay one or more audio channels such that they start at the given positions .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , list ) : raise ValueError ( "positions must be a a list of numbers" ) if not all ( ( is_number ( arg_2 ) and arg_2 >= 0 ) for arg_2 in arg_1 ) : raise ValueError ( "positions must be positive nubmers" ) arg_3 = [ 'Func' ] arg_3 . extend ( [ '{:f}' . format ( arg_2 ) for arg_2 in arg_1 ] ) arg_0 . effects . extend ( arg_3 ) arg_0 . effects_log . append ( 'Func' ) return arg_0

This function will look at the local directory and pick out files that have the correct start name and
    summarize the results into one giant dict.

    :return: None


Question: Returns the full payload as a string .

def Func ( arg_0 ) : for arg_1 , arg_2 in iteritems ( arg_0 ) : arg_0 [ arg_1 ] = _transform ( arg_2 , key = ( arg_1 , ) ) arg_3 = { 'access_token' : SETTINGS [ 'access_token' ] , 'data' : arg_0 } return arg_3

This is a decorator that retries a function.

    Tries `n` times and catches a given tuple of `errors`.

    If the `n` retries are not enough, the error is reraised.

    If desired `waits` some seconds.

    Optionally takes a 'logger_name' of a given logger to print the caught error.


Question: r Return Daniell s periodogram .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = 'mean' , arg_4 = 1. , arg_5 = True , arg_6 = 'hamming' ) : arg_7 = speriodogram ( arg_0 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) if len ( arg_7 ) % 2 == 1 : arg_8 = 'real' else : arg_8 = 'complex' arg_9 = len ( arg_7 ) arg_10 = 2 * arg_1 + 1 if arg_8 == 'real' : arg_11 = np . ceil ( arg_7 . size / float ( arg_10 ) ) if arg_11 % 2 == 0 : arg_11 = arg_7 . size / arg_10 else : arg_11 = np . ceil ( arg_7 . size / float ( arg_10 ) ) if arg_11 % 2 == 1 : arg_11 = arg_7 . size / arg_10 arg_12 = np . zeros ( int ( arg_11 ) ) for arg_13 in range ( 0 , arg_12 . size ) : arg_14 = 0 for arg_15 in range ( arg_13 * arg_10 - arg_1 , arg_13 * arg_10 + arg_1 + 1 ) : if arg_15 > 0 and arg_15 < arg_9 : arg_14 += 1 arg_12 [ arg_13 ] += arg_7 [ arg_15 ] arg_12 [ arg_13 ] /= float ( arg_14 ) if arg_8 == 'complex' : arg_16 = np . linspace ( 0 , arg_4 , len ( arg_12 ) ) else : arg_17 = 1. / arg_4 arg_16 = np . linspace ( 0 , arg_4 / 2. , len ( arg_12 ) ) return arg_12 , arg_16

Reassemble a Binder object coming out of the database.


Question: Geodesic acceleration correction to the LM step .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . update_function ( arg_0 . param_vals ) arg_4 = arg_0 . calc_residuals ( ) . copy ( ) arg_3 = arg_0 . update_function ( arg_0 . param_vals + arg_2 ) arg_5 = arg_0 . calc_residuals ( ) . copy ( ) arg_3 = arg_0 . update_function ( arg_0 . param_vals - arg_2 ) arg_6 = arg_0 . calc_residuals ( ) . copy ( ) arg_7 = ( arg_6 + arg_5 - 2 * arg_4 ) arg_8 , arg_9 , arg_10 , arg_11 = np . linalg . lstsq ( arg_1 , np . dot ( arg_0 . J , arg_7 ) , rcond = arg_0 . min_eigval ) arg_8 *= - 0.5 return arg_8

Initialize bluez DBus communication.  Must be called before any other
        calls are made!


Question: export density to file using the given format .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = '"' ) : arg_5 = arg_0 . _get_Funcer ( arg_1 , arg_2 = arg_2 ) arg_5 ( arg_1 , arg_3 = arg_3 , arg_4 = arg_4 )

r"""Bernoulli likelihood sampling.

    Sample according to

    .. math::

        \mathbf y \sim \prod_{i=1}^n
        \text{Bernoulli}(\mu_i = \text{logit}(z_i))
        \mathcal N(~ o \mathbf 1 + \mathbf a^\intercal \boldsymbol\alpha;
        ~ (h^2 - v_c)\mathrm G^\intercal\mathrm G +
        (1-h^2-v_c)\mathrm I ~)

    using the canonical Logit link function to define the conditional Bernoulli
    mean :math:`\mu_i`.

    The causal :math:`\mathbf a` covariates and the corresponding effect-sizes
    are randomly draw according to the following idea. The ``causal_variants``,
    if given, are first mean-zero and std-one normalized and then having
    its elements divided by the squared-root the the number of variances::

        causal_variants = _stdnorm(causal_variants, axis=0)
        causal_variants /= sqrt(causal_variants.shape[1])

    The causal effect-sizes :math:`\boldsymbol\alpha` are draw from
    :math:`\{-1, +1\}` and subsequently normalized for mean-zero and std-one""

    Parameters
    ----------
    random_state : random_state
        Set the initial random state.

    Example
    -------

    .. doctest::

        >>> from glimix_core.random import bernoulli_sample
        >>> from numpy.random import RandomState
        >>> offset = 5
        >>> G = [[1, -1], [2, 1]]
        >>> bernoulli_sample(offset, G, random_state=RandomState(0))
        array([1., 1.])


Question: Output the positions of an image to a positions . dat file .

def Func ( arg_0 , arg_1 ) : with open ( arg_1 , 'w' ) as f : for arg_2 in arg_0 : f . write ( "%s\n" % arg_2 )

Initialize bluez DBus communication.  Must be called before any other
        calls are made!


Question: Prints the complete YAML .

def Func ( ) : arg_0 = requests . get ( TRELLO_API_DOC ) . content arg_1 = html . fromstring ( arg_0 ) arg_2 = arg_1 . xpath ( '//a[contains(@class, "reference internal")]/@href' ) arg_3 = [ requests . get ( TRELLO_API_DOC + u ) for u in arg_2 if u . endswith ( 'index.html' ) ] arg_4 = [ ] for arg_5 in arg_3 : arg_1 = html . fromstring ( arg_5 . content ) arg_6 = arg_1 . xpath ( '//div[@class="section"]/h2/..' ) for arg_7 in arg_6 : arg_8 = etree . tostring ( arg_7 ) . decode ( 'utf-8' ) arg_9 = html2text ( arg_8 ) . splitlines ( ) arg_10 = EP_DESC_REGEX . match ( arg_9 [ 0 ] ) if not arg_10 : continue arg_11 , arg_12 = arg_10 . groups ( ) arg_9 [ 0 ] = ' ' . join ( [ arg_11 , arg_12 ] ) arg_13 = b64encode ( gzip . compress ( '\n' . join ( arg_9 ) . encode ( 'utf-8' ) ) ) arg_4 . append ( ( arg_11 , arg_12 , arg_13 ) ) print ( yaml . dump ( create_tree ( arg_4 ) ) )


Question: Add a node to run on success .

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : return arg_0 . _assoc_or_create ( 'success' , arg_1 , arg_2 , ** arg_3 )

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


Question: Called when the power state changes .

def Func ( arg_0 , arg_1 ) : logger . debug ( 'Adapter state change: {0}' . format ( arg_1 ) ) if arg_1 == 5 : arg_0 . _powered_off . clear ( ) arg_0 . _powered_on . set ( ) elif arg_1 == 4 : arg_0 . _powered_on . clear ( ) arg_0 . _powered_off . set ( )

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


Question: Returns the authentication URL for this service .

def Func ( arg_0 , arg_1 = None , arg_2 = [ "name" , "email" , "language" , "username" ] ) : arg_1 = arg_1 or arg_0 . request . uri arg_3 = arg_0 . _openid_args ( arg_1 , arg_2 = arg_2 ) arg_0 . redirect ( arg_0 . _OPENID_ENDPOINT + "?" + urllib . urlencode ( arg_3 ) )

Combines all masks from a list of arrays, and logically ors them into a single mask


Question: Searches the PATH for the given command and returns its path

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : arg_1 = os . environ . get ( 'PATH' , '' ) . split ( os . pathsep ) if isinstance ( arg_1 , six . string_types ) : arg_1 = [ arg_1 ] if arg_2 is None : arg_2 = get_pathext ( ) arg_2 = [ arg_5 for arg_5 in arg_2 . lower ( ) . split ( os . pathsep ) if len ( arg_5 ) ] if os . path . splitext ( arg_0 ) [ 1 ] . lower ( ) in arg_2 : arg_2 = [ '' ] for arg_3 in arg_1 : arg_4 = os . path . join ( arg_3 , arg_0 ) for arg_5 in arg_2 : arg_6 = arg_4 + arg_5 if os . path . isfile ( arg_6 ) : return arg_6 if os . path . isfile ( arg_4 ) : return arg_4 raise BadCommand ( 'Cannot find command %r' % arg_0 )

Generate RENEWING time.

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

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


Question: Write DDL of table constraints to the output file

def Func ( arg_0 , arg_1 ) : arg_0 . f . write ( '\n' . join ( super ( PostgresFileWriter , arg_0 ) . Func ( arg_1 ) ) )

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


Question: r Return the longest common subsequence similarity of two strings .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_2 : return 1.0 elif not arg_1 or not arg_2 : return 0.0 return len ( arg_0 . lcsseq ( arg_1 , arg_2 ) ) / max ( len ( arg_1 ) , len ( arg_2 ) )

Run stochastic volatility model.

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

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

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

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


Question: Parse a contains validator which takes as the config a simple string to find

def Func ( arg_0 ) : if not isinstance ( arg_0 , basestring ) : raise TypeError ( "Contains input must be a simple string" ) arg_1 = ContainsValidator ( ) arg_1 . contains_string = arg_0 return arg_1

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


Question: Checks for horizontal spacing near commas and semicolons .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 . lines_without_raw_strings arg_5 = arg_1 . elided [ arg_2 ] if ( Search ( r',[^,\s]' , ReplaceAll ( r'\boperator\s*,\s*\(' , 'F(' , arg_5 ) ) and Search ( r',[^,\s]' , arg_4 [ arg_2 ] ) ) : arg_3 ( arg_0 , arg_2 , 'whitespace/comma' , 3 , 'Missing space after ,' ) if Search ( r';[^\s};\\)/]' , arg_5 ) : arg_3 ( arg_0 , arg_2 , 'whitespace/semicolon' , 3 , 'Missing space after ;' )

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: Get several graphs by their identifiers .

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] ) -> List [ BELGraph ] : return [ arg_0 . networks [ arg_4 ] for arg_4 in arg_1 ]

Creates and connects the underlying text widget.


Question: has this jwt been used?

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . jwts : return True arg_0 . jwts [ arg_1 ] = time . time ( ) return False

Gets the fuel prices for a specific fuel station.


Question: r Computes the equivalent noise bandwidth

def Func ( arg_0 ) : arg_1 = len ( arg_0 ) return arg_1 * np . sum ( arg_0 ** 2 ) / np . sum ( arg_0 ) ** 2

Validates API Root information. Raises errors for required
        properties.


Question: Creates a new price record

def Func ( arg_0 , arg_1 : arg_2 ) : if not arg_1 : raise ValueError ( "Cannot add price. The received model is null!" ) arg_3 = mappers . PriceMapper ( ) arg_4 = arg_3 . map_model ( arg_1 ) arg_0 . Func_entity ( arg_4 )

An intelligent wrapper for ``open``.

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

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

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

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

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

        Otherwise, use the specified coding.

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


Question: Return component by category name

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . comps : if arg_2 . category == arg_1 : return arg_2 return None

In-place multiplication

        :param multiplier: A matrix or vector to be multiplied
        :param axis: The dim along which 'multiplier' is multiplied
        :return: Nothing (as it performs in-place operations)


Question: Return an open file for reading the source of the code unit .

def Func ( arg_0 ) : if os . path . exists ( arg_0 . filename ) : return open_source ( arg_0 . filename ) arg_1 = arg_0 . file_locator . get_zip_data ( arg_0 . filename ) if arg_1 is not None : return StringIO ( arg_1 ) raise CoverageException ( "No source for code '%s'." % arg_0 . filename )

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


Question: Returns all entities present in the collection with attributes included .

def Func ( arg_0 , arg_1 ) : arg_0 . reload ( expand = True , arg_1 = arg_1 ) arg_2 = [ Entity ( arg_0 , r , arg_1 = arg_1 ) for r in arg_0 . _resources ] arg_0 . reload ( ) return arg_2

Sleep for the time specified in the exception. If not specified, wait
        for 60 seconds.


Question: Make a temporary python file return filename and filehandle .

def Func ( arg_0 , arg_1 = '.py' ) : arg_2 = tempfile . mkstemp ( arg_1 ) [ 1 ] arg_3 = open ( arg_2 , 'w' ) arg_3 . write ( arg_0 ) arg_3 . flush ( ) return arg_2 , arg_3

This function returns a dictionary representation of a docker-compose.yml file, based on assembled_specs from
    the spec_assembler, and port_specs from the port_spec compiler


Question: Returns a PDF response with a template rendered with the given context .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( 'filename' , None ) arg_4 = arg_2 . pop ( 'cmd_options' , None ) if issubclass ( arg_0 . response_class , PDFTemplateResponse ) : if arg_3 is None : arg_3 = arg_0 . get_filename ( ) if arg_4 is None : arg_4 = arg_0 . get_cmd_options ( ) return super ( PDFTemplateView , arg_0 ) . Func ( arg_1 = arg_1 , arg_3 = arg_3 , show_content_in_browser = arg_0 . show_content_in_browser , header_template = arg_0 . header_template , footer_template = arg_0 . footer_template , arg_4 = arg_4 , cover_template = arg_0 . cover_template , ** arg_2 ) else : return super ( PDFTemplateView , arg_0 ) . Func ( arg_1 = arg_1 , ** arg_2 )

Expand the rank of x up to static_event_rank times for broadcasting.

    The static event rank was checked to not be None at construction time.

    Args:
      x: A tensor to expand.
    Returns:
      The expanded tensor.


Question: Sets the main input channels of the pipeline and their forks .

def Func ( arg_0 , arg_1 ) : logger . debug ( "Setting raw inputs using raw input dict: {}" . format ( arg_1 ) ) arg_2 = [ ] for arg_3 , arg_4 in arg_1 . items ( ) : arg_2 . append ( arg_4 [ "channel_str" ] ) arg_5 = arg_0 . RAW_MAPPING [ arg_3 ] arg_0 . params [ arg_3 ] = { "default" : arg_5 [ "default_value" ] , "description" : arg_5 [ "description" ] } arg_7 = "set" if len ( arg_4 [ "raw_forks" ] ) == 1 else "into" arg_0 . forks . append ( "\n{}.{}{{ {} }}\n" . format ( arg_4 [ "channel" ] , arg_7 , ";" . join ( arg_4 [ "raw_forks" ] ) ) ) logger . debug ( "Setting raw inputs: {}" . format ( arg_2 ) ) logger . debug ( "Setting forks attribute to: {}" . format ( arg_0 . forks ) ) arg_0 . _context = { ** arg_0 . _context , ** { "forks" : "\n" . join ( arg_0 . forks ) , "main_inputs" : "\n" . join ( arg_2 ) } }

Return True if this new candidate representation satisfies all our overlap
    rules. Since we know that neighboring representations differ by at most
    one bit, we compute running overlaps.


Question: Convert a bitstring value of width bits to a signed integer representation .

def Func ( arg_0 , arg_1 ) : return Operators . ITEBV ( arg_1 , Bit ( arg_0 , arg_1 - 1 ) == 1 , GetNBits ( arg_0 , arg_1 ) - 2 ** arg_1 , GetNBits ( arg_0 , arg_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: This calculates the Matthews correlation coefficent .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ( arg_0 * arg_1 - arg_2 * arg_3 ) arg_5 = msqrt ( ( arg_0 + arg_2 ) * ( arg_0 + arg_3 ) * ( arg_1 + arg_2 ) * ( arg_1 + arg_3 ) ) if arg_5 > 0 : return arg_4 / arg_5 else : return np . nan

This function adds the given stream to the logger, but does not check with a ConnectorDB database
        to make sure that the stream exists. Use at your own risk.


Question: Learnable Deterministic distribution over positive reals .

def Func ( arg_0 , arg_1 = 1e-3 , arg_2 = None ) : with tf . compat . v1 . variable_scope ( None , default_name = "Func" ) : arg_3 = tf . compat . v1 . get_variable ( "unconstrained_loc" , arg_0 ) arg_4 = tf . maximum ( tf . nn . softplus ( arg_3 ) , arg_1 ) arg_5 = ed . Deterministic ( arg_4 = arg_4 , arg_2 = arg_2 ) return arg_5

Return an existing or new ConversationWidget.


Question: validate source directory names in components

def Func ( arg_0 , arg_1 ) : if arg_0 == arg_1 : return 'Module %s public include directory %s should not contain source files' % ( arg_1 , arg_0 ) elif arg_0 . lower ( ) in ( 'source' , 'src' ) and arg_0 != 'source' : return 'Module %s has non-standard source directory name: "%s" should be "source"' % ( arg_1 , arg_0 ) elif isPotentialTestDir ( arg_0 ) and arg_0 != 'test' : return 'Module %s has non-standard test directory name: "%s" should be "test"' % ( arg_1 , arg_0 ) elif not Source_Dir_Regex . match ( arg_0 ) : arg_2 = Source_Dir_Invalid_Regex . sub ( '' , arg_0 . lower ( ) ) if not arg_2 : arg_2 = 'source' return 'Module %s has non-standard source directory name: "%s" should be "%s"' % ( arg_1 , arg_0 , arg_2 ) else : return None

Sparse matrix roll

    This operation is equivalent to ``numpy.roll``, but operates on sparse matrices.

    Parameters
    ----------
    x : scipy.sparse.spmatrix or np.ndarray
        The sparse matrix input

    shift : int
        The number of positions to roll the specified axis

    axis : (0, 1, -1)
        The axis along which to roll.

    Returns
    -------
    x_rolled : same type as `x`
        The rolled matrix, with the same format as `x`

    See Also
    --------
    numpy.roll

    Examples
    --------
    >>> # Generate a random sparse binary matrix
    >>> X = scipy.sparse.lil_matrix(np.random.randint(0, 2, size=(5,5)))
    >>> X_roll = roll_sparse(X, 2, axis=0)  # Roll by 2 on the first axis
    >>> X_dense_r = roll_sparse(X.toarray(), 2, axis=0)  # Equivalent dense roll
    >>> np.allclose(X_roll, X_dense_r.toarray())
    True


Question: Add a variety of default schemes .

def Func ( ) : arg_0 = str . split if sys . version_info < ( 3 , 0 ) : arg_0 = unicode . split def pop_all ( arg_1 , arg_2 ) : for arg_3 in arg_2 : arg_1 . pop ( arg_3 ) global arg_4 arg_4 = copy . deepcopy ( sanscript . SCHEMES ) pop_all ( arg_4 , [ sanscript . ORIYA , sanscript . BENGALI , sanscript . GUJARATI ] ) arg_4 [ HK ] . update ( { 'vowels' : arg_0 ( """a A i I u U R RR lR lRR E ai O au""" ) + arg_0 ( """e o""" ) , 'marks' : arg_0 ( """A i I u U R RR lR lRR E ai O au""" ) + arg_0 ( """e o""" ) , 'consonants' : sanscript . SCHEMES [ HK ] [ 'consonants' ] + arg_0 ( """n2 r2 zh""" ) } ) arg_4 [ ITRANS ] . update ( { 'vowels' : arg_0 ( """a A i I u U R RR LLi LLI E ai O au""" ) + arg_0 ( """e o""" ) , 'marks' : arg_0 ( """A i I u U R RR LLi LLI E ai O au""" ) + arg_0 ( """e o""" ) , 'consonants' : sanscript . SCHEMES [ ITRANS ] [ 'consonants' ] + arg_0 ( """n2 r2 zh""" ) } ) pop_all ( arg_4 [ ITRANS ] . synonym_map , arg_0 ( """e o""" ) ) arg_4 [ OPTITRANS ] . update ( { 'vowels' : arg_0 ( """a A i I u U R RR LLi LLI E ai O au""" ) + arg_0 ( """e o""" ) , 'marks' : arg_0 ( """A i I u U R RR LLi LLI E ai O au""" ) + arg_0 ( """e o""" ) , 'consonants' : sanscript . SCHEMES [ OPTITRANS ] [ 'consonants' ] + arg_0 ( """n2 r2 zh""" ) } ) pop_all ( arg_4 [ OPTITRANS ] . synonym_map , arg_0 ( """e o""" ) )

Retrieve the last analog data value received for the specified pin.

        :param pin: Selected pin

        :return: The last value entered into the analog response table.


Question: Returns True if there are valid credentials for the current user and required scopes .

def Func ( arg_0 ) : arg_1 = _credentials_from_request ( arg_0 . request ) return ( arg_1 and not arg_1 . invalid and arg_1 . has_scopes ( arg_0 . _get_scopes ( ) ) )


Question: Display full version information .

def Func ( ) : click . echo ( 'Tower CLI %s' % __Func__ ) click . echo ( 'API %s' % CUR_API_VERSION ) try : arg_0 = client . get ( '/config/' ) except RequestException as ex : raise exc . TowerCLIError ( 'Could not connect to Ansible Tower.\n%s' % six . text_type ( ex ) ) arg_1 = arg_0 . json ( ) arg_2 = arg_1 . get ( 'license_info' , { } ) . get ( 'license_type' , 'open' ) if arg_2 == 'open' : arg_3 = 'AWX' else : arg_3 = 'Ansible Tower' click . echo ( '%s %s' % ( arg_3 , arg_1 [ 'Func' ] ) ) click . echo ( 'Ansible %s' % arg_1 [ 'ansible_Func' ] )

Return a normalized form of the pattern.

        Normalize the pattern by removing pattern type prefix if it
        exists in the pattern. Then return the pattern type and the
        pattern as a tuple of two strings.

        Arguments:
          pattern (str): Route pattern to match request paths

        Returns:
          tuple: Ruple of pattern type (str) and pattern (str)


Question: Handle display hook output .

def Func ( arg_0 , arg_1 ) : arg_0 . log . debug ( "pyout: %s" , arg_1 . get ( 'content' , '' ) ) if not arg_0 . _hidden and arg_0 . _is_from_this_session ( arg_1 ) : arg_2 = arg_1 [ 'content' ] [ 'data' ] arg_0 . _append_plain_text ( arg_2 + '\n' , before_prompt = True )

Retrieve the list of courses contained within this catalog.

        Only courses with active course runs are returned. A course run is considered active if it is currently
        open for enrollment, or will open in the future.


Question: Convert nearest upsampling layer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : print ( 'Converting upsample...' ) if arg_0 [ 'mode' ] != 'nearest' : raise AssertionError ( 'Cannot convert non-nearest upsampling' ) if arg_6 == 'short' : arg_7 = 'UPSL' + random_string ( 4 ) elif arg_6 == 'keep' : arg_7 = arg_1 else : arg_7 = arg_1 + str ( random . random ( ) ) if 'height_scale' in arg_0 : arg_8 = ( arg_0 [ 'height_scale' ] , arg_0 [ 'width_scale' ] ) elif len ( arg_3 ) == 2 : arg_8 = arg_4 [ arg_3 [ - 1 ] + '_np' ] [ - 2 : ] arg_9 = keras . layers . UpSampling2D ( size = arg_8 , name = arg_7 ) arg_4 [ arg_2 ] = arg_9 ( arg_4 [ arg_3 [ 0 ] ] )

Plots raw returns over time.

    Backtest returns are in green, and out-of-sample (live trading)
    returns are in red.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    live_start_date : datetime, optional
        The date when the strategy began live trading, after
        its backtest period. This date should be normalized.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

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


Question: If database output logging is enabled this saves all the outputs from the indicated prompt number to the database . It s called by run_cell after code has been executed .

def Func ( arg_0 , arg_1 ) : if ( not arg_0 . db_log_output ) or ( arg_1 not in arg_0 . output_hist_reprs ) : return arg_2 = arg_0 . output_hist_reprs [ arg_1 ] with arg_0 . db_output_cache_lock : arg_0 . db_output_cache . append ( ( arg_1 , arg_2 ) ) if arg_0 . db_cache_size <= 1 : arg_0 . save_flag . set ( )

Check that a binary operator is surrounded by exactly one space.


Question: Show the transaction as plain json

def Func ( arg_0 ) : if not arg_0 . _is_constructed ( ) or arg_0 . _is_require_reconstruction ( ) : arg_0 . constructTx ( ) return dict ( arg_0 )

Process data to produce velocity and dropout information.


Question: Load the public suffix database into the system .

def Func ( arg_0 ) : if not arg_1 . INTERN [ "psl_db" ] : arg_1 . INTERN [ "psl_db" ] = Dict ( ) . from_json ( File ( arg_0 . destination ) . read ( ) )

Submit the selected exercise to the server.


Question: Create a task for a given project ID .

def Func ( arg_0 , arg_1 , arg_2 = 30 , arg_3 = 0 , arg_4 = 0 ) : try : arg_5 = dict ( arg_0 = arg_0 , arg_1 = arg_1 , calibration = 0 , arg_3 = arg_3 , arg_2 = arg_2 , arg_4 = arg_4 ) arg_6 = _pybossa_req ( 'post' , 'task' , payload = arg_5 ) if arg_6 . get ( 'id' ) : return Task ( arg_6 ) else : return arg_6 except : raise


Question: Fetch information about a list of keywords .

def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) == 1 : arg_2 = arg_1 [ 0 ] else : arg_2 = ' ' . join ( [ k for k in arg_1 ] ) logger . info ( "Fetching Func for '%s'" , arg_2 ) arg_3 = { 'q' : arg_2 } arg_4 = arg_0 . fetch ( GOOGLE_SEARCH_URL , payload = arg_3 ) return arg_4 . text

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: The following update labels about mouse coordinates .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . authorized_display == True : try : arg_0 . display_the_graphic ( arg_0 . num_line , arg_0 . wavelength , arg_0 . data_wanted , arg_0 . information ) arg_0 . ui . mouse_coordinate . setText ( "(%0.3f, %0.3f)" % ( arg_1 , arg_2 ) ) except : pass

display connection info, and store ports


Question: Pauses the thread for a specified time .

def Func ( arg_0 , arg_1 ) : arg_0 . _Func = Event ( ) return not arg_0 . _Func . Func ( arg_1 )

Accept a publication request at form value 'epub


Question: Creates a site

def Func ( arg_0 , arg_1 = { } ) : arg_2 = "/2/sites/" arg_3 = arg_1 arg_4 = arg_0 . _post_resource ( arg_2 , arg_3 ) return arg_0 . site_from_json ( arg_4 [ "site" ] )

Set x, y and z labels according to one of conventions.

        Args:
            convention (str):
                One of the following:
                    - "original"
                    - "xyz"
                    - "sx sy sz"
                    - "01"
                    - "polarization jones"
                    - "polarization jones letters"
                    see also: http://en.wikipedia.org/wiki/Jones_calculus
                    - "polarization stokes"
                    see also: http://en.wikipedia.org/wiki/Stokes_parameters
        Raises:
            Exception: If convention is not valid.


Question: Raises OrderError if no package or file defined . Raises CardinalityError if more than one type set . Raises SPDXValueError if type is unknown .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { 'SOURCE' : arg_5 . FileType . SOURCE , 'BINARY' : arg_5 . FileType . BINARY , 'ARCHIVE' : arg_5 . FileType . ARCHIVE , 'OTHER' : arg_5 . FileType . OTHER } if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if not arg_0 . file_type_set : arg_0 . file_type_set = True if arg_2 in arg_3 . keys ( ) : arg_0 . file ( arg_1 ) . type = arg_3 [ arg_2 ] return True else : raise SPDXValueError ( 'File::Type' ) else : raise CardinalityError ( 'File::Type' ) else : raise OrderError ( 'File::Type' )

Rename this conversation.

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

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be renamed.


Question: Return datetime object of modified time of machine file . Return now if not a file .

def Func ( arg_0 ) : if arg_0 . _path : arg_1 = os . stat ( arg_0 . _path ) return datetime . utcfromtimestamp ( arg_1 . st_mtime ) else : return datetime . now ( )

Drain will put a connection into a drain state. All subscriptions will
        immediately be put into a drain state. Upon completion, the publishers
        will be drained and can not publish any additional messages. Upon draining
        of the publishers, the connection will be closed. Use the `closed_cb'
        option to know when the connection has moved from draining to closed.

        If a sid is passed, just the subscription with that sid will be drained
        without closing the connection.


Question: Stop the timer

def Func ( arg_0 ) -> float : arg_0 . Func_time = time . time ( ) return arg_0 . Func_time - arg_0 . start_time - arg_0 . offset

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Gets the root argument parser object .

def Func ( arg_0 ) : return arg_0 . arg_parse_class ( description = arg_0 . get_help ( ) , formatter_class = arg_0 . get_formatter_class ( ) )

Update the activity message for the current user.

        Args:
            mood (str): new mood message


Question: Sets the internal state of the df

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_0 . description = arg_1 [ 'description' ] if arg_2 : arg_0 . _index_start , arg_0 . _index_end = arg_1 [ 'active_range' ] arg_0 . _length_unfiltered = arg_0 . _index_end - arg_0 . _index_start if 'renamed_columns' in arg_1 : for arg_7 , arg_8 in arg_1 [ 'renamed_columns' ] : arg_0 . _rename ( arg_7 , arg_8 ) for arg_9 , arg_10 in arg_1 [ 'functions' ] . items ( ) : arg_0 . add_function ( arg_9 , vaex . serialize . from_dict ( arg_10 ) ) if 'column_names' in arg_1 : arg_0 . column_names = [ ] arg_0 . virtual_columns = collections . OrderedDict ( ) for arg_9 , arg_10 in arg_1 [ 'virtual_columns' ] . items ( ) : arg_0 [ arg_9 ] = arg_0 . _expr ( arg_10 ) arg_0 . column_names = arg_1 [ 'column_names' ] else : arg_0 . virtual_columns = collections . OrderedDict ( ) for arg_9 , arg_10 in arg_1 [ 'virtual_columns' ] . items ( ) : arg_0 [ arg_9 ] = arg_0 . _expr ( arg_10 ) arg_0 . variables = arg_1 [ 'variables' ] import astropy arg_14 = { key : astropy . units . Unit ( arg_10 ) for key , arg_10 in arg_1 [ "units" ] . items ( ) } arg_0 . units . update ( arg_14 ) for arg_9 , arg_15 in arg_1 [ 'selections' ] . items ( ) : if arg_15 is None : arg_16 = None else : arg_16 = selections . selection_from_dict ( arg_15 ) arg_0 . set_selection ( arg_16 , arg_9 = arg_9 )

Get base-64 encoded data as a string for the given image. Fallback to return
    fallback_image_file if cannot get the image data or img is None.
    @param {Image} img - The PIL Image to get src data for
    @param {String} fallback_image_file - The filename of the image file,
        to be used when image data capture fails
    @return {String} The base-64 encoded image data string, or path to the file
        itself if not supported.


Question: Retrieves the current results and updates the model s record in the Model database .

def Func ( arg_0 ) : arg_1 = arg_0 . _getMetrics ( ) arg_2 = dict ( [ ( k , arg_1 [ k ] ) for k in arg_0 . _reportMetricLabels ] ) arg_1 = arg_0 . _getMetrics ( ) arg_3 = dict ( ) if arg_0 . _optimizeKeyPattern is not None : arg_3 [ arg_0 . _optimizedMetricLabel ] = arg_1 [ arg_0 . _optimizedMetricLabel ] arg_5 = json . dumps ( ( arg_1 , arg_3 ) ) arg_0 . _jobsDAO . modelUpdateResults ( arg_0 . _modelID , arg_5 = arg_5 , metricValue = arg_3 . values ( ) [ 0 ] , numRecords = ( arg_0 . _currentRecordIndex + 1 ) ) arg_0 . _logger . debug ( "Model Results: modelID=%s; numRecords=%s; results=%s" % ( arg_0 . _modelID , arg_0 . _currentRecordIndex + 1 , arg_5 ) ) return

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

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

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


Question: Returns the new multisig address .

def Func ( arg_0 ) : if not arg_0 . _digests : raise ValueError ( 'Must call ``add_digest`` at least once ' 'before calling ``Func``.' , ) if not arg_0 . _address : arg_1 = [ 0 ] * HASH_LENGTH arg_0 . _sponge . squeeze ( arg_1 ) arg_0 . _address = MultisigAddress . from_trits ( arg_1 , digests = arg_0 . _digests [ : ] , ) return arg_0 . _address

True if the credential is expired or invalid.

        If the token_expiry isn't set, we assume the token doesn't expire.


Question: Like os . makedirs but keeps quiet if path already exists

def Func ( arg_0 , * arg_1 ) : if os . path . exists ( arg_0 ) : return os . makedirs ( arg_0 , * arg_1 )

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: Returns task data from local data .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , int ) : arg_2 = arg_6 ( arg_1 ) elif isinstance ( arg_1 , basestring ) : arg_2 = arg_1 else : arg_2 = arg_1 [ 'id' ] arg_3 = arg_0 . _task_data_key ( ) arg_4 = arg_0 . data . get ( arg_3 , { } ) arg_5 = arg_4 . get ( arg_6 ( arg_2 ) , { } ) arg_4 [ arg_6 ( arg_2 ) ] = arg_5 return arg_5

Creates the variational distribution for LDA.

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

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


Question: Determine paths automatically and a little intelligently

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = False ) : arg_0 . project_dir = Path ( os . getenv ( 'PWD' ) or os . getcwd ( ) ) arg_5 = arg_0 . get_distribution ( ) if arg_5 : arg_0 . project_name = arg_5 . get_name ( ) else : arg_0 . project_name = arg_0 . project_dir . name if os . path . isdir ( arg_0 . project_dir / "src" ) : arg_7 = arg_0 . project_dir / "src" else : arg_7 = arg_0 . project_dir arg_8 = False if not arg_1 : arg_1 = arg_0 . project_name . replace ( "-" , "_" ) def get_matches ( arg_9 ) : arg_10 = [ n for n in os . listdir ( arg_7 ) if os . path . isdir ( arg_7 / n ) ] return difflib . get_close_matches ( arg_9 , arg_10 , n = 1 , cutoff = 0.8 ) arg_11 = get_matches ( arg_1 ) if not arg_11 and "_" in arg_1 : arg_12 = "_" . join ( arg_1 . split ( "_" ) [ 1 : ] ) arg_11 = get_matches ( arg_12 ) if not arg_11 : if arg_2 : arg_13 = arg_7 / arg_1 arg_8 = True if not arg_3 : print ( "Creating package directory at %s" % arg_13 ) os . mkdir ( arg_13 ) else : print ( "Would have created package directory at %s" % arg_13 ) else : raise CommandError ( "Could not guess the package name. Specify it using --name." ) else : arg_1 = arg_11 [ 0 ] arg_0 . package_name = arg_1 arg_0 . package_dir = arg_7 / arg_1 if not os . path . exists ( arg_0 . package_dir ) and not arg_8 : raise CommandError ( "Package directory did not exist at %s. Perhaps specify it using --name" % arg_0 . package_dir )

Send request to API.

        :param method: `str` method name.
        :returns: `dict` response.


Question: obtain the shory geoserver version

def Func ( arg_0 ) : arg_1 = arg_0 . get_version ( ) arg_2 = re . compile ( r'[^\d.]+' ) return arg_2 . sub ( '' , arg_1 ) . strip ( '.' )

Get course's duration as a timedelta.

        Arguments:
            obj (CourseOverview): CourseOverview object

        Returns:
            (timedelta): Duration of a course.


Question: Disable event loop integration with PyQt4 .

def Func ( arg_0 ) : if arg_0 . _apps . has_key ( arg_2 ) : arg_0 . _apps [ arg_2 ] . _in_event_loop = False arg_0 . clear_inputhook ( )

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: Find and load the build backend

def Func ( ) : arg_0 = os . environ . get ( 'PEP517_BACKEND_PATH' ) if arg_0 : arg_1 = arg_0 . split ( os . pathsep ) arg_2 . path [ : 0 ] = arg_1 arg_4 = os . environ [ 'PEP517_BUILD_BACKEND' ] arg_5 , arg_6 , arg_7 = arg_4 . partition ( ':' ) try : arg_8 = import_module ( arg_5 ) except ImportError : raise BackendUnavailable ( traceback . format_exc ( ) ) if arg_0 : if not any ( contained_in ( arg_8 . __file__ , arg_3 ) for arg_3 in arg_1 ) : raise BackendInvalid ( "Backend was not loaded from backend-path" ) if arg_7 : for arg_9 in arg_7 . split ( '.' ) : arg_8 = getattr ( arg_8 , arg_9 ) return arg_8

Retrieve the list of courses contained within this catalog.

        Only courses with active course runs are returned. A course run is considered active if it is currently
        open for enrollment, or will open in the future.


Question: Discover versatileimagefield . py modules .

def Func ( ) : from importlib import import_module from django . apps import apps from django . utils . module_loading import module_has_submodule for arg_0 in apps . get_app_configs ( ) : try : arg_1 = copy . copy ( arg_3 . _sizedimage_registry ) arg_2 = copy . copy ( arg_3 . _filter_registry ) import_module ( '%s.versatileimagefield' % arg_0 . name ) except Exception : arg_3 . _sizedimage_registry = arg_1 arg_3 . _filter_registry = arg_2 if module_has_submodule ( arg_0 . module , 'versatileimagefield' ) : raise

Read attribute from sysfs and return as string