Question: get summary ops for the magnitude of gradient updates

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { } for arg_4 in tf . trainable_variables ( ) : arg_3 [ arg_4 . name ] = [ arg_4 , None , None ] for arg_6 , arg_4 in arg_0 : arg_3 [ arg_4 . name ] [ 1 ] = arg_6 arg_3 [ arg_4 . name ] [ 2 ] = arg_1 . get_slot ( arg_4 , 'accumulator' ) arg_7 = [ ] for arg_8 , ( arg_4 , arg_6 , arg_9 ) in arg_3 . items ( ) : if arg_6 is None : continue if isinstance ( arg_6 , tf . IndexedSlices ) : arg_10 = arg_2 * arg_6 . values if arg_9 is not None : arg_10 /= tf . sqrt ( tf . gather ( arg_9 , arg_6 . indices ) ) else : arg_10 = arg_2 * arg_6 if arg_9 is not None : arg_10 /= tf . sqrt ( arg_9 ) arg_11 = tf . sqrt ( tf . reduce_sum ( arg_4 * arg_4 ) ) + 1.0e-7 arg_12 = tf . sqrt ( tf . reduce_sum ( arg_10 * arg_10 ) ) arg_7 . append ( tf . summary . scalar ( 'UPDATE/' + arg_8 . replace ( ":" , "_" ) , arg_12 / arg_11 ) ) return arg_7

This method is called before first step of simulation.


Question: wrapper for ensuring image_tag returns utf8 - encoded str on Python 2

def Func ( arg_0 ) : if py3compat . PY3 : return arg_0 def utf8_image_tag ( * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) if isinstance ( arg_3 , unicode ) : arg_3 = arg_3 . encode ( 'utf8' ) return arg_3 return utf8_image_tag

Export the contents to a file as comma separated values.

        Parameters
        ----------
        path : string
            File path where the data should be saved to

        Example
        -------
        Export the last ten elements of AME2012 to a new file:

        >>> Table('AME2012').tail(10).to_file('last_ten.txt')


Question: r Read a given BGEN file .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : assert_file_exist ( arg_0 ) assert_file_readable ( arg_0 ) arg_1 = _get_valid_metafile_filepath ( arg_0 , arg_1 ) if not os . path . exists ( arg_1 ) : if arg_3 : print ( f"We will create the metafile `{metafile_filepath}`. This file will " "speed up further\nreads and only need to be created once. So, please, " "bear with me." ) create_metafile ( arg_0 , arg_1 , arg_3 ) arg_4 = get_samples ( arg_0 , arg_2 , arg_3 ) arg_5 = map_metadata ( arg_0 , arg_1 ) arg_6 = map_genotype ( arg_0 , arg_1 , arg_3 ) return dict ( arg_5 = arg_5 , arg_4 = arg_4 , arg_6 = arg_6 )

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


Question: Return files opened by process .

def Func ( arg_0 ) : if arg_0 . pid == 0 : return [ ] arg_1 = [ ] arg_2 = _psutil_osx . get_process_open_files ( arg_0 . pid ) for arg_3 , arg_4 in arg_2 : if isfile_strict ( arg_3 ) : arg_5 = nt_openfile ( arg_3 , arg_4 ) arg_1 . append ( arg_5 ) return arg_1

Build fake MNIST-style data for unit testing.


Question: Updates the target temperature on the NuHeat API

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . SCHEDULE_HOLD ) : if arg_1 < arg_0 . min_temperature : arg_1 = arg_0 . min_temperature if arg_1 > arg_0 . max_temperature : arg_1 = arg_0 . max_temperature arg_5 = [ arg_3 . SCHEDULE_TEMPORARY_HOLD , arg_3 . SCHEDULE_HOLD ] if arg_2 not in arg_5 : raise Exception ( "Invalid mode. Please use one of: {}" . format ( arg_5 ) ) arg_0 . set_data ( { "SetPointTemp" : arg_1 , "ScheduleMode" : arg_2 } )

Try to merge processes as much is possible

    :param processes: list of processes instances


Question: This applies TFA in parallel to all LCs in a directory .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = 'hat-sql' , arg_7 = None , arg_8 = 'nearest' , arg_9 = 5.0 , arg_10 = 10.0 , arg_11 = arg_12 , arg_13 = 1000 ) : if isinstance ( arg_1 , str ) and os . path . exists ( arg_1 ) : with open ( arg_1 , 'rb' ) as infd : arg_1 = pickle . load ( infd ) try : arg_14 = get_lcformat ( arg_6 , use_lcformat_dir = arg_7 ) if arg_14 : ( arg_15 , arg_16 , arg_17 , arg_18 , arg_19 , arg_20 , arg_21 ) = arg_14 else : LOGERROR ( "can't figure out the light curve format" ) return None except Exception as e : LOGEXCEPTION ( "can't figure out the light curve format" ) return None if arg_2 is None : arg_2 = arg_15 arg_22 = sorted ( glob . glob ( os . path . join ( arg_0 , arg_2 ) ) ) return parallel_tfa_lclist ( arg_22 , arg_1 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = None , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_11 = arg_11 , arg_13 = arg_13 )

activates error messages, useful during development


Question: Calculates heatmap for function .

def Func ( arg_0 ) : with _CodeHeatmapCalculator ( ) as prof : arg_1 = arg_0 . _run_object ( * arg_0 . _run_args , ** arg_0 . _run_kwargs ) arg_2 , arg_3 = inspect . getsourcelines ( arg_0 . _run_object ) arg_4 = [ ] for arg_5 in arg_2 : arg_4 . append ( ( 'line' , arg_3 , arg_5 ) ) arg_3 += 1 arg_6 = os . path . abspath ( inspect . getsourcefile ( arg_0 . _run_object ) ) arg_7 = prof . heatmap [ arg_6 ] arg_8 = sum ( time for time in arg_7 . values ( ) ) return { 'objectName' : arg_0 . _object_name , 'runTime' : arg_8 , 'result' : arg_1 , 'timestamp' : int ( time . time ( ) ) , 'heatmaps' : [ { 'name' : arg_0 . _object_name , 'heatmap' : arg_7 , 'executionCount' : prof . execution_count [ arg_6 ] , 'srcCode' : arg_4 , 'runTime' : arg_8 } ] }

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: Return true if the given statement node raise an exception

def Func ( arg_0 : arg_1 . List ) -> bool : for arg_3 in arg_0 : if isinstance ( arg_3 , astroid . Raise ) : return True return False

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: Paste the contents of the clipboard into the input region .

def Func ( arg_0 , arg_1 = arg_2 . QClipboard . Clipboard ) : if arg_0 . _control . textInteractionFlags ( ) & QtCore . Qt . TextEditable : arg_0 . _keep_cursor_in_buffer ( ) arg_5 = arg_0 . _control . textCursor ( ) arg_6 = arg_2 . QApplication . clipboard ( ) . text ( arg_1 ) . rstrip ( ) arg_0 . _insert_plain_text_into_buffer ( arg_5 , dedent ( arg_6 ) )

private function to perform a single D-stat test


Question: Return the path to a data file of ours .

def Func ( arg_0 , arg_1 = "" ) : for arg_2 in STATIC_PATH : arg_3 = os . path . join ( arg_2 , arg_0 ) if os . path . exists ( arg_3 ) : return arg_3 if arg_1 : arg_3 = os . path . join ( arg_2 , arg_1 , arg_0 ) if os . path . exists ( arg_3 ) : return arg_3 raise CoverageException ( "Couldn't find static file %r" % arg_0 )

Receive a StateUpdate and fan out to Conversations.

        Args:
            state_update: hangouts_pb2.StateUpdate instance


Question: Helper function for PDFText to have the document add a page and retry adding a large block of text that would otherwise have been to long for the page .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . parent . document . page . cursor . copy ( ) arg_2 . x_reset ( ) arg_2 . y_reset ( ) arg_0 . parent . document . add_page ( ) arg_0 . parent . document . set_cursor ( arg_2 ) arg_0 . parent . document . add_text ( arg_1 )

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


Question: Strips links from the definition and gathers them in a links property .

def Func ( arg_0 ) : arg_1 = "\[.*?\](.*?)\[\/.*?\]" arg_2 = "\[(.*?)\]" arg_0 . links = [ ] for arg_4 in ( arg_1 , arg_2 ) : for arg_5 in re . findall ( arg_4 , arg_0 . description ) : arg_0 . links . append ( arg_5 ) arg_0 . description = re . sub ( arg_4 , "\\1" , arg_0 . description ) arg_0 . description = arg_0 . description . strip ( )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: r Replace missing value to value .

def Func ( arg_0 , arg_1 = arg_2 . nan ) : return arg_0 . __class__ ( arg_0 . mol , [ ( arg_1 if is_missing ( arg_4 ) else arg_4 ) for arg_4 in arg_0 . values ( ) ] , arg_0 . keys ( ) , )

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

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

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

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

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

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

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

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


Question: Concatenate the sequences given by seqs into a single ISeq .

def Func ( * arg_0 ) -> ISeq : arg_1 = lseq . sequence ( itertools . chain ( * filter ( None , map ( to_seq , arg_0 ) ) ) ) if arg_1 is None : return lseq . EMPTY return arg_1

Sends a POST request to initialize the live reports

        Parameters
        ----------
        report_id : str
            Hash of the report JSON as retrieved from :func:`~_get_report_hash`


