Question: Helper which expand_dims is_accepted then applies tf . where .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if not is_namedtuple_like ( arg_1 ) : return _Func_base_case ( arg_0 , arg_1 , arg_2 , arg_3 = arg_3 ) if not isinstance ( arg_1 , type ( arg_2 ) ) : raise TypeError ( 'Type of `accepted` ({}) must be identical to ' 'type of `rejected` ({})' . format ( type ( arg_1 ) . __name__ , type ( arg_2 ) . __name__ ) ) return type ( arg_1 ) ( ** dict ( [ ( arg_4 , Func ( arg_0 , getattr ( arg_1 , arg_4 ) , getattr ( arg_2 , arg_4 ) , arg_3 = arg_3 ) ) for arg_4 in arg_1 . _fields ] ) )

Collects memory stats for specified Python program.


Question: Is event consistent with the given evidence?

def Func ( arg_0 , arg_1 ) : return every ( lambda ( k , v ) : arg_1 . get ( k , v ) == v , arg_0 . items ( ) )


Question: compute similarities in appended files

def Func ( arg_0 ) : arg_1 = defaultdict ( list ) for arg_2 , arg_3 , arg_4 , arg_5 , arg_6 in arg_0 . _iter_sims ( ) : arg_7 = arg_1 [ arg_2 ] for arg_8 in arg_7 : if ( arg_3 , arg_4 ) in arg_8 or ( arg_5 , arg_6 ) in arg_8 : arg_8 . add ( ( arg_3 , arg_4 ) ) arg_8 . add ( ( arg_5 , arg_6 ) ) break else : arg_7 . append ( { ( arg_3 , arg_4 ) , ( arg_5 , arg_6 ) } ) arg_9 = [ ] for arg_2 , arg_10 in arg_1 . items ( ) : for arg_8 in arg_10 : arg_9 . append ( ( arg_2 , arg_8 ) ) arg_9 . sort ( ) arg_9 . reverse ( ) return arg_9


Question: Print a status message about the logger .

def Func ( arg_0 ) : if arg_0 . logfile is None : print 'Logging has not been activated.' else : arg_1 = arg_0 . log_active and 'active' or 'temporarily suspended' print 'Filename       :' , arg_0 . logfname print 'Mode           :' , arg_0 . logmode print 'Output logging :' , arg_0 . log_output print 'Raw input log  :' , arg_0 . log_raw_input print 'Timestamping   :' , arg_0 . timestamp print 'State          :' , arg_1


Question: Cancel all started queries that have not yet completed

def Func ( arg_0 ) : arg_1 = arg_0 . service . jobs ( ) if ( arg_0 . running_job_id and not arg_0 . poll_job_complete ( arg_0 . running_job_id ) ) : arg_0 . log . info ( 'Attempting to cancel job : %s, %s' , arg_0 . project_id , arg_0 . running_job_id ) if arg_0 . location : arg_1 . cancel ( projectId = arg_0 . project_id , jobId = arg_0 . running_job_id , location = arg_0 . location ) . execute ( num_retries = arg_0 . num_retries ) else : arg_1 . cancel ( projectId = arg_0 . project_id , jobId = arg_0 . running_job_id ) . execute ( num_retries = arg_0 . num_retries ) else : arg_0 . log . info ( 'No running BigQuery jobs to cancel.' ) return arg_2 = 12 arg_3 = 0 arg_4 = False while arg_3 < arg_2 and not arg_4 : arg_3 = arg_3 + 1 arg_4 = arg_0 . poll_job_complete ( arg_0 . running_job_id ) if arg_4 : arg_0 . log . info ( 'Job successfully canceled: %s, %s' , arg_0 . project_id , arg_0 . running_job_id ) elif arg_3 == arg_2 : arg_0 . log . info ( "Stopping polling due to timeout. Job with id %s " "has not completed cancel and may or may not finish." , arg_0 . running_job_id ) else : arg_0 . log . info ( 'Waiting for canceled job with id %s to finish.' , arg_0 . running_job_id ) time . sleep ( 5 )


Question: Fill the entire strip with RGB color tuple

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = - 1 ) : arg_2 = max ( arg_2 , 0 ) if arg_3 < 0 or arg_3 >= arg_0 . numLEDs : arg_3 = arg_0 . numLEDs - 1 for arg_4 in range ( arg_2 , arg_3 + 1 ) : arg_0 . _set_base ( arg_4 , arg_1 )

This function will create the VM directory where a repo will be mounted, if it
    doesn't exist.  If wait_for_server is set, it will wait up to 10 seconds for
    the nfs server to start, by retrying mounts that fail with 'Connection Refused'.

    If wait_for_server is not set, it will attempt to run the mount command once


Question: Generates a set of input record

def Func ( arg_0 , arg_1 = 400 , arg_2 = 42 ) : arg_3 = [ ] for arg_4 in xrange ( arg_0 ) : arg_5 = np . zeros ( arg_1 , dtype = realDType ) for arg_4 in range ( 0 , arg_2 ) : arg_6 = np . random . random_integers ( 0 , arg_1 - 1 , 1 ) [ 0 ] arg_5 [ arg_6 ] = 1 while abs ( arg_5 . sum ( ) - arg_2 ) > 0.1 : arg_6 = np . random . random_integers ( 0 , arg_1 - 1 , 1 ) [ 0 ] arg_5 [ arg_6 ] = 1 arg_3 . append ( arg_5 ) return arg_3

Returns a dictionary with all the past baking statuses of a single book.


Question: Perform an action on the thing .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_1 not in arg_0 . available_actions : return None arg_3 = arg_0 . available_actions [ arg_1 ] if 'input' in arg_3 [ 'metadata' ] : try : validate ( arg_2 , arg_3 [ 'metadata' ] [ 'input' ] ) except ValidationError : return None arg_4 = arg_3 [ 'class' ] ( arg_0 , arg_2 = arg_2 ) arg_4 . set_href_prefix ( arg_0 . href_prefix ) arg_0 . action_notify ( arg_4 ) arg_0 . actions [ arg_1 ] . append ( arg_4 ) return arg_4


Question: Remove memory of state variables set in the command processor

def Func ( arg_0 ) : arg_0 . stack = [ ] arg_0 . curindex = 0 arg_0 . curframe = None arg_0 . thread_name = None arg_0 . frame_thread_name = None return

Extracts start row from the bookmark information


Question: Split a covariance matrix into block - diagonal marginals of given sizes .

def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = [ ] for arg_4 in arg_1 : arg_5 = arg_2 + arg_4 arg_3 . append ( arg_0 [ ... , arg_2 : arg_5 , arg_2 : arg_5 ] ) arg_2 = arg_5 return arg_3

APEv2 tag value factory.

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


Question: Hydrate Generated Python AST nodes with line numbers and column offsets if they exist in the node environment .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_5 = False ) -> arg_1 : if arg_2 . line is not None : arg_0 . node . lineno = arg_2 . line if arg_4 : for arg_8 in arg_0 . dependencies : arg_8 . lineno = arg_2 . line if arg_2 . col is not None : arg_0 . node . col_offset = arg_2 . col if arg_4 : for arg_8 in arg_0 . dependencies : arg_8 . col_offset = arg_2 . col return arg_0


Question: Return the entire source file and starting line number for an object .

def Func ( arg_0 ) : arg_1 = getsourcefile ( arg_0 ) or getfile ( arg_0 ) arg_2 = None if inspect . isframe ( arg_0 ) : arg_2 = arg_0 . f_globals else : arg_3 = getmodule ( arg_0 , arg_1 ) if arg_3 : arg_2 = arg_3 . __dict__ arg_4 = linecache . getlines ( arg_1 , arg_2 ) if not arg_4 : raise IOError ( 'could not get source code' ) if ismodule ( arg_0 ) : return arg_4 , 0 if isclass ( arg_0 ) : arg_5 = arg_0 . __name__ arg_6 = re . compile ( r'^(\s*)class\s*' + arg_5 + r'\b' ) arg_7 = [ ] for arg_8 in range ( len ( arg_4 ) ) : arg_9 = arg_6 . match ( arg_4 [ arg_8 ] ) if arg_9 : if arg_4 [ arg_8 ] [ 0 ] == 'c' : return arg_4 , arg_8 arg_7 . append ( ( arg_9 . group ( 1 ) , arg_8 ) ) if arg_7 : arg_7 . sort ( ) return arg_4 , arg_7 [ 0 ] [ 1 ] else : raise IOError ( 'could not find class definition' ) if ismethod ( arg_0 ) : arg_0 = arg_0 . im_func if isfunction ( arg_0 ) : arg_0 = arg_0 . func_code if istraceback ( arg_0 ) : arg_0 = arg_0 . tb_frame if isframe ( arg_0 ) : arg_0 = arg_0 . f_code if iscode ( arg_0 ) : if not hasattr ( arg_0 , 'co_firstlineno' ) : raise IOError ( 'could not find function definition' ) arg_6 = re . compile ( r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)' ) arg_10 = arg_6 . match arg_11 = min ( arg_0 . co_firstlineno , len ( arg_4 ) ) - 1 while arg_11 > 0 : if arg_10 ( arg_4 [ arg_11 ] ) : break arg_11 -= 1 return arg_4 , arg_11 raise IOError ( 'could not find code object' )

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: Return a dictionary consisting of the key itself

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . db . search ( Query ( ) . name == arg_1 ) if not arg_2 : return { } return arg_2 [ 0 ]

Decimal adjusts AL after subtraction.

        Adjusts the result of the subtraction of two packed BCD values to create a packed BCD result.
        The AL register is the implied source and destination operand. If a decimal borrow is detected,
        the CF and AF flags are set accordingly. This instruction is not valid in 64-bit mode.

        The SF, ZF, and PF flags are set according to the result.::

                IF (AL AND 0FH) > 9 OR AF  =  1
                THEN
                    AL  =  AL - 6;
                    CF  =  CF OR BorrowFromLastSubtraction; (* CF OR borrow from AL  =  AL - 6 *)
                    AF  =  1;
                ELSE
                    AF  =  0;
                FI;
                IF ((AL > 99H) or OLD_CF  =  1)
                THEN
                    AL  =  AL - 60H;
                    CF  =  1;

        :param cpu: current CPU.


Question: Read the user configuration

def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_0 . _config_filename = arg_1 else : try : import appdirs except ImportError : raise Exception ( "Missing dependency for determining config path. Please install " "the 'appdirs' Python module." ) arg_0 . _config_filename = appdirs . user_config_dir ( _LIBRARY_NAME , "ProfitBricks" ) + ".ini" if not arg_0 . _config : arg_0 . _config = configparser . ConfigParser ( ) arg_0 . _config . optionxform = str arg_0 . _config . read ( arg_0 . _config_filename )

Regenerates the primary or secondary access key for the specified
        storage account.

        service_name:
            Name of the storage service account.
        key_type:
            Specifies which key to regenerate. Valid values are:
            Primary, Secondary


Question: Compare vectors . Borrowed from A . Parish .

def Func ( arg_0 , arg_1 ) : if norm ( arg_0 ) > 0 and norm ( arg_1 ) > 0 : return dot ( arg_0 , arg_1 ) / ( norm ( arg_0 ) * norm ( arg_1 ) ) else : return 0.0

Enable the joint motors in this skeleton.

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

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


Question: Retrieve an estimated time correction offset for the given stream .

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


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

def Func ( arg_0 , arg_1 ) : arg_2 = "\t server {\n" arg_2 += "\t \t {}\n" . format ( _nginx_max_file_size_string ( ) ) arg_2 += "\t \t {}\n" . format ( _nginx_listen_string ( arg_0 ) ) arg_2 += "\t \t {}\n" . format ( _nginx_server_name_string ( arg_0 ) ) arg_2 += _nginx_location_spec ( arg_0 , arg_1 ) arg_2 += _custom_502_page ( ) arg_2 += "\t }\n" return arg_2


Question: Create a callable that will invoke the given remote function . The stub will return a deferred even if the remote function does not .

def Func ( arg_0 , arg_1 ) : assert arg_0 . _opened , "RPC System is not opened" logging . debug ( "Func(%s)" % repr ( arg_1 ) ) arg_2 = urlparse . urlparse ( arg_1 ) arg_3 = arg_2 . scheme arg_4 = arg_2 . path . split ( "/" ) if arg_3 != "anycall" : raise ValueError ( "Not an anycall URL: %s" % repr ( arg_1 ) ) if len ( arg_4 ) != 3 or arg_4 [ 0 ] != "" or arg_4 [ 1 ] != "functions" : raise ValueError ( "Not an URL for a remote function: %s" % repr ( arg_1 ) ) try : arg_5 = uuid . UUID ( arg_4 [ 2 ] ) except ValueError : raise ValueError ( "Not a valid URL for a remote function: %s" % repr ( arg_1 ) ) return _RPCFunctionStub ( arg_2 . netloc , arg_5 , arg_0 )

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: Given a frame and a compiled function code find the corresponding function object within the frame .

