Question: Adds genomic coordinated - related filters to the query object

def Func ( arg_0 , arg_1 , arg_2 ) : LOG . debug ( 'Adding genomic coordinates to the query' ) arg_3 = arg_1 [ 'chrom' ] arg_2 [ 'chromosome' ] = arg_3 if ( arg_1 . get ( 'start' ) and arg_1 . get ( 'end' ) ) : arg_2 [ 'position' ] = { '$lte' : int ( arg_1 [ 'end' ] ) } arg_2 [ 'end' ] = { '$gte' : int ( arg_1 [ 'start' ] ) } return arg_2

Call the segmenter in order to split text in sentences.

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

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


Question: Worker to distribute work to jit funcs . Wraps everything on an engine to run single - threaded to maximize efficiency for multi - processing .

def Func ( arg_0 , arg_1 ) : arg_2 = set_mkl_thread_limit ( 1 ) with h5py . File ( arg_0 . database . input , 'r' ) as io5 : arg_3 = io5 [ "bootsarr" ] [ : ] arg_4 = io5 [ "bootsmap" ] [ : , 0 ] arg_5 = io5 [ "quartets" ] [ arg_1 : arg_1 + arg_0 . _chunksize ] arg_6 = arg_3 [ : ] == 78 arg_7 = np . zeros ( ( arg_5 . shape [ 0 ] , 4 ) , dtype = np . uint16 ) arg_8 = np . zeros ( ( arg_5 . shape [ 0 ] , 16 , 16 ) , dtype = np . uint16 ) for arg_9 in xrange ( arg_5 . shape [ 0 ] ) : arg_10 = arg_5 [ arg_9 ] arg_11 = arg_3 [ arg_10 ] arg_12 = np . any ( arg_6 [ arg_10 ] , axis = 0 ) arg_12 += np . all ( arg_11 == arg_11 [ 0 ] , axis = 0 ) arg_13 , arg_14 = calculate ( arg_11 , arg_4 , arg_12 , TESTS ) arg_7 [ arg_9 ] = arg_5 [ arg_9 ] [ arg_13 ] arg_8 [ arg_9 ] = arg_14 set_mkl_thread_limit ( arg_2 ) return arg_7 , arg_8

Called when advertisement data is received.


Question: Checks if we can create the project

def Func ( arg_0 ) : arg_0 . try_import ( arg_0 . project_name ) arg_0 . validate_name ( arg_0 . project_name ) if os . path . exists ( arg_0 . project_name ) : print ( "Directory {} already exist. Aborting." . format ( arg_0 . project_name ) ) return False if os . path . exists ( 'manage.py' ) : print ( "A manage.py file already exist in the current directory. Aborting." ) return False return True

Protected get. Get an item from Q.
            Will block. but if the process group has errors,
            raise an StopProcessGroup exception.

            A slave process will terminate upon StopProcessGroup.
            The master process shall read the error from the process group.


Question: Helper functions that implements bias correction

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 . shape [ 0 ] arg_5 = np . mean ( np . square ( arg_1 [ 0 : arg_3 ] ) . mean ( axis = 1 ) . T . view ( ) - np . square ( arg_1 [ 0 : arg_3 ] . mean ( axis = 1 ) ) . T . view ( ) ) arg_6 = np . square ( arg_2 ) . sum ( axis = 1 ) / arg_3 arg_7 = arg_4 * arg_5 * arg_6 / arg_3 arg_8 = arg_0 - arg_7 return arg_8

Add one or more files or URLs to the manifest.
        If files contains a glob, it is expanded.

        All files are uploaded to SolveBio. The Upload
        object is used to fill the manifest.


Question: Handle DELETE deposit file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : try : del arg_2 . files [ str ( arg_3 ) ] arg_2 . commit ( ) db . session . commit ( ) return make_response ( '' , 204 ) except KeyError : abort ( 404 , 'The specified object does not exist or has already ' 'been Funcd.' )

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: Raph Levien s code draws fast LINETO segments .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 ) : for arg_10 in range ( 0 , 100 ) : arg_11 = arg_10 * .01 arg_12 , arg_13 = eval_cornu ( arg_2 + arg_11 * ( arg_3 - arg_2 ) ) arg_12 *= arg_6 arg_12 -= arg_4 arg_13 -= arg_5 arg_14 = arg_13 * arg_7 - arg_12 * arg_8 arg_15 = arg_12 * arg_7 + arg_13 * arg_8 print_pt ( arg_0 + arg_14 , arg_1 + arg_15 , arg_9 ) arg_9 = 'lineto' return arg_9

Condition to stop when any batch member converges, or all have failed.


Question: Plots a bar graph of returns by year .

def Func ( arg_0 , arg_1 = None , ** arg_2 ) : if arg_1 is None : arg_1 = plt . gca ( ) arg_3 = FuncFormatter ( utils . percentage ) arg_1 . xaxis . set_major_formatter ( FuncFormatter ( arg_3 ) ) arg_1 . tick_params ( axis = 'x' , which = 'major' ) arg_4 = pd . DataFrame ( ep . aggregate_returns ( arg_0 , 'yearly' ) ) arg_1 . axvline ( 100 * arg_4 . values . mean ( ) , color = 'steelblue' , linestyle = '--' , lw = 4 , alpha = 0.7 ) ( 100 * arg_4 . sort_index ( ascending = False ) ) . plot ( arg_1 = arg_1 , kind = 'barh' , alpha = 0.70 , ** arg_2 ) arg_1 . axvline ( 0.0 , color = 'black' , linestyle = '-' , lw = 3 ) arg_1 . set_ylabel ( 'Year' ) arg_1 . set_xlabel ( 'Returns' ) arg_1 . set_title ( "Annual returns" ) arg_1 . legend ( [ 'Mean' ] , frameon = True , framealpha = 0.5 ) return arg_1

Handle marking messages as read and keeping client active.


Question: REST Conference Undeaf helper

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

Get the datetime at a given period.

        :param period: The index of the period.

        :returns: The datetime.


Question: Returns the darkest color from the list .

def Func ( arg_0 ) : arg_1 , arg_2 = ( 1.0 , 1.0 , 1.0 ) , 3.0 for arg_3 in arg_0 : if arg_3 . r + arg_3 . g + arg_3 . b < arg_2 : arg_1 , arg_2 = arg_3 , arg_3 . r + arg_3 . g + arg_3 . b return arg_1

Convert this unnormalized batch to an instance of Batch.

        As this method is intended to be called before augmentation, it
        assumes that none of the ``*_aug`` attributes is yet set.
        It will produce an AssertionError otherwise.

        The newly created Batch's ``*_unaug`` attributes will match the ones
        in this batch, just in normalized form.

        Returns
        -------
        imgaug.augmentables.batches.Batch
            The batch, with ``*_unaug`` attributes being normalized.


Question: checks that a given file exists

def Func ( arg_0 ) : arg_1 = 1 try : arg_2 = open ( arg_0 , "r" ) arg_2 . close ( ) except : arg_1 = None sys . stderr . write ( arg_0 + " couldn't be accessed\n" ) return arg_1

Overriding the default JSONEncoder.default for NDB support.


Question: Return a list of examples which violate the schema .

def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 . _get_schema_folder ( ) , "examples" , "invalid" ) return list ( _get_json_content_from_folder ( arg_1 ) )

Get an IO write task for the requested set of data

        This task can be ran immediately or be submitted to the IO executor
        for it to run.

        :type fileobj: file-like object
        :param fileobj: The file-like object to write to

        :type data: bytes
        :param data: The data to write out

        :type offset: integer
        :param offset: The offset to write the data to in the file-like object

        :returns: An IO task to be used to write data to a file-like object


Question: Calculates string edit distance between string 1 and string 2 . Deletion insertion substitution and transposition all increase edit distance .