Question: Stop job .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = get_job_or_local ( arg_0 . obj . get ( 'project' ) , arg_0 . obj . get ( 'job' ) ) if not arg_1 and not click . confirm ( "Are sure you want to Func " "job `{}`" . format ( arg_4 ) ) : click . echo ( 'Existing without Funcping job.' ) sys . exit ( 0 ) try : PolyaxonClient ( ) . job . Func ( arg_2 , arg_3 , arg_4 ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func job `{}`.' . format ( arg_4 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) Printer . print_success ( "Job is being Funcped." )


Question: Loads the named extension descriptor from the pool .

def Func ( arg_0 , arg_1 ) : arg_1 = _NormalizeFullyQualifiedName ( arg_1 ) arg_2 , arg_3 , arg_4 = arg_1 . rpartition ( '.' ) try : arg_5 = arg_0 . FindMessageTypeByName ( arg_2 ) except KeyError : arg_5 = arg_0 . FindFileContainingSymbol ( arg_1 ) return arg_5 . extensions_by_name [ arg_4 ]

Combines all masks from a list of arrays, and logically ors them into a single mask


Question: Returns a decorator to swallow a requests exception for modules that are not accessible without logging in and turn it into an Unavailable exception .

def Func ( arg_0 ) : def _Func ( arg_1 ) : def wrapped ( * arg_2 , ** arg_3 ) : try : return arg_1 ( * arg_2 , ** arg_3 ) except requests . exceptions . HTTPError as e : if e . response . status_code == requests . codes . unauthorized : raise access_common . Unavailable ( arg_0 ) else : raise return wrapped return _Func

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


Question: Reads a file from a path and returns data as a list of tuples of inputs and correct outputs for every data type in train valid and test .

def Func ( arg_0 , arg_1 : arg_2 , * arg_3 , ** arg_4 ) -> Dict [ arg_2 , List [ Tuple [ Any , Any ] ] ] : raise NotImplementedError

Updates a value of a given key and apply reduction


Question: Generator over all subclasses of a given class in depth - first order .

def Func ( arg_0 , arg_1 = None ) : if not isinstance ( arg_0 , type ) : raise TypeError ( 'Func must be called with ' 'new-style classes, not %.100r' % arg_0 ) if arg_1 is None : arg_1 = set ( ) try : arg_2 = arg_0 . __subclasses__ ( ) except TypeError : arg_2 = arg_0 . __subclasses__ ( arg_0 ) for arg_3 in arg_2 : if arg_3 in arg_1 : continue arg_1 . add ( arg_3 ) yield arg_3 for arg_3 in Func ( arg_3 , arg_1 ) : yield arg_3


Question: Return the most recent timestamp in the operation .

def Func ( arg_0 ) : arg_1 = get_end_time ( arg_0 ) if not arg_1 : arg_2 = get_last_event ( arg_0 ) if arg_2 : arg_1 = arg_2 [ 'timestamp' ] if not arg_1 : arg_1 = get_create_time ( arg_0 ) return arg_1

Return a node representing a disjunction of licenses.


Question: Format the calculated time into a human readable format .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return ":" . join ( list ( arg_0 . _calculate ( arg_1 , arg_2 ) . values ( ) ) )

Removes a subtree from the trajectory tree.

        Does not delete stuff from disk only from RAM.

        :param start_node: The parent node from where to start
        :param name: Name of child which will be deleted and recursively all nodes below the child
        :param predicate:

            Predicate that can be used to compute for individual nodes if they should be removed
            ``True`` or kept ``False``.


Question: Parse a string as an integer . Exit with a message on failure .

def Func ( arg_0 ) : try : arg_1 = int ( arg_0 ) except ValueError : print_err ( '\nInvalid integer: {}' . format ( arg_0 ) ) sys . exit ( 1 ) return arg_1

Return the revocations in this certificate revocation list.

        These revocations will be provided by value, not by reference.
        That means it's okay to mutate them: it won't affect this CRL.

        :return: The revocations in this CRL.
        :rtype: :class:`tuple` of :class:`Revocation`


Question: a list all search that doesn t require a query . Here we return to the user all objects that have custom properties value type set to container which is set when the image is pushed .

def Func ( arg_0 ) : arg_1 = arg_0 . _list_containers ( ) arg_2 = [ ] bot . info ( "[drive://%s] Containers" % arg_0 . _base ) arg_3 = [ ] for arg_4 in arg_1 : arg_5 = arg_4 [ 'name' ] . replace ( '.simg' , '' ) if 'properties' in arg_4 : if 'uri' in arg_4 [ 'properties' ] : arg_5 = arg_4 [ 'properties' ] [ 'uri' ] arg_3 . append ( [ arg_4 [ 'id' ] , arg_5 ] ) arg_4 [ 'uri' ] = arg_5 arg_2 . append ( arg_4 ) bot . custom ( prefix = "   [drive://%s]" % arg_0 . _base , message = "\t\t[id]\t[uri]" , color = "PURPLE" ) bot . table ( arg_3 ) return arg_2


Question: Unapply patches up to patch_name . patch_name will end up as top patch

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_0 . _check ( arg_2 ) arg_3 = arg_0 . db . patches_after ( Patch ( arg_1 ) ) for arg_4 in reversed ( arg_3 ) : arg_0 . _Func ( arg_4 ) arg_0 . db . save ( ) arg_0 . unapplied ( arg_0 . db . top_patch ( ) )

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


Question: Create a new tag

def Func ( arg_0 , arg_1 ) : arg_2 = { 'type' : 'tagit' , 'rate_count' : 0 , 'rate_range' : 'day' , 'limit_count' : 0 , 'limit_range' : 'day' , 'schedule' : [ ] , 'enabled' : True , 'args' : { 'sn' : arg_1 , 'tag_sn' : arg_1 } } return arg_0 . _post ( request = ApiActions . CREATE . value , uri = ApiUri . ACTIONS . value , params = arg_2 )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: Produces a list of ports to be updated async .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = db_api . security_group_find ( arg_1 , id = arg_2 , scope = db_api . ONE ) if not arg_4 : return None arg_5 = db_api . sg_gather_associated_ports ( arg_1 , arg_4 ) if len ( arg_5 ) == 0 : return { "ports" : 0 } for arg_6 in arg_5 : arg_7 = dict ( action = "update port %s" % arg_6 [ 'id' ] , tenant_id = arg_4 [ 'tenant_id' ] , resource_id = arg_6 [ 'id' ] , parent_id = arg_3 ) arg_7 = dict ( arg_8 = arg_7 ) arg_8 = job_api . create_job ( arg_1 . elevated ( ) , arg_7 ) arg_9 = QuarkSGAsyncConsumerClient ( ) try : arg_9 . update_port ( arg_1 , arg_6 [ 'id' ] , arg_8 [ 'id' ] ) except om_exc . MessagingTimeout : LOG . error ( "Failed to update port. Rabbit running?" ) return None

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


Question: Create an in memory DataFrame from a pandas DataFrame .

def Func ( arg_0 , arg_1 = "pandas" , arg_2 = True , arg_3 = "index" ) : import six arg_4 = vaex . dataframe . DataFrameArrays ( arg_1 ) def add ( arg_1 , arg_5 ) : arg_6 = arg_5 . values try : arg_4 . add_column ( arg_1 , arg_6 ) except Exception as e : print ( "could not convert column %s, error: %r, will try to convert it to string" % ( arg_1 , e ) ) try : arg_6 = arg_6 . astype ( "S" ) arg_4 . add_column ( arg_1 , arg_6 ) except Exception as e : print ( "Giving up column %s, error: %r" % ( arg_1 , e ) ) for arg_1 in arg_0 . columns : add ( arg_1 , arg_0 [ arg_1 ] ) if arg_2 : add ( arg_3 , arg_0 . index ) return arg_4

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


Question: wrapper for calling docker methods

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = getattr ( arg_0 . client , arg_1 ) return arg_4 ( * arg_2 , ** arg_3 )

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

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

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

    Returns:
        DataFrame: result


Question: Unload an IPython extension by its module name .

def Func ( arg_0 , arg_1 ) : if arg_1 in sys . modules : arg_2 = sys . modules [ arg_1 ] arg_0 . _call_unload_ipython_extension ( arg_2 )

Scans String.

        Compares the byte, word, or double word specified with the memory operand
        with the value in the AL, AX, EAX, or RAX register, and sets the status flags
        according to the results. The memory operand address is read from either
        the ES:RDI, ES:EDI or the ES:DI registers (depending on the address-size
        attribute of the instruction, 32 or 16, respectively)::

                IF (byte comparison)
                THEN
                    temp  =  AL - SRC;
                    SetStatusFlags(temp);
                    THEN IF DF  =  0
                        THEN (E)DI  =  (E)DI + 1;
                        ELSE (E)DI  =  (E)DI - 1;
                        FI;
                    ELSE IF (word comparison)
                        THEN
                            temp  =  AX - SRC;
                            SetStatusFlags(temp)
                            THEN IF DF  =  0
                                THEN (E)DI  =  (E)DI + 2;
                                ELSE (E)DI  =  (E)DI - 2;
                                FI;
                     ELSE (* doubleword comparison *)
                           temp  =  EAX - SRC;
                           SetStatusFlags(temp)
                           THEN IF DF  =  0
                                THEN
                                    (E)DI  =  (E)DI + 4;
                                ELSE
                                    (E)DI  =  (E)DI - 4;
                                FI;
                           FI;
                     FI;

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


Question: Diagnose a port .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : LOG . info ( "Func %s" % arg_2 ) try : arg_4 = arg_0 . _client . show_port ( arg_2 ) except Exception as e : arg_5 = "failed fetching downstream port: %s" % ( str ( e ) ) LOG . exception ( arg_5 ) raise IronicException ( arg_5 = arg_5 ) return { "downstream_port" : arg_4 }

Downloads the latest Raspbian image and writes it to a microSD card.

        Based on the instructions from:

        https://www.raspberrypi.org/documentation/installation/installing-images/linux.md


Question: Called after executing a step .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = ExtensionDebugger ( 'Func' ) for arg_6 in arg_0 . exts : with arg_5 ( arg_6 ) : arg_6 . Func ( arg_1 , arg_2 , arg_3 , arg_4 ) return arg_4

Store the HTTP status and headers to be sent when self.write is
        called.


Question: Updates record and returns True if record is complete after update else False .

def Func ( arg_0 , arg_1 = True , arg_2 = False , ** arg_3 ) : if arg_3 : arg_0 . __init__ ( partial = arg_1 , arg_2 = arg_2 , ** arg_3 ) return not arg_0 . _partial if not arg_2 and CACHE . get ( hash ( arg_0 ) ) : arg_4 = CACHE [ hash ( arg_0 ) ] for arg_5 in arg_0 . _SIMPLE_FIELDS | arg_0 . _COMPLEX_FIELDS : arg_6 = getattr ( arg_4 , arg_5 ) setattr ( arg_0 , arg_5 , arg_6 ) arg_0 . _partial = False logging . info ( f'Loading {str(self)} from cache' ) return True arg_8 = element_lookup_by_id ( arg_0 . type , arg_0 . id ) arg_0 . __init__ ( partial = False , ** arg_8 ) return True

Sets the new size and buffer size internally


Question: Deallocate a scaling IP .

def Func ( arg_0 , arg_1 ) : LOG . info ( 'Func %s for tenant %s' % ( arg_1 , arg_0 . tenant_id ) ) _delete_flip ( arg_0 , arg_1 , ip_types . SCALING )

Attempts to find the Teradata install directory with the defaults
    for a given platform.  Should always return `None` when the defaults
    are not present and the TERADATA_HOME environment variable wasn't
    explicitly set to the correct install location.


Question: Delta step for event dependent processes

def Func ( arg_0 ) -> Generator [ None , None , None ] : arg_1 = [ ] for arg_2 in arg_0 . _seqProcsToRun : try : arg_3 = arg_0 . _outputContainers [ arg_2 ] except KeyError : arg_3 = None arg_2 ( arg_0 , arg_3 ) if arg_3 is not None : arg_1 . append ( arg_3 ) arg_0 . _seqProcsToRun = UniqList ( ) arg_0 . FuncPlaned = False for arg_6 in arg_1 : for arg_7 , arg_8 in arg_6 . _all_signals : arg_9 = getattr ( arg_6 , arg_7 ) if arg_9 is not None : arg_10 = arg_0 . _conflictResolveStrategy ( arg_9 ) arg_11 , arg_12 = arg_10 arg_8 . simUpdateVal ( arg_0 , arg_11 ) setattr ( arg_6 , arg_7 , None ) return yield

Translates round trip symbols to sectors.

    Parameters
    ----------
    round_trips : pd.DataFrame
        DataFrame with one row per round trip trade.
        - See full explanation in round_trips.extract_round_trips
    sector_mappings : dict or pd.Series, optional
        Security identifier to sector mapping.
        Security ids as keys, sectors as values.

    Returns
    -------
    sector_round_trips : pd.DataFrame
        Round trips with symbol names replaced by sector names.


Question: Merge two datasets based on common column names . We do not support all_x = True and all_y = True . Only one can be True or none is True . The default merge method is auto and it will default to the radix method . The radix method will return the correct merge result regardless of duplicated rows in the right frame . In addition the radix method can perform merge even if you have string columns in your frames . If there are duplicated rows in your rite frame they will not be included if you use the hash method . The hash method cannot perform merge if you have string columns in your left frame . Hence we consider the radix method superior to the hash method and is the default method to use .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False , arg_4 = None , arg_5 = None , arg_6 = "auto" ) : if arg_4 is None and arg_5 is None : arg_7 = list ( set ( arg_0 . names ) & set ( arg_1 . names ) ) if not arg_7 : raise H2OValueError ( "No columns in common to Func on!" ) if arg_4 is None : arg_4 = [ arg_0 . names . index ( c ) for c in arg_7 ] else : arg_4 = _getValidCols ( arg_4 , arg_0 ) if arg_5 is None : arg_5 = [ arg_1 . names . index ( c ) for c in arg_7 ] else : arg_5 = _getValidCols ( arg_5 , arg_1 ) return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) )


Question: Returns index transforms for name .

def Func ( arg_0 , arg_1 ) : arg_1 = arg_1 . decode ( 'utf-8' ) try : return arg_0 . Funces [ arg_1 ] except KeyError : raise KeyError ( 'Index "%s" has not been registered with ' 'this FC store.' % arg_1 )


Question: Parse a Project Haystack scalar in ZINC format .