def Func ( arg_0 , arg_1 ) : def find_code ( arg_2 , arg_3 = 0 ) : if arg_3 > 3 : return for arg_4 in arg_2 : if arg_4 is None : continue arg_5 = None if hasattr ( arg_4 , "__code__" ) and arg_4 . __code__ == arg_1 : arg_5 = arg_4 elif isinstance ( arg_4 , type ) or isinstance ( arg_4 , ModuleType ) : try : arg_5 = find_code ( ( getattr ( arg_4 , n , None ) for n in dir ( arg_4 ) ) , arg_3 + 1 ) except Exception : continue elif isinstance ( arg_4 , ( list , tuple , set ) ) : arg_5 = find_code ( arg_4 , arg_3 + 1 ) elif isinstance ( arg_4 , dict ) : arg_5 = find_code ( arg_4 . values ( ) , arg_3 + 1 ) if arg_5 : return arg_5 return find_code ( arg_0 . f_locals . values ( ) ) or find_code ( arg_0 . f_globals . values ( ) )

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


Question: Convert unixtime to unixtime on GTFS start - of - day .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . set_current_process_time_zone ( ) arg_1 = time . mktime ( time . localtime ( arg_1 ) [ : 3 ] + ( 12 , 00 , 0 , 0 , 0 , - 1 ) ) - 43200 set_process_timezone ( arg_2 ) return arg_1

Population parameter vals == average member parameter vals


Question: Use this if you want to clone an existing contact and replace its data with new user input in one step .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_1 = arg_0 ( arg_1 . address_book , arg_1 . filename , arg_1 . supported_private_objects , None , arg_3 ) arg_1 . _process_user_input ( arg_2 ) return arg_1

Poll the queues that the worker can use to communicate with the
        supervisor, until all the workers are done and all the queues are
        empty.  Handle messages as they appear.


Question: Associate a notification template from this workflow .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_0 . _assoc ( 'notification_templates_%s' % arg_3 , arg_1 , arg_2 )

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: L1 and L2 rules

def Func ( arg_0 , arg_1 ) : arg_2 = True arg_3 = arg_0 [ 'chars' ] for arg_4 in arg_3 [ : : - 1 ] : if arg_4 [ 'orig' ] in ( 'B' , 'S' ) : arg_4 [ 'level' ] = arg_0 [ 'base_level' ] arg_2 = True elif arg_2 and arg_4 [ 'orig' ] in ( 'BN' , 'WS' ) : arg_4 [ 'level' ] = arg_0 [ 'base_level' ] else : arg_2 = False arg_5 = len ( arg_3 ) arg_6 = arg_11 = 0 arg_7 = 0 arg_8 = EXPLICIT_LEVEL_LIMIT for arg_9 in range ( arg_5 ) : arg_4 = arg_3 [ arg_9 ] arg_10 = arg_4 [ 'level' ] if arg_10 > arg_7 : arg_7 = arg_10 if arg_10 % 2 and arg_10 < arg_8 : arg_8 = arg_10 if arg_4 [ 'orig' ] == 'B' or arg_9 == arg_5 - 1 : arg_11 = arg_9 if arg_4 [ 'orig' ] == 'B' : arg_11 -= 1 reverse_contiguous_sequence ( arg_3 , arg_6 , arg_11 , arg_7 , arg_8 ) arg_6 = arg_9 + 1 arg_7 = 0 arg_8 = EXPLICIT_LEVEL_LIMIT if arg_1 : debug_storage ( arg_0 )

Return the class corresponding to the given temporalImp string


Question: Find a webhook by name .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . webhooks . list ( ) : if arg_2 . name == arg_1 : print ( "Deleting Webhook:" , arg_2 . name , arg_2 . targetUrl ) arg_0 . webhooks . delete ( arg_2 . id )

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


Question: Split the extension from a pathname .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . rfind ( arg_1 ) if arg_2 : arg_5 = arg_0 . rfind ( arg_2 ) arg_4 = max ( arg_4 , arg_5 ) arg_6 = arg_0 . rfind ( arg_3 ) if arg_6 > arg_4 : arg_7 = arg_4 + 1 while arg_7 < arg_6 : if arg_0 [ arg_7 ] != arg_3 : return arg_0 [ : arg_6 ] , arg_0 [ arg_6 : ] arg_7 += 1 return arg_0 , ''

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


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

def Func ( arg_0 , arg_1 , arg_2 ) : return [ arg_3 . unmasked_blurred_image_of_galaxies_from_psf ( arg_1 , arg_2 ) for arg_3 in arg_0 ]


Question: Minimize using Hessian - informed proximal gradient descent .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = 1 , arg_6 = 1 , arg_7 = None , arg_8 = None ) : arg_9 = [ arg_1 , arg_3 , arg_4 , arg_5 , arg_6 , arg_2 , arg_7 , ] , with tf . compat . v1 . name_scope ( arg_8 , 'Func' , arg_9 ) : def _loop_cond ( arg_1 , arg_10 , arg_11 ) : del arg_1 return tf . logical_and ( arg_11 < arg_5 , tf . logical_not ( arg_10 ) ) def _loop_body ( arg_1 , arg_10 , arg_11 ) : arg_12 , arg_13 , arg_14 = arg_0 ( arg_1 ) arg_1 , arg_10 , arg_15 = Func_one_step ( gradient_unregularized_loss = arg_12 , hessian_unregularized_loss_outer = arg_13 , hessian_unregularized_loss_middle = arg_14 , arg_1 = arg_1 , arg_3 = arg_3 , arg_4 = arg_4 , maximum_full_sweeps = arg_6 , arg_2 = arg_2 , arg_7 = arg_7 ) return arg_1 , arg_10 , arg_11 + 1 return tf . while_loop ( cond = _loop_cond , body = _loop_body , loop_vars = [ arg_1 , tf . zeros ( [ ] , np . bool , arg_8 = 'converged' ) , tf . zeros ( [ ] , np . int32 , arg_8 = 'iter' ) , ] )

This method is called before first step of simulation.


Question: Returns the lowest bit num from a given bit pattern . Returns None if no bits set .

def Func ( arg_0 ) : if arg_0 == 0 : return None arg_1 = 0 while ( arg_0 & 1 ) == 0 : arg_0 = arg_0 >> 1 arg_1 += 1 if arg_1 > 7 : arg_1 = 0 break return arg_1


Question: Set the focus to position or raise IndexError .

def Func ( arg_0 , arg_1 ) : arg_0 . _focus_position = arg_1 arg_0 . _modified ( ) try : arg_0 . next_position ( arg_1 ) except IndexError : arg_0 . _is_scrolling = False else : arg_0 . _is_scrolling = True

Convert a ChaLearn Cause effect pairs challenge format into numpy.ndarray.

    :param filename: path of the file to read or DataFrame containing the data
    :type filename: str or pandas.DataFrame
    :param scale: Scale the data
    :type scale: bool
    :param kwargs: parameters to be passed to pandas.read_csv
    :return: Dataframe composed of (SampleID, a (numpy.ndarray) , b (numpy.ndarray))
    :rtype: pandas.DataFrame


Question: Update the information for an institute

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None ) : arg_9 = arg_9 or False arg_10 = arg_0 . institute ( arg_1 ) if not arg_10 : raise IntegrityError ( "Institute {} does not exist in database" . format ( arg_1 ) ) arg_11 = { } arg_12 = arg_10 if arg_2 : arg_13 = arg_0 . user ( arg_2 ) if not arg_13 : raise IntegrityError ( "user {} does not exist in database" . format ( arg_2 ) ) LOG . info ( "Updating sanger recipients for institute: {0} with {1}" . format ( arg_1 , arg_2 ) ) arg_11 [ '$push' ] = { 'sanger_recipients' : arg_6 } if arg_6 : LOG . info ( "Removing sanger recipient {0} from institute: {1}" . format ( arg_6 , arg_1 ) ) arg_11 [ '$pull' ] = { 'sanger_recipients' : arg_6 } if arg_3 : LOG . info ( "Updating coverage cutoff for institute: {0} to {1}" . format ( arg_1 , arg_3 ) ) arg_11 [ '$set' ] = { 'coverage_cutoff' : arg_3 } if arg_4 : LOG . info ( "Updating frequency cutoff for institute: {0} to {1}" . format ( arg_1 , arg_4 ) ) if not '$set' in arg_11 : arg_11 [ '$set' ] = { } arg_11 [ '$set' ] = { 'frequency_cutoff' : arg_4 } if arg_5 : LOG . info ( "Updating display name for institute: {0} to {1}" . format ( arg_1 , arg_5 ) ) if not '$set' in arg_11 : arg_11 [ '$set' ] = { } arg_11 [ '$set' ] = { 'display_name' : arg_5 } if arg_7 : if arg_8 : arg_8 = list ( arg_8 ) arg_14 = { } if arg_9 : arg_14 = arg_10 . get ( 'phenotype_groups' , PHENOTYPE_GROUPS ) for arg_15 , arg_16 in enumerate ( arg_7 ) : arg_17 = arg_0 . hpo_term ( arg_16 ) if not arg_17 : raise IntegrityError ( "Term {} does not exist" . format ( arg_16 ) ) arg_18 = arg_17 [ 'hpo_id' ] arg_19 = arg_17 [ 'description' ] arg_20 = None if arg_8 : arg_20 = arg_8 [ arg_15 ] arg_14 [ arg_16 ] = { 'name' : arg_19 , 'abbr' : arg_20 } arg_11 [ '$set' ] = { 'phenotype_groups' : arg_14 } if arg_11 : if not '$set' in arg_11 : arg_11 [ '$set' ] = { } arg_11 [ '$set' ] [ 'updated_at' ] = datetime . now ( ) arg_12 = arg_0 . institute_collection . find_one_and_update ( { '_id' : arg_1 } , arg_11 , return_document = pymongo . ReturnDocument . AFTER ) LOG . info ( "Institute updated" ) return arg_12

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


Question: Execute the wrapped code accepting a prompt optionally responding to the prompt .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : with arg_0 . driver . accept_modal ( "prompt" , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) : yield

Removes a NIC from the load balancer.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      loadbalancer_id: The unique ID of the load balancer.
        :type       loadbalancer_id: ``str``

        :param      nic_id: The unique ID of the NIC.
        :type       nic_id: ``str``


Question: Cut a clip from a video .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = 'info' , arg_7 = False , ** arg_8 ) : arg_9 = { 'log_level' : arg_6 } if arg_4 is None : arg_9 [ 'vcodec' ] = 'copy' if arg_5 is None : arg_9 [ 'acodec' ] = 'copy' if arg_2 : arg_9 [ 'ss' ] = arg_2 else : arg_2 = 0 if arg_3 : arg_9 [ 't' ] = arg_3 - arg_2 convert_video ( arg_0 , arg_1 , arg_7 , ** arg_9 )


Question: Computes the FOLLOW set for every non - terminal in the grammar .

def Func ( arg_0 ) : arg_0 . _follow [ arg_0 . start_symbol ] . add ( END_OF_INPUT ) while True : arg_1 = False for arg_2 , arg_3 in arg_0 . nonterminals . items ( ) : for arg_4 in arg_3 : for arg_5 , arg_6 in enumerate ( arg_4 . rhs ) : if arg_6 not in arg_0 . nonterminals : continue arg_7 = arg_0 . first ( arg_4 . rhs [ arg_5 + 1 : ] ) arg_8 = arg_7 - set ( [ EPSILON ] ) if EPSILON in arg_7 or arg_5 == ( len ( arg_4 . rhs ) - 1 ) : arg_8 |= arg_0 . _follow [ arg_2 ] if arg_8 - arg_0 . _follow [ arg_6 ] : arg_0 . _follow [ arg_6 ] |= arg_8 arg_1 = True if not arg_1 : break

This method increases the permanence values of synapses of columns whose
    activity level has been too low. Such columns are identified by having an
    overlap duty cycle that drops too much below those of their peers. The
    permanence values for such columns are increased.


Question: Register the Selenium specific driver implementation .

def Func ( ) : FuncDriver ( ISelenium , Selenium , class_implements = [ Firefox , Chrome , Ie , Edge , Opera , Safari , BlackBerry , PhantomJS , Android , Remote , EventFiringWebDriver , ] , )

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


Question: Return a new Streamlet by outer join_streamlet with this streamlet

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : from heronpy . streamlet . impl . joinbolt import JoinStreamlet , JoinBolt arg_4 = JoinStreamlet ( JoinBolt . OUTER , arg_2 , arg_3 , arg_0 , arg_1 ) arg_0 . _add_child ( arg_4 ) arg_1 . _add_child ( arg_4 ) return arg_4

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: Retrieve the Engine - level model params from a Swarm model

