Question: Given a string with source return the lib2to3 Node .

def Func ( arg_0 ) : arg_1 = pygram . python_grammar_no_print_statement arg_2 = driver . Driver ( arg_1 , pytree . convert ) if arg_0 [ - 1 ] != '\n' : arg_3 = '\r\n' if '\r\n' in arg_0 [ : 1024 ] else '\n' arg_0 += arg_3 try : arg_4 = arg_2 . parse_string ( arg_0 , True ) except ParseError as pe : arg_5 , arg_6 = pe . context [ 1 ] arg_7 = arg_0 . splitlines ( ) try : arg_8 = arg_7 [ arg_5 - 1 ] except IndexError : arg_8 = "<line number missing in source>" raise ValueError ( f"Cannot parse: {lineno}:{column}: {faulty_line}" ) from None if isinstance ( arg_4 , Leaf ) : arg_4 = Node ( syms . file_input , [ arg_4 ] ) return arg_4

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


Question: Give list of input tokenized words create dataframe of characters where first character of the word is tagged as 1 otherwise 0

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : for arg_3 , arg_4 in enumerate ( arg_2 ) : if arg_3 == 0 : arg_1 . append ( { 'char' : arg_4 , 'type' : CHAR_TYPE_FLATTEN . get ( arg_4 , 'o' ) , 'target' : True } ) else : arg_1 . append ( { 'char' : arg_4 , 'type' : CHAR_TYPE_FLATTEN . get ( arg_4 , 'o' ) , 'target' : False } ) return pd . DataFrame ( arg_1 )

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: Compare physical system memory to process resident memory and calculate process memory utilization as a percentage .

def Func ( arg_0 ) : arg_1 = arg_0 . _platform_impl . get_memory_info ( ) [ 0 ] try : return ( arg_1 / float ( TOTAL_PHYMEM ) ) * 100 except ZeroDivisionError : return 0.0

gridSpan is what docx uses to denote that a table cell has a colspan. This
    is much more simple than rowspans in that there is a one-to-one mapping
    from gridSpan to colspan.


Question: Bounded auto - correlation

def Func ( arg_0 , arg_1 = None , arg_2 = - 1 ) : if arg_1 is None : arg_1 = arg_0 . shape [ arg_2 ] arg_1 = int ( min ( arg_1 , arg_0 . shape [ arg_2 ] ) ) arg_3 = get_fftlib ( ) arg_4 = np . abs ( arg_3 . fft ( arg_0 , n = 2 * arg_0 . shape [ arg_2 ] + 1 , arg_2 = arg_2 ) ) ** 2 arg_5 = arg_3 . ifft ( arg_4 , arg_2 = arg_2 ) arg_6 = [ slice ( None ) ] * arg_5 . ndim arg_6 [ arg_2 ] = slice ( arg_1 ) arg_5 = arg_5 [ tuple ( arg_6 ) ] if not np . iscomplexobj ( arg_0 ) : arg_5 = arg_5 . real return arg_5

Discover versatileimagefield.py modules.

    Iterate over django.apps.get_app_configs() and discover
    versatileimagefield.py modules.


Question: Get the modified time for a file as a datetime instance

def Func ( arg_0 ) : arg_1 = os . stat ( arg_0 ) . st_mtime return datetime . datetime . utcfromtimestamp ( arg_1 )


Question: Return a random Boggle board of size n x n . We represent a board as a linear list of letters .

def Func ( arg_0 = 4 ) : arg_1 = [ cubes16 [ i % 16 ] for i in range ( arg_0 * arg_0 ) ] random . shuffle ( arg_1 ) return map ( random . choice , arg_1 )

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


Question: Returns map with entity or relations from plain text .

def Func ( arg_0 , arg_1 = '\t' , arg_2 = True ) : arg_3 = { } with open ( arg_0 , "r" ) as f : arg_4 = next ( f ) for arg_5 in f : arg_6 = arg_5 . rstrip ( ) . split ( arg_1 ) if not arg_2 : arg_6 = list ( reversed ( arg_6 ) ) arg_3 [ arg_6 [ 0 ] ] = arg_6 [ 1 ] return arg_3

Sum of covariance function derivatives.

        Returns
        -------
        dict
            ∂K₀ + ∂K₁ + ⋯


Question: Iterates over a generator looking for things that match .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , ** arg_6 ) : if isinstance ( arg_1 , SoupStrainer ) : arg_7 = arg_1 else : arg_7 = SoupStrainer ( arg_1 , arg_2 , arg_3 , ** arg_6 ) arg_8 = ResultSet ( arg_7 ) arg_9 = arg_5 ( ) while True : try : arg_10 = arg_9 . next ( ) except StopIteration : break if arg_10 : arg_11 = arg_7 . search ( arg_10 ) if arg_11 : arg_8 . append ( arg_11 ) if arg_4 and len ( arg_8 ) >= arg_4 : break return arg_8

Return a rasterio.io.MemoryFile instance from input.

    Parameters
    ----------
    data : array
        array to be written
    profile : dict
        rasterio profile for MemoryFile


Question: Clip values above and below .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . _rdd . mapValues ( lambda v : v . Func ( arg_1 = arg_1 , arg_2 = arg_2 ) ) return arg_0 . _constructor ( arg_3 ) . __finalize__ ( arg_0 )

deleteOne - Delete one object

			@param obj - object to delete
			@param conn - Connection to reuse, or None

			@return - number of items deleted (0 or 1)


Question: Generate the warmup points for the sampler .

def Func ( arg_0 ) : arg_0 . n_warmup = 0 arg_2 = arg_0 . model . reactions arg_0 . warmup = np . zeros ( ( 2 * len ( arg_2 ) , len ( arg_0 . model . variables ) ) ) arg_0 . model . objective = Zero for arg_6 in ( "min" , "max" ) : arg_0 . model . objective_direction = arg_6 for arg_8 , arg_9 in enumerate ( arg_2 ) : arg_10 = ( arg_0 . model . variables [ arg_0 . fwd_idx [ arg_8 ] ] , arg_0 . model . variables [ arg_0 . rev_idx [ arg_8 ] ] ) if arg_9 . upper_bound - arg_9 . lower_bound < arg_0 . bounds_tol : LOGGER . info ( "skipping fixed reaction %s" % arg_9 . id ) continue arg_0 . model . objective . set_linear_coefficients ( { arg_10 [ 0 ] : 1 , arg_10 [ 1 ] : - 1 } ) arg_0 . model . slim_optimize ( ) if not arg_0 . model . solver . status == OPTIMAL : LOGGER . info ( "can not maximize reaction %s, skipping it" % arg_9 . id ) continue arg_11 = arg_0 . model . solver . primal_values arg_12 = [ arg_11 [ v . name ] for v in arg_0 . model . variables ] arg_0 . warmup [ arg_0 . n_warmup , ] = arg_12 arg_0 . n_warmup += 1 arg_0 . model . objective . set_linear_coefficients ( { arg_10 [ 0 ] : 0 , arg_10 [ 1 ] : 0 } ) arg_0 . warmup = arg_0 . warmup [ 0 : arg_0 . n_warmup , : ] arg_13 = np . logical_not ( arg_0 . _is_redundant ( arg_0 . warmup ) ) arg_0 . warmup = arg_0 . warmup [ arg_13 , : ] arg_0 . n_warmup = arg_0 . warmup . shape [ 0 ] if len ( arg_0 . warmup . shape ) == 1 or arg_0 . warmup . shape [ 0 ] == 1 : raise ValueError ( "Your flux cone consists only of a single point!" ) elif arg_0 . n_warmup == 2 : if not arg_0 . problem . homogeneous : raise ValueError ( "Can not sample from an inhomogenous problem" " with only 2 search directions :(" ) LOGGER . info ( "All search directions on a line, adding another one." ) arg_14 = arg_0 . warmup . T . dot ( [ 0.25 , 0.25 ] ) arg_0 . warmup = np . vstack ( [ arg_0 . warmup , arg_14 ] ) arg_0 . n_warmup += 1 arg_0 . warmup = shared_np_array ( ( arg_0 . n_warmup , len ( arg_0 . model . variables ) ) , arg_0 . warmup )

Build a filter that keeps edges whose data dictionaries are super-dictionaries to the given dictionary.

    :param annotations: The annotation query dict to match
    :param partial_match: Should the query values be used as partial or exact matches? Defaults to :code:`True`.


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

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . database_renderer ( arg_1 = arg_1 , arg_2 = arg_2 ) arg_3 . run ( 'pg_dump -c --host={host_string} --username={db_user} ' '--blobs --format=c {db_name} -n public | ' 'pg_restore -U {db_postgresql_postgres_user} --create ' '--dbname={db_name}' )

Remove a batch webhook. Webhooks will no longer be sent to the given
        URL.

        :param batch_webhook_id: The unique id for the batch webhook.
        :type batch_webhook_id: :py:class:`str`


Question: Randomly or centrally crop multiple images .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = 0 , arg_5 = 1 ) : arg_6 , arg_7 = arg_0 [ 0 ] . shape [ arg_4 ] , arg_0 [ 0 ] . shape [ arg_5 ] if ( arg_6 < arg_2 ) or ( arg_7 < arg_1 ) : raise AssertionError ( "The size of cropping should smaller than or equal to the original image" ) if arg_3 : arg_8 = int ( np . random . uniform ( 0 , arg_6 - arg_2 ) ) arg_9 = int ( np . random . uniform ( 0 , arg_7 - arg_1 ) ) arg_10 = [ ] for arg_11 in arg_0 : arg_10 . append ( arg_11 [ arg_8 : arg_2 + arg_8 , arg_9 : arg_1 + arg_9 ] ) return np . asarray ( arg_10 ) else : arg_8 = ( arg_6 - arg_2 ) / 2 arg_9 = ( arg_7 - arg_1 ) / 2 arg_10 = [ ] for arg_11 in arg_0 : arg_10 . append ( arg_11 [ arg_8 : arg_6 - arg_8 , arg_9 : arg_7 - arg_9 ] ) return np . asarray ( arg_10 )

This method is called before first step of simulation.


Question: Get the current frontmost application .

def Func ( arg_0 ) : arg_1 = arg_0 . _getRunningApps ( ) for arg_2 in arg_1 : arg_3 = arg_2 . processIdentifier ( ) arg_4 = arg_0 . getAppRefByPid ( arg_3 ) try : if arg_4 . AXFrontmost : return arg_4 except ( _a11y . ErrorUnsupported , _a11y . ErrorCannotComplete , _a11y . ErrorAPIDisabled , _a11y . ErrorNotImplemented ) : pass raise ValueError ( 'No GUI application found.' )

Extracts the update time from a ReMo item.

        The timestamp is extracted from 'end' field.
        This date is converted to a perceval format using a float value.

        :param item: item generated by the backend

        :returns: a UNIX timestamp


Question: Export all transcripts to . bed like format

def Func ( arg_0 , arg_1 ) : LOG . info ( "Running scout export Func" ) arg_2 = arg_0 . obj [ 'adapter' ] arg_3 = [ "#Chrom\tStart\tEnd\tTranscript\tRefSeq\tHgncID" ] for arg_4 in arg_3 : click . echo ( arg_4 ) arg_5 = ( "{0}\t{1}\t{2}\t{3}\t{4}\t{5}" ) for arg_6 in export_Func ( arg_2 ) : click . echo ( arg_5 . format ( arg_6 [ 'chrom' ] , arg_6 [ 'start' ] , arg_6 [ 'end' ] , arg_6 [ 'ensembl_transcript_id' ] , arg_6 . get ( 'refseq_id' , '' ) , arg_6 [ 'hgnc_id' ] , ) )

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