def Func ( arg_0 , arg_1 ) : try : return hs_scalar [ arg_1 ] . parseString ( arg_0 , parseAll = True ) [ 0 ] except pp . ParseException as pe : raise ZincParseException ( 'Failed to parse scalar: %s' % reformat_exception ( pe ) , arg_0 , 1 , pe . col ) except : LOG . debug ( 'Failing scalar data: %r (version %r)' , arg_0 , arg_1 )


Question: Format catalog item output

def Func ( arg_0 : arg_1 [ arg_2 , arg_2 ] ) -> str : arg_3 = "" for arg_4 , arg_5 in arg_0 . items ( ) : arg_3 += "**" + str ( arg_4 ) + "**" + ': ' + str ( arg_5 ) + "  \n" return arg_3

select sentences in terms of maximum coverage problem

    Args:
      text: text to be summarized (unicode string)
      char_limit: summary length (the number of characters)

    Returns:
      list of extracted sentences

    Reference:
      Hiroya Takamura, Manabu Okumura.
      Text summarization model based on maximum coverage problem and its
      variant. (section 3)
      http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.222.6945


Question: Query STS for a users account_id

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , ) : arg_4 = get_client ( 'sts' , arg_0 , arg_1 , arg_2 , arg_3 , ) return arg_4 . get_caller_identity ( ) . get ( 'Account' )

Get base-64 encoded data as a string for the given image. Fallback to return
    fallback_image_file if cannot get the image data or img is None.
    @param {Image} img - The PIL Image to get src data for
    @param {String} fallback_image_file - The filename of the image file,
        to be used when image data capture fails
    @return {String} The base-64 encoded image data string, or path to the file
        itself if not supported.


Question: Add point light

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . point_lights . append ( PointLight ( arg_1 , arg_2 ) )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: update secrets will update metadata needed for pull and search

def Func ( arg_0 ) : arg_0 . token = arg_0 . _required_get_and_update ( 'SREGISTRY_GITLAB_TOKEN' ) arg_0 . headers [ "Private-Token" ] = arg_0 . token

Drop a node from the network

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


Question: Remove max = null parameter from URL .

def Func ( arg_0 ) : arg_0 = str ( arg_0 ) arg_1 = urllib . parse . urlparse ( arg_0 ) if not arg_1 . scheme or not arg_1 . netloc or not arg_1 . path : raise ValueError ( "'next_url' must be a valid API endpoint URL, minimally " "containing a scheme, netloc and path." ) if arg_1 . query : arg_2 = arg_1 . query . split ( '&' ) if 'max=null' in arg_2 : arg_2 . remove ( 'max=null' ) warnings . warn ( "`max=null` still present in next-URL returned " "from Webex Teams" , RuntimeWarning ) arg_3 = '&' . join ( arg_2 ) arg_1 = list ( arg_1 ) arg_1 [ 4 ] = arg_3 return urllib . parse . urlunparse ( arg_1 )

Convert a given month into our unified format.

        :param data: The month to convert or shorten.
        :type data: str

        :return: The unified month name.
        :rtype: str


Question: Replace old_pages with new_pages within fileobj .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_2 [ 0 ] . sequence for arg_5 , arg_6 in zip ( arg_3 , range ( arg_4 , arg_4 + len ( arg_3 ) ) ) : arg_5 . sequence = arg_6 arg_5 . serial = arg_2 [ 0 ] . serial arg_3 [ 0 ] . first = arg_2 [ 0 ] . first arg_3 [ 0 ] . last = arg_2 [ 0 ] . last arg_3 [ 0 ] . continued = arg_2 [ 0 ] . continued arg_3 [ - 1 ] . first = arg_2 [ - 1 ] . first arg_3 [ - 1 ] . last = arg_2 [ - 1 ] . last arg_3 [ - 1 ] . complete = arg_2 [ - 1 ] . complete if not arg_3 [ - 1 ] . complete and len ( arg_3 [ - 1 ] . packets ) == 1 : arg_3 [ - 1 ] . position = - 1 arg_13 = b'' . join ( arg_0 . write ( p ) for p in arg_3 ) arg_14 = len ( arg_13 ) arg_1 . seek ( arg_2 [ 0 ] . offset , 0 ) insert_bytes ( arg_1 , arg_14 , arg_2 [ 0 ] . offset ) arg_1 . seek ( arg_2 [ 0 ] . offset , 0 ) arg_1 . write ( arg_13 ) arg_15 = arg_2 [ 0 ] . offset + arg_14 arg_2 . reverse ( ) for arg_16 in arg_2 : arg_17 = arg_16 . offset + arg_14 delete_bytes ( arg_1 , arg_16 . size , arg_17 ) if len ( arg_2 ) != len ( arg_3 ) : arg_1 . seek ( arg_15 , 0 ) arg_8 = arg_3 [ - 1 ] . serial arg_7 = arg_3 [ - 1 ] . sequence + 1 arg_0 . renumber ( arg_1 , arg_8 , arg_7 )

Gets the base class for the custom database back-end.

    This should be the Django PostgreSQL back-end. However,
    some people are already using a custom back-end from
    another package. We are nice people and expose an option
    that allows them to configure the back-end we base upon.

    As long as the specified base eventually also has
    the PostgreSQL back-end as a base, then everything should
    work as intended.


Question: Load AirflowPlugin subclasses from the entrypoints provided . The entry_point group should be airflow . plugins .

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 : log . debug ( 'Importing entry_point plugin %s' , arg_2 . name ) arg_3 = arg_2 . load ( ) if is_valid_plugin ( arg_3 , arg_1 ) : if callable ( getattr ( arg_3 , 'on_load' , None ) ) : arg_3 . on_load ( ) arg_1 . append ( arg_3 ) return arg_1

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


Question: Create a new knitting pattern .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_3 is None : arg_3 = arg_0 . new_row_collection ( ) return arg_0 . _spec . Func ( arg_1 , arg_2 , arg_3 , arg_0 )


Question: Takes a single address and returns the current balance .

def Func ( arg_0 ) : arg_1 = Address . transactions ( arg_0 ) Func = 0 for arg_3 in arg_1 : if arg_3 . recipientId == arg_0 : Func += arg_3 . amount if arg_3 . senderId == arg_0 : Func -= ( arg_3 . amount + arg_3 . fee ) arg_4 = Delegate . delegates ( ) for arg_3 in arg_4 : if arg_0 == arg_3 . address : arg_5 = Delegate . blocks ( arg_3 . pubkey ) for arg_6 in arg_5 : Func += ( arg_6 . reward + arg_6 . totalFee ) if Func < 0 : arg_7 = Node . height ( ) logger . fatal ( 'Negative balance for address {0}, Nodeheight: {1)' . format ( arg_0 , arg_7 ) ) raise NegativeBalanceError ( 'Negative balance for address {0}, Nodeheight: {1)' . format ( arg_0 , arg_7 ) ) return Func

Return the metadata for the specified course run.

        The course run needs to be included in the specified EnterpriseCustomerCatalog
        in order for metadata to be returned from this endpoint.


Question: Subtract metabolites from a reaction .

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : arg_0 . add_metabolites ( { arg_4 : - arg_5 for arg_4 , arg_5 in iteritems ( arg_1 ) } , arg_2 = arg_2 , arg_3 = arg_3 )

Collect the learner completion data from the course certificate.

        Used for Instructor-paced courses.

        If no certificate is found, then returns the completed_date = None, grade = In Progress, on the idea that a
        certificate will eventually be generated.

        Args:
            enterprise_enrollment (EnterpriseCourseEnrollment): the enterprise enrollment record for which we need to
            collect completion/grade data

        Returns:
            completed_date: Date the course was completed, this is None if course has not been completed.
            grade: Current grade in the course.
            is_passing: Boolean indicating if the grade is a passing grade or not.


Question: Creates a Dataset with unknown size . Resize it before using .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . float32 ) : if arg_1 in arg_0 . _datasets : return arg_0 . _datasets [ arg_1 ] arg_5 = arg_0 . _group . create_dataset ( arg_1 , ( 1 , 1 ) , maxshape = None , arg_2 = arg_2 ) arg_0 . _datasets [ arg_1 ] = arg_5 return arg_5

Remove procid from waitlists and reestablish it in the running list


Question: Register nemo and parses annotations

def Func ( arg_0 , arg_1 ) : arg_0 . __nemo__ = arg_1 for arg_3 in arg_0 . __annotations__ : arg_3 . target . expanded = frozenset ( arg_0 . __getinnerreffs__ ( objectId = arg_3 . target . objectId , subreference = arg_3 . target . subreference ) )

Called when there is an error in the websocket


Question: For each string find the count of all possible substrings with 2 characters or more that are contained in the line - separated text file whose path is given .

def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , str ) arg_2 = H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 ) ) arg_2 . _ex . _cache . nrows = arg_0 . nrow arg_2 . _ex . _cache . ncol = arg_0 . ncol return arg_2


Question: Builds the python source code for the Parser TokenType enum .

def Func ( arg_0 ) : arg_1 = "class TokenType(Enum):\n" "{indent}\"\"\"The token types for parse nodes generated by the Parser.\"\"\"\n" "{indent}" + "\n{indent}" . join ( "{1} = {0}" . format ( num + 1 , r . name ) for num , r in enumerate ( arg_0 . rules ) ) return arg_1 . format ( indent = arg_0 . indent )

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: Initialize repositories directory path

def Func ( arg_0 ) : if arg_0 . parsed_args . git_log : arg_1 = arg_0 . parsed_args . git_log elif not arg_0 . parsed_args . git_path : arg_2 = os . path . expanduser ( '~/.perceval/repositories/' ) arg_3 = arg_0 . parsed_args . uri . lstrip ( '/' ) arg_1 = os . path . join ( arg_2 , arg_3 ) + '-git' else : arg_1 = arg_0 . parsed_args . git_path setattr ( arg_0 . parsed_args , 'gitpath' , arg_1 )

An integer-valued dimension bounded between `min` <= x <= `max`.
        Note that the right endpoint of the interval includes `max`.

        When `warp` is None, the base measure associated with this dimension
        is a categorical distribution with each weight on each of the integers
        in [min, max]. With `warp == 'log'`, the base measure is a uniform
        distribution on the log of the variable, with bounds at `log(min)` and
        `log(max)`. This is appropriate for variables that are "naturally" in
        log-space. Other `warp` functions are not supported (yet), but may be
        at a later time. Please note that this functionality is not supported
        for `hyperopt_tpe`.


Question: Parse out a list of requirements from the given requirements requirements file .

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = None for arg_3 in open ( arg_0 , 'r' ) . read ( ) . strip ( ) . split ( '\n' ) : if not arg_3 . strip ( ) : continue if not arg_3 . startswith ( '#' ) : arg_1 . append ( arg_3 ) continue arg_4 = re . search ( r'^# === [Pp]ython (?P<op>[<>=]{1,2}) ' r'(?P<major>[\d])\.(?P<minor>[\d]+) ===[\s]*$' , arg_3 ) if arg_4 : arg_2 = arg_4 . groupdict ( ) for arg_5 in ( 'major' , 'minor' ) : arg_2 [ arg_5 ] = int ( arg_2 [ arg_5 ] ) continue if ' ' not in arg_3 [ 1 : ] . strip ( ) and arg_2 : arg_6 = arg_3 [ 1 : ] . strip ( ) arg_7 = arg_2 [ 'op' ] arg_8 = ( arg_2 [ 'major' ] , arg_2 [ 'minor' ] ) if '=' in arg_7 and sys . version_info [ 0 : 2 ] == arg_8 : arg_1 . append ( arg_6 ) elif '>' in arg_7 and sys . version_info [ 0 : 2 ] > arg_8 : arg_1 . append ( arg_6 ) elif '<' in arg_7 and sys . version_info [ 0 : 2 ] < arg_8 : arg_1 . append ( arg_6 ) return arg_1

Use this method decorator to ensure the JWT token is refreshed when needed.