def Func ( arg_0 ) : arg_1 = ClientJobsDAO . get ( ) ( arg_2 , arg_3 ) = arg_1 . modelsGetFields ( arg_0 , [ "jobId" , "genDescription" ] ) ( arg_4 , ) = arg_1 . jobGetFields ( arg_2 , [ "genBaseDescription" ] ) arg_5 = tempfile . mkdtemp ( ) try : arg_6 = os . path . join ( arg_5 , "base.py" ) with open ( arg_6 , mode = "wb" ) as f : f . write ( arg_4 ) arg_7 = os . path . join ( arg_5 , "description.py" ) with open ( arg_7 , mode = "wb" ) as f : f . write ( arg_3 ) arg_8 = helpers . getExperimentDescriptionInterfaceFromModule ( helpers . loadExperimentDescriptionScriptFromDir ( arg_5 ) ) return json . dumps ( dict ( modelConfig = arg_8 . getModelDescription ( ) , inferenceArgs = arg_8 . getModelControl ( ) . get ( "inferenceArgs" , None ) ) ) finally : shutil . rmtree ( arg_5 , ignore_errors = True )

Return an existing or new ConversationWidget.


Question: Returns a list of degree vectors one for each input and hidden layer .

def Func ( arg_0 , arg_1 = None , arg_2 = "left-to-right" , arg_3 = "equal" ) : arg_2 = _create_input_order ( arg_0 , arg_2 ) arg_4 = [ arg_2 ] if arg_1 is None : arg_1 = [ ] for arg_5 in arg_1 : if isinstance ( arg_3 , six . string_types ) : if arg_3 == "random" : arg_4 . append ( np . random . randint ( low = min ( np . min ( arg_4 [ - 1 ] ) , arg_0 - 1 ) , high = arg_0 , size = arg_5 ) ) elif arg_3 == "equal" : arg_6 = min ( np . min ( arg_4 [ - 1 ] ) , arg_0 - 1 ) arg_4 . append ( np . maximum ( arg_6 , np . ceil ( np . arange ( 1 , arg_5 + 1 ) * ( arg_0 - 1 ) / float ( arg_5 + 1 ) ) . astype ( np . int32 ) ) ) else : raise ValueError ( 'Invalid hidden order: "{}".' . format ( arg_3 ) ) return arg_4

Override of clean method to perform additional validation


Question: Ensure client is authorized to use the response type requested .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , * arg_5 , ** arg_6 ) : if arg_2 not in ( 'code' , 'token' ) : return False if hasattr ( arg_3 , 'allowed_response_types' ) : return arg_2 in arg_3 . allowed_response_types return True

Converts py_zipkin's annotations dict to protobuf.

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


Question: Decrypt a message using this double ratchet session .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_3 == None : arg_3 = arg_0 . __ad arg_4 = arg_0 . __decryptSavedMessage ( arg_1 , arg_2 , arg_3 ) if arg_4 : return arg_4 if arg_0 . triggersStep ( arg_2 . dh_pub ) : arg_0 . __saveMessageKeys ( arg_2 . pn ) arg_0 . step ( arg_2 . dh_pub ) arg_0 . __saveMessageKeys ( arg_2 . n ) return arg_0 . __decrypt ( arg_1 , arg_0 . __skr . nextDecryptionKey ( ) , arg_2 , arg_3 )

Overriding the default JSONEncoder.default for NDB support.


Question: Returns dozscale and particle list of update

def Func ( arg_0 , arg_1 ) : arg_2 = False arg_3 = [ ] for arg_4 in listify ( arg_1 ) : arg_5 , arg_6 = arg_0 . _p2i ( arg_4 ) arg_3 . append ( arg_6 ) arg_2 = arg_2 or arg_5 == 'zscale' arg_3 = set ( arg_3 ) return arg_2 , arg_3

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


Question: Asynchronous connection handler . Processes each line from the socket .

def Func ( arg_0 , arg_1 , * arg_2 ) : arg_0 . shell . stdout . write ( arg_0 . shell . prompt ) arg_3 = arg_0 . shell . stdin . readline ( ) if not len ( arg_3 ) : arg_3 = 'EOF' return False else : arg_3 = arg_3 . rstrip ( '\r\n' ) arg_3 = arg_0 . shell . precmd ( arg_3 ) arg_4 = arg_0 . shell . onecmd ( arg_3 ) arg_4 = arg_0 . shell . postcmd ( arg_4 , arg_3 ) arg_0 . shell . stdout . flush ( ) arg_0 . shell . postloop ( ) if arg_4 : arg_0 . shell = None arg_1 . close ( ) return not arg_4

Operates on item_dict

        Promotes the resource_name and resource_type fields to the
        top-level of the serialization so they can be printed as columns.
        Also makes a copies name field to type, which is a default column.


Question: Generate a training batch for the Skip - Gram model .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0 ) : if arg_1 % arg_2 != 0 : raise Exception ( "batch_size should be able to be divided by num_skips." ) if arg_2 > 2 * arg_3 : raise Exception ( "num_skips <= 2 * skip_window" ) arg_5 = np . ndarray ( shape = ( arg_1 ) , dtype = np . int32 ) arg_6 = np . ndarray ( shape = ( arg_1 , 1 ) , dtype = np . int32 ) arg_7 = 2 * arg_3 + 1 arg_8 = collections . deque ( maxlen = arg_7 ) for arg_9 in range ( arg_7 ) : arg_8 . append ( arg_0 [ arg_4 ] ) arg_4 = ( arg_4 + 1 ) % len ( arg_0 ) for arg_10 in range ( arg_1 // arg_2 ) : arg_11 = arg_3 arg_12 = [ arg_3 ] for arg_13 in range ( arg_2 ) : while arg_11 in arg_12 : arg_11 = random . randint ( 0 , arg_7 - 1 ) arg_12 . append ( arg_11 ) arg_5 [ arg_10 * arg_2 + arg_13 ] = arg_8 [ arg_3 ] arg_6 [ arg_10 * arg_2 + arg_13 , 0 ] = arg_8 [ arg_11 ] arg_8 . append ( arg_0 [ arg_4 ] ) arg_4 = ( arg_4 + 1 ) % len ( arg_0 ) return arg_5 , arg_6 , arg_4

Return a Fmt representation of Translator for pretty-printing


Question: Will delete the entities that match at the time the query is executed .

def Func ( arg_0 , arg_1 = 100 ) : from . columns import MODELS_REFERENCED if not arg_0 . _model . _no_fk or arg_0 . _model . _namespace in MODELS_REFERENCED : raise QueryError ( "Can't Func entities of models with foreign key relationships" ) arg_2 = [ ] arg_3 = 0 for arg_4 in arg_0 . iter_result ( pagesize = arg_1 ) : arg_2 . append ( arg_4 ) arg_3 += 1 if arg_3 >= arg_1 : session . Func ( arg_2 ) del arg_2 [ : ] arg_3 = 0 if arg_2 : session . Func ( arg_2 )

Allocate or reallocate a floating IP.

    :param context: neutron api request context.
    :param content: dictionary describing the floating ip, with keys
        as listed in the RESOURCE_ATTRIBUTE_MAP object in
        neutron/api/v2/attributes.py.  All keys will be populated.

    :returns: Dictionary containing details for the new floating IP.  If values
        are declared in the fields parameter, then only those keys will be
        present.


Question: Returns all of the items from queryset where the user has a product invoking that item s condition in one of their carts .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Q ( enabling_products__productitem__cart__user = arg_2 ) arg_4 = commerce . Cart . STATUS_RELEASED arg_5 = commerce . Cart . STATUS_PAID arg_6 = commerce . Cart . STATUS_ACTIVE arg_7 = Q ( enabling_products__productitem__cart__status = arg_4 ) arg_8 = ~ ( Q ( enabling_products__productitem__cart__status = arg_5 ) | Q ( enabling_products__productitem__cart__status = arg_6 ) ) arg_1 = arg_1 . filter ( arg_3 ) arg_1 = arg_1 . exclude ( arg_7 & arg_8 ) return arg_1

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


Question: Invokes a contract with given parameters and returns the result .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = encode_invocation_params ( arg_2 ) arg_5 = arg_0 . _call ( JSONRPCMethods . INVOKE . value , [ arg_1 , arg_4 , ] , ** arg_3 ) return decode_invocation_result ( arg_5 )

Generates and writes the media pages for all media in the gallery


Question: show basic info about ABF class variables .

def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_3 = "\n### ABF INFO ###\n" arg_4 = { } for arg_5 in sorted ( dir ( arg_0 ) ) : if arg_5 in [ 'cm' , 'evIs' , 'colormap' , 'dataX' , 'dataY' , 'protoX' , 'protoY' ] : continue if "_" in arg_5 : continue arg_6 = getattr ( arg_0 , arg_5 ) if type ( arg_6 ) is list and len ( arg_6 ) > 5 : continue arg_7 = str ( type ( arg_6 ) ) . split ( "'" ) [ 1 ] if "method" in arg_7 or "neo." in arg_7 : continue if arg_5 in [ "header" , "MT" ] : continue arg_3 += "%s <%s> %s\n" % ( arg_5 , arg_7 , arg_6 ) arg_4 [ arg_5 ] = arg_6 if arg_1 : print ( ) for arg_8 in arg_3 . split ( "\n" ) : if len ( arg_8 ) < 3 : continue print ( "   " , arg_8 ) print ( ) if arg_2 : return arg_4 return arg_3

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

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


Question: Returns true if the host is reachable . In some cases it may not be reachable a tunnel must be used .

def Func ( arg_0 ) : for arg_1 in arg_0 . hostportlist : try : socket . create_connection ( arg_1 , StateManager . TIMEOUT_SECONDS ) return True except : LOG . info ( "StateManager %s Unable to connect to host: %s port %i" % ( arg_0 . name , arg_1 [ 0 ] , arg_1 [ 1 ] ) ) continue return False

Overriding the default JSONEncoder.default for NDB support.


Question: Return formatted traceback .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = 5 ) : arg_6 = arg_0 . structured_traceback ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) return arg_0 . stb2Func ( arg_6 )

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: Prompts the user to save an SVG document to disk .

def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_0 , unicode ) : arg_0 = arg_0 . encode ( 'utf-8' ) arg_2 = QtGui . QFileDialog ( arg_1 , 'Save SVG Document' ) arg_2 . setAcceptMode ( QtGui . QFileDialog . AcceptSave ) arg_2 . setDefaultSuffix ( 'svg' ) arg_2 . setNameFilter ( 'SVG document (*.svg)' ) if arg_2 . exec_ ( ) : arg_3 = arg_2 . selectedFiles ( ) [ 0 ] arg_4 = open ( arg_3 , 'w' ) try : arg_4 . write ( arg_0 ) finally : arg_4 . close ( ) return arg_3 return None

Selects an open lswitch for a network.

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


Question: Decorator to log the shapes of input and output dataframes

def Func ( arg_0 ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def wrapper ( * arg_2 , ** arg_3 ) : arg_4 = _get_dfs_shapes ( * arg_2 , ** arg_3 ) arg_5 = arg_1 ( * arg_2 , ** arg_3 ) arg_6 = _get_dfs_shapes ( arg_5 ) _Func ( arg_0 , arg_1 . __name__ , arg_4 , arg_6 ) return arg_5 return wrapper return decorator


Question: Check if run_id is stored in DynamoDB table . Return True if run_id is stored or False otherwise .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_item ( TableName = arg_1 , Key = { DYNAMODB_RUNID_ATTRIBUTE : { 'S' : arg_2 } } ) return arg_3 . get ( 'Item' ) is not None

Decorator for methods accepting old_path and new_path.


Question: Helper method to parse a full or partial path and return a full path as well as a dict containing path parts .

def Func ( arg_0 , arg_1 , ** arg_2 ) : from solvebio . resource . vault import Vault arg_3 = arg_2 . pop ( 'client' , None ) or arg_0 . _client or client if not arg_1 : raise Exception ( 'Invalid path: ' , 'Full path must be in one of the following formats: ' '"vault:/path", "domain:vault:/path", or "~/path"' ) arg_4 = arg_2 . get ( 'vault' ) or arg_1 try : arg_5 , arg_6 = Vault . Func ( arg_4 , client = arg_3 ) except Exception as err : raise Exception ( 'Could not determine vault from "{0}": {1}' . format ( arg_4 , err ) ) if arg_2 . get ( 'path' ) : arg_1 = '{0}:/{1}' . format ( arg_5 , arg_2 [ 'path' ] ) arg_7 = arg_0 . PATH_RE . match ( arg_1 ) if arg_7 : arg_8 = arg_7 . groupdict ( ) [ 'path' ] else : raise Exception ( 'Cannot find a valid object path in "{0}". ' 'Full path must be in one of the following formats: ' '"vault:/path", "domain:vault:/path", or "~/path"' . format ( arg_1 ) ) arg_8 = re . sub ( '//+' , '/' , arg_8 ) if arg_8 != '/' : arg_8 = arg_8 . rstrip ( '/' ) arg_6 [ 'path' ] = arg_8 arg_1 = '{domain}:{vault}:{path}' . format ( ** arg_6 ) arg_6 [ 'full_path' ] = arg_1 return arg_1 , arg_6

Compute the yticks labels of this grid_stack, used for plotting the y-axis ticks when visualizing an image \


Question: Returns the lowest indices in each string in a column where the provided substring is fully contained between within a sample . If the substring is not found - 1 is returned . It is the same as str . find .

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = None ) : return str_find ( arg_0 , arg_1 , arg_2 , arg_3 )

