Question: Return a date time or datetime converted to a datetime in the given timezone . If when is a datetime and has no timezone it is assumed to be local time . Date and time objects are also assumed to be UTC . The tz value defaults to UTC . Raise TypeError if when cannot be converted to a datetime .

def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return None arg_0 = to_datetime ( arg_0 ) if arg_0 . tzinfo is None : arg_0 = arg_0 . replace ( tzinfo = localtz ) return arg_0 . astimezone ( arg_1 or utc )


Question: Parse the command line for overriding the defaults

def Func ( arg_0 ) : arg_1 = dict ( ) for arg_2 in arg_0 : arg_3 = arg_2 . split ( "=" ) if len ( arg_3 ) != 2 : raise Exception ( "Invalid config property format (%s) expected key=value" % arg_2 ) if arg_3 [ 1 ] in [ 'true' , 'True' , 'TRUE' ] : arg_1 [ arg_3 [ 0 ] ] = True elif arg_3 [ 1 ] in [ 'false' , 'False' , 'FALSE' ] : arg_1 [ arg_3 [ 0 ] ] = False else : arg_1 [ arg_3 [ 0 ] ] = arg_3 [ 1 ] return arg_1


Question: Award a bid on a project

def Func ( arg_0 , arg_1 ) : arg_2 = { 'Content-Type' : 'application/x-www-form-urlencoded' } arg_3 = { 'action' : 'award' } arg_4 = 'bids/{}' . format ( arg_1 ) arg_5 = make_put_request ( arg_0 , arg_4 , arg_2 = arg_2 , params_data = arg_3 ) arg_6 = arg_5 . json ( ) if arg_5 . status_code == 200 : return arg_6 [ 'status' ] else : arg_6 = arg_5 . json ( ) raise BidNotAwardedException ( message = arg_6 [ 'message' ] , error_code = arg_6 [ 'error_code' ] , request_id = arg_6 [ 'request_id' ] )

Stop the timer

        Returns:
            The time the timer was stopped


Question: Get filepaths with supported extensions from given filepaths .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ( 'inf' ) ) : arg_4 = [ ] for arg_5 in arg_0 : if os . name == 'nt' and CYGPATH_RE . match ( arg_5 ) : arg_5 = convert_cygwin_path ( arg_5 ) if os . path . isdir ( arg_5 ) : for arg_6 , arg_7 , arg_8 in walk_depth ( arg_5 , arg_2 ) : for arg_9 in arg_8 : if arg_9 . lower ( ) . endswith ( arg_1 ) : arg_4 . append ( os . path . join ( arg_6 , arg_9 ) ) elif os . path . isfile ( arg_5 ) and arg_5 . lower ( ) . endswith ( arg_1 ) : arg_4 . append ( arg_5 ) return arg_4

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: Return a value check function which raises a value error if the value is not in a pre - defined enumeration of values .

def Func ( * arg_0 ) : assert len ( arg_0 ) > 0 , 'at least one argument is required' if len ( arg_0 ) == 1 : arg_1 = arg_0 [ 0 ] else : arg_1 = arg_0 def checker ( arg_2 ) : if arg_2 not in arg_1 : raise ValueError ( arg_2 ) return checker

The 1D index mappings between the unmasked sparse-grid and masked sparse grid.


Question: The Jinja loader for this package bound object .

def Func ( arg_0 ) : if arg_0 . template_folder is not None : return FileSystemLoader ( os . path . join ( arg_0 . root_path , arg_0 . template_folder ) )

Returns participation data for the given sis_course_id.

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


Question: Starts Cloud SQL Proxy .

def Func ( arg_0 ) : arg_0 . _download_sql_proxy_if_needed ( ) if arg_0 . sql_proxy_process : raise AirflowException ( "The sql proxy is already running: {}" . format ( arg_0 . sql_proxy_process ) ) else : arg_1 = [ arg_0 . sql_proxy_path ] arg_1 . extend ( arg_0 . command_line_parameters ) try : arg_0 . log . info ( "Creating directory %s" , arg_0 . cloud_sql_proxy_socket_directory ) os . makedirs ( arg_0 . cloud_sql_proxy_socket_directory ) except OSError : pass arg_1 . extend ( arg_0 . _get_credential_parameters ( ) ) arg_0 . log . info ( "Running the command: `%s`" , " " . join ( arg_1 ) ) arg_0 . sql_proxy_process = Popen ( arg_1 , stdin = PIPE , stdout = PIPE , stderr = PIPE ) arg_0 . log . info ( "The pid of cloud_sql_proxy: %s" , arg_0 . sql_proxy_process . pid ) while True : arg_3 = arg_0 . sql_proxy_process . stderr . readline ( ) . decode ( 'utf-8' ) arg_4 = arg_0 . sql_proxy_process . poll ( ) if arg_3 == '' and arg_4 is not None : arg_0 . sql_proxy_process = None raise AirflowException ( "The cloud_sql_proxy finished early with return code {}!" . format ( arg_4 ) ) if arg_3 != '' : arg_0 . log . info ( arg_3 ) if "googleapi: Error" in arg_3 or "invalid instance name:" in arg_3 : arg_0 . stop_proxy ( ) raise AirflowException ( "Error when starting the cloud_sql_proxy {}!" . format ( arg_3 ) ) if "Ready for new connections" in arg_3 : return

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


Question: Resolves item s URL .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or arg_0 . current_page_context arg_3 = arg_0 . resolve_var if not isinstance ( arg_1 , MODEL_TREE_ITEM_CLASS ) : arg_1 = arg_3 ( arg_1 , arg_2 ) arg_4 = arg_0 . _items_urls . get ( arg_1 ) if arg_4 is not None : return arg_4 if arg_1 . urlaspattern : Func = arg_1 . url arg_6 = Func arg_7 = [ ] if ' ' in Func : arg_6 = Func . split ( ' ' ) for arg_8 in arg_6 [ 1 : ] : arg_9 = arg_3 ( arg_8 ) arg_7 . append ( '"%s"' % arg_9 ) arg_6 = arg_6 [ 0 ] . strip ( '"\' ' ) arg_10 = "'%s' %s" % ( arg_6 , ' ' . join ( arg_7 ) ) else : arg_10 = '%s' % arg_1 . url if arg_1 . urlaspattern : arg_11 = 'url %s as item.url_resolved' % arg_10 url_tag ( Parser ( None ) , Token ( token_type = TOKEN_BLOCK , contents = arg_11 ) ) . render ( arg_2 ) arg_4 = arg_2 [ 'item.url_resolved' ] or UNRESOLVED_ITEM_MARKER else : arg_4 = arg_10 arg_0 . _items_urls [ arg_1 ] = arg_4 return arg_4

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: Sets all the foci within state to values taken from iterable .

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . _is_kind ( Setter ) : raise TypeError ( 'Must be an instance of Setter to .Func()' ) arg_3 = iter ( arg_2 ) arg_4 = lambda a : Identity ( a ) arg_5 = lambda a : Identity ( next ( arg_3 ) ) return arg_0 . apply ( arg_5 , arg_4 , arg_1 ) . unwrap ( )

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


Question: Set this email address as the user s primary email .

def Func ( arg_0 ) : arg_1 = EmailAddress . objects . filter ( arg_2 = True , user = arg_0 . user ) arg_1 = arg_1 . exclude ( pk = arg_0 . pk ) with transaction . atomic ( ) : arg_1 . update ( arg_2 = False ) arg_0 . is_primary = True arg_0 . save ( ) logger . info ( "Set %s as the primary email address for %s." , arg_0 . email , arg_0 . user , )

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


Question: Delete an existing table from the dataset ; If the table does not exist return an error unless ignore_if_missing is set to True .

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 , arg_4 , arg_5 = _split_tablename ( table_input = arg_1 , default_project_id = arg_0 . project_id ) try : arg_0 . service . tables ( ) . delete ( projectId = arg_3 , datasetId = arg_4 , tableId = arg_5 ) . execute ( num_retries = arg_0 . num_retries ) arg_0 . log . info ( 'Deleted table %s:%s.%s.' , arg_3 , arg_4 , arg_5 ) except HttpError : if not arg_2 : raise Exception ( 'Table deletion failed. Table does not exist.' ) else : arg_0 . log . info ( 'Table does not exist. Skipping.' )


Question: Given an id get the corresponding file info relative path joined with file name .

def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_0 . walk_files_info ( ) : if arg_3 [ 'id' ] == arg_1 : return arg_2 return None

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


Question: Calculates the autocorr of mag series for specific lag .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = nparange ( 1 , arg_2 - arg_1 ) arg_6 = ( arg_0 [ arg_5 ] - arg_3 ) * ( arg_0 [ arg_5 + arg_1 ] - arg_3 ) arg_7 = ( 1.0 / ( ( arg_2 - arg_1 ) * arg_4 ) ) * npsum ( arg_6 ) return arg_7

Test whether a stream can be written to.


Question: Return a new interval shifted by time from self

def Func ( arg_0 , arg_1 : arg_2 ) -> 'Interval' : return Interval ( arg_0 . _begin + arg_1 , arg_0 . _end + arg_1 )

Dumps and loads a database snapshot simultaneously.
        Requires that the destination server has direct database access
        to the source server.

        This is better than a serial dump+load when:
        1. The network connection is reliable.
        2. You don't need to save the dump file.

        The benefits of this over a dump+load are:
        1. Usually runs faster, since the load and dump happen in parallel.
        2. Usually takes up less disk space since no separate dump file is
            downloaded.


Question: r Evaluate a chirp signal at time t .

def Func ( arg_0 , arg_1 = 0. , arg_2 = 1. , arg_3 = 100. , arg_4 = 'linear' , arg_5 = 0 ) : arg_6 = [ 'linear' , 'quadratic' , 'logarithmic' ] if arg_4 not in arg_6 : raise ValueError ( "Invalid form. Valid form are %s" % arg_6 ) arg_0 = numpy . array ( arg_0 ) arg_5 = 2. * pi * arg_5 / 360. if arg_4 == "linear" : arg_7 = pi * ( arg_3 - arg_1 ) / arg_2 arg_8 = 2. * pi * arg_1 arg_9 = numpy . cos ( arg_7 * arg_0 ** 2 + arg_8 * arg_0 + arg_5 ) elif arg_4 == "quadratic" : arg_7 = ( 2 / 3. * pi * ( arg_3 - arg_1 ) / arg_2 / arg_2 ) arg_8 = 2. * pi * arg_1 arg_9 = numpy . cos ( arg_7 * arg_0 ** 3 + arg_8 * arg_0 + arg_5 ) elif arg_4 == "logarithmic" : arg_7 = 2. * pi * arg_2 / numpy . log ( arg_3 - arg_1 ) arg_8 = 2. * pi * arg_1 arg_10 = ( arg_3 - arg_1 ) ** ( 1. / arg_2 ) arg_9 = numpy . cos ( arg_7 * arg_10 ** arg_0 + arg_8 * arg_0 + arg_5 ) return arg_9

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Pick n samples from seq at random with replacement with the probability of each element in proportion to its corresponding weight .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = weighted_sampler ( arg_0 , arg_1 ) return [ arg_3 ( ) for arg_4 in range ( arg_2 ) ]

This method is called before first step of simulation.


Question: r Return specificity .

def Func ( arg_0 ) : if arg_0 . _tn + arg_0 . _fp == 0 : return float ( 'NaN' ) return arg_0 . _tn / ( arg_0 . _tn + arg_0 . _fp )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Design an IIR bandstop filter using scipy . signal . iirdesign . The filter order is determined based on f_pass Hz f_stop Hz and the desired stopband attenuation d_stop in dB all relative to a sampling rate of fs Hz . Mark Wickert October 2016

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = 1.00 , arg_7 = 'butter' ) : arg_8 , arg_9 = signal . iirdesign ( [ 2 * float ( arg_0 ) / arg_6 , 2 * float ( arg_3 ) / arg_6 ] , [ 2 * float ( arg_1 ) / arg_6 , 2 * float ( arg_2 ) / arg_6 ] , arg_4 , arg_5 , arg_7 = arg_7 , output = 'ba' ) arg_10 = signal . iirdesign ( [ 2 * float ( arg_0 ) / arg_6 , 2 * float ( arg_3 ) / arg_6 ] , [ 2 * float ( arg_1 ) / arg_6 , 2 * float ( arg_2 ) / arg_6 ] , arg_4 , arg_5 , arg_7 = arg_7 , output = 'sos' ) arg_11 = 'IIR ' + arg_7 + ' order' print ( '%s = %d.' % ( arg_11 , len ( arg_9 ) - 1 ) ) return arg_8 , arg_9 , arg_10