Question: check mean insert size for this sample and update hackersonly . max_inner_mate_distance if need be . This value controls how far apart mate pairs can be to still be considered for bedtools merging downstream .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ipyrad . bins . samtools , "stats" , arg_1 . files . mapped_reads ] arg_3 = [ "grep" , "SN" ] arg_4 = sps . Popen ( arg_2 , stderr = sps . STDOUT , stdout = sps . PIPE ) arg_5 = sps . Popen ( arg_3 , stderr = sps . STDOUT , stdout = sps . PIPE , stdin = arg_4 . stdout ) arg_6 = arg_5 . communicate ( ) [ 0 ] if arg_5 . returncode : raise IPyradWarningExit ( "error in %s: %s" , arg_3 , arg_6 ) arg_7 = 0 arg_8 = 0 arg_9 = 0 for arg_10 in arg_6 . split ( "\n" ) : if "insert size average" in arg_10 : arg_7 = float ( arg_10 . split ( ":" ) [ - 1 ] . strip ( ) ) elif "insert size standard deviation" in arg_10 : arg_8 = float ( arg_10 . split ( ":" ) [ - 1 ] . strip ( ) ) + 0.1 elif "average length" in arg_10 : arg_9 = float ( arg_10 . split ( ":" ) [ - 1 ] . strip ( ) ) LOGGER . debug ( "avg {} stdv {} avg_len {}" . format ( arg_7 , arg_8 , arg_9 ) ) if all ( [ arg_7 , arg_8 , arg_9 ] ) : if arg_8 < 5 : arg_8 = 5. if ( 2 * arg_9 ) < arg_7 : arg_11 = arg_7 + ( 3 * np . math . ceil ( arg_8 ) ) - ( 2 * arg_9 ) else : arg_11 = ( arg_7 - arg_9 ) + ( 3 * np . math . ceil ( arg_8 ) ) LOGGER . info ( "stdv: hacked insert size is %s" , arg_11 ) arg_0 . _hackersonly [ "max_inner_mate_distance" ] = int ( np . math . ceil ( arg_11 ) ) else : arg_0 . _hackersonly [ "max_inner_mate_distance" ] = 300 LOGGER . debug ( "inner mate distance for {} - {}" . format ( arg_1 . name , arg_0 . _hackersonly [ "max_inner_mate_distance" ] ) )

This function returns a dictionary representation of a docker-compose.yml file, based on assembled_specs from
    the spec_assembler, and port_specs from the port_spec compiler


Question: Multiply this frame viewed as a matrix by another matrix .

def Func ( arg_0 , arg_1 ) : if arg_0 . ncols != arg_1 . nrows : raise H2OValueError ( "Matrix is not compatible for Funciplication with the current frame" ) return H2OFrame . _expr ( expr = ExprNode ( "x" , arg_0 , arg_1 ) )

Remove hidden notes and tag a CERN if detected.


Question: Parses the handshake for protocol alerts

def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 in parse_tls_records ( arg_0 ) : if arg_1 != b'\x15' : continue if len ( arg_3 ) != 2 : return None return ( int_from_bytes ( arg_3 [ 0 : 1 ] ) , int_from_bytes ( arg_3 [ 1 : 2 ] ) ) return None

Get a texture by its label

        Args:
            label (str): The Label for the texture

        Returns:
            The py:class:`moderngl.Texture` instance


Question: Returns the indices of the predictive cells .

def Func ( arg_0 ) : arg_1 = None arg_2 = [ ] for arg_3 in arg_0 . activeSegments : if arg_3 . cell != arg_1 : arg_2 . append ( arg_3 . cell ) arg_1 = arg_3 . cell return arg_2

Generates a 'code_verifier' as described in section 4.1 of RFC 7636.

    This is a 'high-entropy cryptographic random string' that will be
    impractical for an attacker to guess.

    Args:
        n_bytes: integer between 31 and 96, inclusive. default: 64
            number of bytes of entropy to include in verifier.

    Returns:
        Bytestring, representing urlsafe base64-encoded random data.


Question: Calls reset on all our Preprocessor objects .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . preprocessors : arg_1 . extend ( arg_2 . Func ( ) or [ ] ) return arg_1

Add noise to the given input.

  Parameters:
  -----------------------------------------------
  input:         the input to add noise to
  noise:         how much noise to add
  doForeground:  If true, turn off some of the 1 bits in the input
  doBackground:  If true, turn on some of the 0 bits in the input


Question: Translate a glob PATTERN to a regular expression .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in _iexplode_path ( arg_0 ) : arg_1 . append ( Func_part ( arg_2 ) ) arg_3 = '[%s]' % re . escape ( SEPARATORS ) arg_4 = _join_translated ( arg_1 , arg_3 ) return '{res}\\Z(?ms)' . format ( arg_4 = arg_4 )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Decompose an observed time series into contributions from each component .

def Func ( arg_0 , arg_1 , arg_2 ) : with tf . compat . v1 . name_scope ( 'Func' , values = [ arg_1 ] ) : [ arg_1 , arg_3 ] = sts_util . canonicalize_observed_time_series_with_mask ( arg_1 ) arg_4 = dist_util . prefer_static_value ( tf . shape ( input = arg_1 ) ) [ - 2 ] arg_5 = arg_0 . make_state_space_model ( arg_4 = arg_4 , param_vals = arg_2 ) arg_6 , arg_7 = arg_5 . posterior_marginals ( arg_1 , mask = arg_3 ) return _decompose_from_posterior_marginals ( arg_0 , arg_6 , arg_7 , arg_2 )

Set a property value or remove a property.

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

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

        This default implementation

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

        Removing a non-existing prop is NOT an error.

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

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


Question: Find an effect class by class name or full python path to class

def Func ( arg_0 , arg_1 ) -> Type [ Effect ] : arg_2 , arg_3 = parse_package_string ( arg_1 ) if arg_2 : arg_4 = arg_0 . get_package ( arg_2 ) return arg_4 . Func ( arg_3 , raise_for_error = True ) for arg_4 in arg_0 . packages : arg_5 = arg_4 . Func ( arg_3 ) if arg_5 : return arg_5 raise EffectError ( "No effect class '{}' found in any packages" . format ( arg_3 ) )

Get the snapshot of a content for the given version.

        :param content_id: fetch the snapshot of this content
        :param version: snapshot version of the content


Question: Return process bounds for zoom level .

def Func ( arg_0 , arg_1 = None ) : return ( ) if arg_0 . area_at_zoom ( arg_1 ) . is_empty else Bounds ( * arg_0 . area_at_zoom ( arg_1 ) . bounds )

Parses arguments for the command.

        :param argv:
            Arguments to pass to the argument parser.
            If ``None``, defaults to ``sys.argv[1:]``.


Question: Calculates the angle between two points .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = degrees ( atan ( ( arg_4 - arg_2 ) / ( arg_3 - arg_1 + 0.00001 ) ) ) + 360 if arg_3 - arg_1 < 0 : arg_5 += 180 return arg_5

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: This implements the MIME - type matching logic for deciding whether to run make_clean_html

def Func ( arg_0 , arg_1 ) : if len ( arg_0 . include_mime_types ) == 0 : return True if arg_1 is None : return False arg_1 = arg_1 . lower ( ) return any ( arg_1 . startswith ( arg_2 ) for arg_2 in arg_0 . include_mime_types )

Return record `n` as 1,024 bytes; records are indexed from 1.


Question: Function to format a warning the standard way .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : try : arg_5 = unicode except NameError : arg_5 = ( ) try : arg_0 = str ( arg_0 ) except UnicodeEncodeError : pass arg_6 = "%s: %s: %s\n" % ( arg_3 , arg_1 . __name__ , arg_0 ) arg_4 = linecache . getline ( arg_2 , arg_3 ) if arg_4 is None else arg_4 if arg_4 : arg_4 = arg_4 . strip ( ) if isinstance ( arg_6 , arg_5 ) and isinstance ( arg_4 , str ) : arg_4 = unicode ( arg_4 , 'latin1' ) arg_6 += "  %s\n" % arg_4 if isinstance ( arg_6 , arg_5 ) and isinstance ( arg_2 , str ) : arg_7 = sys . getfilesystemencoding ( ) if arg_7 : try : arg_2 = unicode ( arg_2 , arg_7 ) except UnicodeDecodeError : pass arg_6 = "%s:%s" % ( arg_2 , arg_6 ) return arg_6


Question: clear the cursor

def Func ( arg_0 , arg_1 ) : if arg_0 . useblit : arg_0 . background = ( arg_0 . canvas . copy_from_bbox ( arg_0 . canvas . figure . bbox ) ) for arg_3 in arg_0 . vlines + arg_0 . hlines : arg_3 . set_visible ( False ) arg_0 . ellipse . set_visible ( False )

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


Question: Add an observer callback to this notification center .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : assert ( arg_1 != None ) arg_0 . registered_types . add ( arg_2 ) arg_0 . registered_senders . add ( arg_3 ) arg_0 . observers . setdefault ( ( arg_2 , arg_3 ) , set ( ) ) . add ( arg_1 )

An integer-valued dimension bounded between `min` <= x <= `max`.
        Note that the right endpoint of the interval includes `max`.

        When `warp` is None, the base measure associated with this dimension
        is a categorical distribution with each weight on each of the integers
        in [min, max]. With `warp == 'log'`, the base measure is a uniform
        distribution on the log of the variable, with bounds at `log(min)` and
        `log(max)`. This is appropriate for variables that are "naturally" in
        log-space. Other `warp` functions are not supported (yet), but may be
        at a later time. Please note that this functionality is not supported
        for `hyperopt_tpe`.


Question: Removes whitespace from the assembly contig names

def Func ( arg_0 ) : arg_1 = "fixed_assembly.fa" with open ( arg_0 ) as in_hf , open ( arg_1 , "w" ) as ou_fh : for arg_2 in in_hf : if arg_2 . startswith ( ">" ) : arg_3 = arg_2 . replace ( " " , "_" ) ou_fh . write ( arg_3 ) else : ou_fh . write ( arg_2 ) return arg_1


Question: Compares initial security group rules with current sg rules .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 : arg_5 = arg_1 [ arg_4 ] [ sg_cli . SECURITY_GROUP_HASH_ATTR ] arg_6 = arg_2 [ arg_4 ] [ sg_cli . SECURITY_GROUP_HASH_ATTR ] arg_7 = ( 'security group rules were changed for vif "%s" while' ' executing xapi_client.update_interfaces.' ' Will not ack rule.' % arg_4 ) if len ( arg_5 ) != len ( arg_6 ) : arg_3 . append ( arg_4 ) LOG . info ( arg_7 ) elif len ( arg_5 ) > 0 : for arg_8 in arg_6 : if arg_8 not in arg_5 : arg_3 . append ( arg_4 ) LOG . info ( arg_7 ) break arg_9 = [ group for group in arg_0 if group not in arg_3 ] return arg_9

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


Question: Launch minterm from pyserial

def Func ( arg_0 = arg_1 ( ) , arg_2 = '9600' ) : arg_3 = [ 'nodemcu-uploader' , arg_0 , arg_2 ] arg_4 . argv = arg_3 miniterm . main ( )

Loads the tables from the gtfs object and counts the number of rows that have null values in
        fields that should not be null. Stores the number of null rows in warnings_container


Question: Prints information about the current user .

def Func ( arg_0 ) : arg_1 = arg_0 [ 'email' ] arg_2 = arg_0 [ 'account' ] [ 'domain' ] arg_3 = arg_0 [ 'role' ] print ( 'You are logged-in to the "{0}" domain ' 'as {1} with role {2}.' . format ( arg_2 , arg_1 , arg_3 ) )

Call the timeout handlers due.

        :Return: (next_event_timeout, sources_handled) tuple.
            next_event_timeout is number of seconds until the next timeout
            event, sources_handled is number of handlers called.


Question: Get BibDocs for Invenio 2 .