Show an image.

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


Question: Handle selection of item in listing .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _acceptButton . setEnabled ( True ) del arg_0 . _selected [ : ] arg_3 = arg_0 . _filesystemWidget . model ( ) . item ( arg_1 ) arg_0 . _selected . append ( arg_3 . path )

Decorator for methods accepting old_path and new_path.


Question: Construct activity endpoint from host athlete name and filename

def Func ( arg_0 , arg_1 , arg_2 ) : return '{host}{athlete}/activity/{filename}' . format ( host = arg_0 . host , arg_1 = quote_plus ( arg_1 ) , arg_2 = 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: Program main .

def Func ( ) : arg_0 = parse_options ( ) arg_1 , arg_2 = create_output ( get_status ( arg_0 ) , arg_0 ) sys . stdout . write ( arg_1 ) sys . exit ( arg_2 )


Question: Calls MuTect to perform variant analysis

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 ) : arg_10 = arg_0 . fileStore . getLocalTempDir ( ) arg_11 = [ arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_7 , arg_6 , arg_8 , arg_9 ] arg_12 = [ 'normal.bam' , 'normal.bai' , 'tumor.bam' , 'tumor.bai' , 'ref.fasta' , 'ref.fasta.fai' , 'ref.dict' , 'cosmic.vcf' , 'dbsnp.vcf' ] for arg_13 , arg_14 in zip ( arg_11 , arg_12 ) : arg_0 . fileStore . readGlobalFile ( arg_13 , os . path . join ( arg_10 , arg_14 ) ) arg_15 = [ '--analysis_type' , 'MuTect' , '--reference_sequence' , 'ref.fasta' , '--cosmic' , '/data/cosmic.vcf' , '--dbsnp' , '/data/dbsnp.vcf' , '--input_file:normal' , '/data/normal.bam' , '--input_file:tumor' , '/data/tumor.bam' , '--tumor_lod' , str ( 10 ) , '--initial_tumor_lod' , str ( 4.0 ) , '--out' , 'mutect.out' , '--coverage_file' , 'mutect.cov' , '--vcf' , 'mutect.vcf' ] dockerCall ( arg_0 = arg_0 , workDir = arg_10 , arg_15 = arg_15 , tool = 'quay.io/ucsc_cgl/mutect:1.1.7--e8bf09459cf0aecb9f55ee689c2b2d194754cbd3' ) arg_16 = [ 'mutect.vcf' , 'mutect.cov' , 'mutect.out' ] arg_17 = [ os . path . join ( arg_10 , x ) for x in arg_16 ] tarball_files ( 'mutect.tar.gz' , file_paths = arg_17 , output_dir = arg_10 ) return arg_0 . fileStore . writeGlobalFile ( os . path . join ( arg_10 , 'mutect.tar.gz' ) )

Renew the message lock.

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

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


Question: Apply some HTML highlighting to the contents . This can t be done in the

def Func ( arg_0 ) : arg_0 = escape ( arg_0 ) arg_0 = arg_0 . replace ( ' <iterator object>' , " <<var>this object can be used in a 'for' loop</var>>" ) arg_0 = arg_0 . replace ( ' <dynamic item>' , ' <<var>this object may have extra field names</var>>' ) arg_0 = arg_0 . replace ( ' <dynamic attribute>' , ' <<var>this object may have extra field names</var>>' ) arg_0 = RE_PROXY . sub ( '\g<1><<var>proxy object</var>>' , arg_0 ) arg_0 = RE_FUNCTION . sub ( '\g<1><<var>object method</var>>' , arg_0 ) arg_0 = RE_GENERATOR . sub ( "\g<1><<var>generator, use 'for' to traverse it</var>>" , arg_0 ) arg_0 = RE_OBJECT_ADDRESS . sub ( '\g<1><<var>\g<2> object</var>>' , arg_0 ) arg_0 = RE_MANAGER . sub ( '\g<1><<var>manager, use .all to traverse it</var>>' , arg_0 ) arg_0 = RE_CLASS_REPR . sub ( '\g<1><<var>\g<2> class</var>>' , arg_0 ) arg_0 = RE_REQUEST_FIELDNAME . sub ( '\g<1>:\n   \g<2>: ' , arg_0 ) arg_0 = RE_REQUEST_CLEANUP1 . sub ( '\g<1>' , arg_0 ) arg_0 = RE_REQUEST_CLEANUP2 . sub ( ')' , arg_0 ) return mark_safe ( arg_0 )

Removes the specfied course from the specified organization


Question: Construct the point record by reading the points from the stream

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_2 . dtype arg_5 = bytearray ( arg_1 . read ( arg_3 * arg_4 . itemsize ) ) try : arg_6 = np . frombuffer ( arg_5 , dtype = arg_4 , arg_3 = arg_3 ) except ValueError : arg_7 = arg_3 * arg_4 . itemsize if len ( arg_5 ) % arg_4 . itemsize != 0 : arg_8 = arg_7 - len ( arg_5 ) raise_not_enough_bytes_error ( arg_7 , arg_8 , len ( arg_5 ) , arg_4 , ) else : arg_9 = len ( arg_5 ) // arg_4 . itemsize logger . critical ( "Expected {} points, there are {} ({} missing)" . format ( arg_3 , arg_9 , arg_3 - arg_9 ) ) arg_6 = np . frombuffer ( arg_5 , dtype = arg_4 , arg_3 = arg_9 ) return arg_0 ( arg_6 , arg_2 )

Checks if a data is csr, csc, bsr, or dia Scipy sparse matrix


Question: Returns the coach ID for the team s OC in a given year .

def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_0 . _year_info_pq ( arg_1 , 'Offensive Coordinator' ) ( 'a' ) if arg_2 : return arg_2 . attr [ 'href' ] except ValueError : return None

Click the right mouse button without modifiers pressed.

        Parameters: coordinates to click on scren (tuple (x, y))
        Returns: None


Question: Flattens a nested dictionary .

def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in arg_0 . items ( ) : if isinstance ( arg_4 , dict ) : arg_5 = Func ( arg_4 , arg_1 ) for arg_6 , arg_7 in arg_5 . items ( ) : arg_8 = arg_3 + arg_1 + arg_6 arg_2 [ arg_8 ] = arg_7 else : arg_2 [ arg_3 ] = arg_4 return arg_2


Question: Parse a datetime to a unix timestamp .

def Func ( arg_0 , arg_1 = None ) : if arg_1 : return _Func_formats . get ( arg_1 , lambda v : Func_fmt ( v , arg_1 ) ) ( arg_0 ) arg_2 = len ( arg_0 ) if 19 <= arg_2 <= 24 and arg_0 [ 3 ] == " " : try : return Func_d_b_Y_H_M_S ( arg_0 ) except ( KeyError , ValueError , OverflowError ) : pass if 30 <= arg_2 <= 31 : try : return Func_a__d_b_Y_H_M_S_z ( arg_0 ) except ( KeyError , ValueError , OverflowError ) : pass if arg_2 == 14 : try : return Func_YmdHMS ( arg_0 ) except ( ValueError , OverflowError ) : pass try : return Func_epoch ( arg_0 ) except ValueError : pass return Func_any ( arg_0 )

Compares and exchanges.

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

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

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

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


Question: Return an argument list node that takes only self .

def Func ( arg_0 ) : return ast . arguments ( args = [ ast . arg ( arg = "self" ) ] , defaults = [ ] , kw_defaults = [ ] , kwonlyargs = [ ] , )

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


Question: Stop this client .

def Func ( arg_0 ) : arg_0 . t . Func ( ) arg_0 . factory . FuncTrying ( ) arg_0 . connector . disconnect ( )


Question: Return byte - size of a memoryview or buffer .

def Func ( arg_0 ) : if isinstance ( arg_0 , memoryview ) : if PY3 : return arg_0 . nbytes else : arg_1 = arg_0 . itemsize for arg_2 in arg_0 . shape : arg_1 *= arg_2 return arg_1 else : return len ( arg_0 )

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


Question: Create a new DataItem .

def Func ( arg_0 ) : models . DataItem . create ( content = '' . join ( random . choice ( string . ascii_uppercase + string . digits ) for arg_1 in range ( 20 ) ) ) return muffin . HTTPFound ( '/' )


Question: Creates a db file with the core schema .

def Func ( arg_0 , arg_1 = False , arg_2 = False , ** arg_3 ) : if arg_0 . fname and arg_0 . fname . exists ( ) : raise ValueError ( 'db file already exists, use force=True to overFunc' ) with arg_0 . connection ( ) as db : for arg_4 in arg_0 . tables : db . execute ( arg_4 . sql ( translate = arg_0 . translate ) ) db . execute ( 'PRAGMA foreign_keys = ON;' ) db . commit ( ) arg_5 = defaultdict ( list ) for arg_6 in arg_0 . tables : if arg_6 . name not in arg_3 : continue arg_7 , arg_8 = [ ] , [ ] arg_9 = { c . name : c for c in arg_6 . columns } for arg_10 , arg_11 in enumerate ( arg_3 [ arg_6 . name ] ) : arg_12 = arg_11 [ arg_6 . primary_key [ 0 ] ] if arg_6 . primary_key and len ( arg_6 . primary_key ) == 1 else None arg_13 = [ ] for arg_14 , arg_15 in arg_11 . items ( ) : if arg_14 in arg_6 . many_to_many : assert arg_12 arg_16 = arg_6 . many_to_many [ arg_14 ] arg_17 = tuple ( [ arg_16 . name ] + [ c . name for c in arg_16 . columns ] ) for arg_18 in arg_15 : arg_19 , arg_20 = arg_0 . association_table_context ( arg_6 , arg_14 , arg_18 ) arg_5 [ arg_17 ] . append ( ( arg_12 , arg_19 , arg_20 ) ) else : arg_21 = arg_9 [ arg_14 ] if isinstance ( arg_15 , list ) : arg_15 = ( arg_21 . separator or ';' ) . join ( arg_21 . convert ( arg_18 ) for arg_18 in arg_15 ) else : arg_15 = arg_21 . convert ( arg_15 ) if arg_15 is not None else None if arg_10 == 0 : arg_8 . append ( arg_21 . name ) arg_13 . append ( arg_15 ) arg_7 . append ( tuple ( arg_13 ) ) insert ( db , arg_0 . translate , arg_6 . name , arg_8 , * arg_7 ) for arg_17 , arg_7 in arg_5 . items ( ) : insert ( db , arg_0 . translate , arg_17 [ 0 ] , arg_17 [ 1 : ] , * arg_7 ) db . commit ( )

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

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

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

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


Question: Check if a PE_PE is globally defined i . e . not inside a C_C

def Func ( arg_0 ) : if type ( arg_0 ) . __name__ != 'PE_PE' : arg_0 = one ( arg_0 ) . PE_PE [ 8001 ] ( ) if one ( arg_0 ) . C_C [ 8003 ] ( ) : return False arg_0 = one ( arg_0 ) . EP_PKG [ 8000 ] . PE_PE [ 8001 ] ( ) if not arg_0 : return True return Func ( arg_0 )

Asynchronously request a URL and get the encoded text content of the
    body.

    Parameters
    ----------
    url : `str`
        URL to download.
    session : `aiohttp.ClientSession`
        An open aiohttp session.

    Returns
    -------
    content : `str`
        Content downloaded from the URL.


Question: Defers an operator overload to attr .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def func ( arg_1 , * arg_2 ) : return arg_0 ( arg_1 . value , * arg_2 ) return func

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: Read encoded contents from specified path or return default .

def Func ( arg_0 , arg_1 = None , arg_2 = 'utf8' ) : if not arg_0 : return arg_1 try : with io . open ( arg_0 , mode = 'r' , arg_2 = arg_2 ) as contents : return contents . Func ( ) except IOError : if arg_1 is not None : return arg_1 raise


Question: Make sure the value evaluates to boolean True .

def Func ( arg_0 , arg_1 ) : if arg_0 is None : raise ValueError ( "Value for environment variable '{evar_name}' can't " "be empty." . format ( evar_name = arg_1 . name ) ) return arg_0

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


