Question: Handle disco error response .

def Func ( arg_0 , arg_1 ) : try : arg_0 . error ( arg_1 . get_error ( ) ) except ProtocolError : from . . error import StanzaErrorNode arg_0 . error ( StanzaErrorNode ( "undefined-condition" ) )

Merge array field from the remote_issue into local_task

    * Local 'left' entries are preserved without modification
    * Remote 'left' are appended to task if not present in local.

    :param `field`: Task field to merge.
    :param `local_task`: `taskw.task.Task` object into which to merge
        remote changes.
    :param `remote_issue`: `dict` instance from which to merge into
        local task.
    :param `hamming`: (default `False`) If `True`, compare entries by
        truncating to maximum length, and comparing hamming distances.
        Useful generally only for annotations.


Question: Calculates the length of the route .

def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_0 . state if arg_1 is None else arg_1 arg_2 = arg_1 arg_3 = 0 if arg_0 . distance_matrix : for arg_4 in range ( len ( arg_2 ) ) : arg_3 += arg_0 . distance_matrix [ "{},{}" . format ( arg_2 [ arg_4 - 1 ] , arg_2 [ arg_4 ] ) ] else : for arg_4 in range ( len ( arg_2 ) ) : arg_3 += distance ( arg_0 . cities [ arg_2 [ arg_4 - 1 ] ] , arg_0 . cities [ arg_2 [ arg_4 ] ] ) return arg_3

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

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


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

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( Authentication , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) arg_7 = [ ] while arg_0 . is_tag_next ( arg_3 . Tags . CREDENTIAL , arg_6 ) : arg_8 = objects . Credential ( ) arg_8 . Func ( arg_6 , arg_2 = arg_2 ) arg_7 . append ( arg_8 ) if len ( arg_7 ) == 0 : raise ValueError ( "Authentication encoding missing credentials." ) arg_0 . _credentials = arg_7 arg_0 . is_oversized ( arg_6 )

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


Question: Safely join directory and filename .

def Func ( arg_0 , arg_1 ) : arg_1 = posixpath . normpath ( arg_1 ) for arg_2 in _os_alt_seps : if arg_2 in arg_1 : raise NotFound ( ) if os . path . isabs ( arg_1 ) or arg_1 == '..' or arg_1 . startswith ( '../' ) : raise NotFound ( ) return os . path . join ( arg_0 , arg_1 )

Compares and exchanges.

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

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

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

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


Question: Process measurement data .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { opendnp3 . ICollectionIndexedBinary : VisitorIndexedBinary , opendnp3 . ICollectionIndexedDoubleBitBinary : VisitorIndexedDoubleBitBinary , opendnp3 . ICollectionIndexedCounter : VisitorIndexedCounter , opendnp3 . ICollectionIndexedFrozenCounter : VisitorIndexedFrozenCounter , opendnp3 . ICollectionIndexedAnalog : VisitorIndexedAnalog , opendnp3 . ICollectionIndexedBinaryOutputStatus : VisitorIndexedBinaryOutputStatus , opendnp3 . ICollectionIndexedAnalogOutputStatus : VisitorIndexedAnalogOutputStatus , opendnp3 . ICollectionIndexedTimeAndInterval : VisitorIndexedTimeAndInterval } arg_4 = arg_3 [ type ( arg_2 ) ] arg_5 = arg_4 ( ) arg_2 . Foreach ( arg_5 ) for arg_6 , arg_7 in arg_5 . index_and_value : arg_8 = 'SOEHandler.Func {0}\theaderIndex={1}\tdata_type={2}\tindex={3}\tvalue={4}' _log . debug ( arg_8 . format ( arg_1 . gv , arg_1 . headerIndex , type ( arg_2 ) . __name__ , arg_6 , arg_7 ) )

Creates the variational distribution for LDA.

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

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


Question: Compares and exchanges .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . size arg_4 = { 8 : 'AL' , 16 : 'AX' , 32 : 'EAX' , 64 : 'RAX' } [ arg_3 ] arg_5 = arg_0 . read_register ( arg_4 ) arg_6 = arg_2 . read ( ) arg_7 = arg_1 . read ( ) arg_0 . write_register ( arg_4 , arg_7 ) arg_1 . write ( Operators . ITEBV ( arg_3 , arg_5 == arg_7 , arg_6 , arg_7 ) ) arg_0 . _calculate_CMP_flags ( arg_3 , arg_5 - arg_7 , arg_5 , arg_7 )

returns the classified labeling of record


Question: Strongly inspired from idlelib . ColorDelegator . make_pat


Question: Print a friendly message .

def Func ( ) : arg_0 = int ( choice ( str ( int ( time ( ) ) ) ) ) if not CONFIGURATION [ "quiet" ] and arg_0 % 3 == 0 : print ( "\n" + Fore . GREEN + Style . BRIGHT + "Thanks for using PyFunceble!" ) print ( Fore . YELLOW + Style . BRIGHT + "Share your experience on " + Fore . CYAN + "Twitter" + Fore . YELLOW + " with " + Fore . CYAN + "#PyFunceble" + Fore . YELLOW + "!" ) print ( Fore . GREEN + Style . BRIGHT + "Have a feedback, an issue or an improvement idea ?" ) print ( Fore . YELLOW + Style . BRIGHT + "Let us know on " + Fore . CYAN + "GitHub" + Fore . YELLOW + "!" )

Unregister an extension code.  For testing only.


Question: add a new markup section

def Func ( arg_0 ) : if arg_0 . markup and arg_0 . markup_lines : arg_1 = arg_0 . markup_lines if len ( arg_1 ) > 0 and not string . strip ( arg_1 [ - 1 ] ) : arg_0 . markup_lines = arg_1 [ : - 1 ] arg_3 = DocMarkup ( arg_0 . markup , arg_0 . markup_lines ) arg_0 . markups . append ( arg_3 ) arg_0 . markup = None arg_0 . markup_lines = [ ]

Return the number of jobs for the given clientInfo and a status that is
    not completed.


Question: Stores data starting from a node along a branch and starts recursively loading all data at end of branch .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 . STORE_DATA , arg_6 = True , arg_7 = False , arg_8 = None , arg_9 = None ) : if arg_3 == arg_4 . STORE_NOTHING : return if arg_8 is None : arg_8 = float ( 'inf' ) if arg_9 is None : arg_10 = arg_1 . v_full_name arg_11 = arg_10 . replace ( '.' , '/' ) try : if arg_10 == '' : arg_9 = arg_0 . _trajectory_group else : arg_9 = arg_0 . _hdf5file . get_node ( where = arg_0 . _trajectory_group , arg_15 = arg_11 ) except pt . NoSuchNodeError : arg_0 . _logger . debug ( 'Cannot store `%s` the parental hdf5 node with path `%s` does ' 'not exist on disk.' % ( arg_1 . v_name , arg_11 ) ) if arg_1 . v_is_leaf : arg_0 . _logger . error ( 'Cannot store `%s` the parental hdf5 ' 'node with path `%s` does ' 'not exist on disk! The child ' 'you want to store is a leaf node,' 'that cannot be stored without ' 'the parental node existing on ' 'disk.' % ( arg_1 . v_name , arg_11 ) ) raise else : arg_0 . _logger . debug ( 'I will try to store the path from trajectory root to ' 'the child now.' ) arg_0 . Func ( arg_1 . _nn_interface . _root_instance , arg_1 . v_full_name + '.' + arg_2 , arg_3 = arg_3 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 + arg_1 . v_depth , arg_9 = arg_0 . _trajectory_group ) return arg_12 = 1 arg_13 = arg_2 . split ( '.' ) arg_14 = arg_13 . pop ( ) for arg_15 in arg_13 : if arg_12 > arg_8 : return arg_0 . _tree_store_nodes_dfs ( arg_1 , arg_15 , arg_3 = arg_3 , arg_6 = arg_6 , arg_7 = False , arg_8 = arg_8 , arg_12 = arg_12 , parent_hdf5_group = arg_9 ) arg_12 += 1 arg_1 = arg_1 . _children [ arg_15 ] arg_9 = getattr ( arg_9 , arg_15 ) if arg_12 <= arg_8 : arg_0 . _tree_store_nodes_dfs ( arg_1 , arg_14 , arg_3 = arg_3 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_12 = arg_12 , parent_hdf5_group = arg_9 )

Sets the telemetry client for logging events.


Question: Does nothing currently . May not need this method

def Func ( arg_0 ) : arg_0 . sky_file = os . path . abspath ( os . path . join ( os . path . join ( arg_0 . input_path , 'sky_files' ) , 'sky_' + arg_0 . sky_state + '_z' + str ( arg_0 . sky_zenith ) + '_a' + str ( arg_0 . sky_azimuth ) + '_' + str ( arg_0 . num_bands ) + '_' + arg_0 . ds_code ) )

Returns participation data for the given sis_course_id.

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


Question: receives rlp . decoded serialized

def Func ( arg_0 , arg_1 , arg_2 ) : log . debug ( '----------------------------------' ) log . debug ( 'remote_transactions_received' , count = len ( arg_2 ) , remote_id = arg_1 ) def _add_txs ( ) : for arg_3 in arg_2 : arg_0 . add_transaction ( arg_3 , origin = arg_1 ) gevent . spawn ( _add_txs )

Return an open file-object to the index file


Question: Returns a string of comma - delimited key = value pairs .

def Func ( arg_0 , arg_1 ) : return ', ' . join ( '%s=%s' % ( arg_2 , arg_3 ) for arg_2 , arg_3 in sorted ( arg_1 . items ( ) ) )

Return the application-controlled IIN field.


Question: Calculate the tanimoto set similarity .

def Func ( arg_0 : arg_1 [ arg_2 ] , arg_3 : arg_1 [ arg_2 ] ) -> float : arg_4 , arg_5 = set ( arg_0 ) , set ( arg_3 ) arg_6 = arg_4 | arg_5 if not arg_6 : return 0.0 return len ( arg_4 & arg_5 ) / len ( arg_6 )

Cancel an IO block.

        block (AIOBlock)
            The IO block to cancel.

        Returns cancelled block's event data (see getEvents), or None if the
        kernel returned EINPROGRESS. In the latter case, event completion will
        happen on a later getEvents call.


Question: D and A emission rates for two populations .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = [ ] , [ ] for arg_4 , arg_5 in zip ( arg_0 , arg_1 ) : arg_6 , arg_7 = em_rates_from_E_DA ( arg_4 , arg_5 ) arg_2 . append ( arg_6 ) arg_3 . append ( arg_7 ) return arg_2 , arg_3

Start listening for events from Marathon, running a sync when we first
        successfully subscribe and triggering a sync on API request events.


Question: r Return logarithmic mean .

def Func ( arg_0 ) : if len ( arg_0 ) != len ( set ( arg_0 ) ) : raise AttributeError ( 'No two values in the nums list may be equal' ) arg_1 = 0 for arg_2 in range ( len ( arg_0 ) ) : arg_3 = 1 for arg_4 in range ( len ( arg_0 ) ) : if arg_2 != arg_4 : arg_3 *= math . log ( arg_0 [ arg_2 ] / arg_0 [ arg_4 ] ) arg_1 += arg_0 [ arg_2 ] / arg_3 return math . factorial ( len ( arg_0 ) - 1 ) * arg_1

This method is called before first step of simulation.


Question: returns a configuration object

def Func ( arg_0 ) : jocker_lgr . debug ( 'config file is: {0}' . format ( arg_0 ) ) try : jocker_lgr . debug ( 'importing config...' ) with open ( arg_0 , 'r' ) as c : return yaml . safe_load ( c . read ( ) ) except IOError as ex : jocker_lgr . error ( str ( ex ) ) raise RuntimeError ( 'cannot access config file' ) except yaml . parser . ParserError as ex : jocker_lgr . error ( 'invalid yaml file: {0}' . format ( ex ) ) raise RuntimeError ( 'invalid yaml file' )

Generate RENEWING time.

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

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


Question: Return a list of Processor objects .