def Func ( arg_0 ) : from invenio . legacy . dbquery import run_sql return ( arg_1 [ 0 ] for arg_1 in run_sql ( 'select id_bibrec from ' 'bibrec_bibdoc as r join bibdoc as d on r.id_bibdoc=d.id ' 'where d.modification_date >=%s' , ( arg_0 , ) , run_on_slave = True ) )

Register elasticsearch templates for events.


Question: Class method that will return a Record object by ID and the domain .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 ( token = arg_1 , arg_2 = arg_2 , id = arg_3 ) arg_4 . load ( ) return arg_4

Handle marking messages as read and keeping client active.


Question: Generate a list of n random ports near the given port .

def Func ( arg_0 , arg_1 ) : for arg_2 in range ( min ( 5 , arg_1 ) ) : yield arg_0 + arg_2 for arg_2 in range ( arg_1 - 5 ) : yield arg_0 + random . randint ( - 2 * arg_1 , 2 * arg_1 )

Called when builder group collect files
        Resolves absolute url if relative passed

        :type asset: static_bundle.builders.Asset
        :type builder: static_bundle.builders.StandardBuilder


Question: h function is straight - line distance from a node s state to goal .

def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_0 . grapFunc , 'locations' , None ) if arg_2 : return int ( distance ( arg_2 [ arg_1 . state ] , arg_2 [ arg_0 . goal ] ) ) else : return infinity

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: Sign this with a private key

def Func ( arg_0 , arg_1 ) : if arg_0 . v : raise InvalidSignature ( "already Funced" ) if arg_1 in ( 0 , '' , '\x00' * 32 ) : raise InvalidSignature ( "Zero privkey cannot Func" ) arg_2 = sha3 ( rlp . encode ( arg_0 , arg_0 . __class__ . exclude ( [ 'v' , 'r' , 's' ] ) ) ) if len ( arg_1 ) == 64 : arg_1 = encode_privkey ( arg_1 , 'bin' ) arg_3 = PrivateKey ( arg_1 , raw = True ) arg_4 = arg_3 . ecdsa_recoverable_serialize ( arg_3 . ecdsa_Func_recoverable ( arg_2 , raw = True ) ) arg_4 = arg_4 [ 0 ] + chr ( arg_4 [ 1 ] ) arg_0 . v = ord ( arg_4 [ 64 ] ) + 27 arg_0 . r = big_endian_to_int ( arg_4 [ 0 : 32 ] ) arg_0 . s = big_endian_to_int ( arg_4 [ 32 : 64 ] ) arg_0 . _sender = None return arg_0


Question: Main executor of the trimmomatic_report template .

def Func ( arg_0 ) : arg_1 = OrderedDict ( ) for arg_2 in arg_0 : arg_3 = arg_2 . rstrip ( "_trimlog.txt" ) arg_1 [ arg_3 ] = parse_log ( arg_2 ) os . remove ( arg_2 ) write_report ( arg_1 , "trimmomatic_report.csv" , arg_3 )


Question: Make a GET request using the session object to a SuccessFactors endpoint for inactive learners .

def Func ( arg_0 ) : arg_1 = datetime . datetime . utcnow ( ) if arg_1 >= arg_0 . expires_at : arg_0 . session . close ( ) arg_0 . _create_session ( ) arg_2 = '{sapsf_base_url}/{search_students_path}?$filter={search_filter}' . format ( sapsf_base_url = arg_0 . enterprise_configuration . sapsf_base_url . rstrip ( '/' ) , search_students_path = arg_0 . global_sap_config . search_student_api_path . rstrip ( '/' ) , search_filter = 'criteria/isActive eq False&$select=studentID' , ) arg_3 = arg_0 . _call_search_students_recursively ( arg_2 , arg_3 = [ ] , page_size = 500 , start_at = 0 ) return arg_3

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


Question: Saves TreeItem model under certain Tree . Handles item s parent assignment exception .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_4 : if arg_2 . parent is not None and arg_2 . parent . id == arg_2 . id : arg_2 . parent = arg_0 . previous_parent messages . warning ( arg_1 , _ ( "Item's parent left unchanged. Item couldn't be parent to itself." ) , '' , True ) arg_2 . tree = arg_0 . tree arg_2 . save ( )

Return new rrule with same attributes except for those attributes given new
           values by whichever keyword arguments are specified.


Question: Extract contour lines from an array .

def Func ( arg_0 , arg_1 , arg_2 = 100 , arg_3 = 'elev' , arg_4 = 0 ) : import matplotlib . pyplot as plt arg_5 = _get_contour_values ( arg_0 . min ( ) , arg_0 . max ( ) , arg_2 = arg_2 , arg_4 = arg_4 ) if not arg_5 : return [ ] arg_6 = plt . contour ( arg_0 , arg_5 ) arg_7 = 0 arg_8 = [ ] for arg_9 in range ( len ( arg_6 . collections ) ) : arg_10 = arg_5 [ arg_7 ] arg_7 += 1 arg_11 = arg_6 . collections [ arg_9 ] . get_paths ( ) for arg_12 in arg_11 : arg_13 = [ ( arg_1 . left + ( y * arg_1 . pixel_x_size ) , arg_1 . top - ( x * arg_1 . pixel_y_size ) , ) for x , y in zip ( arg_12 . vertices [ : , 1 ] , arg_12 . vertices [ : , 0 ] ) ] if len ( arg_13 ) >= 2 : arg_8 . append ( dict ( properties = { arg_3 : arg_10 } , geometry = mapping ( LineString ( arg_13 ) ) ) ) return arg_8

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Call the configuration hook for plugins

def Func ( arg_0 ) : for arg_1 in arg_0 . _dynamic_plugins : arg_2 = modutils . load_module_from_name ( arg_1 ) if hasattr ( arg_2 , "load_configuration" ) : arg_2 . load_configuration ( arg_0 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Calculates log loss .

def Func ( arg_0 : arg_1 [ arg_2 [ arg_2 [ arg_3 ] ] , arg_2 [ arg_2 [ arg_4 ] ] , arg_5 . ndarray ] , arg_7 : arg_1 [ arg_2 [ arg_2 [ arg_3 ] ] , arg_2 [ arg_2 [ arg_4 ] ] , arg_5 . ndarray ] ) -> arg_3 : return log_loss ( arg_0 , arg_7 )

Interactive prompting to populate the readme.


Question: Fetch the pull requests from the repository .

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . issues ( arg_1 = arg_1 ) for arg_3 in arg_2 : arg_4 = json . loads ( arg_3 ) for arg_5 in arg_4 : if "pull_request" not in arg_5 : continue arg_6 = arg_5 [ "number" ] arg_7 = urijoin ( arg_0 . base_url , 'repos' , arg_0 . owner , arg_0 . repository , "Func" , arg_6 ) arg_8 = arg_0 . fetch ( arg_7 ) arg_9 = arg_8 . text yield arg_9

Overriding the default JSONEncoder.default for NDB support.


Question: Set the session state .

async def Func ( arg_0 , arg_1 ) : await arg_0 . _can_run ( ) arg_1 = arg_1 . encode ( arg_0 . encoding ) if isinstance ( arg_1 , six . text_type ) else arg_1 return await arg_0 . _mgmt_request_response ( REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION , { 'session-id' : arg_0 . session_id , 'session-state' : bytearray ( arg_1 ) } , mgmt_handlers . default )

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


Question: Edit a block .

def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_0 . _get_index ( arg_1 ) if arg_1 is None : return if arg_1 > 0 : arg_1 -= 1 arg_2 = arg_0 . shell . mktempfile ( arg_0 . src_blocks [ arg_1 ] ) arg_0 . shell . hooks . Funcor ( arg_2 , 1 ) arg_3 = file_read ( arg_2 ) arg_0 . src_blocks [ arg_1 ] = arg_3 arg_0 . src_blocks_colored [ arg_1 ] = arg_0 . ip_colorize ( arg_3 ) arg_0 . block_index = arg_1 arg_0 ( )

Register a file reader for use in parse_config_file.

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

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

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

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

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


Question: Serialize a dataframe .

def Func ( arg_0 , arg_1 , arg_2 ) : _not_none ( 'writer' , arg_0 ) _not_none_or_empty ( 'data_type_id' , arg_1 ) _not_none ( 'dataframe' , arg_2 ) arg_3 = _SERIALIZERS . get ( arg_1 ) if arg_3 is None : raise UnsupportedDatasetTypeError ( arg_1 ) arg_3 [ 0 ] ( arg_0 = arg_0 , arg_2 = arg_2 )


Question: Adds an entity that matches the given lines .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : Entity . verify_name ( arg_1 ) arg_0 . entities . add ( Entity . wrap_name ( arg_1 ) , arg_2 , arg_3 ) arg_0 . padaos . Func ( arg_1 , arg_2 ) arg_0 . must_train = True

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 a class representing the kind of optic .

def Func ( arg_0 ) : arg_1 = [ Equality , Isomorphism , Prism , Review , Lens , Traversal , Getter , Setter , Fold , ] for arg_2 in arg_1 : if arg_0 . _is_Func ( arg_2 ) : return arg_2

Edit a block.

        If no number is given, use the last block executed.

        This edits the in-memory copy of the demo, it does NOT modify the
        original source file.  If you want to do that, simply open the file in
        an editor and use reload() when you make changes to the file.  This
        method is meant to let you change a block during a demonstration for
        explanatory purposes, without damaging your original script.


Question: Updates the timestamp for the given channel id .

def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_0 . last_update [ arg_1 ] = arg_2 except KeyError : arg_0 . log . warning ( "Attempted ts update of channel %s, but channel " "not present anymore." , arg_0 . channel_directory [ arg_1 ] )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Look for removed attributes

def Func ( arg_0 , arg_1 ) : if arg_1 . attrname == "xreadlines" : arg_0 . add_message ( "xreadlines-attribute" , arg_1 = arg_1 ) return arg_2 = "message" try : for arg_3 in arg_1 . expr . infer ( ) : if isinstance ( arg_3 , astroid . Instance ) and utils . inherit_from_std_ex ( arg_3 ) : if arg_1 . attrname == arg_2 : if arg_2 in arg_3 . instance_attrs : continue arg_0 . add_message ( "exception-message-attribute" , arg_1 = arg_1 ) if isinstance ( arg_3 , astroid . Module ) : arg_0 . _warn_if_deprecated ( arg_1 , arg_3 . name , { arg_1 . attrname } , report_on_modules = False ) except astroid . InferenceError : return


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

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 == RACKETT : arg_3 = Rackett ( arg_1 , arg_0 . Tc , arg_0 . Pc , arg_0 . Zc ) elif arg_2 == YAMADA_GUNN : arg_3 = Yamada_Gunn ( arg_1 , arg_0 . Tc , arg_0 . Pc , arg_0 . omega ) elif arg_2 == BHIRUD_NORMAL : arg_3 = Bhirud_normal ( arg_1 , arg_0 . Tc , arg_0 . Pc , arg_0 . omega ) elif arg_2 == TOWNSEND_HALES : arg_3 = Townsend_Hales ( arg_1 , arg_0 . Tc , arg_0 . Vc , arg_0 . omega ) elif arg_2 == HTCOSTALD : arg_3 = COSTALD ( arg_1 , arg_0 . Tc , arg_0 . Vc , arg_0 . omega ) elif arg_2 == YEN_WOODS_SAT : arg_3 = Yen_Woods_saturation ( arg_1 , arg_0 . Tc , arg_0 . Vc , arg_0 . Zc ) elif arg_2 == MMSNM0 : arg_3 = SNM0 ( arg_1 , arg_0 . Tc , arg_0 . Vc , arg_0 . omega ) elif arg_2 == MMSNM0FIT : arg_3 = SNM0 ( arg_1 , arg_0 . Tc , arg_0 . Vc , arg_0 . omega , arg_0 . SNM0_delta_SRK ) elif arg_2 == CAMPBELL_THODOS : arg_3 = Campbell_Thodos ( arg_1 , arg_0 . Tb , arg_0 . Tc , arg_0 . Pc , arg_0 . MW , arg_0 . dipole ) elif arg_2 == HTCOSTALDFIT : arg_3 = COSTALD ( arg_1 , arg_0 . Tc , arg_0 . COSTALD_Vchar , arg_0 . COSTALD_omega_SRK ) elif arg_2 == RACKETTFIT : arg_3 = Rackett ( arg_1 , arg_0 . Tc , arg_0 . Pc , arg_0 . RACKETT_Z_RA ) elif arg_2 == PERRYDIPPR : arg_4 , arg_5 , arg_6 , arg_7 = arg_0 . DIPPR_coeffs arg_3 = 1. / EQ105 ( arg_1 , arg_4 , arg_5 , arg_6 , arg_7 ) elif arg_2 == CRC_INORG_L : arg_8 = CRC_inorganic ( arg_1 , arg_0 . CRC_INORG_L_rho , arg_0 . CRC_INORG_L_k , arg_0 . CRC_INORG_L_Tm ) arg_3 = rho_to_Vm ( arg_8 , arg_0 . CRC_INORG_L_MW ) elif arg_2 == VDI_PPDS : arg_4 , arg_5 , arg_6 , arg_7 = arg_0 . VDI_PPDS_coeffs arg_9 = 1. - arg_1 / arg_0 . VDI_PPDS_Tc arg_8 = arg_0 . VDI_PPDS_rhoc + arg_4 * arg_9 ** 0.35 + arg_5 * arg_9 ** ( 2 / 3. ) + arg_6 * arg_9 + arg_7 * arg_9 ** ( 4 / 3. ) arg_3 = rho_to_Vm ( arg_8 , arg_0 . VDI_PPDS_MW ) elif arg_2 == CRC_INORG_L_CONST : arg_3 = arg_0 . CRC_INORG_L_CONST_Vm elif arg_2 == COOLPROP : arg_3 = 1. / CoolProp_T_dependent_property ( arg_1 , arg_0 . CASRN , 'DMOLAR' , 'l' ) elif arg_2 in arg_0 . tabular_data : arg_3 = arg_0 . interpolate ( arg_1 , arg_2 ) return arg_3

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


Question: Runs the algorithms with the specified identifiers on the audio_file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0 ) : if arg_3 [ "features" ] . features . shape [ 0 ] <= msaf . config . minimum_frames : logging . warning ( "Audio file too short, or too many few beats " "estimated. Returning empty estimations." ) return np . asarray ( [ 0 , arg_3 [ "features" ] . dur ] ) , np . asarray ( [ 0 ] , dtype = int ) arg_5 = get_boundaries_module ( arg_1 ) arg_6 = get_labels_module ( arg_2 ) arg_7 = arg_3 [ "features" ] . frame_times arg_8 = run_hierarchical if arg_3 [ "hier" ] else run_flat arg_9 , arg_10 = arg_8 ( arg_0 , arg_5 , arg_6 , arg_7 , arg_3 , arg_4 ) return arg_9 , arg_10

