Question: Return enterprise customer instance for given user .

def Func ( arg_0 ) : arg_1 = apps . get_model ( 'enterprise' , 'EnterpriseCustomerUser' ) try : return arg_1 . objects . get ( user_id = arg_0 . id ) . enterprise_customer except arg_1 . DoesNotExist : return None

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

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

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


Question: Sends a POST request to initialize the live reports

def Func ( arg_0 , arg_1 ) : logger . debug ( "Sending initial POST request to {} to start report live" " update" . format ( arg_0 . broadcast_address ) ) try : with open ( ".metadata.json" ) as fh : arg_2 = [ json . load ( fh ) ] except : arg_2 = [ ] arg_3 = { "data" : { "results" : arg_2 } } try : requests . post ( arg_0 . broadcast_address , json = { "run_id" : arg_1 , "report_json" : arg_3 , "status" : arg_0 . status_info } ) except requests . exceptions . ConnectionError : logger . error ( colored_print ( "ERROR: Could not establish connection with server. The server" " may be down or there is a problem with your internet " "connection." , "red_bold" ) ) sys . exit ( 1 )

Returns protobuf mapcontainer. Read from translation file.


Question: If peptide lengths not specified then try using the default lengths associated with this predictor object . If those aren t a valid non - empty sequence of integers then raise an exception . Otherwise return the peptide lengths .

def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = arg_0 . default_peptide_lengths if not arg_1 : raise ValueError ( ( "Must either provide 'peptide_lengths' argument " "or set 'default_peptide_lengths" ) ) if isinstance ( arg_1 , int ) : arg_1 = [ arg_1 ] require_iterable_of ( arg_1 , int ) for arg_2 in arg_1 : if ( arg_0 . min_peptide_length is not None and arg_2 < arg_0 . min_peptide_length ) : raise ValueError ( "Invalid peptide length %d, shorter than min %d" % ( arg_2 , arg_0 . min_peptide_length ) ) elif ( arg_0 . max_peptide_length is not None and arg_2 > arg_0 . max_peptide_length ) : raise ValueError ( "Invalid peptide length %d, longer than max %d" % ( arg_2 , arg_0 . max_peptide_length ) ) return arg_1

Generate a square lattice with auxiliary nodes for spanning detection

    Parameters
    ----------

    length : int
       Number of nodes in one dimension, excluding the auxiliary nodes.

    Returns
    -------

    networkx.Graph
       A square lattice graph with auxiliary nodes for spanning cluster
       detection

    See Also
    --------

    sample_states : spanning cluster detection


Question: Calculate the intensity of the Sersic light profile on a grid of radial coordinates .

def Func ( arg_0 , arg_1 ) : np . seterr ( all = 'ignore' ) return np . multiply ( arg_0 . intensity , np . exp ( np . multiply ( - arg_0 . sersic_constant , np . add ( np . power ( np . divide ( arg_1 , arg_0 . effective_radius ) , 1. / arg_0 . sersic_index ) , - 1 ) ) ) )

Reassemble a Binder object coming out of the database.


Question: Convert this polygon s exterior to Keypoint instances .

def Func ( arg_0 ) : from imgaug . augmentables . kps import Keypoint return [ Keypoint ( x = arg_1 [ 0 ] , y = arg_1 [ 1 ] ) for arg_1 in arg_0 . exterior ]

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: Allow to run async code before application is closed .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( * arg_1 , ** arg_2 ) : arg_3 = asyncio . ensure_future ( arg_0 ( * arg_1 , ** arg_2 ) ) while not arg_3 . done ( ) : QApplication . instance ( ) . processEvents ( ) return wrapper

Returns protobuf mapcontainer. Read from translation file.


Question: Given a file - like object containing a JSON stream upload it to Luminoso with the given account name and project name .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = False , arg_8 = False ) : arg_9 = LuminosoClient . connect ( arg_1 , arg_5 = arg_5 , arg_6 = arg_6 ) if not arg_7 : arg_10 = arg_9 . post ( '/projects/' + arg_2 , name = arg_3 ) arg_11 = arg_10 [ 'project_id' ] print ( 'New project ID:' , arg_11 ) else : arg_12 = arg_9 . get ( '/projects/' + arg_2 , name = arg_3 ) if len ( arg_12 ) == 0 : print ( 'No such project exists!' ) return if len ( arg_12 ) > 1 : print ( 'Warning: Multiple projects with name "%s".  ' % arg_3 , end = '' ) arg_11 = arg_12 [ 0 ] [ 'project_id' ] print ( 'Using existing project with id %s.' % arg_11 ) arg_13 = arg_9 . change_path ( '/projects/' + arg_2 + '/' + arg_11 ) arg_14 = 0 for arg_15 in batches ( arg_0 , 1000 ) : arg_14 += 1 arg_16 = list ( arg_15 ) arg_13 . upload ( 'docs' , arg_16 ) print ( 'Uploaded batch #%d' % ( arg_14 ) ) if not arg_8 : print ( 'Calculating.' ) arg_17 = { } if arg_4 is not None : arg_17 = { 'language' : arg_4 } arg_18 = arg_13 . post ( 'docs/recalculate' , ** arg_17 ) arg_13 . wait_for ( arg_18 )

if is negated return original cond and negated flag


Question: Add the frequencies to a variant

def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_3 = [ '1000GAF' ] arg_4 = [ '1000G_MAX_AF' ] arg_5 = [ 'EXACAF' ] arg_6 = [ 'ExAC_MAX_AF' , 'EXAC_MAX_AF' ] arg_7 = [ 'GNOMADAF' , 'GNOMAD_AF' ] arg_8 = [ 'GNOMADAF_POPMAX' , 'GNOMADAF_MAX' ] for arg_9 in arg_3 : arg_10 = parse_frequency ( arg_0 , arg_9 ) if arg_10 : arg_2 [ 'thousand_g' ] = arg_10 break for arg_9 in arg_4 : arg_11 = parse_frequency ( arg_0 , arg_9 ) if arg_11 : arg_2 [ 'thousand_g_max' ] = arg_11 break for arg_9 in arg_5 : arg_12 = parse_frequency ( arg_0 , arg_9 ) if arg_12 : arg_2 [ 'exac' ] = arg_12 break for arg_9 in arg_6 : arg_13 = parse_frequency ( arg_0 , arg_9 ) if arg_13 : arg_2 [ 'exac_max' ] = arg_13 break for arg_9 in arg_7 : arg_14 = parse_frequency ( arg_0 , arg_9 ) if arg_14 : arg_2 [ 'gnomad' ] = arg_14 break for arg_9 in arg_8 : arg_15 = parse_frequency ( arg_0 , arg_9 ) if arg_15 : arg_2 [ 'gnomad_max' ] = arg_15 break if not arg_2 : for arg_16 in arg_1 : arg_12 = arg_16 . get ( 'exac_maf' ) arg_13 = arg_16 . get ( 'exac_max' ) arg_10 = arg_16 . get ( 'thousand_g_maf' ) arg_17 = arg_16 . get ( 'thousandg_max' ) arg_14 = arg_16 . get ( 'gnomad_maf' ) arg_15 = arg_16 . get ( 'gnomad_max' ) if arg_12 : arg_2 [ 'exac' ] = arg_12 if arg_13 : arg_2 [ 'exac_max' ] = arg_13 if arg_10 : arg_2 [ 'thousand_g' ] = arg_10 if arg_17 : arg_2 [ 'thousand_g_max' ] = arg_17 if arg_14 : arg_2 [ 'gnomad' ] = arg_14 if arg_15 : arg_2 [ 'gnomad_max' ] = arg_15 arg_18 = parse_frequency ( arg_0 , 'left_1000GAF' ) if arg_18 : arg_2 [ 'thousand_g_left' ] = arg_18 arg_19 = parse_frequency ( arg_0 , 'right_1000GAF' ) if arg_19 : arg_2 [ 'thousand_g_right' ] = arg_19 return arg_2

Set a clinvar submission ID to 'closed'

            Args:
                submission_id(str): the ID of the clinvar submission to close

            Return
                updated_submission(obj): the submission object with a 'closed' status


Question: Update the name HTML or folder_id of an existing template .

def Func ( arg_0 , arg_1 , arg_2 ) : if 'name' not in arg_2 : raise KeyError ( 'The template must have a name' ) if 'html' not in arg_2 : raise KeyError ( 'The template must have html' ) arg_0 . template_id = arg_1 return arg_0 . _mc_client . _patch ( url = arg_0 . _build_path ( arg_1 ) , arg_2 = arg_2 )

Whether a connection can be established between those two meshes.


Question: Will return a matching record or raise KeyError is no record is found .

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _schema_map : return arg_0 . _schema_map [ arg_1 ] else : arg_2 = arg_1 . split ( '.' ) [ - 1 ] return arg_0 . _schema_map [ arg_2 ]

Handle marking messages as read and keeping client active.


Question: Bloomberg reference data

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = logs . get_logger ( Func , level = arg_2 . pop ( 'log' , logs . LOG_LEVEL ) ) arg_4 , arg_5 = create_connection ( ) arg_6 = assist . proc_ovrds ( ** arg_2 ) arg_3 . info ( f'loading reference data from Bloomberg:\n' f'{assist.info_qry(tickers=tickers, flds=flds)}' ) arg_7 = arg_4 . ref ( arg_0 = arg_0 , arg_1 = arg_1 , arg_6 = arg_6 ) if not arg_2 . get ( 'cache' , False ) : return [ arg_7 ] arg_8 = [ ] for arg_9 , arg_10 in arg_7 . iterrows ( ) : arg_11 = [ arg_9 ] arg_12 = storage . ref_file ( ticker = arg_10 . ticker , fld = arg_10 . field , ext = 'pkl' , ** arg_2 ) if arg_12 : if not files . exists ( arg_12 ) : arg_8 . append ( arg_7 . iloc [ arg_11 ] ) files . create_folder ( arg_12 , is_file = True ) arg_7 . iloc [ arg_11 ] . to_pickle ( arg_12 ) return arg_8

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: Create the signal handler map

def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in arg_0 . signal_map . items ( ) : arg_1 [ arg_2 ] = arg_0 . _get_signal_handler ( arg_3 ) return arg_1

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


Question: Calculate the single - field - of - view - transit photometric standard error in the G band as a function of G . A 20% margin is included .


Question: Demmel p 312

def Func ( arg_0 , arg_1 , arg_2 = 10 , arg_3 = None , arg_4 = False , arg_5 = 1e-10 ) : arg_6 = arg_1 . copy ( ) arg_7 = arg_1 . copy ( ) arg_8 = np . zeros_like ( arg_1 ) arg_9 = arg_7 . dot ( arg_7 ) arg_10 = "%10i %10.3g %10.3g" arg_11 = "%10s %10s %10s" if arg_4 : print ( arg_11 % ( "iter" , "residual norm" , "soln norm" ) ) for arg_12 in range ( arg_2 ) : if arg_3 is not None : arg_3 ( arg_8 ) if arg_4 : print ( arg_10 % ( arg_12 , arg_9 , np . linalg . norm ( arg_8 ) ) ) arg_13 = arg_0 ( arg_6 ) arg_14 = arg_9 / arg_6 . dot ( arg_13 ) arg_8 += arg_14 * arg_6 arg_7 -= arg_14 * arg_13 arg_15 = arg_7 . dot ( arg_7 ) arg_16 = arg_15 / arg_9 arg_6 = arg_7 + arg_16 * arg_6 arg_9 = arg_15 if arg_9 < arg_5 : break if arg_3 is not None : arg_3 ( arg_8 ) if arg_4 : print ( arg_10 % ( arg_12 + 1 , arg_9 , np . linalg . norm ( arg_8 ) ) ) return arg_8

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: Parses ed25516 keys .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . _unpack_by_int ( arg_1 , 0 ) arg_4 = len ( arg_3 ) * 8 arg_3 = arg_0 . _parse_long ( arg_3 ) if arg_3 < 0 : raise InvalidKeyError ( "ed25519 verifying key must be >0." ) arg_0 . bits = arg_4 if arg_0 . bits != 256 : raise InvalidKeyLengthError ( "ed25519 keys must be 256 bits (was %s bits)" % arg_0 . bits ) return arg_2

Create Flask application class.

    Invenio-Files-REST needs to patch the Werkzeug form parsing in order to
    support streaming large file uploads. This is done by subclassing the Flask
    application class.


Question: Reads and parses the configuration file .

def Func ( arg_0 = arg_1 ) : global arg_2 , arg_3 arg_2 = GMXConfigParser ( arg_0 = arg_0 ) globals ( ) . update ( arg_2 . configuration ) arg_3 = arg_2 . configuration return arg_2

Clip input array with a vector list.

    Parameters
    ----------
    array : array
        input raster data
    array_affine : Affine
        Affine object describing the raster's geolocation
    geometries : iterable
        iterable of dictionaries, where every entry has a 'geometry' and
        'properties' key.
    inverted : bool
        invert clip (default: False)
    clip_buffer : integer
        buffer (in pixels) geometries before clipping

    Returns
    -------
    clipped array : array