List all events occurring at or after a timestamp.


Question: Fetch all tags for repository from Github .

def Func ( arg_0 ) : arg_1 = arg_0 . options . verbose arg_2 = arg_0 . github arg_3 = arg_0 . options . user arg_4 = arg_0 . options . project if arg_1 : print ( "Fetching tags..." ) arg_5 = [ ] arg_6 = 1 while arg_6 > 0 : if arg_1 > 2 : print ( "." , end = "" ) arg_7 , arg_8 = arg_2 . repos [ arg_3 ] [ arg_4 ] . tags . get ( arg_6 = arg_6 , per_page = PER_PAGE_NUMBER ) if arg_7 == 200 : arg_5 . extend ( arg_8 ) else : arg_0 . raise_GitHubError ( arg_7 , arg_8 , arg_2 . getheaders ( ) ) arg_6 = NextPage ( arg_2 ) if arg_1 > 2 : print ( "." ) if len ( arg_5 ) == 0 : if not arg_0 . options . quiet : print ( "Warning: Can't find any tags in repo. Make sure, that " "you push tags to remote repo via 'git push --tags'" ) exit ( ) if arg_1 > 1 : print ( "Found {} tag(s)" . format ( len ( arg_5 ) ) ) return arg_5

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: Clears the state of the KNNClassifier .

def Func ( arg_0 ) : arg_0 . _Memory = None arg_0 . _numPatterns = 0 arg_0 . _M = None arg_0 . _categoryList = [ ] arg_0 . _partitionIdList = [ ] arg_0 . _partitionIdMap = { } arg_0 . _finishedLearning = False arg_0 . _iterationIdx = - 1 if arg_0 . maxStoredPatterns > 0 : assert arg_0 . useSparseMemory , ( "Fixed capacity KNN is implemented only " "in the sparse memory mode" ) arg_0 . fixedCapacity = True arg_0 . _categoryRecencyList = [ ] else : arg_0 . fixedCapacity = False arg_0 . _protoSizes = None arg_0 . _s = None arg_0 . _vt = None arg_0 . _nc = None arg_0 . _mean = None arg_0 . _specificIndexTraining = False arg_0 . _nextTrainingIndices = None

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


Question: Get it on .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] try : arg_4 = npchoice ( [ 1 , 2 ] , 1 , p = [ 0.8 , 0.2 ] ) [ 0 ] for arg_5 in range ( arg_4 ) : arg_6 = God ( arg_1 , arg_2 ) arg_3 . append ( arg_6 ) send_birth_announcement ( arg_1 , arg_2 , arg_6 ) except ValueError : print ( "Breeding error occurred. Likely the generator ran out of names." ) return arg_3

Decode the data passed in and potentially flush the decoder.


Question: Convert an array of time durations in seconds to the specified time unit .

def Func ( arg_0 , arg_1 ) : if arg_1 == 'minutes' : return list ( map ( lambda x : x * 1.0 / 60 , arg_0 ) ) elif arg_1 == 'hours' : return list ( map ( lambda x : x * 1.0 / ( 60 * 60 ) , arg_0 ) ) elif arg_1 == 'days' : return list ( map ( lambda x : x * 1.0 / ( 24 * 60 * 60 ) , arg_0 ) ) return arg_0

returns the classified labeling of record


Question: Handles an OAuth callback .

def Func ( arg_0 , arg_1 ) : @ wraps ( arg_1 ) def decorated ( * arg_2 , ** arg_3 ) : log . warn ( '@Func is deprecated in favor of ' 'authorized_response' ) arg_4 = arg_0 . authorized_response ( ) return arg_1 ( * ( ( arg_4 , ) + arg_2 ) , ** arg_3 ) return decorated

Test if this module ignores the file at "path", which must be a
            path relative to the root of the module.

            If a file is within a directory that is ignored, the file is also
            ignored.


Question: Visualization of a shortest path between two nodes .

def Func ( arg_0 , arg_1 , Func ) : def end ( arg_3 ) : arg_4 = arg_3 . r * 0.35 arg_0 . _ctx . oval ( arg_3 . x - arg_4 , arg_3 . y - arg_4 , arg_4 * 2 , arg_4 * 2 ) if Func and len ( Func ) > 1 and arg_0 . stroke : arg_0 . _ctx . nofill ( ) arg_0 . _ctx . stroke ( arg_0 . stroke . r , arg_0 . stroke . g , arg_0 . stroke . b , arg_0 . stroke . a ) if arg_0 . name != DEFAULT : arg_0 . _ctx . strokewidth ( arg_0 . strokewidth ) else : arg_0 . _ctx . strokewidth ( arg_0 . strokewidth * 2 ) arg_5 = True for arg_6 in Func : arg_3 = arg_1 [ arg_6 ] if arg_5 : arg_5 = False arg_0 . _ctx . beginpath ( arg_3 . x , arg_3 . y ) end ( arg_3 ) else : arg_0 . _ctx . lineto ( arg_3 . x , arg_3 . y ) arg_0 . _ctx . endpath ( ) end ( arg_3 )

Register a file reader for use in parse_config_file.

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

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

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

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

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


Question: Check whether given keyboard character is a single character .

def Func ( arg_0 ) : if not arg_0 : return False if len ( arg_0 ) == 1 : return True return arg_0 . count ( '<' ) == 1 and arg_0 . count ( '>' ) == 1 and arg_0 [ 0 ] == '<' and arg_0 [ - 1 ] == '>'


Question: Can the elements of a sequence .

def Func ( arg_0 ) : if istype ( arg_0 , sequence_types ) : arg_1 = type ( arg_0 ) return arg_1 ( [ can ( arg_2 ) for arg_2 in arg_0 ] ) else : return arg_0

Updates an Event Hub.

        hub_name:
            Name of event hub.
        hub:
            Optional. Event hub properties. Instance of EventHub class.
        hub.message_retention_in_days:
            Number of days to retain the events for this Event Hub.


Question: Return network output .

def Func ( arg_0 , * arg_1 ) : arg_0 . _compile ( ) arg_2 = arg_0 . _Func ( * arg_1 ) if arg_0 . _output_keys : return MapDict ( dict ( zip ( arg_0 . _output_keys , arg_2 ) ) ) else : return arg_2

Remove hidden notes and tag a CERN if detected.


Question: Get the resources corresponding to a given query .

def Func ( arg_0 , Func , arg_2 = None ) : arg_3 = dict ( ) arg_3 [ 'search' ] = Func if arg_2 : arg_3 [ 'token' ] = arg_2 arg_4 = arg_0 . request ( 'midas.resource.search' , arg_3 ) return arg_4

Update the profile picture for the current user.

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


Question: Convert dummy variable into numerical variables

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . columns . values . tolist ( ) arg_4 = [ ] for arg_5 in arg_2 : arg_6 = arg_5 . get ( 'col' ) arg_7 = arg_5 . get ( 'mapping' ) arg_8 = arg_3 . index ( arg_7 . columns [ 0 ] ) arg_1 . insert ( arg_8 , arg_6 , 0 ) arg_9 = arg_7 . index [ arg_7 . index > 0 ] for arg_10 in range ( arg_9 . shape [ 0 ] ) : arg_11 = arg_7 . columns [ arg_10 ] arg_12 = arg_9 [ arg_10 ] arg_1 . loc [ arg_1 [ arg_11 ] == 1 , arg_6 ] = arg_12 arg_4 . append ( arg_11 ) arg_1 . drop ( arg_7 . columns , axis = 1 , inplace = True ) arg_3 = arg_1 . columns . values . tolist ( ) return arg_1

Computes the temporal coverage of each source feed

    Parameters
    ----------
    gtfs: gtfspy.GTFS object
    stats: dict
        where to append the stats

    Returns
    -------
    stats: dict


Question: This writes the lcdict to a Python pickle .

def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = '%s-keplc.pkl' % arg_0 [ 'objectid' ] . replace ( ' ' , '-' ) with open ( arg_1 , 'wb' ) as outfd : pickle . dump ( arg_0 , outfd , protocol = pickle . HIGHEST_PROTOCOL ) return os . path . abspath ( arg_1 )

Get the conservation prediction

        Args:
            variant(dict): A variant dictionary
            info_key(str)

        Returns:
            conservations(list): List of censervation terms


Question: Creates a zip archive from files in path .

def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_1 , "import.zip" ) arg_3 = zipfile . ZipFile ( arg_2 , "w" ) for arg_4 in CSV_FILES : arg_5 = os . path . join ( arg_1 , arg_4 ) if os . path . exists ( arg_5 ) : arg_3 . write ( arg_5 , arg_4 , zipfile . ZIP_DEFLATED ) arg_3 . close ( ) with open ( arg_2 , "rb" ) as f : arg_6 = f . read ( ) return arg_6

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


Question: Retrieve all jobs

def Func ( arg_0 ) : arg_1 = urijoin ( arg_0 . base_url , "api" , "json" ) arg_2 = arg_0 . fetch ( arg_1 ) return arg_2 . text

This is our parsing dispatcher

        :param stype: Search type category
        :param soup: The beautifulsoup object that contains the parsed html


Question: Pad this tile by an equal amount on each side as specified by pad

def Func ( arg_0 , Func ) : arg_2 = arg_0 . copy ( ) arg_2 . l -= Func arg_2 . r += Func return arg_2

Gets a list of snapshots for a cluster

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


Question: Zero crossing value .

def Func ( arg_0 ) : if not arg_0 . option . axis : return - 1 else : return arg_0 . screen . height - ( - arg_0 . minimum * 4.0 / arg_0 . extents * arg_0 . size . y )

Create the prior distribution.

  Args:
    num_topics: Number of topics.
    initial_value: The starting value for the prior parameters.

  Returns:
    prior: A `callable` that returns a `tf.distribution.Distribution`
        instance, the prior distribution.
    prior_variables: A `list` of `Variable` objects, the trainable parameters
        of the prior.


Question: A context manager yielding a stderr - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = None ) : arg_4 = None if arg_2 else arg_0 . stderr_sub_command arg_5 , arg_6 = arg_0 . _get_out_and_path ( arg_0 . stderr , arg_0 . stderr_root , arg_4 , arg_1 ) try : if hasattr ( arg_5 , 'stdin' ) : yield arg_5 . stdin else : yield arg_5 finally : if hasattr ( arg_5 , 'stdin' ) : arg_0 . _close ( arg_5 . stdin ) arg_0 . _wait ( arg_5 , arg_6 ) arg_0 . _close ( arg_5 ) if arg_3 and arg_6 : arg_3 ( arg_6 )

Add an HTTP header to response object.

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


Question: Takes a list of dictionaries with keys corresponding to stream_command arguments and runs all concurrently .

def Func ( arg_0 , arg_1 = False ) : if arg_1 is True : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = lambda : stream_command ( ** arg_3 ) arg_5 = Thread ( arg_4 = arg_4 ) arg_5 . start ( ) arg_2 . append ( arg_5 ) for arg_6 in arg_2 : arg_6 . join ( ) else : for arg_3 in arg_0 : stream_command ( ** arg_3 )

store metric in data tree and calc offset signs

        sign < 0 is CYAN, means metric value is lower then previous,
        sign > 1 is YELLOW, means metric value is higher then prevoius,
        sign == 0 is WHITE, means initial or equal metric value


Question: Return the ZCA whitening principal components matrix .