Called to create the control, which must derive from wxControl.


Question: Prime FFTW with knowledge of which FFTs are best on this machine by loading wisdom from the file wisdomfile

def Func ( arg_0 ) : if arg_0 is None : return try : pyfftw . import_wisdom ( pickle . load ( open ( arg_0 , 'rb' ) ) ) except ( IOError , TypeError ) as e : log . warn ( "No wisdom present, generating some at %r" % arg_0 ) save_wisdom ( arg_0 )


Question: Register this capture agent at the Matterhorn admin server so that it shows up in the admin interface .

def Func ( arg_0 = 'idle' ) : if config ( ) [ 'agent' ] [ 'backup_mode' ] : return arg_1 = [ ( 'address' , config ( ) [ 'ui' ] [ 'url' ] ) , ( 'state' , arg_0 ) ] arg_2 = urlquote ( config ( ) [ 'agent' ] [ 'name' ] . encode ( 'utf-8' ) , safe = '' ) arg_3 = '%s/agents/%s' % ( config ( ) [ 'service-capture.admin' ] [ 0 ] , arg_2 ) try : arg_4 = http_request ( arg_3 , arg_1 ) . decode ( 'utf-8' ) if arg_4 : logger . info ( arg_4 ) except pycurl . error as e : logger . warning ( 'Could not set agent state to %s: %s' % ( arg_0 , e ) )

Returns the index of the type as defined in the LAS Specification

    Parameters
    ----------
    type_str: str

    Returns
    -------
    int
        index of the type


Question: Remove the padding from chunks .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : if arg_4 is None : arg_4 = range ( len ( arg_2 ) ) arg_5 = len ( arg_2 ) * [ False , ] for arg_6 in range ( len ( arg_5 ) ) : if arg_6 in arg_4 and arg_3 [ arg_6 ] != 0 : arg_5 [ arg_6 ] = True arg_7 = [ 0 if ( arg_6 == 0 or not m ) else p for ( arg_6 , m , p ) in zip ( arg_0 , arg_5 , arg_3 ) ] arg_8 = [ None if ( arg_6 == n - 1 or not m ) else - p for ( arg_6 , m , p , n ) in zip ( arg_0 , arg_5 , arg_3 , arg_2 ) ] arg_9 = [ slice ( i1 , i2 ) for ( i1 , i2 ) in zip ( arg_7 , arg_8 ) ] return arg_1 [ arg_9 ]

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


Question: To support weak referencing removes cache key from the cache value .

def Func ( arg_0 , arg_1 ) : return _Mapping ( x = None if arg_1 == "x" else arg_0 . x , y = None if arg_1 == "y" else arg_0 . y , ildj = arg_0 . ildj , kwargs = arg_0 . kwargs )

Serial command to set seasons table.

        If no dictionary is passed, the meter object buffer is used.

        Args:
            cmd_dict (dict): Optional dictionary of season schedules.
            password (str): Optional password

        Returns:
            bool: True on completion and ACK.


Question: Return the license name from an ExtractedLicense or None

def Func ( arg_0 , arg_1 ) : arg_2 = list ( arg_0 . graph . triples ( ( arg_1 , arg_0 . spdx_namespace [ 'licenseName' ] , None ) ) ) if len ( arg_2 ) > 1 : arg_0 . more_than_one_error ( 'extracted license name' ) return elif len ( arg_2 ) == 0 : return return arg_0 . to_special_value ( arg_2 [ 0 ] [ 2 ] )

Input validation for standard estimators.

    Checks X and y for consistent length, enforces X 2d and y 1d.
    Standard input checks are only applied to y. For multi-label y,
    set multi_ouput=True to allow 2d and sparse y.

    Parameters
    ----------
    X : nd-array, list or sparse matrix
        Input data.

    y : nd-array, list or sparse matrix
        Labels.

    accept_sparse : string, list of string or None (default=None)
        String[s] representing allowed sparse matrix formats, such as 'csc',
        'csr', etc.  None means that sparse matrix input will raise an error.
        If the input is sparse but not in the allowed format, it will be
        converted to the first listed format.

    order : 'F', 'C' or None (default=None)
        Whether an array will be forced to be fortran or c-style.

    copy : boolean (default=False)
        Whether a forced copy will be triggered. If copy=False, a copy might
        be triggered by a conversion.

    force_all_finite : boolean (default=True)
        Whether to raise an error on np.inf and np.nan in X.

    ensure_2d : boolean (default=True)
        Whether to make X at least 2d.

    allow_nd : boolean (default=False)
        Whether to allow X.ndim > 2.

    Returns
    -------
    X_converted : object
        The converted and validated X.


Question: This concatenates all text LCs for an objectid with the given aperture .

def Func ( arg_0 , arg_1 , arg_2 = 'TF1' , arg_3 = '.gz' , arg_4 = 'rjd' , arg_5 = True , arg_6 = True ) : LOGINFO ( 'looking for light curves for %s, aperture %s in directory: %s' % ( arg_1 , arg_2 , arg_0 ) ) if arg_6 is False : arg_7 = glob . glob ( os . path . join ( arg_0 , '*%s*%s*%s' % ( arg_1 , arg_2 , arg_3 ) ) ) else : if sys . version_info [ : 2 ] > ( 3 , 4 ) : arg_7 = glob . glob ( os . path . join ( arg_0 , '**' , '*%s*%s*%s' % ( arg_1 , arg_2 , arg_3 ) ) , arg_6 = True ) LOGINFO ( 'found %s files: %s' % ( len ( arg_7 ) , repr ( arg_7 ) ) ) else : arg_8 = os . walk ( arg_0 ) arg_7 = [ ] for arg_9 , arg_10 , arg_11 in arg_8 : for arg_12 in arg_10 : arg_13 = os . path . join ( arg_9 , arg_12 , '*%s*%s*%s' % ( arg_1 , arg_2 , arg_3 ) ) arg_14 = glob . glob ( arg_13 ) if arg_14 : arg_7 . extend ( arg_14 ) LOGINFO ( 'found %s in dir: %s' % ( repr ( arg_14 ) , os . path . join ( arg_9 , arg_12 ) ) ) if arg_7 and len ( arg_7 ) > 0 : arg_15 = concatenate_textlcs ( arg_7 , arg_4 = arg_4 , arg_5 = arg_5 ) return arg_15 else : LOGERROR ( 'did not find any light curves for %s and aperture %s' % ( arg_1 , arg_2 ) ) return None

Restricts a function in n-dimensions to a given direction.

  Suppose f: R^n -> R. Then given a point x0 and a vector p0 in R^n, the
  restriction of the function along that direction is defined by:

  ```None
  g(t) = f(x0 + t * p0)
  ```

  This function performs this restriction on the given function. In addition, it
  also computes the gradient of the restricted function along the restriction
  direction. This is equivalent to computing `dg/dt` in the definition above.

  Args:
    value_and_gradients_function: Callable accepting a single real `Tensor`
      argument of shape `[..., n]` and returning a tuple of a real `Tensor` of
      shape `[...]` and a real `Tensor` of shape `[..., n]`. The multivariate
      function whose restriction is to be computed. The output values of the
      callable are the function value and the gradients at the input argument.
    position: `Tensor` of real dtype and shape consumable by
      `value_and_gradients_function`. Corresponds to `x0` in the definition
      above.
    direction: `Tensor` of the same dtype and shape as `position`. The direction
      along which to restrict the function. Note that the direction need not
      be a unit vector.

  Returns:
    restricted_value_and_gradients_func: A callable accepting a tensor of shape
      broadcastable to `[...]` and same dtype as `position` and returning a
      namedtuple of `Tensors`. The input tensor is the parameter along the
      direction labelled `t` above. The return value contains fields:
        x: A real `Tensor` of shape `[...]`. The input value `t` where the line
          function was evaluated, after any necessary broadcasting.
        f: A real `Tensor` of shape `[...]` containing the value of the
          function at the point `position + t * direction`.
        df: A real `Tensor` of shape `[...]` containing the derivative at
          `position + t * direction`.
        full_gradient: A real `Tensor` of shape `[..., n]`, the full gradient
          of the original `value_and_gradients_function`.


Question: From the pattern decomposition finds the absolute paths matching the pattern .

def Func ( arg_0 , arg_1 ) : ( arg_2 , arg_3 , arg_4 , arg_5 ) = arg_0 . _decompose_pattern ( arg_1 ) arg_6 = glob . glob ( arg_2 ) arg_7 = [ ] for arg_8 in arg_6 : if arg_4 == [ ] : arg_7 . append ( ( arg_8 , { } ) ) continue arg_9 = re . match ( arg_3 , arg_8 ) if arg_9 is None : continue arg_10 = arg_9 . groupdict ( ) . items ( ) arg_11 = dict ( ( k , arg_5 . get ( k , str ) ( v ) ) for ( k , v ) in arg_10 ) arg_7 . append ( ( arg_8 , arg_11 ) ) return arg_7

Handle marking messages as read and keeping client active.