def Func ( arg_0 , arg_1 = None ) : if arg_1 : return arg_0 . api . processor . get ( name = arg_1 ) [ 'objects' ] else : return arg_0 . api . processor . get ( ) [ 'objects' ]


Question: Iterate over dict keys .

def Func ( arg_0 , ** arg_1 ) : return iter ( arg_0 . keys ( ** arg_1 ) ) if IS_PY3 else arg_0 . Func ( ** arg_1 )

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


Question: Find the statements in self . code .

def Func ( arg_0 ) : for arg_1 in arg_0 . child_parsers ( ) : for arg_2 , arg_3 in arg_1 . _bytes_lines ( ) : yield arg_3


Question: A simple checker that connections are coming in descending order of departure time and that no departure time has been skipped .

def Func ( arg_0 , arg_1 ) : assert arg_1 <= arg_0 . _min_dep_time , "Labels should be entered in decreasing order of departure time." arg_2 = arg_0 . dep_times_to_index [ arg_1 ] if arg_0 . _min_dep_time < float ( 'inf' ) : arg_3 = arg_0 . dep_times_to_index [ arg_0 . _min_dep_time ] assert arg_3 == arg_2 or ( arg_3 == arg_2 - 1 ) , "dep times should be ordered sequentially" else : assert arg_2 is 0 , "first dep_time index should be zero (ensuring that all connections are properly handled)" arg_0 . _min_dep_time = arg_1

Add the currently mined information to the
        mined "database".

        :param to_add: The element to add.
        :type to_add: dict


Question: Dump the oauth2server Client .

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False , ** arg_4 ) : return dict ( name = arg_0 . name , description = arg_0 . description , website = arg_0 . website , user_id = arg_0 . user_id , client_id = arg_0 . client_id , client_secret = arg_0 . client_secret , is_confidential = arg_0 . is_confidential , is_internal = arg_0 . is_internal , _redirect_uris = arg_0 . _redirect_uris , _default_scopes = arg_0 . _default_scopes )

Return True, if childUri is a child of parentUri or maps to the same resource.

    Similar to <util.is_child_uri>_ ,  but this method also returns True, if parent
    equals child. ('/a/b' is considered identical with '/a/b/').


Question: Gets the object s children .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_2 . extend ( arg_1 . subgraphs ) arg_2 . extend ( arg_1 . clusters ) arg_2 . extend ( arg_1 . nodes ) arg_2 . extend ( arg_1 . edges ) return arg_2

Run stochastic volatility model.

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

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

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

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


Question: Composes a list of existing object into a new object in the same storage bucket_name

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not arg_2 or not len ( arg_2 ) : raise ValueError ( 'source_objects cannot be empty.' ) if not arg_1 or not arg_3 : raise ValueError ( 'bucket_name and destination_object cannot be empty.' ) arg_0 . log . info ( "Composing %s to %s in the bucket %s" , arg_2 , arg_3 , arg_1 ) arg_4 = arg_0 . get_conn ( ) arg_5 = arg_4 . get_bucket ( arg_1 ) arg_6 = arg_5 . blob ( arg_3 ) arg_6 . Func ( sources = [ arg_5 . blob ( blob_name = arg_7 ) for arg_7 in arg_2 ] ) arg_0 . log . info ( "Completed successfully." )

This method starts the thread that continuously runs to receive and interpret
        messages coming from Firmata. This must be the last method in this file
        It also checks the deque for messages to be sent to Firmata.


Question: Call plugins in a chain where the result of each plugin call is sent to the next plugin as input . The final output result is returned .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = None arg_4 = [ a for ( arg_4 , a ) in zip ( getattr ( arg_0 . method , 'static_args' , [ ] ) , arg_1 ) if arg_4 ] for arg_5 , arg_6 in arg_0 . plugins : arg_3 = arg_6 ( * arg_1 , ** arg_2 ) arg_1 = arg_4 [ : ] arg_1 . append ( arg_3 ) return arg_3

Create a new archive.

        The method creates in the filesystem a brand new archive with
        a random SHA1 as its name. The first byte of the hashcode will
        be the name of the subdirectory; the remaining bytes, the
        archive name.

        :returns: a new `Archive` object

        :raises ArchiveManagerError: when an error occurs creating the
            new archive


Question: Return the other node

def Func ( arg_0 , Func ) : if Func == arg_0 . node1 : return arg_0 . node2 elif Func == arg_0 . node2 : return arg_0 . node1 else : return None

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Compute nominal p - value .

def Func ( arg_0 , arg_1 ) : arg_2 = [ arg_0 < 0 , arg_0 >= 0 ] arg_3 = [ np . sum ( arg_1 < arg_0 . reshape ( len ( arg_0 ) , 1 ) , axis = 1 ) / np . sum ( arg_1 < 0 , axis = 1 ) , np . sum ( arg_1 >= arg_0 . reshape ( len ( arg_0 ) , 1 ) , axis = 1 ) / np . sum ( arg_1 >= 0 , axis = 1 ) ] arg_4 = np . select ( arg_2 , arg_3 ) return arg_4

Form for selecting products from an individual product category.

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

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

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


Question: r Covariance of the prior .

def Func ( arg_0 ) : from numpy_sugar . linalg import ddot , sum2diag arg_1 = arg_0 . _QS [ 0 ] [ 0 ] arg_2 = arg_0 . _QS [ 1 ] return sum2diag ( dot ( ddot ( arg_1 , arg_0 . v0 * arg_2 ) , arg_1 . T ) , arg_0 . v1 )


Question: Return a list of all enrollments for the passed section_id .

def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = SECTIONS_API . format ( arg_1 ) + "/enrollments" arg_4 = [ ] for arg_5 in arg_0 . _get_paged_resource ( arg_3 , arg_2 = arg_2 ) : arg_4 . append ( CanvasEnrollment ( data = arg_5 ) ) return arg_4

Configure the Outstation's database of input point definitions.

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


Question: Extract the list of NIFT names from the BEL resource and builds a dictionary mapping from the lowercased version to the uppercase version .

def Func ( ) -> Mapping [ str , str ] : arg_0 = get_bel_resource ( NIFT ) return { arg_1 . lower ( ) : arg_1 for arg_1 in arg_0 [ 'Values' ] }

Configure session for particular device

        Returns:
            tensorflow.Session


Question: Return message digest if a secret key was provided

def Func ( arg_0 ) : return hmac . new ( arg_0 . _secret , request . data , hashlib . sha1 ) . hexdigest ( ) if arg_0 . _secret else None

Wrapper method that calls the appropriate main updating methods of
        the inspection.

        It is meant to be used inside a loop (like while), so that it can
        continuously update the class attributes from the trace and log files.
        It already implements checks to parse these files only when they
        change, and they ignore entries that have been previously processes.


Question: Get any defined templates for configuration values .

def Func ( arg_0 ) : arg_1 = { } for arg_2 in six . iterkeys ( Task . FIELDS ) : arg_3 = '%s_template' % arg_2 if arg_3 in arg_0 . config : arg_1 [ arg_2 ] = arg_0 . config . get ( arg_3 ) return arg_1

Generate RENEWING time.

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

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


Question: This gets or creates a DB cursor for the current DB connection .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_1 in arg_0 . Funcs : return arg_0 . Funcs [ arg_1 ] else : if arg_2 : arg_0 . Funcs [ arg_1 ] = arg_0 . connection . Func ( Func_factory = psycopg2 . extras . DictCursor ) else : arg_0 . Funcs [ arg_1 ] = arg_0 . connection . Func ( ) return arg_0 . Funcs [ arg_1 ]


Question: Returns pretty - printed table of metrics .

def Func ( arg_0 , arg_1 = 5 ) : assert len ( arg_0 ) > 0 , "No metrics found" arg_2 = PrettyTable ( [ "Metric" , "mean" , "standard deviation" , "min" , "max" , "sum" , ] ) for arg_3 in arg_0 : arg_2 . add_row ( [ arg_3 . prettyPrintTitle ( ) ] + arg_3 . getStats ( ) ) return arg_2 . get_string ( ) . encode ( "utf-8" )

Manage the response when the server rejects a message.

        An undo is when required this client sends a message that the server
        refuses to pass on to the other clients playing the game.  When this
        happens, the client must undo the changes that the message made to the
        world before being sent or crash.  Note that unlike sync requests, undo
        requests are only reported to the client that sent the offending
        message.


Question: Return a list of not null values from the col_name column of df .

def Func ( arg_0 , arg_1 ) : _check_cols ( arg_0 , [ arg_1 ] ) if 'O' in arg_0 [ arg_1 ] or pd . np . issubdtype ( arg_0 [ arg_1 ] . dtype , str ) : return [ arg_2 . lower ( ) for arg_2 in arg_0 [ pd . notnull ( arg_0 ) ] [ arg_1 ] if not pd . isnull ( arg_2 ) ] else : return [ arg_2 for arg_2 in arg_0 [ pd . notnull ( arg_0 ) ] [ arg_1 ] if not pd . isnull ( arg_2 ) ]

Return byte-size of a memoryview or buffer.


Question: Searches elasticsearch for objects with the same address protocol port and state .

def Func ( arg_0 , arg_1 ) : arg_2 = Service . search ( ) arg_2 = arg_2 . filter ( "term" , address = arg_1 . address ) arg_2 = arg_2 . filter ( "term" , protocol = arg_1 . protocol ) arg_2 = arg_2 . filter ( "term" , port = arg_1 . port ) arg_2 = arg_2 . filter ( "term" , state = arg_1 . state ) if arg_2 . count ( ) : arg_3 = arg_2 [ 0 ] . execute ( ) [ 0 ] return arg_3 . meta . id else : return None

Import a HDF5 file into a numpy array.

    Arguments:
        hdf5_filename:  A string filename of a HDF5 datafile

    Returns:
        A numpy array with data from the HDF5 file


Question: Helper method for fetchone which returns the next row from a buffer . If the buffer is empty attempts to paginate through the result set for the next page and load it into the buffer .

def Func ( arg_0 ) : if not arg_0 . job_id : return None if len ( arg_0 . buffer ) == 0 : if arg_0 . all_pages_loaded : return None arg_1 = ( arg_0 . service . jobs ( ) . getQueryResults ( projectId = arg_0 . project_id , jobId = arg_0 . job_id , pageToken = arg_0 . page_token ) . execute ( num_retries = arg_0 . num_retries ) ) if 'rows' in arg_1 and arg_1 [ 'rows' ] : arg_0 . page_token = arg_1 . get ( 'pageToken' ) arg_3 = arg_1 [ 'schema' ] [ 'fields' ] arg_4 = [ field [ 'type' ] for field in arg_3 ] arg_5 = arg_1 [ 'rows' ] for arg_6 in arg_5 : arg_7 = ( [ _bq_cast ( vs [ 'v' ] , arg_4 [ idx ] ) for idx , vs in enumerate ( arg_6 [ 'f' ] ) ] ) arg_0 . buffer . append ( arg_7 ) if not arg_0 . page_token : arg_0 . all_pages_loaded = True else : arg_0 . page_token = None arg_0 . job_id = None arg_0 . page_token = None return None return arg_0 . buffer . pop ( 0 )

Return path to any existing user config files


Question: Set the action of the item .

def Func ( arg_0 , arg_1 ) : if arg_1 is None : if arg_0 . xmlnode . hasProp ( "action" ) : arg_0 . xmlnode . unsetProp ( "action" ) return if arg_1 not in ( "remove" , "update" ) : raise ValueError ( "Action must be 'update' or 'remove'" ) arg_1 = unicode ( arg_1 ) arg_0 . xmlnode . setProp ( "action" , arg_1 . encode ( "utf-8" ) )

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: Reduce noise in the audio signal by profiling and filtering . This effect is moderately effective at removing consistent background noise such as hiss or hum .

def Func ( arg_0 , arg_1 , arg_2 = 0.5 ) : if not os . path . exists ( arg_1 ) : raise IOError ( "profile_path {} does not exist." . format ( arg_1 ) ) if not is_number ( arg_2 ) or arg_2 < 0 or arg_2 > 1 : raise ValueError ( "amount must be a number between 0 and 1." ) arg_3 = [ 'Func' , arg_1 , '{:f}' . format ( arg_2 ) ] arg_0 . effects . extend ( arg_3 ) arg_0 . effects_log . append ( 'Func' ) return arg_0