def Func ( arg_0 ) : arg_1 = np . reshape ( arg_0 , ( arg_0 . shape [ 0 ] , arg_0 . shape [ 1 ] * arg_0 . shape [ 2 ] * arg_0 . shape [ 3 ] ) ) tl . logging . info ( "zca : computing sigma .." ) arg_2 = np . dot ( arg_1 . T , arg_1 ) / arg_1 . shape [ 0 ] tl . logging . info ( "zca : computing U, S and V .." ) arg_3 , arg_4 , arg_5 = linalg . svd ( arg_2 ) tl . logging . info ( "zca : computing principal components .." ) arg_6 = np . dot ( np . dot ( arg_3 , np . diag ( 1. / np . sqrt ( arg_4 + 10e-7 ) ) ) , arg_3 . T ) return arg_6

Given task instance, try_number, filename_template, return the rendered log
    filename

    :param ti: task instance
    :param try_number: try_number of the task
    :param filename_template: filename template, which can be jinja template or
        python string template


Question: Download iana - domains - db . json if not present .

def Func ( arg_0 ) : arg_1 = PyFunceble . CONFIGURATION [ "links" ] [ "iana" ] arg_1 = Version ( True ) . right_url_from_version ( arg_1 ) arg_2 = PyFunceble . CURRENT_DIRECTORY + "iana-domains-db.json" if not Version ( True ) . is_cloned ( ) or not PyFunceble . path . isfile ( arg_2 ) : return Download ( arg_1 , arg_2 ) . text ( ) return None


Question: Process f - string arguments .

def Func ( arg_0 , arg_1 ) : if version_info >= ( 3 , 6 ) : if arg_0 . within_logging_statement ( ) : if any ( isinstance ( arg_2 , FormattedValue ) for arg_2 in arg_1 . values ) : if arg_0 . within_logging_argument ( ) : arg_0 . violations . append ( ( arg_1 , FSTRING_VIOLATION ) ) super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 )


Question: Knock out each gene from a given list .

def Func ( arg_0 , arg_1 = None , arg_2 = "fba" , arg_3 = None , arg_4 = None , ** arg_5 ) : return _multi_deletion ( arg_0 , 'gene' , element_lists = _element_lists ( arg_0 . genes , arg_1 ) , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , ** arg_5 )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Check to see if a movie id is already added to a list .

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _get_id_path ( 'Func' ) arg_3 = arg_0 . _GET ( arg_2 , arg_1 ) arg_0 . _set_attrs_to_values ( arg_3 ) return arg_3

Enable the joint motors in this skeleton.

        This method sets the maximum force that can be applied by each joint to
        attain the desired target velocities. It also enables torque feedback
        for all joint motors.

        Parameters
        ----------
        max_force : float
            The maximum force that each joint is allowed to apply to attain its
            target velocity.


Question: Verify that the ENV defined NVMe device exists

def Func ( ) : if env ( ) : cij . err ( "cij.nvm.Func: Invalid NVMe ENV." ) return 1 arg_0 = cij . env_to_dict ( PREFIX , EXPORTED + REQUIRED ) arg_1 = [ '[[ -b "%s" ]]' % arg_0 [ "DEV_PATH" ] ] arg_2 , arg_3 , arg_3 = cij . ssh . command ( arg_1 , shell = True , echo = False ) return arg_2


Question: Populates the global env variables with custom default settings .

def Func ( ) : arg_0 . ROLES_DIR = ROLE_DIR arg_0 . services = [ ] arg_0 . confirm_deployment = False arg_0 . is_local = None arg_0 . base_config_dir = '.' arg_0 . src_dir = 'src' arg_0 . sites = { } arg_0 [ arg_8 ] = None arg_0 [ arg_9 ] = None arg_0 . hosts_retriever = None arg_0 . hosts_retrievers = type ( arg_0 ) ( ) arg_0 . hostname_translator = 'default' arg_0 . hostname_translators = type ( arg_0 ) ( ) arg_0 . hostname_translators . default = lambda hostname : hostname arg_0 . default_site = None arg_0 . available_sites = [ ] arg_0 . available_sites_by_host = { } arg_0 . disk_usage_command = "df -H | grep -vE '^Filesystem|tmpfs|cdrom|none' | awk '{print $5 " " $1}'" arg_0 . burlap_data_dir = '.burlap' arg_0 . setdefault ( 'roledefs' , { } ) arg_0 . setdefault ( 'roles' , [ ] ) arg_0 . setdefault ( 'hosts' , [ ] ) arg_0 . setdefault ( 'exclude_hosts' , [ ] )

Create a deep copy of the segmentation map object.

        Returns
        -------
        imgaug.SegmentationMapOnImage
            Deep copy.


Question: Project the bounding box onto a differently shaped image .

Returns a string contains start time and the secondary training job status message.

    :param job_description: Returned response from DescribeTrainingJob call
    :type job_description: dict
    :param prev_description: Previous job description from DescribeTrainingJob call
    :type prev_description: dict

    :return: Job status string to be printed.


Question: Returns the closest sibling to this Tag that matches the given criteria and appears after this Tag in the document .

def Func ( arg_0 , arg_1 = None , arg_2 = { } , arg_3 = None , ** arg_4 ) : return arg_0 . _findOne ( arg_0 . Funcs , arg_1 , arg_2 , arg_3 , ** arg_4 )


Question: Removes the chunk from the file

def Func ( arg_0 ) : Func_bytes ( arg_0 . __fileobj , arg_0 . size , arg_0 . offset ) if arg_0 . parent_chunk is not None : arg_0 . parent_chunk . resize ( arg_0 . parent_chunk . data_size - arg_0 . size )

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

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

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

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

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

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

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

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


Question: Round or extend the fraction to size digs .

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: optik callback for printing available messages

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_0 . linter . msgs_store . list_messages ( ) sys . exit ( 0 )

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: Update this with a new set of paths to DAG definition files .

def Func ( arg_0 , arg_1 ) : arg_0 . _file_paths = arg_1 arg_0 . _file_path_queue = [ x for x in arg_0 . _file_path_queue if x in arg_1 ] arg_4 = { } for arg_5 , arg_6 in arg_0 . _processors . items ( ) : if arg_5 in arg_1 : arg_4 [ arg_5 ] = arg_6 else : arg_0 . log . warning ( "Stopping processor for %s" , arg_5 ) arg_6 . terminate ( ) arg_0 . _processors = arg_4


Question: Read a function reader macro from the input stream .

def Func ( arg_0 : arg_1 ) -> llist . List : if arg_0 . is_in_anon_fn : raise SyntaxError ( f"Nested #() definitions not allowed" ) with arg_0 . in_anon_fn ( ) : arg_2 = _read_list ( arg_0 ) arg_3 = set ( ) def arg_suffix ( arg_4 ) : if arg_4 is None : return "1" elif arg_4 == "&" : return "rest" else : return arg_4 def sym_replacement ( arg_4 ) : arg_5 = arg_suffix ( arg_4 ) return symbol . symbol ( f"arg-{suffix}" ) def identify_and_replace ( arg_6 ) : if isinstance ( arg_6 , symbol . Symbol ) : if arg_6 . ns is None : arg_7 = fn_macro_args . match ( arg_6 . name ) if arg_7 is not None : arg_4 = arg_7 . group ( 2 ) arg_5 = arg_suffix ( arg_4 ) arg_3 . add ( arg_5 ) return sym_replacement ( arg_4 ) return arg_6 arg_8 = walk . postwalk ( identify_and_replace , arg_2 ) if len ( arg_2 ) > 0 else None arg_9 : List [ symbol . Symbol ] = [ ] arg_10 = sorted ( map ( int , filter ( lambda k : k != "rest" , arg_3 ) ) ) if len ( arg_10 ) > 0 : arg_11 = max ( arg_10 ) arg_9 = [ sym_replacement ( str ( i ) ) for i in range ( 1 , arg_11 + 1 ) ] if "rest" in arg_3 : arg_9 . append ( _AMPERSAND ) arg_9 . append ( sym_replacement ( "rest" ) ) return llist . l ( _FN , vector . vector ( arg_9 ) , arg_8 )

Parse a hub key into a dictionary of component parts

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


Question: Show a simple pop - up modal dialog

def Func ( arg_0 , arg_1 = "" , arg_2 = None , arg_3 = False , arg_4 = "exclamation" ) : if not arg_3 : arg_5 = { 'exclamation' : wx . ICON_EXCLAMATION , 'error' : wx . ICON_ERROR , 'question' : wx . ICON_QUESTION , 'info' : wx . ICON_INFORMATION } arg_6 = wx . OK | arg_5 [ arg_4 ] arg_7 = dialogs . messageDialog ( arg_2 , arg_0 , arg_1 , arg_6 ) else : arg_7 = dialogs . scrolledMessageDialog ( arg_2 , arg_0 , arg_1 )

Overriding the default JSONEncoder.default for NDB support.


Question: generate word pairs for the TextRank graph

def Func ( arg_0 , arg_1 = 3 ) : arg_2 = list ( filter ( lambda w : w . word_id > 0 , arg_0 ) ) arg_3 = len ( arg_2 ) for arg_4 in iter ( range ( 0 , arg_3 - 1 ) ) : arg_5 = arg_2 [ arg_4 ] for arg_6 in iter ( range ( arg_4 + 1 , min ( arg_3 , arg_4 + 1 + arg_1 ) ) ) : arg_7 = arg_2 [ arg_6 ] if ( arg_7 . idx - arg_5 . idx ) <= arg_1 : yield ( arg_5 . root , arg_7 . root , )

Set a property value or remove a property.

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

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

        This default implementation

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

        Removing a non-existing prop is NOT an error.

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

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


Question: Callback called by Secure Transport to actually read the socket

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = None try : arg_3 = _connection_refs . get ( arg_0 ) if not arg_3 : arg_4 = _socket_refs . get ( arg_0 ) else : arg_4 = arg_3 . _socket if not arg_3 and not arg_4 : return 0 arg_5 = deref ( arg_2 ) arg_6 = arg_4 . gettimeout ( ) arg_7 = None arg_8 = b'' try : while len ( arg_8 ) < arg_5 : if arg_6 is not None and arg_6 > 0.0 : arg_9 , arg_10 , arg_10 = select . select ( [ arg_4 ] , [ ] , [ ] , arg_6 ) if len ( arg_9 ) == 0 : raise socket_ . error ( errno . EAGAIN , 'timed out' ) arg_11 = arg_4 . recv ( arg_5 - len ( arg_8 ) ) arg_8 += arg_11 if arg_11 == b'' : if len ( arg_8 ) == 0 : if arg_6 is None : return SecurityConst . errSSLClosedNoNotify return SecurityConst . errSSLClosedAbort break except ( socket_ . error ) as e : arg_7 = e . errno if arg_7 is not None and arg_7 != errno . EAGAIN : if arg_7 == errno . ECONNRESET or arg_7 == errno . EPIPE : return SecurityConst . errSSLClosedNoNotify return SecurityConst . errSSLClosedAbort if arg_3 and not arg_3 . _done_handshake : if len ( arg_8 ) >= 3 and len ( arg_3 . _server_hello ) == 0 : arg_12 = arg_8 [ 0 : 1 ] in set ( [ b'\x15' , b'\x16' ] ) arg_13 = arg_8 [ 1 : 3 ] in set ( [ b'\x03\x00' , b'\x03\x01' , b'\x03\x02' , b'\x03\x03' , b'\x03\x04' ] ) if not arg_12 or not arg_13 : arg_3 . _server_hello += arg_8 + _read_remaining ( arg_4 ) return SecurityConst . errSSLProtocol arg_3 . _server_hello += arg_8 write_to_buffer ( arg_1 , arg_8 ) pointer_set ( arg_2 , len ( arg_8 ) ) if len ( arg_8 ) != arg_5 : return SecurityConst . errSSLWouldBlock return 0 except ( KeyboardInterrupt ) as e : if arg_3 : arg_3 . _exception = e return SecurityConst . errSSLClosedAbort

Overriding the default JSONEncoder.default for NDB support.