Question: Update the dynamic gene list for a case

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = '37' ) : arg_6 = [ ] arg_7 = [ ] if arg_3 : LOG . info ( "Fetching genes by hgnc id" ) arg_7 = arg_0 . hgnc_collection . find ( { 'hgnc_id' : { '$in' : arg_3 } , 'build' : arg_5 } ) elif arg_2 : LOG . info ( "Fetching genes by hgnc symbols" ) arg_7 = [ ] for arg_8 in arg_2 : for arg_9 in arg_0 . gene_by_alias ( arg_8 = arg_8 , arg_5 = arg_5 ) : arg_7 . append ( arg_9 ) for arg_9 in arg_7 : arg_6 . append ( { 'hgnc_symbol' : arg_9 [ 'hgnc_symbol' ] , 'hgnc_id' : arg_9 [ 'hgnc_id' ] , 'description' : arg_9 [ 'description' ] , } ) LOG . info ( "Update dynamic gene panel for: %s" , arg_1 [ 'display_name' ] ) arg_10 = arg_0 . case_collection . find_one_and_update ( { '_id' : arg_1 [ '_id' ] } , { '$set' : { 'dynamic_gene_list' : arg_6 , 'dynamic_panel_phenotypes' : arg_4 or [ ] } } , return_document = pymongo . ReturnDocument . AFTER ) LOG . debug ( "Case updated" ) return arg_10

Increase the processed task counter and show progress message


Question: Returns whether the input matches the given determinant limit .

def Func ( arg_0 , arg_1 ) : return tf . cast ( tf . linalg . det ( arg_0 ) > arg_1 , dtype = arg_0 . dtype )

Add a specific enqueue time to the message.

        :param schedule_time: The scheduled time to enqueue the message.
        :type schedule_time: ~datetime.datetime


Question: If the form or formsets are invalid re - render the context data with the data - filled form and formsets and errors .

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . render_to_response ( arg_0 . get_context_data ( arg_1 = arg_1 , arg_2 = arg_2 ) )

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

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

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


Question: Main function to start change log generation

def Func ( arg_0 ) : arg_0 . fetch_and_filter_tags ( ) arg_1 = arg_0 . sort_tags_by_date ( arg_0 . filtered_tags ) arg_0 . filtered_tags = arg_1 arg_0 . fetch_and_filter_issues_and_pr ( ) arg_3 = str ( arg_0 . options . frontmatter ) if arg_0 . options . frontmatter else u"" arg_3 += u"{0}\n\n" . format ( arg_0 . options . header ) if arg_0 . options . unreleased_only : arg_3 += arg_0 . generate_unreleased_section ( ) else : arg_3 += arg_0 . generate_log_for_all_tags ( ) try : with open ( arg_0 . options . base ) as fh : arg_3 += fh . read ( ) except ( TypeError , IOError ) : pass return arg_3

Say the workers to finish their jobs and quit.


Question: Retrieves callbacks from a subscriber

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 . meta . call_args . subscribers : arg_4 = 'on_' + arg_1 if hasattr ( arg_3 , arg_4 ) : arg_2 . append ( functools . partial ( getattr ( arg_3 , arg_4 ) , future = arg_0 ) ) return arg_2

Return an open file-object to the index file


Question: set new mapped - items structure into cache

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : cache . set ( arg_0 . get_cache_item_name ( arg_1 , arg_2 ) , arg_3 )

If you want to use functionalities related to Controls and Patterns in a new thread.
    You must call InitializeUIAutomationInCurrentThread first in the thread
        and call UninitializeUIAutomationInCurrentThread when the thread exits.
    But you can't use use a Control or a Pattern created in a different thread.
    So you can't create a Control or a Pattern in main thread and then pass it to a new thread and use it.


Question: Yields one boolean whether the first string starts with the second

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 = next ( string_arg ( arg_0 , arg_1 ) , '' ) arg_2 = next ( string_arg ( arg_0 , arg_2 ) , '' ) yield arg_1 . startswith ( arg_2 )

ensures all workers and management thread are running


Question: Load a skeleton definition from a text file .

def Func ( arg_0 , arg_1 , ** arg_2 ) : logging . info ( '%s: parsing skeleton configuration' , arg_1 ) if hasattr ( arg_1 , 'read' ) : arg_3 = parser . parse ( arg_1 , arg_0 . world , arg_0 . jointgroup , ** arg_2 ) else : with open ( arg_1 ) as handle : arg_3 = parser . parse ( handle , arg_0 . world , arg_0 . jointgroup , ** arg_2 ) arg_0 . bodies = arg_3 . bodies arg_0 . joints = arg_3 . joints arg_0 . set_pid_params ( kp = 0.999 / arg_0 . world . dt )

Adjust the timestamp on which the certificate starts being valid.

        :param amount: The number of seconds by which to adjust the timestamp.
        :return: ``None``


Question: Return the specified grid .

def Func ( arg_0 ) : assert_is_type ( arg_0 , str ) arg_1 = api ( "GET /99/Grids/%s" % arg_0 ) arg_2 = [ get_model ( key [ "name" ] ) for key in arg_1 [ "model_ids" ] ] arg_3 = api ( "GET /3/Models/%s" % arg_1 [ "model_ids" ] [ 0 ] [ "name" ] ) [ "models" ] [ 0 ] arg_4 = H2OGridSearch ( None , { } , arg_0 ) arg_4 . _resolve_grid ( arg_0 , arg_1 , arg_3 ) arg_4 . models = arg_2 arg_5 = { arg_6 : set ( ) for arg_6 in arg_4 . hyper_names } for arg_6 in arg_4 . hyper_names : for arg_7 in arg_2 : if isinstance ( arg_7 . full_parameters [ arg_6 ] [ "actual_value" ] , list ) : arg_5 [ arg_6 ] . add ( arg_7 . full_parameters [ arg_6 ] [ "actual_value" ] [ 0 ] ) else : arg_5 [ arg_6 ] . add ( arg_7 . full_parameters [ arg_6 ] [ "actual_value" ] ) arg_5 = { str ( arg_6 ) : list ( vals ) for arg_6 , vals in arg_5 . items ( ) } arg_4 . hyper_params = arg_5 arg_4 . model = arg_7 . __class__ ( ) return arg_4

Overriding the default JSONEncoder.default for NDB support.


Question: todo is it really useful ?

def Func ( arg_0 ) : arg_1 = len ( arg_0 ) return np . concatenate ( ( arg_0 [ arg_1 // 2 + 1 : ] , arg_0 [ 0 : arg_1 // 2 ] ) )

Get datetime of the next retry if the task instance fails. For exponential
        backoff, retry_delay is used as base and will be converted to seconds.


Question: Triggers when entering the given testsuite

def Func ( arg_0 , arg_1 ) : if arg_0 [ "conf" ] [ "VERBOSE" ] : cij . emph ( "rnr:tsuite:enter { name: %r }" % arg_1 [ "name" ] ) arg_2 = 0 for arg_3 in arg_1 [ "hooks" ] [ "enter" ] : arg_2 = script_run ( arg_0 , arg_3 ) if arg_2 : break if arg_0 [ "conf" ] [ "VERBOSE" ] : cij . emph ( "rnr:tsuite:enter { rcode: %r } " % arg_2 , arg_2 ) return arg_2

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


Question: Check whether the submission did not generate a runtime error .

def Func ( arg_0 , arg_1 = "Have a look at the console: your code contains an error. Fix it and try again!" , ) : arg_0 . assert_root ( "Func" ) if arg_0 . reporter . errors : arg_2 = arg_0 . build_message ( arg_1 , { "error" : str ( arg_0 . reporter . errors [ 0 ] ) } ) arg_0 . report ( Feedback ( arg_2 , arg_0 ) ) return arg_0


Question: Initialize internal state of the random number generator .

def Func ( arg_0 , arg_1 = None ) : super ( Random , arg_0 ) . Func ( arg_1 ) arg_0 . gauss_next = None

Get course's duration as a timedelta.

        Arguments:
            obj (CourseOverview): CourseOverview object

        Returns:
            (timedelta): Duration of a course.


Question: Finds the positions of all gaps in the sequence that are at least min_length long . Returns a list of Intervals . Coords are zero - based

def Func ( arg_0 , arg_1 = 1 ) : Func = [ ] arg_3 = re . compile ( 'N+' , re . IGNORECASE ) for arg_4 in arg_3 . finditer ( arg_0 . seq ) : if arg_4 . span ( ) [ 1 ] - arg_4 . span ( ) [ 0 ] + 1 >= arg_1 : Func . append ( intervals . Interval ( arg_4 . span ( ) [ 0 ] , arg_4 . span ( ) [ 1 ] - 1 ) ) return Func

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: For lens data compute the unmasked blurred image of every unmasked unblurred image of each plane . To do this \ this function iterates over all planes to extract their unmasked unblurred images .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 : if arg_4 . has_pixelization : arg_5 = None else : arg_5 = arg_1 . unmasked_blurred_image_from_psf_and_unmasked_image ( arg_2 = arg_2 , unmasked_image_1d = arg_4 . image_plane_image_1d ) arg_3 . append ( arg_5 ) return arg_3

Save the model in the given directory.

    :param saveModelDir: (string)
         Absolute directory path for saving the model. This directory should
         only be used to store a saved model. If the directory does not exist,
         it will be created automatically and populated with model data. A
         pre-existing directory will only be accepted if it contains previously
         saved model data. If such a directory is given, the full contents of
         the directory will be deleted and replaced with current model data.


Question: Harris - motivated feature detection on a d - dimensional image .

def Func ( arg_0 , arg_1 = 5 , arg_2 = 'harris' , arg_3 = 0.05 ) : arg_4 = arg_0 . ndim arg_5 = [ nd . sobel ( arg_0 , axis = i ) for i in range ( arg_4 ) ] arg_6 = np . zeros ( ( arg_4 , arg_4 ) + arg_0 . shape ) for arg_7 in range ( arg_4 ) : for arg_8 in range ( arg_4 ) : arg_6 [ arg_7 , arg_8 ] = nd . filters . gaussian_filter ( arg_5 [ arg_7 ] * arg_5 [ arg_8 ] , arg_1 ) if arg_2 == 'matrix' : return arg_6 arg_9 = np . trace ( arg_6 , axis1 = 0 , axis2 = 1 ) arg_10 = np . linalg . det ( arg_6 . T ) . T if arg_2 == 'trace-determinant' : return arg_9 , arg_10 else : arg_11 = arg_10 - arg_3 * arg_9 * arg_9 return arg_11


Question: Update the API Root s information and list of Collections

def Func ( arg_0 , arg_1 = arg_2 ) : arg_0 . Func_information ( arg_1 ) arg_0 . Func_collections ( arg_1 )

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

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


Question: Calculate the portion of enthalpy of the compound phase covered by this Cp record .

def Func ( arg_0 , arg_1 ) : arg_2 = 0.0 if arg_1 < arg_0 . Tmax : arg_3 = arg_1 else : arg_3 = arg_0 . Tmax arg_4 = arg_0 . Tmin for arg_5 , arg_6 in zip ( arg_0 . _coefficients , arg_0 . _exponents ) : if arg_6 == - 1.0 : arg_2 += arg_5 * math . log ( arg_3 / arg_4 ) else : arg_2 += arg_5 * ( arg_3 ** ( arg_6 + 1.0 ) - arg_4 ** ( arg_6 + 1.0 ) ) / ( arg_6 + 1.0 ) return arg_2

Logs into the specified ftp server and returns connector.


Question: Load and validate the header of a pcap file .

def Func ( arg_0 ) : try : arg_1 = arg_0 . read ( 24 ) except UnicodeDecodeError : print ( "\nMake sure the input file is opened in read binary, 'rb'\n" ) raise InvalidEncoding ( "Could not read file; it might not be opened in binary mode." ) if arg_1 [ : 4 ] in [ struct . pack ( ">I" , _MAGIC_NUMBER ) , struct . pack ( ">I" , _MAGIC_NUMBER_NS ) ] : arg_2 = b'big' arg_3 = struct . unpack ( '>IhhIIII' , arg_1 ) elif arg_1 [ : 4 ] in [ struct . pack ( "<I" , _MAGIC_NUMBER ) , struct . pack ( "<I" , _MAGIC_NUMBER_NS ) ] : arg_2 = b'little' arg_3 = struct . unpack ( '<IhhIIII' , arg_1 ) else : raise UnknownMagicNumber ( "No supported Magic Number found" ) ( arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 ) = arg_3 arg_11 = __pcap_header__ ( arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 , ctypes . c_char_p ( arg_2 ) , arg_4 == _MAGIC_NUMBER_NS ) if not __validate_header__ ( arg_11 ) : raise InvalidHeader ( "Invalid Header" ) else : return arg_11

Create required links from a sensor region to a classifier region.


Question: Find a slider attacker

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 , arg_7 , arg_8 = arg_5 arg_9 = reach [ arg_6 ( arg_4 ) ] [ arg_7 ( arg_3 , arg_4 ) ] arg_10 = arg_9 & arg_7 ( arg_2 , arg_4 ) while arg_10 : arg_9 = arg_10 & - arg_10 arg_11 = arg_9 . bit_length ( ) - 1 if not ( ray [ arg_11 ] [ arg_6 ( arg_4 ) ] & arg_7 ( arg_1 , arg_4 ) ) : arg_0 . append ( arg_8 ( arg_11 , arg_4 ) ) arg_10 ^= arg_9

Creates a SecBufferDesc struct and contained SecBuffer structs

        :param number:
            The number of contains SecBuffer objects to create

        :return:
            A tuple of (SecBufferDesc pointer, SecBuffer array)


Question: Convert transposed convolution layer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : print ( 'Converting transposed convolution ...' ) if arg_6 == 'short' : arg_7 = 'C' + random_string ( 7 ) elif arg_6 == 'keep' : arg_7 = arg_1 else : arg_7 = arg_1 + str ( random . random ( ) ) arg_8 = '{0}.bias' . format ( arg_1 ) arg_9 = '{0}.weight' . format ( arg_1 ) if len ( arg_5 [ arg_9 ] . numpy ( ) . shape ) == 4 : arg_10 = arg_5 [ arg_9 ] . numpy ( ) . transpose ( 2 , 3 , 1 , 0 ) arg_11 , arg_12 , arg_13 , arg_14 = arg_10 . shape arg_15 = arg_0 [ 'group' ] if arg_15 > 1 : raise AssertionError ( 'Cannot convert conv1d with groups != 1' ) if arg_0 [ 'dilations' ] [ 0 ] > 1 : raise AssertionError ( 'Cannot convert conv1d with dilation_rate != 1' ) if arg_8 in arg_5 : arg_16 = arg_5 [ arg_8 ] . numpy ( ) arg_17 = True else : arg_16 = None arg_17 = False arg_18 = arg_3 [ 0 ] if arg_17 : arg_5 = [ arg_10 , arg_16 ] else : arg_5 = [ arg_10 ] arg_19 = keras . layers . Conv2DTranspose ( filters = arg_13 , kernel_size = ( arg_11 , arg_12 ) , strides = ( arg_0 [ 'strides' ] [ 0 ] , arg_0 [ 'strides' ] [ 1 ] ) , padding = 'valid' , output_padding = 0 , arg_5 = arg_5 , use_bias = arg_17 , activation = None , dilation_rate = arg_0 [ 'dilations' ] [ 0 ] , bias_initializer = 'zeros' , kernel_initializer = 'zeros' , name = arg_7 ) arg_4 [ arg_2 ] = arg_19 ( arg_4 [ arg_18 ] ) arg_4 [ arg_2 ] . set_shape ( arg_4 [ arg_2 ] . _keras_shape ) arg_20 = arg_0 [ 'pads' ] if arg_20 [ 0 ] > 0 : assert ( len ( arg_20 ) == 2 or ( arg_20 [ 2 ] == arg_20 [ 0 ] and arg_20 [ 3 ] == arg_20 [ 1 ] ) ) arg_21 = keras . layers . Cropping2D ( arg_20 [ : 2 ] , name = arg_7 + '_crop' ) arg_4 [ arg_2 ] = arg_21 ( arg_4 [ arg_2 ] ) else : raise AssertionError ( 'Layer is not supported for now' )

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

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

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


Question: This function deal with the nova notification .

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


Question: Make an absolute directory path in the bucker for dirname which is is assumed relative to the self . _bucket_root prefix directory .

def Func ( arg_0 , arg_1 ) : if arg_1 in ( '.' , '/' ) : arg_1 = '' arg_2 = os . path . join ( arg_0 . _bucket_root , arg_1 ) arg_2 = arg_2 . rstrip ( '/' ) return arg_2

Initiate connection to APRS server and attempt to login

        blocking = False     - Should we block until connected and logged-in
        retry = 30           - Retry interval in seconds


Question: The user is required to have an application secrets file in his or her environment . The client exists with error if the variable isn t found .

def Func ( arg_0 ) : arg_1 = 'SREGISTRY_GOOGLE_DRIVE_CREDENTIALS' arg_0 . _secrets = arg_0 . _get_and_update_setting ( arg_1 ) arg_0 . _base = arg_0 . _get_and_update_setting ( 'SREGISTRY_GOOGLE_DRIVE_ROOT' ) if arg_0 . _base is None : arg_0 . _base = 'sregistry' if arg_0 . _secrets is None : bot . error ( 'You must export %s to use Google Drive client' % arg_1 ) bot . info ( "https://singularityhub.github.io/sregistry-cli/client-google-drive" ) sys . exit ( 1 )


Question: Download and save price online

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 , arg_4 : arg_2 ) -> PriceModel : arg_5 = arg_0 . __Func ( arg_1 , arg_3 , arg_4 ) arg_0 . save ( ) return arg_5

An intelligent wrapper for ``open``.

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

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

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

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

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

        Otherwise, use the specified coding.

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


Question: Return the python codec name corresponding to an encoding or None if the string doesn t correspond to a valid encoding .

def Func ( arg_0 ) : if isinstance ( arg_0 , bytes ) : try : arg_0 = arg_0 . decode ( "ascii" ) except UnicodeDecodeError : return None if arg_0 : arg_1 = ascii_punctuation_re . sub ( "" , arg_0 ) . lower ( ) return encodings . get ( arg_1 , None ) else : return None

Bring the interrupt pin on the GPIO into Linux userspace.


Question: Cut a numeric vector into categorical buckets .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = True , arg_5 = 3 ) : assert_is_type ( arg_1 , [ numeric ] ) if arg_0 . ncols != 1 : raise H2OValueError ( "Single-column frame is expected" ) if arg_0 . types [ arg_0 . names [ 0 ] ] not in { "int" , "real" } : raise H2OValueError ( "A numeric column is expected" ) arg_6 = H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) , cache = arg_0 . _ex . _cache ) arg_6 . _ex . _cache . types = { k : "enum" for k in arg_0 . names } return arg_6