Question: Load a keyring specified in the config file or infer the best available .

def Func ( arg_0 = None ) : arg_1 . _limit = arg_0 arg_3 = filter ( arg_0 , arg_1 . get_all_keyring ( ) ) set_keyring ( load_env ( ) or load_config ( ) or max ( arg_3 , default = fail . Keyring ( ) , key = arg_1 . by_priority ) )


Question: Write fasta_dict to fasta_file

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_1 if isinstance ( arg_1 , str ) : arg_3 = open ( arg_1 , 'wb' ) for arg_4 in arg_0 : arg_5 = arg_0 [ arg_4 ] [ 'seq' ] if arg_2 : arg_5 = '\n' . join ( [ arg_5 [ i : i + arg_2 ] for i in range ( 0 , len ( arg_5 ) , arg_2 ) ] ) arg_3 . write ( u'{0:s}\n{1:s}\n' . format ( arg_0 [ arg_4 ] [ 'header' ] , arg_5 ) )

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


Question: Launch a process to process the given file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : def helper ( ) : arg_6 = logging . getLogger ( "airflow.processor" ) arg_7 = StreamLogWriter ( arg_6 , logging . INFO ) arg_8 = StreamLogWriter ( arg_6 , logging . WARN ) set_context ( arg_6 , arg_1 ) try : arg_9 . stdout = arg_7 arg_9 . stderr = arg_8 settings . configure_orm ( ) arg_10 . current_thread ( ) . name = arg_4 arg_13 = time . time ( ) arg_6 . info ( "Started process (PID=%s) to work on %s" , os . getpid ( ) , arg_1 ) arg_14 = SchedulerJob ( dag_ids = arg_3 , arg_6 = arg_6 ) arg_15 = arg_14 . process_file ( arg_1 , arg_5 , arg_2 ) arg_0 . put ( arg_15 ) arg_16 = time . time ( ) arg_6 . info ( "Processing %s took %.3f seconds" , arg_1 , arg_16 - arg_13 ) except Exception : arg_6 . exception ( "Got an exception! Propagating..." ) raise finally : arg_9 . stdout = arg_9 . __stdout__ arg_9 . stderr = arg_9 . __stderr__ settings . dispose_orm ( ) arg_17 = multiprocessing . Process ( target = helper , args = ( ) , arg_12 = "{}-Process" . format ( arg_4 ) ) arg_17 . start ( ) return arg_17

ASCII adjust after addition.

        Adjusts the sum of two unpacked BCD values to create an unpacked BCD
        result. The AL register is the implied source and destination operand
        for this instruction. The AAA instruction is only useful when it follows
        an ADD instruction that adds (binary addition) two unpacked BCD values
        and stores a byte result in the AL register. The AAA instruction then
        adjusts the contents of the AL register to contain the correct 1-digit
        unpacked BCD result.
        If the addition produces a decimal carry, the AH register is incremented
        by 1, and the CF and AF flags are set. If there was no decimal carry,
        the CF and AF flags are cleared and the AH register is unchanged. In either
        case, bits 4 through 7 of the AL register are cleared to 0.

        This instruction executes as described in compatibility mode and legacy mode.
        It is not valid in 64-bit mode.
        ::
                IF ((AL AND 0FH) > 9) Operators.OR(AF  =  1)
                THEN
                    AL  =  (AL + 6);
                    AH  =  AH + 1;
                    AF  =  1;
                    CF  =  1;
                ELSE
                    AF  =  0;
                    CF  =  0;
                FI;
                AL  =  AL AND 0FH;
        :param cpu: current CPU.


Question: Extract a Tensor with canonical shape and optional mask .

def Func ( arg_0 ) : with tf . compat . v1 . name_scope ( 'Func' ) : if hasattr ( arg_0 , 'is_missing' ) : arg_1 = ( arg_0 . time_series ) arg_2 = arg_0 . is_missing else : arg_1 = arg_0 arg_2 = None arg_1 = tf . convert_to_tensor ( value = arg_1 , name = 'observed_time_series' ) arg_1 = _maybe_expand_trailing_dim ( arg_1 ) if arg_2 is not None : arg_2 = tf . convert_to_tensor ( value = arg_2 , name = 'is_missing' , dtype_hint = tf . bool ) return missing_values_util . MaskedTimeSeries ( arg_1 , arg_2 = arg_2 )

Return the RSSI signal strength in decibels.


Question: Retrieve auth from profile configuration and set in msg . auth attr .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . __class__ . __name__ . lower ( ) arg_3 = arg_0 . profile + "_" + arg_2 arg_4 = arg_1 . pwd [ arg_3 ] . split ( " :: " ) if len ( arg_4 ) == 1 : arg_0 . auth = arg_4 [ 0 ] else : arg_0 . auth = tuple ( arg_4 )