Question: When checking a function definition of lambda function prepare has_equal_x for checking the call of a user - defined function .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_0 . assert_is ( [ "function_defs" , "lambda_functions" ] , "Func" , [ "check_function_def" , "check_lambda_function" ] , ) if arg_3 is None : arg_3 = "To verify it, we reran {{argstr}}. " arg_4 , arg_5 = build_call ( arg_1 , arg_0 . student_parts [ "node" ] ) arg_6 , arg_7 = build_call ( arg_1 , arg_0 . solution_parts [ "node" ] ) arg_8 = { "msg" : arg_3 , "kwargs" : { "argstr" : arg_2 or arg_5 } } arg_9 = part_to_child ( arg_4 , arg_6 , arg_8 , arg_0 ) return arg_9

Method to refresh API tokens from ecobee


Question: Disables computation of the second derivatives for a tensor .

def Func ( arg_0 ) : def grad ( arg_1 ) : return array_ops . prevent_gradient ( arg_1 , message = "Second derivative is not implemented." ) return tf . identity ( arg_0 ) , grad

Returns the dictionary of CORS specific app configurations.


Question: Learn empirical variances from X .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ : , 'X' ] if isinstance ( arg_1 , DictRDD ) else arg_1 check_rdd ( arg_2 , ( np . ndarray , sp . spmatrix ) ) def mapper ( arg_2 ) : arg_2 = check_array ( arg_2 , ( 'csr' , 'csc' ) , dtype = np . float64 ) if hasattr ( arg_2 , "toarray" ) : arg_3 , arg_4 = mean_variance_axis ( arg_2 , axis = 0 ) else : arg_3 , arg_4 = np . mean ( arg_2 , axis = 0 ) , np . var ( arg_2 , axis = 0 ) return arg_2 . shape [ 0 ] , arg_3 , arg_4 def reducer ( arg_5 , arg_6 ) : arg_7 , arg_8 , arg_9 = arg_5 arg_10 , arg_11 , arg_12 = arg_6 arg_13 = arg_7 + arg_10 arg_14 = ( ( arg_8 * arg_7 ) + ( arg_11 * arg_10 ) ) / arg_13 arg_15 = ( ( ( arg_7 * arg_9 ) + ( arg_10 * arg_12 ) ) / arg_13 ) + ( ( arg_7 * arg_10 ) * ( ( arg_11 - arg_8 ) / arg_13 ) ** 2 ) return ( arg_13 , arg_14 , arg_15 ) arg_16 , arg_16 , arg_0 . variances_ = arg_2 . map ( mapper ) . treeReduce ( reducer ) if np . all ( arg_0 . variances_ <= arg_0 . threshold ) : arg_18 = "No feature in X meets the variance threshold {0:.5f}" if arg_2 . shape [ 0 ] == 1 : arg_18 += " (X contains only one sample)" raise ValueError ( arg_18 . format ( arg_0 . threshold ) ) return arg_0


Question: Gets schedule information for a team - season .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_year_doc ( '{}_games' . format ( arg_1 ) ) arg_3 = arg_2 ( 'table#games' ) arg_4 = sportsref . utils . parse_table ( arg_3 ) return arg_4


Question: Return a string representation of the Python object

def Func ( arg_0 , arg_1 ) : arg_2 = { float_types : lambda x : '{:.{}g}' . Func ( x , arg_1 . digits ) , } for arg_3 , arg_4 in arg_2 . items ( ) : if isinstance ( arg_0 , arg_3 ) : return arg_4 ( arg_0 ) try : if six . PY2 and isinstance ( arg_0 , six . string_types ) : return str ( arg_0 . encode ( 'utf-8' ) ) return str ( arg_0 ) except : return 'OBJECT'

Awake one process waiting to receive data on fd


Question: Plots output of compute_sector_exposures as area charts

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_2 is None : arg_2 = plt . gca ( ) if arg_1 is None : arg_3 = SECTORS . values ( ) else : arg_3 = arg_1 . values ( ) arg_4 = plt . cm . gist_rainbow ( np . linspace ( 0 , 1 , 11 ) ) arg_2 . stackplot ( arg_0 [ 0 ] . index , arg_0 , labels = arg_3 , colors = arg_4 , alpha = 0.8 , baseline = 'zero' ) arg_2 . axhline ( 0 , color = 'k' , linestyle = '-' ) arg_2 . set ( title = 'Gross exposure to sectors' , ylabel = 'Proportion of gross exposure \n in sectors' ) return arg_2

Set a property value or remove a property.

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

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

        This default implementation

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

        Removing a non-existing prop is NOT an error.

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

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


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

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( KeyWrappingData , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . WRAPPING_METHOD , arg_6 ) : arg_0 . _wrapping_method = primitives . Enumeration ( enum = arg_3 . WrappingMethod , tag = arg_3 . Tags . WRAPPING_METHOD ) arg_0 . _wrapping_method . Func ( arg_6 , arg_2 = arg_2 ) else : raise ValueError ( "Invalid struct missing the wrapping method attribute." ) if arg_0 . is_tag_next ( arg_3 . Tags . ENCRYPTION_KEY_INFORMATION , arg_6 ) : arg_0 . _encryption_key_information = EncryptionKeyInformation ( ) arg_0 . _encryption_key_information . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . MAC_SIGNATURE_KEY_INFORMATION , arg_6 ) : arg_0 . _mac_signature_key_information = MACSignatureKeyInformation ( ) arg_0 . _mac_signature_key_information . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . MAC_SIGNATURE , arg_6 ) : arg_0 . _mac_signature = primitives . ByteString ( tag = arg_3 . Tags . MAC_SIGNATURE ) arg_0 . _mac_signature . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . IV_COUNTER_NONCE , arg_6 ) : arg_0 . _iv_counter_nonce = primitives . ByteString ( tag = arg_3 . Tags . IV_COUNTER_NONCE ) arg_0 . _iv_counter_nonce . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . ENCODING_OPTION , arg_6 ) : arg_0 . _encoding_option = primitives . Enumeration ( enum = arg_3 . EncodingOption , tag = arg_3 . Tags . ENCODING_OPTION ) arg_0 . _encoding_option . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 )

Get distribution version.

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

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


Question: Generates a rsync of all deployable code .

def Func ( arg_0 ) : assert arg_0 . genv . SITE , 'Site unspecified.' assert arg_0 . genv . ROLE , 'Role unspecified.' arg_1 = arg_0 . local_renderer if arg_0 . env . exclusions : arg_1 . env . exclusions_str = ' ' . join ( "--exclude='%s'" % _ for _ in arg_0 . env . exclusions ) arg_1 . local ( arg_1 . env . rsync_command ) arg_1 . sudo ( 'chown -R {rsync_chown_user}:{rsync_chown_group} {rsync_dst_dir}' )

Convert this unnormalized batch to an instance of Batch.

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

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

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


Question: Draws the network highlighting active queues .

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . g for arg_3 in arg_2 . nodes ( ) : arg_0 . g . set_vp ( arg_3 , 'vertex_color' , [ 0 , 0 , 0 , 0.9 ] ) arg_4 = False arg_5 = arg_2 . in_edges ( arg_3 ) if arg_2 . is_directed ( ) else arg_2 . out_edges ( arg_3 ) for arg_6 in arg_5 : arg_7 = arg_2 . edge_index [ arg_6 ] if arg_0 . edge2queue [ arg_7 ] . _active : arg_4 = True break if arg_4 : arg_0 . g . set_vp ( arg_3 , 'vertex_fill_color' , arg_0 . colors [ 'vertex_active' ] ) else : arg_0 . g . set_vp ( arg_3 , 'vertex_fill_color' , arg_0 . colors [ 'vertex_inactive' ] ) for arg_6 in arg_2 . edges ( ) : arg_7 = arg_2 . edge_index [ arg_6 ] if arg_0 . edge2queue [ arg_7 ] . _active : arg_0 . g . set_ep ( arg_6 , 'edge_color' , arg_0 . colors [ 'edge_active' ] ) else : arg_0 . g . set_ep ( arg_6 , 'edge_color' , arg_0 . colors [ 'edge_inactive' ] ) arg_0 . draw ( update_colors = False , ** arg_1 ) arg_0 . _update_all_colors ( )

Returns a decorator to swallow a requests exception for modules that
        are not accessible without logging in, and turn it into an Unavailable
        exception.


Question: Choose n random cells to learn from .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : if arg_4 <= 0 : return [ ] arg_6 = numpy . where ( arg_5 == 1 ) if len ( arg_6 [ 0 ] ) == 0 : return [ ] if arg_3 is None : arg_7 = [ syn for syn in zip ( arg_6 [ 0 ] , arg_6 [ 1 ] ) ] else : arg_8 = set ( ( syn [ 0 ] , syn [ 1 ] ) for syn in arg_3 . syns ) arg_7 = [ syn for syn in zip ( arg_6 [ 0 ] , arg_6 [ 1 ] ) if ( syn [ 0 ] , syn [ 1 ] ) not in arg_8 ] if len ( arg_7 ) <= arg_4 : return arg_7 if arg_4 == 1 : arg_9 = arg_0 . _random . getUInt32 ( len ( arg_7 ) ) return [ arg_7 [ arg_9 ] ] arg_10 = numpy . array ( [ arg_12 for arg_12 in range ( len ( arg_7 ) ) ] , dtype = 'uint32' ) arg_11 = numpy . zeros ( min ( arg_4 , len ( arg_10 ) ) , dtype = 'uint32' ) arg_0 . _random . sample ( arg_10 , arg_11 ) return sorted ( [ arg_7 [ arg_12 ] for arg_12 in arg_11 ] )

Add the absolute value of an expression to the model.

    Also defines a variable for the absolute value that can be used in other
    objectives or constraints.

    Parameters
    ----------
    model : a cobra model
       The model to which to add the absolute expression.
    expression : A sympy expression
       Must be a valid expression within the Model's solver object. The
       absolute value is applied automatically on the expression.
    name : string
       The name of the newly created variable.
    ub : positive float
       The upper bound for the variable.
    difference : positive float
        The difference between the expression and the variable.
    add : bool
        Whether to add the variable to the model at once.

    Returns
    -------
    namedtuple
        A named tuple with variable and two constraints (upper_constraint,
        lower_constraint) describing the new variable and the constraints
        that assign the absolute value of the expression to it.


Question: Checks to see if property is specified in options . If not reads the default value from the schema

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 not in arg_2 : arg_3 = arg_0 [ 'properties' ] [ arg_1 ] if 'default' in arg_3 : arg_2 [ arg_1 ] = arg_3 [ 'default' ] else : arg_2 [ arg_1 ] = None

Look through the jobs table and reactivate all that are already in the
    running state by setting their _eng_allocate_new_workers fields to True;
    used by Nupic Scheduler as part of its failure-recovery procedure.


Question: Set whether we print or not when this signal is caught .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 : arg_0 . sigs [ arg_1 ] . print_method = arg_0 . dbgr . intf [ - 1 ] . msg else : arg_0 . sigs [ arg_1 ] . print_method = None pass return arg_2

Write the index.html file for this report.


Question: Return the model as a YAML document .

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_3 = model_to_dict ( arg_0 , arg_1 = arg_1 ) arg_3 [ "version" ] = YAML_SPEC return yaml . dump ( arg_3 , ** arg_2 )

Say the workers to finish their jobs and quit.


Question: Send a request to the REST API

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , ** arg_4 ) : arg_5 = arg_0 . format_request_url ( arg_2 , * arg_3 ) arg_6 = getattr ( requests , arg_1 ) arg_7 = arg_0 . get_request_headers ( ) arg_8 = arg_0 . format_parameters ( ** arg_4 ) arg_9 = arg_6 ( arg_5 , arg_7 = arg_7 , arg_10 = arg_8 ) arg_10 = arg_0 . get_response ( arg_9 ) if arg_9 . status_code >= 300 : arg_11 = arg_10 . pop ( 'message' , 'API request returned error' ) raise APIError ( arg_11 , arg_9 . status_code , ** arg_10 ) return arg_10

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: Compute the RECI fit score

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 = np . reshape ( minmax_scale ( arg_1 ) , ( - 1 , 1 ) ) arg_2 = np . reshape ( minmax_scale ( arg_2 ) , ( - 1 , 1 ) ) arg_3 = PolynomialFeatures ( degree = arg_0 . degree ) arg_4 = arg_3 . fit_transform ( arg_1 ) arg_4 [ : , 1 ] = 0 arg_4 [ : , 2 ] = 0 arg_5 = LinearRegression ( ) arg_5 . fit ( arg_4 , arg_2 ) arg_6 = arg_5 . predict ( arg_4 ) arg_7 = mean_squared_error ( arg_6 , arg_2 ) return arg_7