Question: S20 unit to generic address

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = [ "nvm_addr Func" , arg_0 . envs [ "DEV_PATH" ] , "%d %d %d %d" % ( arg_1 , arg_2 , arg_3 , arg_4 ) ] arg_6 , arg_7 , arg_8 = cij . ssh . command ( arg_5 , shell = True ) if arg_6 : raise RuntimeError ( "cij.liblight.Func: cmd fail" ) return int ( re . findall ( r"val: ([0-9a-fx]+)" , arg_7 ) [ 0 ] , 16 )

Get events from this conversation.

        Makes a request to load historical events if necessary.

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

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

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


Question: Dynamically adjust the reader max_in_flight . Set to 0 to immediately disable a Reader

def Func ( arg_0 , arg_1 ) : assert isinstance ( arg_1 , int ) arg_0 . max_in_flight = arg_1 if arg_1 == 0 : for arg_2 in itervalues ( arg_0 . conns ) : if arg_2 . rdy > 0 : logger . debug ( '[%s:%s] rdy: %d -> 0' , arg_2 . id , arg_0 . name , arg_2 . rdy ) arg_0 . _send_rdy ( arg_2 , 0 ) arg_0 . total_rdy = 0 else : arg_0 . need_rdy_redistributed = True arg_0 . _redistribute_rdy_state ( )

Prepare sys.path for running the linter checks.

    Within this context, each of the given arguments is importable.
    Paths are added to sys.path in corresponding order to the arguments.
    We avoid adding duplicate directories to sys.path.
    `sys.path` is reset to its original value upon exiting this context.


Question: Read a notebook from base64 .

def Func ( arg_0 , arg_1 = arg_2 ) : try : return reads ( b64decode ( arg_0 ) . decode ( 'utf-8' ) , arg_1 = arg_1 ) except Exception as e : raise CorruptedFile ( e )

Enroll a single user in any number of courses using a particular course mode.

        Args:
            enterprise_customer: The EnterpriseCustomer which is sponsoring the enrollment
            user: The user who needs to be enrolled in the course
            course_mode: The mode with which the enrollment should be created
            *course_ids: An iterable containing any number of course IDs to eventually enroll the user in.

        Returns:
            Boolean: Whether or not enrollment succeeded for all courses specified


Question: Returns a Raster from layer features .

def Func ( arg_0 , arg_1 ) : arg_2 = ImageDriver ( 'MEM' ) arg_3 = arg_2 . raster ( arg_2 . ShortName , arg_1 . size ) arg_3 . affine = arg_1 . affine arg_5 = arg_1 . sref if not arg_5 . srid : arg_5 = SpatialReference ( 4326 ) arg_3 . sref = arg_5 arg_6 = MemoryLayer ( arg_5 , arg_0 . GetGeomType ( ) ) arg_6 . load ( arg_0 ) arg_7 = gdal . RasterizeLayer ( arg_3 . ds , ( 1 , ) , arg_6 . layer , options = [ 'ATTRIBUTE=%s' % arg_6 . id ] ) arg_6 . close ( ) return arg_3


Question: Given a variable and one of its attributes determine if the attribute is accessible inside of a Django template and return True or False accordingly

def Func ( arg_0 , arg_1 ) : if arg_1 . startswith ( '_' ) : return False try : arg_2 = getattr ( arg_0 , arg_1 ) except : return False if isroutine ( arg_2 ) : if getattr ( arg_2 , 'alters_data' , False ) : return False else : try : arg_3 = getargspec ( arg_2 ) arg_4 = len ( arg_3 . args ) if arg_3 . args else 0 arg_5 = len ( arg_3 . defaults ) if arg_3 . defaults else 0 if arg_4 - arg_5 > 1 : return False except TypeError : pass return True

Called by the PDFLite object to prompt creating
            the font objects.


Question: Cast an arbitrary object or sequence to a number type

def Func ( arg_0 ) : if isinstance ( arg_0 , LiteralWrapper ) : arg_1 = arg_0 . obj elif isinstance ( arg_0 , Iterable ) and not isinstance ( arg_0 , str ) : arg_1 = next ( arg_0 , None ) else : arg_1 = arg_0 if arg_1 is None : yield 0 elif isinstance ( arg_1 , str ) : yield float ( arg_1 ) elif isinstance ( arg_1 , node ) : yield float ( strval ( arg_1 ) ) elif isinstance ( arg_1 , int ) or isinstance ( arg_1 , float ) : yield arg_1 else : raise RuntimeError ( 'Unknown type for number conversion: {}' . format ( arg_1 ) )

Lists all temple templates and packages associated with those templates

    If ``template`` is None, returns the available templates for the configured
    Github org.

    If ``template`` is a Github path to a template, returns all projects spun
    up with that template.

    ``ls`` uses the github search API to find results.

    Note that the `temple.constants.TEMPLE_ENV_VAR` is set to 'ls' for the duration of this
    function.

    Args:
        github_user (str): The github user or org being searched.
        template (str, optional): The template git repo path. If provided, lists
            all projects that have been created with the provided template. Note
            that the template path is the SSH path
            (e.g. git@github.com:CloverHealth/temple.git)

    Returns:
        dict: A dictionary of repository information keyed on the SSH Github url

    Raises:
        `InvalidGithubUserError`: When ``github_user`` is invalid


Question: Find a config in our children so we can fill in variables in our other children with its data .

def Func ( arg_0 , arg_1 ) : arg_2 = None arg_3 = None if 'config' in arg_1 : if type ( arg_1 [ 'config' ] ) == str : arg_1 [ 'config' ] = ConfigFile ( arg_1 [ 'config' ] ) elif isinstance ( arg_1 [ 'config' ] , Config ) : arg_1 [ 'config' ] = arg_1 [ 'config' ] elif type ( arg_1 [ 'config' ] ) == dict : arg_1 [ 'config' ] = Config ( data = arg_1 [ 'config' ] ) else : raise TypeError ( "Don't know how to turn {} into a Config" . format ( type ( arg_1 [ 'config' ] ) ) ) arg_2 = arg_1 [ 'config' ] for arg_4 in arg_1 : if isinstance ( arg_1 [ arg_4 ] , Config ) : arg_3 = arg_1 [ arg_4 ] for arg_4 in arg_1 : if isinstance ( arg_1 [ arg_4 ] , Directory ) : for arg_5 in arg_1 [ arg_4 ] . _children : if arg_5 == 'config' and not arg_2 : arg_2 = arg_1 [ arg_4 ] . _children [ arg_5 ] if isinstance ( arg_1 [ arg_4 ] . _children [ arg_5 ] , Config ) : arg_3 = arg_1 [ arg_4 ] . _children [ arg_5 ] if arg_2 : return arg_2 else : return arg_3

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

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


Question: Create a new empty Basilisp Python module . Modules are created for each Namespace when it is created .

def Func ( arg_0 : arg_1 , arg_2 = None ) -> types . ModuleType : arg_3 = types . ModuleType ( arg_0 , arg_2 = arg_2 ) arg_3 . __loader__ = None arg_3 . __package__ = None arg_3 . __spec__ = None arg_3 . __basilisp_bootstrapped__ = False return arg_3


Question: Allows staff to make manual payments or refunds on an invoice .

def Func ( arg_0 , arg_1 ) : arg_2 = "Func" arg_3 = InvoiceController . for_id_or_404 ( arg_1 ) arg_4 = forms . ManualPaymentForm ( arg_0 . POST or None , prefix = arg_2 , ) if arg_0 . POST and arg_4 . is_valid ( ) : arg_4 . instance . invoice = arg_3 . invoice arg_4 . instance . entered_by = arg_0 . user arg_4 . save ( ) arg_3 . update_status ( ) arg_4 = forms . ManualPaymentForm ( prefix = arg_2 ) arg_8 = { "invoice" : arg_3 . invoice , "form" : arg_4 , } return render ( arg_0 , "registrasion/Func.html" , arg_8 )

Add missing row to a df base on a reference column

    ---

    ### Parameters

    *mandatory :*
    - `id_cols` (*list of str*): names of the columns used to create each group
    - `reference_col` (*str*): name of the column used to identify missing rows

    *optional :*
    - `complete_index` (*list* or *dict*): [A, B, C] a list of values used to add missing rows.
      It can also be a dict to declare a date range.
      By default, use all values of reference_col.
    - `method` (*str*): by default all missing rows are added. The possible values are :
        - `"between"` : add missing rows having their value between min and max values for each group,
        - `"between_and_after"` : add missing rows having their value bigger than min value for each group.
        - `"between_and_before"` : add missing rows having their value smaller than max values for each group.
    - `cols_to_keep` (*list of str*): name of other columns to keep, linked to the reference_col.

    ---

    ### Example

    **Input**

    YEAR | MONTH | NAME
    :---:|:---:|:--:
    2017|1|A
    2017|2|A
    2017|3|A
    2017|1|B
    2017|3|B

    ```cson
    add_missing_row:
      id_cols: ['NAME']
      reference_col: 'MONTH'
    ```

    **Output**

    YEAR | MONTH | NAME
    :---:|:---:|:--:
    2017|1|A
    2017|2|A
    2017|3|A
    2017|1|B
    2017|2|B
    2017|3|B


Question: A generator to convert raw text segments without xml to a list of words without any markup . Additionally dates are replaced by 7777 for normalization .

def Func ( arg_0 , arg_1 = False , arg_2 = True ) : return sent_tokenize ( remove_dates ( _remove_urls ( arg_0 ) ) , arg_1 , arg_2 )

Checks if name_node has corresponding assign statement in same scope


Question: Method builds a payload out of the passed arguments .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_5 = { 'event_type' : unicode ( arg_1 ) , 'tenant_id' : unicode ( arg_0 . used_by_tenant_id ) , 'ip_address' : unicode ( arg_0 . address_readable ) , 'ip_version' : int ( arg_0 . version ) , 'ip_type' : unicode ( arg_0 . address_type ) , 'id' : unicode ( arg_0 . id ) } if arg_1 == IP_EXISTS : if arg_3 is None or arg_4 is None : raise ValueError ( 'IP_BILL: {} start_time/end_time cannot be empty' . format ( arg_1 ) ) arg_5 . update ( { 'startTime' : unicode ( convert_timestamp ( arg_3 ) ) , 'endTime' : unicode ( convert_timestamp ( arg_4 ) ) } ) elif arg_1 in [ IP_ADD , IP_DEL , IP_ASSOC , IP_DISASSOC ] : if arg_2 is None : raise ValueError ( 'IP_BILL: {}: event_time cannot be NULL' . format ( arg_1 ) ) arg_5 . update ( { 'eventTime' : unicode ( convert_timestamp ( arg_2 ) ) , 'subnet_id' : unicode ( arg_0 . subnet_id ) , 'network_id' : unicode ( arg_0 . network_id ) , 'public' : True if arg_0 . network_id == PUBLIC_NETWORK_ID else False , } ) else : raise ValueError ( 'IP_BILL: bad event_type: {}' . format ( arg_1 ) ) return arg_5

Unregister an extension code.  For testing only.


Question: Import settings from the given file system path to given settings instance .

def Func ( arg_0 , arg_1 ) : arg_2 = QtCore . QSettings ( arg_1 , QtCore . QSettings . IniFormat ) for arg_3 in arg_2 . allKeys ( ) : arg_0 [ arg_3 ] = arg_2 . value ( arg_3 )

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


Question: Returns arrays of long short and gross sector exposures of an algorithm s positions

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : arg_4 = arg_2 . keys ( ) arg_5 = [ ] arg_6 = [ ] arg_7 = [ ] arg_8 = [ ] arg_9 = arg_0 . drop ( 'cash' , axis = 'columns' ) arg_10 = arg_9 [ arg_9 > 0 ] . sum ( axis = 'columns' ) arg_11 = arg_9 [ arg_9 < 0 ] . abs ( ) . sum ( axis = 'columns' ) arg_12 = arg_9 . abs ( ) . sum ( axis = 'columns' ) for arg_13 in arg_4 : arg_14 = arg_9 [ arg_1 == arg_13 ] arg_15 = arg_14 [ arg_14 > 0 ] . sum ( axis = 'columns' ) . divide ( arg_10 ) arg_16 = arg_14 [ arg_14 < 0 ] . sum ( axis = 'columns' ) . divide ( arg_11 ) arg_17 = arg_14 . abs ( ) . sum ( axis = 'columns' ) . divide ( arg_12 ) arg_18 = arg_15 . subtract ( arg_16 ) arg_5 . append ( arg_15 ) arg_6 . append ( arg_16 ) arg_7 . append ( arg_17 ) arg_8 . append ( arg_18 ) return arg_5 , arg_6 , arg_7 , arg_8

Perform dimensionality reduction on X.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape (n_samples, n_features)
            New data.

        Returns
        -------
        X_new : array, shape (n_samples, n_components)
            Reduced version of X. This will always be a dense array.