Enumerate all possible resonance forms and return them as a list.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: A list of all possible resonance forms of the molecule.
        :rtype: list of rdkit.Chem.rdchem.Mol


Question: convert a dictionary to a pretty formatted string .

def Func ( arg_0 , arg_1 = None , arg_2 = "=" , arg_3 = "\n" , arg_4 = True , arg_5 = None ) : arg_6 = "" if "record" in str ( type ( arg_0 ) ) : arg_7 = arg_0 . dtype . names else : arg_7 = arg_0 . keys ( ) if arg_4 : arg_7 = sorted ( arg_7 ) for arg_8 in arg_7 : if arg_8 [ 0 ] == "_" : continue if arg_1 : if not arg_8 in arg_1 : continue if arg_5 and arg_8 [ - len ( arg_5 ) ] == arg_5 : continue if 'float' in str ( type ( arg_0 [ arg_8 ] ) ) : arg_9 = "%.02f" % arg_0 [ arg_8 ] else : arg_9 = str ( arg_0 [ arg_8 ] ) if "object" in arg_9 : arg_9 = '<object>' arg_6 += arg_8 + arg_2 + arg_9 + arg_3 return arg_6 . strip ( )

Jumps short if not greater.

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


Question: Stop the heartbeating and cancel all related callbacks .

def Func ( arg_0 ) : if arg_0 . _beating : arg_0 . _beating = False arg_0 . _hb_periodic_callback . stop ( ) if not arg_0 . hb_stream . closed ( ) : arg_0 . hb_stream . on_recv ( None )