Retrieve the certificate for the given username for the given course_id.

        Args:
        * ``course_id`` (str): The string value of the course's unique identifier
        * ``username`` (str): The username ID identifying the user for which to retrieve the certificate

        Raises:

        HttpNotFoundError if no certificate found for the given user+course.

        Returns:

        a dict containing:

        * ``username``: A string representation of an user's username passed in the request.
        * ``course_id``: A string representation of a Course ID.
        * ``certificate_type``: A string representation of the certificate type.
        * ``created_date`: Datetime the certificate was created (tz-aware).
        * ``status``: A string representation of the certificate status.
        * ``is_passing``: True if the certificate has a passing status, False if not.
        * ``download_url``: A string representation of the certificate url.
        * ``grade``: A string representation of a float for the user's course grade.


Question: Creates a new encryption key in the path provided and sets the file permissions . Setting the file permissions currently does not work on Windows platforms because of the differences in how file permissions are read and modified .

def Func ( arg_0 ) : arg_1 = "{}{}" . format ( os . urandom ( 32 ) , time . time ( ) ) arg_2 = generate_key ( ensure_bytes ( arg_1 ) ) with open ( arg_0 , "wb" ) as f : f . write ( base64 . b64encode ( arg_2 ) ) os . chmod ( arg_0 , 0o400 )

Checks on whether the task instance is in the right state and timeframe
        to be retried.


Question: Add a new merge field for a specific list .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . list_id = arg_1 if 'name' not in arg_2 : raise KeyError ( 'The list merge field must have a name' ) if 'type' not in arg_2 : raise KeyError ( 'The list merge field must have a type' ) arg_3 = arg_0 . _mc_client . _post ( url = arg_0 . _build_path ( arg_1 , 'merge-fields' ) , arg_2 = arg_2 ) if arg_3 is not None : arg_0 . merge_id = arg_3 [ 'merge_id' ] else : arg_0 . merge_id = None return arg_3

Start running the game.  The window is created and shown at this point, and then
    the main event loop is entered.  'game.on_tick' and other event handlers are called
    repeatedly until the game exits.

    If a game is already running, this function replaces the :class:`Game` instance that
    receives events.


Question: Validates a VLAN ID .

def Func ( arg_0 , arg_1 ) : try : arg_2 = int ( arg_1 ) assert arg_2 >= arg_0 . MIN_VLAN_ID assert arg_2 <= arg_0 . MAX_VLAN_ID except Exception : arg_3 = ( "Invalid vlan_id. Got '%(vlan_id)s'. " "vlan_id should be an integer between %(min)d and %(max)d " "inclusive." % { 'vlan_id' : arg_1 , 'min' : arg_0 . MIN_VLAN_ID , 'max' : arg_0 . MAX_VLAN_ID } ) raise TagValidationError ( arg_1 , arg_3 ) return True

Remove all binary files in the adslib directory.


Question: save - Save all objects in this list

def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return [ ] arg_1 = arg_0 . getModel ( ) return arg_1 . Funcr . Func ( arg_0 )

Geometric function using cylindrical coordinates.

    Define functions in Z up cylindrical coordinates, with radius 'r',
    angle 'theta', and height 'z'

    See "function" docs for additional usage info and accepted parameters.

    Args:
        r_func (str): function to generate new coordinates for radius
        theta_func (str): function to generate new coordinates for angle.
            0 degrees is on the +X axis.
        z_func (str): function to generate new coordinates for height

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA


Question: Checks if file already exists and ask the user if it should be overwritten if it does .

def Func ( arg_0 , arg_1 ) : log . debug ( "Checking file output" ) if os . path . isfile ( arg_0 ) and not arg_1 : if sys . stdin . isatty ( ) : arg_2 = console . ask ( "File {0} already exists! Overwrite it? [y/N] " , arg_0 ) if arg_2 . lower ( ) != "y" : sys . exit ( ) else : log . error ( "File {0} already exists, use --force to overwrite it." . format ( arg_0 ) ) sys . exit ( ) return FileOutput ( arg_0 )

Overriding the default JSONEncoder.default for NDB support.


Question: Generates likely unique image path using md5 hashes

def Func ( arg_0 , arg_1 ) : arg_1 , arg_2 = os . path . splitext ( arg_1 . lower ( ) ) arg_3 = hashlib . md5 ( str ( arg_0 . id ) ) . hexdigest ( ) arg_4 = '' . join ( random . sample ( hashlib . md5 ( arg_1 . encode ( 'utf-8' ) ) . hexdigest ( ) , 8 ) ) return '{}/{}{}' . format ( arg_3 , arg_4 , arg_2 )

This method is called before first step of simulation.


Question: Add a control - number 00x for given tag with value .

def Func ( arg_0 , arg_1 , arg_2 ) : record_add_field ( arg_0 . record , arg_1 , controlfield_value = arg_2 )

List all events occurring at or after a timestamp.


Question: Build a two - dimensional diagonal filter .

def Func ( arg_0 , arg_1 , arg_2 = 1.0 , arg_3 = None , arg_4 = False ) : if arg_3 is None : arg_3 = np . arctan ( arg_2 ) arg_5 = np . diag ( get_window ( arg_0 , arg_1 , fftbins = False ) ) if not np . isclose ( arg_3 , np . pi / 4 ) : arg_5 = scipy . ndimage . rotate ( arg_5 , 45 - arg_3 * 180 / np . pi , order = 5 , prefilter = False ) np . clip ( arg_5 , 0 , None , out = arg_5 ) arg_5 /= arg_5 . sum ( ) if arg_4 : arg_5 -= arg_5 . mean ( ) return arg_5


Question: Factory for loading the ccd data from . fits files as well as computing properties like the noise - map exposure - time map etc . from the ccd - data .

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = 0 , arg_8 = None , arg_9 = True , arg_10 = None , arg_11 = 0 , arg_12 = False , arg_13 = False , arg_14 = False , arg_15 = None , arg_16 = 0 , arg_17 = False , arg_18 = False , arg_19 = None , arg_20 = 0 , arg_21 = False , arg_22 = False , arg_23 = False , arg_24 = None , arg_25 = 0 , arg_26 = None , arg_27 = False , arg_28 = None , arg_29 = 0 , arg_30 = False , arg_31 = None , arg_32 = False , arg_33 = None ) : arg_34 = load_image ( arg_0 = arg_0 , arg_2 = arg_2 , arg_1 = arg_1 ) arg_35 = load_background_noise_map ( arg_15 = arg_15 , arg_16 = arg_16 , arg_1 = arg_1 , arg_17 = arg_17 , arg_18 = arg_18 ) if arg_35 is not None : arg_36 = 1.0 / arg_35 else : arg_36 = None arg_37 = load_exposure_time_map ( arg_24 = arg_24 , arg_25 = arg_25 , arg_1 = arg_1 , shape = arg_34 . shape , exposure_time = arg_26 , arg_27 = arg_27 , arg_36 = arg_36 ) arg_38 = load_poisson_noise_map ( arg_19 = arg_19 , arg_20 = arg_20 , arg_1 = arg_1 , arg_22 = arg_22 , arg_23 = arg_23 , arg_34 = arg_34 , arg_37 = arg_37 , arg_21 = arg_21 , arg_30 = arg_30 , arg_31 = arg_31 , arg_32 = arg_32 ) arg_39 = load_noise_map ( arg_10 = arg_10 , arg_11 = arg_11 , arg_1 = arg_1 , arg_34 = arg_34 , arg_35 = arg_35 , arg_37 = arg_37 , arg_13 = arg_13 , arg_14 = arg_14 , arg_12 = arg_12 , arg_30 = arg_30 , arg_31 = arg_31 , arg_32 = arg_32 ) arg_40 = load_psf ( arg_6 = arg_6 , arg_7 = arg_7 , arg_1 = arg_1 , renormalize = arg_9 ) arg_41 = load_background_sky_map ( arg_28 = arg_28 , arg_29 = arg_29 , arg_1 = arg_1 ) arg_34 = CCDData ( arg_34 = arg_34 , arg_1 = arg_1 , arg_40 = arg_40 , arg_39 = arg_39 , arg_35 = arg_35 , arg_38 = arg_38 , arg_37 = arg_37 , arg_41 = arg_41 , arg_31 = arg_31 , name = arg_33 ) if arg_3 is not None : arg_34 = arg_34 . new_ccd_data_with_resized_arrays ( new_shape = arg_3 , new_centre_pixels = arg_4 , new_centre_arcsec = arg_5 ) if arg_8 is not None : arg_34 = arg_34 . new_ccd_data_with_resized_psf ( new_shape = arg_8 ) if arg_30 : arg_34 = arg_34 . new_ccd_data_converted_from_electrons ( ) elif arg_32 : arg_34 = arg_34 . new_ccd_data_converted_from_adus ( arg_31 = arg_31 ) return arg_34

Attach an observer.

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

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


Question: Find a symbol in the symbol table by name kind or both .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : for arg_3 in reversed ( arg_0 . stack ) : for arg_4 , arg_5 in arg_3 . symbols . items ( ) : arg_6 = arg_5 . __class__ . __name__ if arg_1 == arg_4 and arg_2 == arg_6 : return arg_5 elif arg_1 is None and arg_2 == arg_5 . __class__ . __name__ : return arg_5 elif arg_1 == arg_4 and arg_2 is None : return arg_5 if arg_1 is None and arg_2 == arg_3 . handle . __class__ . __name__ : return arg_3 . handle

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: Using the record length and appropriate start points seek to the country that corresponds to the converted IP address integer . Return offset of record .

def Func ( arg_0 , arg_1 ) : try : arg_2 = 0 arg_3 = 127 if len ( str ( arg_1 ) ) > 10 else 31 for arg_4 in range ( arg_3 , - 1 , - 1 ) : if arg_0 . _flags & const . MEMORY_CACHE : arg_5 = 2 * arg_0 . _recordLength * arg_2 arg_6 = arg_5 + ( 2 * arg_0 . _recordLength ) arg_7 = arg_0 . _memory [ arg_5 : arg_6 ] else : arg_5 = 2 * arg_0 . _recordLength * arg_2 arg_8 = 2 * arg_0 . _recordLength try : arg_0 . _lock . acquire ( ) arg_0 . _fp . seek ( arg_5 , os . SEEK_SET ) arg_7 = arg_0 . _fp . read ( arg_8 ) finally : arg_0 . _lock . release ( ) if PY3 and type ( arg_7 ) is bytes : arg_7 = arg_7 . decode ( ENCODING ) arg_9 = [ 0 , 0 ] for arg_10 in range ( 2 ) : for arg_11 in range ( arg_0 . _recordLength ) : arg_12 = arg_7 [ arg_0 . _recordLength * arg_10 + arg_11 ] arg_9 [ arg_10 ] += ord ( arg_12 ) << ( arg_11 * 8 ) if arg_1 & ( 1 << arg_4 ) : if arg_9 [ 1 ] >= arg_0 . _databaseSegments : arg_0 . _netmask = arg_3 - arg_4 + 1 return arg_9 [ 1 ] arg_2 = arg_9 [ 1 ] else : if arg_9 [ 0 ] >= arg_0 . _databaseSegments : arg_0 . _netmask = arg_3 - arg_4 + 1 return arg_9 [ 0 ] arg_2 = arg_9 [ 0 ] except ( IndexError , UnicodeDecodeError ) : pass raise GeoIPError ( 'Corrupt database' )


Question: Save a small version of the graph based on a session and the output node names .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : for arg_4 in arg_0 . graph_def . node : arg_4 . device = '' arg_6 = graph_util . extract_sub_graph ( arg_0 . graph_def , arg_2 ) arg_7 , arg_8 = os . path . split ( arg_1 ) graph_io . write_graph ( arg_6 , arg_7 , arg_8 , arg_3 = arg_3 )

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


Question: Given a Discord http_conn_id return the default webhook endpoint or override if a webhook_endpoint is manually supplied .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 : arg_3 = arg_2 elif arg_1 : arg_4 = arg_0 . get_connection ( arg_1 ) arg_5 = arg_4 . extra_dejson arg_3 = arg_5 . get ( 'webhook_endpoint' , '' ) else : raise AirflowException ( 'Cannot get webhook endpoint: No valid Discord ' 'webhook endpoint or http_conn_id supplied.' ) if not re . match ( '^webhooks/[0-9]+/[a-zA-Z0-9_-]+$' , arg_3 ) : raise AirflowException ( 'Expected Discord webhook endpoint in the form ' 'of "webhooks/{webhook.id}/{webhook.token}".' ) return arg_3

Returns the profile with the received ID as a dict

        If a local copy of the profile exists, it'll be returned. If not, it'll
        be downloaded from the web. The results are cached, so any subsequent
        calls won't hit the filesystem or the web.

        Args:
            profile_id (str): The ID of the profile you want.

        Raises:
            RegistryError: If there was some problem opening the profile file
                or its format was incorrect.


Question: Generator which returns all of the statements in all of the settings tables

def Func ( arg_0 ) : for arg_1 in arg_0 . tables : if isinstance ( arg_1 , SettingTable ) : for arg_2 in arg_1 . statements : yield arg_2

Returns the size of a specific dimension.


Question: Initiates an upgrade .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 = None , arg_9 = None ) : _validate_not_none ( 'service_name' , arg_1 ) _validate_not_none ( 'deployment_name' , arg_2 ) _validate_not_none ( 'mode' , arg_3 ) _validate_not_none ( 'package_url' , arg_4 ) _validate_not_none ( 'configuration' , arg_5 ) _validate_not_none ( 'label' , arg_6 ) _validate_not_none ( 'force' , arg_7 ) return arg_0 . _perform_post ( arg_0 . _get_deployment_path_using_name ( arg_1 , arg_2 ) + '/?comp=upgrade' , _XmlSerializer . Func_to_xml ( arg_3 , arg_4 , arg_5 , arg_6 , arg_8 , arg_7 , arg_9 ) , as_async = True )

List the roles for an account, for the passed Canvas account ID.

        https://canvas.instructure.com/doc/api/roles.html#method.role_overrides.api_index


Question: Gets the 3 GeoTiff vlrs from the vlr_list and parse them into a nicer structure

def Func ( arg_0 : arg_1 . VLRList ) -> List [ GeoTiffKey ] : arg_3 = arg_0 . get_by_id ( GeoKeyDirectoryVlr . official_user_id ( ) , GeoKeyDirectoryVlr . official_record_ids ( ) ) [ 0 ] arg_4 = arg_0 . get_by_id ( GeoDoubleParamsVlr . official_user_id ( ) , GeoDoubleParamsVlr . official_record_ids ( ) ) [ 0 ] arg_5 = arg_0 . get_by_id ( GeoAsciiParamsVlr . official_user_id ( ) , GeoAsciiParamsVlr . official_record_ids ( ) ) [ 0 ] return parse_geo_tiff ( arg_3 , arg_4 , arg_5 )

Delete latex comments from TeX source.

    Parameters
    ----------
    tex_source : str
        TeX source content.

    Returns
    -------
    tex_source : str
        TeX source without comments.


Question: Get the header value for a name .

def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . dict . get ( arg_1 . lower ( ) , arg_2 )

Init openstack neutron mq

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

        :param mq: class ternya.mq.MQ


Question: Determines JSONAPI type for provided GUID

def Func ( arg_0 , Func ) : return arg_0 . _json ( arg_0 . _get ( arg_0 . _build_url ( 'guids' , Func ) ) , 200 ) [ 'data' ] [ 'type' ]

Read list format context from a file.

    For customized read_words method, see ``tutorial_generate_text.py``.

    Parameters
    ----------
    filename : str
        a file path.
    replace : list of str
        replace original string by target string.

    Returns
    -------
    list of str
        The context in a list (split using space).


Question: activates error messages useful during development

def Func ( ) : logging . basicConfig ( level = logging . WARNING ) peony . logger . setLevel ( logging . DEBUG )

Update annotations of discretized continuous pulse function with duration.

    Args:
        discretized_pulse: Discretized decorated continuous pulse.


Question: Write tersoff potential file from parameters to string

def Func ( arg_0 ) : arg_1 = [ ] for ( arg_2 , arg_3 , arg_4 ) , arg_5 in arg_0 . items ( ) : if len ( arg_5 ) != 14 : raise ValueError ( 'tersoff three body potential expects 14 parameters' ) arg_1 . append ( ' ' . join ( [ arg_2 , arg_3 , arg_4 ] + [ '{:16.8g}' . format ( arg_6 ) for arg_6 in arg_5 ] ) ) return '\n' . join ( arg_1 )

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

    :param value: The value to convert.
    :type value: int or long or BitVec
    :param int width: The width of the bitstring to consider
    :return: The converted value
    :rtype int or long or BitVec


Question: Pretty - print the encoded output using ascii art .

def Func ( arg_0 , arg_1 , arg_2 = "" ) : print arg_2 , arg_3 = arg_0 . getDescription ( ) + [ ( "end" , arg_0 . getWidth ( ) ) ] for arg_4 in xrange ( len ( arg_3 ) - 1 ) : arg_5 = arg_3 [ arg_4 ] [ 1 ] arg_6 = arg_3 [ arg_4 + 1 ] [ 1 ] print "%s |" % bitsToString ( arg_1 [ arg_5 : arg_6 ] ) , print

Creates a layer from its config.

    This method is the reverse of `get_config`, capable of instantiating the
    same layer from the config dictionary.

    Args:
      config: A Python dictionary, typically the output of `get_config`.

    Returns:
      layer: A layer instance.


Question: Given a document_field and a form_value this will translate the value to the correct result for mongo to use .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if isinstance ( arg_0 , ReferenceField ) : arg_2 = arg_0 . document_type . objects . get ( id = arg_1 ) if arg_1 else None return arg_2

Returns the number of connected subscribers.

        :rtype:  int
        :returns: The number of subscribers.


Question: Create event start and end datetimes .

def Func ( arg_0 , arg_1 ) : arg_2 = datetime . datetime . now ( ) return { "start" : { "dateTime" : ( arg_2 + datetime . timedelta ( minutes = int ( arg_1 [ "start" ] ) ) ) . strftime ( DT_FORMAT ) , "timeZone" : arg_0 . timezone , } , "end" : { "dateTime" : ( arg_2 + datetime . timedelta ( minutes = int ( arg_1 [ "end" ] ) ) ) . strftime ( DT_FORMAT ) , "timeZone" : arg_0 . timezone , } , }


Question: Re - encrypt all of the files and checkpoints for a single user .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_4 . info ( "Begin re-encryption for user %s" , arg_1 ) with arg_0 . begin ( ) as db : arg_4 . info ( "Re-encrypting files for %s" , arg_1 ) for ( arg_5 , ) in select_file_ids ( db , arg_1 ) : reencrypt_row_content ( db , files , arg_5 , arg_2 , arg_3 , arg_4 , ) arg_4 . info ( "Re-encrypting checkpoints for %s" , arg_1 ) for ( arg_6 , ) in select_remote_checkpoint_ids ( db , arg_1 ) : reencrypt_row_content ( db , remote_checkpoints , arg_6 , arg_2 , arg_3 , arg_4 , ) arg_4 . info ( "Finished re-encryption for user %s" , arg_1 )


Question: Returns token for the request .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = 'http://' + arg_1 + arg_2 + arg_0 . issuer + arg_0 . account_key if arg_4 in arg_11 : arg_5 = arg_11 [ arg_4 ] if not arg_0 . _token_is_expired ( arg_5 ) : return arg_5 arg_6 = HTTPRequest ( ) arg_6 . protocol_override = 'https' arg_6 . host = arg_1 . replace ( '.servicebus.' , '-sb.accesscontrol.' ) arg_6 . method = 'POST' arg_6 . path = '/WRAPv0.9' arg_6 . body = ( 'wrap_name=' + url_quote ( arg_0 . issuer ) + '&wrap_password=' + url_quote ( arg_0 . account_key ) + '&wrap_scope=' + url_quote ( 'http://' + arg_1 + arg_2 ) ) . encode ( 'utf-8' ) arg_6 . headers . append ( ( 'Content-Length' , str ( len ( arg_6 . body ) ) ) ) arg_10 = arg_3 . perform_request ( arg_6 ) arg_5 = arg_10 . body . decode ( 'utf-8-sig' ) arg_5 = url_unquote ( arg_5 [ arg_5 . find ( '=' ) + 1 : arg_5 . rfind ( '&' ) ] ) arg_11 [ arg_4 ] = arg_5 return arg_5

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


Question: Compute the labor hours given a count of source lines of code

def Func ( arg_0 , arg_1 = 'cocomo_book' ) : if arg_1 == 'hours_per_year' : arg_2 = 40.0 * 52 / 12 else : arg_2 = 152.0 arg_3 = 'http://csse.usc.edu/tools/cocomoii.php' arg_4 = requests . post ( arg_3 , data = { 'new_size' : arg_0 } ) try : arg_5 = float ( EFFORT_REGEX . search ( arg_4 . text ) . group ( 1 ) ) except AttributeError : logger . error ( 'Unable to find Person Months in page text: sloc=%s' , arg_0 ) arg_5 = 0 arg_6 = arg_5 * arg_2 logger . debug ( 'sloc=%d labor_hours=%d' , arg_0 , arg_6 ) return arg_6

Returns a list of the dicom files within root_path

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

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


Question: Parse an assembly file in fasta format .

def Func ( arg_0 , arg_1 ) : with open ( arg_1 ) as fh : arg_2 = None logger . debug ( "Starting iteration of assembly file: {}" . format ( arg_1 ) ) for arg_3 in fh : if not arg_3 . strip ( ) : continue if arg_3 . startswith ( ">" ) : arg_2 = arg_3 [ 1 : ] . strip ( ) arg_0 . contigs [ arg_2 ] = [ ] else : arg_0 . contigs [ arg_2 ] . append ( arg_3 . strip ( ) ) arg_0 . contigs = OrderedDict ( ( arg_2 , "" . join ( seq ) ) for arg_2 , seq in arg_0 . contigs . items ( ) )

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: Log msg at verbose level debug < verbose < info

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_0 . log ( logging . VERBOSE , arg_1 , * arg_2 , ** arg_3 )

Create a canvas course with the given subaccount id and course name.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.create


Question: Attempts to list all of the modules and submodules found within a given directory tree . This function recursively searches the directory tree for potential python modules and returns a list of candidate names .

def Func ( arg_0 ) : arg_1 = list ( ) if os . path . isdir ( arg_0 ) : for arg_2 in os . listdir ( arg_0 ) : arg_3 = os . path . join ( arg_0 , arg_2 ) if os . path . isfile ( os . path . join ( arg_3 , MODULE_INIT_FILE ) ) : arg_4 = _search_for_modules ( arg_3 , True , arg_2 ) arg_1 . extend ( arg_4 ) return arg_1

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


Question: Parse a CSV line into a price element

def Func ( arg_0 , arg_1 : arg_2 ) -> PriceModel : arg_1 = arg_1 . rstrip ( ) arg_3 = arg_1 . split ( ',' ) arg_4 = PriceModel ( ) arg_4 . symbol = arg_0 . translate_symbol ( arg_3 [ 0 ] ) arg_4 . value = Decimal ( arg_3 [ 1 ] ) arg_7 = arg_3 [ 2 ] arg_7 = arg_7 . replace ( '"' , '' ) arg_8 = arg_7 . split ( '/' ) arg_9 = arg_8 [ 2 ] arg_10 = arg_8 [ 1 ] arg_11 = arg_8 [ 0 ] logging . debug ( f"parsing {date_parts} into date" ) arg_4 . datetime = arg_12 ( int ( arg_9 ) , int ( arg_10 ) , int ( arg_11 ) ) return arg_4

Creates the Nginx configuration for the project


Question: Get the list of milestones

def Func ( arg_0 , arg_1 = [ ] , arg_2 = [ ] , arg_3 = None , arg_4 = 10 , arg_5 = 0 ) : arg_6 = { } if arg_2 : arg_6 [ 'milestones[]' ] = arg_2 if arg_1 : arg_6 [ 'projects[]' ] = arg_1 arg_6 [ 'limit' ] = arg_4 arg_6 [ 'offset' ] = arg_5 if arg_3 : arg_6 . update ( arg_3 ) arg_7 = make_get_request ( arg_0 , 'milestones' , params_data = arg_6 ) arg_8 = arg_7 . json ( ) if arg_7 . status_code == 200 : return arg_8 [ 'result' ] else : raise MilestonesNotFoundException ( message = arg_8 [ 'message' ] , error_code = arg_8 [ 'error_code' ] , request_id = arg_8 [ 'request_id' ] )

Whether a connection can be established between those two meshes.


Question: Update the results string and last - update - time fields of a model .

def Func ( arg_0 , arg_1 , arg_2 ) : with ConnectionFactory . get ( ) as conn : arg_3 = 'UPDATE %s SET _eng_last_update_time=UTC_TIMESTAMP(), ' '              results=%%s ' '          WHERE job_id=%%s' % ( arg_0 . jobsTableName , ) conn . cursor . execute ( arg_3 , [ arg_2 , arg_1 ] )

Removes the specfied course from the specified organization


Question: This function deal with the heat notification .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ 'event_type' ] arg_3 = heat_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 heat_customer_process_wildcard . keys ( ) : if arg_6 . match ( arg_2 ) : arg_5 = heat_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 ( )

Slice all the annotations inside the jam and return as a new `JAMS`
        object.

        See `Annotation.slice` for details about how the annotations
        are sliced.

        This operation is also documented in the jam-level sandbox
        with a list keyed by ``JAMS.sandbox.slice`` containing a tuple for each
        jam-level slice of the form ``(start_time, end_time)``.

        Since slicing is implemented using trimming, the operation will also be
        documented in ``JAMS.sandbox.trim`` as described in `JAMS.trim`.

        This function also copies over all of the file metadata from the
        original jam.

        Note: slicing will affect the duration of the jam, i.e. the new value
        of ``JAMS.file_metadata.duration`` will be ``end_time - start_time``.

        Parameters
        ----------
        start_time : float
            The desired start time for slicing in seconds.
        end_time
            The desired end time for slicing in seconds. Must be greater than
            ``start_time``.
        strict : bool
            When ``False`` (default) observations that lie at the boundaries of
            the slicing range (see `Annotation.slice` for details), will have
            their time and/or duration adjusted such that only the part of the
            observation that lies within the slice range is kept. When ``True``
            such observations are discarded and not included in the sliced
            annotation.

        Returns
        -------
        jam_sliced: JAMS
            The sliced jam with sliced annotations, returned as a new
            JAMS object.


Question: This plots the training results from the classifier run on the training set .

def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_0 , str ) and os . path . exists ( arg_0 ) : with open ( arg_0 , 'rb' ) as infd : arg_3 = pickle . load ( infd ) elif isinstance ( arg_0 , dict ) : arg_3 = arg_0 else : LOGERROR ( "can't figure out the input classifier arg" ) return None arg_4 = arg_3 [ 'best_confmatrix' ] arg_5 = arg_3 [ 'best_classifier' ] . feature_importances_ arg_6 = np . array ( [ tree . feature_importances_ for tree in arg_3 [ 'best_classifier' ] . estimators_ ] ) arg_7 = np . std ( arg_6 , axis = 0 ) arg_8 = np . array ( arg_3 [ 'feature_names' ] ) plt . figure ( figsize = ( 6.4 * 3.0 , 4.8 ) ) plt . subplot ( 121 ) arg_9 = np . array ( arg_1 ) plt . imshow ( arg_4 , interpolation = 'nearest' , cmap = plt . cm . Blues ) arg_10 = np . arange ( len ( arg_9 ) ) plt . xticks ( arg_10 , arg_9 ) plt . yticks ( arg_10 , arg_9 ) plt . title ( 'evaluation set confusion matrix' ) plt . ylabel ( 'predicted class' ) plt . xlabel ( 'actual class' ) arg_11 = arg_4 . max ( ) / 2. for arg_12 , arg_13 in itertools . product ( range ( arg_4 . shape [ 0 ] ) , range ( arg_4 . shape [ 1 ] ) ) : plt . text ( arg_13 , arg_12 , arg_4 [ arg_12 , arg_13 ] , horizontalalignment = "center" , color = "white" if arg_4 [ arg_12 , arg_13 ] > arg_11 else "black" ) plt . subplot ( 122 ) arg_14 = np . array ( arg_8 ) arg_15 = np . argsort ( arg_5 ) [ : : - 1 ] arg_14 = arg_14 [ arg_15 ] arg_8 = arg_8 [ arg_15 ] arg_5 = arg_5 [ arg_15 ] arg_7 = arg_7 [ arg_15 ] plt . bar ( np . arange ( 0 , arg_14 . size ) , arg_5 , yerr = arg_7 , width = 0.8 , color = 'grey' ) plt . xticks ( np . arange ( 0 , arg_14 . size ) , arg_14 , rotation = 90 ) plt . yticks ( [ 0.0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 ] ) plt . xlim ( - 0.75 , arg_14 . size - 1.0 + 0.75 ) plt . ylim ( 0.0 , 0.9 ) plt . ylabel ( 'relative importance' ) plt . title ( 'relative importance of features' ) plt . subplots_adjust ( wspace = 0.1 ) plt . savefig ( arg_2 , bbox_inches = 'tight' , dpi = 100 ) plt . close ( 'all' ) return arg_2

Whether a connection can be established between those two meshes.


Question: Return JSON representation for this template

def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 . fields : arg_1 [ arg_2 . name ] = arg_2 . Func ( arg_0 . data . get ( arg_2 . name ) ) return arg_1

Read attribute from sysfs and return as string


Question: Adds is_rendered to the context and the widget s context data .

def Func ( arg_0 , ** arg_1 ) : arg_2 = super ( RenderWidgetMixin , arg_0 ) . Func ( ** arg_1 ) arg_2 . update ( { 'is_rendered' : True , 'widget' : arg_0 . widget , } ) arg_2 . update ( arg_0 . widget . Func ( ) ) return arg_2

Convert a tuple of OM objects into an OM object

        EXAMPLES::

            >>> from openmath import openmath as om
            >>> from openmath.convert_pickle  import PickleConverter
            >>> converter = PickleConverter()
            >>> o = converter.OMTuple([om.OMInteger(2), om.OMInteger(3)]); o
            OMApplication(elem=OMSymbol(name='tuple', cd='Python', id=None, cdbase='http://python.org/'),
                     arguments=[OMInteger(integer=2, id=None), OMInteger(integer=3, id=None)], id=None, cdbase=None)
            >>> converter.to_python(o)
            (2, 3)


Question: Returns the given string as a string of bytes . That means in Python2 as a str object and in Python3 as a bytes object . Raises a TypeError if it cannot be converted .

def Func ( arg_0 , arg_1 = 'utf-8' ) : if six . PY2 : if isinstance ( arg_0 , str ) : return arg_0 elif isinstance ( arg_0 , unicode ) : return arg_0 . encode ( arg_1 ) else : if isinstance ( arg_0 , bytes ) : return arg_0 elif isinstance ( arg_0 , str ) : return arg_0 . encode ( arg_1 ) raise TypeError ( "Invalid argument %r for Func()" % ( arg_0 , ) )

Put us back at the beginning of the file again.


Question: Remove the MUC specific stanza payload element .

def Func ( arg_0 ) : if arg_0 . muc_child : arg_0 . muc_child . free_borrowed ( ) arg_0 . muc_child = None if not arg_0 . xmlnode . children : return arg_2 = arg_0 . xmlnode . children while arg_2 : if arg_2 . name not in ( "x" , "query" ) : arg_2 = arg_2 . next continue arg_3 = arg_2 . ns ( ) if not arg_3 : arg_2 = arg_2 . next continue arg_4 = arg_3 . getContent ( ) if arg_4 in ( MUC_NS , MUC_USER_NS , MUC_ADMIN_NS , MUC_OWNER_NS ) : arg_2 . unlinkNode ( ) arg_2 . freeNode ( ) arg_2 = arg_2 . next

Retrieve the list of courses contained within the catalog linked to this enterprise.

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


Question: Display the exception that just occurred .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = False ) : try : try : arg_5 , arg_6 , arg_7 = arg_0 . _get_exc_info ( arg_1 ) except ValueError : arg_0 . write_err ( 'No traceback available to show.\n' ) return if arg_5 is SyntaxError : arg_0 . showsyntaxerror ( arg_2 ) elif arg_5 is UsageError : arg_0 . write_err ( "UsageError: %s" % arg_6 ) else : if arg_4 : arg_8 = [ 'An exception has occurred, use %tb to see ' 'the full traceback.\n' ] arg_8 . extend ( arg_0 . InteractiveTB . get_exception_only ( arg_5 , arg_6 ) ) else : try : arg_8 = arg_6 . _render_traceback_ ( ) except Exception : arg_8 = arg_0 . InteractiveTB . structured_traceback ( arg_5 , arg_6 , arg_7 , arg_3 = arg_3 ) arg_0 . _Func ( arg_5 , arg_6 , arg_8 ) if arg_0 . call_pdb : arg_0 . debugger ( force = True ) return arg_0 . _Func ( arg_5 , arg_6 , arg_8 ) except KeyboardInterrupt : arg_0 . write_err ( "\nKeyboardInterrupt\n" )

Given configuration initiate a SigningService instance

    :param config: The signing service configuration
    :param entity_id: The entity identifier
    :return: A SigningService instance


Question: Create a torus mesh

def Func ( arg_0 , arg_1 = 3.0 , arg_2 = 1.0 , arg_3 = None , arg_4 = None , arg_5 = 48 , arg_6 = 12 , arg_7 = None ) : if arg_3 is not None and arg_4 is not None : arg_1 = ( arg_3 + arg_4 ) / 4 arg_2 = arg_1 - arg_3 / 2 arg_8 = '' . join ( [ '  <filter name="Torus">\n' , '    <Param name="hRadius" ' , 'value="%s" ' % arg_1 , 'description="Horizontal Radius" ' , 'type="RichFloat" ' , '/>\n' , '    <Param name="vRadius" ' , 'value="%s" ' % arg_2 , 'description="Vertical Radius" ' , 'type="RichFloat" ' , '/>\n' , '    <Param name="hSubdiv" ' , 'value="%d" ' % arg_5 , 'description="Horizontal Subdivision" ' , 'type="RichInt" ' , '/>\n' , '    <Param name="vSubdiv" ' , 'value="%d" ' % arg_6 , 'description="Vertical Subdivision" ' , 'type="RichInt" ' , '/>\n' , '  </filter>\n' ] ) util . write_filter ( arg_0 , arg_8 ) if isinstance ( arg_0 , FilterScript ) : arg_0 . add_layer ( 'Torus' , change_layer = True ) if arg_7 is not None : vert_color . function ( arg_0 , arg_7 = arg_7 ) return None

Primitive string formatter.

        The only directives understood are the following:
          ============   ==========================
          Directive      meaning
          ============   ==========================
          %d             day as integer
          %H             hour  [00-23]
          %h             hours including days
          %M             minute as integer [00-59]
          %S             second as integer [00-59]
          ============   ==========================


Question: Return the metadata for the specified program .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . get_object ( ) arg_5 = arg_4 . get_program ( arg_3 ) if not arg_5 : raise Http404 arg_6 = arg_0 . get_serializer_context ( ) arg_6 [ 'enterprise_customer_catalog' ] = arg_4 arg_7 = serializers . ProgramDetailSerializer ( arg_5 , arg_6 = arg_6 ) return Response ( arg_7 . data )

Initialize the bucket map assuming the given number of maxBuckets.


Question: Output code coverage report .

def Func ( arg_0 , arg_1 ) : log . debug ( "Coverage Func" ) arg_0 . coverInstance . stop ( ) arg_0 . coverInstance . combine ( ) arg_0 . coverInstance . save ( ) arg_2 = [ module for name , module in sys . modules . items ( ) if arg_0 . wantModuleCoverage ( name , module ) ] log . debug ( "Coverage Func will cover modules: %s" , arg_2 ) arg_0 . coverInstance . Func ( arg_2 , file = arg_1 ) if arg_0 . coverHtmlDir : log . debug ( "Generating HTML coverage Func" ) arg_0 . coverInstance . html_Func ( arg_2 , arg_0 . coverHtmlDir ) if arg_0 . coverXmlFile : log . debug ( "Generating XML coverage Func" ) arg_0 . coverInstance . xml_Func ( arg_2 , arg_0 . coverXmlFile ) if arg_0 . coverMinPercentage : arg_3 = StringIO . StringIO ( ) arg_0 . coverInstance . Func ( arg_2 , file = arg_3 ) arg_4 = re . search ( r'-------\s\w+\s+\d+\s+\d+\s+(\d+)%\s+\d*\s{0,1}$' , arg_3 . getvalue ( ) ) if arg_4 : arg_5 = int ( arg_4 . groups ( ) [ 0 ] ) if arg_5 < arg_0 . coverMinPercentage : log . error ( 'TOTAL Coverage did not reach minimum ' 'required: %d%%' % arg_0 . coverMinPercentage ) sys . exit ( 1 ) else : log . error ( "No total percentage was found in coverage output, " "something went wrong." )

Remove a list of metabolites from the the object.

        The change is reverted upon exit when using the model as a context.

        Parameters
        ----------
        metabolite_list : list
            A list with `cobra.Metabolite` objects as elements.

        destructive : bool
            If False then the metabolite is removed from all
            associated reactions.  If True then all associated
            reactions are removed from the Model.


Question: Compute k - means clustering .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ : , 'X' ] if isinstance ( arg_1 , DictRDD ) else arg_1 check_rdd ( arg_2 , ( np . ndarray , sp . spmatrix ) ) if arg_0 . init == 'k-means||' : arg_0 . _mllib_model = MLlibKMeans . train ( arg_2 . unblock ( ) , arg_0 . n_clusters , maxIterations = arg_0 . max_iter , initializationMode = "k-means||" ) arg_0 . cluster_centers_ = arg_0 . _mllib_model . centers else : arg_5 = arg_2 . map ( lambda arg_2 : super ( SparkKMeans , arg_0 ) . Func ( arg_2 ) ) arg_5 = arg_5 . map ( lambda model : model . cluster_centers_ ) . collect ( ) return super ( SparkKMeans , arg_0 ) . Func ( np . concatenate ( arg_5 ) )

activates error messages, useful during development


Question: Recursive calculation of scene bbox

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 . matrix is not None : arg_1 = matrix44 . multiply ( arg_0 . matrix , arg_1 ) if arg_0 . mesh : arg_2 , arg_3 = arg_0 . mesh . Func ( arg_1 , arg_2 , arg_3 ) for arg_4 in arg_0 . children : arg_2 , arg_3 = arg_4 . Func ( arg_1 , arg_2 , arg_3 ) return arg_2 , arg_3


Question: Return best block selected based on simple heuristic .

def Func ( arg_0 ) : if not arg_0 : raise ValueError ( "No suitable blocks were found in assembly." ) arg_1 = max ( arg_0 , key = lambda b : b [ 1 ] [ 'packed_instr' ] ) if arg_1 [ 1 ] [ 'packed_instr' ] == 0 : arg_1 = max ( arg_0 , key = lambda b : ( b [ 1 ] [ 'ops' ] + b [ 1 ] [ 'packed_instr' ] + b [ 1 ] [ 'avx_instr' ] , b [ 1 ] [ 'ZMM' ] , b [ 1 ] [ 'YMM' ] , b [ 1 ] [ 'XMM' ] ) ) return arg_1 [ 0 ]

Returns the profile with the received ID as a dict

        If a local copy of the profile exists, it'll be returned. If not, it'll
        be downloaded from the web. The results are cached, so any subsequent
        calls won't hit the filesystem or the web.

        Args:
            profile_id (str): The ID of the profile you want.

        Raises:
            RegistryError: If there was some problem opening the profile file
                or its format was incorrect.


Question: Return the Spec for IdentityRegion .

def Func ( arg_0 ) : arg_1 = { "description" : IdentityRegion . __doc__ , "singleNodeOnly" : True , "inputs" : { "in" : { "description" : "The input vector." , "dataType" : "Real32" , "count" : 0 , "required" : True , "regionLevel" : False , "isDefaultInput" : True , "requireSplitterMap" : False } , } , "outputs" : { "out" : { "description" : "A copy of the input vector." , "dataType" : "Real32" , "count" : 0 , "regionLevel" : True , "isDefaultOutput" : True } , } , "parameters" : { "dataWidth" : { "description" : "Size of inputs" , "accessMode" : "Read" , "dataType" : "UInt32" , "count" : 1 , "constraints" : "" } , } , } return arg_1

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Sends a single datapoint metric to DataDog

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = api . Metric . send ( metric = arg_1 , points = arg_2 , host = arg_0 . host , arg_3 = arg_3 , type = arg_4 , arg_5 = arg_5 ) arg_0 . validate_response ( arg_6 ) return arg_6

Creates a generator that does all the work.


Question: Removes the video from youtube and from db Requires POST

def Func ( arg_0 , arg_1 ) : try : arg_2 = settings . YOUTUBE_DELETE_REDIRECT_URL except AttributeError : arg_2 = reverse ( "django_youtube.views.upload" ) try : Video . objects . get ( arg_1 = arg_1 ) . delete ( ) except : from django . contrib import messages messages . add_message ( arg_0 , messages . ERROR , _ ( 'Video could not be deleted.' ) ) return HttpResponseRedirect ( arg_2 )

Return resistance of the vehicle.

        :return: newton the resistance of the ship


Question: Transforms X according to the linear transformation corresponding to flipping the input eigenvalues .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . flip_ . shape [ 0 ] if arg_1 . ndim != 2 or arg_1 . shape [ 1 ] != arg_2 : arg_3 = "X should have {} columns, the number of samples at fit time" raise TypeError ( arg_3 . format ( arg_0 . flip_ . shape [ 0 ] ) ) return np . dot ( arg_1 , arg_0 . flip_ )

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

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

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


Question: Apply a generic array - > object to each subarray

def Func ( arg_0 , arg_1 ) : def process_record ( arg_2 ) : arg_3 = empty ( 1 , dtype = "object" ) arg_3 [ 0 ] = arg_1 ( arg_2 ) return arg_3 arg_4 = arg_0 . _rdd . mapValues ( process_record ) arg_5 = arg_0 . getnumber ( arg_0 . plan , arg_0 . vshape ) arg_6 = tuple ( [ int ( s ) for s in r_ [ arg_0 . kshape , arg_5 ] ] ) arg_7 = len ( arg_0 . shape ) return BoltArraySpark ( arg_4 , shape = arg_6 , split = arg_7 , ordered = arg_0 . _ordered , dtype = "object" )

Add feedback on a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "message": string*
        }
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []


Question: Parses an operand from buf

def Func ( arg_0 , arg_1 ) : arg_1 = iter ( arg_1 ) try : arg_2 = 0 for arg_3 in range ( arg_0 . operand_size ) : arg_2 <<= 8 arg_2 |= next ( arg_1 ) arg_0 . _operand = arg_2 except StopIteration : raise ParseError ( "Not enough data for decoding" )

Return the generation index of the first generation in the given
    swarm that does not have numParticles particles in it, either still in the
    running state or completed. This does not include orphaned particles.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:  A string representation of the sorted list of encoders in this
                 swarm. For example '__address_encoder.__gym_encoder'
    minNumParticles: minium number of partices required for a full
                  generation.

    retval:  generation index, or None if no particles at all.


Question: diff - Compare the field values on two IndexedRedisModels .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if not isIndexedRedisModel ( arg_0 ) : raise ValueError ( 'Type < %s > does not extend IndexedRedisModel.' % ( type ( arg_0 ) . __name__ , ) ) if not isIndexedRedisModel ( arg_1 ) : raise ValueError ( 'Type < %s > does not extend IndexedRedisModel.' % ( type ( arg_1 ) . __name__ , ) ) arg_0 . validateModel ( ) arg_1 . validateModel ( ) if getattr ( arg_0 , 'FIELDS' ) != getattr ( arg_1 , 'FIELDS' ) : raise ValueError ( 'Cannot compare  < %s > and < %s > . Must be same model OR have equal FIELDS.' % ( arg_0 . __class__ , arg_1 . __class__ ) ) arg_3 = { } for arg_4 in arg_0 . FIELDS : arg_5 = str ( arg_4 ) arg_6 = object . __getattribute__ ( arg_0 , arg_5 ) arg_7 = object . __getattribute__ ( arg_1 , arg_5 ) if arg_6 != arg_7 : arg_3 [ arg_5 ] = ( ( arg_6 , arg_7 ) ) if arg_2 : arg_8 = arg_0 . getPk ( ) arg_9 = arg_1 . getPk ( ) if arg_8 != arg_9 : arg_3 [ '_id' ] = ( arg_8 , arg_9 ) return arg_3

validate source directory names in components


Question: Download a file from device to local filesystem

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . __exchange ( 'send("{filename}")' . format ( arg_1 = arg_1 ) ) if ( 'unexpected' in arg_2 ) or ( 'stdin' in arg_2 ) : log . error ( 'Unexpected error downloading file: %s' , arg_2 ) raise Exception ( 'Unexpected error downloading file' ) arg_0 . __write ( 'C' ) arg_3 = arg_0 . __expect ( NUL ) . strip ( ) log . info ( 'receiveing ' + arg_3 ) arg_0 . __write ( ACK , True ) arg_4 = '' arg_5 = '' arg_6 , arg_4 = arg_0 . __read_chunk ( arg_4 ) while arg_6 != '' : arg_0 . __write ( ACK , True ) arg_5 = arg_5 + arg_6 arg_6 , arg_4 = arg_0 . __read_chunk ( arg_4 ) return arg_5

Load a default value for redshift from config and set it as the redshift for source or lens galaxies that have
    falsey redshifts

    Parameters
    ----------
    key: str

    Returns
    -------
    decorator
        A decorator that wraps the setter function to set defaults


Question: Download outputs for job .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = get_job_or_local ( arg_0 . obj . get ( 'project' ) , arg_0 . obj . get ( 'job' ) ) try : PolyaxonClient ( ) . job . download_Func ( arg_1 , arg_2 , arg_3 ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not download Func for job `{}`.' . format ( arg_3 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) Printer . print_success ( 'Files downloaded.' )


Question: Return a sorted DataFrame sorted by the expression by

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = 'quickFunc' ) : arg_0 = arg_0 . trim ( ) arg_4 = arg_0 . evaluate ( arg_1 , filtered = False ) arg_5 = np . argFunc ( arg_4 , arg_3 = arg_3 ) if not arg_2 : arg_5 = arg_5 [ : : - 1 ] . copy ( ) return arg_0 . take ( arg_5 )


Question: Load aggregation configurations .

def Func ( arg_0 ) : arg_1 = { } for arg_2 in iter_entry_points ( group = arg_0 . entry_point_group_aggs ) : for arg_3 in arg_2 . load ( ) ( ) : if arg_3 [ 'aggregation_name' ] not in arg_0 . enabled_aggregations : continue elif arg_3 [ 'aggregation_name' ] in arg_1 : raise DuplicateAggregationError ( 'Duplicate aggregation {0} in entry point ' '{1}' . format ( arg_3 [ 'event_type' ] , arg_2 . name ) ) arg_3 . update ( arg_0 . enabled_aggregations [ arg_3 [ 'aggregation_name' ] ] or { } ) arg_1 [ arg_3 [ 'aggregation_name' ] ] = arg_3 return arg_1

APEv2 tag value factory.

    Use this if you need to specify the value's type manually.  Binary
    and text data are automatically detected by APEv2.__setitem__.


Question: Set the shutdown state of the Connection .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , integer_types ) : raise TypeError ( "state must be an integer" ) _lib . SSL_Func ( arg_0 . _ssl , 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 the headers for a new zipkin span .

def Func ( arg_0 = None , arg_1 = None ) : if arg_1 : arg_2 = arg_1 . get_zipkin_attrs ( ) elif arg_0 : arg_2 = arg_0 . get ( ) else : arg_2 = get_default_tracer ( ) . get_zipkin_attrs ( ) if not arg_2 : return { } return { 'X-B3-TraceId' : arg_2 . trace_id , 'X-B3-SpanId' : generate_random_64bit_string ( ) , 'X-B3-ParentSpanId' : arg_2 . span_id , 'X-B3-Flags' : '0' , 'X-B3-Sampled' : '1' if arg_2 . is_sampled else '0' , }

Perform an ADC read with the provided mux, gain, data_rate, and mode
        values.  Returns the signed integer result of the read.


Question: Fits X to outcomes y using clf

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 'auto' ) : arg_0 . X = arg_1 arg_0 . y = arg_2 arg_0 . set_class_weight ( arg_4 = arg_4 , arg_2 = arg_2 ) arg_0 . clf = arg_0 . clf . Func ( arg_1 , arg_2 ) return arg_0 . clf

Initialize configuration.

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


Question: SPSS . sav files to Pandas DataFrame through savreader module

def Func ( arg_0 ) : from savReaderWriter import SavReader arg_1 = [ ] with SavReader ( arg_0 , returnHeader = True ) as reader : arg_2 = next ( reader ) for arg_3 in reader : arg_1 . append ( arg_3 ) return pd . DataFrame ( data = arg_1 , columns = arg_2 )

This method should only be called while the reference is locked.

        Decrements the reference count for the resource. If this process holds
        the only reference at the time we finish dereferencing it; True is
        returned. Operating on the resource after it has been dereferenced is
        undefined behavior.

        Dereference queries the value stored in the backend, if any, iff (if
        and only if) this instance is the last reference to that resource. e.g.
        self.count() == 0

        :param function callback: A function to execute iff it's determined
            this process holds the only reference to the resource. When there
            is a failure communicating with the backend in the cleanup step the
            callback function will be called an additional time for that
            failure and each subsequent one thereafter. Ensure your callback
            handles this properly.
        :param tuple args: Positional arguments to pass your callback.
        :param dict kwargs: keyword arguments to pass your callback.

        :returns: Whether or not there are no more references among all
            processes. True if this was the last reference. False otherwise.
        :rtype: bool


Question: check for a name using the type s regexp

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = arg_5 . HIGH ) : def _should_exempt_from_invalid_name ( arg_3 ) : if arg_1 == "variable" : arg_7 = utils . safe_infer ( arg_3 ) if isinstance ( arg_7 , astroid . ClassDef ) : return True return False if utils . is_inside_except ( arg_3 ) : arg_8 , arg_9 = utils . clobber_in_except ( arg_3 ) if arg_8 : return if arg_2 in arg_0 . config . good_names : return if arg_2 in arg_0 . config . bad_names : arg_0 . stats [ "badname_" + arg_1 ] += 1 arg_0 . add_message ( "blacklisted-name" , arg_3 = arg_3 , args = arg_2 ) return arg_10 = arg_0 . _name_regexps [ arg_1 ] arg_11 = arg_10 . match ( arg_2 ) if _is_multi_naming_match ( arg_11 , arg_1 , arg_4 ) : arg_12 = arg_0 . _find_name_group ( arg_1 ) arg_13 = arg_0 . _bad_names . setdefault ( arg_12 , { } ) arg_14 = arg_13 . setdefault ( arg_11 . lastgroup , [ ] ) arg_14 . append ( ( arg_3 , arg_1 , arg_2 , arg_4 ) ) if arg_11 is None and not _should_exempt_from_invalid_name ( arg_3 ) : arg_0 . _raise_name_warning ( arg_3 , arg_1 , arg_2 , arg_4 )

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: Delete old prices leaving just the last .

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) : arg_3 = PriceDbApplication ( ) arg_3 . logger = arg_4 arg_5 = 0 if arg_0 is not None : arg_6 = SecuritySymbol ( "" , "" ) arg_6 . parse ( arg_0 ) arg_7 = arg_3 . Func ( arg_6 ) if arg_7 : arg_5 = 1 else : arg_5 = arg_3 . Func_all ( ) print ( f"Removed {count} old price entries." )

Upload a new site build to LSST the Docs.


Question: Read the contents of the Annotation Resource

def Func ( arg_0 ) : if not arg_0 . __content__ : arg_0 . __retriever__ = arg_0 . __resolver__ . resolve ( arg_0 . uri ) arg_0 . __content__ , arg_0 . __mimetype__ = arg_0 . __retriever__ . Func ( arg_0 . uri ) return arg_0 . __content__

Removes a player from the current players.


Question: Get a Sender for the Service Bus endpoint .

def Func ( arg_0 , arg_1 = 0 , arg_2 = None , ** arg_3 ) : arg_4 = str ( uuid . uuid4 ( ) ) if arg_0 . entity and arg_0 . requires_session : return SessionSender ( arg_4 , arg_0 . entity_uri , arg_0 . auth_config , arg_2 = arg_2 , loop = arg_0 . loop , debug = arg_0 . debug , msg_timeout = arg_1 , ** arg_3 ) return Sender ( arg_4 , arg_0 . entity_uri , arg_0 . auth_config , arg_2 = arg_2 , loop = arg_0 . loop , debug = arg_0 . debug , msg_timeout = arg_1 , ** arg_3 )

Return a dictionary of circuit properties.


Question: Starts a network run before the individual run .

def Func ( arg_0 , arg_1 ) : arg_0 . pre_build ( arg_1 ) arg_0 . _logger . info ( '\n------------------------\n' 'Pre-Running the Network\n' '------------------------' ) arg_0 . _network = arg_0 . _network_constructor ( * arg_0 . _brian_list ) arg_0 . network_runner . execute_network_pre_run ( arg_1 , arg_0 . _network , arg_0 . _network_dict , arg_0 . components , arg_0 . analysers ) arg_0 . _logger . info ( '\n-----------------------------\n' 'Network Simulation successful\n' '-----------------------------' ) arg_0 . _pre_run = True if hasattr ( arg_0 . _network , 'store' ) : arg_0 . _network . store ( 'pre_run' )

Overriding the default JSONEncoder.default for NDB support.


Question: Add extensions to the certificate .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if not isinstance ( arg_2 , X509Extension ) : raise ValueError ( "One of the elements is not an X509Extension" ) arg_3 = _lib . X509_add_ext ( arg_0 . _x509 , arg_2 . _extension , - 1 ) if not arg_3 : _raise_current_error ( )


Question: Create an item to the server .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , ** arg_4 ) : arg_5 = dict ( ) arg_5 [ 'token' ] = arg_1 arg_5 [ 'name' ] = arg_2 arg_5 [ 'parentid' ] = arg_3 arg_6 = [ 'description' , 'uuid' , 'privacy' ] for arg_7 in arg_6 : if arg_7 in arg_4 : arg_5 [ arg_7 ] = arg_4 [ arg_7 ] arg_8 = arg_0 . request ( 'midas.item.create' , arg_5 ) return arg_8

Trim all the annotations inside the jam and return as a new `JAMS`
        object.

        See `Annotation.trim` for details about how the annotations
        are trimmed.

        This operation is also documented in the jam-level sandbox
        with a list keyed by ``JAMS.sandbox.trim`` containing a tuple for each
        jam-level trim of the form ``(start_time, end_time)``.

        This function also copies over all of the file metadata from the
        original jam.

        Note: trimming does not affect the duration of the jam, i.e. the value
        of ``JAMS.file_metadata.duration`` will be the same for the original
        and trimmed jams.

        Parameters
        ----------
        start_time : float
            The desired start time for the trimmed annotations in seconds.
        end_time
            The desired end time for trimmed annotations in seconds. Must be
            greater than ``start_time``.
        strict : bool
            When ``False`` (default) observations that lie at the boundaries of
            the trimming range (see `Annotation.trim` for details), will have
            their time and/or duration adjusted such that only the part of the
            observation that lies within the trim range is kept. When ``True``
            such observations are discarded and not included in the trimmed
            annotation.

        Returns
        -------
        jam_trimmed : JAMS
            The trimmed jam with trimmed annotations, returned as a new JAMS
            object.


Question: Decorator function for windows with fractional input .

def Func ( arg_0 ) : def _wrap ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 , arg_5 = int ( np . floor ( arg_1 ) ) , int ( np . ceil ( arg_1 ) ) arg_6 = get_window ( arg_0 , arg_4 ) if len ( arg_6 ) < arg_5 : arg_6 = np . pad ( arg_6 , [ ( 0 , arg_5 - len ( arg_6 ) ) ] , mode = 'constant' ) arg_6 [ arg_4 : ] = 0.0 return arg_6 return _wrap

Generate a header for a tag section with specific parameters.

        :param str newer_tag_name: Name (title) of newer tag.
        :param str newer_tag_link: Tag name of newer tag, used for links.
                               Could be same as **newer_tag_name** or some
                               specific value, like `HEAD`.
        :param datetime newer_tag_time: Date and time when
                                        newer tag was created.
        :param str older_tag_link: Tag name of older tag, used for links.
        :param str project_url: URL for current project.
        :rtype: str
        :return: Generated ready-to-add tag section.


Question: Determines the length of the DH params from the ServerKeyExchange

def Func ( arg_0 ) : arg_1 = None arg_2 = None for arg_3 , arg_4 , arg_5 in parse_tls_records ( arg_0 ) : if arg_3 != b'\x16' : continue for arg_6 , arg_7 in parse_handshake_messages ( arg_5 ) : if arg_6 == b'\x0c' : arg_2 = arg_7 break if arg_2 : break if arg_2 : arg_1 = int_from_bytes ( arg_2 [ 0 : 2 ] ) * 8 return arg_1

Jumps short if not greater.

        :param cpu: current CPU.
        :param target: destination operand.


Question: Called when an error stanza is received .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_Func ( ) arg_0 . __logger . debug ( "Error from: %r Condition: %r" % ( arg_1 . get_from ( ) , arg_2 . get_condition ) )

Load the configuration.

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

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

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


Question: Function decorator that intercepts HTTP Errors and raises AirflowException with more informative message .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper_decorator ( arg_1 , * arg_2 , ** arg_3 ) : try : return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) except GoogleAPICallError as e : if isinstance ( e , AlreadyExists ) : raise e else : arg_1 . log . error ( 'The request failed:\n%s' , str ( e ) ) raise AirflowException ( e ) except RetryError as e : arg_1 . log . error ( 'The request failed due to a retryable error and retry attempts failed.' ) raise AirflowException ( e ) except ValueError as e : arg_1 . log . error ( 'The request failed, the parameters are invalid.' ) raise AirflowException ( e ) except HttpError as e : arg_1 . log . error ( 'The request failed:\n%s' , str ( e ) ) raise AirflowException ( e ) return wrapper_decorator

canonical cluster statistics for a single run and a single probability

    Parameters
    ----------

    microcanonical_statistics : ndarray
        Return value of `bond_microcanonical_statistics`

    convolution_factors : 1-D array_like
        The coefficients of the convolution for the given probabilty ``p``
        and for each occupation number ``n``.

    Returns
    -------
    ret : ndarray of size ``1``
        Structured array with dtype as returned by
        `canonical_statistics_dtype`

    ret['percolation_probability'] : ndarray of float
        The "percolation probability" of this run at the value of ``p``.
        Only exists if `microcanonical_statistics` argument has the
        ``has_spanning_cluster`` field.

    ret['max_cluster_size'] : ndarray of int
        Weighted size of the largest cluster (absolute number of sites)

    ret['moments'] : 1-D :py:class:`numpy.ndarray` of float
        Array of size ``5``.
        The ``k``-th entry is the weighted ``k``-th raw moment of the
        (absolute) cluster size distribution, with ``k`` ranging from ``0`` to
        ``4``.

    See Also
    --------

    bond_microcanonical_statistics
    canonical_statistics_dtype


Question: Process bounds as defined in the configuration .

def Func ( arg_0 ) : if arg_0 . _raw [ "Func" ] is None : return arg_0 . process_pyramid . Func else : return Bounds ( * _validate_Func ( arg_0 . _raw [ "Func" ] ) )

Renew the message lock.

        This will maintain the lock on the message to ensure
        it is not returned to the queue to be reprocessed. In order to complete (or otherwise settle)
        the message, the lock must be maintained. Messages received via ReceiveAndDelete mode are not
        locked, and therefore cannot be renewed. This operation can also be performed as an asynchronous
        background task by registering the message with an `azure.servicebus.aio.AutoLockRenew` instance.
        This operation is only available for non-sessionful messages.

        :raises: TypeError if the message is sessionful.
        :raises: ~azure.servicebus.common.errors.MessageLockExpired is message lock has already expired.
        :raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
        :raises: ~azure.servicebus.common.errors.MessageAlreadySettled is message has already been settled.


Question: Initialize application object .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_0 . init_config ( arg_1 ) arg_0 . limiter = Limiter ( arg_1 , key_func = get_ipaddr ) if arg_1 . config [ 'APP_ENABLE_SECURE_HEADERS' ] : arg_0 . talisman = Talisman ( arg_1 , ** arg_1 . config . get ( 'APP_DEFAULT_SECURE_HEADERS' , { } ) ) if arg_1 . config [ 'APP_HEALTH_BLUEPRINT_ENABLED' ] : arg_5 = Blueprint ( 'invenio_app_ping' , __name__ ) @ arg_5 . route ( '/ping' ) def arg_6 ( ) : return 'OK' arg_6 . talisman_view_options = { 'force_https' : False } arg_1 . register_blueprint ( arg_5 ) arg_8 = arg_1 . config . get ( 'APP_REQUESTID_HEADER' ) if arg_8 : @ arg_1 . before_request def set_request_id ( ) : arg_9 = request . headers . get ( arg_8 ) if arg_9 : arg_10 . request_id = arg_9 [ : 200 ] try : from flask_debugtoolbar import DebugToolbarExtension arg_1 . extensions [ 'flask-debugtoolbar' ] = DebugToolbarExtension ( arg_1 ) except ImportError : arg_1 . logger . debug ( 'Flask-DebugToolbar extension not installed.' ) arg_1 . extensions [ 'invenio-app' ] = arg_0

Remove hidden notes and tag a CERN if detected.


Question: Read a JSON notebook from a string and return the NotebookNode object .

def Func ( arg_0 , ** arg_1 ) : arg_2 , arg_3 , arg_4 = parse_json ( arg_0 , ** arg_1 ) if arg_2 == 1 : arg_5 = v1 . to_notebook_json ( arg_4 , ** arg_1 ) arg_5 = v3 . convert_to_this_nbformat ( arg_5 , orig_version = 1 ) elif arg_2 == 2 : arg_5 = v2 . to_notebook_json ( arg_4 , ** arg_1 ) arg_5 = v3 . convert_to_this_nbformat ( arg_5 , orig_version = 2 ) elif arg_2 == 3 : arg_5 = v3 . to_notebook_json ( arg_4 , ** arg_1 ) arg_5 = v3 . convert_to_this_nbformat ( arg_5 , orig_version = 3 , orig_minor = arg_3 ) else : raise NBFormatError ( 'Unsupported JSON nbformat version: %i' % arg_2 ) return arg_5

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


Question: Return the Jaro or Jaro - Winkler distance between two strings .

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = 'winkler' , arg_4 = False , arg_5 = 0.7 , arg_6 = 0.1 , ) : return JaroWinkler ( ) . dist ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 )

Lists all of the service certificates associated with the specified
        hosted service.

        service_name:
            Name of the hosted service.


Question: Handle inputs that start classic IPython prompt syntax .

def Func ( arg_0 ) : if not arg_0 or arg_0 . isspace ( ) : return arg_0 arg_1 = _ipy_prompt_re . match ( arg_0 ) if arg_1 : return arg_0 [ len ( arg_1 . group ( 0 ) ) : ] else : return arg_0

Add a torque to this body.

        Parameters
        ----------
        force : 3-tuple of float
            A vector giving the torque along each world or body coordinate axis.
        relative : bool, optional
            If False, the torque values are assumed to be given in the world
            coordinate frame. If True, they are assumed to be given in the
            body-relative coordinate frame. Defaults to False.


Question: Return the index string for Numpy . eignsum matrix - matrix multiplication .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 , arg_5 = _Func_helper ( arg_0 , arg_1 ) arg_6 = ascii_uppercase [ : arg_1 ] return "{mat_l}{mat_r}, " . format ( arg_2 = arg_2 , arg_3 = arg_3 ) + "{tens_lin}{tens_r}->{tens_lout}{tens_r}" . format ( arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 )


Question: Add sitedir argument to sys . path if missing and handle . pth files in sitedir

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = _init_pathinfo ( ) arg_2 = 1 else : arg_2 = 0 arg_0 , arg_3 = makepath ( arg_0 ) if not arg_3 in arg_1 : sys . path . append ( arg_0 ) try : arg_4 = os . listdir ( arg_0 ) except os . error : return arg_4 . sort ( ) for arg_5 in arg_4 : if arg_5 . endswith ( os . extsep + "pth" ) : addpackage ( arg_0 , arg_5 , arg_1 ) if arg_2 : arg_1 = None return arg_1

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

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

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


Question: Continue a TLS handshake .

def Func ( arg_0 ) : try : logger . debug ( " do_handshake()" ) arg_0 . _socket . do_handshake ( ) except ssl . SSLError , err : if err . args [ 0 ] == ssl . SSL_ERROR_WANT_READ : arg_0 . _tls_state = "want_read" logger . debug ( "   want_read" ) arg_0 . _state_cond . notify ( ) return elif err . args [ 0 ] == ssl . SSL_ERROR_WANT_WRITE : arg_0 . _tls_state = "want_write" logger . debug ( "   want_write" ) arg_0 . _write_queue . appendleft ( TLSHandshake ) return else : raise arg_0 . _tls_state = "connected" arg_0 . _set_state ( "connected" ) arg_0 . _auth_properties [ 'security-layer' ] = "TLS" if "tls-unique" in CHANNEL_BINDING_TYPES : try : arg_3 = arg_0 . _socket . get_channel_binding ( "tls-unique" ) except ValueError : pass else : arg_0 . _auth_properties [ 'channel-binding' ] = { "tls-unique" : arg_3 } try : arg_4 = arg_0 . _socket . cipher ( ) except AttributeError : arg_4 = "unknown" arg_5 = get_certificate_from_ssl_socket ( arg_0 . _socket ) arg_0 . event ( TLSConnectedEvent ( arg_4 , arg_5 ) )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Try to find a stream_id

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _image_re . search ( arg_1 ) if arg_2 : return arg_2 . group ( "stream_id" )

store metric in data tree and calc offset signs

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


Question: Returns a dictionary like object with the lists of values collapsed by their respective key . Useful to find varying vs constant keys and to find how fast keys vary .

def Func ( arg_0 , arg_1 ) : arg_2 = itertools . chain . from_iterable ( [ [ ( arg_4 , run [ arg_4 ] ) for arg_4 in run ] for run in arg_1 ] ) arg_3 = defaultdict ( list ) for ( arg_4 , arg_5 ) in arg_2 : arg_3 [ arg_4 ] . append ( arg_5 ) return arg_3

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: Return a requested map from a robot .

def Func ( arg_0 , arg_1 = None ) : arg_2 = requests . get ( arg_0 , stream = True , timeout = 10 ) if arg_1 : arg_3 = arg_0 . rsplit ( '/' , 2 ) [ 1 ] + '-' + arg_0 . rsplit ( '/' , 1 ) [ 1 ] arg_4 = arg_3 . split ( '?' ) [ 0 ] arg_5 = os . path . join ( arg_1 , arg_4 ) arg_2 . raise_for_status ( ) with open ( arg_5 , 'wb' ) as data : arg_2 . raw . decode_content = True shutil . copyfileobj ( arg_2 . raw , data ) return arg_2 . raw

Overriding the default JSONEncoder.default for NDB support.


Question: Runs Picard MarkDuplicates on a BAM file . Requires that the BAM file be coordinate sorted .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'LENIENT' ) : arg_4 = arg_0 . fileStore . getLocalTempDir ( ) arg_0 . fileStore . readGlobalFile ( arg_1 , os . path . join ( arg_4 , 'sorted.bam' ) ) arg_0 . fileStore . readGlobalFile ( arg_2 , os . path . join ( arg_4 , 'sorted.bai' ) ) arg_5 = [ 'MarkDuplicates' , 'INPUT=sorted.bam' , 'OUTPUT=mkdups.bam' , 'METRICS_FILE=metrics.txt' , 'ASSUME_SORTED=true' , 'CREATE_INDEX=true' , 'VALIDATION_STRINGENCY=%s' % arg_3 . upper ( ) ] arg_6 = [ '--rm' , '--log-driver' , 'none' , '-e' , 'JAVA_OPTIONS=-Djava.io.tmpdir=/data/ -Xmx{}' . format ( arg_0 . memory ) , '-v' , '{}:/data' . format ( arg_4 ) ] arg_7 = time . time ( ) dockerCall ( arg_0 = arg_0 , workDir = arg_4 , parameters = arg_5 , tool = 'quay.io/ucsc_cgl/picardtools:1.95--dd5ac549b95eb3e5d166a5e310417ef13651994e' , dockerParameters = arg_6 ) arg_8 = time . time ( ) _log_runtime ( arg_0 , arg_7 , arg_8 , "Picard MarkDuplicates" ) arg_1 = arg_0 . fileStore . writeGlobalFile ( os . path . join ( arg_4 , 'mkdups.bam' ) ) arg_2 = arg_0 . fileStore . writeGlobalFile ( os . path . join ( arg_4 , 'mkdups.bai' ) ) return arg_1 , arg_2

Return True if we should retry, False otherwise.


Question: Factory for loading the Poisson noise - map from a . fits file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 ) : arg_11 = sum ( [ arg_3 , arg_4 , arg_5 ] ) if arg_11 == 0 and arg_0 is not None : return PoissonNoiseMap . from_fits_with_pixel_scale ( file_path = arg_0 , hdu = arg_1 , arg_2 = arg_2 ) elif arg_5 : if not ( arg_8 or arg_10 ) and arg_7 is None : raise exc . DataException ( 'Cannot compute the Poisson noise-map from the image if an ' 'exposure-time (or exposure time map) is not supplied to convert to adus' ) if arg_10 and arg_9 is None : raise exc . DataException ( 'Cannot compute the Poisson noise-map from the image if a' 'gain is not supplied to convert from adus' ) return PoissonNoiseMap . from_image_and_exposure_time_map ( arg_2 = arg_2 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 ) elif arg_3 and arg_0 is not None : arg_12 = Array . from_fits ( file_path = arg_0 , hdu = arg_1 ) return PoissonNoiseMap . from_weight_map ( arg_12 = arg_12 , arg_2 = arg_2 ) elif arg_4 and arg_0 is not None : arg_13 = Array . from_fits ( file_path = arg_0 , hdu = arg_1 ) return PoissonNoiseMap . from_inverse_noise_map ( arg_13 = arg_13 , arg_2 = arg_2 ) else : return None

Calls consume_function for each element of this streamlet. This function returns nothing


Question: Returns the items that this user has purchased or has pending .

def Func ( arg_0 ) : arg_1 = [ commerce . Cart . STATUS_PAID , commerce . Cart . STATUS_ACTIVE ] return arg_0 . _items ( arg_1 )

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: Modify subfield at specified position .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None , arg_6 = None ) : arg_7 = record_get_subfields ( arg_0 , arg_1 , arg_5 = arg_5 , arg_6 = arg_6 ) try : arg_7 [ arg_4 ] = ( arg_2 , arg_3 ) except IndexError : raise InvenioBibRecordFieldError ( "There is no subfield with position '%d'." % arg_4 )

This function creates the command list from available information


Question: Return the application - controlled IIN field .

def Func ( arg_0 ) : arg_1 = opendnp3 . ApplicationIIN ( ) arg_1 . configCorrupt = False arg_1 . deviceTrouble = False arg_1 . localControl = False arg_1 . needTime = False arg_6 = arg_1 . ToIIN ( ) _log . debug ( 'OutstationApplication.Func: IINField LSB={}, MSB={}' . format ( arg_6 . LSB , arg_6 . MSB ) ) return arg_1

Extracts start row from the bookmark information


Question: return the array . array objects for the branch and its counter branch

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _getArray ( arg_1 , arg_2 ) if arg_3 is None : return None , None arg_4 = arg_0 . _getCounterArray ( arg_1 , arg_2 ) return arg_3 , arg_4

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: Plot pairwise distances between all samples

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = "euclidean" ) : arg_6 = arg_0 . genotypes . to_n_alt ( ) arg_7 = allel . pairwise_distance ( arg_6 , arg_5 = arg_5 ) if not arg_2 : arg_8 = plt . figure ( figsize = ( 5 , 5 ) ) arg_2 = arg_8 . add_subplot ( 1 , 1 , 1 ) if isinstance ( arg_1 , bool ) : if arg_1 : arg_1 = list ( arg_0 . samples_vcforder ) elif isinstance ( arg_1 , type ( None ) ) : pass else : if not len ( arg_1 ) == len ( arg_0 . samples_vcforder ) : raise IPyradError ( LABELS_LENGTH_ERROR . format ( len ( arg_1 ) , len ( arg_0 . samples_vcforder ) ) ) allel . plot . pairwise_distance ( arg_7 , arg_1 = arg_1 , arg_2 = arg_2 , colorbar = 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: Calculate f_ON and f_OFF as defined in van Straten et al . 2012 equations 2 and 3

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 , arg_5 = integrate_calib ( arg_0 , arg_2 , ** arg_3 ) arg_6 , arg_7 = integrate_calib ( arg_1 , arg_2 , ** arg_3 ) arg_8 = arg_5 / arg_4 - 1 arg_9 = arg_7 / arg_6 - 1 return arg_8 , arg_9

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


Question: Add the absolute value of an expression to the model .

def Func ( arg_0 , arg_1 , arg_2 = "abs_var" , arg_3 = None , arg_4 = 0 , arg_5 = True ) : arg_6 = namedtuple ( 'Components' , [ 'variable' , 'upper_constraint' , 'lower_constraint' ] ) arg_7 = arg_0 . problem . Variable ( arg_2 , lb = 0 , arg_3 = arg_3 ) arg_8 = arg_0 . problem . Constraint ( arg_1 - arg_7 , arg_3 = arg_4 , arg_2 = "abs_pos_" + arg_2 ) , arg_9 = arg_0 . problem . Constraint ( arg_1 + arg_7 , lb = arg_4 , arg_2 = "abs_neg_" + arg_2 ) arg_10 = arg_6 ( arg_7 , arg_8 , arg_9 ) if arg_5 : add_cons_vars_to_problem ( arg_0 , arg_10 ) return arg_10

Return a list of all enrollments for the passed section_id.

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


Question: create a Validator instance from data_struct_dict

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = 'FromDictValidator' arg_2 = { } for arg_3 , arg_4 in six . iteritems ( arg_0 ) : arg_5 = arg_4 [ 'type' ] if arg_5 == DictField . FIELD_TYPE_NAME and isinstance ( arg_4 . get ( 'validator' ) , dict ) : arg_4 [ 'validator' ] = Func ( arg_4 [ 'validator' ] ) arg_2 [ arg_3 ] = create_field ( arg_4 ) arg_1 = force_str ( arg_1 ) return type ( arg_1 , ( Validator , ) , arg_2 )

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

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


Question: Deletes the specified Cloud Function .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) . projects ( ) . locations ( ) . functions ( ) . delete ( arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) arg_3 = arg_2 [ "name" ] arg_0 . _wait_for_operation_to_complete ( arg_3 = arg_3 )

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


Question: Read configuration from the env_var environment variable .

def Func ( arg_0 , arg_1 ) : arg_2 = os . environ . get ( arg_1 , '' ) if arg_2 : arg_0 . timid = ( '--timid' in arg_2 )

Register a file reader for use in parse_config_file.

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

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

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

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

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


Question: Add particles with diffusion coefficient D at random positions .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _plist += arg_0 . _generate ( arg_1 , arg_2 , box = arg_0 . box , rs = arg_0 . rs )

The Get Management Certificate operation retrieves information about
        the management certificate with the specified thumbprint. Management
        certificates, which are also known as subscription certificates,
        authenticate clients attempting to connect to resources associated
        with your Windows Azure subscription.

        thumbprint:
            The thumbprint value of the certificate.


Question: Insert node as a child of the current node before refNode in the list of child nodes . Raises ValueError if refNode is not a child of the current node

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . xml_children . index ( arg_2 ) arg_0 . xml_insert ( arg_1 , arg_3 )


Question: Returns an OGR Geometry for this envelope .

def Func ( arg_0 ) : arg_1 = ogr . Geometry ( ogr . wkbLinearRing ) for arg_2 in arg_0 . ll , arg_0 . lr , arg_0 . ur , arg_0 . ul , arg_0 . ll : arg_1 . AddPoint_2D ( * arg_2 ) arg_3 = ogr . Geometry ( ogr . wkbPolygon ) arg_3 . AddGeometryDirectly ( arg_1 ) return arg_3


Question: write triples into a translation file .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = triple_pb . Translation ( ) arg_4 = [ ] for arg_5 , arg_6 in arg_1 . items ( ) : arg_3 . entities . add ( element = arg_5 , arg_6 = arg_6 ) arg_7 = [ ] for arg_5 , arg_6 in arg_2 . items ( ) : arg_3 . relations . add ( element = arg_5 , arg_6 = arg_6 ) with open ( arg_0 , "wb" ) as f : f . write ( arg_3 . SerializeToString ( ) )


Question: Removes all breakpoints at a give filename and line number . Returns a list of breakpoints numbers deleted .

def Func ( arg_0 , arg_1 , arg_2 ) : if ( arg_1 , arg_2 ) not in arg_0 . bplist : return [ ] arg_3 = arg_0 . bplist [ ( arg_1 , arg_2 ) ] arg_4 = [ arg_5 . number for arg_5 in arg_3 ] for arg_5 in list ( arg_3 ) : arg_0 . delete_breakpoint ( arg_5 ) return arg_4

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

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

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

    Returns:
        DataFrame: result


Question: Unite data into a DataFrame .

def Func ( arg_0 ) : if not isinstance ( arg_0 , pd . DataFrame ) : if isinstance ( arg_0 , list ) : arg_0 = pd . DataFrame ( arg_0 ) elif isinstance ( arg_0 , ( np . generic , np . ndarray ) ) : arg_0 = pd . DataFrame ( arg_0 ) elif isinstance ( arg_0 , csr_matrix ) : arg_0 = pd . DataFrame ( arg_0 . todense ( ) ) elif isinstance ( arg_0 , pd . Series ) : arg_0 = pd . DataFrame ( arg_0 ) else : raise ValueError ( 'Unexpected input type: %s' % ( str ( type ( arg_0 ) ) ) ) arg_0 = arg_0 . apply ( lambda x : pd . to_numeric ( x , errors = 'ignore' ) ) return arg_0


Question: Read the data encoding the CreateKeyPair request payload and decode it into its constituent parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( CreateKeyPairRequestPayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : if arg_0 . is_tag_next ( arg_3 . Tags . COMMON_TEMPLATE_ATTRIBUTE , arg_6 ) : arg_0 . _common_template_attribute = objects . TemplateAttribute ( tag = arg_3 . Tags . COMMON_TEMPLATE_ATTRIBUTE ) arg_0 . _common_template_attribute . Func ( arg_6 , arg_2 = arg_2 ) else : if arg_0 . is_tag_next ( arg_3 . Tags . COMMON_ATTRIBUTES , arg_6 ) : arg_8 = objects . Attributes ( tag = arg_3 . Tags . COMMON_ATTRIBUTES ) arg_8 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _common_template_attribute = objects . convert_attributes_to_template_attribute ( arg_8 ) if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : if arg_0 . is_tag_next ( arg_3 . Tags . PRIVATE_KEY_TEMPLATE_ATTRIBUTE , arg_6 ) : arg_0 . _private_key_template_attribute = objects . TemplateAttribute ( tag = arg_3 . Tags . PRIVATE_KEY_TEMPLATE_ATTRIBUTE ) arg_0 . _private_key_template_attribute . Func ( arg_6 , arg_2 = arg_2 ) else : if arg_0 . is_tag_next ( arg_3 . Tags . PRIVATE_KEY_ATTRIBUTES , arg_6 ) : arg_8 = objects . Attributes ( tag = arg_3 . Tags . PRIVATE_KEY_ATTRIBUTES ) arg_8 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _private_key_template_attribute = objects . convert_attributes_to_template_attribute ( arg_8 ) if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : if arg_0 . is_tag_next ( arg_3 . Tags . PUBLIC_KEY_TEMPLATE_ATTRIBUTE , arg_6 ) : arg_0 . _public_key_template_attribute = objects . TemplateAttribute ( tag = arg_3 . Tags . PUBLIC_KEY_TEMPLATE_ATTRIBUTE ) arg_0 . _public_key_template_attribute . Func ( arg_6 , arg_2 = arg_2 ) else : if arg_0 . is_tag_next ( arg_3 . Tags . PUBLIC_KEY_ATTRIBUTES , arg_6 ) : arg_8 = objects . Attributes ( tag = arg_3 . Tags . PUBLIC_KEY_ATTRIBUTES ) arg_8 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _public_key_template_attribute = objects . convert_attributes_to_template_attribute ( arg_8 ) arg_0 . is_oversized ( arg_6 )

Given the request and response headers, return `True` if an HTTP
        "Not Modified" response could be returned instead.


Question: Adds a model chooser definition to the registry .

def Func ( arg_0 , arg_1 , ** arg_2 ) : if not issubclass ( arg_1 , Chooser ) : return arg_0 . register_simple_chooser ( arg_1 , ** arg_2 ) arg_0 . choosers [ arg_1 . model ] = arg_1 ( ** arg_2 ) return arg_1

Prints the traceback and invokes the ipython debugger on any exception

    Only invokes ipydb if you are outside ipython or python interactive session.
    So scripts must be called from OS shell in order for exceptions to ipy-shell-out.

    Dependencies:
      Needs `pip install ipdb`

    Arguments:
      exc_type (type): The exception type/class (e.g. RuntimeError)
      exc_value (Exception): The exception instance (e.g. the error message passed to the Exception constructor)
      exc_trace (Traceback): The traceback instance

    References:
      http://stackoverflow.com/a/242531/623735

    Example Usage:
      $  python -c 'from pug import debug;x=[];x[0]'
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
      IndexError: list index out of range

      > <string>(1)<module>()

      ipdb> x
      []
      ipdb> locals()
      {'__builtins__': <module '__builtin__' (built-in)>, '__package__': None, 'x': [], 'debug': <module 'pug.debug' from 'pug/debug.py'>, '__name__': '__main__', '__doc__': None}
      ipdb>


Question: Writes the specified string to the output target of the report .

def Func ( arg_0 , arg_1 , arg_2 = True ) : click . echo ( text_type ( arg_1 ) , nl = arg_2 , file = arg_0 . Func_file )

Get events from this conversation.

        Makes a request to load historical events if necessary.

        Args:
            event_id (str): (optional) If provided, return events preceding
                this event, otherwise return the newest events.
            max_events (int): Maximum number of events to return. Defaults to
                50.

        Returns:
            List of :class:`.ConversationEvent` instances, ordered
            newest-first.

        Raises:
            KeyError: If ``event_id`` does not correspond to a known event.
            .NetworkError: If the events could not be requested.


Question: Add a spout to the topology

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None ) : arg_6 = arg_2 . spec ( arg_1 = arg_1 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 ) arg_0 . add_spec ( arg_6 ) return arg_6

Based on the config and the dataset, get the file name to store the
    results.


Question: Run a query for entities .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) arg_3 = ( arg_2 . projects ( ) . runQuery ( projectId = arg_0 . project_id , arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_3 [ 'batch' ]


Question: Runs the review process for all the launchers .

def Func ( arg_0 , arg_1 ) : if arg_0 . launch_args is not None : arg_2 = arg_0 . review_args ( arg_0 . launch_args , show_repr = True , heading = 'Meta Arguments' ) if not arg_2 : return False arg_3 = [ arg_0 . review_args , arg_0 . review_command , arg_0 . review_launcher ] for ( arg_4 , arg_5 ) in enumerate ( arg_1 ) : if not all ( arg_6 ( arg_5 ) for arg_6 in arg_3 ) : print ( "\n == Aborting launch ==" ) return False if len ( arg_1 ) != 1 and arg_4 < len ( arg_1 ) - 1 : arg_7 = arg_0 . input_options ( [ 'Y' , 'n' , 'quit' ] , '\nSkip remaining reviews?' , default = 'y' ) if arg_7 == 'y' : break elif arg_7 == 'quit' : return False if arg_0 . input_options ( [ 'y' , 'N' ] , 'Execute?' , default = 'n' ) != 'y' : return False else : return arg_0 . _launch_all ( arg_1 )


Question: Optimization of a state along a specific set of directions in parameter space .

def Func ( arg_0 , arg_1 , arg_2 = 2 , arg_3 = 2 , arg_4 = 1e-3 , arg_5 = False , arg_6 = True , ** arg_7 ) : arg_8 = np . array ( [ d / np . sqrt ( np . dot ( d , d ) ) for d in arg_1 ] ) if np . isnan ( arg_8 ) . any ( ) : raise ValueError ( '`directions` must not be 0s or contain nan' ) arg_9 = OptState ( arg_0 , arg_8 ) arg_10 = LMOptObj ( arg_9 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_6 = arg_6 , ** arg_7 ) arg_10 . do_run_1 ( ) if arg_5 : return arg_10 . get_termination_stats ( )

Returns protobuf mapcontainer. Read from translation file.


Question: call all sites in a locus array .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = np . zeros ( arg_0 . shape [ 1 ] , dtype = np . uint8 ) arg_5 . fill ( 78 ) arg_6 = arg_0 . view ( np . uint8 ) for arg_7 in xrange ( arg_6 . shape [ 1 ] ) : arg_8 = arg_6 [ : , arg_7 ] arg_9 = arg_8 == 45 arg_9 += arg_8 == 78 arg_10 = arg_8 [ ~ arg_9 ] if not arg_10 . shape [ 0 ] : arg_5 [ arg_7 ] = 78 elif np . all ( arg_10 == arg_10 [ 0 ] ) : arg_5 [ arg_7 ] = arg_10 [ 0 ] else : arg_11 = np . bincount ( arg_10 ) arg_12 = np . argmax ( arg_11 ) arg_13 = arg_11 [ arg_12 ] arg_11 [ arg_12 ] = 0 arg_14 = np . argmax ( arg_11 ) arg_15 = arg_11 [ arg_14 ] arg_11 [ arg_14 ] = 0 arg_16 = np . argmax ( arg_11 ) arg_17 = arg_11 [ arg_16 ] arg_18 = arg_13 + arg_15 if arg_18 < arg_1 : arg_5 [ arg_7 ] = 78 else : if arg_18 > 500 : arg_19 = int ( 500 * ( arg_13 / float ( arg_18 ) ) ) arg_20 = int ( 500 * ( arg_15 / float ( arg_18 ) ) ) else : arg_19 = arg_13 arg_20 = arg_15 if arg_18 >= arg_2 : arg_21 , arg_22 = get_binom ( arg_19 , arg_20 , arg_4 , arg_3 ) if arg_22 < 0.95 : arg_5 [ arg_7 ] = 78 else : if arg_21 : arg_5 [ arg_7 ] = TRANS [ ( arg_12 , arg_14 ) ] else : arg_5 [ arg_7 ] = arg_12 else : if arg_13 == arg_15 : arg_5 [ arg_7 ] = TRANS [ ( arg_12 , arg_14 ) ] else : arg_5 [ arg_7 ] = arg_12 return arg_5 . view ( "S1" )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: formats and sends a chunk of data to the device according to transfer protocol

def Func ( arg_0 , arg_1 ) : log . debug ( 'writing %d bytes chunk' , len ( arg_1 ) ) arg_2 = BLOCK_START + chr ( len ( arg_1 ) ) + arg_1 if len ( arg_1 ) < 128 : arg_3 = 128 - len ( arg_1 ) log . debug ( 'pad with %d characters' , arg_3 ) arg_2 = arg_2 + ( ' ' * arg_3 ) log . debug ( "packet size %d" , len ( arg_2 ) ) arg_0 . __write ( arg_2 ) arg_0 . _port . flush ( ) return arg_0 . __got_ack ( )


Question: Signs an authentication challenge

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : if isinstance ( arg_1 , string_types ) : arg_1 = json . loads ( arg_1 ) if arg_1 [ 'version' ] != VERSION : raise ValueError ( 'Unsupported U2F version: %s' % arg_1 [ 'version' ] ) arg_4 = arg_1 . get ( 'appId' , arg_2 ) verify_facet ( arg_4 , arg_2 ) arg_5 = sha256 ( arg_4 . encode ( 'utf8' ) ) . digest ( ) arg_6 = websafe_decode ( arg_1 [ 'keyHandle' ] ) arg_7 = { 'typ' : 'navigator.id.getAssertion' , 'challenge' : arg_1 [ 'challenge' ] , 'origin' : arg_2 } arg_7 = json . dumps ( arg_7 ) arg_8 = sha256 ( arg_7 . encode ( 'utf8' ) ) . digest ( ) arg_9 = arg_8 + arg_5 + int2byte ( len ( arg_6 ) ) + arg_6 arg_10 = 0x07 if arg_3 else 0x03 arg_11 = 0 arg_12 = arg_0 . send_apdu ( INS_SIGN , arg_10 , arg_11 , arg_9 ) return { 'clientData' : websafe_encode ( arg_7 ) , 'signatureData' : websafe_encode ( arg_12 ) , 'keyHandle' : arg_1 [ 'keyHandle' ] }


Question: Remove all keys with Nones as values

def Func ( arg_0 ) : if sys . version_info [ 0 ] < 3 : return { arg_1 : arg_2 for arg_1 , arg_2 in arg_0 . iteritems ( ) if arg_2 is not None } else : return { arg_1 : arg_2 for arg_1 , arg_2 in arg_0 . items ( ) if arg_2 is not None }


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

def Func ( arg_0 ) : arg_1 = arg_0 ( ) arg_2 = { 'encode' : arg_1 . encode , 'decode' : arg_1 . decode , } if PY3 : arg_2 [ '_is_text_encoding' ] = False return CodecInfo ( ** arg_2 )

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.