Verify scrollbar is vertical

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success.
        @rtype: integer


Question: Handle an error gracefully . May be overridden .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = sys . exc_info ( ) arg_4 = arg_3 [ 1 ] if arg_4 . args [ 0 ] in ( 10053 , 10054 ) : _logger . error ( "*** Caught socket.error: {}" . format ( arg_4 ) ) return _logger . error ( "-" * 40 , file = sys . stderr ) _logger . error ( "<{}> Exception happened during processing of request from {}" . format ( threading . currentThread ( ) . ident , arg_2 ) ) _logger . error ( arg_2 , file = sys . stderr ) traceback . print_exc ( ) _logger . error ( "-" * 40 , file = sys . stderr ) _logger . error ( arg_1 , file = sys . stderr )

Generate RENEWING time.

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

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


Question: Return a formfield .

def Func ( arg_0 , ** arg_1 ) : arg_2 = { } if arg_0 . ppoi_field : arg_2 [ 'form_class' ] = SizedImageCenterpointClickDjangoAdminField if arg_1 . get ( 'widget' ) is AdminFileWidget : del arg_1 [ 'widget' ] arg_2 . update ( arg_1 ) return super ( VersatileImageField , arg_0 ) . Func ( ** arg_2 )

Initialize lookup table for string input of LCD fields


Question: Update an institute

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = arg_0 . obj [ 'adapter' ] LOG . info ( "Running scout update Func" ) try : arg_7 . update_Func ( internal_id = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , ) except Exception as err : LOG . warning ( err ) arg_0 . abort ( )

This finds a set of solutions for symbolic using policy.
            This raises TooManySolutions if more solutions than maxcount


Question: Add noise to the given input .

def Func ( arg_0 , arg_1 = 0.1 , arg_2 = True , arg_3 = True ) : if arg_2 and arg_3 : return numpy . abs ( arg_0 - ( numpy . random . random ( arg_0 . shape ) < arg_1 ) ) else : if arg_2 : return numpy . logical_and ( arg_0 , numpy . random . random ( arg_0 . shape ) > arg_1 ) if arg_3 : return numpy . logical_or ( arg_0 , numpy . random . random ( arg_0 . shape ) < arg_1 ) return arg_0


Question: Return random sentences .

def Func ( arg_0 = 2 , arg_1 = False ) : arg_2 = [ sntc . strip ( ) for sntc in random . sample ( get_dictionary ( 'lorem_ipsum' ) , arg_0 ) ] if arg_1 : return arg_2 else : return ' ' . join ( arg_2 )

Frees the memory used by all of the dynamically allocated C arrays.


Question: Load playlists from local filepaths .

def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 ( 'inf' ) ) : logger . info ( "Loading local playlists..." ) arg_4 = [ ] arg_5 = [ ] arg_6 = get_supported_filepaths ( arg_0 , SUPPORTED_PLAYLIST_FORMATS , arg_2 = arg_2 ) arg_4 , arg_5 = exclude_filepaths ( arg_6 , arg_1 = arg_1 ) logger . info ( "Excluded {0} local playlists" . format ( len ( arg_5 ) ) ) logger . info ( "Loaded {0} local playlists" . format ( len ( arg_4 ) ) ) return arg_4 , arg_5

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: Get google API credentials for user .

def Func ( arg_0 , arg_1 ) : try : if arg_0 . Func : arg_2 = flow_from_clientsecrets ( arg_1 [ "secrets" ] , scope = SCOPE , redirect_uri = "oob" ) sys . stdout . write ( "Follow this URL: {url} and grant access to calendar.\n" . format ( url = arg_2 . step1_get_authorize_url ( ) ) ) arg_3 = raw_input ( "Enter token:" ) arg_4 = arg_2 . step2_exchange ( arg_3 ) arg_5 = Storage ( os . path . join ( arg_1 [ "credentials" ] , "{username}.json" . format ( username = arg_0 . username ) ) ) arg_5 . put ( arg_4 ) arg_4 . set_store ( arg_5 ) else : arg_5 = Storage ( os . path . join ( arg_1 [ "credentials" ] , "{username}.json" . format ( username = arg_0 . username ) ) ) arg_4 = arg_5 . get ( ) except Exception , err : if not arg_0 . quiet : sys . stderr . write ( "ERROR: Getting google API credentials error. {err}\n" . format ( err = err ) ) sys . exit ( - 1 ) return arg_4

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: The list of search paths . It is built from registered finders which has paths property . Can be useful for compilers to resolve internal dependencies .

def Func ( arg_0 ) : if not hasattr ( arg_0 , '_paths' ) : Func = [ ] for arg_2 in arg_0 . finders : if hasattr ( arg_2 , 'paths' ) : Func . extend ( arg_2 . paths ) arg_0 . _paths = Func return arg_0 . _paths


Question: Looks up the precomputed adversarial image for a given image .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = np . square ( arg_0 . _input_images - arg_2 ) arg_4 = np . mean ( arg_3 , axis = tuple ( range ( 1 , arg_3 . ndim ) ) ) arg_5 = np . argmin ( arg_4 ) if arg_4 [ arg_5 ] > 0 : raise ValueError ( 'No precomputed output image for this image' ) return arg_0 . _output_images [ arg_5 ]

Receive ASGI websocket messages, ensuring valid state transitions.


Question: Random coincidence matrix .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . reshape ( - 1 , 1 ) return ( arg_3 . dot ( arg_3 . T ) - np . eye ( len ( arg_0 ) ) * arg_3 ) / ( arg_1 - 1 )

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


Question: Creates an AAAA record attached to this hosted zone .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 , arg_4 = None , arg_5 = None , arg_6 = None ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( AAAAResourceRecordSet , ** arg_2 )

Helper to read the contents of the given file or path into a string with the given encoding.
    Encoding defaults to 'utf-8', other useful encodings are 'ascii' and 'latin-1'.


Question: Add a feature to self .

def Func ( arg_0 , arg_1 ) : if arg_0 . has_feature ( arg_1 ) : return arg_2 = arg_0 . xmlnode . newChild ( None , "feature" , None ) arg_2 . setProp ( "var" , to_utf8 ( arg_1 ) )

Remove hidden notes and tag a CERN if detected.


Question: Run complete analysis and return results .

def Func ( arg_0 ) : try : arg_1 , arg_2 = arg_0 . kernel . iaca_analysis ( micro_architecture = arg_0 . machine [ 'micro-architecture' ] , arg_2 = arg_0 . asm_block , pointer_increment = arg_0 . pointer_increment , verbose = arg_0 . verbose > 2 ) except RuntimeError as e : print ( "IACA analysis failed: " + str ( e ) ) sys . exit ( 1 ) arg_3 = arg_1 [ 'throughput' ] arg_4 = arg_1 [ 'port cycles' ] arg_5 = arg_1 [ 'uops' ] arg_6 = abs ( arg_2 [ 'pointer_increment' ] // arg_0 . kernel . datatypes_size [ arg_0 . kernel . datatype ] ) arg_7 = arg_6 * arg_0 . kernel . datatypes_size [ arg_0 . kernel . datatype ] try : arg_8 = float ( arg_0 . machine [ 'cacheline size' ] ) / arg_7 except ZeroDivisionError as e : print ( "Too small block_size / pointer_increment:" , e , file = sys . stderr ) sys . exit ( 1 ) arg_4 = dict ( [ ( i [ 0 ] , i [ 1 ] * arg_8 ) for i in list ( arg_4 . items ( ) ) ] ) arg_5 = arg_5 * arg_8 arg_9 = arg_3 * arg_8 arg_10 = max ( [ v for k , v in list ( arg_4 . items ( ) ) if k in arg_0 . machine [ 'overlapping model' ] [ 'ports' ] ] ) arg_11 = max ( [ v for k , v in list ( arg_4 . items ( ) ) if k in arg_0 . machine [ 'non-overlapping model' ] [ 'ports' ] ] ) if arg_11 < arg_9 : arg_10 = arg_9 arg_0 . results = { 'port cycles' : arg_4 , 'cl throughput' : arg_0 . conv_cy ( arg_9 ) , 'uops' : arg_5 , 'T_nOL' : arg_11 , 'T_OL' : arg_10 , 'IACA output' : arg_1 [ 'output' ] , 'elements_per_block' : arg_6 , 'pointer_increment' : arg_2 [ 'pointer_increment' ] , 'flops per iteration' : sum ( arg_0 . kernel . _flops . values ( ) ) } return arg_0 . results

Generate RENEWING time.

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

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


Question: Add a torque to this body .

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_0 . ode_body . addRelTorque if arg_2 else arg_0 . ode_body . addTorque arg_3 ( arg_1 )

Generates the JSON report to plot the gene boxes

        Following the convention of the reports platform, this method returns
        a list of JSON/dict objects with the information about each entry in
        the abricate file. The information contained in this JSON is::

            {contig_id: <str>,
             seqRange: [<int>, <int>],
             gene: <str>,
             accession: <str>,
             coverage: <float>,
             identity: <float>
             }

        Note that the `seqRange` entry contains the position in the
        corresponding contig, not the absolute position in the whole assembly.

        Returns
        -------
        json_dic : list
            List of JSON/dict objects with the report data.


Question: Retrieve all builds from a job

def Func ( arg_0 , arg_1 ) : if arg_0 . blacklist_jobs and arg_1 in arg_0 . blacklist_jobs : logger . warning ( "Not getting blacklisted job: %s" , arg_1 ) return arg_2 = { 'depth' : arg_0 . detail_depth } arg_3 = urijoin ( arg_0 . base_url , "job" , arg_1 , "api" , "json" ) arg_4 = arg_0 . fetch ( arg_3 , arg_2 = arg_2 ) return arg_4 . text

Return an open file-object to the index file


Question: Remove duplicates from the stack in first - seen order .

def Func ( arg_0 : arg_1 ) -> arg_1 : arg_2 = lambda x , y : x if y in x else x + ( y , ) return reduce ( arg_2 , arg_0 , arg_1 ( ) )

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


Question: Generates an invoice for arbitrary items not held in a user s cart .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] for arg_5 , arg_6 in arg_3 : arg_7 = commerce . LineItem ( arg_5 = arg_5 , quantity = 1 , arg_6 = Decimal ( arg_6 ) , product = None , ) arg_4 . append ( arg_7 ) arg_8 = timezone . now ( ) + arg_2 return arg_0 . _generate ( arg_1 , None , arg_8 , arg_4 )

Retrieve the Engine-level model params from a Swarm model

  Args:
    modelID - Engine-level model ID of the Swarm model

  Returns:
    JSON-encoded string containing Model Params


Question: Open a file based at the AIMA root directory .

def Func ( arg_0 , arg_1 = 'r' ) : import utils arg_2 = os . path . dirname ( utils . __file__ ) return open ( apply ( os . path . join , [ arg_2 ] + arg_0 ) , arg_1 )

Generate RENEWING time.

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

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


Question: Function to create a new empty las data object

def Func ( * , arg_0 = 0 , arg_1 = None ) : if arg_1 is not None : dims . raise_if_version_not_compatible_with_fmt ( arg_0 , arg_1 ) else : arg_1 = dims . min_file_version_for_point_format ( arg_0 ) arg_2 = headers . HeaderFactory . new ( arg_1 ) arg_2 . point_format_id = arg_0 if arg_1 >= "1.4" : return las14 . LasData ( arg_2 = arg_2 ) return las12 . LasData ( arg_2 = arg_2 )

Subscribe to device status messages

        # Parameters
        typeId (string): typeId for the subscription, optional.  Defaults to all device types (MQTT `+` wildcard)
        deviceId (string): deviceId for the subscription, optional.  Defaults to all devices (MQTT `+` wildcard)

        # Returns
        int: If the subscription was successful then the return Message ID (mid) for the subscribe request
            will be returned. The mid value can be used to track the subscribe request by checking against
            the mid argument if you register a subscriptionCallback method.
            If the subscription fails then the return value will be `0`