r'''Basic formula serializer to construct a consistently-formatted formula.
    This is necessary for handling user-supplied formulas, which are not always
    well formatted.

    Performs no sanity checking that elements are actually elements.

    Parameters
    ----------
    formula : str
        Formula string as parseable by the method nested_formula_parser, [-]

    Returns
    -------
    formula : str
        A consistently formatted formula to describe a molecular formula, [-]

    Notes
    -----

    Examples
    --------
    >>> serialize_formula('Pd(NH3)4+3')
    'H12N4Pd+3'


Question: Debug helper to print the ABC registry .

def Func ( arg_0 , arg_1 = None ) : print >> arg_1 , "Class: %s.%s" % ( arg_0 . __module__ , arg_0 . __name__ ) print >> arg_1 , "Inv.counter: %s" % ABCMeta . _abc_invalidation_counter for arg_2 in sorted ( arg_0 . __dict__ . keys ( ) ) : if arg_2 . startswith ( "_abc_" ) : arg_3 = getattr ( arg_0 , arg_2 ) print >> arg_1 , "%s: %r" % ( arg_2 , arg_3 )


Question: Add text nodes as possible to all descendants of an element for spacing & indentation to make the MicroXML as printed easier for people to read . Will not modify the value of any text node which is not already entirely whitespace .

def Func ( arg_0 , arg_1 = 0 , arg_2 = '  ' ) : arg_1 += 1 arg_3 = [ ] arg_4 = 0 for arg_5 in arg_0 . xml_children : if isinstance ( arg_5 , element ) : if arg_4 % 2 : arg_3 . append ( arg_5 ) arg_4 += 1 else : arg_6 = text ( '\n' + arg_2 * arg_1 , arg_0 ) arg_3 . append ( arg_6 ) arg_3 . append ( arg_5 ) arg_4 += 2 Func ( arg_5 , arg_1 ) else : if arg_5 . xml_value . strip ( ) : arg_3 . append ( arg_5 ) arg_4 += 1 else : arg_6 = text ( '\n' + arg_2 * arg_1 , arg_0 ) arg_3 . append ( arg_6 ) arg_4 += 1 if not ( arg_4 % 2 ) : arg_6 = text ( '\n' + arg_2 * ( arg_1 - 1 ) , arg_0 ) arg_3 . append ( arg_6 ) arg_0 . xml_children = arg_3 return arg_0

Returns an authorized HTTP object to be used to build a Google cloud
        service hook connection.


Question: Checks if the page or current node has no radio button or checkbox with the given label value or id that is currently unchecked .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 [ "checked" ] = False return arg_0 . has_no_selector ( "field" , arg_1 , ** arg_2 )

Stop the timer

        Returns:
            The time the timer was stopped


Question: Run the CGNN on a given graph .

def Func ( arg_0 , arg_1 , arg_2 = 1000 , arg_3 = 1000 , arg_4 = None , arg_5 = 0 , arg_6 = 0.01 , ** arg_7 ) : arg_4 = SETTINGS . get_default ( arg_4 = arg_4 ) arg_8 = th . optim . Adam ( arg_0 . parameters ( ) , arg_6 = arg_6 ) arg_0 . score . zero_ ( ) with trange ( arg_2 + arg_3 , disable = not arg_4 ) as t : for arg_9 in t : arg_8 . zero_grad ( ) arg_10 = arg_0 . forward ( ) arg_11 = arg_0 . criterion ( arg_10 , arg_1 ) if not arg_9 % 200 : t . set_postfix ( arg_5 = arg_5 , arg_9 = arg_9 , loss = arg_11 . item ( ) ) arg_11 . backward ( ) arg_8 . step ( ) if arg_9 >= arg_3 : arg_0 . score . add_ ( arg_11 . data ) return arg_0 . score . cpu ( ) . numpy ( ) / arg_3

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


Question: Find a single entry point .

def Func ( arg_0 , arg_1 , arg_2 = None ) : for arg_3 , arg_4 in iter_files_distros ( arg_2 = arg_2 ) : if ( arg_0 in arg_3 ) and ( arg_1 in arg_3 [ arg_0 ] ) : arg_5 = arg_3 [ arg_0 ] [ arg_1 ] with BadEntryPoint . err_to_warnings ( ) : return EntryPoint . from_string ( arg_5 , arg_1 , arg_4 ) raise NoSuchEntryPoint ( arg_0 , arg_1 )

Get the reason of this revocation.

        :return: The reason, or ``None`` if there is none.
        :rtype: bytes or NoneType

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.


Question: Internal method to set the initial default font . Change the font using set_font method .

def Func ( arg_0 ) : arg_0 . font = PDFFont ( arg_0 . session ) arg_0 . font . _set_index ( ) arg_0 . fonts . append ( arg_0 . font ) arg_0 . fontkeys . append ( arg_0 . font . font_key )

Converts a comma separated string to a list


Question: Determine if a number of Card Actions are supported by a Channel .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = 100 ) -> bool : arg_4 = { Channels . facebook : 3 , Channels . skype : 3 , Channels . ms_teams : 3 , Channels . line : 99 , Channels . slack : 100 , Channels . emulator : 100 , Channels . direct_line : 100 , Channels . webchat : 100 , Channels . cortana : 100 , } return arg_2 <= arg_4 [ arg_0 ] if arg_0 in arg_4 else False

Helper function to get query argument.
    Raises exception if argument is missing.
    Returns the query argument.


Question: Specify a callback function that will be called on the server when a client offers protocols using ALPN .

def Func ( arg_0 , arg_1 ) : arg_0 . _alpn_select_helper = _ALPNSelectHelper ( arg_1 ) arg_0 . _alpn_select_callback = arg_0 . _alpn_select_helper . callback _lib . SSL_CTX_set_alpn_select_cb ( arg_0 . _context , arg_0 . _alpn_select_callback , _ffi . NULL )

One way to calibrate the band pass is to take the median value
            for every frequency fine channel, and divide by it.


Question: Parses a theme from XML returned by Kuler . Gets the theme s id label and swatches . All of the swatches are converted to RGB . If we have a full description for a theme id in cache parse that to get tags associated with the theme .

def Func ( arg_0 , arg_1 ) : arg_2 = KulerTheme ( ) arg_2 . author = arg_1 . getElementsByTagName ( "author" ) [ 0 ] arg_2 . author = arg_2 . author . childNodes [ 1 ] . childNodes [ 0 ] . nodeValue arg_2 . id = int ( arg_0 . parse_tag ( arg_1 , "id" ) ) arg_2 . label = arg_0 . parse_tag ( arg_1 , "label" ) arg_6 = arg_0 . parse_tag ( arg_1 , "mode" ) for arg_7 in arg_1 . getElementsByTagName ( "swatch" ) : arg_8 = float ( arg_0 . parse_tag ( arg_7 , "c1" ) ) arg_9 = float ( arg_0 . parse_tag ( arg_7 , "c2" ) ) arg_10 = float ( arg_0 . parse_tag ( arg_7 , "c3" ) ) arg_11 = float ( arg_0 . parse_tag ( arg_7 , "c4" ) ) if arg_6 == "rgb" : arg_2 . append ( ( arg_8 , arg_9 , arg_10 ) ) if arg_6 == "cmyk" : arg_2 . append ( cmyk_to_rgb ( arg_8 , arg_9 , arg_10 , arg_11 ) ) if arg_6 == "hsv" : arg_2 . append ( colorsys . hsv_to_rgb ( arg_8 , arg_9 , arg_10 ) ) if arg_6 == "hex" : arg_2 . append ( hex_to_rgb ( arg_8 ) ) if arg_6 == "lab" : arg_2 . append ( lab_to_rgb ( arg_8 , arg_9 , arg_10 ) ) if arg_0 . _cache . exists ( arg_0 . id_string + str ( arg_2 . id ) ) : arg_1 = arg_0 . _cache . read ( arg_0 . id_string + str ( arg_2 . id ) ) arg_1 = minidom . parseString ( arg_1 ) for arg_12 in arg_1 . getElementsByTagName ( "tag" ) : arg_12 = arg_0 . parse_tag ( arg_12 , "label" ) arg_12 = arg_12 . split ( " " ) arg_2 . tags . extend ( arg_12 ) return arg_2


Question: Generate all combinations of the elements of iterable and its subsets .

def Func ( arg_0 ) : arg_1 = len ( arg_0 ) for arg_2 in range ( arg_1 , - 1 , - 1 ) : for arg_3 in combinations ( arg_0 , arg_2 ) : yield arg_3

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


Question: Print build_info from release . yaml

def Func ( arg_0 = False ) : if arg_0 : arg_1 = get_zipped_heron_release_file ( ) else : arg_1 = get_heron_release_file ( ) with open ( arg_1 ) as release_info : arg_2 = yaml . load ( release_info ) arg_3 = sorted ( arg_2 . items ( ) , arg_4 = lambda tup : tup [ 0 ] ) for arg_4 , arg_5 in arg_3 : print ( "%s : %s" % ( arg_4 , arg_5 ) )

Calculate statistics for given data.

  :param list data_list: List of floats
  :param list stats_to_calculate: List of strings with statistics to calculate. Supported stats are defined in constant stats_to_numpy_method_map
  :param list percentiles_to_calculate: List of floats that defined which percentiles to calculate.
  :return: tuple of dictionaries containing calculated statistics and percentiles


Question: Sonify pitch contours .

def Func ( arg_0 , arg_1 = 22050 , arg_2 = None , ** arg_3 ) : arg_4 = defaultdict ( list ) arg_5 = defaultdict ( list ) for arg_6 in arg_0 : arg_4 [ arg_6 . value [ 'index' ] ] . append ( arg_6 . time ) arg_5 [ arg_6 . value [ 'index' ] ] . append ( arg_6 . value [ 'frequency' ] * ( - 1 ) ** ( ~ arg_6 . value [ 'voiced' ] ) ) arg_7 = 0.0 for arg_8 in arg_4 : arg_7 = arg_7 + filter_kwargs ( mir_eval . sonify . Func , np . asarray ( arg_4 [ arg_8 ] ) , np . asarray ( arg_5 [ arg_8 ] ) , fs = arg_1 , arg_2 = arg_2 , ** arg_3 ) if arg_2 is None : arg_2 = len ( arg_7 ) return arg_7


Question: Generate RENEWING time .

def Func ( arg_0 , arg_1 = 0 ) : arg_2 = int ( arg_0 ) * RENEW_PERC - arg_1 arg_3 = int ( arg_0 ) * REBIND_PERC - arg_2 logger . debug ( 'rebinding fuzz range %s' , arg_3 ) arg_4 = random . uniform ( - ( arg_3 ) , + ( arg_3 ) ) arg_2 += arg_4 logger . debug ( 'Renewing time %s.' , arg_2 ) return arg_2

increments the branches counter and checks boolean expressions


Question: Close port .

def Func ( arg_0 ) : os . Func ( arg_0 . in_d ) os . Func ( arg_0 . out_d )


Question: Add a new setting definition .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 , arg_4 = None , arg_5 = None , arg_6 = False , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = False ) : arg_12 = _SettingDefinition ( arg_1 , arg_2 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 , arg_11 ) if arg_1 not in arg_0 . _defs : arg_0 . _defs [ arg_1 ] = arg_12 return arg_14 = arg_0 . _defs [ arg_1 ] if arg_14 . type != arg_12 . type : raise ValueError ( "Setting duplicate, with a different type" ) if arg_14 . default != arg_12 . default : raise ValueError ( "Setting duplicate, with a different default" ) if arg_14 . factory != arg_12 . factory : raise ValueError ( "Setting duplicate, with a different factory" )

Get the reason of this revocation.

        :return: The reason, or ``None`` if there is none.
        :rtype: bytes or NoneType

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.


Question: Get event counts from puppetdb aggregated into a single map .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : return arg_0 . _query ( 'aggregate-event-counts' , arg_2 = arg_2 , arg_1 = arg_1 , arg_3 = arg_3 , arg_4 = arg_4 )

Modal dialog asking for an input, returns string or None if cancelled


Question: Return a AzureDLFileSystem object .

def Func ( arg_0 ) : arg_1 = arg_0 . Funcection ( arg_0 . conn_id ) arg_2 = arg_1 . extra_dejson arg_0 . account_name = arg_2 . get ( 'account_name' ) arg_4 = lib . auth ( tenant_id = arg_2 . get ( 'tenant' ) , client_secret = arg_1 . password , client_id = arg_1 . login ) arg_5 = core . AzureDLFileSystem ( arg_4 , store_name = arg_0 . account_name ) arg_5 . connect ( ) return arg_5

Sets the review comment. Raises CardinalityError if
        already set. OrderError if no reviewer defined before.


Question: Add a point to the TextTier

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if arg_0 . tier_type != 'TextTier' : raise Exception ( 'Tiertype must be TextTier.' ) if arg_3 and any ( arg_4 for arg_4 in arg_0 . intervals if arg_4 [ 0 ] == arg_1 ) : raise Exception ( 'No overlap is allowed' ) arg_0 . intervals . append ( ( arg_1 , arg_2 ) )

Remove groups from the model.

        Members of each group are not removed
        from the model (i.e. metabolites, reactions, and genes in the group
        stay in the model after any groups containing them are removed).

        Parameters
        ----------
        group_list : list
            A list of `cobra.Group` objects to remove from the model.


Question: Schedule function to be called from the main loop after delay seconds .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 arg_4 = [ ] class DelayedCallHandler ( TimeoutHandler ) : @ timeout_handler ( arg_1 , False ) def callback ( arg_0 ) : try : arg_2 ( ) finally : arg_3 . remove_handler ( arg_4 [ 0 ] ) arg_4 . append ( DelayedCallHandler ( ) ) arg_0 . add_handler ( arg_4 [ 0 ] )

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


Question: Compute a statistic over an axis .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = False ) : if arg_1 is None : arg_1 = list ( range ( len ( arg_0 . shape ) ) ) arg_1 = tupleize ( arg_1 ) if arg_2 and not arg_3 : return arg_0 . reduce ( arg_2 , arg_1 , arg_4 ) if arg_3 and not arg_2 : from bolt . local . array import BoltArrayLocal arg_5 = arg_0 . _align ( arg_1 ) def reducer ( arg_6 , arg_7 ) : return arg_6 . combine ( arg_7 ) arg_8 = arg_5 . _rdd . values ( ) . mapPartitions ( lambda arg_10 : [ StatCounter ( values = arg_10 , stats = arg_3 ) ] ) . treeReduce ( reducer , depth = 3 ) arg_9 = getattr ( arg_8 , arg_3 ) if arg_4 : for arg_10 in arg_1 : arg_9 = expand_dims ( arg_9 , arg_1 = arg_10 ) return BoltArrayLocal ( arg_9 ) . toscalar ( ) else : raise ValueError ( 'Must specify either a function or a statistic name.' )

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: Check that arguments are consistent with spark array construction .

def Func ( * arg_0 , ** arg_1 ) : try : from pyspark import SparkContext except ImportError : return False arg_2 = any ( [ isinstance ( arg , SparkContext ) for arg in arg_0 ] ) arg_3 = isinstance ( arg_1 . get ( 'context' , None ) , SparkContext ) arg_4 = any ( [ isinstance ( arg , BoltArraySpark ) for arg in arg_0 ] ) arg_5 = any ( [ any ( [ isinstance ( sub , BoltArraySpark ) for sub in arg ] ) if isinstance ( arg , ( tuple , list ) ) else False for arg in arg_0 ] ) return arg_2 or arg_3 or arg_4 or arg_5

Scale in the number of active blocks by the specified number.


Question: Clear description to default values

def Func ( arg_0 ) : arg_0 . _desc = { } for arg_2 , arg_3 in merge . DEFAULT_PROJECT . items ( ) : if arg_2 not in arg_0 . _HIDDEN : arg_0 . _desc [ arg_2 ] = type ( arg_3 ) ( )

An intelligent wrapper for ``open``.

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

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

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

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

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

        Otherwise, use the specified coding.

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


Question: Open dashboard in browser .

def Func ( arg_0 , arg_1 ) : arg_2 = "{}/app" . format ( PolyaxonClient ( ) . api_config . http_host ) if arg_1 : click . echo ( arg_2 ) sys . exit ( 0 ) if not arg_0 : click . confirm ( 'Dashboard page will now open in your browser. Continue?' , abort = True , default = True ) click . launch ( arg_2 )

Set's the package's description.
        Raises SPDXValueError if text is not free form text.
        Raises CardinalityError if description already set.
        Raises OrderError if no package previously defined.


Question: Calculates the distance of a given image to the original image .

def Func ( arg_0 , arg_1 ) : return arg_0 . __distance ( arg_0 . __original_image_for_distance , arg_1 , bounds = arg_0 . bounds ( ) )

This method is called before first step of simulation.


Question: Writes the given content to a local temporary file .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = get_dryrun ( arg_2 . get ( 'dryrun' ) ) if arg_3 : arg_4 , arg_5 = tempfile . mkstemp ( ) os . remove ( arg_5 ) arg_6 = 'local' arg_7 = 'cat <<EOT >> %s\n%s\nEOT' % ( arg_5 , arg_0 ) if BURLAP_COMMAND_PREFIX : print ( '%s %s: %s' % ( render_command_prefix ( ) , arg_6 , arg_7 ) ) else : print ( arg_7 ) else : arg_4 , arg_5 = tempfile . mkstemp ( ) arg_8 = open ( arg_5 , 'w' ) arg_8 . write ( arg_0 ) arg_8 . close ( ) return arg_5

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

    The pixel coordinate origin is at the top left corner of the 2D array and goes right-wards and downwards, such
    that for an array of shape (3,3) where all pixels are unmasked:

    - pixel [0,0] of the 2D array will correspond to index 0 of the 1D array.
    - pixel [0,1] of the 2D array will correspond to index 1 of the 1D array.
    - pixel [1,0] of the 2D array will correspond to index 4 of the 1D array.

    Parameters
     ----------
    mask : ndarray
        A 2D array of bools, where *False* values mean unmasked and are included in the mapping.
    array_2d : ndarray
        The 2D array of values which are mapped to a 1D array.

    Returns
    --------
    ndarray
        A 1D array of values mapped from the 2D array with dimensions (total_unmasked_pixels).

    Examples
    --------
    mask = np.array([[True, False, True],
                     [False, False, False]
                     [True, False, True]])

    array_2d = np.array([[1.0, 2.0, 3.0],
                          [4.0, 5.0, 6.0],
                          [7.0, 8.0, 9.0]])

    array_1d = map_2d_array_to_masked_1d_array_from_array_2d_and_mask(mask=mask, array_2d=array_2d)


Question: Finishes the load job . Called automatically when the connection closes .

def Func ( arg_0 ) : if arg_0 . Funced : return arg_0 . exit_code arg_1 = arg_0 . checkpoint ( ) arg_0 . exit_code = arg_0 . _exit_code ( ) if arg_0 . exit_code != 0 : raise TeradataPTError ( "BulkLoad job Funced with return code '{}'" . format ( arg_0 . exit_code ) ) if arg_0 . applied_count > 0 : arg_0 . _end_acquisition ( ) arg_0 . _apply_rows ( ) arg_0 . exit_code = arg_0 . _exit_code ( ) if arg_0 . exit_code != 0 : raise TeradataPTError ( "BulkLoad job Funced with return code '{}'" . format ( arg_0 . exit_code ) ) arg_0 . Funced = True return arg_0 . exit_code


Question: Get the file from an specific item

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = "/{t}/{u}/items/{i}/Func" . format ( u = arg_0 . library_id , t = arg_0 . library_type , i = arg_1 . upper ( ) ) return arg_0 . _build_query ( arg_3 , no_params = True )

initialize the merger model with a coalescent time

        Args:
            - Tc:   a float or an iterable, if iterable another argument T of same shape is required
            - T:    an array like of same shape as Tc that specifies the time pivots corresponding to Tc
        Returns:
            - None


Question: Returns the intersection of each color s context .

def Func ( arg_0 ) : arg_1 = None for arg_2 in arg_0 : arg_3 = [ ] if arg_2 . is_black : arg_4 = "black" elif arg_2 . is_white : arg_4 = "white" elif arg_2 . is_grey : arg_4 = "grey" else : arg_4 = arg_2 . nearest_hue ( primary = True ) if arg_4 == "orange" and arg_2 . brightness < 0.6 : arg_4 = "brown" arg_5 = context [ arg_4 ] if arg_1 is None : arg_1 = arg_5 else : for arg_6 in arg_5 : if arg_6 in arg_1 : if arg_6 not in arg_3 : arg_3 . append ( arg_6 ) arg_1 = arg_3 arg_3 . sort ( ) return arg_3

Overriding the default JSONEncoder.default for NDB support.


Question: Check that the task arguments received are valid

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not arg_0 or arg_0 . strip ( ) == "" : arg_4 = "Missing task_id for task" raise ValueError ( arg_4 ) if not arg_1 or arg_1 . strip ( ) == "" : arg_4 = "Missing backend for task '%s'" % arg_0 raise ValueError ( arg_4 ) if arg_3 and not isinstance ( arg_3 , dict ) : arg_4 = "Backend_args is not a dict, task '%s'" % arg_0 raise ValueError ( arg_4 ) if not arg_2 or arg_2 . strip ( ) == "" : arg_4 = "Missing category for task '%s'" % arg_0 raise ValueError ( arg_4 )

Table Branch Halfword causes a PC-relative forward branch using a table of single halfword offsets. A base
        register provides a pointer to the table, and a second register supplies an index into the table. The branch
        length is twice the value of the halfword returned from the table.

        :param ARMv7Operand dest: see below; register


Question: Query to test if a value exists .

def Func ( arg_0 ) : if not isinstance ( arg_0 , Token ) : raise TypeError ( 'value must be a token' ) if not hasattr ( arg_0 , 'identifier' ) : raise TypeError ( 'value must support an identifier' ) if not arg_0 . identifier : arg_0 = arg_0 . __class__ ( ** arg_0 . __dict__ ) arg_0 . identifier = 'v' arg_2 = Identifier ( arg_0 . identifier ) return Query ( [ OptionalMatch ( arg_0 ) , Return ( Predicate ( arg_2 , 'IS NOT NULL' ) ) , Limit ( 1 ) , ] )

Decode the data passed in and potentially flush the decoder.


Question: Factory for loading the image from a . fits file

def Func ( arg_0 , arg_1 , arg_2 ) : return ScaledSquarePixelArray . from_fits_with_pixel_scale ( file_path = arg_0 , hdu = arg_1 , arg_2 = arg_2 )

Notify all subscribers of a property change.

        property_ -- the property that changed


Question: Search for HPO terms .

def Func ( ) : arg_0 = request . args . get ( 'query' ) if arg_0 is None : return abort ( 500 ) arg_1 = sorted ( store . hpo_terms ( arg_0 = arg_0 ) , key = itemgetter ( 'hpo_number' ) ) arg_2 = [ { 'name' : '{} | {}' . format ( term [ '_id' ] , term [ 'description' ] ) , 'id' : term [ '_id' ] } for term in arg_1 [ : 7 ] ] return jsonify ( arg_2 )

Drop a node from the network

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


Question: Makes closure which creates loc scale params from tf . get_variable .

def Func ( arg_0 = False , arg_1 = arg_2 . compat . v1 . initializers . random_normal ( arg_7 = 0.1 ) , arg_8 = arg_2 . compat . v1 . initializers . random_normal ( arg_9 = - 3. , arg_7 = 0.1 ) , arg_10 = None , arg_11 = None , arg_12 = None , arg_13 = None ) : def _fn ( arg_14 , arg_15 , arg_16 , arg_17 , arg_18 ) : arg_19 = arg_18 ( arg_16 = arg_16 + '_loc' , arg_15 = arg_15 , initializer = arg_1 , regularizer = arg_10 , constraint = arg_12 , arg_14 = arg_14 , arg_17 = arg_17 ) if arg_0 : return arg_19 , None arg_20 = arg_18 ( arg_16 = arg_16 + '_untransformed_scale' , arg_15 = arg_15 , initializer = arg_8 , regularizer = arg_11 , constraint = arg_13 , arg_14 = arg_14 , arg_17 = arg_17 ) arg_21 = ( np . finfo ( arg_14 . as_numpy_dtype ) . eps + arg_2 . nn . softplus ( arg_20 ) ) return arg_19 , arg_21 return _fn

Parses a file and returns a document object.
        File, a file like object.


Question: Update selected keys .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . dumps ( ) arg_2 [ '_deposit' ] [ 'pid' ] [ 'revision_id' ] = arg_1 . revision_id arg_2 [ '_deposit' ] [ 'status' ] = 'draft' arg_2 [ '$schema' ] = arg_0 . build_deposit_schema ( arg_1 ) return arg_2

Accept a raw uri and return rewritten versions.

    This function returns a normalized URI and a docker path. The normalized
    URI may have minor alterations meant to disambiguate and prepare for use
    by shell utilities that may require a specific format.

    The docker rewriter makes substantial modifications to the raw URI when
    constructing a docker path, but modifications must follow these rules:
      1) System specific characters are not allowed (ex. indirect paths).
      2) The path, if it is a directory, must end in a forward slash.
      3) The path will begin with the value set in self._relative_path.
      4) The path will have an additional prefix (after self._relative_path) set
         by the file provider-specific rewriter.

    Rewrite output for the docker path:
      >>> out_util = FileParamUtil('AUTO_', 'output')
      >>> out_util.rewrite_uris('gs://mybucket/myfile.txt', job_model.P_GCS)[1]
      'output/gs/mybucket/myfile.txt'
      >>> out_util.rewrite_uris('./data/myfolder/', job_model.P_LOCAL)[1]
      'output/file/data/myfolder/'

    When normalizing the URI for cloud buckets, no rewrites are done. For local
    files, the user directory will be expanded and relative paths will be
    converted to absolute:
      >>> in_util = FileParamUtil('AUTO_', 'input')
      >>> in_util.rewrite_uris('gs://mybucket/gcs_dir/', job_model.P_GCS)[0]
      'gs://mybucket/gcs_dir/'
      >>> in_util.rewrite_uris('/data/./dir_a/../myfile.txt',
      ...   job_model.P_LOCAL)[0]
      '/data/myfile.txt'
      >>> in_util.rewrite_uris('file:///tmp/data/*.bam', job_model.P_LOCAL)[0]
      '/tmp/data/*.bam'

    Args:
      raw_uri: (str) the path component of the raw URI.
      file_provider: a valid provider (contained in job_model.FILE_PROVIDERS).

    Returns:
      normalized: a cleaned version of the uri provided by command line.
      docker_path: the uri rewritten in the format required for mounting inside
                   a docker worker.

    Raises:
      ValueError: if file_provider is not valid.


Question: Sonifies the estimated times into the output file .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0 ) : arg_5 = arg_1 + arg_4 arg_6 = np . sin ( 2 * np . pi * np . arange ( arg_3 * .1 ) * 1000 / ( 1. * arg_3 ) ) arg_6 *= np . exp ( - np . arange ( arg_3 * .1 ) / ( arg_3 * .01 ) ) arg_7 = int ( arg_5 . max ( ) * arg_3 + arg_6 . shape [ 0 ] + 1 ) arg_8 = mir_eval . sonify . clicks ( arg_5 , arg_3 , arg_7 = arg_7 ) arg_9 = np . zeros ( max ( arg_10 ( arg_0 ) , arg_10 ( arg_8 ) ) ) arg_9 [ : arg_10 ( arg_0 ) ] = arg_0 arg_9 [ : arg_10 ( arg_8 ) ] += arg_8 scipy . io . wavfile . write ( arg_2 , arg_3 , arg_9 )


Question: Convert an AST terminal to python source code .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = _replace ( arg_1 . value ) if arg_0 . use_terminal_shorthand : return [ arg_3 ] else : return [ "terminal({})" . format ( arg_3 ) ]

Returns participation data for the given sis_course_id.

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


Question: Obtain particular version of the doc at key .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : if '_doc' in arg_3 : arg_4 = arg_3 [ '_doc' ] else : if type ( arg_2 ) is int : if arg_2 == 0 : arg_5 = pymongo . ASCENDING elif arg_2 == - 1 : arg_5 = pymongo . DESCENDING arg_4 = arg_0 . _collection . find_one ( { 'k' : arg_1 } , sort = [ [ 'd' , arg_5 ] ] ) elif type ( arg_2 ) is datetime : arg_6 = arg_0 . __round_time ( arg_2 ) arg_4 = arg_0 . _collection . find_one ( { 'k' : arg_1 , 'd' : arg_6 } ) if arg_4 is None : raise KeyError ( 'Supplied key `{0}` or version `{1}` does not exist' . format ( arg_1 , str ( arg_2 ) ) ) arg_7 = arg_4 [ 'v' ] return pickle . loads ( arg_7 )


Question: Merges trajectories by loading iteratively items of the other trajectory and store it into the current trajectory .

def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_2 : arg_4 = arg_2 [ arg_3 ] arg_5 = arg_1 . f_get ( arg_3 ) if arg_5 . f_is_empty ( ) : with arg_0 . _nn_interface . _disable_logging : arg_1 . f_load_item ( arg_5 ) if not arg_0 . f_contains ( arg_4 ) : arg_6 = arg_5 . f_get_class_name ( ) arg_7 = arg_0 . _create_class ( arg_6 ) arg_8 = arg_0 . f_add_leaf ( arg_7 , arg_4 ) else : arg_8 = arg_0 . f_get ( arg_4 , shortcuts = False ) if not arg_8 . f_is_empty ( ) : raise RuntimeError ( 'Something is wrong! Your item `%s` should be empty.' % arg_4 ) arg_9 = arg_5 . _store ( ) arg_8 . _load ( arg_9 ) arg_8 . f_set_annotations ( ** arg_5 . v_annotations . f_to_dict ( copy = False ) ) arg_8 . v_comment = arg_5 . v_comment arg_0 . f_store_item ( arg_8 ) if arg_5 . v_is_parameter : arg_5 . f_unlock ( ) arg_8 . f_unlock ( ) arg_5 . f_empty ( ) arg_8 . f_empty ( )

Delete latex comments from TeX source.

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

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


Question: \ Writes an image src http string to disk as a temporary file and returns the LocallyStoredImage object that has the info you should need on the image

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_0 . read_localfile ( arg_2 , arg_3 , arg_4 ) if arg_5 : return arg_5 if arg_3 . startswith ( 'data:image' ) : arg_5 = arg_0 . write_localfile_base64 ( arg_2 , arg_3 , arg_4 ) return arg_5 arg_6 = arg_1 . fetch ( arg_3 ) if arg_6 : arg_5 = arg_0 . write_localfile ( arg_6 , arg_2 , arg_3 , arg_4 ) if arg_5 : return arg_5 return None

Create an iterable from the iterables that contains each element once.

    :return: an iterable over the iterables. Each element of the result
      appeared only once in the result. They are ordered by the first
      occurrence in the iterables.


Question: Fit KimCNNClassifier according to X y

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = WordVectorTransformer ( padding = 'max' ) arg_1 = arg_3 . Func_transform ( arg_1 ) arg_1 = LongTensor ( arg_1 ) arg_0 . word_vector_transformer = arg_3 arg_4 = LabelEncoder ( ) arg_2 = arg_4 . Func_transform ( arg_2 ) arg_2 = torch . from_numpy ( arg_2 ) arg_0 . y_transformer = arg_4 arg_5 = CategorizedDataset ( arg_1 , arg_2 ) arg_6 = DataLoader ( arg_5 , batch_size = arg_0 . batch_size , shuffle = True , num_workers = 4 ) arg_7 = arg_0 . kernel_sizes arg_8 = arg_0 . num_kernel arg_9 = arg_0 . embedding_dim arg_10 = TextCNN ( vocab_size = arg_3 . get_vocab_size ( ) , embedding_dim = arg_9 , output_size = len ( arg_0 . y_transformer . classes_ ) , kernel_sizes = arg_7 , num_kernel = arg_8 ) if USE_CUDA : arg_10 = arg_10 . cuda ( ) arg_11 = arg_0 . epoch arg_12 = arg_0 . lr arg_13 = nn . CrossEntropyLoss ( ) arg_14 = optim . Adam ( arg_10 . parameters ( ) , lr = arg_12 ) for arg_15 in range ( arg_11 ) : arg_16 = [ ] for arg_17 , arg_18 in enumerate ( arg_6 ) : arg_1 , arg_2 = arg_18 arg_1 , arg_2 = Variable ( arg_1 ) , Variable ( arg_2 ) arg_14 . zero_grad ( ) arg_10 . train ( ) arg_19 = arg_10 ( arg_1 ) arg_20 = arg_13 ( arg_19 , arg_2 ) arg_16 . append ( arg_20 . data . tolist ( ) [ 0 ] ) arg_20 . backward ( ) arg_14 . step ( ) if arg_17 % 100 == 0 : print ( "[%d/%d] mean_loss : %0.2f" % ( arg_15 , arg_11 , np . mean ( arg_16 ) ) ) arg_16 = [ ] arg_0 . model = arg_10

Modify an existing lock's timeout.

        token:
            Valid lock token.
        timeout:
            Suggested lifetime in seconds (-1 for infinite).
            The real expiration time may be shorter than requested!
        Returns:
            Lock dictionary.
            Raises ValueError, if token is invalid.


Question: Installs system packages listed in apt - requirements . txt .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = 0 , arg_4 = 0 ) : arg_5 = arg_0 . local_renderer assert arg_0 . genv [ ROLE ] arg_6 = arg_1 or ( arg_0 . env . apt_requirments_fn and arg_0 . find_template ( arg_0 . env . apt_requirments_fn ) ) if not arg_6 : return [ ] assert os . path . isfile ( arg_6 ) arg_7 = list ( arg_0 . env . apt_packages or [ ] ) for arg_8 in open ( arg_6 ) . readlines ( ) : if arg_8 . strip ( ) and not arg_8 . strip ( ) . startswith ( '#' ) and ( not arg_2 or arg_8 . strip ( ) == arg_2 ) : arg_7 . extend ( arg_9 . strip ( ) for arg_9 in arg_8 . split ( ' ' ) if arg_9 . strip ( ) ) if arg_4 : return arg_7 arg_10 = arg_5 . write_temp_file ( '\n' . join ( arg_7 ) ) arg_6 = arg_10 if not arg_0 . genv . is_local : arg_5 . put ( local_path = arg_10 , remote_path = arg_10 ) arg_6 = arg_0 . genv . put_remote_path arg_5 . sudo ( 'DEBIAN_FRONTEND=noninteractive apt-get -yq update --fix-missing' ) arg_5 . sudo ( 'DEBIAN_FRONTEND=noninteractive apt-get -yq install `cat "%s" | tr "\\n" " "`' % arg_6 )

Add this manager's namespace to the graph.


Question: Parse a page of character results .

async def Func ( arg_0 ) : arg_0 = list ( arg_0 . find_all ( 'table' , class_ = 'stripe' ) [ 0 ] . children ) [ 1 : ] arg_1 = [ ] for arg_2 in arg_0 : arg_3 = { 'gender' : None , 'name' : None , 'games' : { } } arg_3 [ 'gender' ] = arg_2 . abbr . get ( 'title' ) arg_3 [ 'name' ] = list ( arg_2 . children ) [ 1 ] . a . string arg_3 [ 'games' ] = [ ] for arg_4 in list ( list ( list ( arg_2 . children ) [ 1 ] . children ) [ 1 ] . children ) : if isinstance ( arg_4 , NavigableString ) : continue arg_3 [ 'games' ] . append ( { 'name' : arg_4 . string , 'id' : arg_4 . get ( 'href' ) . split ( '/' ) [ 1 ] } ) arg_1 . append ( arg_3 ) del arg_3 return arg_1

Produces a TidyPy configuration that incorporates the configuration files
    stored in the current user's home directory.

    :param project_path: the path to the project that is going to be analyzed
    :type project_path: str
    :param use_cache:
        whether or not to use cached versions of any remote/referenced TidyPy
        configurations. If not specified, defaults to ``True``.
    :type use_cache: bool
    :rtype: dict


Question: Return a list of published courses for the passed account ID .

def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_2 [ "published" ] = True return arg_0 . get_courses_in_account ( arg_1 , arg_2 )

Associates a cobra.Gene object with a cobra.Reaction.

        Parameters
        ----------
        cobra_gene : cobra.core.Gene.Gene


Question: Parse the Jmeter file and calculate key stats

def Func ( arg_0 ) : arg_1 = True for arg_2 in arg_0 . infile_list : arg_1 = arg_1 and naarad . utils . is_valid_file ( arg_2 ) if not arg_1 : return False arg_3 = arg_0 . Func_xml_jtl ( arg_0 . aggregation_granularity ) gc . collect ( ) return arg_3

Replicate a VM image to multiple target locations. This operation
        is only for publishers. You have to be registered as image publisher
        with Microsoft Azure to be able to call this.

        vm_image_name:
            Specifies the name of the VM Image that is to be used for
            replication
        regions:
            Specified a list of regions to replicate the image to
            Note: The regions in the request body are not additive. If a VM
            Image has already been replicated to Regions A, B, and C, and
            a request is made to replicate to Regions A and D, the VM
            Image will remain in Region A, will be replicated in Region D,
            and will be unreplicated from Regions B and C
        offer:
            Specifies the publisher defined name of the offer. The allowed
            characters are uppercase or lowercase letters, digit,
            hypen(-), period (.).The maximum allowed length is 64 characters.
        sku:
            Specifies the publisher defined name of the Sku. The allowed
            characters are uppercase or lowercase letters, digit,
            hypen(-), period (.). The maximum allowed length is 64 characters.
        version:
            Specifies the publisher defined version of the image.
            The allowed characters are digit and period.
            Format: <MajorVersion>.<MinorVersion>.<Patch>
            Example: '1.0.0' or '1.1.0' The 3 version number to
            follow standard of most of the RPs. See http://semver.org


Question: Adjust contrast of an Image .

def Func ( arg_0 , arg_1 ) : if not _is_pil_image ( arg_0 ) : raise TypeError ( 'img should be PIL Image. Got {}' . format ( type ( arg_0 ) ) ) arg_2 = ImageEnhance . Contrast ( arg_0 ) arg_0 = arg_2 . enhance ( arg_1 ) return arg_0

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: Add an activity to the component .

def Func ( arg_0 , arg_1 ) : arg_0 . gl . structure . validate_account_names ( arg_1 . get_referenced_accounts ( ) ) arg_0 . activities . append ( arg_1 ) arg_1 . set_parent_path ( arg_0 . path )

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: Writes the referrers data to file .

def Func ( arg_0 , arg_1 = '' , arg_2 = arg_3 ( arg_4 . date . today ( ) ) , arg_6 = 'llnl' ) : arg_0 . remove_date ( arg_1 = arg_1 , arg_2 = arg_2 ) arg_7 = os . path . isfile ( arg_1 ) with open ( arg_1 , 'a' ) as out : if not arg_7 : out . write ( 'date,organization,referrer,count,count_log,uniques,' + 'uniques_logged\n' ) arg_8 = sorted ( arg_0 . referrers_lower ) for arg_9 in arg_8 : arg_10 = arg_0 . referrers_lower [ arg_9 ] arg_11 = arg_0 . referrers [ arg_10 ] [ 0 ] arg_12 = arg_0 . referrers [ arg_10 ] [ 1 ] if arg_11 == 1 : arg_11 = 1.5 if arg_12 == 1 : arg_12 = 1.5 arg_13 = math . log ( arg_11 ) arg_14 = math . log ( arg_12 ) out . write ( arg_2 + ',' + arg_6 + ',' + arg_10 + ',' + arg_3 ( arg_11 ) + ',' + arg_3 ( arg_13 ) + ',' + arg_3 ( arg_12 ) + ',' + arg_3 ( arg_14 ) + '\n' ) out . close ( )

Performs recombination by binary crossover for the current population.

  Let v_i denote the i'th component of the member v and m_i the corresponding
  component of the mutant vector corresponding to v. Then the crossed over
  vector w_i is determined by setting w_i =
  (m_i with probability=crossover_prob else v_i). In addition, DE requires that
  at least one of the components is crossed over (otherwise we end
  up with no change). This is done by choosing on index say k randomly where
  a force crossover is performed (i.e. w_k = m_k). This is the scheme
  implemented in this function.

  Args:
    population: A Python list of `Tensor`s where each `Tensor` in the list
      must be of rank at least 1 and all the elements must have a common
      first dimension. The base population to cross over.
    population_size: A scalar integer `Tensor`. The number of elements in the
      population (i.e. size of the first dimension of any member of
      `population`).
    mutants: A Python list of `Tensor`s with the same structure as `population`.
      The mutated population.
    crossover_prob: A postive real scalar `Tensor` bounded above by 1.0. The
      probability of a crossover being performed for each axis.
    seed: `int` or None. The random seed for this `Op`. If `None`, no seed is
      applied.

  Returns:
    A list of `Tensor`s of the same structure, dtype and shape as `population`.
    The recombined population.


Question: Set or return size of current font .

def Func ( arg_0 , Func = None ) : if Func is not None : arg_0 . _canvas . fontsize = Func else : return arg_0 . _canvas . fontsize

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


Question: Rank sub - graphs by which have the most nodes matching an given filter .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 , arg_5 [ arg_4 ] ] , arg_6 : arg_7 = 'Subgraph' , arg_8 : arg_9 = True , ) -> List [ Tuple [ arg_7 , int ] ] : arg_10 = group_nodes_by_annotation_filtered ( arg_0 , arg_2 = arg_2 , arg_6 = arg_6 ) arg_11 = count_dict_values ( arg_10 ) return sorted ( arg_11 . items ( ) , key = itemgetter ( 1 ) , arg_8 = arg_8 )

Handle marking messages as read and keeping client active.


Question: Get a list of the running applications .

def Func ( arg_0 ) : def runLoopAndExit ( ) : AppHelper . stopEventLoop ( ) AppHelper . callLater ( 1 , runLoopAndExit ) AppHelper . runConsoleEventLoop ( ) arg_1 = AppKit . NSWorkspace . sharedWorkspace ( ) arg_2 = arg_1 . runningApplications ( ) return arg_2

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


Question: Add the currently mined information to the mined database .

def Func ( arg_0 , arg_1 ) : if arg_2 . CONFIGURATION [ "mining" ] : if arg_2 . INTERN [ "file_to_test" ] not in arg_2 . INTERN [ "mined" ] : arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] = { } for arg_4 in arg_1 : if ( arg_4 in arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] ) : arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] [ arg_4 ] . extend ( arg_1 [ arg_4 ] ) else : arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] [ arg_4 ] = arg_1 [ arg_4 ] arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] [ arg_4 ] = List ( arg_2 . INTERN [ "mined" ] [ arg_2 . INTERN [ "file_to_test" ] ] [ arg_4 ] ) . format ( ) arg_0 . _backup ( )

Setting up and running GIES with all arguments.


Question: Sets the width and height of the current window .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'current' ) : arg_0 . _execute ( Command . SET_WINDOW_SIZE , { 'width' : int ( arg_1 ) , 'height' : int ( arg_2 ) , 'window_handle' : arg_3 } )

expression_terminal = identifier
                           | terminal
                           | option_group
                           | repetition_group
                           | grouping_group
                           | special_handling ;


Question: Creates a new key stores it then returns key parameters and attributes to the client .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = False , ** arg_11 ) : arg_12 = models . KeyCreateParameters ( arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 ) arg_13 = arg_0 . Func . metadata [ 'url' ] arg_14 = { 'vaultBaseUrl' : arg_0 . _serialize . url ( "vault_base_url" , arg_1 , 'str' , skip_quote = True ) , 'key-name' : arg_0 . _serialize . url ( "key_name" , arg_2 , 'str' , pattern = r'^[0-9a-zA-Z-]+$' ) } arg_13 = arg_0 . _client . format_url ( arg_13 , ** arg_14 ) arg_15 = { } arg_15 [ 'api-version' ] = arg_0 . _serialize . query ( "self.api_version" , arg_0 . api_version , 'str' ) arg_16 = { } arg_16 [ 'Content-Type' ] = 'application/json; charset=utf-8' if arg_0 . config . generate_client_request_id : arg_16 [ 'x-ms-client-request-id' ] = str ( uuid . uuid1 ( ) ) if arg_9 : arg_16 . update ( arg_9 ) if arg_0 . config . accept_language is not None : arg_16 [ 'accept-language' ] = arg_0 . _serialize . header ( "self.config.accept_language" , arg_0 . config . accept_language , 'str' ) arg_17 = arg_0 . _serialize . body ( arg_12 , 'KeyCreateParameters' ) arg_18 = arg_0 . _client . post ( arg_13 , arg_15 ) arg_19 = arg_0 . _client . send ( arg_18 , arg_16 , arg_17 , stream = False , ** arg_11 ) if arg_19 . status_code not in [ 200 ] : raise models . KeyVaultErrorException ( arg_0 . _deserialize , arg_19 ) arg_20 = None if arg_19 . status_code == 200 : arg_20 = arg_0 . _deserialize ( 'KeyBundle' , arg_19 ) if arg_10 : arg_21 = ClientRawResponse ( arg_20 , arg_19 ) return arg_21 return arg_20


Question: Get the snapshot of a content for the given version .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . RCONTENTS + '/' + str ( arg_1 ) arg_4 = { arg_0 . PVERSION : arg_2 , arg_0 . PSTATUS : arg_0 . VHISTORICAL , arg_0 . PEXPAND : ',' . join ( arg_0 . VEXPAND ) } arg_5 = [ arg_5 for arg_5 in arg_0 . _call ( arg_3 , arg_4 ) ] return arg_5 [ 0 ]

Parse a Supybot IRC log file.

        The method parses the Supybot IRC log file and returns an iterator of
        dictionaries. Each one of this, contains a message from the file.

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

        :raises ParseError: raised when the format of the Supybot log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file


Question: Display a list of all users and which institutes they belong to .

def Func ( arg_0 ) : arg_1 = list ( arg_0 . Func ( ) ) arg_2 = arg_0 . user_events ( ) . count ( ) for arg_3 in arg_1 : if arg_3 . get ( 'institutes' ) : arg_3 [ 'institutes' ] = [ arg_0 . institute ( inst_id ) for inst_id in arg_3 . get ( 'institutes' ) ] else : arg_3 [ 'institutes' ] = [ ] arg_3 [ 'events' ] = arg_0 . user_events ( arg_3 ) . count ( ) arg_3 [ 'events_rank' ] = event_rank ( arg_3 [ 'events' ] ) return dict ( Func = sorted ( arg_1 , key = lambda user : - user [ 'events' ] ) , arg_2 = arg_2 , )


Question: Get a package_data and data_files handler command .

def Func ( arg_0 , arg_1 ) : class FileHandler ( BaseCommand ) : def run ( arg_2 ) : arg_3 = arg_2 . distribution . package_data arg_4 = arg_0 or dict ( ) for ( arg_5 , arg_6 ) in arg_4 . items ( ) : arg_3 [ arg_5 ] = _get_package_data ( arg_5 , arg_6 ) arg_2 . distribution . data_files = _get_data_files ( arg_1 , arg_2 . distribution . data_files ) return FileHandler

Return a warning message of code 'code'.

    If code = (cd, str) it returns the warning message of code 'cd' and appends
    str at the end


Question: save the result of a completed task .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 [ 0 ] try : arg_2 = arg_0 . session . unserialize ( arg_2 ) except Exception : arg_0 . log . error ( "task::invalid task result message send to %r: %r" , arg_3 , arg_2 , exc_info = True ) return arg_4 = arg_2 [ 'parent_header' ] if not arg_4 : arg_0 . log . warn ( "Task %r had no parent!" , arg_2 ) return arg_5 = arg_4 [ 'msg_id' ] if arg_5 in arg_0 . unassigned : arg_0 . unassigned . remove ( arg_5 ) arg_6 = arg_2 [ 'header' ] arg_7 = arg_6 . get ( 'engine' , u'' ) arg_8 = arg_0 . by_ident . get ( cast_bytes ( arg_7 ) , None ) arg_9 = arg_6 . get ( 'status' , None ) if arg_5 in arg_0 . pending : arg_0 . log . info ( "task::task %r finished on %s" , arg_5 , arg_8 ) arg_0 . pending . remove ( arg_5 ) arg_0 . all_completed . add ( arg_5 ) if arg_8 is not None : if arg_9 != 'aborted' : arg_0 . completed [ arg_8 ] . append ( arg_5 ) if arg_5 in arg_0 . tasks [ arg_8 ] : arg_0 . tasks [ arg_8 ] . remove ( arg_5 ) arg_10 = arg_6 [ 'date' ] arg_11 = arg_6 . get ( 'started' , None ) arg_12 = { 'result_header' : arg_6 , 'result_content' : arg_2 [ 'content' ] , 'started' : arg_11 , 'completed' : arg_10 , 'received' : datetime . now ( ) , 'engine_uuid' : arg_7 , } arg_12 [ 'result_buffers' ] = arg_2 [ 'buffers' ] try : arg_0 . db . update_record ( arg_5 , arg_12 ) except Exception : arg_0 . log . error ( "DB Error saving task request %r" , arg_5 , exc_info = True ) else : arg_0 . log . debug ( "task::unknown task %r finished" , arg_5 )

Deobfuscates the URL and returns HttpResponse from source view.
    SEO juice is mostly ignored as it is intended for display purposes only.


Question: Find the necessary file for the given test case .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = os . path . dirname ( __file__ ) arg_4 = os . path . join ( arg_3 , "mappings" , arg_0 , arg_2 , arg_1 ) if os . path . exists ( arg_4 ) : return arg_4 else : arg_5 = "Couldn't find parsing file: {}" . format ( arg_4 ) logger . error ( arg_5 ) raise IOError ( arg_5 )

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


Question: This will decode an instruction from memory pointed by pc

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _instruction_cache : return arg_0 . _instruction_cache [ arg_1 ] arg_2 = b'' for arg_3 in range ( arg_1 , arg_1 + arg_0 . max_instr_width ) : if not arg_0 . memory . access_ok ( arg_3 , 'x' ) : break arg_4 = arg_0 . memory [ arg_3 ] if issymbolic ( arg_4 ) : if isinstance ( arg_0 . memory , LazySMemory ) : try : arg_5 = visitors . simplify_array_select ( arg_4 ) arg_4 = bytes ( [ arg_5 [ 0 ] ] ) except visitors . ArraySelectSimplifier . ExpressionNotSimple : arg_4 = struct . pack ( 'B' , solver . get_value ( arg_0 . memory . constraints , arg_4 ) ) elif isinstance ( arg_4 , Constant ) : arg_4 = bytes ( [ arg_4 . value ] ) else : logger . error ( 'Concretize executable memory %r %r' , arg_4 , arg_2 ) raise ConcretizeMemory ( arg_0 . memory , arg_3 = arg_1 , size = 8 * arg_0 . max_instr_width , policy = 'INSTRUCTION' ) arg_2 += arg_4 arg_6 = arg_2 . ljust ( arg_0 . max_instr_width , b'\x00' ) try : arg_7 = arg_0 . disasm . disassemble_instruction ( arg_6 , arg_1 ) except StopIteration as e : raise DecodeException ( arg_1 , arg_6 ) if not arg_0 . memory . access_ok ( slice ( arg_1 , arg_1 + arg_7 . size ) , 'x' ) : logger . info ( "Trying to execute instructions from non-executable memory" ) raise InvalidMemoryAccess ( arg_1 , 'x' ) arg_7 . operands = arg_0 . _wrap_operands ( arg_7 . operands ) arg_0 . _instruction_cache [ arg_1 ] = arg_7 return arg_7

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

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

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


Question: Make a filename relative where the filename path and it is relative to rel_to

def Func ( arg_0 , arg_1 ) : arg_2 = os . path . basename ( arg_0 ) arg_0 = os . path . dirname ( arg_0 ) arg_0 = os . path . normpath ( os . path . abspath ( arg_0 ) ) arg_1 = os . path . normpath ( os . path . abspath ( arg_1 ) ) arg_3 = arg_0 . strip ( os . path . sep ) . split ( os . path . sep ) arg_4 = arg_1 . strip ( os . path . sep ) . split ( os . path . sep ) while arg_3 and arg_4 and arg_3 [ 0 ] == arg_4 [ 0 ] : arg_3 . pop ( 0 ) arg_4 . pop ( 0 ) arg_5 = [ '..' ] * len ( arg_4 ) + arg_3 + [ arg_2 ] if arg_5 == [ '' ] : return '.' + os . path . sep return os . path . sep . join ( arg_5 )

Return list of GATT descriptors that have been discovered for this
        characteristic.


Question: Build a callable for one step of Kalman covariance recursion .

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

Serialize this object as dictionary usable for conversion to JSON.

        :return: Dictionary representing this object.


Question: r Compute dosage from allele expectation .

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : return arg_0 [ ... , - 1 ] try : return arg_0 [ : , arg_1 ] except NotImplementedError : arg_1 = asarray ( arg_1 , int ) return asarray ( arg_0 , float ) [ : , arg_1 ]

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


Question: Unregister the SizedImage subclass currently assigned to attr_name .

def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . _sizedimage_registry : raise NotRegistered ( 'No SizedImage subclass is registered to %s' % arg_1 ) else : del arg_0 . _sizedimage_registry [ arg_1 ]

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


Question: Compute the context vector with soft attention .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_3 = arg_3 if arg_3 else arg_0 . precompute ( arg_2 ) arg_5 = arg_0 . compute_alignments ( arg_1 , arg_3 , arg_4 ) arg_6 = T . sum ( arg_5 [ : , : , None ] * arg_2 , axis = 1 ) return arg_6

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


Question: Retrieve the given subparser from parser

def Func ( arg_0 , arg_1 ) : arg_2 = [ action for action in arg_0 . _actions if isinstance ( action , argparse . _SubParsersAction ) ] for arg_3 in arg_2 : for arg_4 , arg_5 in arg_3 . choices . items ( ) : if arg_4 == arg_1 : return arg_5 return None

Write the index.html file for this report.


Question: Fetch up to size rows from the cursor . Result set may be smaller than size . If size is not defined cursor . arraysize is used .

def Func ( arg_0 , arg_1 = None ) : arg_0 . _check_executed ( ) arg_2 = arg_0 . _fetch_row ( arg_1 or arg_0 . arraysize ) arg_0 . rownumber = arg_0 . rownumber + len ( arg_2 ) if not arg_2 : arg_0 . _warning_check ( ) return arg_2

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


Question: Initialize the bucket map assuming the given number of maxBuckets .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _maxBuckets = arg_1 arg_0 . minIndex = arg_0 . _maxBuckets / 2 arg_0 . maxIndex = arg_0 . _maxBuckets / 2 arg_0 . _offset = arg_2 arg_0 . bucketMap = { } def _permutation ( arg_8 ) : arg_9 = numpy . arange ( arg_8 , dtype = numpy . uint32 ) arg_0 . random . shuffle ( arg_9 ) return arg_9 arg_0 . bucketMap [ arg_0 . minIndex ] = _permutation ( arg_0 . n ) [ 0 : arg_0 . w ] arg_0 . numTries = 0

Stop the timer

        Returns:
            The time the timer was stopped


Question: Asynchronous DELETE request with the process pool .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : if not arg_2 : arg_2 = '' arg_4 = arg_4 or { } arg_5 = arg_5 or { } arg_6 = arg_0 . _build_endpoint_url ( arg_1 , arg_2 ) arg_0 . _authenticate ( arg_4 , arg_5 ) process_pool . apply_async ( make_delete_request , args = ( arg_6 , arg_4 , arg_5 ) , arg_3 = arg_3 )

Overriding the default JSONEncoder.default for NDB support.


Question: set to stroke linecap .

def Func ( arg_0 , arg_1 ) : arg_1 = getattr ( pgmagick . LineCap , "%sCap" % arg_1 . title ( ) ) arg_1 = pgmagick . DrawableStrokeLineCap ( arg_1 ) arg_0 . drawer . append ( arg_1 )


Question: Return the solid named name . Throws if it does not exist .

def Func ( arg_0 , arg_1 ) : check . str_param ( arg_1 , 'name' ) if arg_1 not in arg_0 . _solid_dict : raise DagsterInvariantViolationError ( 'Pipeline {pipeline_name} has no solid named {name}.' . format ( pipeline_name = arg_0 . name , arg_1 = arg_1 ) ) return arg_0 . _solid_dict [ arg_1 ]

Configure the Outstation's database of input point definitions.

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


Question: analyze a simple word to detect cross - references and styling

def Func ( arg_0 , arg_1 ) : arg_2 = re_crossref . match ( arg_1 ) if arg_2 : try : arg_3 = arg_2 . group ( 1 ) arg_4 = arg_2 . group ( 2 ) arg_5 = arg_0 . identifiers [ arg_3 ] arg_6 = arg_0 . make_block_url ( arg_5 ) return '' + arg_3 + '' + arg_4 except : sys . stderr . write ( "WARNING: undefined cross reference '" + arg_3 + "'.\n" ) return '?' + arg_3 + '?' + arg_4 arg_2 = re_italic . match ( arg_1 ) if arg_2 : arg_3 = arg_2 . group ( 1 ) arg_4 = arg_2 . group ( 3 ) return '' + arg_3 + '' + arg_4 arg_2 = re_bold . match ( arg_1 ) if arg_2 : arg_3 = arg_2 . group ( 1 ) arg_4 = arg_2 . group ( 3 ) return '' + arg_3 + '' + arg_4 return html_quote ( arg_1 )


Question: Get a directory from the database .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : with arg_0 . engine . begin ( ) as db : try : arg_4 = get_directory ( db , arg_0 . user_id , arg_1 , arg_2 ) except NoSuchDirectory : if arg_0 . file_exists ( arg_1 ) : arg_0 . do_400 ( "Wrong type: %s" % arg_1 ) else : arg_0 . no_such_entity ( arg_1 ) return arg_0 . _directory_model_from_db ( arg_4 , arg_2 )

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

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


Question: If possible set the input buffer to a previous history item .

def Func ( arg_0 , arg_1 = '' , arg_2 = True ) : arg_3 = arg_0 . _history_index arg_4 = False while arg_3 > 0 : arg_3 -= 1 arg_5 = arg_0 . _get_edited_history ( arg_3 ) if ( arg_2 and arg_5 . startswith ( arg_1 ) ) or ( not arg_2 and arg_1 in arg_5 ) : arg_4 = True break if arg_4 : arg_0 . _store_edits ( ) arg_0 . _history_index = arg_3 arg_0 . input_buffer = arg_5 return arg_4

Check the spacing of a single equals sign.


Question: Returns a list of all tfvc branches for the supplied project within the supplied collection

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] arg_5 = create_tfs_tfvc_client ( '{url}/{collection_name}' . format ( arg_0 = arg_0 , collection_name = arg_2 . name ) , arg_1 ) logger . debug ( 'Retrieving Tfvc Branches for Project: {project_name}' . format ( project_name = arg_3 . name ) ) arg_6 = arg_5 . get_branches ( arg_3 . id , True , True , False , True ) if arg_6 : arg_4 . extend ( arg_6 ) else : logger . debug ( 'No Tfvcc Branches in Project: {project_name}' . format ( project_name = arg_3 . name ) ) return arg_4

Generate RENEWING time.

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

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


Question: Split a env var text like

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = arg_0 . partition ( '=' ) arg_1 , arg_3 = arg_1 . strip ( ) , arg_3 . strip ( ) . encode ( 'unicode-escape' ) . decode ( 'ascii' ) if arg_3 and arg_3 [ 0 ] == arg_3 [ - 1 ] in [ '"' , "'" ] : arg_3 = __escape_decoder ( arg_3 [ 1 : - 1 ] ) [ 0 ] return arg_1 , arg_3

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


Question: send the registration_request

def Func ( arg_0 ) : arg_0 . log . info ( "Registering with controller at %s" % arg_0 . url ) arg_1 = arg_0 . context arg_2 , arg_3 = arg_0 . init_connector ( ) arg_4 = arg_1 . socket ( zmq . DEALER ) arg_4 . setsockopt ( zmq . IDENTITY , arg_0 . bident ) arg_2 ( arg_4 , arg_0 . url ) arg_0 . registrar = zmqstream . ZMQStream ( arg_4 , arg_0 . loop ) arg_6 = dict ( queue = arg_0 . ident , heartbeat = arg_0 . ident , control = arg_0 . ident ) arg_0 . registrar . on_recv ( lambda msg : arg_0 . complete_registration ( msg , arg_2 , arg_3 ) ) arg_0 . session . send ( arg_0 . registrar , "registration_request" , arg_6 = arg_6 )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Return a triple theta phi lambda for the product .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 , arg_7 , arg_8 = Optimize1qGates . yzy_to_zyz ( ( arg_2 + arg_4 ) , arg_0 , arg_3 ) ( arg_9 , arg_10 , arg_11 ) = ( arg_6 , arg_1 + arg_7 , arg_5 + arg_8 ) return ( arg_9 , arg_10 , arg_11 )

Extract metadata entries from an xml node


Question: Load metadata from the archive file

def Func ( arg_0 ) : logger . debug ( "Loading metadata infomation of archive %s" , arg_0 . archive_path ) arg_1 = arg_0 . _db . cursor ( ) arg_2 = "SELECT origin, backend_name, backend_version, " "category, backend_params, created_on " "FROM " + arg_0 . METADATA_TABLE + " " "LIMIT 1" arg_1 . execute ( arg_2 ) arg_3 = arg_1 . fetchone ( ) arg_1 . close ( ) if arg_3 : arg_0 . origin = arg_3 [ 0 ] arg_0 . backend_name = arg_3 [ 1 ] arg_0 . backend_version = arg_3 [ 2 ] arg_0 . category = arg_3 [ 3 ] arg_0 . backend_params = pickle . loads ( arg_3 [ 4 ] ) arg_0 . created_on = str_to_datetime ( arg_3 [ 5 ] ) else : logger . debug ( "Metadata of archive %s was empty" , arg_0 . archive_path ) logger . debug ( "Metadata of archive %s loaded" , arg_0 . archive_path )

Get an access token from the provider token URI.

        :param code: Authorization code.
        :type code: str
        :return: Dict containing access token, refresh token, etc.
        :rtype: dict


Question: Add more transformed MIBs repositories .

def Func ( arg_0 , * arg_1 ) : arg_0 . _searchers . extend ( arg_1 ) debug . logger & debug . flagCompiler and debug . logger ( 'current compiled MIBs location(s): %s' % ', ' . join ( [ str ( arg_2 ) for arg_2 in arg_0 . _searchers ] ) ) return arg_0


Question: Select last row

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) if not arg_3 . AXEnabled : raise LdtpServerException ( u"Object %s state disabled" % arg_2 ) arg_4 = arg_3 . AXRows [ - 1 ] if not arg_4 . AXSelected : arg_3 . activate ( ) arg_4 . AXSelected = True else : pass return 1

Show Program Landing page for the Enterprise's Program.

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

        Unauthenticated learners will be redirected to enterprise-linked SSO.

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


Question: Returns a stderr - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_3 = None if arg_2 else arg_0 . stderr_sub_command arg_4 , arg_5 = arg_0 . _get_out_and_path ( arg_0 . stderr , arg_0 . stderr_root , arg_3 , arg_1 ) if hasattr ( arg_4 , 'stdin' ) : return arg_4 . stdin return arg_4

Add an HTTP header to response object.

        Arguments:
          name (str): HTTP header field name
          value (str): HTTP header field value


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

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = struct . pack ( '2H' , * arg_1 ) arg_0 . _cmd ( 'DMPAFT' ) arg_4 = VProCRC . get ( arg_3 ) arg_4 = struct . pack ( '>H' , arg_4 ) log_raw ( 'send' , arg_3 + arg_4 ) arg_0 . port . write ( arg_3 + arg_4 ) arg_5 = arg_0 . port . read ( len ( arg_0 . ACK ) ) log_raw ( 'read' , arg_5 ) if arg_5 != arg_0 . ACK : return arg_6 = arg_0 . port . read ( DmpStruct . size ) log_raw ( 'read' , arg_6 ) if not VProCRC . verify ( arg_6 ) : log_raw ( 'send ESC' , arg_0 . ESC ) arg_0 . port . write ( arg_0 . ESC ) return log_raw ( 'send ACK' , arg_0 . ACK ) arg_0 . port . write ( arg_0 . ACK ) arg_7 = DmpStruct . unpack ( arg_6 ) log . info ( 'reading %d pages, start offset %d' % ( arg_7 [ 'Pages' ] , arg_7 [ 'Offset' ] ) ) for arg_8 in xrange ( arg_7 [ 'Pages' ] ) : arg_6 = arg_0 . port . read ( DmpPageStruct . size ) log_raw ( 'read' , arg_6 ) if not VProCRC . verify ( arg_6 ) : log_raw ( 'send ESC' , arg_0 . ESC ) arg_0 . port . write ( arg_0 . ESC ) return log_raw ( 'send ACK' , arg_0 . ACK ) arg_0 . port . write ( arg_0 . ACK ) arg_9 = DmpPageStruct . unpack ( arg_6 ) arg_10 = 0 if arg_8 == 0 : arg_10 = arg_7 [ 'Offset' ] * ArchiveAStruct . size while arg_10 < ArchiveAStruct . size * 5 : log . info ( 'page %d, reading record at offset %d' % ( arg_9 [ 'Index' ] , arg_10 ) ) if arg_0 . _use_rev_b_archive ( arg_9 [ 'Records' ] , arg_10 ) : arg_11 = ArchiveBStruct . unpack_from ( arg_9 [ 'Records' ] , arg_10 ) else : arg_11 = ArchiveAStruct . unpack_from ( arg_9 [ 'Records' ] , arg_10 ) if arg_11 [ 'DateStamp' ] != 0xffff and arg_11 [ 'TimeStamp' ] != 0xffff : arg_2 . append ( arg_11 ) arg_10 += ArchiveAStruct . size log . info ( 'read all pages' ) return arg_2

Increases or decreases the brightness in the layer.

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


Question: Summarizes data handled by the result as a string .

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = 0 for arg_3 in arg_0 . _data : arg_4 = arg_0 . _data [ arg_3 ] arg_5 = '%s=%s, ' % ( arg_3 , repr ( arg_4 ) ) arg_1 . append ( arg_5 ) arg_2 += len ( arg_5 ) if arg_2 > pypetconstants . HDF5_STRCOL_MAX_VALUE_LENGTH : break arg_6 = "" . join ( arg_1 ) if len ( arg_6 ) > pypetconstants . HDF5_STRCOL_MAX_VALUE_LENGTH : arg_6 = arg_6 [ 0 : pypetconstants . HDF5_STRCOL_MAX_VALUE_LENGTH - 3 ] + '...' else : arg_6 = arg_6 [ 0 : - 2 ] return arg_6

Generate RENEWING time.

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

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


Question: Returns a list of files on the remote system .

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_0 . get_conn ( ) arg_3 . cwd ( arg_1 ) arg_4 = arg_3 . nlst ( ) return arg_4

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

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

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


Question: Sends ACCEPT reply .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . info or b'' arg_0 . send_raw ( arg_1 , ACCEPT , arg_3 , * arg_2 )

Start monitoring of the alarm status.

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


Question: Init openstack neutron mq

def Func ( arg_0 , arg_1 ) : if not arg_0 . enable_component_notification ( Openstack . Neutron ) : log . debug ( "disable listening neutron notification" ) return for arg_2 in range ( arg_0 . config . neutron_mq_consumer_count ) : arg_1 . create_consumer ( arg_0 . config . neutron_mq_exchange , arg_0 . config . neutron_mq_queue , ProcessFactory . process ( Openstack . Neutron ) ) log . debug ( "enable listening openstack neutron notification." )

Dump a certificate revocation list to a buffer.

    :param type: The file type (one of ``FILETYPE_PEM``, ``FILETYPE_ASN1``, or
        ``FILETYPE_TEXT``).
    :param CRL crl: The CRL to dump.

    :return: The buffer with the CRL.
    :rtype: bytes


Question: Return string fingerprint .

def Func ( arg_0 , arg_1 , arg_2 = ' ' ) : arg_1 = unicode_normalize ( 'NFKD' , text_type ( arg_1 . strip ( ) . lower ( ) ) ) arg_1 = '' . join ( [ c for c in arg_1 if c . isalnum ( ) or c . isspace ( ) ] ) arg_1 = arg_2 . join ( sorted ( list ( set ( arg_1 . split ( ) ) ) ) ) return arg_1

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Convert a notebook to the v3 format .

def Func ( arg_0 , arg_1 = 2 , arg_2 = 0 ) : if arg_1 == 1 : arg_0 = v2 . Func ( arg_0 ) arg_1 = 2 if arg_1 == 2 : arg_0 . nbformat = arg_3 arg_0 . nbformat_minor = arg_4 arg_0 . orig_nbformat = 2 return arg_0 elif arg_1 == 3 : if arg_2 != arg_4 : arg_0 . orig_nbformat_minor = arg_2 arg_0 . nbformat_minor = arg_4 return arg_0 else : raise ValueError ( 'Cannot convert a notebook from v%s to v3' % arg_1 )


Question: Instantiates worker plugins that have requsite properties .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = inspect . getmembers ( arg_1 , inspect . isclass ) arg_4 = 0 for arg_5 , arg_6 in arg_3 : if hasattr ( arg_6 , 'versions' ) : if arg_2 not in arg_6 . versions : continue else : continue if issubclass ( arg_6 , base_worker . QuarkAsyncPluginBase ) : LOG . debug ( "Loading plugin %s" % arg_5 ) arg_7 = arg_6 ( ) arg_0 . plugins . append ( arg_7 ) arg_4 += 1 LOG . debug ( "Found %d possible plugins and loaded %d" % ( len ( arg_3 ) , arg_4 ) )

Deletes the video

        Authentication is required

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

        Return:
            True if successful

        Raise:
            OperationError: on unsuccessful deletion


Question: Provide a common interface for single or multiple knockouts .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = "fba" , arg_4 = None , arg_5 = None , ** arg_6 ) : arg_7 = sutil . interface_to_str ( arg_0 . problem . __name__ ) if arg_3 == "moma" and arg_7 not in sutil . qp_solvers : raise RuntimeError ( "Cannot use MOMA since '{}' is not QP-capable." "Please choose a different solver or use FBA only." . format ( arg_7 ) ) if arg_5 is None : arg_5 = CONFIGURATION . processes with arg_0 : if "moma" in arg_3 : add_moma ( arg_0 , arg_4 = arg_4 , linear = "linear" in arg_3 ) elif "room" in arg_3 : add_room ( arg_0 , arg_4 = arg_4 , linear = "linear" in arg_3 , ** arg_6 ) arg_8 = set ( [ frozenset ( comb ) for comb in product ( * arg_2 ) ] ) arg_5 = min ( arg_5 , len ( arg_8 ) ) def extract_knockout_results ( arg_9 ) : arg_10 = pd . DataFrame ( [ ( frozenset ( ids ) , growth , status ) for ( ids , growth , status ) in arg_9 ] , columns = [ 'ids' , 'growth' , 'status' ] ) arg_10 . set_index ( 'ids' , inplace = True ) return arg_10 if arg_5 > 1 : arg_11 = dict ( gene = _gene_deletion_worker , reaction = _reaction_deletion_worker ) [ arg_1 ] arg_12 = len ( arg_8 ) // arg_5 arg_13 = multiprocessing . Pool ( arg_5 , initializer = _init_worker , initargs = ( arg_0 , ) ) arg_14 = extract_knockout_results ( arg_13 . imap_unordered ( arg_11 , arg_8 , chunksize = arg_12 ) ) arg_13 . close ( ) arg_13 . join ( ) else : arg_11 = dict ( gene = _gene_deletion , reaction = _reaction_deletion ) [ arg_1 ] arg_14 = extract_knockout_results ( map ( partial ( arg_11 , arg_0 ) , arg_8 ) ) return arg_14

Generates a bytecode from an object.

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


Question: Receiver for request - confirmed signal to send email notification .

def Func ( arg_0 ) : arg_1 , arg_2 = get_record ( arg_0 . recid ) if arg_2 is None : current_app . logger . error ( "Cannot retrieve record %s. Emails not sent" % arg_0 . recid ) return arg_3 = _ ( "Access request: %(record)s" , arg_2 = arg_2 [ "title" ] ) _send_notification ( arg_0 . receiver . email , arg_3 , "zenodo_accessrequests/emails/new_request.tpl" , arg_0 = arg_0 , arg_2 = arg_2 , arg_1 = arg_1 , ) _send_notification ( arg_0 . sender_email , arg_3 , "zenodo_accessrequests/emails/confirmation.tpl" , arg_0 = arg_0 , arg_2 = arg_2 , arg_1 = arg_1 , )

Maintain current time during context

    Example:
        >>> with maintained_time():
        ...    cmds.playblast()
        >>> # Time restored


Question: Pretty print the cell representations for sequences in the history .

def Func ( arg_0 , arg_1 = "Column" ) : arg_0 . _mmComputeTransitionTraces ( ) arg_2 = PrettyTable ( [ "Pattern" , "Column" , "predicted=>active cells" ] ) for arg_3 , arg_4 in ( arg_0 . _mmData [ "predictedActiveCellsForSequence" ] . iteritems ( ) ) : arg_5 = arg_0 . mapCellsToColumns ( arg_4 ) for arg_6 , arg_7 in arg_5 . iteritems ( ) : arg_2 . add_row ( [ arg_3 , arg_6 , list ( arg_7 ) ] ) return arg_2 . get_string ( arg_1 = arg_1 ) . encode ( "utf-8" )


Question: A convenience method

def Func ( arg_0 , arg_1 ) : from indic_transliteration import sanscript return sanscript . transliterate ( arg_1 = arg_1 , _from = sanscript . DEVANAGARI , _to = arg_0 . name )

Fetch the events pages of a given group.


Question: Map a 1D array the same dimension as the grid to its original masked 2D array .

def Func ( arg_0 , arg_1 ) : return mapping_util . map_masked_1d_array_to_2d_array_from_array_1d_shape_and_one_to_two ( arg_1 = arg_1 , shape = arg_0 . mask . shape , one_to_two = arg_0 . mask . masked_grid_index_to_pixel )


Question: Wrap code into a begin and end call on this monitor

def Func ( arg_0 , arg_1 : arg_2 , arg_3 = None , arg_4 = None ) : arg_0 . begin ( arg_1 , arg_3 , arg_4 ) try : yield arg_0 finally : arg_0 . done ( )

Renders a javascript snippet suitable for use as a mapbox-gl heatmap paint entry

        Returns:
            A dict that can be converted to a mapbox-gl javascript paint snippet


Question: Removes errored ranges

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 , arg_5 in arg_1 : if isinstance ( arg_4 , int ) or isinstance ( arg_5 , int ) : if isinstance ( arg_4 , int ) and not ( 0 <= arg_4 < arg_2 ) : continue elif isinstance ( arg_4 , int ) and isinstance ( arg_5 , int ) and not ( arg_4 <= arg_5 ) : continue elif arg_4 is None and arg_5 == 0 : continue arg_3 . append ( ( arg_4 , arg_5 ) ) return arg_3

Helper function to get scheduler location with
    a callback. The future watch is placed
    only if isWatching is True.


Question: Convenience method to wait for creation of some UI element .

def Func ( arg_0 , arg_1 = 10 , arg_2 = 'AXCreated' ) : arg_3 = AXCallbacks . returnElemCallback arg_4 = None arg_5 = ( arg_4 , ) return arg_0 . waitFor ( arg_1 , arg_2 , arg_3 = arg_3 , arg_5 = arg_5 )

Main executor of the trimmomatic_report template.

    Parameters
    ----------
    log_files : list
        List of paths to the trimmomatic log files.


Question: The likelihood that the context is a member .

def Func ( arg_0 ) : if arg_0 : arg_1 = arg_0 . xpath ( './/*[local-name()="explicitMember"]/text()' ) . extract ( ) arg_2 = str ( arg_1 ) . lower ( ) if len ( arg_1 ) > 1 : return 2 elif 'country' in arg_2 : return 2 elif 'member' not in arg_2 : return 0 elif 'successor' in arg_2 : return 1 elif 'parent' in arg_2 : return 2 return 3

Parse or download mnist data if train_dir is empty.

    :param: train_dir: The directory storing the mnist data

    :param: data_type: Reading training set or testing set.It can be either "train" or "test"

    :return:

    ```
    (ndarray, ndarray) representing (features, labels)
    features is a 4D unit8 numpy array [index, y, x, depth] representing each pixel valued from 0 to 255.
    labels is 1D unit8 nunpy array representing the label valued from 0 to 9.
    ```


Question: Find all elements on the page matching the given selector and options .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = SelectorQuery ( * arg_1 , ** arg_2 ) @ arg_0 . synchronize ( wait = arg_3 . wait ) def Func ( ) : arg_4 = arg_3 . resolve_for ( arg_0 ) if not arg_4 . matches_count : raise ExpectationNotMet ( arg_4 . failure_message ) return arg_4 return Func ( )

Return client credentials based on the current request.

        According to the rfc6749, client MAY use the HTTP Basic authentication
        scheme as defined in [RFC2617] to authenticate with the authorization
        server. The client identifier is encoded using the
        "application/x-www-form-urlencoded" encoding algorithm per Appendix B,
        and the encoded value is used as the username; the client password is
        encoded using the same algorithm and used as the password. The
        authorization server MUST support the HTTP Basic authentication scheme
        for authenticating clients that were issued a client password.
        See `Section 2.3.1`_.

        .. _`Section 2.3.1`: https://tools.ietf.org/html/rfc6749#section-2.3.1


Question: Parse 10 - Q or 10 - K XML report .

def Func ( arg_0 , arg_1 ) : arg_2 = ReportItemLoader ( arg_1 = arg_1 ) arg_3 = arg_2 . load_item ( ) if 'doc_type' in arg_3 : arg_4 = arg_3 [ 'doc_type' ] if arg_4 in ( '10-Q' , '10-K' ) : return arg_3 return None


Question: Mark a case as checked from an analysis point of view .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = False ) : LOG . info ( "Updating checked status of {}" . format ( arg_2 [ 'display_name' ] ) ) arg_6 = 'not checked' if arg_5 else 'checked' arg_0 . create_event ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , category = 'case' , verb = 'check_case' , subject = arg_6 ) LOG . info ( "Updating {0}'s checked status {1}" . format ( arg_2 [ 'display_name' ] , arg_6 ) ) arg_7 = False if arg_5 else True arg_8 = arg_0 . case_collection . find_one_and_update ( { '_id' : arg_2 [ '_id' ] } , { '$set' : { 'analysis_checked' : arg_7 } } , return_document = pymongo . ReturnDocument . AFTER ) LOG . debug ( "Case updated" ) return arg_8

Remove the MUC specific stanza payload element.


Question: Build per minute stats for each key

def Func ( arg_0 , arg_1 ) : arg_2 = { } Func = { } for arg_4 in arg_1 : arg_5 = arg_4 [ 'key' ] if arg_5 not in arg_2 : arg_2 [ arg_5 ] = [ ] Func [ arg_5 ] = { } arg_2 [ arg_5 ] . append ( arg_4 [ 'total_time' ] ) arg_0 . _traces . pop ( arg_4 [ 'id' ] ) for arg_5 in arg_2 : arg_6 = arg_2 [ arg_5 ] Func [ arg_5 ] = dict ( count = len ( arg_6 ) , max = max ( arg_6 ) , min = min ( arg_6 ) , avg = sum ( arg_6 ) / len ( arg_6 ) ) return Func

Initialize the dictionary of architectures for disassembling via capstone


Question: Template decorator .

def Func ( arg_0 = None ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def decorated_function ( * arg_2 , ** arg_3 ) : arg_4 = arg_0 if arg_4 is None : arg_4 = request . endpoint . replace ( '.' , '/' ) + '.html' arg_5 = arg_1 ( * arg_2 , ** arg_3 ) if arg_5 is None : arg_5 = { } elif not isinstance ( arg_5 , dict ) : return arg_5 return render_template ( arg_4 , ** arg_5 ) return decorated_function return decorator


Question: Update throttle scope so that service user throttle rates are applied .

def Func ( arg_0 ) : arg_0 . scope = SERVICE_USER_SCOPE arg_0 . rate = arg_0 . get_rate ( ) arg_0 . num_requests , arg_0 . duration = arg_0 . parse_rate ( arg_0 . rate )

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


Question: This function adjusts the start and end angles to correct for duplicated axes .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_0 . find_node_group_membership ( arg_1 ) arg_6 = arg_0 . find_node_group_membership ( arg_3 ) if arg_5 == 0 and arg_6 == len ( arg_0 . nodes . keys ( ) ) - 1 : if arg_0 . has_edge_within_group ( arg_5 ) : arg_2 = correct_negative_angle ( arg_2 - arg_0 . minor_angle ) if arg_0 . has_edge_within_group ( arg_6 ) : arg_4 = correct_negative_angle ( arg_4 + arg_0 . minor_angle ) elif arg_5 == len ( arg_0 . nodes . keys ( ) ) - 1 and arg_6 == 0 : if arg_0 . has_edge_within_group ( arg_5 ) : arg_2 = correct_negative_angle ( arg_2 + arg_0 . minor_angle ) if arg_0 . has_edge_within_group ( arg_6 ) : arg_4 = correct_negative_angle ( arg_4 - arg_0 . minor_angle ) elif arg_5 < arg_6 : if arg_0 . has_edge_within_group ( arg_6 ) : arg_4 = correct_negative_angle ( arg_4 - arg_0 . minor_angle ) if arg_0 . has_edge_within_group ( arg_5 ) : arg_2 = correct_negative_angle ( arg_2 + arg_0 . minor_angle ) elif arg_6 < arg_5 : if arg_0 . has_edge_within_group ( arg_5 ) : arg_2 = correct_negative_angle ( arg_2 - arg_0 . minor_angle ) if arg_0 . has_edge_within_group ( arg_6 ) : arg_4 = correct_negative_angle ( arg_4 + arg_0 . minor_angle ) return arg_2 , arg_4


Question: Copy sys . modules onto my mod stack

def Func ( arg_0 ) : arg_1 = sys . modules . copy ( ) arg_0 . _mod_stack . append ( arg_1 )


Question: Restore content in target file to be before any changes

def Func ( arg_0 ) : if arg_0 . _original_target_content : with open ( arg_0 . target , 'w' ) as fp : fp . write ( arg_0 . _original_target_content )


Question: Updates the camera vectors based on the current yaw and pitch

def Func ( arg_0 ) : arg_1 = Vector3 ( [ 0.0 , 0.0 , 0.0 ] ) arg_1 . x = cos ( radians ( arg_0 . yaw ) ) * cos ( radians ( arg_0 . pitch ) ) arg_1 . y = sin ( radians ( arg_0 . pitch ) ) arg_1 . z = sin ( radians ( arg_0 . yaw ) ) * cos ( radians ( arg_0 . pitch ) ) arg_0 . dir = vector . normalise ( arg_1 ) arg_0 . right = vector . normalise ( vector3 . cross ( arg_0 . dir , arg_0 . _up ) ) arg_0 . up = vector . normalise ( vector3 . cross ( arg_0 . right , arg_0 . dir ) )

Match a literal sequence.

    In the `TextParsers`` context, this matches the literal string
    provided. In the ``GeneralParsers`` context, this matches a sequence of
    input.

    If multiple literals are provided, they are treated as alternatives. e.g.
    ``lit('+', '-')`` is the same as ``lit('+') | lit('-')``.

    Args:
        literal: A literal to match
        *literals: Alternative literals to match

    Returns:
        A ``LiteralParser`` in the ``GeneralContext``, a ``LiteralStringParser``
        in the ``TextParsers`` context, and an ``AlternativeParser`` if multiple
        arguments are provided.


Question: returns a kba . pipeline transform function that generates file type stats from the stream_items that it sees . Currently these stats are just the first five non - whitespace characters .

def Func ( arg_0 ) : def _Func ( arg_1 , arg_2 ) : if arg_1 . body and arg_1 . body . raw : if 'doctype html' in arg_1 . body . raw [ : 250 ] . lower ( ) : print 'DOCTYPE: html' else : if has_tags ( arg_1 . body . raw [ : 400 ] ) : print 'PROBABLY_HTML' else : arg_3 = xml_ish . search ( arg_1 . body . raw ) if arg_3 : print 'XML: %s' % repr ( arg_3 . group ( 'intro' ) ) else : arg_4 = pdf_start . search ( arg_1 . body . raw ) if arg_4 : print 'PDF %s' % repr ( arg_4 . group ( 'version' ) ) else : arg_5 = arg_1 . abs_url . split ( '.' ) [ - 1 ] if len ( arg_5 ) < 6 : print 'UNK ext: %s' % repr ( arg_5 ) else : arg_6 = first_letters . match ( arg_1 . body . raw ) if arg_6 and False : print 'UNK letters: %s' % repr ( arg_6 . group ( 'first_letters' ) ) else : print 'UNK first bytes: %s' % repr ( arg_1 . body . raw [ : 50 ] ) return arg_1 return _Func

Get or set `Settings._wrapped`

    :param str path: a python module file,
        if user set it,write config to `Settings._wrapped`
    :param str with_path: search path
    :return: A instance of `Settings`