Apply all filters to issues and pull requests.

        :param dict older_tag: All issues before this tag's date will be
                               excluded. May be special value, if new tag is
                               the first tag. (Means **older_tag** is when
                               the repo  was created.)
        :param dict newer_tag: All issues after this tag's date  will be
                               excluded. May be title of unreleased section.
        :rtype: list(dict), list(dict)
        :return: Filtered issues and pull requests.


Question: Convenience method that returns a cursor for the prompt position .

def Func ( arg_0 ) : arg_1 = arg_0 . _control . textCursor ( ) arg_1 . setPosition ( arg_0 . _prompt_pos ) return arg_1

Load the configuration.

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

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

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


Question: Extract a name to index dictionary from 6dof settings xml

def Func ( arg_0 ) : arg_1 = ET . fromstring ( arg_0 ) arg_2 = { } for arg_3 , arg_4 in enumerate ( arg_1 . findall ( "*/Body/Name" ) ) : arg_2 [ arg_4 . text . strip ( ) ] = arg_3 return arg_2

Whether a connection can be established between those two meshes.


Question: Return the contents of a named file as a list of lines .

def Func ( arg_0 ) : try : arg_1 = open ( arg_0 ) except IOError : return [ ] else : arg_2 = arg_1 . readlines ( ) arg_1 . close ( ) return arg_2

Checks if sting is valid for bidirectional printing.


Question: Adds all parameters to traj

def Func ( arg_0 ) : print ( 'Adding Parameters' ) arg_0 . f_add_parameter ( 'neuron.V_init' , 0.0 , comment = 'The initial condition for the ' 'membrane potential' ) arg_0 . f_add_parameter ( 'neuron.I' , 0.0 , comment = 'The externally applied current.' ) arg_0 . f_add_parameter ( 'neuron.tau_V' , 10.0 , comment = 'The membrane time constant in milliseconds' ) arg_0 . f_add_parameter ( 'neuron.tau_ref' , 5.0 , comment = 'The refractory period in milliseconds ' 'where the membrane potnetial ' 'is clamped.' ) arg_0 . f_add_parameter ( 'simulation.duration' , 1000.0 , comment = 'The duration of the experiment in ' 'milliseconds.' ) arg_0 . f_add_parameter ( 'simulation.dt' , 0.1 , comment = 'The step size of an Euler integration step.' )

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


Question: stream is a get that will stream to file_name . Since this is a worker task it differs from the client provided version in that it requires headers .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True ) : bot . debug ( "GET %s" % arg_0 ) if DISABLE_SSL_CHECK is True : bot . warning ( 'Verify of certificates disabled! ::TESTING USE ONLY::' ) arg_4 = requests . get ( arg_0 , arg_1 = arg_1 , verify = not DISABLE_SSL_CHECK , Func = True ) if arg_4 . status_code in [ 401 , 403 ] : arg_1 = update_token ( arg_1 ) return Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) elif arg_4 . status_code == 200 : arg_5 = None if 'Content-Length' in arg_4 . headers : arg_6 = 0 arg_5 = int ( arg_4 . headers [ 'Content-Length' ] ) bot . show_progress ( arg_6 , arg_5 , length = 35 ) arg_7 = 1 << 20 with open ( arg_2 , 'wb' ) as filey : for arg_8 in arg_4 . iter_content ( arg_7 = arg_7 ) : filey . write ( arg_8 ) if arg_5 is not None : arg_6 += arg_7 bot . show_progress ( iteration = arg_6 , total = arg_5 , length = 35 , carriage_return = False ) sys . stdout . write ( '\n' ) return arg_2 bot . error ( "Problem with Func, response %s" % ( arg_4 . status_code ) ) sys . exit ( 1 )

Median absolute error regression loss

    :param y_actual: H2OFrame of actual response.
    :param y_predicted: H2OFrame of predicted response.
    :returns: median absolute error loss (best is 0.0)


Question: Extracts the session data from cookie .

def Func ( arg_0 ) : arg_1 = arg_0 . adapter . cookies . get ( arg_0 . name ) return arg_0 . _deserialize ( arg_1 ) if arg_1 else { }

Subscribe to device status messages

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

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


Question: Generate num rules from category cat optionally specifying preferred category groups preferred that should be preferred at probability preferred_ratio over other randomly - chosen rule definitions .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = 0.5 , arg_6 = None , arg_7 = True ) : import arg_8 . fields arg_8 . fields . REF_LEVEL = 1 if arg_2 is None and arg_3 is None : raise arg_8 . errors . GramFuzzError ( "cat and cat_group are None, one must be set" ) if arg_2 is None and arg_3 is not None : if arg_3 not in arg_0 . cat_group_defaults : raise arg_8 . errors . GramFuzzError ( "cat_group {!r} did not define a TOP_CAT variable" ) arg_2 = arg_0 . cat_group_defaults [ arg_3 ] if not isinstance ( arg_2 , basestring ) : raise arg_8 . errors . GramFuzzError ( "cat_group {!r}'s TOP_CAT variable was not a string" ) if arg_7 and arg_0 . _rules_processed == False : arg_0 . preprocess_rules ( ) if arg_6 is not None : arg_0 . set_max_recursion ( arg_6 ) if arg_4 is None : arg_4 = [ ] arg_11 = deque ( ) arg_12 = arg_0 . defs [ arg_2 ] arg_13 = arg_11 . append arg_14 = arg_11 . extend arg_15 = rand . choice arg_16 = rand . maybe arg_17 = utils . val arg_18 = arg_0 . defs [ arg_2 ] . keys ( ) arg_0 . _last_pref_keys = arg_0 . _get_pref_keys ( arg_2 , arg_4 ) arg_0 . _last_prefs = arg_4 arg_21 = deque ( ) arg_22 = 0 while arg_22 < arg_1 : if len ( arg_0 . _last_pref_keys ) > 0 and arg_16 ( arg_5 ) : arg_23 = arg_15 ( arg_0 . _last_pref_keys ) if arg_23 not in arg_12 : arg_23 = arg_15 ( list ( arg_18 ) ) else : arg_23 = arg_15 ( list ( arg_18 ) ) if arg_23 not in arg_12 : continue arg_24 = arg_15 ( arg_12 [ arg_23 ] ) arg_25 = { } arg_26 = deque ( ) arg_0 . pre_revert ( arg_25 ) arg_27 = None try : arg_27 = arg_17 ( arg_24 , arg_26 ) except errors . GramFuzzError as e : raise except RuntimeError as e : print ( "RUNTIME ERROR" ) arg_0 . revert ( arg_25 ) continue if arg_27 is not None : arg_14 ( arg_26 ) arg_13 ( arg_27 ) arg_22 += 1 arg_0 . post_revert ( arg_2 , arg_11 , arg_22 , arg_1 , arg_25 ) return arg_11

Print a status message about the logger.


Question: Fetch the messages that a bot can read .

def Func ( arg_0 , arg_1 = None ) : arg_2 = { } if arg_1 : arg_2 [ arg_0 . OFFSET ] = arg_1 arg_4 = arg_0 . _call ( arg_0 . UPDATES_METHOD , arg_2 ) return arg_4

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: Return the signature algorithm used in the certificate .

def Func ( arg_0 ) : arg_1 = _lib . X509_get0_tbs_sigalg ( arg_0 . _x509 ) arg_2 = _lib . OBJ_obj2nid ( arg_1 . algorithm ) if arg_2 == _lib . NID_undef : raise ValueError ( "Undefined signature algorithm" ) return _ffi . string ( _lib . OBJ_nid2ln ( arg_2 ) )


Question: Creates the required metrics modules

def Func ( arg_0 , arg_1 ) : if not arg_1 : return arg_0 . __metricSpecs = arg_1 for arg_3 in arg_1 : if not InferenceElement . validate ( arg_3 . inferenceElement ) : raise ValueError ( "Invalid inference element for metric spec: %r" % arg_3 ) arg_0 . __metrics . append ( metrics . getModule ( arg_3 ) ) arg_0 . __metricLabels . append ( arg_3 . getLabel ( ) )


Question: Transform duration into a human - readable form .

def Func ( arg_0 , arg_1 ) : arg_2 = "" arg_3 , arg_1 = divmod ( arg_1 , 60 ) if arg_3 >= 60 : arg_4 , arg_3 = divmod ( arg_3 , 60 ) arg_2 = "%sh " % arg_4 arg_2 += "%sm %ss" % ( arg_3 , arg_1 ) return arg_2

Removes a subtree from the trajectory tree.

        Does not delete stuff from disk only from RAM.

        :param start_node: The parent node from where to start
        :param name: Name of child which will be deleted and recursively all nodes below the child
        :param predicate:

            Predicate that can be used to compute for individual nodes if they should be removed
            ``True`` or kept ``False``.


Question: Returns all the records

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . fields [ 0 ] . numRecords assert ( all ( arg_3 . numRecords == arg_2 for arg_3 in arg_0 . fields ) ) for arg_4 in range ( arg_2 ) : arg_1 . append ( arg_0 . getRecord ( arg_4 ) ) return arg_1


Question: Pretty print a pandas DataFrame .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : if isinstance ( arg_0 , pd . Series ) : arg_0 = pd . DataFrame ( arg_0 ) if arg_1 is not None : arg_0 . columns . name = arg_1 arg_6 = arg_0 . to_html ( arg_2 = arg_2 , arg_3 = arg_3 ) if arg_4 is not None : arg_7 = arg_6 . split ( '
' ) [ 1 ] . split ( '
' ) [ 0 ] . count ( '' ) arg_8 = '' for arg_1 , arg_9 in arg_4 . items ( ) : arg_8 += ( '\n
%s	' + '%s
' ) % ( arg_1 , arg_7 , arg_9 ) arg_6 = arg_6 . replace ( '
' , '
' + arg_8 ) display ( HTML ( arg_6 ) )

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


Question: translate gui2py attribute name from pythoncard legacy code

def Func ( arg_0 , arg_1 ) : arg_2 = PYTHONCARD_PROPERTY_MAP . get ( arg_1 ) if arg_2 : print "WARNING: property %s should be %s (%s)" % ( arg_1 , arg_2 , arg_0 . obj . name ) return arg_2 else : return arg_1

Read the file and perform any transforms to get a loaded image


Question: Remove direct links in the training sets .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = set ( ) arg_4 = arg_1 + arg_2 for arg_5 in arg_4 : arg_3 . add ( ( arg_5 . head , arg_5 . tail ) ) arg_6 = filterfalse ( lambda arg_5 : ( arg_5 . head , arg_5 . tail ) in arg_3 or ( arg_5 . tail , arg_5 . head ) in arg_3 , arg_0 ) return list ( arg_6 )

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: Send an item into a generator expecting a final return value

def Func ( arg_0 , arg_1 ) : try : arg_0 . send ( arg_1 ) except StopIteration as e : return stopiter_value ( e ) else : raise RuntimeError ( 'generator did not return as expected' )

Returns opened file object for writing dialog logs.

        Returns:
            log_file: opened Python file object.


Question: publish value to status

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . log . debug ( "Publishing status: %s/%s: %s" , arg_0 . __class__ . __name__ , arg_1 , arg_2 ) arg_0 . core . Func ( arg_0 . __class__ . __name__ , arg_1 , arg_2 )

Return the correspond math mode latex string.