Question: Apply an operation to the output of the circuit .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_2 = arg_2 or [ ] arg_3 = arg_3 or [ ] arg_5 = arg_0 . _bits_in_condition ( arg_4 ) arg_5 . extend ( arg_3 ) arg_0 . _check_condition ( arg_1 . name , arg_4 ) arg_0 . _check_bits ( arg_2 , arg_0 . output_map ) arg_0 . _check_bits ( arg_5 , arg_0 . output_map ) arg_0 . _add_op_node ( arg_1 , arg_2 , arg_3 , arg_4 ) arg_6 = [ arg_2 , arg_5 ] for arg_7 in itertools . chain ( * arg_6 ) : arg_8 = list ( arg_0 . _multi_graph . predecessors ( arg_0 . output_map [ arg_7 ] ) ) if len ( arg_8 ) != 1 : raise DAGCircuitError ( "output node has multiple in-edges" ) arg_0 . _multi_graph . add_edge ( arg_8 [ 0 ] , arg_0 . _id_to_node [ arg_0 . _max_node_id ] , name = "%s[%s]" % ( arg_7 [ 0 ] . name , arg_7 [ 1 ] ) , wire = arg_7 ) arg_0 . _multi_graph . remove_edge ( arg_8 [ 0 ] , arg_0 . output_map [ arg_7 ] ) arg_0 . _multi_graph . add_edge ( arg_0 . _id_to_node [ arg_0 . _max_node_id ] , arg_0 . output_map [ arg_7 ] , name = "%s[%s]" % ( arg_7 [ 0 ] . name , arg_7 [ 1 ] ) , wire = arg_7 ) return arg_0 . _id_to_node [ arg_0 . _max_node_id ]

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


Question: Walk the knitting pattern in a right - to - left fashion .

def Func ( arg_0 ) : arg_1 = { } arg_2 = [ ] Func = [ ] for arg_4 in arg_0 . rows : arg_5 = arg_4 . rows_before [ : ] if arg_5 : arg_1 [ arg_4 ] = arg_5 else : arg_2 . append ( arg_4 ) assert arg_2 while arg_2 : arg_4 = arg_2 . pop ( 0 ) Func . append ( arg_4 ) assert arg_4 not in arg_1 for arg_6 in reversed ( arg_4 . rows_after ) : arg_7 = arg_1 [ arg_6 ] arg_7 . remove ( arg_4 ) if not arg_7 : del arg_1 [ arg_6 ] arg_2 . insert ( 0 , arg_6 ) assert not arg_1 , "everything is walked" return Func

Verify course ID and retrieve course details.


Question: This just reads a pickled fake LC .

def Func ( arg_0 ) : try : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd ) except UnicodeDecodeError : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd , encoding = 'latin1' ) return arg_1

Init openstack neutron mq

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

        :param mq: class ternya.mq.MQ


Question: Execute a Perceval job on RQ .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None , arg_6 = arg_7 ) : arg_8 = rq . get_current_job ( ) arg_9 = PercevalJob ( arg_8 . id , arg_3 , arg_0 , arg_4 , arg_8 . connection , arg_2 ) logger . debug ( "Running job #%s (task: %s) (%s) (cat:%s)" , arg_9 . job_id , arg_3 , arg_0 , arg_4 ) if not arg_9 . has_archiving ( ) and arg_5 : raise AttributeError ( "archive attributes set but archive is not supported" ) arg_10 = True arg_11 = False arg_12 = 0 while arg_10 : try : arg_9 . run ( arg_1 , arg_5 = arg_5 , arg_11 = arg_11 ) except AttributeError as e : raise e except Exception as e : logger . debug ( "Error running job %s (%s) - %s" , arg_9 . job_id , arg_0 , str ( e ) ) arg_12 += 1 if not arg_9 . has_resuming ( ) or arg_12 >= arg_6 : logger . error ( "Cancelling job #%s (task: %s) (%s)" , arg_9 . job_id , arg_3 , arg_0 ) raise e logger . warning ( "Resuming job #%s (task: %s) (%s) due to a failure (n %s, max %s)" , arg_9 . job_id , arg_3 , arg_0 , arg_12 , arg_6 ) arg_11 = True else : arg_10 = False arg_13 = arg_9 . result logger . debug ( "Job #%s (task: %s) completed (%s) - %s items (%s) fetched" , arg_13 . job_id , arg_3 , arg_13 . backend , str ( arg_13 . nitems ) , arg_13 . category ) return arg_13

Given a Dusty repo object, clone the remote into Dusty's local repos
        directory if it does not already exist.


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

def Func ( arg_0 , arg_1 ) : arg_2 = mask_util . total_regular_pixels_from_mask ( arg_0 ) arg_3 = np . zeros ( shape = arg_2 ) arg_4 = 0 for arg_5 in range ( arg_0 . shape [ 0 ] ) : for arg_6 in range ( arg_0 . shape [ 1 ] ) : if not arg_0 [ arg_5 , arg_6 ] : arg_3 [ arg_4 ] = arg_1 [ arg_5 , arg_6 ] arg_4 += 1 return arg_3

Add all filenames in the given list to the parser's set.


Question: GBM model demo .

def Func ( arg_0 = True , arg_1 = True , arg_2 = False ) : def demo_body ( arg_3 ) : arg_3 ( ) h2o . init ( ) arg_3 ( ) arg_4 = h2o . load_dataset ( "prostate" ) arg_3 ( ) arg_4 . describe ( ) arg_3 ( ) arg_5 , arg_6 = arg_4 . split_frame ( ratios = [ 0.70 ] ) arg_3 ( ) arg_5 [ "CAPSULE" ] = arg_5 [ "CAPSULE" ] . asfactor ( ) arg_6 [ "CAPSULE" ] = arg_6 [ "CAPSULE" ] . asfactor ( ) arg_3 ( ) from h2o . estimators import H2OGradientBoostingEstimator arg_7 = H2OGradientBoostingEstimator ( distribution = "bernoulli" , ntrees = 10 , max_depth = 8 , min_rows = 10 , learn_rate = 0.2 ) arg_7 . train ( x = [ "AGE" , "RACE" , "PSA" , "VOL" , "GLEASON" ] , y = "CAPSULE" , training_frame = arg_5 ) arg_3 ( ) arg_7 . show ( ) arg_3 ( ) arg_8 = arg_7 . predict ( arg_6 ) arg_8 . show ( ) arg_3 ( ) from h2o . tree import H2OTree , H2ONode arg_9 = H2OTree ( arg_7 , 0 , "0" ) len ( arg_9 ) arg_9 . left_children arg_9 . right_children arg_9 . root_node . show ( ) arg_3 ( ) arg_10 = arg_7 . model_performance ( arg_6 ) arg_10 . show ( ) _run_demo ( demo_body , arg_0 , arg_1 , arg_2 )

Start monitoring of the alarm status.

        Send command to satel integra to start sending updates. Read in a
        loop and call respective callbacks when received messages.


Question: Write variable header

def Func ( arg_0 , arg_1 ) : arg_0 . write ( struct . pack ( 'b3xI' , etypes [ 'miUINT32' ] [ 'n' ] , 8 ) ) arg_0 . write ( struct . pack ( 'b3x4x' , mclasses [ arg_1 [ 'mclass' ] ] ) ) write_elements ( arg_0 , 'miINT32' , arg_1 [ 'dims' ] ) write_elements ( arg_0 , 'miINT8' , asbytes ( arg_1 [ 'name' ] ) , is_name = True )

Temporal distance probability density function.

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


Question: Context manager to execute a code block in a directory .

def Func ( arg_0 , arg_1 = True ) : arg_2 = os . getcwd ( ) try : try : os . chdir ( arg_0 ) logger . debug ( "Working in {directory!r}..." . format ( ** vars ( ) ) ) except OSError as err : if arg_1 and err . errno == errno . ENOENT : os . makedirs ( arg_0 ) os . chdir ( arg_0 ) logger . info ( "Working in {directory!r} (newly created)..." . format ( ** vars ( ) ) ) else : logger . exception ( "Failed to start working in {directory!r}." . format ( ** vars ( ) ) ) raise yield os . getcwd ( ) finally : os . chdir ( arg_2 )

Given configuration initiate a SigningService instance

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


Question: Updates the profile s config entry with values set in each attr by the user . This will overwrite existing values .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 : if arg_2 in arg_1 . data [ arg_0 . profile ] and arg_2 is not "auth" : arg_1 . data [ arg_0 . profile ] [ arg_2 ] = getattr ( arg_0 , arg_2 )

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: Add a client authenticator class to CLIENT_MECHANISMS_D CLIENT_MECHANISMS and optionally to SECURE_CLIENT_MECHANISMS

def Func ( arg_0 , arg_1 ) : arg_2 [ arg_1 ] = arg_0 arg_3 = sorted ( arg_2 . items ( ) , key = _key_func , reverse = True ) arg_4 [ : ] = [ k for ( k , v ) in arg_3 ] arg_5 [ : ] = [ k for ( k , v ) in arg_3 if v . _pyxmpp_sasl_secure ]

Returns the bounds of the index

        :param coordinate_interleaved: If True, the coordinates are turned
            in the form [xmin, ymin, ..., kmin, xmax, ymax, ..., kmax],
            otherwise they are returned as
            [xmin, xmax, ymin, ymax, ..., ..., kmin, kmax].  If not specified,
            the :attr:`interleaved` member of the index is used, which
            defaults to True.


Question: check if dependency program is there

def Func ( arg_0 ) : return _subprocess . call ( "type " + arg_0 , shell = True , stdout = _subprocess . PIPE , stderr = _subprocess . PIPE ) == 0

Perform dimensionality reduction on X.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape (n_samples, n_features)
            New data.

        Returns
        -------
        X_new : array, shape (n_samples, n_components)
            Reduced version of X. This will always be a dense array.


Question: Place the next queen at the given row .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . index ( None ) arg_4 = arg_1 [ : ] arg_4 [ arg_3 ] = arg_2 return arg_4

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


Question: Intercept downstream websocket . accept message and thus allow this upsteam application to accept websocket frames .

async def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = not arg_0 . applications_accepting_frames arg_0 . applications_accepting_frames . add ( arg_2 ) if arg_3 : await arg_0 . accept ( )

Take a string and return the corresponding module


Question: Validate that the name is a valid GCS bucket .

def Func ( arg_0 ) : if not arg_0 . startswith ( 'gs://' ) : raise ValueError ( 'Invalid bucket path "%s". Must start with "gs://".' % arg_0 ) arg_1 = arg_0 [ len ( 'gs://' ) : ] if not re . search ( r'^\w[\w_\.-]{1,61}\w$' , arg_1 ) : raise ValueError ( 'Invalid bucket name: %s' % arg_0 )

Stop streaming samples from device and delete samples buffer


Question: Compute the mappings between a pixelization s pixels and the unmasked sub - grid pixels . These mappings \ are determined after the regular - grid is used to determine the pixelization .

def Func ( arg_0 ) : Func = [ [ ] for _ in range ( arg_0 . pixels ) ] for arg_2 , arg_3 in enumerate ( arg_0 . sub_to_pix ) : Func [ arg_3 ] . append ( arg_2 ) return Func

Returns the coach ID for the team's OC in a given year.

        :year: An int representing the year.
        :returns: A string containing the coach ID of the OC.


Question: Creates a plane with a specified number of vertices on it sides but no vertices on the interior .


Question: Given a ChangeSet POST it to the Route53 API .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = xml_generators . change_resource_record_set_writer ( connection = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 ) arg_4 = arg_0 . _send_request ( path = 'hostedzone/%s/rrset' % arg_1 . hosted_zone_id , data = arg_3 , method = 'POST' , ) arg_5 = arg_4 . find ( './{*}ChangeInfo' ) if arg_5 is None : arg_6 = arg_4 . find ( './{*}Error' ) . find ( './{*}Message' ) . text raise Route53Error ( arg_6 ) return parse_change_info ( arg_5 )

Based on values in the exclude_dictionary generate a list of term queries that
    will filter out unwanted results.


Question: Return the first element of a binned expression where the values each bin are sorted by order_expression .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = [ ] , arg_4 = None , arg_5 = arg_6 , arg_7 = False , arg_8 = False , arg_9 = False , arg_10 = None ) : return arg_0 . _compute_agg ( 'Func' , arg_1 , arg_3 , arg_4 , arg_5 , arg_7 , arg_8 , arg_9 , arg_10 , extra_expressions = [ arg_2 ] ) logger . debug ( "count(%r, binby=%r, limits=%r)" , arg_1 , arg_3 , arg_4 ) logger . debug ( "count(%r, binby=%r, limits=%r)" , arg_1 , arg_3 , arg_4 ) arg_1 = _ensure_strings_from_expressions ( arg_1 ) arg_2 = _ensure_string_from_expression ( arg_2 ) arg_3 = _ensure_strings_from_expressions ( arg_3 ) arg_11 , [ arg_12 , ] = vaex . utils . listify ( arg_1 ) @ delayed def finish ( * arg_13 ) : arg_13 = np . asarray ( arg_13 ) return vaex . utils . unlistify ( arg_11 , arg_13 ) arg_14 = vaex . utils . progressbars ( arg_10 ) arg_4 = arg_0 . limits ( arg_3 , arg_4 , arg_8 = True , arg_5 = arg_5 ) arg_15 = [ arg_0 . _Func_calculation ( arg_1 , arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_7 = arg_7 , arg_9 = arg_9 , arg_14 = arg_14 ) for arg_1 in arg_12 ] arg_16 = finish ( * arg_15 ) return arg_0 . _delay ( arg_8 , arg_16 )