Question: Creates a new notice .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = False if arg_2 is None : arg_2 = { } arg_5 = NoticeType . objects . get ( arg_1 = arg_1 ) arg_6 = get_language ( ) for arg_7 in arg_0 : try : arg_8 = get_notification_language ( arg_7 ) except LanguageStoreNotAvailable : arg_8 = None if arg_8 is not None : activate ( arg_8 ) for arg_9 in NOTIFICATION_BACKENDS . values ( ) : if arg_9 . can_send ( arg_7 , arg_5 ) : arg_9 . deliver ( arg_7 , arg_3 , arg_5 , arg_2 ) arg_4 = True activate ( arg_6 ) return arg_4

Selects an open lswitch for a network.

        Note that it does not select the most full switch, but merely one with
        ports available.


Question: Return an auth token based on the client + service + seed tuple .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = hashlib . md5 ( ) arg_4 = ',' . join ( ( arg_0 , arg_1 , arg_2 ) ) . encode ( 'utf-8' ) arg_3 . update ( arg_4 ) return arg_3 . hexdigest ( )

Returns a list of the dicom files within root_path

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

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


Question: Returns the closest parent of this Tag that matches the given criteria .

def Func ( arg_0 , arg_1 = None , arg_2 = { } , ** arg_3 ) : arg_4 = None arg_5 = arg_0 . Funcs ( arg_1 , arg_2 , 1 ) if arg_5 : arg_4 = arg_5 [ 0 ] return arg_4

Returns an arrow Table object containing the arrays corresponding to the evaluated data

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :return: pyarrow.Table object