r'''Method to calculate pressure-dependent gas viscosity
        at temperature `T` and pressure `P` with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to calculate gas viscosity, [K]
        P : float
            Pressure at which to calculate gas viscosity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        mu : float
            Viscosity of the gas at T and P, [Pa*]


Question: Import a single file or collection of files .

def Func ( arg_0 , arg_1 = None ) : assert_is_type ( arg_0 , str , [ str ] ) assert_is_type ( arg_1 , str , None ) arg_2 = [ arg_0 ] if is_type ( arg_0 , str ) else arg_0 return _import_multi ( arg_2 , arg_1 )

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

    Parameters:
    ----------------------------------------------------------------
    jobID:      job ID of model to modify
    results:    new results (json dict string)


Question: Write FIR Fixed - Point Filter Header Files Mark Wickert February 2015

Try loading given config file.

        :param str file: full path to the config file to load


Question: a light excepthook adding a small message to the usual traceback

def Func ( arg_0 , arg_1 , arg_2 ) : traceback . print_exception ( arg_0 , arg_1 , arg_2 ) from IPython . core . interactiveshell import InteractiveShell if InteractiveShell . initialized ( ) : arg_3 = "%config " else : arg_3 = "c." print >> sys . stderr , _lite_message_template . format ( email = author_email , arg_3 = arg_3 )


Question: Get a document from an existing collection in the CosmosDB database .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_1 is None : raise AirflowBadRequest ( "Cannot get a document without an id" ) try : return arg_0 . get_conn ( ) . ReadItem ( Func_link ( arg_0 . __get_database_name ( arg_2 ) , arg_0 . __get_collection_name ( arg_3 ) , arg_1 ) ) except HTTPFailure : return None

Adjust contrast of an Image.

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

    Returns:
        PIL Image: Contrast adjusted image.


Question: Attempts to return a numpy array converted to the most sensible dtype Value errors will be caught and simply return the original array Tries to make dtype int then float then no change

def Func ( arg_0 ) : try : arg_1 = arg_0 . astype ( 'float' ) if ( arg_1 < sys . maxsize ) . all ( ) and ( arg_1 % 1 ) . sum ( ) == 0 : return arg_1 . astype ( 'int' ) else : return arg_1 except ValueError : return arg_0


Question: check that accessed members are defined

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( "AttributeError" , "Exception" , "BaseException" ) for arg_4 , arg_5 in arg_2 . items ( ) : try : arg_1 . local_attr ( arg_4 ) continue except astroid . NotFoundError : pass try : next ( arg_1 . instance_attr_ancestors ( arg_4 ) ) continue except StopIteration : pass try : arg_6 = arg_1 . instance_attr ( arg_4 ) except astroid . NotFoundError : pass else : arg_6 = [ stmt for stmt in arg_6 if stmt not in arg_5 ] if not arg_6 : continue arg_7 = arg_6 [ 0 ] . scope ( ) arg_6 = [ stmt for i , stmt in enumerate ( arg_6 ) if i == 0 or stmt . scope ( ) is not arg_7 ] if len ( arg_6 ) == 1 : arg_8 = arg_6 [ 0 ] arg_9 = arg_8 . frame ( ) arg_10 = arg_8 . fromlineno for arg_11 in arg_5 : if ( arg_11 . frame ( ) is arg_9 and arg_11 . fromlineno < arg_10 and not astroid . are_exclusive ( arg_11 . statement ( ) , arg_8 , arg_3 ) ) : arg_0 . add_message ( "access-member-before-definition" , arg_1 = arg_11 , args = ( arg_4 , arg_10 ) , )

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


Question: Make an API call to get the metric definition

def Func ( arg_0 ) : arg_0 . _url = arg_0 . form_url ( ) if arg_0 . _headers is not None : logging . debug ( arg_0 . _headers ) if arg_0 . _data is not None : logging . debug ( arg_0 . _data ) if len ( arg_0 . _get_url_parameters ( ) ) > 0 : logging . debug ( arg_0 . _get_url_parameters ( ) ) arg_2 = arg_0 . _methods [ arg_0 . _method ] ( ) if not arg_0 . good_response ( arg_2 . status_code ) : logging . error ( arg_0 . _url ) logging . error ( arg_0 . _method ) if arg_0 . _data is not None : logging . error ( arg_0 . _data ) logging . error ( arg_2 ) arg_0 . _api_result = arg_2

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: get the config attribute corresponding to opt

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 . get_option_def ( arg_1 ) return arg_2 . get ( "dest" , arg_1 . replace ( "-" , "_" ) )

Process current member with 'op' operation.


Question: Deletes a variable from a DataFrame .

def Func ( arg_0 , arg_1 ) : del arg_0 . variables [ arg_1 ] arg_0 . signal_variable_changed . emit ( arg_0 , arg_1 , "delete" )

Overriding the default JSONEncoder.default for NDB support.


Question: Augment batches .

def Func ( arg_0 , arg_1 , arg_2 = None ) : assert isinstance ( arg_1 , list ) , ( "Expected to get a list as 'batches', got type %s. " + "Call iFunc() if you use generators." ) % ( type ( arg_1 ) , ) return arg_0 . pool . map ( _Pool_starworker , arg_0 . _handle_batch_ids ( arg_1 ) , arg_2 = arg_2 )


Question: Decode geohash returning two strings with latitude and longitude containing only relevant digits and with trailing zeroes removed .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 , arg_4 = Func_exactly ( arg_0 ) arg_5 = "%.*f" % ( max ( 1 , int ( round ( - log10 ( arg_3 ) ) ) ) - 1 , arg_1 ) arg_6 = "%.*f" % ( max ( 1 , int ( round ( - log10 ( arg_4 ) ) ) ) - 1 , arg_2 ) if '.' in arg_5 : arg_5 = arg_5 . rstrip ( '0' ) if '.' in arg_6 : arg_6 = arg_6 . rstrip ( '0' ) return arg_5 , arg_6

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


Question: Given a module - like object that defines a type add it to our type system so that it can be used with the iotile tool and with other annotated API functions .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 = arg_0 . _canonicalize_type ( arg_1 ) arg_3 , arg_4 , arg_3 = arg_0 . split_type ( arg_1 ) if arg_0 . is_known_type ( arg_1 ) : raise ArgumentError ( "attempting to inject a type that is already defined" , type = arg_1 ) if ( not arg_4 ) and arg_0 . _is_factory ( arg_2 ) : if arg_1 in arg_0 . type_factories : raise ArgumentError ( "attempted to inject a complex type factory that is already defined" , type = arg_1 ) arg_0 . type_factories [ arg_1 ] = arg_2 else : arg_0 . _validate_type ( arg_2 ) arg_0 . known_types [ arg_1 ] = arg_2 if not hasattr ( arg_2 , "default_formatter" ) : raise ArgumentError ( "type is invalid, does not have default_formatter function" , type = arg_2 , methods = dir ( arg_2 ) )

List all events occurring at or after a timestamp.


Question: Updates field object with data from a PrefProxy object .

def Func ( arg_0 , arg_1 ) : arg_2 = ( 'verbose_name' , 'help_text' , 'default' ) for arg_3 in arg_2 : setattr ( arg_0 , arg_3 , getattr ( arg_1 , arg_3 ) )

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


Question: Save a screenshot of the page .

def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_1 = _prepare_path ( arg_1 , "png" ) arg_0 . driver . Func ( arg_1 , ** arg_2 ) return arg_1

Delete job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon job delete
    ```


Question: Build a request for twisted

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = { } , arg_4 = None , arg_5 = False ) : arg_6 = arg_2 if arg_5 else arg_0 . _url ( arg_2 ) arg_7 = arg_0 . get_headers ( ) if arg_3 : arg_7 . update ( arg_3 ) arg_8 = http_headers . Headers ( ) for arg_9 in arg_7 : arg_8 . addRawHeader ( arg_9 , arg_7 [ arg_9 ] ) arg_10 = client . Agent ( reactor ) arg_11 = arg_10 . request ( arg_1 , arg_6 , arg_8 , arg_4 ) return ( reactor , arg_11 )

Coincidence matrix.

    Parameters
    ----------
    value_counts : ndarray, with shape (N, V)
        Number of coders that assigned a certain value to a determined unit, where N is the number of units
        and V is the value count.

    value_domain : array_like, with shape (V,)
        Possible values V the units can take.
        If the level of measurement is not nominal, it must be ordered.

    dtype : data-type
        Result and computation data-type.

    Returns
    -------
    o : ndarray, with shape (V, V)
        Coincidence matrix.


Question: Get timezone as set by the system

def Func ( ) : arg_0 = 'America/New_York' arg_1 = locale . getdefaultlocale ( ) return arg_0 if not arg_1 [ 0 ] else str ( pytz . country_timezones [ arg_1 [ 0 ] [ - 2 : ] ] [ 0 ] )

Like ``generate`` but writes to disk.

        :param name: file name, the tar.gz extension will be added automatically
        :param path: directory where the file will be written to, defaults to ``./``
        :returns: None


Question: Place the runtime requirements from pkg_info into metadata .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = defaultdict ( list ) for arg_4 in arg_1 . get_all ( arg_2 ) : arg_5 = EXTRA_RE . search ( arg_4 ) if arg_5 : arg_6 = arg_5 . groupdict ( ) arg_7 = arg_6 [ 'condition' ] arg_8 = arg_6 [ 'extra' ] arg_9 = arg_6 [ 'package' ] if arg_7 . endswith ( ' and ' ) : arg_7 = arg_7 [ : - 5 ] else : arg_7 , arg_8 = None , None arg_9 = arg_4 arg_2 = MayRequiresKey ( arg_7 , arg_8 ) arg_3 [ arg_2 ] . append ( arg_9 ) if arg_3 : arg_0 [ 'run_requires' ] = [ ] for arg_2 , arg_4 in arg_3 . items ( ) : arg_10 = { 'requires' : arg_4 } if arg_2 . extra : arg_10 [ 'extra' ] = arg_2 . extra if arg_2 . condition : arg_10 [ 'environment' ] = arg_2 . condition arg_0 [ 'run_requires' ] . append ( arg_10 ) if not 'extras' in arg_0 : arg_0 [ 'extras' ] = [ ] arg_0 [ 'extras' ] . extend ( [ arg_2 . extra for arg_2 in arg_3 . keys ( ) if arg_2 . extra ] )

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: REST Conference Kick helper

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

Generates a bytecode from an object.

    :param obb: The object to generate.
    :param previous: The previous bytecode to use when generating subobjects.
    :return: The generated bytecode.


Question: Validate that all required type methods are implemented .

def Func ( arg_0 , arg_1 ) : if not ( hasattr ( arg_1 , "convert" ) or hasattr ( arg_1 , "convert_binary" ) ) : raise ArgumentError ( "type is invalid, does not have convert or convert_binary function" , type = arg_1 , methods = dir ( arg_1 ) ) if not hasattr ( arg_1 , "default_formatter" ) : raise ArgumentError ( "type is invalid, does not have default_formatter function" , type = arg_1 , methods = dir ( arg_1 ) )

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


Question: Drops the historical sap_success_factors table named herein .

def Func ( arg_0 , arg_1 ) : arg_2 = 'sap_success_factors_historicalsapsuccessfactorsenterprisecus80ad' if arg_2 in connection . introspection . table_names ( ) : migrations . DeleteModel ( name = arg_2 , )

Estimate whether the line string is at least partially inside the image.

        Parameters
        ----------
        image : ndarray or tuple of int
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.

        default
            Default value to return if the line string contains no points.

        Returns
        -------
        bool
            True if the line string is at least partially inside the image area.
            False otherwise.


Question: Get labels from the anomaly classifier within this model .

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . _getAnomalyClassifier ( ) . getSelf ( ) . getLabels ( arg_1 , arg_2 )


Question: Swift annotation for adding function to process swift notification .

def Func ( * arg_0 ) : check_event_type ( Openstack . Swift , * arg_0 ) arg_1 = arg_0 [ 0 ] def decorator ( arg_2 ) : if arg_1 . find ( "*" ) != - 1 : arg_3 = pre_compile ( arg_1 ) arg_4 [ arg_3 ] = arg_2 else : arg_5 [ arg_1 ] = arg_2 log . info ( "add function {0} to process event_type:{1}" . format ( arg_2 . __name__ , arg_1 ) ) @ functools . wraps ( arg_2 ) def wrapper ( * arg_6 , ** arg_7 ) : arg_2 ( * arg_6 , ** arg_7 ) return wrapper return decorator

Look through the jobs table and get the demand - minimum and maximum
    number of workers requested, if new workers are to be allocated, if there
    are any untended dead workers, for all running jobs.

    Parameters:
    ----------------------------------------------------------------
    retval:      list of ClientJobsDAO._jobs.jobDemandNamedTuple nametuples
                  containing the demand - min and max workers,
                  allocate_new_workers, untended_dead_workers, num_failed_workers
                  for each running (STATUS_RUNNING) job. Empty list when there
                  isn't any demand.


Question: passive check of python programs by pyflakes .

def Func ( ) : arg_0 = [ x for x in options . setup . packages if '.' not in x ] sh ( 'Func {param} {files}' . format ( param = options . paved . pycheck . Func . param , files = ' ' . join ( arg_0 ) ) )

Deserialize a dataframe.

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

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


Question: Can add this object

def Func ( arg_0 , arg_1 ) : return arg_1 . user . is_authenticated and arg_1 . user . is_active and arg_1 . user . is_staff


Question: Shows all of the credit notes that have been generated .

def Func ( ) : arg_0 = commerce . CreditNote . refunded ( ) return QuerysetReport ( "Credit note refunds" , [ "id" , "creditnoterefund__reference" , "amount" ] , arg_0 , link_view = views . credit_note , )

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Build path with endpoint and args

def Func ( arg_0 , * arg_1 ) : return '/' . join ( chain ( ( arg_0 . endpoint , ) , map ( str , arg_1 ) ) )

Backs up a trajectory.

        :param traj: Trajectory that should be backed up

        :param backup_filename:

            Path and filename of backup file. If None is specified the storage service
            defaults to `path_to_trajectory_hdf5_file/backup_trajectory_name.hdf`.


Question: Assign var and keep track of conflicts .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 . get ( arg_1 , None ) if arg_2 != arg_4 : if arg_4 is not None : arg_0 . record_conflict ( arg_3 , arg_1 , arg_4 , - 1 ) arg_0 . record_conflict ( arg_3 , arg_1 , arg_2 , + 1 ) CSP . Func ( arg_0 , arg_1 , arg_2 , arg_3 )

Send a completion status call to Degreed using the client.

        Args:
            payload: The learner completion data payload to send to Degreed


Question: Get number of elements of x in axis as type x . dtype .

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : return tf . cast ( tf . size ( input = arg_0 ) , arg_0 . dtype ) return tf . cast ( tf . reduce_prod ( input_tensor = tf . gather ( tf . shape ( input = arg_0 ) , arg_1 ) ) , arg_0 . dtype )

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Create new doamin

def Func ( arg_0 ) : arg_1 = { "name" : arg_0 . name , "ip_address" : arg_0 . ip_address , } arg_2 = arg_0 . get_data ( "domains" , type = POST , params = arg_1 ) return arg_2

Handles HTTP error codes for the given request

        Raises:
            AuthenticationError on the appropriate 4** errors
            ServerError if the response is not an ok (2**)

        Arguments:
            r -- The request result


Question: Verify partial table cell value

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : try : arg_6 = getcellvalue ( arg_1 , arg_2 , arg_3 , arg_4 ) if re . searchmatch ( arg_5 , arg_6 ) : return 1 except LdtpServerException : pass return 0

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: Return a random taxation ID number for a natural person .

Returns a dictionary of formatted data understood by the storage service.

        The data is put into an :class:`~pypet.parameter.ObjectTable` named 'data'.
        If the parameter is explored, the exploration range is also put into another table
        named 'explored_data'.

        :return: Dictionary containing the data and optionally the exploration range.


Question: Check for overlapping ranges .

def Func ( arg_0 , arg_1 , arg_2 ) : def _contains ( arg_3 , arg_4 ) : return ( arg_3 >= arg_4 [ 0 ] and arg_3 <= arg_4 [ 1 ] ) def _is_overlap ( arg_4 , arg_5 ) : return ( _contains ( arg_4 [ 0 ] , arg_5 ) or _contains ( arg_4 [ 1 ] , arg_5 ) or _contains ( arg_5 [ 0 ] , arg_4 ) or _contains ( arg_5 [ 1 ] , arg_4 ) ) for arg_6 in arg_2 : if _is_overlap ( arg_1 , arg_6 ) : return True return False

Build the parser that will have all available commands and options.


Question: Get trip counts per day between the start and end day of the feed .

def Func ( arg_0 ) : arg_1 = "SELECT date, count(*) AS number_of_trips FROM day_trips GROUP BY date" arg_2 = pd . read_sql_query ( arg_1 , arg_0 . conn , index_col = "date" ) arg_3 = arg_2 . index . max ( ) arg_4 = arg_2 . index . min ( ) arg_5 = datetime . datetime . strptime ( arg_4 , '%Y-%m-%d' ) arg_6 = datetime . datetime . strptime ( arg_3 , '%Y-%m-%d' ) arg_7 = ( arg_6 - arg_5 ) . days arg_8 = [ arg_5 + datetime . timedelta ( days = x ) for x in range ( arg_7 + 1 ) ] arg_9 = [ ] arg_10 = [ ] for arg_11 in arg_8 : arg_12 = arg_11 . strftime ( "%Y-%m-%d" ) arg_10 . append ( arg_12 ) try : arg_13 = arg_2 . loc [ arg_12 , 'number_of_trips' ] except KeyError : arg_13 = 0 arg_9 . append ( arg_13 ) for arg_12 in arg_2 . index : assert arg_12 in arg_10 arg_14 = { "date" : arg_8 , "date_str" : arg_10 , "trip_counts" : arg_9 } return pd . DataFrame ( arg_14 )

Respond when the server indicates that the client is out of sync.

        The server can request a sync when this client sends a message that
        fails the check() on the server.  If the reason for the failure isn't
        very serious, then the server can decide to send it as usual in the
        interest of a smooth gameplay experience.  When this happens, the
        server sends out an extra response providing the clients with the
        information they need to resync themselves.


Question: Decorator for Backend that ensures rates are fresh within last 5 mins

def Func ( arg_0 ) : def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . last_updated + timedelta ( minutes = 5 ) < zulu . now ( ) : arg_1 . refresh ( ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return wrapper

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: Add data to flow

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_0 . X = arg_1 arg_0 . y = arg_2 arg_0 . sentences = arg_3

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: Generator that yields a task - specific view of the job .

def Func ( arg_0 ) : for arg_1 in arg_0 . task_descriptors : arg_2 = JobDescriptor ( arg_0 . job_metadata , arg_0 . job_params , arg_0 . job_resources , [ arg_1 ] ) yield arg_2


Question: Decorator for warning user of depricated functions before use .

def Func ( arg_0 ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def wrapper ( * arg_2 , ** arg_3 ) : warnings . simplefilter ( 'always' , DeprecationWarning ) warnings . warn ( "Function {} is depricated, please use {} instead." . format ( arg_1 . __name__ , arg_0 ) , category = DeprecationWarning , stacklevel = 2 ) warnings . simplefilter ( 'default' , DeprecationWarning ) return arg_1 ( * arg_2 , ** arg_3 ) return wrapper return decorator

Loads many namespaces and combines their names.

    :param iter[str] locations: An iterable of URLs or file paths pointing to BEL namespaces.
    :param bool check_keywords: Should all the keywords be the same? Defaults to ``True``
    :return: A dictionary of {names: labels}
    :rtype: dict[str, str]

    Example Usage

    >>> from pybel.resources import write_namespace
    >>> from pybel_tools.definition_utils import export_namespace, get_merged_namespace_names
    >>> graph = ...
    >>> original_ns_url = ...
    >>> export_namespace(graph, 'MBS') # Outputs in current directory to MBS.belns
    >>> value_dict = get_merged_namespace_names([original_ns_url, 'MBS.belns'])
    >>> with open('merged_namespace.belns', 'w') as f:
    >>> ...  write_namespace('MyBrokenNamespace', 'MBS', 'Other', 'Charles Hoyt', 'PyBEL Citation', value_dict, file=f)


Question: This method is called before first step of simulation .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . vcdWriter arg_3 . date ( datetime . now ( ) ) arg_3 . timescale ( 1 ) arg_0 . vcdRegisterInterfaces ( arg_2 , None ) arg_0 . vcdRegisterRemainingSignals ( arg_2 ) arg_3 . enddefinitions ( )

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


Question: Writes all traffic data to file in JSON form .

def Func ( arg_0 , arg_1 = ( arg_2 . date . today ( ) ) , arg_4 = 'llnl' , arg_5 = { } , arg_6 = '' ) : for arg_7 in arg_5 : if len ( arg_5 [ arg_7 ] ) != 0 : arg_8 = ( '../github-data/' + arg_4 + '/' + arg_7 + '/' + arg_6 + '/' + str ( arg_1 ) + '.json' ) arg_0 . checkDir ( arg_8 ) with open ( arg_8 , 'w' ) as out : out . write ( json . dumps ( arg_5 [ arg_7 ] , sort_keys = True , indent = 4 , separators = ( ',' , ': ' ) ) ) out . close ( )

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


Question: Return whether the input course or program exist .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 and CourseApiClient ( ) . get_course_details ( arg_1 ) arg_4 = arg_2 and CourseCatalogApiServiceClient ( ) . program_exists ( arg_2 ) return arg_3 or arg_4

Associate the given client data with the item at position n.


Question: Extract a character from each sample at the specified position from a string column . Note that if the specified position is out of bound of the string sample this method returns while pandas retunrs nan .

def Func ( arg_0 , arg_1 ) : arg_0 = _to_string_sequence ( arg_0 ) if arg_1 == - 1 : arg_2 = arg_0 . slice_string_end ( - 1 ) else : arg_2 = arg_0 . slice_string ( arg_1 , arg_1 + 1 ) return column . ColumnStringArrow ( arg_2 . bytes , arg_2 . indices , arg_2 . length , arg_2 . offset , string_sequence = arg_2 )

Returns an authorized http instance.

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

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


Question: Equivalent to map compatibility purpose only . Column parameter ignored .

def Func ( arg_0 , arg_1 , arg_2 = None , * arg_3 , ** arg_4 ) : arg_5 = arg_0 . _rdd . map ( arg_1 ) if arg_2 is None : return arg_0 . __class__ ( arg_5 , noblock = True , ** arg_0 . get_params ( ) ) if arg_2 is np . ndarray : return ArrayRDD ( arg_5 , bsize = arg_0 . bsize , noblock = True ) elif arg_2 is sp . spmatrix : return SparseRDD ( arg_5 , bsize = arg_0 . bsize , noblock = True ) else : return BlockRDD ( arg_5 , bsize = arg_0 . bsize , arg_2 = arg_2 , noblock = True )

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


Question: Called by the environment to make some initial configurations before performing the individual runs .

def Func ( arg_0 ) : if len ( arg_0 . _changed_default_parameters ) : raise pex . PresettingError ( 'The following parameters were supposed to replace a ' 'default value, but it was never tried to ' 'add default values with these names: %s' % str ( arg_0 . _changed_default_parameters ) ) arg_0 . f_lock_parameters ( ) arg_0 . f_lock_derived_parameters ( )

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


Question: Parse an instruction .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _as_instruction ( arg_2 ) return arg_0 . _spec . new_Func ( arg_1 , arg_3 )

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


Question: Copy data from one table to another while filtering data at the same time

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_1 . cursor ( ) if arg_2 and arg_0 . Func_where : arg_4 = arg_0 . Func_where . format ( ** arg_2 ) else : arg_4 = '' arg_3 . execute ( 'INSERT INTO %s ' 'SELECT * FROM source.%s %s' % ( arg_0 . table , arg_0 . table , arg_4 ) )

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

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

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


Question: Check if a certain path exists in the storage service .

def Func ( arg_0 , arg_1 ) : arg_0 . __validate_storage_path ( arg_1 ) try : arg_2 = arg_0 . api_client . get_entity_by_query ( arg_1 = arg_1 ) except StorageNotFoundException : return False return arg_2 and 'uuid' in arg_2

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

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


Question: Takes Edward probabilistic program and returns its log joint function .

def Func ( arg_0 ) : def log_joint_fn ( * arg_1 , ** arg_2 ) : arg_3 = [ ] def interceptor ( arg_4 , * arg_5 , ** arg_6 ) : arg_7 = arg_6 . get ( "name" ) if arg_7 is None : raise KeyError ( "Random variable constructor {} has no name " "in its arguments." . format ( arg_4 . __name__ ) ) arg_8 = arg_6 . get ( "value" ) arg_9 = arg_2 . get ( arg_7 , arg_8 ) if arg_9 is None : raise LookupError ( "Keyword argument specifying value for {} is " "missing." . format ( arg_7 ) ) arg_6 [ "value" ] = arg_9 arg_10 = arg_4 ( * arg_5 , ** arg_6 ) arg_11 = tf . reduce_sum ( input_tensor = arg_10 . distribution . log_prob ( arg_10 . value ) ) arg_3 . append ( arg_11 ) return arg_10 arg_12 = _get_function_inputs ( arg_0 , arg_2 ) with interception ( interceptor ) : arg_0 ( * arg_1 , ** arg_12 ) arg_11 = sum ( arg_3 ) return arg_11 return log_joint_fn

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


Question: Check the spacing of a single equals sign .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . _has_valid_type_annotation ( arg_1 , arg_2 ) : arg_0 . _check_space ( arg_1 , arg_2 , ( _MUST , _MUST ) ) elif arg_0 . _inside_brackets ( "(" ) or arg_0 . _inside_brackets ( "lambda" ) : arg_0 . _check_space ( arg_1 , arg_2 , ( _MUST_NOT , _MUST_NOT ) ) else : arg_0 . _check_space ( arg_1 , arg_2 , ( _MUST , _MUST ) )

Given a single spinn3r feed entry, produce a single StreamItem.

    Returns 'None' if a complete item can't be constructed.


Question: Configure the index to work with

def Func ( arg_0 , arg_1 = False ) : try : arg_2 = requests . get ( arg_0 ) except requests . exceptions . ConnectionError : arg_3 = "Error connecting to Elastic Search (index: %s)" % arg_0 raise ElasticSearchError ( arg_3 = arg_3 ) if arg_2 . status_code != 200 : arg_2 = requests . put ( arg_0 ) if arg_2 . status_code != 200 : logger . info ( "Can't create index %s (%s)" , arg_0 , arg_2 . status_code ) arg_3 = "Error creating Elastic Search index %s" % arg_0 raise ElasticSearchError ( arg_3 = arg_3 ) logger . info ( "Index %s created" , arg_0 ) return True elif arg_2 . status_code == 200 and arg_1 : requests . delete ( arg_0 ) requests . put ( arg_0 ) logger . info ( "Index deleted and created (index: %s)" , arg_0 ) return True return False

Generate the body that will be used in the refresh request.


Question: Parse arguments not consumed by arg parser into a dicitonary

def Func ( arg_0 ) : arg_1 = { } arg_2 = False for arg_3 in arg_0 : if arg_3 . startswith ( '--' ) : if '=' in arg_3 : arg_4 = arg_3 . split ( '=' ) [ 0 ] [ 2 : ] arg_5 = arg_3 . split ( '=' ) [ 1 ] arg_1 [ arg_4 ] = arg_5 else : arg_4 = arg_3 [ 2 : ] arg_2 = True elif arg_2 : arg_1 [ arg_4 ] = arg_3 arg_2 = False return arg_1


Question: Ask Skype for the authenticated user s identifier and store it on the connection object .

def Func ( arg_0 ) : arg_0 . userId = arg_0 ( "GET" , "{0}/users/self/profile" . format ( arg_0 . API_USER ) , auth = arg_0 . Auth . SkypeToken ) . json ( ) . get ( "username" )

Stop any currently running Docker containers associated with
    Dusty, or associated with the provided apps_or_services. Does not remove
    the service's containers.


Question: Plot two parts of the ortho view the two sections given by orientation .

def Func ( arg_0 , arg_1 = None , arg_2 = 6.0 , arg_3 = 'bone_r' , arg_4 = 0 , arg_5 = 1 , arg_6 = 'vertical' , arg_7 = 1.09 , arg_8 = 0.01 ) : arg_1 = arg_1 or [ arg_10 // 2 for arg_10 in arg_0 . shape ] arg_9 = [ ] for arg_10 , arg_11 in enumerate ( arg_1 ) : arg_12 = [ np . s_ [ : ] ] * len ( arg_1 ) arg_12 [ arg_10 ] = arg_11 arg_9 . append ( tuple ( arg_12 ) ) arg_13 , arg_14 , arg_15 = [ float ( arg_10 ) for arg_10 in arg_0 . shape ] arg_16 = float ( arg_15 + arg_13 ) arg_17 = float ( arg_14 + arg_13 ) def show ( arg_0 , arg_18 , arg_19 , arg_20 = False ) : arg_21 = arg_0 [ arg_19 ] if not arg_20 else arg_0 [ arg_19 ] . T arg_18 . imshow ( arg_21 , arg_3 = arg_3 , interpolation = 'nearest' , arg_4 = arg_4 , arg_5 = arg_5 ) arg_18 . set_xticks ( [ ] ) arg_18 . set_yticks ( [ ] ) arg_18 . grid ( 'off' ) if arg_6 . startswith ( 'v' ) : log . info ( '{} {} {} {} {} {}' . format ( arg_15 , arg_14 , arg_13 , arg_16 , arg_17 , arg_15 / arg_17 ) ) arg_22 = arg_15 / arg_17 arg_23 = arg_14 / arg_17 arg_24 = 1 / ( 1 + 3 * arg_8 ) arg_25 = pl . figure ( figsize = ( arg_2 * arg_22 , arg_2 * arg_24 ) ) arg_26 = arg_25 . add_axes ( ( arg_8 , arg_24 * ( 1 - arg_23 ) + 2 * arg_8 , arg_24 , arg_24 * arg_23 ) ) arg_27 = arg_25 . add_axes ( ( arg_8 , arg_8 , arg_24 , arg_24 * ( 1 - arg_23 ) ) ) show ( arg_0 , arg_26 , arg_9 [ 0 ] ) show ( arg_0 , arg_27 , arg_9 [ 1 ] ) else : arg_22 = arg_14 / arg_16 arg_23 = arg_15 / arg_16 arg_24 = 1 / ( 1 + 3 * arg_8 ) arg_25 = pl . figure ( figsize = ( arg_2 * arg_24 , arg_2 * arg_22 ) ) arg_26 = arg_25 . add_axes ( ( arg_8 , arg_8 , arg_24 * arg_23 , arg_24 ) ) arg_27 = arg_25 . add_axes ( ( 2 * arg_8 + arg_24 * arg_23 , arg_8 , arg_24 * ( 1 - arg_23 ) , arg_24 ) ) show ( arg_0 , arg_26 , arg_9 [ 0 ] ) show ( arg_0 , arg_27 , arg_9 [ 2 ] , arg_20 = True ) return arg_25 , arg_26 , arg_27

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


Question: Return number of objects that intersect the given coordinates .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . get_coordinate_pointers ( arg_1 ) arg_4 = ctypes . c_uint64 ( 0 ) core . rt . Index_Intersects_Func ( arg_0 . handle , arg_2 , arg_3 , arg_0 . properties . dimension , ctypes . byref ( arg_4 ) ) return arg_4 . value

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

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


Question: Backward update for a Kalman smoother .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = arg_6 . matmul ( arg_1 ) arg_8 = tf . linalg . cholesky ( arg_3 ) arg_9 = tf . linalg . cholesky_solve ( arg_8 , arg_7 ) arg_10 = ( arg_0 + tf . linalg . matmul ( arg_9 , arg_4 - arg_2 , adjoint_a = True ) ) arg_11 = ( arg_1 + tf . linalg . matmul ( arg_9 , tf . linalg . matmul ( arg_5 - arg_3 , arg_9 ) , adjoint_a = True ) ) return ( arg_10 , arg_11 )

write lines, one by one, separated by \n to device


Question: Performs a bootstrap analysis on a user - defined function returning a summary statistic .

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_3 . pop ( 'n_samples' , 1000 ) arg_5 = np . empty ( arg_4 ) arg_6 = arg_3 . pop ( 'factor_returns' , None ) for arg_7 in range ( arg_4 ) : arg_8 = np . random . randint ( len ( arg_1 ) , size = len ( arg_1 ) ) arg_9 = arg_1 . iloc [ arg_8 ] . reset_index ( drop = True ) if arg_6 is not None : arg_10 = arg_6 . iloc [ arg_8 ] . reset_index ( drop = True ) arg_5 [ arg_7 ] = arg_0 ( arg_9 , arg_10 , * arg_2 , ** arg_3 ) else : arg_5 [ arg_7 ] = arg_0 ( arg_9 , * arg_2 , ** arg_3 ) return arg_5

Returns protobuf mapcontainer. Read from translation file.


Question: 260 Date normalization .

def Func ( arg_0 ) : arg_1 = record_get_field_instances ( arg_0 . record , '260' ) for arg_2 in arg_1 : for arg_3 , ( arg_4 , arg_5 ) in enumerate ( arg_2 [ 0 ] ) : if arg_4 == 'c' : arg_2 [ 0 ] [ arg_3 ] = ( 'c' , arg_5 [ : 4 ] ) elif arg_4 == 't' : del arg_2 [ 0 ] [ arg_3 ] if not arg_1 : arg_6 = record_get_field_values ( arg_0 . record , "773" , code = "y" ) if arg_6 : record_add_field ( arg_0 . record , "260" , subfields = [ ( "c" , arg_6 [ 0 ] [ : 4 ] ) ] ) else : arg_7 = record_get_field_values ( arg_0 . record , "269" , code = "c" ) if arg_7 : record_add_field ( arg_0 . record , "260" , subfields = [ ( "c" , arg_7 [ 0 ] [ : 4 ] ) ] )

Disconnect any connected devices that have any of the specified
        service UUIDs.


Question: Returns the list of reports for the canvas account id .

def Func ( arg_0 , arg_1 ) : arg_2 = ACCOUNTS_API . format ( arg_1 ) + "/reports" arg_3 = [ ] for arg_4 in arg_0 . _get_resource ( arg_2 ) : arg_3 . append ( ReportType ( data = arg_4 , arg_1 = arg_1 ) ) return arg_3


Question: Save the object to a given file like object in the given format .

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : arg_2 = arg_0 . format if arg_2 is None else arg_2 arg_4 = getattr ( arg_0 , "save_%s" % arg_2 , None ) if arg_4 is None : raise ValueError ( "Unknown format '%s'." % arg_2 ) arg_4 ( arg_1 , ** arg_3 )


Question: Compares two operands .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . read ( ) arg_4 = Operators . SEXTEND ( arg_2 . read ( ) , arg_2 . size , arg_1 . size ) arg_0 . _calculate_Func_flags ( arg_1 . size , arg_3 - arg_4 , arg_3 , arg_4 )

Write the index.html file for this report.


Question: Raise an appropriate error for a given response .

def Func ( arg_0 ) : for arg_1 in web_exceptions . __all__ : arg_2 = getattr ( web_exceptions , arg_1 ) if arg_2 . status_code == arg_0 . status : arg_3 = dict ( headers = arg_0 . headers , reason = arg_0 . reason , ) if issubclass ( arg_2 , web_exceptions . _HTTPMove ) : raise arg_2 ( arg_0 . headers [ 'Location' ] , ** arg_3 ) raise arg_2 ( ** arg_3 )

Get a unique hash depending on the state of the data.

    Args:
        data (object):
            Any sort of loosely organized data

        hasher (str or HASHER):
            Hash algorithm from hashlib, defaults to `sha512`.

        base (str or List[str]):
            Shorthand key or a list of symbols.  Valid keys are: 'abc', 'hex',
            and 'dec'. Defaults to 'hex'.

        types (bool):
            If True data types are included in the hash, otherwise only the raw
            data is hashed. Defaults to False.

        hashlen (int):
            Maximum number of symbols in the returned hash. If not specified,
            all are returned.  DEPRECATED. Use slice syntax instead.

        convert (bool, optional, default=True):
            if True, try and convert the data to json an the json is hashed
            instead. This can improve runtime in some instances, however the
            hash may differ from the case where convert=False.

    Notes:
        alphabet26 is a pretty nice base, I recommend it.
        However we default to hex because it is standard.
        This means the output of hashdata with base=sha1 will be the same as
        the output of `sha1sum`.

    Returns:
        str: text -  hash string

    Example:
        >>> import ubelt as ub
        >>> print(ub.hash_data([1, 2, (3, '4')], convert=False))
        60b758587f599663931057e6ebdf185a...
        >>> print(ub.hash_data([1, 2, (3, '4')], base='abc',  hasher='sha512')[:32])
        hsrgqvfiuxvvhcdnypivhhthmrolkzej


Question: Gets status of response .

def Func ( arg_0 ) : Func = c_long ( ) _WinHttpRequest . _Status ( arg_0 , byref ( Func ) ) return int ( Func . value )

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

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


Question: Refreshes the task instance from the database based on the primary key

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_3 = TaskInstance arg_4 = arg_1 . query ( arg_3 ) . filter ( arg_3 . dag_id == arg_0 . dag_id , arg_3 . task_id == arg_0 . task_id , arg_3 . execution_date == arg_0 . execution_date ) if arg_2 : arg_5 = arg_4 . with_for_update ( ) . first ( ) else : arg_5 = arg_4 . first ( ) if arg_5 : arg_0 . state = arg_5 . state arg_0 . start_date = arg_5 . start_date arg_0 . end_date = arg_5 . end_date arg_0 . try_number = arg_5 . _try_number arg_0 . max_tries = arg_5 . max_tries arg_0 . hostname = arg_5 . hostname arg_0 . pid = arg_5 . pid arg_0 . executor_config = arg_5 . executor_config else : arg_0 . state = None

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

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


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

def Func ( arg_0 , arg_1 , arg_2 = False ) : if not arg_0 . isatty : arg_0 . fobj . Func ( '%s\n' % arg_1 ) return arg_3 = len ( arg_1 ) arg_0 . max_len = max ( arg_0 . max_len , arg_3 ) arg_0 . fobj . Func ( "\r%-*s" % ( arg_0 . max_len , arg_1 ) ) if arg_2 or not arg_0 . isatty : arg_0 . fobj . Func ( '\n' ) arg_0 . max_len = 0

Stop any currently running Docker containers associated with
    Dusty, or associated with the provided apps_or_services. Does not remove
    the service's containers.


Question: Compute a greedy classification for the given set of data .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . feed_forward ( arg_1 , ** arg_2 ) return arg_3 [ arg_0 . layers [ - 1 ] . output_name ] . argmax ( axis = - 1 )

AWS doesn't quite have Swagger 2.0 validation right and will fail
        on some refs. So, we need to convert to deref before
        upload.


Question: Tells if this message is a text message .

def Func ( arg_0 ) : return arg_0 . type in [ arg_0 . _TYPE_PASTE , arg_0 . _TYPE_TEXT , arg_0 . _TYPE_TWEET ]

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


Question: Checks the health of a sample from the FastQC summary file .

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( "fail_sensitive" , [ "Per base sequence quality" , "Overrepresented sequences" , "Sequence Length Distribution" , "Per sequence GC content" ] ) logger . debug ( "Fail sensitive categories: {}" . format ( arg_2 ) ) arg_3 = arg_1 . get ( "must_pass" , [ "Per base N content" , "Adapter Content" ] ) logger . debug ( "Must pass categories: {}" . format ( arg_3 ) ) arg_4 = arg_1 . get ( "warning_fail_sensitive" , [ "Per base sequence quality" , "Overrepresented sequences" , ] ) arg_5 = arg_1 . get ( "warning_must_pass" , [ "Per base sequence content" ] ) arg_6 = get_summary ( arg_0 ) arg_7 = True arg_8 = [ ] arg_9 = [ ] for arg_10 , arg_11 in arg_6 . items ( ) : logger . debug ( "Assessing category {} with result {}" . format ( arg_10 , arg_11 ) ) if arg_10 in arg_2 and arg_11 == "FAIL" : arg_7 = False arg_8 . append ( "{}:{}" . format ( arg_10 , arg_11 ) ) logger . error ( "Category {} failed a fail sensitive " "category" . format ( arg_10 ) ) if arg_10 in arg_3 and arg_11 != "PASS" : arg_7 = False arg_8 . append ( "{}:{}" . format ( arg_10 , arg_11 ) ) logger . error ( "Category {} failed a must pass category" . format ( arg_10 ) ) if arg_10 in arg_4 and arg_11 == "FAIL" : arg_9 . append ( "Failed category: {}" . format ( arg_10 ) ) logger . warning ( "Category {} flagged at a fail sensitive " "category" . format ( arg_10 ) ) if arg_10 in arg_5 and arg_11 != "PASS" : arg_9 . append ( "Did not pass category: {}" . format ( arg_10 ) ) logger . warning ( "Category {} flagged at a must pass " "category" . format ( arg_10 ) ) return arg_7 , arg_8 , arg_9

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


Question: Calculate correlation filter .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 15 , arg_4 = 0.9 , arg_5 = 0.05 , arg_6 = True , arg_7 = False ) : if arg_3 % 2 != 1 : arg_3 += 1 arg_8 = locals ( ) del ( arg_8 [ 'self' ] ) arg_9 = arg_0 . filt . maxset + 1 arg_10 = '{:}_{:}_{:.0f}' . format ( arg_1 , arg_2 , arg_3 ) arg_0 . calc_correlation ( arg_1 , arg_2 , arg_3 , arg_6 , arg_7 ) arg_11 , arg_12 = arg_0 . correlations [ arg_10 ] arg_13 = ( abs ( arg_11 ) > arg_4 ) & ( arg_12 < arg_5 ) arg_13 = ~ arg_13 arg_14 = arg_1 + '_' + arg_2 + '_corr' arg_0 . filt . add ( arg_14 = arg_14 , arg_6 = arg_13 , info = ( arg_1 + ' vs. ' + arg_2 + ' correlation filter.' ) , arg_8 = arg_8 , arg_9 = arg_9 ) arg_0 . filt . off ( arg_6 = arg_14 ) arg_0 . filt . on ( analyte = arg_2 , arg_6 = arg_14 ) return


Question: 64bit counter aggregator with wrapping

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 < arg_0 : arg_3 = 18446744073709551615 - arg_0 return ( arg_3 + arg_1 ) / float ( arg_2 ) return ( arg_1 - arg_0 ) / float ( arg_2 )

Downloads a MP4 or WebM file that is associated with the video at the URL passed.

        :param str url: URL of the video to be downloaded
        :return str: Filename of the file in local storage


Question: Replace the levels of a categorical column .

def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , [ str ] ) return H2OFrame . _expr ( expr = ExprNode ( "setDomain" , arg_0 , False , arg_1 ) , cache = arg_0 . _ex . _cache )

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


Question: Get stop count data .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_tripIs_active_in_range ( arg_1 , arg_2 ) arg_4 = Counter ( ) for arg_5 in arg_3 . itertuples ( ) : arg_6 = arg_0 . get_trip_stop_time_data ( arg_5 . trip_I , arg_5 . day_start_ut ) for arg_7 in arg_6 . itertuples ( index = False ) : if ( arg_7 . dep_time_ut >= arg_1 ) and ( arg_7 . dep_time_ut <= arg_2 ) : arg_4 [ arg_7 . stop_I ] += 1 arg_8 = arg_0 . stops ( ) arg_9 = [ arg_4 [ stop_I ] for stop_I in arg_8 [ "stop_I" ] . values ] arg_8 . loc [ : , "count" ] = pd . Series ( arg_9 , index = arg_8 . index ) return arg_8

Recompute this distribution's dependencies.


Question: Adds headers to the request

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . copy ( ) arg_2 . update ( arg_0 . _headers ) return arg_0 . __copy_and_set ( 'headers' , arg_2 )

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: Adds all of the members of the composite abundances to the graph .

def Func ( arg_0 : arg_1 ) : arg_2 = list ( get_nodes_by_function ( arg_0 , COMPOSITE ) ) for arg_3 in arg_2 : for arg_4 in arg_3 . members : arg_0 . add_has_component ( arg_3 , arg_4 )


Question: Loads the model of the given name . The model will also be inserted into the cache .

def Func ( arg_0 , arg_1 ) : arg_2 = model . Model ( arg_0 . peng , arg_0 , arg_1 ) arg_0 . modelobjcache [ arg_1 ] = arg_2 arg_0 . peng . sendEvent ( "peng3d:rsrc.model.load" , { "peng" : arg_0 . peng , "name" : arg_1 } ) return arg_2

Process current member with 'op' operation.


Question: Try to convert a tar file containing a sequence of frames saved by the meshcat viewer into a single video file .

def Func ( arg_0 , arg_1 = "output.mp4" , arg_2 = 60 , arg_3 = False ) : arg_1 = os . path . abspath ( arg_1 ) if os . path . isfile ( arg_1 ) and not arg_3 : raise ValueError ( "The output path {:s} already exists. To overwrite that file, you can pass overwrite=True to this function." . format ( arg_1 ) ) with tempfile . TemporaryDirectory ( ) as tmp_dir : with tarfile . open ( arg_0 ) as tar : tar . extractall ( tmp_dir ) arg_4 = [ "ffmpeg" , "-r" , str ( arg_2 ) , "-i" , r"%07d.png" , "-vcodec" , "libx264" , "-preset" , "slow" , "-crf" , "18" ] if arg_3 : arg_4 . append ( "-y" ) arg_4 . append ( arg_1 ) try : subprocess . check_call ( arg_4 , cwd = tmp_dir ) except subprocess . CalledProcessError as e : print ( """Could not call `ffmpeg` to convert your frames into a video.If you want to convert the frames manually, you can extract the.tar archive into a directory, cd to that directory, and run:ffmpeg -r 60 -i %07d.png \\\n\t -vcodec libx264 \\\n\t -preset slow \\\n\t -crf 18 \\\n\t output.mp4                """ ) raise print ( "Saved output as {:s}" . format ( arg_1 ) ) return arg_1


Question: Return the shape of img .

def Func ( arg_0 ) : if hasattr ( arg_0 , 'shape' ) : arg_1 = arg_0 . shape else : arg_1 = arg_0 . get_data ( ) . shape return arg_1

main execution loop. query weather data and post to online service.


Question: Checkpoint the dfk incrementally to a checkpoint file .

def Func ( arg_0 , arg_1 = None ) : with arg_0 . Func_lock : arg_2 = None if arg_1 : arg_2 = arg_1 else : arg_2 = arg_0 . tasks arg_3 = '{0}/Func' . format ( arg_0 . run_dir ) arg_4 = arg_3 + '/dfk.pkl' arg_5 = arg_3 + '/tasks.pkl' if not os . path . exists ( arg_3 ) : try : os . makedirs ( arg_3 ) except FileExistsError : pass with open ( arg_4 , 'wb' ) as f : arg_6 = { 'rundir' : arg_0 . run_dir , 'task_count' : arg_0 . task_count } pickle . dump ( arg_6 , f ) arg_7 = 0 with open ( arg_5 , 'ab' ) as f : for arg_8 in arg_2 : if not arg_0 . tasks [ arg_8 ] [ 'Func' ] and arg_0 . tasks [ arg_8 ] [ 'app_fu' ] . done ( ) and arg_0 . tasks [ arg_8 ] [ 'app_fu' ] . exception ( ) is None : arg_9 = arg_0 . tasks [ arg_8 ] [ 'hashsum' ] if not arg_9 : continue arg_10 = { 'hash' : arg_9 , 'exception' : None , 'result' : None } try : arg_11 = arg_0 . memoizer . hash_lookup ( arg_9 ) . result ( ) except Exception as e : arg_10 [ 'exception' ] = e else : arg_10 [ 'result' ] = arg_11 pickle . dump ( arg_10 , f ) arg_7 += 1 arg_0 . tasks [ arg_8 ] [ 'Func' ] = True logger . debug ( "Task {} Funced" . format ( arg_8 ) ) arg_0 . Funced_tasks += arg_7 if arg_7 == 0 : if arg_0 . Funced_tasks == 0 : logger . warn ( "No tasks Funced so far in this run. Please ensure caching is enabled" ) else : logger . debug ( "No tasks Funced in this pass." ) else : logger . info ( "Done Funcing {} tasks" . format ( arg_7 ) ) return arg_3

Remove a contact from the roster.

        :Parameters:
            - `jid`: contact's jid
            - `callback`: function to call when the request succeeds. It should
              accept a single argument - a `RosterItem` describing the
              requested change
            - `error_callback`: function to call when the request fails. It
              should accept a single argument - an error stanza received
              (`None` in case of timeout)
        :Types:
            - `jid`: `JID`


Question: Parse single RFC2425 record and update attributes of self .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_1 . split ( ":" , 1 ) arg_3 = arg_3 . replace ( "\\n" , "\n" ) . replace ( "\\N" , "\n" ) arg_4 = arg_2 . lower ( ) . split ( ";" ) arg_5 = arg_4 [ 0 ] arg_6 = arg_4 [ 1 : ] if u"." in arg_5 : arg_5 = arg_5 . split ( "." , 1 ) [ 1 ] arg_5 = arg_5 . upper ( ) if arg_5 in ( u"X-DESC" , u"X-JABBERID" ) : arg_5 = arg_5 [ 2 : ] if not arg_0 . components . has_key ( arg_5 ) : return if arg_6 : arg_6 = dict ( [ p . split ( "=" , 1 ) for p in arg_6 ] ) arg_7 , arg_8 = arg_0 . components [ arg_5 ] if arg_8 in ( "required" , "optional" ) : if arg_0 . content . has_key ( arg_5 ) : raise ValueError ( "Duplicate %s" % ( arg_5 , ) ) try : arg_0 . content [ arg_5 ] = arg_7 ( arg_5 , arg_3 , arg_6 ) except Empty : pass elif arg_8 == "multi" : if not arg_0 . content . has_key ( arg_5 ) : arg_0 . content [ arg_5 ] = [ ] try : arg_0 . content [ arg_5 ] . append ( arg_7 ( arg_5 , arg_3 , arg_6 ) ) except Empty : pass else : return


Question: Apply cu1 from ctl to tgt with angle theta .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_0 . append ( Cu1Gate ( arg_1 ) , [ arg_2 , arg_3 ] , [ ] )


Question: Register passed processor for passed mimetype .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 not in arg_0 or arg_2 not in arg_0 [ arg_1 ] : arg_0 . setdefault ( arg_1 , [ ] ) . append ( arg_2 )


Question: Send DDL to create the specified table constraints

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

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


Question: Export all genes from a build

def Func ( arg_0 , arg_1 , arg_2 ) : LOG . info ( "Running scout export Func" ) arg_3 = arg_0 . obj [ 'adapter' ] arg_4 = arg_3 . all_Func ( arg_1 = arg_1 ) if arg_2 : click . echo ( dumps ( arg_4 ) ) return arg_5 = ( "{0}\t{1}\t{2}\t{3}\t{4}" ) click . echo ( "#Chromosom\tStart\tEnd\tHgnc_id\tHgnc_symbol" ) for arg_6 in arg_4 : click . echo ( arg_5 . format ( arg_6 [ 'chromosome' ] , arg_6 [ 'start' ] , arg_6 [ 'end' ] , arg_6 [ 'hgnc_id' ] , arg_6 [ 'hgnc_symbol' ] , ) )

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


Question: Generate a safe and closed filepath .

def Func ( arg_0 = "tmp_" , arg_1 = "" , arg_2 = None ) : try : arg_3 , arg_4 = mkstemp ( arg_0 = arg_0 , arg_1 = arg_1 , dir = arg_2 ) os . close ( arg_3 ) except IOError , e : try : os . remove ( arg_4 ) except Exception : pass raise e return arg_4

Extract metadata entries from an xml node


Question: Displays the default pipeline inspection overview

def Func ( arg_0 ) : arg_1 = True arg_0 . screen = curses . initscr ( ) arg_0 . screen . keypad ( True ) arg_0 . screen . nodelay ( - 1 ) curses . cbreak ( ) curses . noecho ( ) curses . start_color ( ) arg_0 . screen_lines = arg_0 . screen . getmaxyx ( ) [ 0 ] try : while arg_1 : arg_0 . _curses_keybindings ( ) arg_0 . update_inspection ( ) arg_0 . flush_overview ( ) sleep ( arg_0 . refresh_rate ) except FileNotFoundError : sys . stderr . write ( colored_print ( "ERROR: nextflow log and/or trace files are no longer " "reachable!" , "red_bold" ) ) except Exception as e : sys . stderr . write ( str ( e ) ) finally : curses . nocbreak ( ) arg_0 . screen . keypad ( 0 ) curses . echo ( ) curses . endwin ( )

Generate RENEWING time.

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

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


Question: Get course mode s SKU discounted price after applying any entitlement available for this user .

def Func ( arg_0 , arg_1 , arg_2 = '$' , arg_3 = None ) : try : arg_4 = arg_0 . client . baskets . calculate . get ( sku = [ arg_1 [ 'sku' ] ] , username = arg_0 . user . username , catalog = arg_3 , ) except ( SlumberBaseException , ConnectionError , Timeout ) as exc : LOGGER . exception ( 'Failed to get price details for sku %s due to: %s' , arg_1 [ 'sku' ] , str ( exc ) ) arg_4 = { } arg_5 = arg_4 . get ( 'total_incl_tax' , arg_1 [ 'min_price' ] ) if arg_5 != arg_1 [ 'min_price' ] : return format_price ( arg_5 , arg_2 ) return arg_1 [ 'original_price' ]

Extracts start row from the bookmark information


Question: Gets back all response headers .

def Func ( arg_0 ) : arg_1 = c_void_p ( ) _WinHttpRequest . _GetAllResponseHeaders ( arg_0 , byref ( arg_1 ) ) arg_1 = ctypes . cast ( arg_1 , c_wchar_p ) arg_2 = arg_1 . value _SysFreeString ( arg_1 ) return arg_2

Init openstack neutron mq

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

        :param mq: class ternya.mq.MQ


Question: Takes a base91 char string and returns decimal

def Func ( arg_0 ) : if not isinstance ( arg_0 , string_type ) : raise TypeError ( "expected str or unicode, %s given" % type ( arg_0 ) ) if findall ( r"[\x00-\x20\x7c-\xff]" , arg_0 ) : raise ValueError ( "invalid character in sequence" ) arg_0 = arg_0 . lstrip ( '!' ) arg_1 = 0 arg_2 = len ( arg_0 ) - 1 for arg_3 , arg_4 in enumerate ( arg_0 ) : arg_1 += ( ord ( arg_4 ) - 33 ) * ( 91 ** ( arg_2 - arg_3 ) ) return arg_1 if arg_0 != '' else 0

Shrinks the trajectory and removes all exploration ranges from the parameters.
        Only possible if the trajectory has not been stored to disk before or was loaded as new.

        :param force:

            Usually you cannot shrink the trajectory if it has been stored to disk,
            because there's no guarantee that it is actually shrunk if there
            still exist explored parameters on disk. In case you are certain that
            you did not store explored parameters to disk set or you deleted all
            of them from disk set `force=True`.

        :raises: TypeError if the trajectory was stored before.


Question: Sets byte if not overflow .

def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . OF == False , 1 , 0 ) )


Question: Format the endpoint url by data and then request the remote server .

def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 , arg_4 = arg_1 try : arg_5 = arg_0 . _formatter . format_map ( arg_4 , arg_2 ) arg_6 = arg_0 . _formatter . get_unused_kwargs ( ) arg_7 = "{0}{1}" . format ( arg_0 . _url , arg_5 ) return arg_0 . _request ( arg_3 , arg_7 , arg_6 ) except KeyError as err : LOGGER . debug ( 'Endpoint {0} is missing argument {1}' . format ( arg_4 , err ) ) raise

Does this filename match any of the patterns?


Question: Init and configure logger .

def Func ( arg_0 = None , arg_1 = False ) : Func = logging . getLogger ( arg_0 ) if arg_1 : arg_3 = '%(asctime)s [%(levelname)s] [%(name)s] %(funcName)s: %(message)s (line %(lineno)d)' arg_4 = 'fut.log' open ( arg_4 , 'w' ) . write ( '' ) Func . setLevel ( logging . DEBUG ) arg_5 = logging . FileHandler ( arg_4 ) arg_5 . setFormatter ( logging . Formatter ( arg_3 ) ) else : arg_5 = NullHandler ( ) Func . addHandler ( arg_5 ) return Func

Returns how the result count compares to the query options.

        The return value is negative if too few results were found, zero if enough were found, and
        positive if too many were found.

        Returns:
            int: -1, 0, or 1.


Question: Forward the close event to every tabs contained by the windows

def Func ( arg_0 , arg_1 ) : if arg_0 . tab_widget . count ( ) == 0 : arg_1 . accept ( ) return arg_2 = arg_0 . window ( ) . windowTitle ( ) arg_3 = QtGui . QMessageBox . Cancel arg_4 = QtGui . QMessageBox . Ok if arg_0 . confirm_exit : if arg_0 . tab_widget . count ( ) > 1 : arg_5 = "Close all tabs, stop all kernels, and Quit?" else : arg_5 = "Close console, stop kernel, and Quit?" arg_6 = "Kernels not started here (e.g. notebooks) will be left alone." arg_7 = QtGui . QPushButton ( "&Quit" , arg_0 ) arg_7 . setShortcut ( 'Q' ) arg_8 = QtGui . QMessageBox ( QtGui . QMessageBox . Question , arg_2 , arg_5 ) arg_8 . setInformativeText ( arg_6 ) arg_8 . addButton ( arg_3 ) arg_8 . addButton ( arg_7 , QtGui . QMessageBox . YesRole ) arg_8 . setDefaultButton ( arg_7 ) arg_8 . setEscapeButton ( arg_3 ) arg_9 = QtGui . QPixmap ( arg_0 . _app . icon . pixmap ( QtCore . QSize ( 64 , 64 ) ) ) arg_8 . setIconPixmap ( arg_9 ) arg_10 = arg_8 . exec_ ( ) else : arg_10 = arg_4 if arg_10 == arg_3 : arg_1 . ignore ( ) return if arg_10 == arg_4 : while arg_0 . tab_widget . count ( ) >= 1 : arg_11 = arg_0 . active_frontend arg_11 . _confirm_exit = False arg_0 . close_tab ( arg_11 ) arg_1 . accept ( )

Assign MUC stanza handlers to the `self.stream`.

        :Parameters:
            - `priority`: priority for the handlers.
        :Types:
            - `priority`: `int`


Question: Checks to see if the given repo has a ReadMe . MD means it has a correct Readme recognized by GitHub .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . readme ( ) if arg_2 is not None : arg_0 . total_readmes += 1 return 'MD' if arg_0 . search_limit >= 28 : print 'Hit search limit. Sleeping for 60 sec.' time . sleep ( 60 ) arg_0 . search_limit = 0 arg_0 . search_limit += 1 arg_4 = arg_0 . logged_in_gh . search_code ( 'readme' + 'in:path repo:' + arg_1 . full_name ) try : for arg_5 in arg_4 : arg_6 = arg_5 . path [ 1 : ] if '/' not in arg_6 and 'readme' in arg_6 . lower ( ) : arg_0 . total_readmes += 1 return arg_6 return 'MISS' except ( github3 . models . GitHubError , StopIteration ) as e : return 'MISS'


Question: Randomly resize an image and corresponding keypoints . The height and width of image will be changed independently so the scale will be changed .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = ( 0.8 , 1.2 ) ) : arg_4 = arg_0 . shape [ 0 ] arg_5 = arg_0 . shape [ 1 ] arg_6 , arg_7 = arg_3 arg_8 = np . random . uniform ( arg_6 , arg_7 ) arg_9 = np . random . uniform ( arg_6 , arg_7 ) arg_10 = int ( arg_5 * arg_8 ) arg_11 = int ( arg_4 * arg_9 ) arg_12 = cv2 . resize ( arg_0 , ( arg_10 , arg_11 ) , interpolation = cv2 . INTER_AREA ) if arg_2 is not None : arg_2 = cv2 . resize ( arg_2 , ( arg_10 , arg_11 ) , interpolation = cv2 . INTER_AREA ) arg_13 = [ ] for arg_14 in arg_1 : arg_15 = [ ] for arg_16 in arg_14 : if arg_16 [ 0 ] < - 100 or arg_16 [ 1 ] < - 100 : arg_15 . append ( ( - 1000 , - 1000 ) ) continue arg_15 . append ( ( int ( arg_16 [ 0 ] * arg_8 + 0.5 ) , int ( arg_16 [ 1 ] * arg_9 + 0.5 ) ) ) arg_13 . append ( arg_15 ) if arg_2 is not None : return arg_12 , arg_13 , arg_2 else : return arg_12 , arg_13 , None

Get distribution version.

        This method is enhanced compared to original distutils implementation.
        If the version string is set to a special value then instead of using
        the actual value the real version is obtained by querying versiontools.

        If versiontools package is not installed then the version is obtained
        from the standard section of the ``PKG-INFO`` file. This file is
        automatically created by any source distribution. This method is less
        useful as it cannot take advantage of version control information that
        is automatically loaded by versiontools. It has the advantage of not
        requiring versiontools installation and that it does not depend on
        ``setup_requires`` feature of ``setuptools``.


Question: The following opens the log file of PlanarRad .

def Func ( arg_0 ) : arg_1 = open ( os . path . expanduser ( '~/.planarradpy/log/libplanarradpy.log' ) ) arg_0 . uiLog . textEdit . setPlainText ( str ( arg_1 . read ( ) ) ) arg_0 . log_window . show ( )


Question: Retrieve value from store .

def Func ( arg_0 , arg_1 , arg_2 = True ) : try : del arg_0 . store [ arg_1 ] except Exception as error : pass if arg_2 : arg_0 . flush ( )

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

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


Question: selects sub - tree events

def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 : if arg_2 [ 'type' ] == ENTER : arg_1 += 1 elif arg_2 [ 'type' ] == EXIT : if arg_1 == 0 : break arg_1 -= 1 yield arg_2

Update the profile picture for the current user.

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


Question: Parse the date range for the query

def Func ( arg_0 , arg_1 ) : return arg_0 . time_parser . parse ( arg_0 . parse_keyword ( Keyword . WHERE , arg_1 ) )

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: Called if no explicit visitor function exists for a node .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . _fields : setattr ( arg_1 , arg_2 , arg_0 . visit ( getattr ( arg_1 , arg_2 ) ) ) return arg_1

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: Trains model on a single batch

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] , arg_4 : arg_3 [ arg_5 ] ) -> None : arg_6 , arg_7 = arg_0 . _transform_batch ( arg_1 , arg_4 ) arg_0 . model_ . Func ( arg_6 , arg_7 )

Override of clean method to perform additional validation


Question: Method to refresh API tokens from ecobee

def Func ( arg_0 ) : arg_1 = 'https://api.ecobee.com/token' arg_2 = { 'grant_type' : 'refresh_token' , 'refresh_token' : arg_0 . refresh_token , 'client_id' : arg_0 . api_key } arg_3 = requests . post ( arg_1 , arg_2 = arg_2 ) if arg_3 . status_code == requests . codes . ok : arg_0 . access_token = arg_3 . json ( ) [ 'access_token' ] arg_0 . refresh_token = arg_3 . json ( ) [ 'refresh_token' ] arg_0 . write_tokens_to_file ( ) return True else : arg_0 . request_pin ( )

Return True if file matches exclude pattern.


Question: Redo selection for the name .

def Func ( arg_0 , arg_1 = "default" , arg_2 = None ) : logger . debug ( "redo" ) arg_2 = arg_2 or arg_0 . executor assert arg_0 . selection_can_redo ( arg_1 = arg_1 ) arg_3 = arg_0 . selection_histories [ arg_1 ] arg_4 = arg_0 . selection_history_indices [ arg_1 ] arg_5 = arg_3 [ arg_4 + 1 ] arg_0 . selection_history_indices [ arg_1 ] += 1 arg_0 . signal_selection_changed . emit ( arg_0 ) logger . debug ( "redo: selection history is %r, index is %r" , arg_3 , arg_4 )

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