Clean up stats file, if configured to do so.


Question: Makes a striplog of all unions .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , arg_0 . __class__ ) : arg_2 = "You can only Func striplogs with each other." raise StriplogError ( arg_2 ) arg_3 = [ ] for arg_4 in deepcopy ( arg_0 ) : for arg_5 in arg_1 : if arg_4 . any_overlaps ( arg_5 ) : arg_4 = arg_4 . Func ( arg_5 ) arg_3 . append ( arg_4 ) return Striplog ( arg_3 )

Get the filesystem path to a file that contains OpenSSL-compatible CA certs.

    On OS X and Windows, there are extracted from the system certificate store
    and cached in a file on the filesystem. This path should not be writable
    by other users, otherwise they could inject CA certs into the trust list.

    :param temp_dir:
        The temporary directory to cache the CA certs in on OS X and Windows.
        Needs to have secure permissions so other users can not modify the
        contents.

    :param cache_length:
        The number of hours to cache the CA certs on OS X and Windows

    :param cert_callback:
        A callback that is called once for each certificate in the trust store.
        It should accept two parameters: an asn1crypto.x509.Certificate object,
        and a reason. The reason will be None if the certificate is being
        exported, otherwise it will be a unicode string of the reason it won't.
        This is only called on Windows and OS X when passed to this function.

    :raises:
        oscrypto.errors.CACertsError - when an error occurs exporting/locating certs

    :return:
        The full filesystem path to a CA certs file


Question: Helper for wheel_color that distributes colors over length and allows shifting position .

def Func ( arg_0 , arg_1 , arg_2 ) : return wheel_color ( ( arg_0 * len ( _WHEEL ) / arg_1 ) + arg_2 )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Create a nice image name from the url .

def Func ( arg_0 ) : arg_1 = r'https?://|[^\w]' arg_2 = '_' return re . sub ( arg_1 , arg_2 , arg_0 ) . strip ( '_' )

Re-enable the FTDI drivers for the current platform.


Question: Return the number of ports .

def Func ( arg_0 , arg_1 = None ) : LOG . info ( "Func for tenant %s filters %s" % ( arg_0 . tenant_id , arg_1 ) ) return db_api . port_count_all ( arg_0 , join_security_groups = True , ** arg_1 )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Formats answers depending on fmt .

def Func ( arg_0 , arg_1 = 'obj' ) : arg_2 = ( 'obj' , 'array' , 'plain' ) if arg_1 not in arg_2 : eprint ( "Error: '{}' not in {}" . format ( arg_1 , arg_2 ) ) return def stringify ( arg_3 ) : if type ( arg_3 ) in ( list , tuple ) : return ', ' . join ( str ( arg_4 ) for arg_4 in arg_3 ) return arg_3 if arg_1 == 'obj' : return json . dumps ( arg_0 . answers ) elif arg_1 == 'array' : arg_5 = [ [ k , v ] for k , v in arg_0 . answers . items ( ) ] return json . dumps ( arg_5 ) elif arg_1 == 'plain' : arg_5 = '\n' . join ( '{}: {}' . format ( k , stringify ( v ) ) for k , v in arg_0 . answers . items ( ) ) return arg_5

Awake one process waiting to receive data on fd


Question: Deletes the specified file from the given S3 bucket .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = S3Connection ( arg_0 . access_key_id , arg_0 . access_key_secret ) arg_4 = arg_3 . get_bucket ( arg_2 ) if type ( arg_1 ) . __name__ == 'Key' : arg_1 = '/' + arg_1 . name arg_5 = arg_0 . _get_s3_path ( arg_1 ) arg_6 = Key ( arg_4 ) arg_6 . key = arg_5 try : arg_4 . delete_key ( arg_6 ) except S3ResponseError : pass

Generates a JSON string with the params to be used
        when sending CONNECT to the server.

          ->> CONNECT {"lang": "python3"}


Question: Hamiltonian Monte Carlo TransitionOperator .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_5 , arg_6 : arg_7 , arg_8 : arg_9 = None , arg_10 : arg_3 = None , arg_11 : arg_12 = None , arg_13 : arg_14 [ [ arg_15 , arg_16 ] , arg_17 ] = lambda * arg_18 : ( ) , arg_19 = None , ) -> Tuple [ arg_1 , HamiltonianMonteCarloExtra ] : arg_20 = arg_0 . state arg_21 = arg_0 . state_grads arg_22 = arg_0 . target_log_prob arg_23 = arg_0 . state_extra if arg_10 is None : def arg_10 ( * arg_8 ) : return tf . add_n ( [ tf . reduce_sum ( input_tensor = tf . square ( arg_24 ) , axis = - 1 ) / 2. for arg_24 in tf . nest . flatten ( arg_8 ) ] ) , ( ) if arg_11 is None : def arg_11 ( * arg_8 ) : arg_25 = tf . nest . map_structure ( lambda arg_24 : tf . random . normal ( tf . shape ( input = arg_24 ) , dtype = arg_24 . dtype ) , arg_8 ) if len ( arg_25 ) == 1 : return arg_25 [ 0 ] else : return arg_25 if arg_8 is None : arg_8 = call_fn ( arg_11 , tf . nest . map_structure ( tf . zeros_like , arg_20 ) ) if arg_22 is None : arg_22 , arg_23 , arg_21 = call_and_grads ( arg_2 , arg_20 ) arg_26 , arg_27 = call_fn ( arg_10 , arg_8 ) arg_28 = - arg_22 + arg_26 arg_29 = arg_1 ( arg_20 = arg_20 , arg_21 = arg_21 , arg_23 = arg_23 , arg_22 = arg_22 ) def leapfrog_wrapper ( arg_30 , arg_22 , arg_23 ) : del arg_22 del arg_23 arg_30 , arg_31 = leapfrog_step ( arg_30 , arg_4 = arg_4 , arg_2 = arg_2 , arg_10 = arg_10 ) return [ arg_30 , arg_31 . target_log_prob , arg_31 . state_extra ] , arg_31 def leapfrog_trace_wrapper_fn ( arg_18 , arg_31 ) : return arg_13 ( arg_18 [ 0 ] , arg_31 ) arg_32 = ( arg_15 ( arg_20 , arg_21 , arg_8 ) , arg_22 , arg_23 ) [ [ arg_30 , arg_22 , arg_23 ] , arg_27 ] , arg_33 = trace ( arg_32 , leapfrog_wrapper , arg_6 , trace_fn = leapfrog_trace_wrapper_fn ) arg_26 , arg_27 = call_fn ( arg_10 , arg_30 . momentum ) arg_34 = - arg_22 + arg_26 arg_35 = arg_1 ( arg_20 = arg_30 . state , arg_21 = arg_30 . state_grads , arg_22 = arg_22 , arg_23 = arg_23 ) arg_36 = arg_34 - arg_28 arg_0 , arg_37 , arg_27 = metropolis_hastings_step ( arg_29 , arg_35 , arg_36 , arg_19 = arg_19 ) arg_0 = arg_0 return arg_0 , HamiltonianMonteCarloExtra ( arg_37 = arg_37 , proposed_hmc_state = arg_35 , log_accept_ratio = - arg_36 , arg_33 = arg_33 )


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

def Func ( arg_0 , arg_1 = False ) : if arg_0 . _stored and not arg_1 : raise TypeError ( 'Your trajectory is already stored to disk or database, shrinking is ' 'not allowed.' ) for arg_2 in arg_0 . _explored_parameters . values ( ) : arg_2 . f_unlock ( ) try : arg_2 . _shrink ( ) except Exception as exc : arg_0 . _logger . error ( 'Could not shrink `%s` because of:`%s`' % ( arg_2 . v_full_name , repr ( exc ) ) ) arg_0 . _explored_parameters = { } arg_0 . _run_information = { } arg_0 . _single_run_ids = { } arg_0 . _add_run_info ( 0 ) arg_0 . _test_run_addition ( 1 )

This method fixes a bug in Python's SGMLParser.


Question: Returns ON - OFF for all Stokes parameters given a cross_pols noise diode measurement

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = Waterfall ( arg_0 , max_load = 150 ) arg_4 = arg_3 . populate_freqs ( ) arg_5 = arg_3 . header [ 'tsamp' ] arg_6 = arg_3 . data arg_3 = None arg_7 , arg_8 , arg_9 , arg_10 = get_stokes ( arg_6 , arg_1 ) arg_11 , arg_12 = foldcal ( arg_7 , arg_5 , ** arg_2 ) arg_13 , arg_14 = foldcal ( arg_8 , arg_5 , ** arg_2 ) arg_15 , arg_16 = foldcal ( arg_9 , arg_5 , ** arg_2 ) arg_17 , arg_18 = foldcal ( arg_10 , arg_5 , ** arg_2 ) arg_19 = arg_12 - arg_11 arg_20 = arg_14 - arg_13 arg_21 = arg_16 - arg_15 arg_22 = arg_18 - arg_17 return arg_19 , arg_20 , arg_21 , arg_22 , arg_4

Resolves VirtualEnvironments in CPENV_HOME


Question: Find Vars mapped by the given Symbol input or None if no Vars are mapped by that Symbol .

def Func ( arg_0 , arg_1 : arg_1 . Symbol ) -> Optional [ Var ] : arg_3 = arg_0 . interns . entry ( arg_1 , None ) if arg_3 is None : return arg_0 . refers . entry ( arg_1 , None ) return arg_3

This runs the pyeebls.eebls function using the given inputs.

    Parameters
    ----------

    times,mags : np.array
        The input magnitude time-series to search for transits.

    nfreq : int
        The number of frequencies to use when searching for transits.

    freqmin : float
        The minimum frequency of the period-search -> max period that will be
        used for the search.

    stepsize : float
        The step-size in frequency to use to generate a frequency-grid.

    nbins : int
        The number of phase bins to use.

    minduration : float
        The minimum fractional transit duration that will be considered.

    maxduration : float
        The maximum fractional transit duration that will be considered.

    Returns
    -------

    dict
        Returns a dict of the form::

            {
                'power':           the periodogram power array,
                'bestperiod':      the best period found,
                'bestpower':       the highest peak of the periodogram power,
                'transdepth':      transit depth found by eebls.f,
                'transduration':   transit duration found by eebls.f,
                'transingressbin': transit ingress bin found by eebls.f,
                'transegressbin':  transit egress bin found by eebls.f,
            }


Question: Convert this unnormalized batch to an instance of Batch .

def Func ( arg_0 ) : assert all ( [ arg_2 is None for arg_1 , arg_2 in arg_0 . __dict__ . items ( ) if arg_1 . endswith ( "_aug" ) ] ) , "Expected UnnormalizedBatch to not contain any augmented data " "before normalization, but at least one '*_aug' attribute was " "already set." arg_3 = nlib . normalize_images ( arg_0 . images_unaug ) arg_4 = None if arg_3 is not None : arg_4 = [ image . shape for image in arg_3 ] return Batch ( images = arg_3 , heatmaps = nlib . normalize_heatmaps ( arg_0 . heatmaps_unaug , arg_4 ) , segmentation_maps = nlib . normalize_segmentation_maps ( arg_0 . segmentation_maps_unaug , arg_4 ) , keypoints = nlib . normalize_keypoints ( arg_0 . keypoints_unaug , arg_4 ) , bounding_boxes = nlib . normalize_bounding_boxes ( arg_0 . bounding_boxes_unaug , arg_4 ) , polygons = nlib . normalize_polygons ( arg_0 . polygons_unaug , arg_4 ) , line_strings = nlib . normalize_line_strings ( arg_0 . line_strings_unaug , arg_4 ) , data = arg_0 . data )

Copy a path from inside a Dusty container to a path on the
    local filesystem. The path on the local filesystem must be
    wrist-accessible by the user specified in mac_username.


Question: Evaluate model on splitted 10 percent testing set

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = prepare_feature ( arg_0 , option = 'test' ) arg_5 = arg_1 . predict ( [ arg_2 , arg_3 ] ) arg_5 = ( arg_5 . ravel ( ) > 0.5 ) . astype ( int ) arg_6 = f1_score ( arg_4 , arg_5 ) arg_7 = precision_score ( arg_4 , arg_5 ) arg_8 = recall_score ( arg_4 , arg_5 ) return arg_6 , arg_7 , arg_8

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