Question: add additional parameters to parser

def Func ( arg_0 ) : for arg_1 in arg_0 : cli_args . add_verbose ( arg_1 ) cli_args . add_config ( arg_1 ) arg_1 . add_argument ( '--heron-dir' , default = config . get_heron_dir ( ) , help = 'Path to Heron home directory' )

Appends transactions that close out all positions at the end of
    the timespan covered by positions data. Utilizes pricing information
    in the positions DataFrame to determine closing price.

    Parameters
    ----------
    positions : pd.DataFrame
        The positions that the strategy takes over time.
    transactions : pd.DataFrame
        Prices and amounts of executed round_trips. One row per trade.
        - See full explanation in tears.create_full_tear_sheet

    Returns
    -------
    closed_txns : pd.DataFrame
        Transactions with closing transactions appended.


Question: Check whether the certificate has expired .

def Func ( arg_0 ) : arg_1 = _native ( arg_0 . get_notAfter ( ) ) arg_2 = datetime . datetime . strptime ( arg_1 , "%Y%m%d%H%M%SZ" ) return arg_2 < datetime . datetime . utcnow ( )

Overrides Django's default to_python to allow correct
        translation to instance.


Question: Print message via subprocess . call function .

def Func ( arg_0 = None ) : arg_1 = { 'stdout' : sys . stdout , 'stderr' : sys . stderr , 'shell' : True } return subprocess . call ( 'echo "{0}"' . format ( arg_0 or '' ) , ** arg_1 )

Serialize a dataframe.

    Parameters
    ----------
    writer : file
        File-like object to write to. Must be opened in binary mode.
    data_type_id : dict
        Serialization format to use.
        See the azureml.DataTypeIds class for constants.
    dataframe: pandas.DataFrame
        Dataframe to serialize.


Question: Renders a list of archived messages for the current user

def Func ( arg_0 , arg_1 = 10 ) : if "user" in arg_0 : arg_2 = arg_0 [ "user" ] if arg_2 . is_authenticated ( ) : arg_3 = MessageArchive . objects . select_related ( "message" ) . filter ( arg_2 = arg_2 ) return { "messages" : arg_3 [ : arg_1 ] , "count" : arg_3 . count ( ) , }