Question: Bookmark build job .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = get_build_or_local ( arg_0 . obj . get ( 'project' ) , arg_0 . obj . get ( 'build' ) ) try : PolyaxonClient ( ) . build_job . Func ( arg_1 , arg_2 , arg_3 ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func build job `{}`.' . format ( arg_3 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) Printer . print_success ( "Build job Funced." )


Question: This is a parallel worker for makelclist .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = arg_0 try : arg_6 = get_lcformat ( arg_3 , use_lcformat_dir = arg_4 ) if arg_6 : ( arg_7 , arg_8 , arg_9 , arg_10 , arg_11 , arg_12 , arg_13 ) = arg_6 else : LOGERROR ( "can't figure out the light curve format" ) return None except Exception as e : LOGEXCEPTION ( "can't figure out the light curve format" ) return None arg_14 = { 'lcfname' : os . path . abspath ( arg_1 ) } try : arg_15 = arg_8 ( arg_1 ) if ( ( isinstance ( arg_15 , ( list , tuple ) ) ) and ( isinstance ( arg_15 [ 0 ] , dict ) ) ) : arg_15 = arg_15 [ 0 ] for arg_16 in arg_2 : if '.' in arg_16 : arg_17 = arg_16 . split ( '.' ) else : arg_17 = [ arg_16 ] try : arg_18 = _dict_get ( arg_15 , arg_17 ) except Exception as e : LOGWARNING ( 'column %s does not exist for %s' % ( arg_16 , arg_1 ) ) arg_18 = np . nan arg_14 [ arg_17 [ - 1 ] ] = arg_18 except Exception as e : LOGEXCEPTION ( 'could not figure out columns for %s' % arg_1 ) for arg_16 in arg_2 : if '.' in arg_16 : arg_17 = arg_16 . split ( '.' ) else : arg_17 = [ arg_16 ] arg_18 = np . nan arg_14 [ arg_17 [ - 1 ] ] = arg_18 for arg_19 in arg_5 : try : if '.' in arg_19 : arg_20 = arg_19 . split ( '.' ) else : arg_20 = [ arg_19 ] arg_21 = _dict_get ( arg_15 , arg_20 ) arg_22 = arg_21 [ np . isfinite ( arg_21 ) ] . size arg_14 [ '%s.ndet' % arg_20 [ - 1 ] ] = arg_22 except Exception as e : arg_14 [ '%s.ndet' % arg_20 [ - 1 ] ] = np . nan return arg_14

Returns information used by the codecs library to configure the
        codec for use.


Question: Returns list of output names in spec .

def Func ( arg_0 ) : arg_1 = arg_0 . getSpec ( ) . outputs return [ arg_1 . getByIndex ( arg_2 ) [ 0 ] for arg_2 in xrange ( arg_1 . getCount ( ) ) ]

Drop a node from the network

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


Question: Export a numpy array to a HDF5 file .

def Func ( arg_0 , arg_1 ) : arg_0 = os . path . expanduser ( arg_0 ) try : arg_2 = h5py . File ( arg_0 , "w" ) arg_2 . create_dataset ( 'CUTOUT' , data = arg_1 ) arg_2 . close ( ) except Exception as e : raise ValueError ( "Could not Func HDF5 file {0}." . format ( arg_0 ) ) return arg_0

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


Question: Check if spark version is below 2 . 2

def Func ( ) : import pyspark if ( hasattr ( pyspark , "version" ) ) : arg_0 = pyspark . version . __version__ arg_1 = arg_0 . split ( "." ) arg_2 = arg_1 [ 0 ] + "." + arg_1 [ 1 ] if ( compare_version ( arg_2 , "2.2" ) >= 0 ) : return False return True

Check if the element is into the database.


Question: Fetch all queued instances of type embed_type save results to self . instances

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . serializers . get ( arg_1 , None ) if arg_3 is None : return arg_0 . instances [ arg_1 ] = arg_3 . fetch ( arg_2 )

r'''Method to calculate low-pressure liquid molar volume at tempearture
        `T` with a given method.

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

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

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and a low pressure, [m^3/mol]


Question: Convert native python datetime . date object to a format supported by the API

def Func ( arg_0 ) : return { DAY : arg_0 . day , MONTH : arg_0 . month , YEAR : arg_0 . year }

Delete the specified cgroup.

        :param path: The path of the cgroup to delete.
        E.g. cpu/mygroup/mysubgroup


Question: Create the rst string to download supplementary data

def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) > 1 : return arg_0 . DATA_DOWNLOAD % ( ( '\n\n' + ' ' * 8 ) + ( '\n' + ' ' * 8 ) . join ( '* :download:`%s`' % arg_2 for arg_2 in arg_1 ) ) return arg_0 . DATA_DOWNLOAD % ':download:`%s`' % arg_1 [ 0 ]

Computes graph and static `sample_shape`.


Question: Updates a LAN

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = { } if arg_3 : arg_6 [ 'name' ] = arg_3 if arg_4 is not None : arg_6 [ 'public' ] = arg_4 if arg_5 : arg_6 [ 'ipFailover' ] = arg_5 arg_7 = arg_0 . _perform_request ( url = '/datacenters/%s/lans/%s' % ( arg_1 , arg_2 ) , method = 'PATCH' , arg_6 = json . dumps ( arg_6 ) ) return arg_7

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Gets predictions for a given utterance in the form of intents and entities . The current maximum query size is 500 characters .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = False , ** arg_11 ) : arg_12 = arg_0 . Func . metadata [ 'url' ] arg_13 = { 'Endpoint' : arg_0 . _serialize . url ( "self.config.endpoint" , arg_0 . config . endpoint , 'str' , skip_quote = True ) , 'appId' : arg_0 . _serialize . url ( "app_id" , arg_1 , 'str' ) } arg_12 = arg_0 . _client . format_url ( arg_12 , ** arg_13 ) arg_14 = { } if arg_3 is not None : arg_14 [ 'timezoneOffset' ] = arg_0 . _serialize . query ( "timezone_offset" , arg_3 , 'float' ) if arg_4 is not None : arg_14 [ 'verbose' ] = arg_0 . _serialize . query ( "verbose" , arg_4 , 'bool' ) if arg_5 is not None : arg_14 [ 'staging' ] = arg_0 . _serialize . query ( "staging" , arg_5 , 'bool' ) if arg_6 is not None : arg_14 [ 'spellCheck' ] = arg_0 . _serialize . query ( "spell_check" , arg_6 , 'bool' ) if arg_7 is not None : arg_14 [ 'bing-spell-check-subscription-key' ] = arg_0 . _serialize . query ( "bing_spell_check_subscription_key" , arg_7 , 'str' ) if arg_8 is not None : arg_14 [ 'log' ] = arg_0 . _serialize . query ( "log" , arg_8 , 'bool' ) arg_15 = { } arg_15 [ 'Accept' ] = 'application/json' arg_15 [ 'Content-Type' ] = 'application/json; charset=utf-8' if arg_9 : arg_15 . update ( arg_9 ) arg_16 = arg_0 . _serialize . body ( arg_2 , 'str' ) arg_17 = arg_0 . _client . post ( arg_12 , arg_14 , arg_15 , arg_16 ) arg_18 = arg_0 . _client . send ( arg_17 , stream = False , ** arg_11 ) if arg_18 . status_code not in [ 200 ] : raise models . APIErrorException ( arg_0 . _deserialize , arg_18 ) arg_19 = None if arg_18 . status_code == 200 : arg_19 = arg_0 . _deserialize ( 'LuisResult' , arg_18 ) if arg_10 : arg_20 = ClientRawResponse ( arg_19 , arg_18 ) return arg_20 return arg_19


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

def Func ( arg_0 , arg_1 ) : arg_2 = OrderedDict ( ) arg_3 = arg_0 [ 'total_returns' ] arg_4 = arg_0 [ 'specific_returns' ] arg_5 = arg_0 [ 'common_returns' ] arg_2 [ 'Annualized Specific Return' ] = ep . annual_return ( arg_4 ) arg_2 [ 'Annualized Common Return' ] = ep . annual_return ( arg_5 ) arg_2 [ 'Annualized Total Return' ] = ep . annual_return ( arg_3 ) arg_2 [ 'Specific Sharpe Ratio' ] = ep . sharpe_ratio ( arg_4 ) arg_2 [ 'Cumulative Specific Return' ] = ep . cum_returns_final ( arg_4 ) arg_2 [ 'Cumulative Common Return' ] = ep . cum_returns_final ( arg_5 ) arg_2 [ 'Total Returns' ] = ep . cum_returns_final ( arg_3 ) arg_2 = pd . Series ( arg_2 , name = '' ) arg_6 = [ ep . annual_return ( arg_0 [ c ] ) for c in arg_1 . columns ] arg_7 = [ ep . cum_returns_final ( arg_0 [ c ] ) for c in arg_1 . columns ] arg_8 = pd . DataFrame ( data = OrderedDict ( [ ( 'Average Risk Factor Exposure' , arg_1 . mean ( axis = 'rows' ) ) , ( 'Annualized Return' , arg_6 ) , ( 'Cumulative Return' , arg_7 ) , ] ) , index = arg_1 . columns , ) return arg_2 , arg_8

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


Question: Register this bolt to the topology and create HeronComponentSpec

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = 1 , arg_4 = None , arg_5 = None ) : arg_6 = "%s.%s" % ( arg_0 . __module__ , arg_0 . __name__ ) if hasattr ( arg_0 , 'outputs' ) : arg_7 = copy . copy ( arg_0 . outputs ) else : arg_7 = [ ] if arg_5 is not None : assert isinstance ( arg_5 , ( list , tuple ) ) for arg_8 in arg_5 : assert isinstance ( arg_8 , ( str , Stream ) ) arg_7 . append ( arg_8 ) return HeronComponentSpec ( arg_1 , arg_6 , is_spout = False , arg_3 = arg_3 , arg_2 = arg_2 , outputs = arg_7 , arg_4 = arg_4 )

Log 'msg % args' at level 'level' once per 'n' times.

    Logs the 1st call, (N+1)st call, (2N+1)st call,  etc.
    Not threadsafe.

    Args:
    level: The level at which to log.
    msg: The message to be logged.
    n: The number of times this should be called before it is logged.
    *args: The args to be substituted into the msg.


Question: Get input and output history from the current session . Called by get_range and takes similar parameters .

def Func ( arg_0 , arg_1 = 1 , arg_2 = None , arg_3 = True , arg_4 = False ) : arg_5 = arg_0 . input_hist_raw if arg_3 else arg_0 . input_hist_parsed arg_6 = len ( arg_5 ) if arg_1 < 0 : arg_1 += arg_6 if not arg_2 or ( arg_2 > arg_6 ) : arg_2 = arg_6 elif arg_2 < 0 : arg_2 += arg_6 for arg_7 in range ( arg_1 , arg_2 ) : if arg_4 : arg_8 = ( arg_5 [ arg_7 ] , arg_0 . output_hist_reprs . get ( arg_7 ) ) else : arg_8 = arg_5 [ arg_7 ] yield ( 0 , arg_7 , arg_8 )

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


Question: Sets the specified certificate issuer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = False , ** arg_9 ) : arg_10 = models . CertificateIssuerSetParameters ( arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_11 = arg_0 . Func . metadata [ 'url' ] arg_12 = { 'vaultBaseUrl' : arg_0 . _serialize . url ( "vault_base_url" , arg_1 , 'str' , skip_quote = True ) , 'issuer-name' : arg_0 . _serialize . url ( "issuer_name" , arg_2 , 'str' ) } arg_11 = arg_0 . _client . format_url ( arg_11 , ** arg_12 ) arg_13 = { } arg_13 [ 'api-version' ] = arg_0 . _serialize . query ( "self.api_version" , arg_0 . api_version , 'str' ) arg_14 = { } arg_14 [ 'Content-Type' ] = 'application/json; charset=utf-8' if arg_0 . config . generate_client_request_id : arg_14 [ 'x-ms-client-request-id' ] = str ( uuid . uuid1 ( ) ) if arg_7 : arg_14 . update ( arg_7 ) if arg_0 . config . accept_language is not None : arg_14 [ 'accept-language' ] = arg_0 . _serialize . header ( "self.config.accept_language" , arg_0 . config . accept_language , 'str' ) arg_15 = arg_0 . _serialize . body ( arg_10 , 'CertificateIssuerSetParameters' ) arg_16 = arg_0 . _client . put ( arg_11 , arg_13 ) arg_17 = arg_0 . _client . send ( arg_16 , arg_14 , arg_15 , stream = False , ** arg_9 ) if arg_17 . status_code not in [ 200 ] : raise models . KeyVaultErrorException ( arg_0 . _deserialize , arg_17 ) arg_18 = None if arg_17 . status_code == 200 : arg_18 = arg_0 . _deserialize ( 'IssuerBundle' , arg_17 ) if arg_8 : arg_19 = ClientRawResponse ( arg_18 , arg_17 ) return arg_19 return arg_18

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Convert a file in some other encoding into a temporary file that s in UTF - 8 .

def Func ( arg_0 , arg_1 ) : arg_2 = tempfile . TemporaryFile ( ) for arg_3 in io . open ( arg_0 , arg_1 = arg_1 ) : arg_2 . write ( arg_3 . strip ( '\uFEFF' ) . encode ( 'utf-8' ) ) arg_2 . seek ( 0 ) return arg_2


Question: Read from memory .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = [ ] for arg_5 in range ( arg_2 ) : arg_4 . append ( Operators . CHR ( arg_0 . read_int ( arg_1 + arg_5 , 8 , arg_3 ) ) ) return arg_4

Parse a hub key into a dictionary of component parts

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


Question: Copy files from the given source to the target .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : import fnmatch if IsDir ( arg_0 ) : arg_4 = '*' else : arg_0 , arg_4 = os . path . split ( arg_0 ) if not IsDir ( arg_1 ) : if arg_2 : CreateDirectory ( arg_1 ) else : from . _exceptions import DirectoryNotFoundError raise DirectoryNotFoundError ( arg_1 ) arg_5 = ListFiles ( arg_0 ) if arg_5 is None : return for arg_6 in arg_5 : if arg_3 and arg_6 . endswith ( '.md5' ) : continue if fnmatch . fnmatch ( arg_6 , arg_4 ) : arg_7 = arg_0 + '/' + arg_6 arg_8 = arg_1 + '/' + arg_6 if IsDir ( arg_7 ) : Func ( arg_7 , arg_8 , arg_2 = True , arg_3 = arg_3 ) else : CopyFile ( arg_7 , arg_8 , arg_3 = arg_3 )

Show Program Landing page for the Enterprise's Program.

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

        Unauthenticated learners will be redirected to enterprise-linked SSO.

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


Question: Layout the graph incrementally . The graph is drawn at the center of the canvas . The weighted and directed parameters visualize edge weight and direction . The highlight specifies list of connected nodes . The path will be colored according to the highlight style . Clicking and dragging events are monitored .

def Func ( arg_0 , arg_1 = 0 , arg_2 = 0 , arg_3 = False , arg_4 = False , arg_5 = [ ] , arg_6 = None ) : arg_0 . update ( ) arg_7 = arg_0 . styles . default arg_7 . graph_background ( arg_7 ) _ctx . push ( ) _ctx . translate ( arg_0 . x + arg_1 , arg_0 . y + arg_2 ) if arg_6 : if isinstance ( arg_6 , bool ) : arg_6 = 5 for arg_8 in arg_0 . nodes_by_betweenness ( ) [ : arg_6 ] : try : arg_7 = arg_0 . styles [ arg_8 . style ] except : arg_7 = arg_0 . styles . default if arg_7 . graph_traffic : arg_7 . graph_traffic ( arg_7 , arg_8 , arg_0 . alpha ) arg_7 = arg_0 . styles . default if arg_7 . edges : arg_7 . edges ( arg_7 , arg_0 . edges , arg_0 . alpha , arg_3 , arg_4 ) for arg_8 in arg_0 . nodes : try : arg_7 = arg_0 . styles [ arg_8 . style ] except : arg_7 = arg_0 . styles . default if arg_7 . node : arg_7 . node ( arg_7 , arg_8 , arg_0 . alpha ) try : arg_7 = arg_0 . styles . highlight except : arg_7 = arg_0 . styles . default if arg_7 . path : arg_7 . path ( arg_7 , arg_0 , arg_5 ) for arg_8 in arg_0 . nodes : try : arg_7 = arg_0 . styles [ arg_8 . style ] except : arg_7 = arg_0 . styles . default if arg_7 . node_label : arg_7 . node_label ( arg_7 , arg_8 , arg_0 . alpha ) _ctx . pop ( )

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: Write a 2D NumPy array to a . fits file .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_2 and os . path . exists ( arg_1 ) : os . remove ( arg_1 ) arg_3 = fits . Header ( ) arg_4 = fits . PrimaryHDU ( np . flipud ( arg_0 ) , arg_3 ) arg_4 . writeto ( arg_1 )

Receive a StateUpdate and fan out to Conversations.

        Args:
            state_update: hangouts_pb2.StateUpdate instance


Question: Search for TV shows by title .

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _get_path ( 'Func' ) arg_3 = arg_0 . _GET ( arg_2 , arg_1 ) arg_0 . _set_attrs_to_values ( arg_3 ) return arg_3

Get a queue that allows direct access to the internal buffer. If the dataset to be read is chunked, the
        block_size should be a multiple of the chunk size to maximise performance. In this case it is best to leave it
        to the default. When cyclic=False, and block_size does not divide the dataset evenly, the remainder elements
        will not be returned by the queue. When cyclic=True, the remainder elements will be part of a block that wraps
        around the end and includes element from the beginning of the dataset. By default, blocks are returned in the
        order in which they become available. The ordered option will force blocks to be returned in on-disk order.

        :param path: The HDF5 path to the dataset that should be read.
        :param n_procs: The number of background processes used to read the datset in parallel.
        :param read_ahead: The number of blocks to allocate in the internal buffer.
        :param cyclic: True if the queue should wrap at the end of the dataset.
        :param block_size: The size along the outer dimension of the blocks to be read. Defaults to a multiple of
            the chunk size, or to a 128KB sized block if the dataset is not chunked.
        :param ordered: Force the reader return data in on-disk order. May result in performance penalty.
        :return: A queue object that allows access to the internal buffer.


Question: Mark the name as consumed and delete it from the to_consume dictionary

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . consumed [ arg_1 ] = arg_2 del arg_0 . to_consume [ arg_1 ]


Question: 1 ) Get command line arguments 2 ) Read the JSON file 3 ) Parse into a dictionary 4 ) Create or update definitions using API call

def Func ( arg_0 ) : arg_0 . v2Metrics = arg_0 . metricDefinitionV2 ( arg_0 . metrics ) if arg_0 . v2Metrics : arg_2 = arg_0 . metrics else : arg_2 = arg_0 . metrics [ 'result' ] for arg_3 in arg_2 : if arg_0 . v2Metrics : arg_4 = arg_2 [ arg_3 ] arg_4 [ 'name' ] = arg_3 else : arg_4 = arg_3 arg_0 . create_update ( arg_4 )

check whether the given sub metric is in important_sub_metrics list


Question: Start a pdb set_trace inside of the template with the context available as context . Uses ipdb if available .

def Func ( arg_0 ) : try : import ipdb as pdb except ImportError : import pdb print ( "For best results, pip install ipdb." ) print ( "Variables that are available in the current context:" ) arg_1 = lambda s : template . Template ( s ) . render ( arg_0 ) arg_2 = get_variables ( arg_0 ) pprint ( arg_2 ) print ( 'Type `availables` to show this list.' ) print ( 'Type <variable_name> to access one.' ) print ( 'Use render("template string") to test template rendering' ) for arg_3 in arg_2 : arg_4 ( ) [ arg_3 ] = arg_0 [ arg_3 ] pdb . Func ( ) return ''


Question: Return a list with matching Category arguments .

def Func ( ** arg_0 ) : try : arg_1 = _pybossa_req ( 'get' , 'category' , params = arg_0 ) if type ( arg_1 ) . __name__ == 'list' : return [ Category ( arg_2 ) for arg_2 in arg_1 ] else : return arg_1 except : raise

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

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

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

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


Question: Iterator over all API endpoint names and callbacks .

def Func ( arg_0 ) : for arg_1 in dir ( arg_0 ) : arg_2 = getattr ( arg_0 , arg_1 ) arg_3 = getattr ( arg_2 , 'api_path' , None ) if arg_3 : yield ( '%s%s' % ( arg_0 . api_path_prefix , arg_3 ) , arg_2 , ) for arg_4 in arg_0 . api_providers : for arg_3 , arg_2 in Func ( arg_4 ) : yield ( arg_3 , arg_2 )

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


Question: Get AAD token

def Func ( arg_0 , arg_1 ) : from azure . servicefabric . service_fabric_client_ap_is import ( ServiceFabricClientAPIs ) from sfctl . auth import ClientCertAuthentication from sfctl . config import set_aad_metadata arg_2 = ClientCertAuthentication ( None , None , arg_1 ) arg_3 = ServiceFabricClientAPIs ( arg_2 , base_url = arg_0 ) arg_4 = arg_3 . get_aad_metadata ( ) if arg_4 . type != "aad" : raise CLIError ( "Not AAD cluster" ) arg_5 = arg_4 . metadata arg_6 = arg_5 . tenant arg_7 = arg_5 . login + '/' + arg_6 arg_8 = adal . AuthenticationContext ( arg_7 , api_version = None ) arg_9 = arg_5 . cluster arg_10 = arg_5 . client set_aad_metadata ( arg_7 , arg_9 , arg_10 ) arg_11 = arg_8 . acquire_user_code ( arg_9 , arg_10 ) print ( arg_11 [ 'message' ] ) arg_12 = arg_8 . acquire_token_with_device_code ( arg_9 , arg_11 , arg_10 ) print ( "Succeed!" ) return arg_12 , arg_8 . cache

Check if input dimension corresponds to qubit subsystems.


Question: Returns a redirect response to the remote authorization URL with the signed callback given .

def Func ( arg_0 , arg_1 = None , arg_2 = None , ** arg_3 ) : arg_4 = dict ( arg_0 . request_token_params ) or { } arg_4 . update ( ** arg_3 ) if arg_0 . request_token_url : arg_5 = arg_0 . generate_request_token ( arg_1 ) [ 0 ] arg_6 = '%s?oauth_token=%s' % ( arg_0 . expand_url ( arg_0 . Func_url ) , url_quote ( arg_5 ) ) if arg_4 : arg_6 += '&' + url_encode ( arg_4 ) else : assert arg_1 is not None , 'Callback is required for OAuth2' arg_7 = arg_0 . make_client ( ) if 'scope' in arg_4 : arg_8 = arg_4 . pop ( 'scope' ) else : arg_8 = None if isinstance ( arg_8 , str ) : arg_8 = _encode ( arg_8 , arg_0 . encoding ) if 'state' in arg_4 : if not arg_2 : arg_2 = arg_4 . pop ( 'state' ) else : arg_4 . pop ( 'state' ) if callable ( arg_2 ) : arg_2 = arg_2 ( ) arg_9 [ '%s_oauthredir' % arg_0 . name ] = arg_1 arg_6 = arg_7 . prepare_request_uri ( arg_0 . expand_url ( arg_0 . Func_url ) , redirect_uri = arg_1 , arg_8 = arg_8 , arg_2 = arg_2 , ** arg_4 ) return redirect ( arg_6 )


Question: Return a decorator that validates arguments with provided validator function .

def Func ( arg_0 ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def wrapper ( arg_2 , arg_3 , Func = True ) : if Func : arg_0 ( arg_2 , arg_3 ) return arg_1 ( arg_2 , arg_3 ) return wrapper return decorator

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


Question: Delete auth token when delete request was issued .

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = get_authorization_header ( arg_1 ) . split ( ) if not arg_4 or arg_4 [ 0 ] . lower ( ) != b'token' : return response . Response ( status = status . HTTP_400_BAD_REQUEST ) if len ( arg_4 ) == 1 : arg_5 = 'Invalid token header. No credentials provided.' return response . Response ( arg_5 , status = status . HTTP_400_BAD_REQUEST ) elif len ( arg_4 ) > 2 : arg_5 = 'Invalid token header. Token string should not contain spaces.' return response . Response ( arg_5 , status = status . HTTP_400_BAD_REQUEST ) try : arg_6 = arg_0 . model . objects . get ( key = arg_4 [ 1 ] ) except arg_0 . model . DoesNotExist : pass else : arg_6 . Func ( ) signals . user_logged_out . send ( type ( arg_0 ) , user = arg_6 . user , arg_1 = arg_1 , ) return response . Response ( status = status . HTTP_204_NO_CONTENT )

Reshape input and output dimensions of operator.

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

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

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


Question: Helper function to validate interval . An interval is valid if starttime and endtime are integrals and starttime is less than the endtime . Raises exception if interval is not valid .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = int ( arg_1 ) arg_4 = int ( arg_2 ) if arg_3 > arg_4 : raise Exception ( "starttime is greater than endtime." )

Generate the characters support by the font at the given path.


Question: get depth of an element in the tree

def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = arg_1 [ arg_0 ] while arg_3 is not None : arg_2 += 1 arg_3 = arg_1 [ arg_3 ] return arg_2

Get an access token from the provider token URI.

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


Question: Create a deep copy of the BoundingBoxesOnImage object .

def Func ( arg_0 ) : arg_1 = [ bb . Func ( ) for bb in arg_0 . bounding_boxes ] return BoundingBoxesOnImage ( arg_1 , tuple ( arg_0 . shape ) )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: Return user entities based on a query .

async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . SearchEntitiesResponse ( ) await arg_0 . _pb_request ( 'contacts/searchentities' , arg_1 , arg_2 ) return arg_2


Question: Helper to try to get a setting from the environment or pyconfig or finally use a provided default .

def Func ( arg_0 , arg_1 ) : arg_2 = os . Funciron . get ( arg_0 , None ) if arg_2 is not None : log . info ( '    %s = %r' , arg_0 . lower ( ) . replace ( '_' , '.' ) , arg_2 ) return arg_2 arg_0 = arg_0 . lower ( ) . replace ( '_' , '.' ) arg_2 = get ( arg_0 ) if arg_2 is not None : return arg_2 return arg_1

Constructs the middle line of the element


Question: Adds a value over a range of rows .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : for arg_6 , arg_7 in enumerate ( arg_0 ) : if arg_6 >= arg_3 and arg_6 <= arg_4 : arg_7 [ arg_2 ] = type ( arg_5 ) ( arg_7 [ arg_2 ] ) + arg_5 arg_1 . appendRecord ( arg_7 )

Computes the walk paths between stops, and updates these to the gtfs database.

    Parameters
    ----------
    gtfs: gtfspy.GTFS or str
        A GTFS object or a string representation.
    osm_path: str
        path to the OpenStreetMap file
    cutoff_distance_m: number
        maximum allowed distance in meters

    Returns
    -------
    None

    See Also
    --------
    gtfspy.calc_transfers
    compute_walk_paths_java


Question: Update partial or entire z .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_1 = _make_np_bool ( arg_1 ) if arg_2 is None : if len ( arg_0 . _z ) != len ( arg_1 ) : raise QiskitError ( "During updating whole z, you can not " "change the number of qubits." ) arg_0 . _z = arg_1 else : if not isinstance ( arg_2 , list ) and not isinstance ( arg_2 , np . ndarray ) : arg_2 = [ arg_2 ] for arg_4 , arg_5 in enumerate ( arg_2 ) : arg_0 . _z [ arg_5 ] = arg_1 [ arg_4 ] return arg_0

Upload a new site build to LSST the Docs.


Question: Returns a python iterable containing the exploration range .

def Func ( arg_0 , arg_1 = True ) : if not arg_0 . f_has_range ( ) : raise TypeError ( 'Your parameter `%s` is not array, so cannot return array.' % arg_0 . v_full_name ) elif arg_1 : return arg_0 . _explored_range [ : ] else : return arg_0 . _explored_range

Converts another parameter's results to positive values.

    Parameters
    ----------
    other_param : imgaug.parameters.StochasticParameter
        Other parameter which's sampled values are to be
        modified.

    mode : {'invert', 'reroll'}, optional
        How to change the signs. Valid values are ``invert`` and ``reroll``.
        ``invert`` means that wrong signs are simply flipped.
        ``reroll`` means that all samples with wrong signs are sampled again,
        optionally many times, until they randomly end up having the correct
        sign.

    reroll_count_max : int, optional
        If `mode` is set to ``reroll``, this determines how often values may
        be rerolled before giving up and simply flipping the sign (as in
        ``mode="invert"``). This shouldn't be set too high, as rerolling is
        expensive.

    Examples
    --------
    >>> param = Positive(Normal(0, 1), mode="reroll")

    Generates a normal distribution that has only positive values.


Question: Produces a TidyPy configuration using the pyproject . toml in the project s directory .

def Func ( arg_0 , arg_1 = True ) : arg_2 = os . path . join ( arg_0 , 'pyproject.toml' ) if os . path . exists ( arg_2 ) : with open ( arg_2 , 'r' ) as config_file : arg_3 = pytoml . load ( config_file ) arg_3 = arg_3 . get ( 'tool' , { } ) . get ( 'tidypy' , { } ) arg_3 = merge_dict ( get_default_config ( ) , arg_3 ) arg_3 = process_extensions ( arg_3 , arg_0 , arg_1 = arg_1 ) return arg_3 return None


Question: Run Presto query on athena with provided config and return submitted query_execution_id

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = arg_0 . conn . start_query_execution ( QueryString = arg_1 , ClientRequestToken = arg_4 , QueryExecutionContext = arg_2 , ResultConfiguration = arg_3 ) arg_6 = arg_5 [ 'QueryExecutionId' ] return arg_6

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


Question: Returns a string that is valid JSON or YAML and contains all the variables in every extra_vars_opt inside of extra_vars_list .

def Func ( arg_0 , arg_1 = True ) : arg_2 = { } arg_3 = "" for arg_4 in arg_0 : if arg_4 . startswith ( "@" ) : with open ( arg_4 [ 1 : ] , 'r' ) as f : arg_4 = f . read ( ) arg_5 = string_to_dict ( arg_4 , allow_kv = False ) else : arg_5 = string_to_dict ( arg_4 , allow_kv = True ) if any ( arg_6 . startswith ( "#" ) for arg_6 in arg_4 . split ( '\n' ) ) : arg_3 += arg_4 + "\n" elif arg_4 != "" : arg_3 += yaml . dump ( arg_5 , default_flow_style = False ) + "\n" arg_2 . update ( arg_5 ) if not arg_1 : try : arg_7 = yaml . load ( arg_3 , Loader = yaml . SafeLoader ) assert type ( arg_7 ) is dict debug . log ( 'Using unprocessed YAML' , header = 'decision' , nl = 2 ) return arg_3 . rstrip ( ) except Exception : debug . log ( 'Failed YAML parsing, defaulting to JSON' , header = 'decison' , nl = 2 ) if arg_2 == { } : return "" return json . dumps ( arg_2 , ensure_ascii = False )

One way to calibrate the band pass is to take the median value
            for every frequency fine channel, and divide by it.


Question: Pretty print the variable importances or return them in a list .

def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . _model_json [ "output" ] if arg_0 . algo == 'glm' or "variable_importances" in list ( arg_2 . keys ( ) ) and arg_2 [ "variable_importances" ] : if arg_0 . algo == 'glm' : arg_3 = arg_2 [ "standardized_coefficient_magnitudes" ] . cell_values arg_4 = 0 arg_5 = 0 for arg_6 in arg_3 : arg_5 = arg_5 + arg_6 [ 1 ] if arg_6 [ 1 ] > arg_4 : arg_4 = arg_6 [ 1 ] arg_7 = [ ] for arg_6 in arg_3 : arg_8 = ( arg_6 [ 0 ] , arg_6 [ 1 ] , arg_6 [ 1 ] / arg_4 , arg_6 [ 1 ] / arg_5 ) arg_7 . append ( arg_8 ) arg_9 = [ "variable" , "relative_importance" , "scaled_importance" , "percentage" ] else : arg_7 = arg_2 [ "variable_importances" ] . cell_values arg_9 = arg_2 [ "variable_importances" ] . col_header if arg_1 and can_use_pandas ( ) : import pandas return pandas . DataFrame ( arg_7 , columns = arg_9 ) else : return arg_7 else : print ( "Warning: This model doesn't have variable importances" )


Question: Modify the user s permissions .

def Func ( arg_0 , arg_1 ) : arg_2 = Group . objects . get ( name = 'Admin' ) if arg_1 == 'admin' : arg_0 . groups . add ( arg_2 ) else : arg_0 . groups . remove ( arg_2 )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Declaration of routes that can be browsed by users .

def Func ( arg_0 ) : arg_0 . add_notfound_view ( default_exceptionresponse_view , append_slash = True ) arg_1 = arg_0 . add_route arg_1 ( 'admin-index' , '/a/' ) arg_1 ( 'admin-moderation' , '/a/moderation/' ) arg_1 ( 'admin-api-keys' , '/a/api-keys/' ) arg_1 ( 'admin-add-site-messages' , '/a/site-messages/' , request_method = 'GET' ) arg_1 ( 'admin-add-site-messages-POST' , '/a/site-messages/' , request_method = 'POST' ) arg_1 ( 'admin-delete-site-messages' , '/a/site-messages/' , request_method = 'DELETE' ) arg_1 ( 'admin-edit-site-message' , '/a/site-messages/{id}/' , request_method = 'GET' ) arg_1 ( 'admin-edit-site-message-POST' , '/a/site-messages/{id}/' , request_method = 'POST' ) arg_1 ( 'admin-content-status' , '/a/content-status/' ) arg_1 ( 'admin-content-status-single' , '/a/content-status/{uuid}' ) arg_1 ( 'admin-print-style' , '/a/print-style/' ) arg_1 ( 'admin-print-style-single' , '/a/print-style/{style}' )

_doCascadeFetch - Takes an object and performs a cascading fetch on all foreign links, and all theirs, and so on.

			@param obj <IndexedRedisModel> - A fetched model


Question: Creates an error from the given code and args and kwargs .

def Func ( arg_0 : arg_1 , * arg_2 , ** arg_3 ) -> HedgehogCommandError : if arg_0 == FAILED_COMMAND and len ( arg_2 ) >= 1 and arg_2 [ 0 ] == "Emergency Shutdown activated" : return EmergencyShutdown ( * arg_2 , ** arg_3 ) return _Funcs [ arg_0 ] ( * arg_2 , ** arg_3 )

Return local folder path of header files.


Question: Slices a single parameter of a distribution .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = tf . shape ( input = arg_0 ) arg_5 = tf . ones ( [ tf . size ( input = arg_3 ) + arg_1 - tf . rank ( arg_0 ) ] , dtype = arg_4 . dtype ) arg_6 = tf . concat ( [ arg_5 , arg_4 ] , axis = 0 ) arg_7 = tf . reshape ( arg_0 , arg_6 ) arg_8 = [ ] arg_9 = 0 arg_10 = 0 for arg_11 in arg_2 : if arg_11 is tf . newaxis : arg_8 . append ( arg_11 ) continue if arg_11 is Ellipsis : if arg_10 < 0 : raise ValueError ( 'Found multiple `...` in slices {}' . format ( arg_2 ) ) arg_8 . append ( arg_11 ) arg_12 = sum ( [ s is not tf . newaxis for s in arg_2 [ arg_2 . index ( Ellipsis ) + 1 : ] ] ) arg_10 = - arg_12 arg_9 = arg_10 - arg_1 continue arg_13 = arg_6 [ arg_9 ] arg_14 = arg_3 [ arg_10 ] arg_15 = arg_14 > arg_13 if isinstance ( arg_11 , slice ) : arg_16 , arg_17 , arg_18 = arg_11 . start , arg_11 . stop , arg_11 . step if arg_16 is not None : arg_16 = tf . where ( arg_15 , 0 , arg_16 ) if arg_17 is not None : arg_17 = tf . where ( arg_15 , 1 , arg_17 ) if arg_18 is not None : arg_18 = tf . where ( arg_15 , 1 , arg_18 ) arg_8 . append ( slice ( arg_16 , arg_17 , arg_18 ) ) else : arg_8 . append ( tf . where ( arg_15 , 0 , arg_11 ) ) arg_9 += 1 arg_10 += 1 arg_8 . extend ( [ ALL_SLICE ] * arg_1 ) return arg_7 . __getitem__ ( arg_8 )

Calculate hexadecimal representation of the phrase.


Question: Decorator that prevents callbacks from calling into methods that are not reentrant

def Func ( arg_0 ) : def wrap ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . _callback_lock and arg_1 . _callback_lock . in_callback : arg_4 = "Connection %s cannot be invoked from a callback!" % arg_0 raise RuntimeError ( arg_4 ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return wrap

Write the manifest content to the zip file. It must be a predictable
        order.


Question: First the Document object does the heavy - lifting for the individual page objects and content . Then the overall Pages object is generated .

def Func ( arg_0 ) : arg_0 . document . _get_orientation_changes ( ) arg_0 . document . _output_pages ( ) arg_0 . session . _add_object ( 1 ) arg_0 . session . _out ( '<</Type /Pages' ) arg_1 = '/Kids [' for arg_2 in xrange ( 0 , len ( arg_0 . document . pages ) ) : arg_1 += str ( 3 + 2 * arg_2 ) + ' 0 R ' arg_0 . session . _out ( arg_1 + ']' ) arg_0 . session . _out ( '/Count %s' % len ( arg_0 . document . pages ) ) arg_0 . session . _out ( '/MediaBox [0 0 %.2f %.2f]' % ( arg_0 . document . page . width , arg_0 . document . page . height ) ) arg_0 . session . _out ( '>>' ) arg_0 . session . _out ( 'endobj' )

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


Question: True if the credential is expired or invalid .

def Func ( arg_0 ) : if arg_0 . invalid : return True if not arg_0 . token_expiry : return False arg_1 = _UTCNOW ( ) if arg_1 >= arg_0 . token_expiry : logger . info ( 'access_token is expired. Now: %s, token_expiry: %s' , arg_1 , arg_0 . token_expiry ) return True return False

Number of `params` needed to create a `MixtureSameFamily` distribution.

    Arguments:
      num_components: Number of component distributions in the mixture
        distribution.
      component_params_size: Number of parameters needed to create a single
        component distribution.
      name: The name to use for the op to compute the number of parameters
        (if such an op needs to be created).

    Returns:
     params_size: The number of parameters needed to create the mixture
       distribution.


Question: Replaces all occurrences of old by new in the given file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = GetFileContents ( arg_0 , arg_3 = arg_3 ) arg_4 = arg_4 . replace ( arg_1 , arg_2 ) CreateFile ( arg_0 , arg_4 , arg_3 = arg_3 ) return arg_4

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


Question: Helper to write the JSON configuration to a file

def Func ( arg_0 ) : with open ( CONFIG_PATH , 'w' ) as f : json . dump ( arg_0 , f , indent = 2 , sort_keys = True )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Sum of all width of interfaces in this interface

def Func ( arg_0 ) : try : arg_1 = arg_0 . _interfaces except AttributeError : arg_1 = None if arg_1 is None : arg_2 = arg_0 . _clone ( ) arg_2 . _loadDeclarations ( ) arg_1 = arg_2 . _interfaces if arg_1 : arg_3 = 0 for arg_4 in arg_1 : arg_3 += arg_4 . Func ( ) return arg_3 else : return arg_0 . _dtype . bit_length ( )

Sets the specified certificate issuer.

        The SetCertificateIssuer operation adds or updates the specified
        certificate issuer. This operation requires the certificates/setissuers
        permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param issuer_name: The name of the issuer.
        :type issuer_name: str
        :param provider: The issuer provider.
        :type provider: str
        :param credentials: The credentials to be used for the issuer.
        :type credentials:
         ~azure.keyvault.v2016_10_01.models.IssuerCredentials
        :param organization_details: Details of the organization as provided
         to the issuer.
        :type organization_details:
         ~azure.keyvault.v2016_10_01.models.OrganizationDetails
        :param attributes: Attributes of the issuer object.
        :type attributes: ~azure.keyvault.v2016_10_01.models.IssuerAttributes
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: IssuerBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.IssuerBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`


Question: Set a smoothing Gaussian kernel given its FWHM in mm .

def Func ( arg_0 , arg_1 ) : if arg_1 != arg_0 . _Func : arg_0 . _is_data_smooth = False arg_0 . _Func = arg_1

Overriding the default JSONEncoder.default for NDB support.


Question: Gets the status of a commit .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = get_api_url ( arg_0 , arg_1 , github_status_url ) . format ( arg_2 = arg_2 , arg_3 = arg_3 ) logging . debug ( "Getting status for %s %s" , arg_2 , arg_3 ) arg_5 = get_session_for_repo ( arg_0 , arg_1 ) arg_6 = arg_5 . get ( arg_4 ) if not arg_6 . ok : raise Exception ( "Unable to get status: {}" . format ( arg_6 . status_code ) ) return arg_6

Deserialize a dataframe.

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

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


Question: Check peptide sequences to make sure they are valid for this predictor .

def Func ( arg_0 , arg_1 ) : require_iterable_of ( arg_1 , string_types ) arg_2 = not arg_0 . allow_X_in_peptides arg_3 = not arg_0 . allow_lowercase_in_peptides arg_4 = arg_0 . min_peptide_length is not None arg_5 = arg_0 . min_peptide_length arg_6 = arg_0 . max_peptide_length is not None arg_7 = arg_0 . max_peptide_length for arg_8 in arg_1 : if not arg_8 . isalpha ( ) : raise ValueError ( "Invalid characters in peptide '%s'" % arg_8 ) elif arg_2 and "X" in arg_8 : raise ValueError ( "Invalid character 'X' in peptide '%s'" % arg_8 ) elif arg_3 and not arg_8 . isupper ( ) : raise ValueError ( "Invalid lowercase letters in peptide '%s'" % arg_8 ) elif arg_4 and len ( arg_8 ) < arg_5 : raise ValueError ( "Peptide '%s' too short (%d chars), must be at least %d" % ( arg_8 , len ( arg_8 ) , arg_5 ) ) elif arg_6 and len ( arg_8 ) > arg_7 : raise ValueError ( "Peptide '%s' too long (%d chars), must be at least %d" % ( arg_8 , len ( arg_8 ) , arg_7 ) )

Get the default local IP address.

    From: https://stackoverflow.com/a/28950776


Question: A context manager to temporarily set the training mode of model to mode resetting it when we exit the with - block . A no - op if mode is None .

def Func ( arg_0 , arg_1 ) : if arg_1 is None : yield return arg_2 = arg_0 . training if arg_2 != arg_1 : arg_0 . train ( arg_1 ) try : yield finally : if arg_2 != arg_1 : arg_0 . train ( arg_2 )

Return list of GATT descriptors that have been discovered for this
        characteristic.


Question: Reverse guard expression . not (

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: Set a node to a value captured from another node

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . value = arg_0 . value ( arg_2 ) return True

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


Question: Callback from a parent future to update the AppFuture .

def Func ( arg_0 , arg_1 ) : with arg_0 . _update_lock : if not arg_1 . done ( ) : raise ValueError ( "done callback called, despite future not reporting itself as done" ) if arg_1 != arg_0 . parent : if arg_1 . exception ( ) is None and not isinstance ( arg_1 . result ( ) , RemoteExceptionWrapper ) : raise ValueError ( "internal consistency error: AppFuture done callback called without an exception, but parent has been changed since then" ) try : arg_2 = arg_1 . result ( ) if isinstance ( arg_2 , RemoteExceptionWrapper ) : arg_2 . reraise ( ) super ( ) . set_result ( arg_1 . result ( ) ) except Exception as e : if arg_1 . retries_left > 0 : pass else : super ( ) . set_exception ( e )


Question: Lists options that have not been used to format other values in their sections . Good for finding out if the user has misspelled any of the options .

def Func ( arg_0 , arg_1 ) : arg_2 = set ( [ ] ) for arg_3 in _list ( arg_1 ) : if not arg_0 . has_section ( arg_3 ) : continue arg_4 = arg_0 . options ( arg_3 ) arg_5 = [ arg_0 . get ( arg_3 , arg_6 , raw = True ) for arg_6 in arg_4 ] for arg_6 in arg_4 : arg_7 = "%(" + arg_6 + ")s" for arg_8 in arg_5 : if arg_7 in arg_8 : break else : arg_2 . add ( arg_6 ) return list ( arg_2 )

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: Isolate change clusters by eliminating ranges with no changes .

def Func ( arg_0 , arg_1 = 3 ) : arg_2 = arg_0 . get_opcodes ( ) if not arg_2 : arg_2 = [ ( "equal" , 0 , 1 , 0 , 1 ) ] if arg_2 [ 0 ] [ 0 ] == 'equal' : arg_3 , arg_4 , arg_5 , arg_6 , arg_7 = arg_2 [ 0 ] arg_2 [ 0 ] = arg_3 , max ( arg_4 , arg_5 - arg_1 ) , arg_5 , max ( arg_6 , arg_7 - arg_1 ) , arg_7 if arg_2 [ - 1 ] [ 0 ] == 'equal' : arg_3 , arg_4 , arg_5 , arg_6 , arg_7 = arg_2 [ - 1 ] arg_2 [ - 1 ] = arg_3 , arg_4 , min ( arg_5 , arg_4 + arg_1 ) , arg_6 , min ( arg_7 , arg_6 + arg_1 ) arg_8 = arg_1 + arg_1 arg_9 = [ ] for arg_3 , arg_4 , arg_5 , arg_6 , arg_7 in arg_2 : if arg_3 == 'equal' and arg_5 - arg_4 > arg_8 : arg_9 . append ( ( arg_3 , arg_4 , min ( arg_5 , arg_4 + arg_1 ) , arg_6 , min ( arg_7 , arg_6 + arg_1 ) ) ) yield arg_9 arg_9 = [ ] arg_4 , arg_6 = max ( arg_4 , arg_5 - arg_1 ) , max ( arg_6 , arg_7 - arg_1 ) arg_9 . append ( ( arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) ) if arg_9 and not ( len ( arg_9 ) == 1 and arg_9 [ 0 ] [ 0 ] == 'equal' ) : yield arg_9

Read the maximum volume level of the device.


Question: Run a process return a deferred that fires when it is done

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = defer . Deferred ( ) arg_5 = ProcessProtocol ( arg_4 ) arg_6 = arg_3 . spawnProcess ( arg_5 , arg_0 [ 0 ] , arg_0 , env = os . environ ) def _logEnded ( arg_7 ) : arg_7 . trap ( tierror . ProcessDone , tierror . ProcessTerminated ) print ( arg_7 . value ) arg_4 . addErrback ( _logEnded ) def _cancelTermination ( arg_8 ) : for arg_9 in arg_10 : if arg_9 . active ( ) : arg_9 . cancel ( ) arg_4 . addCallback ( _cancelTermination ) arg_10 = [ ] arg_10 . append ( arg_3 . callLater ( arg_1 , arg_6 . signalProcess , "TERM" ) ) arg_10 . append ( arg_3 . callLater ( arg_1 + arg_2 , arg_6 . signalProcess , "KILL" ) ) return arg_4


Question: Collection content browsing route function

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . resolver . getMetadata ( arg_1 ) return { "template" : "main::collection.html" , "collections" : { "current" : { "label" : str ( arg_3 . get_label ( arg_2 ) ) , "id" : arg_3 . id , "model" : str ( arg_3 . model ) , "type" : str ( arg_3 . type ) , } , "members" : arg_0 . make_members ( arg_3 , arg_2 = arg_2 ) , "parents" : arg_0 . make_parents ( arg_3 , arg_2 = arg_2 ) } , }


Question: Returns the interface name of the first not link_local and not loopback interface .

def Func ( ) : arg_0 = '' arg_1 = psutil . net_if_addrs ( ) for arg_2 , arg_3 in arg_1 . items ( ) : for arg_4 in arg_3 : if arg_4 . family == socket . AF_INET : arg_5 = ipaddress . ip_address ( arg_4 . address ) if not ( arg_5 . is_link_local or arg_5 . is_loopback ) : arg_0 = arg_2 break return arg_0

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


Question: Return the children of this process as a list of Process objects . If recursive is True return all the parent descendants .

def Func ( arg_0 , arg_1 = False ) : if not arg_0 . is_running ( ) : arg_2 = arg_0 . _platform_impl . _process_name raise NoSuchProcess ( arg_0 . pid , arg_2 ) arg_3 = [ ] if not arg_1 : for arg_4 in process_iter ( ) : try : if arg_4 . ppid == arg_0 . pid : if arg_0 . create_time <= arg_4 . create_time : arg_3 . append ( arg_4 ) except NoSuchProcess : pass else : arg_5 = defaultdict ( list ) for arg_4 in process_iter ( ) : try : arg_5 [ arg_4 . ppid ] . append ( arg_4 ) except NoSuchProcess : pass arg_6 = [ arg_0 . pid ] for arg_7 in arg_6 : for arg_8 in arg_5 [ arg_7 ] : try : arg_9 = arg_0 . create_time <= arg_8 . create_time except NoSuchProcess : pass else : if arg_9 : arg_3 . append ( arg_8 ) if arg_8 . pid not in arg_6 : arg_6 . append ( arg_8 . pid ) return arg_3

Register a file reader for use in parse_config_file.

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

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

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

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

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


Question: Init a uniform noise variable .

def Func ( arg_0 ) : return np . random . rand ( 1 ) * np . random . uniform ( arg_0 , 1 ) + random . sample ( [ 2 , - 2 ] , 1 )


Question: Create a deep copy of the KeypointsOnImage object .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : arg_1 = [ kp . Func ( ) for kp in arg_0 . keypoints ] if arg_2 is None : arg_2 = tuple ( arg_0 . shape ) return KeypointsOnImage ( arg_1 , arg_2 )

- Value of purchases and sales divided
    by either the actual gross book or the portfolio value
    for the time step.

    Parameters
    ----------
    positions : pd.DataFrame
        Contains daily position values including cash.
        - See full explanation in tears.create_full_tear_sheet
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
        - See full explanation in tears.create_full_tear_sheet
    denominator : str, optional
        Either 'AGB' or 'portfolio_value', default AGB.
        - AGB (Actual gross book) is the gross market
        value (GMV) of the specific algo being analyzed.
        Swapping out an entire portfolio of stocks for
        another will yield 200% turnover, not 100%, since
        transactions are being made for both sides.
        - We use average of the previous and the current end-of-period
        AGB to avoid singularities when trading only into or
        out of an entire book in one trading period.
        - portfolio_value is the total value of the algo's
        positions end-of-period, including cash.

    Returns
    -------
    turnover_rate : pd.Series
        timeseries of portfolio turnover rates.


Question: Drops all views .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . database_renderer arg_4 = arg_3 . sudo ( "mysql --batch -v -h {db_host} " "-u {db_user} -p'{db_password}' " "--execute=\"SELECT GROUP_CONCAT(CONCAT(TABLE_SCHEMA,'.',table_name) SEPARATOR ', ') AS views " "FROM INFORMATION_SCHEMA.views WHERE TABLE_SCHEMA = '{db_name}' ORDER BY table_name DESC;\"" ) arg_4 = re . findall ( r'^views[\s\t\r\n]+(.*)' , arg_4 , flags = re . IGNORECASE | re . DOTALL | re . MULTILINE ) if not arg_4 : return arg_3 . env . db_view_list = arg_4 [ 0 ] arg_3 . sudo ( "mysql -v -h {db_host} -u {db_user} -p'{db_password}' " "--execute=\"DROP VIEW {db_view_list} CASCADE;\"" )


Question: Return Porter helper function _sb_has_vowel value .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 in arg_0 . _vowels : return True return False

Return a list of all enrollments for the passed section_id.

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


Question: Read a quoted form from the input stream .

def Func ( arg_0 : arg_1 ) -> llist . List : arg_2 = arg_0 . reader . advance ( ) assert arg_2 == "'" arg_3 = _read_next_consuming_comment ( arg_0 ) return llist . l ( _QUOTE , arg_3 )

Overriding the default JSONEncoder.default for NDB support.


Question: Ensure the user making the API request is associated with an EnterpriseCustomer .

def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_1 . user arg_5 = get_enterprise_customer_for_user ( arg_4 ) if arg_5 : arg_2 = arg_2 + ( arg_5 , ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) else : raise PermissionDenied ( 'User {username} is not associated with an EnterpriseCustomer.' . format ( username = arg_4 . username ) ) return wrapper

Returns mappable data for a random subset of voxels.

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

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

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


Question: Gets a re - labeled clone of this expression .

def Func ( arg_0 , arg_1 ) : return arg_0 . __class__ ( arg_1 . get ( arg_0 . alias , arg_0 . alias ) , arg_0 . target , arg_0 . hstore_key , arg_0 . output_field )

Return an existing or new ConversationWidget.


Question: Writes the weeks with associated commits to file .

def Func ( arg_0 ) : with open ( '../github_stats_output/last_year_commits.csv' , 'w+' ) as output : output . write ( 'date,organization,repos,members,teams,' + 'unique_contributors,total_contributors,forks,' + 'stargazers,pull_requests,open_issues,has_readme,' + 'has_license,pull_requests_open,pull_requests_closed,' + 'commits\n' ) arg_1 = 0 for arg_2 in arg_0 . sorted_weeks : if str ( arg_0 . commits [ arg_2 ] ) != arg_1 : arg_3 = datetime . datetime . utcfromtimestamp ( arg_2 ) . strftime ( '%Y-%m-%d' ) output . write ( arg_3 + ',llnl,0,0,0,0,0,0,0,0,0,0,0,0,0,' + str ( arg_0 . commits [ arg_2 ] ) + '\n' ) arg_1 = str ( arg_0 . commits [ 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: 230v power off

def Func ( arg_0 , arg_1 = 200 ) : if arg_0 . __Func_port is None : cij . err ( "cij.usb.relay: Invalid USB_RELAY_POWER_OFF" ) return 1 return arg_0 . __press ( arg_0 . __Func_port , arg_1 = arg_1 )

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


Question: Download the metadata . yaml file from a technote s GitHub repository .

async def Func ( arg_0 , arg_1 ) : arg_2 = _build_metadata_yaml_url ( arg_1 ) async with arg_0 . get ( arg_2 ) as response : response . raise_for_status ( ) arg_3 = await response . text ( ) return yaml . safe_load ( arg_3 )

Reshape input and output dimensions of operator.

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

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

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


Question: Creates a SecBufferDesc struct and contained SecBuffer structs

def Func ( arg_0 , arg_1 ) : arg_2 = new ( secur32 , 'SecBuffer[%d]' % arg_1 ) for arg_3 in range ( 0 , arg_1 ) : arg_2 [ arg_3 ] . cbBuffer = 0 arg_2 [ arg_3 ] . BufferType = Secur32Const . SECBUFFER_EMPTY arg_2 [ arg_3 ] . pvBuffer = null ( ) arg_7 = struct ( secur32 , 'SecBufferDesc' ) arg_8 = unwrap ( arg_7 ) arg_8 . ulVersion = Secur32Const . SECBUFFER_VERSION arg_8 . cBuffers = arg_1 arg_8 . pBuffers = arg_2 return ( arg_7 , arg_2 )


Question: Group in a dictionary all the DICOM files in dicom_paths separated by the given hdr_field tag value .

def Func ( arg_0 , arg_1 = 'PatientID' ) : arg_2 = defaultdict ( list ) try : for arg_3 in arg_0 : arg_4 = dicom . read_file ( arg_3 ) arg_5 = getattr ( arg_4 , arg_1 ) arg_2 [ arg_5 ] . append ( arg_3 ) except KeyError as ke : raise KeyError ( 'Error reading field {} from file {}.' . format ( arg_1 , arg_3 ) ) from ke return arg_2

Total time since the timer is started.

        Returns (float): Time in seconds.


Question: Process message stanza .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . stanza_type if arg_2 is None : arg_2 = "normal" if arg_0 . __try_handlers ( arg_0 . _message_handlers , arg_1 , arg_2 = arg_2 ) : return True if arg_2 not in ( "error" , "normal" ) : return arg_0 . __try_handlers ( arg_0 . _message_handlers , arg_1 , arg_2 = "normal" ) return False

Does google-lint on a single file.

  Args:
    filename: The name of the file to parse.

    vlevel: The level of errors to report.  Every error of confidence
    >= verbose_level will be reported.  0 is a good default.

    extra_check_functions: An array of additional check functions that will be
                           run on each source line. Each function takes 4
                           arguments: filename, clean_lines, line, error


Question: Checks the TUN adapter for data and returns any that is found .

def Func ( arg_0 ) : arg_1 = arg_0 . _TUN . _tun . read ( arg_0 . _TUN . _tun . mtu ) return ( arg_1 )

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: Select a solver for a given optimization problem .

def Func ( arg_0 = False , arg_1 = False ) : if len ( solvers ) == 0 : raise SolverNotFound ( "no solvers installed" ) arg_2 = [ "gurobi" , "cplex" , "glpk" ] arg_3 = [ "glpk" , "cplex" , "gurobi" ] arg_4 = [ "gurobi" , "cplex" ] if arg_0 is False and arg_1 is False : for arg_5 in arg_3 : if arg_5 in solvers : return arg_5 return list ( solvers ) [ 0 ] elif arg_1 : for arg_5 in arg_4 : if arg_5 in solvers : return arg_5 raise SolverNotFound ( "no qp-capable solver found" ) else : for arg_5 in arg_2 : if arg_5 in solvers : return arg_5 raise SolverNotFound ( "no mip-capable solver found" )

Converts py_zipkin's annotations dict to protobuf.

    :param annotations: annotations dict.
    :type annotations: dict
    :return: corresponding protobuf's list of annotations.
    :rtype: list