Question: Creates a FloatingIP in a region without assigning it to a specific Droplet .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 . get_data ( 'floating_ips/' , type = POST , params = { 'region' : arg_0 . region_slug } ) if arg_3 : arg_0 . ip = arg_3 [ 'floating_ip' ] [ 'ip' ] arg_0 . region = arg_3 [ 'floating_ip' ] [ 'region' ] return arg_0

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


Question: Runs a network in an experimental run .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_0 . _Func ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , pre_run = False )

Overriding the default JSONEncoder.default for NDB support.


Question: Creates a reference to the parent document to allow for partial - tree validation .

def Func ( arg_0 , arg_1 ) : if arg_0 . document != arg_1 : arg_0 . document = arg_1 for arg_3 in arg_0 . children : if not isinstance ( arg_3 , dom_tag ) : return arg_3 . Func ( arg_1 )

Converts given J, H, Ks mags to an SDSS r magnitude value.

    Parameters
    ----------

    jmag,hmag,kmag : float
        2MASS J, H, Ks mags of the object.

    Returns
    -------

    float
        The converted SDSS r band magnitude.


Question: Returns the dictionary of CORS specific app configurations .

def Func ( arg_0 ) : arg_1 = getattr ( arg_0 , 'config' , { } ) return dict ( ( arg_2 . lower ( ) . replace ( 'cors_' , '' ) , arg_1 . get ( arg_2 ) ) for arg_2 in CONFIG_OPTIONS if arg_1 . get ( arg_2 ) is not None )

Regenerates the primary or secondary access key for the specified
        storage account.

        service_name:
            Name of the storage service account.
        key_type:
            Specifies which key to regenerate. Valid values are:
            Primary, Secondary


Question: Parse the value of the state parameter .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . rsplit ( ':' , 1 ) if xsrfutil . validate_token ( xsrf_secret_key ( ) , arg_3 , arg_1 . user_id ( ) , action_id = arg_2 ) : return arg_2 else : return None

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


Question: run a build meaning creating a build . Retry if there is failure

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _get_project ( ) bot . custom ( 'PROJECT' , arg_4 , "CYAN" ) bot . custom ( 'BUILD  ' , arg_1 [ 'steps' ] [ 0 ] [ 'name' ] , "CYAN" ) arg_5 = arg_0 . _build_service . projects ( ) . builds ( ) . create ( body = arg_1 , projectId = arg_4 ) . execute ( ) arg_6 = arg_5 [ 'metadata' ] [ 'build' ] [ 'id' ] arg_7 = arg_5 [ 'metadata' ] [ 'build' ] [ 'status' ] bot . log ( "build %s: %s" % ( arg_6 , arg_7 ) ) arg_8 = time . time ( ) while arg_7 not in [ 'COMPLETE' , 'FAILURE' , 'SUCCESS' ] : time . sleep ( 15 ) arg_5 = arg_0 . _build_service . projects ( ) . builds ( ) . get ( id = arg_6 , projectId = arg_4 ) . execute ( ) arg_6 = arg_5 [ 'id' ] arg_7 = arg_5 [ 'status' ] bot . log ( "build %s: %s" % ( arg_6 , arg_7 ) ) arg_9 = time . time ( ) bot . log ( 'Total build time: %s seconds' % ( round ( arg_9 - arg_8 , 2 ) ) ) if arg_7 == 'SUCCESS' : arg_10 = 'SREGISTRY_GOOGLE_STORAGE_PRIVATE' arg_11 = arg_2 . blob ( arg_5 [ 'artifacts' ] [ 'objects' ] [ 'paths' ] [ 0 ] ) if arg_0 . _get_and_update_setting ( arg_10 ) == None : arg_11 . make_public ( ) arg_5 [ 'public_url' ] = arg_11 . public_url update_blob_metadata ( arg_11 , arg_5 , arg_1 , arg_2 , arg_3 ) arg_5 [ 'media_link' ] = arg_11 . media_link arg_5 [ 'size' ] = arg_11 . size arg_5 [ 'file_hash' ] = arg_11 . md5_hash return arg_5

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: Handle a POST request .

def Func ( arg_0 , arg_1 = '0' ) : arg_2 = arg_0 . get_thing ( arg_1 ) if arg_2 is None : arg_0 . set_status ( 404 ) return try : arg_3 = json . loads ( arg_0 . request . body . decode ( ) ) except ValueError : arg_0 . set_status ( 400 ) return arg_4 = { } for arg_5 , arg_6 in arg_3 . items ( ) : arg_7 = None if 'input' in arg_6 : arg_7 = arg_6 [ 'input' ] arg_8 = arg_2 . perform_action ( arg_5 , arg_7 ) if arg_8 : arg_4 . update ( arg_8 . as_action_description ( ) ) tornado . ioloop . IOLoop . current ( ) . spawn_callback ( perform_action , arg_8 , ) arg_0 . set_status ( 201 ) arg_0 . write ( json . dumps ( arg_4 ) )

Returns a new random state.

    Parameters
    ----------
    seed : None or int, optional
        Optional seed value to use.
        The same datatypes are allowed as for ``numpy.random.RandomState(seed)``.

    fully_random : bool, optional
        Whether to use numpy's random initialization for the
        RandomState (used if set to True). If False, a seed is sampled from
        the global random state, which is a bit faster and hence the default.

    Returns
    -------
    numpy.random.RandomState
        The new random state.


Question: Return adjusted start and stop index as tuple .

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 , arg_4 ] ) -> ( arg_4 , arg_4 ) : arg_5 , arg_6 = arg_0 . _span if isinstance ( arg_1 , arg_4 ) : if arg_1 < 0 : arg_1 += arg_6 - arg_5 if arg_1 < 0 : raise IndexError ( 'index out of range' ) elif arg_1 >= arg_6 - arg_5 : raise IndexError ( 'index out of range' ) arg_7 = arg_5 + arg_1 return arg_7 , arg_7 + 1 if arg_1 . step is not None : raise NotImplementedError ( 'step is not implemented for string setter.' ) arg_7 , arg_8 = arg_1 . start or 0 , arg_1 . stop if arg_7 < 0 : arg_7 += arg_6 - arg_5 if arg_7 < 0 : raise IndexError ( 'start index out of range' ) if arg_8 is None : arg_8 = arg_6 - arg_5 elif arg_8 < 0 : arg_8 += arg_6 - arg_5 if arg_7 > arg_8 : raise IndexError ( 'stop index out of range or start is after the stop' ) return arg_7 + arg_5 , arg_8 + arg_5

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


Question: r Take pauli string to construct pauli .

def Func ( arg_0 , arg_1 ) : arg_2 = np . zeros ( len ( arg_1 ) , dtype = np . bool ) arg_3 = np . zeros ( len ( arg_1 ) , dtype = np . bool ) for arg_4 , arg_5 in enumerate ( arg_1 ) : if arg_5 == 'X' : arg_3 [ - arg_4 - 1 ] = True elif arg_5 == 'Z' : arg_2 [ - arg_4 - 1 ] = True elif arg_5 == 'Y' : arg_2 [ - arg_4 - 1 ] = True arg_3 [ - arg_4 - 1 ] = True elif arg_5 != 'I' : raise QiskitError ( "Pauli string must be only consisted of 'I', 'X', " "'Y' or 'Z' but you have {}." . format ( arg_5 ) ) return arg_0 ( arg_2 = arg_2 , arg_3 = arg_3 )


Question: Creates a generator that does all the work .

def Func ( arg_0 ) : arg_1 = arg_0 . bundle . group_transactions ( ) arg_2 = arg_0 . bundle . hash arg_3 = len ( arg_0 . bundle ) - 1 arg_4 = 0 arg_5 = 0 for arg_6 in arg_1 : for arg_7 in arg_6 : arg_4 += arg_7 . value if arg_7 . bundle_hash != arg_2 : yield 'Transaction {i} has invalid bundle hash.' . format ( i = arg_5 , ) if arg_7 . current_index != arg_5 : yield ( 'Transaction {i} has invalid current index value ' '(expected {i}, actual {actual}).' . format ( actual = arg_7 . current_index , i = arg_5 , ) ) if arg_7 . last_index != arg_3 : yield ( 'Transaction {i} has invalid last index value ' '(expected {expected}, actual {actual}).' . format ( actual = arg_7 . last_index , expected = arg_3 , i = arg_5 , ) ) arg_5 += 1 if arg_4 != 0 : yield ( 'Bundle has invalid balance ' '(expected 0, actual {actual}).' . format ( actual = arg_4 , ) ) if not arg_0 . _errors : arg_8 = [ ] for arg_6 in arg_1 : if arg_6 [ 0 ] . value >= 0 : continue arg_9 = True for arg_10 , arg_7 in enumerate ( arg_6 ) : if ( arg_10 > 0 ) and ( arg_7 . value != 0 ) : yield ( 'Transaction {i} has invalid value ' '(expected 0, actual {actual}).' . format ( actual = arg_7 . value , i = arg_7 . current_index , ) ) arg_9 = False continue if arg_9 : arg_8 . append ( arg_6 ) if arg_8 : for arg_11 in arg_0 . _get_bundle_signature_errors ( arg_8 ) : yield arg_11

display connection info, and store ports


Question: NamePrefix = string

def Func ( arg_0 = None , ** arg_1 ) : arg_2 = arg_0 . Func ( ** arg_1 ) if not arg_2 . get ( "Rules" ) : arg_2 . update ( { "Rules" : [ ] } ) return arg_2

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


Question: Process post - publication events coming out of the database .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . module_ident , arg_0 . ident_hash arg_4 = get_current_registry ( ) . celery_app arg_1 . execute ( 'SELECT result_id::text ' 'FROM document_baking_result_associations ' 'WHERE module_ident = %s' , ( arg_2 , ) ) for arg_5 in arg_1 . fetchall ( ) : arg_6 = arg_4 . AsyncResult ( arg_5 [ 0 ] ) . state if arg_6 in ( 'QUEUED' , 'STARTED' , 'RETRY' ) : logger . debug ( 'Already queued module_ident={} ident_hash={}' . format ( arg_2 , arg_3 ) ) return logger . debug ( 'Queued for processing module_ident={} ident_hash={}' . format ( arg_2 , arg_3 ) ) arg_7 = _get_recipe_ids ( arg_2 , arg_1 ) update_module_state ( arg_1 , arg_2 , 'processing' , arg_7 [ 0 ] ) arg_1 . connection . commit ( ) arg_8 = 'cnxpublishing.subscribers.baking_processor' arg_9 = arg_4 . tasks [ arg_8 ] arg_5 = arg_9 . delay ( arg_2 , arg_3 ) arg_9 . backend . store_result ( arg_5 . id , None , 'QUEUED' ) track_baking_proc_state ( arg_5 , arg_2 , arg_1 )

Asset minifier
        Uses default minifier in bundle if it's not defined

        :rtype: static_bundle.minifiers.DefaultMinifier|None


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

def Func ( arg_0 , arg_1 ) : arg_2 = set ( arg_0 . keys ( ) + arg_1 . keys ( ) ) arg_3 = { } for arg_4 in arg_2 : if arg_0 . get ( arg_4 ) != arg_1 . get ( arg_4 ) : arg_3 [ arg_4 ] = ( arg_0 . get ( arg_4 ) , arg_1 . get ( arg_4 ) ) return arg_3

Parse the conservation predictors

        Args:
            variant(dict): A variant dictionary

        Returns:
            conservations(dict): A dictionary with the conservations


Question: Returns a normalized unit number i . e . integers Raises exception X10InvalidUnitNumber if unit number appears to be invalid

def Func ( arg_0 ) : try : try : arg_0 = int ( arg_0 ) except ValueError : raise X10InvalidUnitNumber ( '%r not a valid unit number' % arg_0 ) except TypeError : raise X10InvalidUnitNumber ( '%r not a valid unit number' % arg_0 ) if not ( 1 <= arg_0 <= 16 ) : raise X10InvalidUnitNumber ( '%r not a valid unit number' % arg_0 ) return arg_0

This method will iterate over all process in the pipeline and
        populate the nextflow configuration files with the directives
        of each process in the pipeline.


Question: Checks the Scrabble score of a single word .

def Func ( arg_0 , arg_1 , arg_2 = 0 ) : arg_3 = 0 arg_4 = 0 arg_5 = [ ] arg_6 = list ( arg_1 ) for arg_7 in arg_0 : if arg_7 in arg_6 : arg_4 += 1 arg_3 += letter_score ( arg_7 ) arg_6 . remove ( arg_7 ) else : arg_5 . append ( letter_score ( arg_7 ) ) for arg_8 in sorted ( arg_5 , reverse = True ) : if arg_2 > 0 : arg_3 += arg_8 arg_2 -= 1 if arg_4 > 6 : arg_3 += 50 return arg_3

Show Program Landing page for the Enterprise's Program.

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

        Unauthenticated learners will be redirected to enterprise-linked SSO.

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