Handle registration form received.

        [client only]

        Call self.registration_callback with the registration form received
        as the argument. Use the value returned by the callback will be a
        filled-in form.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.iq.Iq`


Question: Install setuptools from scratch using installer

def Func ( arg_0 , arg_1 ) : with cd ( "/tmp" ) : download ( EZ_SETUP_URL ) arg_2 = '%(python_cmd)s ez_setup.py' % locals ( ) if arg_1 : run_as_root ( arg_2 ) else : run ( arg_2 ) run ( 'rm -f ez_setup.py' )

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


Question: Subscribe to the data stream .

def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = c_int ( ) lib . lsl_Func ( arg_0 . obj , c_double ( arg_1 ) , byref ( arg_3 ) ) handle_error ( arg_3 )

Set the time against which the certificates are verified.

        Normally the current time is used.

        .. note::

          For example, you can determine if a certificate was valid at a given
          time.

        .. versionadded:: 17.0.0

        :param datetime vfy_time: The verification time to set on this store.
        :return: ``None`` if the verification time was successfully set.


Question: Unencrypt data for all users .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_2 . info ( "Beginning re-encryption for all users." ) for arg_3 in all_user_ids ( arg_0 ) : unencrypt_single_user ( arg_0 = arg_0 , arg_3 = arg_3 , old_crypto = arg_1 ( arg_3 ) , arg_2 = arg_2 , ) arg_2 . info ( "Finished re-encryption for all users." )


Question: Append an instruction to the end of the circuit modifying the circuit in place .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_2 = arg_2 or [ ] arg_3 = arg_3 or [ ] if not isinstance ( arg_1 , Instruction ) and hasattr ( arg_1 , 'to_instruction' ) : arg_1 = arg_1 . to_instruction ( ) if not isinstance ( arg_1 , Instruction ) : raise QiskitError ( 'object is not an Instruction.' ) arg_0 . _check_dups ( arg_2 ) arg_0 . _check_qargs ( arg_2 ) arg_0 . _check_cargs ( arg_3 ) if arg_1 . num_qubits != len ( arg_2 ) or arg_1 . num_clbits != len ( arg_3 ) : raise QiskitError ( "instruction %s with %d qubits and %d clbits " "cannot be Funced onto %d qubits and %d clbits." % ( arg_1 . name , arg_1 . num_qubits , arg_1 . num_clbits , len ( arg_2 ) , len ( arg_3 ) ) ) arg_4 = arg_1 , arg_2 , arg_3 arg_0 . data . Func ( arg_4 ) for arg_5 , arg_6 in enumerate ( arg_1 . params ) : if isinstance ( arg_6 , Parameter ) : arg_7 = arg_0 . parameters if arg_6 in arg_7 : arg_0 . _parameter_table [ arg_6 ] . Func ( ( arg_1 , arg_5 ) ) else : arg_0 . _parameter_table [ arg_6 ] = [ ( arg_1 , arg_5 ) ] return arg_1

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


Question: Restore Python settings to the original states

def Func ( arg_0 ) : arg_1 = arg_0 . orig_settings arg_2 . setrecursionlimit ( arg_1 [ "sys.recursionlimit" ] ) if "sys.tracebacklimit" in arg_1 : arg_2 . tracebacklimit = arg_1 [ "sys.tracebacklimit" ] else : if hasattr ( arg_2 , "tracebacklimit" ) : del arg_2 . tracebacklimit if "showwarning" in arg_1 : arg_4 . showwarning = arg_1 [ "showwarning" ] arg_1 . clear ( ) threading . stack_size ( )

Read the data encoding the SignatureVerify response payload and decode
        it into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.


Question: Decompose a feature matrix .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = True , ** arg_5 ) : if arg_2 is None : if arg_4 is False : raise ParameterError ( 'fit must be True if transformer is None' ) arg_2 = sklearn . decomposition . NMF ( arg_1 = arg_1 , ** arg_5 ) if arg_1 is None : arg_1 = arg_0 . shape [ 0 ] if arg_4 : arg_6 = arg_2 . fit_transform ( arg_0 . T ) . T else : arg_6 = arg_2 . transform ( arg_0 . T ) . T arg_7 = arg_2 . components_ . T if arg_3 : arg_7 , arg_8 = util . axis_sort ( arg_7 , index = True ) arg_6 = arg_6 [ arg_8 ] return arg_7 , arg_6

Utility for creating continuous palette from the cubehelix system.

    This produces a colormap with linearly-decreasing (or increasing)
    brightness. That means that information will be preserved if printed to
    black and white or viewed by someone who is colorblind.

    Parameters
    ----------
    start : float (0 <= start <= 3)
        The hue at the start of the helix.
    rot : float
        Rotations around the hue wheel over the range of the palette.
    gamma : float (0 <= gamma)
        Gamma factor to emphasize darker (gamma < 1) or lighter (gamma > 1)
        colors.
    hue : float (0 <= hue <= 1)
        Saturation of the colors.
    dark : float (0 <= dark <= 1)
        Intensity of the darkest color in the palette.
    light : float (0 <= light <= 1)
        Intensity of the lightest color in the palette.
    reverse : bool
        If True, the palette will go from dark to light.

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        :class:`int` parameter ``n`` and returns ``n``
        equally spaced colors.

    References
    ----------
    Green, D. A. (2011). "A colour scheme for the display of astronomical
    intensity images". Bulletin of the Astromical Society of India, Vol. 39,
    p. 289-295.

    Examples
    --------
    >>> palette = cubehelix_pal()
    >>> palette(5)
    ['#edd1cb', '#d499a7', '#aa688f', '#6e4071', '#2d1e3e']


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

def Func ( arg_0 , arg_1 ) : if arg_0 is None or arg_0 . get ( 'SecondaryStatusTransitions' ) is None or len ( arg_0 . get ( 'SecondaryStatusTransitions' ) ) == 0 : return '' arg_2 = arg_1 . get ( 'SecondaryStatusTransitions' ) if arg_1 is not None else None arg_3 = len ( arg_1 [ 'SecondaryStatusTransitions' ] ) if arg_2 is not None else 0 arg_4 = arg_0 [ 'SecondaryStatusTransitions' ] arg_5 = arg_4 [ - 1 : ] if len ( arg_4 ) == arg_3 else arg_4 [ arg_3 - len ( arg_4 ) : ] arg_6 = [ ] for arg_7 in arg_5 : arg_8 = arg_7 [ 'StatusMessage' ] arg_9 = timezone . convert_to_utc ( arg_0 [ 'LastModifiedTime' ] ) . strftime ( '%Y-%m-%d %H:%M:%S' ) arg_6 . append ( '{} {} - {}' . format ( arg_9 , arg_7 [ 'Status' ] , arg_8 ) ) return '\n' . join ( arg_6 )


Question: Activity tick handler ; services all activities

def Func ( arg_0 ) : for arg_1 in arg_0 . __activities : if not arg_1 . iteratorHolder [ 0 ] : continue try : next ( arg_1 . iteratorHolder [ 0 ] ) except StopIteration : arg_1 . cb ( ) if arg_1 . repeating : arg_1 . iteratorHolder [ 0 ] = iter ( xrange ( arg_1 . period ) ) else : arg_1 . iteratorHolder [ 0 ] = None return True

Query for if date_field is within number of "days" from now.


Question: Push a list of samples into the outlet .

def Func ( arg_0 , arg_1 , arg_2 = 0.0 , arg_3 = True ) : try : arg_4 = arg_0 . channel_count * len ( arg_1 ) arg_5 = ( arg_0 . value_type * arg_4 ) . from_buffer ( arg_1 ) handle_error ( arg_0 . do_Func ( arg_0 . obj , arg_5 , c_long ( arg_4 ) , c_double ( arg_2 ) , c_int ( arg_3 ) ) ) except TypeError : if len ( arg_1 ) : if type ( arg_1 [ 0 ] ) is list : arg_1 = [ v for sample in arg_1 for v in sample ] if arg_0 . channel_format == cf_string : arg_1 = [ v . encode ( 'utf-8' ) for v in arg_1 ] if len ( arg_1 ) % arg_0 . channel_count == 0 : arg_6 = arg_0 . value_type * len ( arg_1 ) handle_error ( arg_0 . do_Func ( arg_0 . obj , arg_6 ( * arg_1 ) , c_long ( len ( arg_1 ) ) , c_double ( arg_2 ) , c_int ( arg_3 ) ) ) else : raise ValueError ( "each sample must have the same number of " "channels." )

Reassemble a Binder object coming out of the database.


Question: Use ftfy to detect the encoding of a file based on a sample of its first megabyte .

def Func ( arg_0 ) : with open ( arg_0 , 'rb' ) as opened : arg_1 = opened . read ( 2 ** 20 ) arg_2 , arg_3 = ftfy . guess_bytes ( arg_1 ) return arg_3

Substitute constants in expression unless it is already a number.


Question: Calculates the false alarm probabilities of periodogram peaks using bootstrap resampling of the magnitude time series .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 250 , arg_5 = False , arg_6 = 10.0 , arg_7 = None ) : if ( arg_7 and ( 0 < arg_7 < len ( arg_0 [ 'nbestperiods' ] ) ) ) : arg_8 = arg_7 else : LOGWARNING ( 'npeaks not specified or invalid, ' 'getting FAP for all %s periodogram peaks' % len ( arg_0 [ 'nbestperiods' ] ) ) arg_8 = len ( arg_0 [ 'nbestperiods' ] ) arg_9 = arg_0 [ 'nbestperiods' ] [ : arg_8 ] arg_10 = arg_0 [ 'nbestlspvals' ] [ : arg_8 ] arg_11 , arg_12 , arg_13 = sigclip_magseries ( arg_1 , arg_2 , arg_3 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_14 = [ ] arg_15 = [ ] arg_16 = [ ] arg_17 = [ ] if len ( arg_11 ) > 9 and len ( arg_12 ) > 9 and len ( arg_13 ) > 9 : for arg_18 , arg_19 , arg_20 in zip ( range ( len ( arg_9 ) ) , arg_9 , arg_10 ) : LOGINFO ( 'peak %s: running %s trials...' % ( arg_18 + 1 , arg_4 ) ) arg_21 = [ ] for arg_22 in range ( arg_4 ) : arg_23 = np . random . randint ( 0 , high = arg_2 . size , size = arg_2 . size ) if 'kwargs' in arg_0 : arg_24 = arg_0 [ 'kwargs' ] arg_24 . update ( { 'magsarefluxes' : arg_5 , 'sigclip' : arg_6 , 'verbose' : False } ) else : arg_24 = { 'magsarefluxes' : arg_5 , 'sigclip' : arg_6 , 'verbose' : False } arg_25 = LSPMETHODS [ arg_0 [ 'method' ] ] ( arg_1 , arg_2 [ arg_23 ] , arg_3 [ arg_23 ] , ** arg_24 ) arg_21 . append ( arg_25 [ 'bestlspval' ] ) arg_21 = np . array ( arg_21 ) arg_17 . append ( arg_21 ) if arg_0 [ 'method' ] != 'pdm' : arg_26 = ( ( 1.0 + arg_21 [ arg_21 > arg_20 ] . size ) / ( arg_21 . size + 1.0 ) ) else : arg_26 = ( ( 1.0 + arg_21 [ arg_21 < arg_20 ] . size ) / ( arg_21 . size + 1.0 ) ) LOGINFO ( 'FAP for peak %s, period: %.6f = %.3g' % ( arg_18 + 1 , arg_19 , arg_26 ) ) arg_14 . append ( arg_20 ) arg_15 . append ( arg_19 ) arg_16 . append ( arg_26 ) return { 'peaks' : arg_14 , 'periods' : arg_15 , 'probabilities' : arg_16 , 'alltrialbestpeaks' : arg_17 } else : LOGERROR ( 'not enough mag series points to calculate periodogram' ) return None


Question: Build a function that handles downloading OBO data and parsing it into a NetworkX object .

def Func ( arg_0 : arg_1 , arg_2 : arg_1 , * , arg_3 : arg_4 [ arg_1 ] = None , ) -> Callable [ [ arg_4 [ arg_1 ] , arg_8 , arg_8 ] , MultiDiGraph ] : arg_5 = make_downloader ( arg_0 , arg_2 ) def get_obo ( arg_6 : arg_4 [ arg_1 ] = None , arg_7 : arg_8 = True , arg_9 : arg_8 = False ) -> MultiDiGraph : if arg_3 is not None and os . path . exists ( arg_3 ) : return read_gpickle ( arg_3 ) if arg_6 is None and arg_7 : arg_6 = arg_5 ( arg_9 = arg_9 ) arg_10 = obonet . read_obo ( arg_6 ) if arg_3 is not None : write_gpickle ( arg_10 , arg_3 ) return arg_10 return get_obo


Question: This function deal with the keystone notification .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ 'event_type' ] arg_3 = keystone_customer_process . get ( arg_2 ) if arg_3 is not None : arg_3 ( arg_0 , arg_1 ) else : arg_4 = False arg_5 = None for arg_6 in keystone_customer_process_wildcard . keys ( ) : if arg_6 . match ( arg_2 ) : arg_5 = keystone_customer_process_wildcard . get ( arg_6 ) arg_4 = True break if arg_4 : arg_5 ( arg_0 , arg_1 ) else : default_process ( arg_0 , arg_1 ) arg_1 . ack ( )

Creates the tf.train.Scaffold object and assigns it to self.scaffold.
        Other fields of the Scaffold are generated automatically.


Question: Return a root jsonschema for a given record

def Func ( arg_0 ) : arg_1 = SchemaGeneratorState ( ) arg_2 = get_schema_dict ( arg_0 , arg_1 ) del arg_1 . record_schemas [ arg_0 . _schema_name ] if arg_1 . record_schemas : arg_2 [ 'definitions' ] = dict ( ) for arg_3 , arg_4 in arg_1 . record_schemas . iteritems ( ) : arg_2 [ 'definitions' ] [ arg_3 ] = arg_4 return arg_2

Return the number of bytes transmitted in 1 second.


Question: Update a node in the symbol table .

def Func ( arg_0 , arg_1 ) : if arg_1 . name in arg_0 . current_symtab : arg_2 = arg_0 . current_symtab [ arg_1 . name ] raise QasmError ( "Duplicate declaration for" , arg_1 . type + " '" + arg_1 . name + "' at line" , str ( arg_1 . line ) + ', file' , arg_1 . file + '.\nPrevious occurrence at line' , str ( arg_2 . line ) + ', file' , arg_2 . file ) arg_0 . current_symtab [ arg_1 . name ] = arg_1

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

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

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


Question: a task has become unreachable send a reply with an ImpossibleDependency error .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . ImpossibleDependency ) : if arg_1 not in arg_0 . depending : arg_0 . log . error ( "msg %r already failed!" , arg_1 ) return arg_5 = arg_0 . depending . pop ( arg_1 ) for arg_6 in arg_5 . dependents : if arg_6 in arg_0 . graph : arg_0 . graph [ arg_6 ] . remove ( arg_1 ) try : raise arg_2 ( ) except : arg_7 = arg_3 . wrap_exception ( ) arg_0 . all_done . add ( arg_1 ) arg_0 . all_failed . add ( arg_1 ) arg_8 = arg_0 . session . send ( arg_0 . client_stream , 'apply_reply' , arg_7 , parent = arg_5 . header , ident = arg_5 . idents ) arg_0 . session . send ( arg_0 . mon_stream , arg_8 , ident = [ b'outtask' ] + arg_5 . idents ) arg_0 . update_graph ( arg_1 , success = 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: Remove median divide by IQR .

def Func ( arg_0 ) : if sum ( ~ np . isnan ( arg_0 ) ) > 2 : arg_1 = arg_0 [ ~ np . isnan ( arg_0 ) ] arg_2 = np . median ( arg_1 ) arg_3 = np . diff ( np . percentile ( arg_1 , [ 25 , 75 ] ) ) return ( arg_0 - arg_2 ) / arg_3 else : return np . full ( arg_0 . shape , np . nan )

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: Reads TESS Ames - format FITS light curve files .

def Func ( arg_0 , arg_1 , arg_2 = 2 ) : warnings . warn ( "Use the astrotess.read_tess_fitslc and " "astrotess.consolidate_tess_fitslc functions instead of this function. " "This function will be removed in astrobase v0.4.2." , FutureWarning ) if arg_1 not in ( 'PDCSAP' , 'SAP' ) : raise ValueError ( 'unknown light curve type requested: %s' % arg_1 ) arg_3 = pyfits . open ( arg_0 ) arg_4 = arg_3 [ 0 ] . header arg_5 = arg_3 [ 1 ] . header arg_6 = arg_3 [ 1 ] . data if ( ( 'Ames' not in arg_4 [ 'ORIGIN' ] ) or ( 'LIGHTCURVE' not in arg_5 [ 'EXTNAME' ] ) ) : raise ValueError ( 'could not understand input LC format. ' 'Is it a TESS TOI LC file?' ) arg_7 = arg_6 [ 'TIME' ] arg_8 = arg_6 [ '{:s}_FLUX' . format ( arg_1 ) ] arg_9 = arg_6 [ '{:s}_FLUX_ERR' . format ( arg_1 ) ] arg_10 = ( arg_6 [ 'QUALITY' ] == 0 ) arg_10 &= np . isfinite ( arg_7 ) arg_10 &= np . isfinite ( arg_8 ) arg_10 &= np . isfinite ( arg_9 ) arg_10 &= ~ np . isnan ( arg_7 ) arg_10 &= ~ np . isnan ( arg_8 ) arg_10 &= ~ np . isnan ( arg_9 ) arg_10 &= ( arg_7 != 0 ) arg_10 &= ( arg_8 != 0 ) arg_10 &= ( arg_9 != 0 ) arg_7 = arg_7 [ arg_10 ] arg_8 = arg_8 [ arg_10 ] arg_9 = arg_9 [ arg_10 ] arg_11 = np . abs ( np . nanmedian ( np . diff ( arg_7 ) ) * 24 * 60 - arg_2 ) if arg_11 > 1.0e-2 : raise ValueError ( 'the light curve is not at the required cadence specified: %.2f' % arg_2 ) arg_12 = np . nanmedian ( arg_8 ) arg_8 /= arg_12 arg_9 /= arg_12 return arg_7 , arg_8 , arg_9


Question: Export all genes from the database

def Func ( arg_0 , arg_1 = '37' ) : LOG . info ( "Exporting all genes to .bed format" ) for arg_2 in arg_0 . all_genes ( arg_1 = arg_1 ) : yield arg_2

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


Question: Create a secret link from request .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_0 . link = SecretLink . create ( arg_1 , arg_0 . receiver , extra_data = dict ( recid = arg_0 . recid ) , arg_2 = arg_2 , arg_3 = arg_3 , ) return arg_0 . link

Overriding the default JSONEncoder.default for NDB support.


Question: This converts from equatorial coords to galactic coords .

def Func ( arg_0 , arg_1 , arg_2 = 'J2000' ) : arg_3 = SkyCoord ( arg_0 = arg_0 * u . degree , dec = arg_1 * u . degree , arg_2 = arg_2 ) arg_4 = arg_3 . galactic . l . degree arg_5 = arg_3 . galactic . b . degree return arg_4 , arg_5


Question: In the leftmost empty column try all non - conflicting rows .

def Func ( arg_0 , arg_1 ) : if arg_1 [ - 1 ] is not None : return [ ] else : arg_2 = arg_1 . index ( None ) return [ arg_3 for arg_3 in range ( arg_0 . N ) if not arg_0 . conflicted ( arg_1 , arg_3 , arg_2 ) ]

module predict, return the predict label

        :param data_rdd: the data to be predict.
        :return: An RDD represent the predict label.


Question: Sets the item at index n to be the selected item .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_1 is None : arg_0 . wx_obj . SetSelection ( - 1 ) if hasattr ( arg_0 . wx_obj , "SetValue" ) : arg_0 . wx_obj . SetValue ( "" ) else : arg_0 . wx_obj . SetSelection ( arg_1 ) arg_3 = ItemContainerControlSelectEvent ( arg_0 . _commandtype , arg_1 , arg_0 . wx_obj ) if hasattr ( arg_0 , "onchange" ) and arg_0 . onchange : arg_4 = FormEvent ( name = "change" , arg_3 = arg_3 ) arg_0 . onchange ( arg_4 )

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

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

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


Question: Convert a given month into our unified format .

Run stochastic volatility model.

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

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

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

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


Question: Executes all satchel configurators to apply pending changes to the server .

def Func ( arg_0 , arg_1 = None , arg_2 = 0 ) : from burlap import notifier arg_3 = arg_0 . get_satchel ( 'service' ) arg_0 . lock ( ) try : arg_2 = int ( arg_2 ) if not arg_2 : if arg_0 . genv . host_string == arg_0 . genv . hosts [ 0 ] : execute ( partial ( arg_0 . preview , arg_1 = arg_1 , ask = 1 ) ) notifier . notify_pre_deployment ( ) arg_4 , arg_5 = arg_0 . get_component_funcs ( arg_1 = arg_1 ) arg_3 . pre_deploy ( ) for arg_6 , arg_7 in arg_5 : print ( 'Executing %s...' % arg_6 ) arg_7 ( ) arg_0 . fake ( arg_1 = arg_1 ) arg_3 . post_deploy ( ) notifier . notify_post_deployment ( ) finally : arg_0 . unlock ( )


Question: Plot analyte gradients as a function of time .

def Func ( arg_0 , arg_1 = None , arg_2 = 15 , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = None , arg_7 = [ 10 , 4 ] , arg_8 = 'All_Analyses' ) : if arg_5 is None : arg_5 = arg_0 . focus_stage if arg_6 is None : arg_6 = arg_0 . report_dir + '/' + arg_5 + '_gradient' if not os . path . isdir ( arg_6 ) : os . mkdir ( arg_6 ) if arg_8 is not None : arg_3 = arg_0 . _get_samples ( arg_8 ) elif arg_3 is None : arg_3 = arg_0 . subsets [ 'All_Analyses' ] elif isinstance ( arg_3 , str ) : arg_3 = [ arg_3 ] with arg_0 . pbar . set ( total = len ( arg_3 ) , desc = 'Drawing Plots' ) as prog : for arg_9 in arg_3 : arg_10 , arg_11 = arg_0 . data [ arg_9 ] . gplot ( arg_1 = arg_1 , arg_2 = arg_2 , arg_7 = arg_7 , arg_4 = arg_4 , focus_stage = arg_5 ) arg_10 . savefig ( arg_6 + '/' + arg_9 + '_gradients.pdf' ) plt . close ( arg_10 ) prog . update ( ) return

Drop a node from the network

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


Question: Convert value to a numeric value or raise a ValueError if that isn t possible .

def Func ( arg_0 ) : arg_1 = ForceNumeric . is_convertible ( arg_0 ) if not arg_1 or isinstance ( arg_0 , bool ) : raise ValueError if isinstance ( str ( arg_0 ) , str ) : return ForceNumeric . str_to_num ( arg_0 ) return float ( arg_0 )

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


Question: Calculate the modelled progress state for the given time moment .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 , arg_5 = arg_0 . _t0 , arg_0 . _x0 , arg_0 . _v0 , arg_0 . _ve arg_6 = ( arg_4 - arg_5 ) * math . exp ( - arg_0 . BETA * ( arg_1 - arg_2 ) ) arg_7 = arg_5 + arg_6 arg_8 = clamp ( arg_3 + arg_5 * ( arg_1 - arg_2 ) + ( arg_4 - arg_5 - arg_6 ) / arg_0 . BETA , 0 , 1 ) return arg_8 , arg_7

Remove hidden notes and tag a CERN if detected.


Question: Return the instance of RarInfo given name .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . NameToInfo . get ( arg_1 ) if arg_2 is None : raise KeyError ( 'There is no item named %r in the archive' % arg_1 ) return arg_2


Question: Accept request .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : with db . session . begin_nested ( ) : if arg_0 . status != RequestStatus . PENDING : raise InvalidRequestStateError ( RequestStatus . PENDING ) arg_0 . status = RequestStatus . ACCEPTED request_Funced . send ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )


Question: Opens a stream and reads 8192 bytes from it .

def Func ( arg_0 ) : global arg_1 try : arg_1 = arg_0 . open ( ) except StreamError as err : raise StreamError ( "Could not open stream: {0}" . format ( err ) ) try : log . debug ( "Pre-buffering 8192 bytes" ) arg_2 = arg_1 . read ( 8192 ) except IOError as err : arg_1 . close ( ) raise StreamError ( "Failed to read data from stream: {0}" . format ( err ) ) if not arg_2 : arg_1 . close ( ) raise StreamError ( "No data returned from stream" ) return arg_1 , arg_2

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: 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 .

def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 . temp_path , LOCAL_ODS ) try : po_to_ods ( arg_0 . languages , arg_0 . locale_root , arg_0 . po_files_path , arg_1 ) except ( IOError , OSError ) as e : raise PODocsError ( e ) arg_0 . _Func_file_to_gdoc ( arg_1 ) arg_0 . _clear_temp ( )


Question: Reads a list of assignments from the given node .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_2 . childNodes : if arg_4 . nodeType != minidom . Node . ELEMENT_NODE : continue if arg_4 . nodeName . lower ( ) == 'assign' : arg_3 . append ( arg_0 . deserialize_assign ( arg_1 , arg_4 ) ) else : _exc ( 'Unknown node: %s' % arg_4 . nodeName ) return arg_3

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


Question: Checks if a key exists in a bucket

def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : ( arg_2 , arg_1 ) = arg_0 . parse_s3_url ( arg_1 ) try : arg_0 . get_conn ( ) . head_object ( Bucket = arg_2 , Key = arg_1 ) return True except ClientError as e : arg_0 . log . info ( e . response [ "Error" ] [ "Message" ] ) return False

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: On Windows some default encodings are not provided by Python while they are always available as mbcs in each locale . Make them usable by aliasing to mbcs in such a case .

def Func ( ) : if sys . platform == 'win32' : import locale , codecs arg_0 = locale . getdefaultlocale ( ) [ 1 ] if arg_0 . startswith ( 'cp' ) : try : codecs . lookup ( arg_0 ) except LookupError : import arg_1 arg_1 . _cache [ arg_0 ] = arg_1 . _unknown arg_1 . aliases . aliases [ arg_0 ] = 'mbcs'

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

    :param commands: A list of dictionaries, the keys of which should line up
                     with the arguments to ``stream_command`` function.
    :type commands: ``list`` of ``dict``
    :param parallel: If true, commands will be run in parallel.
    :type parallel: ``bool``


Question: Acquires a lock before storage and releases it afterwards .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : try : arg_0 . acquire_lock ( ) return arg_0 . _storage_service . Func ( * arg_1 , ** arg_2 ) finally : if arg_0 . lock is not None : try : arg_0 . release_lock ( ) except RuntimeError : arg_0 . _logger . error ( 'Could not release lock `%s`!' % str ( arg_0 . lock ) )

Plot the interpolated envelope of pulse.

        Keyword Args:
            dt (float): Time interval of samples.
            interp_method (str): Method of interpolation
                (set `None` for turn off the interpolation).
            filename (str): Name required to save pulse image.
            interactive (bool): When set true show the circuit in a new window
                (this depends on the matplotlib backend being used supporting this).
            dpi (int): Resolution of saved image.
            nop (int): Data points for interpolation.
            size (tuple): Size of figure.


Question: Draw random samples from a multivariate normal distribution .

def Func ( arg_0 , arg_1 , arg_2 ) : from numpy . linalg import cholesky arg_3 = cholesky ( arg_2 ) return arg_3 @ arg_0 . randn ( arg_3 . shape [ 0 ] ) + arg_1

Indicates the start of a new sequence. Clears any predictions and makes sure
    synapses don't grow to the currently active cells in the next time step.


Question: Initialize the archive manager .

def Func ( arg_0 , arg_1 ) : if arg_1 == "" : raise ValueError ( "Archive manager path cannot be empty" ) if arg_1 : arg_0 . archive_manager = perceval . archive . ArchiveManager ( arg_1 )

Transform a QuantumChannel to the SuperOp representation.


Question: Get a list of all current joint torques in the skeleton .

def Func ( arg_0 ) : return as_flat_array ( getattr ( arg_1 , 'amotor' , arg_1 ) . feedback [ - 1 ] [ : arg_1 . ADOF ] for arg_1 in arg_0 . joints )

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


Question: Unpickle a possible compressed pickle .

def Func ( arg_0 , arg_1 = False ) : if arg_1 : with zipfile . ZipFile ( arg_0 , "r" , arg_1 = zipfile . ZIP_DEFLATED ) as myzip : with myzip . open ( "data" ) as f : return pickle . load ( f ) else : with open ( arg_0 , "rb" ) as f : return pickle . load ( f )

Enables uniform interface to value and batch jacobian calculation.

  Works in both eager and graph modes.

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

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


Question: Names of all state locations must be unique .

def Func ( arg_0 ) : arg_1 = map ( lambda loc : loc [ "name" ] , arg_0 . locations ) assert len ( arg_1 ) == len ( set ( arg_1 ) ) , "Names of state locations must be unique"

Issue a B read on V4 meter.

        Returns:
            bool: True if CRC match at end of call.


Question: Return the stoichiometric coefficient of a metabolite .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , Metabolite ) : return arg_0 . _metabolites [ arg_1 ] arg_2 = { m . id : m for m in arg_0 . _metabolites } return arg_0 . _metabolites [ arg_2 [ arg_1 ] ]

Returns a DataFrame of offensive team splits for a season.

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


Question: Get a code object from a . pyc file .

def Func ( arg_0 ) : try : arg_1 = open ( arg_0 , "rb" ) except IOError : raise NoCode ( "No file to run: %r" % arg_0 ) try : arg_2 = arg_1 . read ( 4 ) if arg_2 != imp . get_magic ( ) : raise NoCode ( "Bad magic number in .pyc file" ) arg_1 . read ( 4 ) if sys . version_info >= ( 3 , 3 ) : arg_1 . read ( 4 ) arg_3 = marshal . load ( arg_1 ) finally : arg_1 . close ( ) return arg_3

Creates a new node. Checks if the new node needs to know the trajectory.

        :param constructor:  The constructor to use
        :param full_name: Full name of node
        :param args: Arguments passed to constructor
        :param kwargs: Keyword arguments passed to the constructor
        :return:


Question: Replace the currently authenticated user s list of jobs with a new list of jobs

def Func ( arg_0 , arg_1 ) : arg_2 = { 'jobs[]' : arg_1 } arg_3 = make_put_request ( arg_0 , 'self/jobs' , arg_4 = arg_2 ) arg_4 = arg_3 . json ( ) if arg_3 . status_code == 200 : return arg_4 [ 'status' ] else : raise UserJobsNotSetException ( message = arg_4 [ 'message' ] , error_code = arg_4 [ 'error_code' ] , request_id = arg_4 [ 'request_id' ] )

Apply the criteria to filter out on the output required


Question: Check that the Paypal API keys are configured correctly

def Func ( arg_0 = None , ** arg_1 ) : arg_2 = [ ] arg_3 = getattr ( djpaypal_settings , "PAYPAL_MODE" , None ) if arg_3 not in VALID_MODES : arg_4 = "Invalid PAYPAL_MODE specified: {}." . format ( repr ( arg_3 ) ) arg_5 = "PAYPAL_MODE must be one of {}" . format ( ", " . join ( repr ( k ) for k in VALID_MODES ) ) arg_2 . append ( checks . Critical ( arg_4 , arg_5 = arg_5 , id = "djpaypal.C001" ) ) for arg_6 in "PAYPAL_CLIENT_ID" , "PAYPAL_CLIENT_SECRET" : if not getattr ( djpaypal_settings , arg_6 , None ) : arg_4 = "Invalid value specified for {}" . format ( arg_6 ) arg_5 = "Add PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET to your settings." arg_2 . append ( checks . Critical ( arg_4 , arg_5 = arg_5 , id = "djpaypal.C002" ) ) return arg_2

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: Apply pagination to query

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : assert isinstance ( arg_1 , peewee . Query ) assert isinstance ( arg_2 , int ) assert isinstance ( arg_3 , ( str , int , type ( None ) ) ) assert isinstance ( arg_4 , ( list , set , tuple , type ( None ) ) ) arg_5 = arg_1 . model . _meta . get_primary_keys ( ) if len ( arg_5 ) == 0 : raise peewee . ProgrammingError ( 'Cannot apply pagination on model without primary key' ) if len ( arg_5 ) > 1 : raise peewee . ProgrammingError ( 'Cannot apply pagination on model with compound primary key' ) if arg_3 is not None : arg_1 = arg_1 . where ( arg_5 [ 0 ] >= arg_3 ) arg_6 = [ ] if arg_4 : for arg_7 , arg_8 in arg_4 : if not isinstance ( arg_8 , str ) : raise ValueError ( "Invalid sort direction on field '{}'" . format ( arg_7 ) ) arg_8 = arg_8 . lower ( ) . strip ( ) if arg_8 not in [ 'asc' , 'desc' ] : raise ValueError ( "Invalid sort direction on field '{}'" . format ( arg_7 ) ) arg_9 = peewee . SQL ( arg_7 ) arg_9 = getattr ( arg_9 , arg_8 ) ( ) arg_6 += [ arg_9 ] arg_6 += [ arg_5 [ 0 ] . asc ( ) ] arg_1 = arg_1 . order_by ( * arg_6 ) arg_1 = arg_1 . limit ( arg_2 ) return arg_1

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


Question: Generate a series of lines one for each line in source .

def Func ( arg_0 ) : arg_1 = set ( [ token . INDENT , token . DEDENT , token . NEWLINE , tokenize . NL ] ) arg_2 = [ ] arg_3 = 0 arg_0 = arg_0 . expandtabs ( 8 ) . replace ( '\r\n' , '\n' ) arg_4 = generate_tokens ( arg_0 ) for arg_5 , arg_6 , ( arg_7 , arg_8 ) , ( arg_7 , arg_9 ) , arg_7 in phys_tokens ( arg_4 ) : arg_10 = True for arg_11 in re . split ( '(\n)' , arg_6 ) : if arg_11 == '\n' : yield arg_2 arg_2 = [ ] arg_3 = 0 arg_12 = False elif arg_11 == '' : arg_12 = False elif arg_5 in arg_1 : arg_12 = False else : if arg_10 and arg_8 > arg_3 : arg_2 . append ( ( "ws" , " " * ( arg_8 - arg_3 ) ) ) arg_10 = False arg_13 = tokenize . tok_name . get ( arg_5 , 'xx' ) . lower ( ) [ : 3 ] if arg_5 == token . NAME and keyword . iskeyword ( arg_6 ) : arg_13 = "key" arg_2 . append ( ( arg_13 , arg_11 ) ) arg_12 = True arg_8 = 0 if arg_12 : arg_3 = arg_9 if arg_2 : yield arg_2

Called when there is an error in the websocket


Question: Returns the linescore for the game as a DataFrame .

def Func ( arg_0 ) : arg_1 = arg_0 . get_main_doc ( ) arg_2 = arg_1 ( 'table#line_score' ) arg_3 = [ th . text ( ) for th in arg_2 ( 'tr.thead' ) . items ( 'th' ) ] arg_3 [ 0 ] = 'team_id' arg_4 = [ [ sportsref . utils . flatten_links ( td ) for td in tr ( 'td' ) . items ( ) ] for tr in arg_2 ( 'tr.thead' ) . next_all ( 'tr' ) . items ( ) ] return pd . DataFrame ( arg_4 , index = [ 'away' , 'home' ] , arg_3 = arg_3 , dtype = 'float' )


Question: Parses sitetree_children tag parameters .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split_contents ( ) arg_3 = detect_clause ( arg_0 , 'template' , arg_2 ) arg_4 = len ( arg_2 ) arg_5 = ( arg_4 == 5 and arg_2 [ 1 ] == 'of' and arg_2 [ 3 ] == 'for' and arg_2 [ 4 ] in ( 'menu' , 'sitetree' ) ) if arg_5 and arg_3 is not None : arg_6 = arg_2 [ 2 ] arg_7 = arg_2 [ 4 ] return FuncNode ( arg_6 , arg_7 , arg_3 ) else : raise template . TemplateSyntaxError ( '%r tag requires six arguments. ' 'E.g. {%% Func of someitem for menu template "sitetree/mychildren.html" %%}.' % arg_2 [ 0 ] )


Question: Runs one iteration of the Transformed Kernel .

def Func ( arg_0 , arg_1 , arg_2 ) : with tf . compat . v1 . name_scope ( name = mcmc_util . make_name ( arg_0 . name , 'transformed_kernel' , 'Func' ) , values = [ arg_2 ] ) : arg_3 , arg_4 = arg_0 . _inner_kernel . Func ( arg_2 . transformed_state , arg_2 . inner_results ) arg_5 = ( arg_3 if mcmc_util . is_list_like ( arg_3 ) else [ arg_3 ] ) arg_6 = arg_0 . _forward_transform ( arg_5 ) arg_7 = ( arg_6 if mcmc_util . is_list_like ( arg_3 ) else arg_6 [ 0 ] ) arg_4 = TransformedTransitionKernelResults ( transformed_state = arg_3 , inner_results = arg_4 ) return arg_7 , arg_4

Verify a certificate in a context.

        .. versionadded:: 0.15

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


Question: Pack up a function args and kwargs to be sent over the wire .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 , arg_5 = arg_6 ) : arg_7 = list ( chain . from_iterable ( serialize_object ( arg , arg_3 , arg_5 ) for arg in arg_1 ) ) arg_8 = sorted ( arg_2 . keys ( ) ) arg_9 = list ( chain . from_iterable ( serialize_object ( arg_2 [ key ] , arg_3 , arg_5 ) for key in arg_8 ) ) arg_10 = dict ( nargs = len ( arg_1 ) , narg_bufs = len ( arg_7 ) , arg_8 = arg_8 ) arg_11 = [ pickle . dumps ( can ( arg_0 ) , PICKLE_PROTOCOL ) ] arg_11 . append ( pickle . dumps ( arg_10 , PICKLE_PROTOCOL ) ) arg_11 . extend ( arg_7 ) arg_11 . extend ( arg_9 ) return arg_11

Unregister an extension code.  For testing only.


Question: The Master sent a Select command to the Outstation . Handle it .

def Func ( arg_0 , arg_1 , arg_2 ) : OutstationApplication . process_point_value ( 'Func' , arg_1 , arg_2 , None ) return opendnp3 . CommandStatus . SUCCESS

Return an open file-object to the index file


Question: Read the data encoding the CapabilityInformation structure and decode it into its constituent parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_3 ) : if arg_2 < arg_3 . KMIPVersion . KMIP_1_3 : raise exceptions . VersionNotSupported ( "KMIP {} does not support the CapabilityInformation " "object." . format ( arg_2 . value ) ) super ( CapabilityInformation , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . STREAMING_CAPABILITY , arg_6 ) : arg_7 = primitives . Boolean ( tag = arg_3 . Tags . STREAMING_CAPABILITY ) arg_7 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _streaming_capability = arg_7 if arg_0 . is_tag_next ( arg_3 . Tags . ASYNCHRONOUS_CAPABILITY , arg_6 ) : arg_9 = primitives . Boolean ( tag = arg_3 . Tags . ASYNCHRONOUS_CAPABILITY ) arg_9 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _asynchronous_capability = arg_9 if arg_0 . is_tag_next ( arg_3 . Tags . ATTESTATION_CAPABILITY , arg_6 ) : arg_11 = primitives . Boolean ( tag = arg_3 . Tags . ATTESTATION_CAPABILITY ) arg_11 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _attestation_capability = arg_11 if arg_2 >= arg_3 . KMIPVersion . KMIP_1_4 : if arg_0 . is_tag_next ( arg_3 . Tags . BATCH_UNDO_CAPABILITY , arg_6 ) : arg_13 = primitives . Boolean ( tag = arg_3 . Tags . BATCH_UNDO_CAPABILITY ) arg_13 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _batch_continue_capability = arg_13 if arg_0 . is_tag_next ( arg_3 . Tags . BATCH_CONTINUE_CAPABILITY , arg_6 ) : arg_15 = primitives . Boolean ( tag = arg_3 . Tags . BATCH_CONTINUE_CAPABILITY ) arg_15 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _batch_continue_capability = arg_15 if arg_0 . is_tag_next ( arg_3 . Tags . UNWRAP_MODE , arg_6 ) : arg_16 = primitives . Enumeration ( arg_3 . UnwrapMode , tag = arg_3 . Tags . UNWRAP_MODE ) arg_16 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _unwrap_mode = arg_16 if arg_0 . is_tag_next ( arg_3 . Tags . DESTROY_ACTION , arg_6 ) : arg_18 = primitives . Enumeration ( arg_3 . DestroyAction , tag = arg_3 . Tags . DESTROY_ACTION ) arg_18 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _destroy_action = arg_18 if arg_0 . is_tag_next ( arg_3 . Tags . SHREDDING_ALGORITHM , arg_6 ) : arg_20 = primitives . Enumeration ( arg_3 . ShreddingAlgorithm , tag = arg_3 . Tags . SHREDDING_ALGORITHM ) arg_20 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _shredding_algorithm = arg_20 if arg_0 . is_tag_next ( arg_3 . Tags . RNG_MODE , arg_6 ) : arg_22 = primitives . Enumeration ( arg_3 . RNGMode , tag = arg_3 . Tags . RNG_MODE ) arg_22 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _rng_mode = arg_22 arg_0 . is_oversized ( arg_6 )

Generate RENEWING time.

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

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


Question: Return the precision of x

def Func ( arg_0 ) : from . bounds import zero_range arg_1 = min_max ( arg_0 , na_rm = True ) if zero_range ( arg_1 ) : arg_2 = np . abs ( arg_1 [ 0 ] ) else : arg_2 = np . diff ( arg_1 ) [ 0 ] if arg_2 == 0 : return 1 else : return 10 ** int ( np . floor ( np . log10 ( arg_2 ) ) )

Returns any parameters needed for Akamai HD player verification.

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


Question: Draws a weighted swatch with approximately n columns and rows .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 35 , arg_4 = 35 , arg_5 = 4 , arg_6 = 0 , arg_7 = 12 , arg_8 = 0.035 , arg_9 = None ) : if arg_9 is None : arg_9 = arg_0 . group_Funces if not arg_9 : arg_10 = sum ( [ arg_13 for arg_11 , arg_12 , arg_13 in arg_0 . ranges ] ) for arg_11 , arg_12 , arg_13 in arg_0 . ranges : arg_14 = max ( 1 , int ( arg_13 / arg_10 * arg_7 ) ) for arg_15 in _range ( arg_14 ) : arg_12 . colors ( arg_11 , arg_7 = arg_7 , arg_8 = arg_8 ) . Func ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_1 += arg_3 + arg_5 return arg_1 , arg_2 + arg_7 * ( arg_4 + arg_5 ) arg_9 = arg_0 . _weight_by_hue ( ) for arg_16 , arg_17 , arg_18 , arg_19 in arg_9 : arg_20 = arg_2 arg_21 = 0 for arg_11 , arg_12 , arg_22 in arg_19 : arg_23 = arg_1 arg_14 = int ( arg_17 * arg_7 ) arg_14 = max ( 1 , min ( arg_14 , arg_7 - len ( arg_9 ) ) ) if arg_11 . name == "black" : arg_12 = arg_12 . black if arg_11 . name == "white" : arg_12 = arg_12 . white for arg_15 in _range ( arg_14 ) : arg_24 = int ( arg_22 / arg_16 * arg_7 ) arg_24 = max ( 1 , arg_24 ) if ( arg_11 , arg_12 , arg_22 ) == arg_19 [ - 1 ] and arg_21 + arg_24 < arg_7 : arg_24 += 1 arg_12 . colors ( arg_11 , arg_7 = arg_24 , arg_8 = arg_8 ) . Func ( arg_23 , arg_20 , arg_3 , arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_23 += arg_3 + arg_5 arg_20 += ( arg_3 + arg_5 ) * arg_24 arg_21 = arg_24 arg_1 += ( arg_3 + arg_5 ) * arg_14 + arg_5 return arg_1 , arg_20

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: Fetchs all available rows from the cursor .

def Func ( arg_0 ) : arg_0 . _check_executed ( ) arg_1 = arg_0 . _fetch_row ( 0 ) arg_0 . rownumber = arg_0 . rownumber + len ( arg_1 ) arg_0 . _warning_check ( ) return arg_1


Question: Duplicate a layer .

def Func ( arg_0 , arg_1 = None ) : arg_2 = '  <filter name="Duplicate Current layer"/>\n' if isinstance ( arg_0 , mlx . FilterScript ) : if ( arg_1 is None ) or ( arg_1 == arg_0 . current_layer ( ) ) : util . write_filter ( arg_0 , arg_2 ) arg_0 . add_layer ( '{}_copy' . format ( arg_0 . layer_stack [ arg_0 . current_layer ( ) ] ) , True ) else : change ( arg_0 , arg_1 ) util . write_filter ( arg_0 , arg_2 ) arg_0 . add_layer ( '{}_copy' . format ( arg_0 . layer_stack [ arg_1 ] ) , True ) else : util . write_filter ( arg_0 , arg_2 ) return None

Given model params, figure out the correct parameters for the
  RandomDistributed encoder. Modifies params in place.


Question: r Return engineering suffix and its floating point equivalent of a number .

def Func ( arg_0 ) : arg_1 = " " if arg_0 [ - 1 ] . isdigit ( ) else arg_0 [ - 1 ] return EngPower ( arg_1 , _SUFFIX_POWER_DICT [ arg_1 ] )

Handle marking messages as read and keeping client active.


Question: Parses as much as possible until it encounters a matching closing quote . By default matches any_token but can be provided with a more specific parser if required . Returns a string

def Func ( arg_0 = arg_1 ) : arg_2 = quote ( ) arg_3 , arg_4 = many_until ( arg_0 , partial ( one_of , arg_2 ) ) return build_string ( arg_3 )


Question: Read data from file - like object

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . Func ( len ( arg_0 . magic ) ) if not arg_2 : return None if arg_2 != arg_0 . magic : raise ValueError ( 'Magic bytes not found! Read data: {}' . format ( arg_2 ) ) arg_3 = arg_0 . header . _make ( arg_0 . header_struct . unpack ( arg_1 . Func ( arg_0 . header_struct . size ) ) ) arg_4 = numpy . fromstring ( arg_1 . Func ( arg_3 . size ) , dtype = 'float32' ) return ( arg_3 , arg_4 )

Sets the package verification code, if not already set.
        code - A string.
        Raises CardinalityError if already defined.
        Raises OrderError if no package previously defined.
        Raises Value error if doesn't match verifcode form


Question: Connect to hostname supporting the vaex web api .

def Func ( arg_0 , ** arg_1 ) : from vaex . remote import ServerRest arg_0 = urlparse ( arg_0 ) if arg_0 . scheme == "ws" : arg_2 = True else : arg_2 = False assert arg_0 . scheme in [ "ws" , "http" ] arg_3 = arg_0 . port arg_4 = arg_0 . path arg_5 = arg_0 . hostname return vaex . remote . ServerRest ( arg_5 , arg_4 = arg_4 , arg_3 = arg_3 , arg_2 = arg_2 , ** arg_1 )

Resets builder's state for building new documents.
        Must be called between usage with different documents.


Question: Return the stored coverage data from the given file .

def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_3 = { } try : arg_4 = arg_0 . raw_data ( arg_1 ) if isinstance ( arg_4 , dict ) : arg_2 = dict ( [ ( f , dict . fromkeys ( linenos , None ) ) for f , linenos in iitems ( arg_4 . get ( 'lines' , { } ) ) ] ) arg_3 = dict ( [ ( f , dict . fromkeys ( arcpairs , None ) ) for f , arcpairs in iitems ( arg_4 . get ( 'arcs' , { } ) ) ] ) except Exception : pass return arg_2 , arg_3


Question: Creates an NxN element of the Gaussian Orthogonal Ensemble

def Func ( arg_0 ) : arg_1 = ra . standard_normal ( ( arg_0 , arg_0 ) ) arg_1 += arg_1 . T return arg_1 / 2


Question: Return all gene panels

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = { } if arg_1 : arg_4 [ 'panel_name' ] = arg_1 if arg_3 : arg_4 [ 'version' ] = arg_3 if arg_2 : arg_4 [ 'institute' ] = arg_2 return arg_0 . panel_collection . find ( arg_4 )

Updates the target temperature on the NuHeat API

        :param temperature: The desired temperature in NuHeat format
        :param permanent: Permanently hold the temperature. If set to False, the schedule will
                          resume at the next programmed event


Question: Add widget string to right panel of the screen

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_index ( ) while arg_2 in arg_0 . info_widgets . keys ( ) : arg_2 += 1 arg_0 . info_widgets [ arg_1 . get_index ( ) ] = arg_1

scan through the java output text and extract the bad java messages that may or may not happened when
    unit tests are run.  It will not record any bad java messages that are stored in g_ok_java_messages.

    :return: none


Question: Checks that format string tokens match the supplied arguments .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = _count_supplied_tokens ( arg_1 . args [ arg_2 + 1 : ] ) if not arg_3 : return arg_4 = arg_1 . args [ arg_2 ] . value if not isinstance ( arg_4 , str ) : arg_5 = 0 else : try : if arg_0 . _format_style == "old" : arg_6 , arg_5 , arg_7 , arg_7 = utils . parse_format_string ( arg_4 ) if arg_6 : return elif arg_0 . _format_style == "new" : arg_8 , arg_9 , arg_10 = utils . parse_format_method_string ( arg_4 ) arg_11 = len ( set ( k for k , l in arg_8 if not isinstance ( k , int ) ) ) arg_5 = ( arg_11 + arg_9 + arg_10 ) except utils . UnsupportedFormatCharacter as ex : arg_12 = arg_4 [ ex . index ] arg_0 . add_message ( "logging-unsupported-format" , arg_1 = arg_1 , args = ( arg_12 , ord ( arg_12 ) , ex . index ) , ) return except utils . IncompleteFormatString : arg_0 . add_message ( "logging-format-truncated" , arg_1 = arg_1 ) return if arg_3 > arg_5 : arg_0 . add_message ( "logging-too-many-args" , arg_1 = arg_1 ) elif arg_3 < arg_5 : arg_0 . add_message ( "logging-too-few-args" , arg_1 = arg_1 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: print error type message if file handle is sys . stderr print color message

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = "[error]:" , arg_4 = "..." ) : arg_5 = arg_3 + arg_1 + arg_4 arg_2 = arg_2 or sys . stderr if arg_2 is sys . stderr : termcolor . cprint ( arg_5 , color = "red" ) else : arg_2 . write ( arg_5 ) pass

Determine the set of elements present in a list of chemical compounds.

    The list of elements is sorted alphabetically.

    :param compounds: List of compound formulas and phases, e.g.
      ['Fe2O3[S1]', 'Al2O3[S1]'].

    :returns: List of elements.


Question: Adds a watermark to an image .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 ) : if arg_3 < 1 : arg_1 = reduce_opacity ( arg_1 , arg_3 ) if arg_0 . mode != 'RGBA' : arg_0 = arg_0 . convert ( 'RGBA' ) arg_4 = Image . new ( 'RGBA' , arg_0 . size , ( 0 , 0 , 0 , 0 ) ) if arg_2 == 'tile' : for arg_5 in range ( 0 , arg_0 . size [ 1 ] , arg_1 . size [ 1 ] ) : for arg_6 in range ( 0 , arg_0 . size [ 0 ] , arg_1 . size [ 0 ] ) : arg_4 . paste ( arg_1 , ( arg_6 , arg_5 ) ) elif arg_2 == 'scale' : arg_7 = min ( float ( arg_0 . size [ 0 ] ) / arg_1 . size [ 0 ] , float ( arg_0 . size [ 1 ] ) / arg_1 . size [ 1 ] ) arg_8 = int ( arg_1 . size [ 0 ] * arg_7 ) arg_9 = int ( arg_1 . size [ 1 ] * arg_7 ) arg_1 = arg_1 . resize ( ( arg_8 , arg_9 ) ) arg_4 . paste ( arg_1 , ( int ( ( arg_0 . size [ 0 ] - arg_8 ) / 2 ) , int ( ( arg_0 . size [ 1 ] - arg_9 ) / 2 ) ) ) else : arg_4 . paste ( arg_1 , arg_2 ) return Image . composite ( arg_4 , arg_0 , arg_4 )


Question: Read the value of the Boolean object from the input stream .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : try : arg_6 = unpack ( '!Q' , arg_1 . read ( arg_0 . LENGTH ) ) [ 0 ] except Exception : arg_0 . logger . error ( "Error reading boolean value from buffer" ) raise if arg_6 == 1 : arg_0 . value = True elif arg_6 == 0 : arg_0 . value = False else : raise ValueError ( "expected: 0 or 1, observed: {0}" . format ( arg_6 ) ) arg_0 . validate ( )

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: Concert velocities from a cartesian to a spherical coordinate system

Increases or decreases the brightness in the layer.

        The given value is a percentage to increase
        or decrease the image brightness,
        for example 0.8 means brightness at 80%.


Question: Perform a request to the fully qualified url and return json .

def Func ( arg_0 , arg_1 ) : return arg_0 . json_response ( requests . get ( arg_1 , ** arg_0 . requests_kwargs ) )

Compares and exchanges.

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

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

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

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


Question: Clear contents of general pasteboard .

def Func ( arg_0 ) : arg_1 = 'Request to clear contents of pasteboard: general' logging . debug ( arg_1 ) arg_2 = AppKit . NSPasteboard . generalPasteboard ( ) arg_2 . Func ( ) return True

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

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


Question: Generate requested statistics for a dataset and cache to a file . If filename is None then don t cache to a file

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = [ ] , arg_4 = True ) : if not isinstance ( arg_1 , dict ) : raise RuntimeError ( "statsInfo must be a dict -- " "found '%s' instead" % type ( arg_1 ) ) arg_0 = resource_filename ( "nupic.datafiles" , arg_0 ) if arg_4 : arg_5 = getStatsFilename ( arg_0 , arg_1 , arg_3 ) if os . path . exists ( arg_5 ) : try : arg_6 = pickle . load ( open ( arg_5 , "rb" ) ) except : print "Warning: unable to load stats for %s -- " "will regenerate" % arg_0 arg_6 = dict ( ) arg_7 = set ( [ s for s in arg_1 ] ) arg_8 = set ( arg_6 . keys ( ) ) arg_9 = arg_7 . difference ( arg_8 ) if len ( arg_9 ) == 0 : return arg_6 else : print "Func: re-generating stats file %s because " "keys %s are not available" % ( arg_0 , str ( arg_9 ) ) os . remove ( arg_0 ) print "Generating statistics for file '%s' with filters '%s'" % ( arg_0 , arg_3 ) arg_10 = RecordSensor ( ) arg_10 . dataSource = FileRecordStream ( arg_0 ) arg_10 . preEncodingFilters = arg_3 arg_13 = [ ] for arg_14 in arg_1 : if arg_1 [ arg_14 ] == "number" : arg_1 [ arg_14 ] = NumberStatsCollector ( ) elif arg_1 [ arg_14 ] == "category" : arg_1 [ arg_14 ] = CategoryStatsCollector ( ) else : raise RuntimeError ( "Unknown stats type '%s' for field '%s'" % ( arg_1 [ arg_14 ] , arg_14 ) ) if arg_2 is None : arg_2 = 500000 for arg_15 in xrange ( arg_2 ) : try : arg_16 = arg_10 . getNextRecord ( ) except StopIteration : break for ( arg_17 , arg_18 ) in arg_1 . items ( ) : arg_18 . add ( arg_16 [ arg_17 ] ) del arg_10 arg_6 = dict ( ) for ( arg_14 , arg_18 ) in arg_1 . items ( ) : arg_13 = arg_18 . getStats ( ) if arg_14 not in arg_6 : arg_6 [ arg_14 ] = arg_13 else : arg_6 [ arg_14 ] . update ( arg_13 ) if arg_4 : arg_19 = open ( arg_5 , "wb" ) pickle . dump ( arg_6 , arg_19 ) arg_19 . close ( ) arg_6 [ "_filename" ] = arg_5 return arg_6

Perform a rachted step, calculating a new shared secret from the public key and
        deriving new chain keys from this secret.

        New Diffie-Hellman calculations are only performed if the public key is different
        from the previous one.

        :param other_pub: A bytes-like object encoding the public key of the other
            Diffie-Hellman ratchet to synchronize with.


Question: r Craft a simple command name from the command .

def Func ( arg_0 ) : arg_1 = arg_0 . splitlines ( ) for arg_2 in arg_1 : arg_2 = arg_2 . strip ( ) if arg_2 and not arg_2 . startswith ( '#' ) and arg_2 != '\\' : return os . path . basename ( re . split ( r'\s' , arg_2 ) [ 0 ] ) return 'command'

Generate RENEWING time.

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

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