Question: A helper function to look up license object information

def Func ( arg_0 ) : arg_1 = None if arg_0 in ( 'MIT' , 'MIT License' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/mit' , 'name' : 'MIT' } elif arg_0 in ( 'BSD 2-clause "Simplified" License' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/bsd-2-clause' , 'name' : 'BSD-2-Clause' } elif arg_0 in ( 'BSD 3-clause "New" or "Revised" License' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/bsd-3-clause' , 'name' : 'BSD-3-Clause' } elif arg_0 in ( 'Apache License 2.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/apache-2.0' , 'name' : 'Apache-2.0' } elif arg_0 in ( 'GNU General Public License v2.1' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/gpl-2.1' , 'name' : 'GPL-2.1' } elif arg_0 in ( 'GNU General Public License v2.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/gpl-2.0' , 'name' : 'GPL-2.0' } elif arg_0 in ( 'GNU Lesser General Public License v2.1' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/lgpl-2.1' , 'name' : 'LGPL-2.1' } elif arg_0 in ( 'GNU General Public License v3.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/gpl-3.0' , 'name' : 'GPL-3.0' } elif arg_0 in ( 'GNU Lesser General Public License v3.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/lgpl-3.0' , 'name' : 'LGPL-3.0' } elif arg_0 in ( 'Eclipse Public License 1.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/epl-1.0' , 'name' : 'EPL-1.0' , } elif arg_0 in ( 'Mozilla Public License 2.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/mpl-2.0' , 'name' : 'MPL-2.0' , } elif arg_0 in ( 'The Unlicense' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/unlicense' , 'name' : 'Unlicense' , } elif arg_0 in ( 'GNU Affero General Public License v3.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/agpl-3.0' , 'name' : 'AGPL-3.0' , } elif arg_0 in ( 'Eclipse Public License 2.0' ) : arg_1 = { 'URL' : 'https://api.github.com/licenses/epl-2.0' , 'name' : 'EPL-2.0' , } if arg_1 is None : logger . warn ( 'I dont understand the license: %s' , arg_0 ) raise ValueError ( 'Aborting!' ) return arg_1


Question: Sets the package verification code if not already set . code - A string . Raises CardinalityError if already defined . Raises OrderError if no package previously defined .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_verif_set : arg_0 . package_verif_set = True arg_1 . package . verif_code = arg_2 else : raise CardinalityError ( 'Package::VerificationCode' )


Question: Calculate the Reynolds number .

def Func ( arg_0 : arg_1 , arg_2 : arg_1 , arg_3 : arg_1 ) -> arg_1 : return arg_2 * arg_0 / arg_3

Extracts the category from a GitHub item.

        This backend generates two types of item which are
        'issue' and 'pull_request'.


Question: Derive new Raster instances .

def Func ( arg_0 , arg_1 = ( ) , arg_2 = None ) : arg_1 = arg_1 or arg_0 . size + ( len ( arg_0 ) , ) arg_3 = arg_0 . ds . GetRasterBand ( 1 ) arg_4 = ImageDriver ( 'MEM' ) arg_5 = arg_4 . raster ( arg_4 . ShortName , arg_1 , arg_3 . DataType ) arg_5 . sref = arg_0 . GetProjection ( ) arg_5 . affine = arg_2 or tuple ( arg_0 . affine ) arg_7 = arg_3 . GetColorTable ( ) for arg_8 in arg_5 : if arg_0 . nodata is not None : arg_8 . SetNoDataValue ( arg_0 . nodata ) if arg_7 : arg_8 . SetColorTable ( arg_7 ) return arg_5

Init openstack neutron mq

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

        :param mq: class ternya.mq.MQ


Question: converts top results from mash screen txt output to json format

def Func ( arg_0 , arg_1 ) : logger . info ( "Reading file : {}" . format ( arg_0 ) ) arg_2 = open ( arg_0 ) arg_3 = { } arg_4 = [ ] arg_5 = { } logger . info ( "Generating dictionary and list to pre-process the final json" ) for arg_6 in arg_2 : arg_7 = arg_6 . split ( "\t" ) arg_8 = arg_7 [ 0 ] arg_9 = arg_7 [ 2 ] arg_10 = arg_7 [ 4 ] arg_3 [ arg_10 ] = [ arg_8 , arg_9 ] arg_4 . append ( float ( arg_9 ) ) arg_11 = open ( " " . join ( arg_0 . split ( "." ) [ : - 1 ] ) + ".json" , "w" ) if len ( arg_4 ) > 0 : arg_12 = median ( arg_4 ) logger . info ( "Generating final json to dump to a file" ) for arg_13 , arg_14 in arg_3 . items ( ) : arg_15 = int ( float ( arg_14 [ 1 ] ) / arg_12 ) if float ( arg_14 [ 1 ] ) > arg_12 : arg_5 [ "_" . join ( arg_13 . split ( "_" ) [ 0 : 3 ] ) ] = [ round ( float ( arg_14 [ 0 ] ) , 2 ) , arg_15 ] logger . info ( "Exported dictionary has {} entries" . format ( len ( arg_5 ) ) ) else : logger . error ( "No matches were found using mash screen for the queried reads" ) arg_11 . write ( json . dumps ( arg_5 ) ) arg_11 . close ( ) arg_18 = { "tableRow" : [ { "sample" : arg_1 , "data" : [ { "header" : "Mash Screen" , "table" : "plasmids" , "patlas_mashscreen" : arg_5 , "value" : len ( arg_5 ) } ] } ] , } with open ( ".report.json" , "w" ) as json_report : json_report . write ( json . dumps ( arg_18 , separators = ( "," , ":" ) ) )

Log 'msg % args' at level 'level' once per 'n' times.

    Logs the 1st call, (N+1)st call, (2N+1)st call,  etc.
    Not threadsafe.

    Args:
    level: The level at which to log.
    msg: The message to be logged.
    n: The number of times this should be called before it is logged.
    *args: The args to be substituted into the msg.


Question: Retrieve original value and check it wasn t signed more than max_age seconds ago .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 , arg_4 = struct . calcsize ( '>cQ' ) , arg_0 . digest . digest_size arg_5 = '>cQ%ds%ds' % ( len ( arg_1 ) - arg_3 - arg_4 , arg_4 ) try : arg_6 , arg_7 , arg_8 , arg_9 = struct . unpack ( arg_5 , arg_1 ) except struct . error : raise BadSignature ( 'Signature is not valid' ) if arg_6 != arg_0 . version : raise BadSignature ( 'Signature version not supported' ) if arg_2 is not None : if isinstance ( arg_2 , datetime . timedelta ) : arg_2 = arg_2 . total_seconds ( ) arg_10 = abs ( time . time ( ) - arg_7 ) if arg_10 > arg_2 + _MAX_CLOCK_SKEW : raise SignatureExpired ( 'Signature age %s > %s seconds' % ( arg_10 , arg_2 ) ) try : arg_0 . signature ( arg_1 [ : - arg_4 ] ) . verify ( arg_9 ) except InvalidSignature : raise BadSignature ( 'Signature "%s" does not match' % binascii . b2a_base64 ( arg_9 ) ) return arg_8

Sends a new message event to an Event Hub.


Question: Sets a version to be the default . Blocks until finished .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = 'projects/{}/models/{}/versions/{}' . format ( arg_1 , arg_2 , arg_3 ) arg_5 = arg_0 . _mlengine . projects ( ) . models ( ) . versions ( ) . setDefault ( name = arg_4 , body = { } ) try : arg_6 = arg_5 . execute ( ) arg_0 . log . info ( 'Successfully set version: %s to default' , arg_6 ) return arg_6 except HttpError as e : arg_0 . log . error ( 'Something went wrong: %s' , e ) raise

Set the rotation of this body using a rotation matrix.

        Parameters
        ----------
        rotation : sequence of 9 floats
            The desired rotation matrix for this body.


Question: Use a closure so that draw attributes can be saved

def Func ( arg_0 ) : arg_1 = arg_0 . fill arg_2 = arg_0 . stroke arg_3 = arg_0 . strokewidth def _render ( arg_4 ) : arg_5 = arg_0 . _call_transform_mode ( arg_0 . _transform ) if arg_1 is None and arg_2 is None : return arg_4 . set_matrix ( arg_5 ) arg_0 . _traverse ( arg_4 ) arg_4 . set_matrix ( cairo . Matrix ( ) ) if arg_1 is not None and arg_2 is not None : if arg_2 [ 3 ] < 1 : arg_4 . push_group ( ) arg_4 . set_source_rgba ( * arg_1 ) arg_4 . fill_preserve ( ) arg_6 = arg_4 . stroke_extents ( ) arg_4 . set_source_rgba ( * arg_2 ) arg_4 . set_operator ( cairo . OPERATOR_SOURCE ) arg_4 . set_line_width ( arg_3 ) arg_4 . stroke ( ) arg_4 . pop_group_to_source ( ) arg_4 . paint ( ) else : arg_4 . set_source_rgba ( * arg_1 ) arg_4 . fill_preserve ( ) arg_4 . set_source_rgba ( * arg_2 ) arg_4 . set_line_width ( arg_3 ) arg_4 . stroke ( ) elif arg_1 is not None : arg_4 . set_source_rgba ( * arg_1 ) arg_4 . fill ( ) elif arg_2 is not None : arg_4 . set_source_rgba ( * arg_2 ) arg_4 . set_line_width ( arg_3 ) arg_4 . stroke ( ) return _render

returns complement of sequence including ambiguity characters,
    and saves lower case info for multiple hetero sequences


Question: Loads a particular item from disk .

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_5 = True try : arg_5 = arg_0 . _srvc_opening_routine ( 'r' , arg_4 = arg_4 ) if arg_1 == pypetconstants . TRAJECTORY : arg_0 . _trj_Func_trajectory ( arg_2 , * arg_3 , ** arg_4 ) elif arg_1 == pypetconstants . LEAF : arg_0 . _prm_Func_parameter_or_result ( arg_2 , * arg_3 , ** arg_4 ) elif arg_1 == pypetconstants . GROUP : arg_0 . _grp_Func_group ( arg_2 , * arg_3 , ** arg_4 ) elif arg_1 == pypetconstants . TREE : arg_0 . _tree_Func_sub_branch ( arg_2 , * arg_3 , ** arg_4 ) elif arg_1 == pypetconstants . LIST : arg_0 . _srvc_Func_several_items ( arg_2 , * arg_3 , ** arg_4 ) else : raise pex . NoSuchServiceError ( 'I do not know how to handle `%s`' % arg_1 ) except pt . NoSuchNodeError as exc : arg_0 . _logger . error ( 'Failed Funcing  `%s`' % str ( arg_2 ) ) raise pex . DataNotInStorageError ( repr ( exc ) ) except : arg_0 . _logger . error ( 'Failed Funcing  `%s`' % str ( arg_2 ) ) raise finally : arg_0 . _srvc_closing_routine ( arg_5 )

Convert a 2D array of items into a Markdown table.

    padding: the number of padding spaces on either side of each divider
    divider: the vertical divider to place between columns
    header_div: the horizontal divider to place between the header row and
        body cells


Question: Get the value of a keyword argument specified on the command line .

def Func ( arg_0 , arg_1 = arg_2 . NoParam , arg_4 = None ) : if arg_4 is None : arg_4 = sys . argv arg_5 = [ arg_0 ] if isinstance ( arg_0 , six . string_types ) else arg_0 arg_6 = len ( arg_4 ) - 1 for arg_7 , arg_8 in enumerate ( arg_4 ) : for arg_9 in arg_5 : if arg_8 == arg_9 : if arg_7 < arg_6 : arg_10 = arg_4 [ arg_7 + 1 ] return arg_10 elif arg_8 . startswith ( arg_9 + '=' ) : arg_10 = '=' . join ( arg_8 . split ( '=' ) [ 1 : ] ) return arg_10 arg_10 = arg_1 return arg_10

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Parse strings as returned from the Windows registry into the time zone name as defined in the registry .

def Func ( arg_0 , arg_1 ) : if not arg_1 . startswith ( '@' ) : return arg_1 arg_2 = arg_1 . split ( ',-' ) try : arg_3 = int ( arg_2 [ 1 ] ) except : raise ValueError ( "Malformed timezone string." ) return arg_0 . load_name ( arg_3 )

Drop a node from the network

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


Question: Convert convert_adaptive_max_pool2d layer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : print ( 'Converting adaptive_avg_pool2d...' ) if arg_6 == 'short' : arg_7 = 'APOL' + random_string ( 4 ) elif arg_6 == 'keep' : arg_7 = arg_1 else : arg_7 = arg_1 + str ( random . random ( ) ) arg_8 = keras . layers . GlobalMaxPooling2D ( data_format = 'channels_first' , name = arg_7 ) arg_4 [ arg_2 ] = arg_8 ( arg_4 [ arg_3 [ 0 ] ] ) def target_layer ( arg_9 ) : import keras return keras . backend . expand_dims ( arg_9 ) arg_10 = keras . layers . Lambda ( target_layer , name = arg_7 + 'E' ) arg_4 [ arg_2 ] = arg_10 ( arg_4 [ arg_2 ] ) arg_4 [ arg_2 ] = arg_10 ( arg_4 [ arg_2 ] )

Find the necessary file for the given test case.

    Args:
        device(napalm device connection): for which device
        filename(str): file to find
        path(str): where to find it relative to where the module is installed


Question: Prints information about the current user . Assumes the user is already logged - in .

def Func ( * arg_0 , ** arg_1 ) : arg_2 = client . Func ( ) if arg_2 : print_user ( arg_2 ) else : print ( 'You are not logged-in.' )


Question: Estimate variance using samples .

def Func ( arg_0 , arg_1 = 0 , arg_2 = False , arg_3 = None ) : with tf . compat . v1 . name_scope ( arg_3 , 'Func' , values = [ arg_0 , arg_1 ] ) : return coFunc ( arg_0 , y = None , arg_1 = arg_1 , event_axis = None , arg_2 = arg_2 )

Reassemble a Binder object coming out of the database.


Question: Parse the fsapi endpoint from the device url .

def Func ( arg_0 ) : arg_1 = yield from arg_0 . __session . get ( arg_0 . fsapi_device_url , timeout = arg_0 . timeout ) arg_2 = yield from arg_1 . text ( encoding = 'utf-8' ) arg_3 = objectify . fromstring ( arg_2 ) return arg_3 . webfsapi . text

Simple and fast implementation of the covariance AR estimate

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

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

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

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

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

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

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

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

    :References: Mathworks


Question: Embeds checks that categorical distributions don t have too many classes .

def Func ( arg_0 , arg_1 = "Func" ) : with tf . name_scope ( arg_1 ) : arg_2 = tf . convert_to_tensor ( value = arg_0 , arg_1 = "categorical_param" ) arg_3 = dtype_util . base_dtype ( arg_2 . dtype ) arg_4 = ( _largest_integer_by_dtype ( arg_3 ) if dtype_util . is_floating ( arg_3 ) else 0 ) if arg_4 is 0 : raise TypeError ( "Unable to validate size of unrecognized dtype " "({})." . format ( dtype_util . name ( arg_3 ) ) ) try : arg_5 = tensorshape_util . with_rank_at_least ( arg_2 . shape , 1 ) except ValueError : raise ValueError ( "A categorical-distribution parameter must have " "at least 1 dimension." ) arg_6 = tf . compat . dimension_value ( arg_5 [ - 1 ] ) if arg_6 is not None : if arg_6 < 2 : raise ValueError ( "A categorical-distribution parameter must have at " "least 2 events." ) if arg_6 > arg_4 : raise ValueError ( "Number of classes exceeds `dtype` precision, i.e., " "{} implies shape ({}) cannot exceed {}." . format ( dtype_util . name ( arg_3 ) , arg_6 , arg_4 ) ) return arg_2 else : arg_6 = tf . shape ( input = arg_2 , out_type = tf . int64 , arg_1 = "x_shape" ) [ - 1 ] return with_dependencies ( [ assert_util . assert_rank_at_least ( arg_2 , 1 , message = ( "A categorical-distribution parameter must have " "at least 1 dimension." ) ) , assert_util . assert_greater_equal ( tf . shape ( input = arg_2 ) [ - 1 ] , 2 , message = ( "A categorical-distribution parameter must have at " "least 2 events." ) ) , assert_util . assert_less_equal ( arg_6 , tf . convert_to_tensor ( arg_4 , dtype = tf . int64 ) , message = "Number of classes exceeds `dtype` precision, " "i.e., {} dtype cannot exceed {} shape." . format ( dtype_util . name ( arg_3 ) , arg_4 ) ) , ] , arg_2 )

Sends a new data frame.

        This method will block until a new room is available for
        a new sender. This limit is determined by the size of the window.


Question: Method that constructs a full url with the given url and the snapshot name .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_1 . endswith ( arg_0 . URL_SEPERATOR ) : arg_1 = arg_1 + arg_0 . URL_SEPERATOR if arg_2 is None : arg_2 = '' return '%s%s%s' % ( urlparse . urljoin ( arg_0 . dsn , arg_1 ) , arg_2 , arg_0 . NAME_EXTENSION )

Jumps short if not greater.

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


Question: Process a brotli stream .

def Func ( arg_0 ) : print ( 'addr  hex{:{}s}binary context explanation' . format ( '' , arg_0 . width - 10 ) ) print ( 'Stream header' . center ( 60 , '-' ) ) arg_0 . windowSize = arg_0 . verboseRead ( WindowSizeAlphabet ( ) ) print ( 'Metablock header' . center ( 60 , '=' ) ) arg_0 . ISLAST = False arg_0 . output = bytearray ( ) while not arg_0 . ISLAST : arg_0 . ISLAST = arg_0 . verboseRead ( BoolCode ( 'LAST' , description = "Last block" ) ) if arg_0 . ISLAST : if arg_0 . verboseRead ( BoolCode ( 'EMPTY' , description = "Empty block" ) ) : break if arg_0 . metablockLength ( ) : continue if not arg_0 . ISLAST and arg_0 . uncompressed ( ) : continue print ( 'Block type descriptors' . center ( 60 , '-' ) ) arg_0 . numberOfBlockTypes = { } arg_0 . currentBlockCounts = { } arg_0 . blockTypeCodes = { } arg_0 . blockCountCodes = { } for arg_8 in ( L , I , D ) : arg_0 . blockType ( arg_8 ) print ( 'Distance code parameters' . center ( 60 , '-' ) ) arg_0 . NPOSTFIX , arg_0 . NDIRECT = arg_0 . verboseRead ( DistanceParamAlphabet ( ) ) arg_0 . readLiteralContextModes ( ) print ( 'Context maps' . center ( 60 , '-' ) ) arg_0 . cmaps = { } arg_12 = { I : arg_0 . numberOfBlockTypes [ I ] } for arg_8 in ( L , D ) : arg_12 [ arg_8 ] = arg_0 . contextMap ( arg_8 ) print ( 'Prefix code lists' . center ( 60 , '-' ) ) arg_0 . prefixCodes = { } for arg_8 in ( L , I , D ) : arg_0 . readPrefixArray ( arg_8 , arg_12 [ arg_8 ] ) arg_0 . metablock ( )

Turn a mongodb-style search dict into an SQL query.


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

def Func ( arg_0 ) : if os . path . exists ( arg_0 . managed_path ) : logging . debug ( 'Repo {} already exists' . format ( arg_0 . remote_path ) ) return logging . info ( 'Initiating clone of local repo {}' . format ( arg_0 . remote_path ) ) arg_1 = parent_dir ( arg_0 . managed_path ) if not os . path . exists ( arg_1 ) : os . makedirs ( arg_1 ) with git_error_handling ( ) : git . Repo . clone_from ( arg_0 . assemble_remote_path ( ) , arg_0 . managed_path )

Pretty-print the encoded output using ascii art.

    :param output: to print
    :param prefix: printed before the header if specified


Question: Given model params figure out the correct parameters for the RandomDistributed encoder . Modifies params in place .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ( arg_0 [ "modelConfig" ] [ "modelParams" ] [ "sensorParams" ] [ "encoders" ] ) for arg_5 in arg_4 . itervalues ( ) : if arg_5 is not None : if arg_5 [ "type" ] == "RandomDistributedScalarEncoder" : arg_6 = max ( arg_3 , ( arg_2 - arg_1 ) / arg_5 . pop ( "numBuckets" ) ) arg_4 [ "c1" ] [ "resolution" ] = arg_6

Wait for the event, run the task, trigger the next task.


Question: A callback that should be called when this is done running .

def Func ( arg_0 ) : if arg_0 . _cfg_path and os . path . isfile ( arg_0 . _cfg_path ) : if arg_0 . run_as_user : subprocess . call ( [ 'sudo' , 'rm' , arg_0 . _cfg_path ] , close_fds = True ) else : os . remove ( arg_0 . _cfg_path )

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: Take json as dictionary parameter

def Func ( arg_0 , arg_1 , arg_2 ) : try : return json . loads ( arg_2 ) except : raise optparse . OptionValueError ( "Option %s: invalid dict value: %r" % ( arg_1 , arg_2 ) )

Perform global inhibition. Performing global inhibition entails picking the
    top 'numActive' columns with the highest overlap score in the entire
    region. At most half of the columns in a local neighborhood are allowed to
    be active. Columns with an overlap score below the 'stimulusThreshold' are
    always inhibited.

    :param overlaps: an array containing the overlap score for each  column.
                    The overlap score for a column is defined as the number
                    of synapses in a "connected state" (connected synapses)
                    that are connected to input bits which are turned on.
    :param density: The fraction of columns to survive inhibition.
    @return list with indices of the winning columns


Question: Return trade status .

def Func ( arg_0 , arg_1 ) : arg_2 = 'GET' arg_3 = 'trade/status' if not isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = ( arg_1 , ) arg_1 = ( str ( arg_6 ) for arg_6 in arg_1 ) arg_4 = { 'tradeIds' : ',' . join ( arg_1 ) } arg_5 = arg_0 . __request__ ( arg_2 , arg_3 , arg_4 = arg_4 ) return [ itemParse ( arg_6 , full = False ) for arg_6 in arg_5 [ 'auctionInfo' ] ]

Deletes the specified file from the given S3 bucket.


Question: Include unknown fields after dumping .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_2 : for arg_4 , arg_5 in enumerate ( arg_1 ) : arg_6 = set ( arg_3 [ arg_4 ] . __dict__ ) - set ( arg_1 [ arg_4 ] ) for arg_7 in arg_6 : arg_1 [ arg_4 ] [ arg_7 ] = getattr ( arg_3 [ arg_4 ] , arg_7 ) else : arg_6 = set ( arg_3 . __dict__ ) - set ( arg_1 ) for arg_7 in arg_6 : arg_1 [ arg_7 ] = getattr ( arg_3 , arg_7 ) return arg_1

Remove all binary files in the adslib directory.


Question: Annotation filtering filter

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ annotation for annotation in arg_0 if annotation . type_uri == arg_1 ] arg_2 = min ( [ len ( arg_3 ) , arg_2 ] ) if arg_2 == 0 : return None else : return arg_3 [ arg_2 - 1 ]

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: A helper method to get or create a backend with thread locking .

def Func ( arg_0 ) : arg_0 = os . path . abspath ( arg_0 ) with _backends_lock : if arg_0 not in arg_1 : arg_1 [ arg_0 ] = _MultiprocessStorageBackend ( arg_0 ) return arg_1 [ arg_0 ]

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

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


Question: This version is 10 times faster than arburg but the output rho is not correct .

def Func ( arg_0 , arg_1 ) : arg_2 = np . array ( arg_0 ) arg_3 = len ( arg_2 ) if arg_1 <= 0. : raise ValueError ( "order must be > 0" ) arg_4 = sum ( abs ( arg_2 ) ** 2. ) / arg_3 arg_5 = arg_4 * 2. * arg_3 arg_6 = np . zeros ( arg_3 , dtype = complex ) arg_7 = np . zeros ( arg_3 , dtype = complex ) for arg_8 in range ( 0 , arg_3 ) : arg_6 [ arg_8 ] = arg_2 [ arg_8 ] arg_7 [ arg_8 ] = arg_2 [ arg_8 ] arg_9 = np . zeros ( 1 , dtype = complex ) arg_9 [ 0 ] = 1 arg_10 = np . zeros ( arg_1 , dtype = complex ) arg_11 = 1. arg_12 = np . zeros ( arg_1 + 1 ) arg_12 [ 0 ] = arg_4 for arg_13 in range ( 0 , arg_1 ) : arg_14 = arg_6 [ 1 : ] arg_15 = arg_7 [ 0 : - 1 ] arg_16 = - 2. * np . dot ( arg_15 . conj ( ) . transpose ( ) , arg_14 ) arg_5 = np . dot ( arg_14 . conj ( ) . transpose ( ) , arg_14 ) arg_5 += np . dot ( arg_15 , arg_15 . conj ( ) . transpose ( ) ) arg_10 [ arg_13 ] = arg_16 / arg_5 arg_6 = arg_14 + arg_10 [ arg_13 ] * arg_15 arg_7 = arg_15 + arg_10 [ arg_13 ] . conj ( ) . transpose ( ) * arg_14 arg_9 . resize ( len ( arg_9 ) + 1 ) arg_9 = arg_9 + arg_10 [ arg_13 ] * np . flipud ( arg_9 ) . conjugate ( ) arg_12 [ arg_13 + 1 ] = ( 1 - arg_10 [ arg_13 ] . conj ( ) . transpose ( ) * arg_10 [ arg_13 ] ) * arg_12 [ arg_13 ] return arg_9 , arg_12 [ - 1 ] , arg_10

Converts py_zipkin's annotations dict to protobuf.

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


Question: Retrieves some statistics from a single Trimmomatic log file .

def Func ( arg_0 ) : arg_1 = OrderedDict ( [ ( "clean_len" , 0 ) , ( "total_trim" , 0 ) , ( "total_trim_perc" , 0 ) , ( "5trim" , 0 ) , ( "3trim" , 0 ) , ( "bad_reads" , 0 ) ] ) with open ( arg_0 ) as fh : for arg_2 in fh : arg_3 = [ int ( x ) for x in arg_2 . strip ( ) . split ( ) [ - 4 : ] ] if not arg_3 [ 0 ] : arg_1 [ "bad_reads" ] += 1 arg_1 [ "5trim" ] += arg_3 [ 1 ] arg_1 [ "3trim" ] += arg_3 [ 3 ] arg_1 [ "total_trim" ] += arg_3 [ 1 ] + arg_3 [ 3 ] arg_1 [ "clean_len" ] += arg_3 [ 0 ] arg_4 = arg_1 [ "clean_len" ] + arg_1 [ "total_trim" ] if arg_4 : arg_1 [ "total_trim_perc" ] = round ( ( arg_1 [ "total_trim" ] / arg_4 ) * 100 , 2 ) else : arg_1 [ "total_trim_perc" ] = 0 return arg_1

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

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


Question: Parses ssh options string .

def Func ( arg_0 , arg_1 ) : arg_2 = False arg_3 = { } def parse_add_single_option ( arg_4 ) : if "=" in arg_4 : arg_5 , arg_6 = arg_4 . split ( "=" , 1 ) arg_6 = arg_6 . replace ( '"' , '' ) else : arg_5 = arg_4 arg_6 = True if " " in arg_5 or not arg_0 . OPTION_NAME_RE . match ( arg_5 ) : raise InvalidOptionNameError ( "%s is not valid option name." % arg_5 ) if arg_0 . strict_mode : for arg_7 , arg_8 in arg_0 . OPTIONS_SPEC : if arg_5 . lower ( ) == arg_7 : if arg_8 and arg_6 is True : raise MissingMandatoryOptionValueError ( "%s is missing mandatory value." % arg_5 ) break else : raise UnknownOptionNameError ( "%s is unrecognized option name." % arg_5 ) if arg_5 not in arg_3 : arg_3 [ arg_5 ] = [ ] arg_3 [ arg_5 ] . append ( arg_6 ) arg_9 = 0 arg_10 = 1 for arg_10 , arg_11 in enumerate ( arg_1 ) : if arg_11 == '"' : arg_2 = not arg_2 if arg_2 : continue if arg_11 == "," : arg_4 = arg_1 [ arg_9 : arg_10 ] parse_add_single_option ( arg_4 ) arg_9 = arg_10 + 1 if arg_9 + 1 != arg_10 : arg_4 = arg_1 [ arg_9 : ] parse_add_single_option ( arg_4 ) if arg_2 : raise InvalidOptionsError ( "Unbalanced quotes." ) return arg_3

Unregister an extension code.  For testing only.


Question: Retrieve pandas object or group of Numpy ndarrays stored in file

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . Func_node ( arg_1 ) if arg_2 is None : raise KeyError ( 'No object named %s in the file' % arg_1 ) if hasattr ( arg_2 , 'attrs' ) : if 'pandas_type' in arg_2 . attrs : return arg_0 . _read_group ( arg_2 ) return arg_0 . _read_array ( arg_2 )

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


Question: Send a request . Use the request information to see if it exists in the cache and cache the response if we need to and can .

def Func ( arg_0 , arg_1 , ** arg_2 ) : if arg_1 . method == 'GET' : arg_3 = arg_0 . controller . cached_request ( arg_1 ) if arg_3 : return arg_0 . build_response ( arg_1 , arg_3 , from_cache = True ) arg_1 . headers . update ( arg_0 . controller . conditional_headers ( arg_1 ) ) arg_4 = super ( CacheControlAdapter , arg_0 ) . Func ( arg_1 , ** arg_2 ) return arg_4


Question: Applies quadratic volumeshare slippage model to daily returns based on the proportion of the observed historical daily bar dollar volume consumed by the strategy s trades . Scales the size of trades based on the ratio of the starting capital we wish to test to the starting capital of the passed backtest data .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0.1 ) : arg_5 = arg_2 / arg_3 arg_6 = abs ( arg_5 * arg_1 . amount ) arg_7 = arg_1 . price * arg_6 arg_8 = arg_6 / arg_1 . volume arg_9 = arg_8 ** 2 * arg_4 * arg_7 arg_10 = arg_9 . resample ( 'D' ) . sum ( ) arg_10 = arg_10 . reindex ( arg_0 . index ) . fillna ( 0 ) arg_11 = ep . cum_returns ( arg_0 , starting_value = arg_3 ) * arg_5 arg_12 = arg_0 - ( arg_10 / arg_11 ) return arg_12

Attach an observer.

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

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


Question: Create ContentMetadataItemTransmision models for the given content metadata items .

def Func ( arg_0 , arg_1 ) : arg_2 = apps . get_model ( 'integrated_channel' , 'ContentMetadataItemTransmission' ) arg_3 = [ ] for arg_4 , arg_5 in arg_1 . items ( ) : arg_3 . append ( arg_2 ( enterprise_customer = arg_0 . enterprise_configuration . enterprise_customer , integrated_channel_code = arg_0 . enterprise_configuration . channel_code ( ) , arg_4 = arg_4 , arg_5 = arg_5 ) ) arg_2 . objects . bulk_create ( arg_3 )

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: Say the workers to finish their jobs and quit .

def Func ( arg_0 ) : arg_0 . quit . set ( ) while sorted ( [ arg_0 . pool [ arg_1 ] . is_alive ( ) for arg_1 in xrange ( len ( arg_0 . pool ) ) ] ) [ - 1 ] : time . sleep ( 1 ) try : while not arg_0 . task_queue . empty ( ) : arg_0 . task_queue . get ( timeout = 0.1 ) arg_0 . task_queue . close ( ) arg_0 . feeder . join ( ) except Exception as ex : logger . info ( ex )

Collects memory stats for specified Python program.


Question: async function to reboot QTM cameras

async def Func ( arg_0 ) : arg_1 , arg_2 = await asyncio . get_event_loop ( ) . create_datagram_endpoint ( QRebootProtocol , local_addr = ( arg_0 , 0 ) , allow_broadcast = True , reuse_address = True , ) LOG . info ( "Sending Func on %s" , arg_0 ) arg_2 . send_Func ( )

To be subclassed if alternate methods of loading data.


Question: Plot relative parallax errors as a function of distance for stars of a given spectral type .

def Func ( arg_0 = False , arg_1 = False ) : arg_2 = np . linspace ( - 1 , np . log10 ( 20.0 ) , 100 ) arg_3 = OrderedDict ( [ ( 'K0V' , ( 5.58 , 0.87 ) ) , ( 'G5V' , ( 4.78 , 0.74 ) ) , ( 'G0V' , ( 4.24 , 0.67 ) ) , ( 'F5V' , ( 3.50 , 0.50 ) ) , ( 'F0V' , ( 2.98 , 0.38 ) ) , ( 'RC' , ( 0.8 , 1.0 ) ) ] ) arg_4 = { } arg_5 = plt . figure ( figsize = ( 10 , 6.5 ) ) arg_6 = plt . gca ( ) for arg_7 in arg_3 . keys ( ) : arg_8 = arg_3 [ arg_7 ] [ 0 ] + 5.0 * arg_2 + 10.0 arg_9 = ( arg_8 > 14 ) & ( arg_8 < 16 ) arg_10 = arg_8 + gminvFromVmini ( arg_3 [ arg_7 ] [ 1 ] ) arg_11 = parallaxErrorSkyAvg ( arg_10 , arg_3 [ arg_7 ] [ 1 ] ) arg_12 = arg_11 * 10 ** arg_2 / 1000.0 plt . loglog ( 10 ** arg_2 , arg_12 , '--k' , lw = 1 ) plt . loglog ( 10 ** arg_2 [ arg_9 ] , arg_12 [ arg_9 ] , '-' , label = arg_7 ) plt . xlim ( 0.1 , 20.0 ) plt . ylim ( 0.001 , 0.5 ) plt . text ( 0.9 , 0.05 , 'Colours indicate $14<V<16$' , horizontalalignment = 'right' , verticalalignment = 'bottom' , transform = arg_6 . transAxes ) plt . legend ( loc = 2 ) plt . xlabel ( 'distance [kpc]' ) plt . ylabel ( '$\\sigma_\\varpi/\\varpi$' ) plt . grid ( which = 'both' ) if ( args [ 'pdfOutput' ] ) : plt . savefig ( 'RelativeParallaxErrorsVsDist.pdf' ) elif ( args [ 'pngOutput' ] ) : plt . savefig ( 'RelativeParallaxErrorsVsDist.png' ) else : plt . show ( )


Question: Check whether a file is presumed hidden either because the pathname starts with dot or because the platform indicates such .

def Func ( arg_0 ) : arg_1 = os . path . abspath ( arg_0 ) arg_2 = os . path . basename ( arg_1 ) def no ( arg_0 ) : return False arg_3 = globals ( ) . get ( 'Func_' + platform . system ( ) , no ) return arg_2 . startswith ( '.' ) or arg_3 ( arg_1 )

When an event from enaml occurs, send it out the websocket
        so the client's browser can update accordingly.


Question: Set the maximum depth for the certificate chain verification that shall be allowed for this Context object .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , integer_types ) : raise TypeError ( "depth must be an integer" ) _lib . SSL_CTX_Func ( arg_0 . _context , arg_1 )

The estimated signal-to-noise_maps mappers of the image.


Question: Execute the given command .

def Func ( arg_0 ) : arg_1 = Popen ( arg_0 . command , stdout = PIPE , stderr = PIPE , shell = True ) ( arg_2 , arg_3 ) = arg_1 . communicate ( ) if arg_1 . returncode != 0 : return arg_0 . _decode_output ( arg_3 ) return arg_0 . _decode_output ( 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: stupidly print an iterable of iterables in TSV format

def Func ( arg_0 , arg_1 = "\t" , arg_2 = arg_3 . stdout ) : for arg_5 in arg_0 : print ( * arg_5 , arg_1 = arg_1 , arg_2 = arg_2 )

Prepare the actors, the world, and the messaging system to begin
        playing the game.

        This method is guaranteed to be called exactly once upon entering the
        game stage.


Question: Marks line_data and all of its associated feature s line_status as removed does not actually remove the line_data from the data structure . The write function checks the line_status when writing the gff file . Find the root parent of line_data of type root_type remove all of its descendants . If the root parent has a parent with no children after the remove remove the root parent s parent recursively .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ arg_9 for arg_9 in arg_0 . ancestors ( arg_1 ) if ( arg_2 and arg_9 [ 'line_type' ] == arg_2 ) or ( not arg_2 and not arg_9 [ 'parents' ] ) ] or [ arg_1 ] for arg_4 in arg_3 : arg_4 [ 'line_status' ] = 'Funcd' arg_5 = arg_0 . descendants ( arg_4 ) for arg_6 in arg_5 : arg_6 [ 'line_status' ] = 'Funcd' arg_7 = arg_0 . ancestors ( arg_4 ) for arg_8 in arg_7 : if len ( [ arg_9 for arg_9 in arg_8 [ 'children' ] if arg_9 [ 'line_status' ] != 'Funcd' ] ) == 0 : arg_8 [ 'line_status' ] = 'Funcd'

Add an HTTP header to response object.

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


Question: Convert a vector size to a matrix size .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if isinstance ( arg_0 , ( float , int , np . generic , np . ndarray ) ) : arg_3 = ( - 1 + np . sqrt ( 1 + 8 * arg_0 ) ) / 2. if float ( int ( arg_3 ) ) != arg_3 : raise ValueError ( "Vector length is not a triangular number." ) return int ( arg_3 ) else : with tf . name_scope ( arg_2 or "Func" ) as arg_2 : arg_3 = ( - 1. + tf . sqrt ( 1 + 8. * tf . cast ( arg_0 , dtype = tf . float32 ) ) ) / 2. if arg_1 : with tf . control_dependencies ( [ assert_util . assert_equal ( tf . cast ( tf . cast ( arg_3 , dtype = tf . int32 ) , dtype = tf . float32 ) , arg_3 , message = "Vector length is not a triangular number" ) ] ) : arg_3 = tf . identity ( arg_3 ) return tf . cast ( arg_3 , arg_0 . dtype )

Cycles through notifications with latest results from data feeds.


Question: Loads Django settings for the current site and sets them so Django internals can be run .

def Func ( arg_0 ) : arg_1 = arg_0 . local_renderer arg_2 = { } arg_3 = [ 'ALLOW_CELERY' , 'DJANGO_SETTINGS_MODULE' ] for arg_4 in arg_3 : arg_2 [ arg_4 ] = arg_5 . environ . get ( arg_4 ) try : if arg_1 . env . local_project_dir : sys . path . insert ( 0 , arg_1 . env . local_project_dir ) arg_5 . environ [ 'ALLOW_CELERY' ] = '0' arg_5 . environ [ 'DJANGO_SETTINGS_MODULE' ] = arg_1 . format ( arg_1 . env . settings_module ) try : import django django . setup ( ) except AttributeError : pass arg_7 = arg_0 . get_settings ( ) try : from django . contrib import staticfiles from django . conf import arg_7 as _settings if arg_7 is not None : for arg_8 , arg_9 in arg_7 . __dict__ . items ( ) : setattr ( _settings , arg_8 , arg_9 ) else : raise ImportError except ( ImportError , RuntimeError ) : print ( 'Unable to load settings.' ) traceback . print_exc ( ) finally : for arg_4 , arg_10 in arg_2 . items ( ) : if arg_10 is None : del arg_5 . environ [ arg_4 ] else : arg_5 . environ [ arg_4 ] = arg_10 return arg_7

Add this manager's namespace to the graph.


Question: If the source files dirpath is the same as dest_dir a copy is not necessary and nothing is done . Else a copy is made .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 + '/' + os . path . basename ( arg_1 ) if os . path . dirname ( arg_1 ) != arg_2 : try : shutil . copyfile ( arg_1 , arg_3 ) os . chmod ( arg_3 , 0o777 ) except OSError as e : raise FileCopyException ( e , arg_0 . hostname ) return arg_3

Returns grade data for the given account_id and term_id.

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


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

def Func ( arg_0 , arg_1 ) : from heronpy . streamlet . impl . Funcbolt import ConsumeStreamlet arg_2 = ConsumeStreamlet ( arg_1 , arg_0 ) arg_0 . _add_child ( arg_2 ) return

Create a tuning job

        :param config: the config for tuning
        :type config: dict
        :param wait_for_completion: if the program should keep running until job finishes
        :type wait_for_completion: bool
        :param check_interval: the time interval in seconds which the operator
            will check the status of any SageMaker job
        :type check_interval: int
        :param max_ingestion_time: the maximum ingestion time in seconds. Any
            SageMaker jobs that run longer than this will fail. Setting this to
            None implies no timeout for any SageMaker job.
        :type max_ingestion_time: int
        :return: A response to tuning job creation


Question: This function creates a 2d gaussian kernel with the standard deviation denoted by sigma

def Func ( arg_0 , arg_1 ) : if arg_0 % 2 == 0 : raise ValueError ( "Kernel dimension should be odd" ) arg_2 = np . zeros ( ( arg_0 , arg_0 ) , dtype = np . float16 ) arg_3 = arg_0 / 2 arg_4 = arg_1 ** 2 arg_5 = 1. / ( 2 * arg_4 ) for arg_6 in range ( 0 , arg_0 ) : for arg_7 in range ( 0 , arg_0 ) : arg_8 = abs ( arg_6 - arg_3 ) arg_9 = abs ( arg_7 - arg_3 ) arg_10 = arg_8 ** 2 + arg_9 ** 2 arg_11 = 2 * arg_4 arg_2 [ arg_6 , arg_7 ] = arg_5 * np . exp ( - 1. * arg_10 / arg_11 ) return arg_2 / sum ( sum ( arg_2 ) )


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

def Func ( arg_0 , arg_1 ) : _validate_not_none ( 'thumbprint' , arg_1 ) return arg_0 . _perform_get ( '/' + arg_0 . subscription_id + '/certificates/' + _str ( arg_1 ) , SubscriptionCertificate )


Question: return the classified labeling of record

def Func ( arg_0 , arg_1 ) : arg_2 = { "categoryIn" : [ None ] , "bottomUpIn" : arg_0 . _getStateAnomalyVector ( arg_1 ) , } arg_3 = { "categoriesOut" : numpy . zeros ( ( 1 , ) ) , "bestPrototypeIndices" : numpy . zeros ( ( 1 , ) ) , "categoryProbabilitiesOut" : numpy . zeros ( ( 1 , ) ) } arg_4 = arg_0 . htm_prediction_model . _getAnomalyClassifier ( ) arg_5 = arg_4 . getSelf ( ) . _knn arg_6 = numpy . array ( arg_4 . getSelf ( ) . getParameter ( 'categoryRecencyList' ) ) arg_7 = numpy . where ( ( arg_6 >= arg_0 . _autoDetectWaitRecords ) & ( arg_6 < arg_1 . ROWID ) ) [ 0 ] . tolist ( ) if len ( arg_7 ) == 0 : return None arg_4 . setParameter ( 'inferenceMode' , True ) arg_4 . setParameter ( 'learningMode' , False ) arg_4 . getSelf ( ) . compute ( arg_2 , arg_3 ) arg_4 . setParameter ( 'learningMode' , True ) arg_8 = arg_4 . getSelf ( ) . getLatestDistances ( ) arg_9 = arg_8 [ arg_7 ] if arg_9 . min ( ) <= arg_0 . _classificationMaxDist : arg_10 = arg_6 [ arg_7 ] arg_11 = arg_10 [ arg_9 . argmin ( ) ] arg_12 = numpy . where ( arg_6 == arg_11 ) [ 0 ] [ 0 ] arg_13 = arg_4 . getSelf ( ) . getCategoryList ( ) [ arg_12 ] return arg_13 return None


Question: Adds job to neutron context for use later .

def Func ( arg_0 , arg_1 ) : arg_2 = db_api . async_transaction_find ( arg_0 , id = arg_1 , scope = db_api . ONE ) if not arg_2 : return arg_0 . async_job = { "job" : v . _make_job_dict ( arg_2 ) }

Jumps short if not greater.

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


Question: Return index type used in loop nest .

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . get_kernel_loop_nest ( ) if type ( arg_1 ) is c_ast . For : arg_1 = [ arg_1 ] arg_2 = ( None , None ) for arg_3 in arg_1 : if type ( arg_3 ) is c_ast . For : if type ( arg_3 . stmt ) in [ c_ast . For , c_ast . Compound ] : arg_4 = arg_0 . Func ( arg_1 = arg_3 . stmt ) else : arg_4 = None arg_2 = ( arg_3 . init . decls [ 0 ] . type . type . names , arg_4 ) break if arg_2 [ 0 ] == arg_2 [ 1 ] or arg_2 [ 1 ] is None : return arg_2 [ 0 ] else : raise ValueError ( "Loop indices must have same type, found {}." . format ( arg_2 ) )

Translates round trip symbols to sectors.

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

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


Question: Convenience function which statically broadcasts shape when possible .

def Func ( arg_0 , arg_1 , arg_2 = "Func" ) : with tf . name_scope ( arg_2 ) : def make_shape_tensor ( arg_3 ) : return tf . convert_to_tensor ( value = arg_3 , arg_2 = "shape" , dtype = tf . int32 ) def get_tensor_shape ( arg_4 ) : if isinstance ( arg_4 , tf . TensorShape ) : return arg_4 arg_5 = tf . get_static_value ( make_shape_tensor ( arg_4 ) ) if arg_5 is not None : return tf . TensorShape ( arg_5 ) return None def get_shape_tensor ( arg_4 ) : if not isinstance ( arg_4 , tf . TensorShape ) : return make_shape_tensor ( arg_4 ) if tensorshape_util . is_fully_defined ( arg_4 ) : return make_shape_tensor ( tensorshape_util . as_list ( arg_4 ) ) raise ValueError ( "Cannot broadcast from partially " "defined `TensorShape`." ) arg_6 = get_tensor_shape ( arg_0 ) arg_7 = get_tensor_shape ( arg_1 ) if arg_6 is not None and arg_7 is not None : return tf . broadcast_static_shape ( arg_6 , arg_7 ) arg_6 = get_shape_tensor ( arg_0 ) arg_7 = get_shape_tensor ( arg_1 ) return tf . broadcast_dynamic_shape ( arg_6 , arg_7 )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Requests a list of next - available - IDs from the server .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_3 = str ( arg_3 ) arg_4 = arg_0 . url ( "{}/{}/reserve/{}/" . format ( arg_1 , arg_2 , arg_3 ) ) arg_5 = arg_0 . remote_utils . get_url ( arg_4 ) if arg_5 . status_code is not 200 : raise RemoteDataNotFoundError ( 'Invalid req: ' + arg_5 . status_code ) arg_6 = arg_5 . json ( ) return [ arg_6 [ 0 ] + arg_7 for arg_7 in range ( arg_6 [ 1 ] ) ]

Determine the assay of self.

        :returns: [mass fractions] An array containing the assay of self.


Question: Check whether the SLA has passed or failed

def Func ( arg_0 , arg_1 , arg_2 ) : try : if arg_1 . display is '%' : arg_3 = float ( arg_2 [ 'percent_diff' ] ) else : arg_3 = float ( arg_2 [ 'absolute_diff' ] ) except ValueError : return False if not ( arg_1 . Func_passed ( arg_3 ) ) : arg_0 . sla_failures += 1 arg_0 . sla_failure_list . append ( DiffSLAFailure ( arg_1 , arg_2 ) ) return True

Read settings from a config file in the source_dir root.


Question: Checks to see if the model should exit based on the exitAfter dummy parameter

def Func ( arg_0 , arg_1 ) : if arg_0 . _exitAfter is None or arg_1 < arg_0 . _exitAfter : return False arg_2 = arg_0 . _jobsDAO . modelsGetFieldsForJob ( arg_0 . _jobID , [ 'params' ] ) arg_3 = [ e [ 0 ] for e in arg_2 ] arg_4 = [ json . loads ( e [ 1 ] [ 0 ] ) [ 'structuredParams' ] [ '__model_num' ] for e in arg_2 ] arg_5 = filter ( lambda x : x [ 1 ] == arg_0 . modelIndex , zip ( arg_3 , arg_4 ) ) arg_6 = min ( zip ( * arg_5 ) [ 0 ] ) return arg_6 == arg_0 . _modelID

Adds headers to the request

        Args:
            headers (dict): The headers to add the request headers

        Returns:
            The request builder instance in order to chain calls


Question: Load a list of trees from an open Newick formatted file .

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_2 [ 'strip_comments' ] = arg_1 return Funcs ( arg_0 . read ( ) , ** arg_2 )

Makes the python dict corresponding to the
    JSON that needs to be sent for a failed
    response. Message is the message that is
    sent as the reason for failure.


Question: insert a child node

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . children . Func ( arg_1 , arg_2 ) arg_2 . parent = arg_0

Gets predictions for a given utterance, in the form of intents and
        entities. The current maximum query size is 500 characters.

        :param app_id: The LUIS application ID (Guid).
        :type app_id: str
        :param query: The utterance to predict.
        :type query: str
        :param timezone_offset: The timezone offset for the location of the
         request.
        :type timezone_offset: float
        :param verbose: If true, return all intents instead of just the top
         scoring intent.
        :type verbose: bool
        :param staging: Use the staging endpoint slot.
        :type staging: bool
        :param spell_check: Enable spell checking.
        :type spell_check: bool
        :param bing_spell_check_subscription_key: The subscription key to use
         when enabling Bing spell check
        :type bing_spell_check_subscription_key: str
        :param log: Log query (default is true)
        :type log: bool
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: LuisResult or ClientRawResponse if raw=true
        :rtype:
         ~azure.cognitiveservices.language.luis.runtime.models.LuisResult or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`APIErrorException<azure.cognitiveservices.language.luis.runtime.models.APIErrorException>`


Question: Determine molecule numbers for given total absolute and relative numbers

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = sum ( arg_3 ) if not any ( arg_2 ) : arg_5 = [ int ( arg_0 * i / arg_4 ) for i in arg_3 ] elif any ( arg_3 ) : arg_6 = arg_0 - sum ( arg_2 ) arg_5 = [ int ( arg_6 * i / arg_4 ) if i else j for i , j in zip ( arg_3 , arg_2 ) ] else : arg_5 = arg_2 return list ( zip ( arg_1 , arg_5 ) )


Question: Return a list of keys from MimicDB .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_2 . pop ( 'force' , None ) : arg_3 = arg_2 . get ( 'headers' , arg_1 [ 0 ] if len ( arg_1 ) else None ) or dict ( ) arg_3 [ 'force' ] = True arg_2 [ 'headers' ] = arg_3 return super ( Bucket , arg_0 ) . Func ( * arg_1 , ** arg_2 )

Decimal adjusts AL after subtraction.

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

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

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

        :param cpu: current CPU.


Question: Returns an optional AudioTrack .

def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_0 . track = arg_1 [ 'track' ] arg_0 . identifier = arg_1 [ 'info' ] [ 'identifier' ] arg_0 . can_seek = arg_1 [ 'info' ] [ 'isSeekable' ] arg_0 . author = arg_1 [ 'info' ] [ 'author' ] arg_0 . duration = arg_1 [ 'info' ] [ 'length' ] arg_0 . stream = arg_1 [ 'info' ] [ 'isStream' ] arg_0 . title = arg_1 [ 'info' ] [ 'title' ] arg_0 . uri = arg_1 [ 'info' ] [ 'uri' ] arg_0 . requester = arg_2 return arg_0 except KeyError : raise InvalidTrack ( 'An invalid track was passed.' )


Question: Moves a file .

def Func ( arg_0 , arg_1 ) : _AssertIsLocal ( arg_0 ) _AssertIsLocal ( arg_1 ) import shutil shutil . move ( arg_0 , arg_1 )

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: Handles display of the dot code in a text editor .

def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_0 . dot_code = str ( arg_0 . model ) arg_3 = arg_0 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" , view = "dot_code_view" )

Adds an empty derived parameter group under the current node.

        Adds the full name of the current node as prefix to the name of the group.
        If current node is a single run (root) adds the prefix `'derived_parameters.runs.run_08%d%'`
        to the full name where `'08%d'` is replaced by the index of the current run.

        The `name` can also contain subgroups separated via colons, for example:
        `name=subgroup1.subgroup2.subgroup3`. These other parent groups will be automatically
        be created.


Question: Creates validators generator for the spec resolver .

def Func ( arg_0 , arg_1 ) : arg_2 = DerefValidatorDecorator ( arg_1 ) for arg_3 , arg_4 in iteritems ( arg_0 . validators ) : yield arg_3 , arg_2 ( arg_4 )


Question: Given a message or header return the header .

def Func ( arg_0 ) : if not arg_0 : return { } try : arg_1 = arg_0 [ 'header' ] except KeyError : try : arg_1 = arg_0 [ 'msg_id' ] except KeyError : raise else : arg_1 = arg_0 if not isinstance ( arg_1 , dict ) : arg_1 = dict ( arg_1 ) return arg_1

Remove max=null parameter from URL.

    Patch for Webex Teams Defect: 'next' URL returned in the Link headers of
    the responses contain an errant 'max=null' parameter, which  causes the
    next request (to this URL) to fail if the URL is requested as-is.

    This patch parses the next_url to remove the max=null parameter.

    Args:
        next_url(basestring): The 'next' URL to be parsed and cleaned.

    Returns:
        basestring: The clean URL to be used for the 'next' request.

    Raises:
        AssertionError: If the parameter types are incorrect.
        ValueError: If 'next_url' does not contain a valid API endpoint URL
            (scheme, netloc and path).


Question: Update a wrapper function to look like the wrapped function

def Func ( arg_0 , arg_1 , arg_2 = arg_3 , arg_4 = arg_5 ) : for arg_6 in arg_2 : setattr ( arg_0 , arg_6 , getattr ( arg_1 , arg_6 ) ) for arg_6 in arg_4 : getattr ( arg_0 , arg_6 ) . update ( getattr ( arg_1 , arg_6 , { } ) ) return arg_0

Serialize the specified DataFrame and upload it as a new dataset.

        Parameters
        ----------
        dataframe : pandas.DataFrame
            Data to serialize.
        data_type_id : str
            Format to serialize to.
            Supported formats are:
                'PlainText'
                'GenericCSV'
                'GenericTSV'
                'GenericCSVNoHeader'
                'GenericTSVNoHeader'
            See the azureml.DataTypeIds class for constants.
        name : str
            Name for the new dataset.
        description : str
            Description for the new dataset.

        Returns
        -------
        SourceDataset
            Dataset that was just created.
            Use open(), read_as_binary(), read_as_text() or to_dataframe() on
            the dataset object to get its contents as a stream, bytes, str or
            pandas DataFrame.


Question: Resolves an option value into options .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if getattr ( arg_1 , arg_2 , None ) is not None : return if arg_2 . startswith ( arg_3 + '_' ) : arg_4 = arg_2 . upper ( ) arg_5 = arg_2 [ len ( arg_3 ) + 1 : ] else : arg_4 = ( arg_3 + '_' + arg_2 ) . upper ( ) arg_5 = arg_2 setattr ( arg_1 , arg_2 , os . environ . get ( arg_4 , ( arg_0 . context . conf . get ( arg_3 , { } ) ) . get ( arg_5 ) ) )

Pad dimensions of event tensors for mixture distributions.

  See `Mixture._sample_n` and `MixtureSameFamily._sample_n` for usage examples.

  Args:
    x: event tensor to pad.
    mixture_distribution: Base distribution of the mixture.
    categorical_distribution: `Categorical` distribution that mixes the base
      distribution.
    event_ndims: Integer specifying the number of event dimensions in the event
      tensor.

  Returns:
    A padded version of `x` that can broadcast with `categorical_distribution`.


Question: Helper for various string - wrapped functions .

def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 , arg_4 in arg_1 : if hasattr ( arg_4 , '__html__' ) or isinstance ( arg_4 , string_types ) : arg_0 [ arg_3 ] = arg_2 ( arg_4 ) return arg_0

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Retrieve the Hit Ratios .

def Func ( arg_0 , arg_1 = False , arg_2 = False , arg_3 = False ) : arg_4 = ModelBase . _get_metrics ( arg_0 , arg_1 , arg_2 , arg_3 ) arg_5 = { } for arg_6 , arg_7 in zip ( list ( arg_4 . keys ( ) ) , list ( arg_4 . values ( ) ) ) : arg_5 [ arg_6 ] = None if arg_7 is None else arg_7 . Func ( ) return list ( arg_5 . values ( ) ) [ 0 ] if len ( arg_5 ) == 1 else arg_5

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


Question: Get or create edges using get_or_create_node

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = arg_0 . add_node ( arg_1 ) arg_5 = arg_0 . add_node ( arg_2 ) arg_6 = Edge ( arg_4 , arg_5 , arg_3 ) arg_0 . _edges . append ( arg_6 ) return arg_6

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


Question: Get all effect directories for registered effects .

def Func ( arg_0 ) -> List [ str ] : for arg_1 in arg_0 . packages : yield os . path . join ( arg_1 . path , 'resources' )

Read attribute from sysfs and return as string


Question: Creates a job flow using the config from the EMR connection . Keys of the json extra hash may have the arguments of the boto3 run_job_flow method . Overrides for this config may be passed as the job_flow_overrides .

def Func ( arg_0 , arg_1 ) : if not arg_0 . emr_conn_id : raise AirflowException ( 'emr_conn_id must be present to use Func' ) arg_2 = arg_0 . get_connection ( arg_0 . emr_conn_id ) arg_3 = arg_2 . extra_dejson . copy ( ) arg_3 . update ( arg_1 ) arg_4 = arg_0 . get_conn ( ) . run_job_flow ( ** arg_3 ) return arg_4

Make arrays indexable for cross-validation.

    Checks consistent length, passes through None, and ensures that everything
    can be indexed by converting sparse matrices to csr and converting
    non-interable objects to arrays.

    Parameters
    ----------
    iterables : lists, dataframes, arrays, sparse matrices
        List of objects to ensure sliceability.


Question: Initialize the BLE provider . Must be called once before any other calls are made to the provider .

def Func ( arg_0 ) : arg_0 . _central_manager = CBCentralManager . alloc ( ) arg_0 . _central_manager . initWithDelegate_queue_options_ ( arg_0 . _central_delegate , None , None )

Rename this conversation.

        Hangouts only officially supports renaming group conversations, so
        custom names for one-to-one conversations may or may not appear in all
        first party clients.

        Args:
            name (str): New name.

        Raises:
            .NetworkError: If conversation cannot be renamed.


Question: Change the name of this droplet

def Func ( arg_0 , arg_1 , arg_2 = True ) : return arg_0 . _action ( 'Func' , arg_1 = arg_1 , arg_2 = arg_2 )

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


Question: Run a Basilisp script or a line of code if it is provided .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , ) : basilisp . init ( ) arg_7 = compiler . CompilerContext ( filename = CLI_INPUT_FILE_PATH if arg_1 else ( STDIN_INPUT_FILE_PATH if arg_0 == STDIN_FILE_NAME else arg_0 ) , opts = { compiler . WARN_ON_SHADOWED_NAME : arg_4 , compiler . WARN_ON_SHADOWED_VAR : arg_5 , compiler . USE_VAR_INDIRECTION : arg_3 , compiler . WARN_ON_VAR_INDIRECTION : arg_6 , } , ) arg_8 = object ( ) with Functime . ns_bindings ( arg_2 ) as ns : if arg_1 : print ( Functime . lrepr ( eval_str ( arg_0 , arg_7 , ns . module , arg_8 ) ) ) elif arg_0 == STDIN_FILE_NAME : print ( Functime . lrepr ( eval_stream ( click . get_text_stream ( "stdin" ) , arg_7 , ns . module ) ) ) else : print ( Functime . lrepr ( eval_file ( arg_0 , arg_7 , ns . module ) ) )

Returns protobuf mapcontainer. Read from translation file.


Question: Converts the provided traceId hex value with optional high bits to a string .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is not None : arg_3 = bytearray ( 32 ) arg_0 . _write_hex_long ( arg_3 , 0 , arg_2 ) arg_0 . _write_hex_long ( arg_3 , 16 , arg_1 ) return arg_3 . decode ( "utf8" ) arg_3 = bytearray ( 16 ) arg_0 . _write_hex_long ( arg_3 , 0 , arg_1 ) return arg_3 . decode ( "utf8" )

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: Update the object with new data .

def Func ( arg_0 , arg_1 ) : arg_2 = [ 'id' , 'status' , 'type' , 'persistence' , 'date_start' , 'date_finish' , 'date_created' , 'date_modified' , 'checksum' , 'processor_name' , 'input' , 'input_schema' , 'output' , 'output_schema' , 'static' , 'static_schema' , 'var' , 'var_template' , ] arg_0 . annotation = { } for arg_4 in arg_2 : setattr ( arg_0 , arg_4 , arg_1 [ arg_4 ] ) arg_0 . name = arg_1 [ 'static' ] [ 'name' ] if 'name' in arg_1 [ 'static' ] else '' arg_0 . annotation . Func ( arg_0 . _flatten_field ( arg_1 [ 'input' ] , arg_1 [ 'input_schema' ] , 'input' ) ) arg_0 . annotation . Func ( arg_0 . _flatten_field ( arg_1 [ 'output' ] , arg_1 [ 'output_schema' ] , 'output' ) ) arg_0 . annotation . Func ( arg_0 . _flatten_field ( arg_1 [ 'static' ] , arg_1 [ 'static_schema' ] , 'static' ) ) arg_0 . annotation . Func ( arg_0 . _flatten_field ( arg_1 [ 'var' ] , arg_1 [ 'var_template' ] , 'var' ) )

Transform a QuantumChannel to the SuperOp representation.


Question: Guess driver from file extension .

def Func ( arg_0 ) : arg_1 = os . path . splitext ( arg_0 ) [ 1 ] . split ( "." ) [ 1 ] if arg_1 not in _file_ext_to_driver ( ) : raise MapcheteDriverError ( "no driver could be found for file extension %s" % arg_1 ) arg_2 = _file_ext_to_driver ( ) [ arg_1 ] if len ( arg_2 ) > 1 : warnings . warn ( DeprecationWarning ( "more than one driver for file found, taking %s" % arg_2 [ 0 ] ) ) return arg_2 [ 0 ]

Initialize all ephemerals used by derived classes.


Question: Return the FONEM code of a word .

def Func ( arg_0 , arg_1 ) : arg_1 = unicode_normalize ( 'NFKD' , text_type ( arg_1 . upper ( ) ) ) arg_1 = arg_1 . translate ( { 198 : 'AE' , 338 : 'OE' } ) arg_1 = '' . join ( c for c in arg_1 if c in arg_0 . _uc_set ) for arg_2 in arg_0 . _rule_order : arg_3 , arg_4 = arg_0 . _rule_table [ arg_2 ] if isinstance ( arg_3 , text_type ) : arg_1 = arg_1 . replace ( arg_3 , arg_4 ) else : arg_1 = arg_3 . sub ( arg_4 , arg_1 ) return arg_1

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


Question: Obtain a handle to the frame in H2O with the frame_id key .

def Func ( arg_0 , ** arg_1 ) : assert_is_type ( arg_0 , str ) return H2OFrame . Func ( arg_0 , ** arg_1 )

Bayesian Estimation Supersedes the T-Test

    This model runs a Bayesian hypothesis comparing if y1 and y2 come
    from the same distribution. Returns are assumed to be T-distributed.

    In addition, computes annual volatility and Sharpe of in and
    out-of-sample periods.

    This model replicates the example used in:
    Kruschke, John. (2012) Bayesian estimation supersedes the t
    test. Journal of Experimental Psychology: General.

    Parameters
    ----------
    y1 : array-like
        Array of returns (e.g. in-sample)
    y2 : array-like
        Array of returns (e.g. out-of-sample)
    samples : int, optional
        Number of posterior samples to draw.

    Returns
    -------
    model : pymc.Model object
        PyMC3 model containing all random variables.
    trace : pymc3.sampling.BaseTrace object
        A PyMC3 trace object that contains samples for each parameter
        of the posterior.

    See Also
    --------
    plot_stoch_vol : plotting of tochastic volatility model


Question: r Multiply two Paulis and track the phase .

def Func ( arg_0 , arg_1 ) : arg_2 = Pauli . _prod_phase ( arg_0 , arg_1 ) arg_3 = arg_0 * arg_1 return arg_3 , arg_2

Set the colorpalette which should be used


Question: Handles adding a Cluster to the main graph .

def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_2 = arg_0 . _request_graph ( arg_1 . ui . control ) if arg_2 is not None : arg_3 = Cluster ( ) arg_4 = arg_3 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" ) if arg_4 . result : arg_2 . clusters . append ( arg_3 )

Set a property value or remove a property.

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

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

        This default implementation

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

        Removing a non-existing prop is NOT an error.

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

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


Question: iterate on similarities among all files by making a cartesian product

def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 . linesets [ : - 1 ] ) : for arg_3 in arg_0 . linesets [ arg_1 + 1 : ] : for arg_4 in arg_0 . _find_common ( arg_2 , arg_3 ) : yield arg_4

Renders a standalone page as a response for the specified fragment.


Question: Build the Ref instance by fetching the rule from the GramFuzzer instance and building it

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : global REF_LEVEL REF_LEVEL += 1 try : if arg_1 is None : arg_1 = [ ] arg_3 = arg_0 . fuzzer . get_ref ( arg_0 . cat , arg_0 . refname ) arg_4 = utils . val ( arg_3 , arg_1 , arg_2 = ( arg_2 or REF_LEVEL >= arg_0 . max_recursion ) ) return arg_4 finally : REF_LEVEL -= 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: Upload a pattern of files . This will recursively walk down every tree in the file pattern to create a hierarchy on the server . As of right now this places the file into the currently logged in user s home directory .

def Func ( arg_0 , arg_1 = 'Private' , arg_2 = False , arg_3 = False ) : arg_4 . token = verify_credentials ( ) arg_6 = None arg_7 = arg_4 . communicator . list_user_folders ( arg_4 . token ) if arg_1 . startswith ( '/' ) : arg_6 = _find_resource_id_from_path ( arg_1 ) else : for arg_8 in arg_7 : if arg_8 [ 'name' ] == arg_1 : arg_6 = arg_8 [ 'folder_id' ] if arg_6 is None : print ( 'Unable to locate specified destination. Defaulting to {0}.' . format ( arg_7 [ 0 ] [ 'name' ] ) ) arg_6 = arg_7 [ 0 ] [ 'folder_id' ] for arg_9 in glob . iglob ( arg_0 ) : arg_9 = os . path . normpath ( arg_9 ) if os . path . isfile ( arg_9 ) : print ( 'Uploading item from {0}' . format ( arg_9 ) ) _Func_as_item ( os . path . basename ( arg_9 ) , arg_6 , arg_9 , arg_3 ) else : _Func_folder_recursive ( arg_9 , arg_6 , arg_2 , arg_3 )


Question: Obtains a credentials handle from secur32 . dll for use with SChannel

def Func ( arg_0 ) : arg_1 = { 'SSLv3' : Secur32Const . SP_PROT_SSL3_CLIENT , 'TLSv1' : Secur32Const . SP_PROT_TLS1_CLIENT , 'TLSv1.1' : Secur32Const . SP_PROT_TLS1_1_CLIENT , 'TLSv1.2' : Secur32Const . SP_PROT_TLS1_2_CLIENT , } arg_2 = 0 for arg_3 , arg_4 in arg_1 . items ( ) : if arg_3 in arg_0 . _protocols : arg_2 |= arg_4 arg_5 = [ Secur32Const . CALG_AES_128 , Secur32Const . CALG_AES_256 , Secur32Const . CALG_3DES , Secur32Const . CALG_SHA1 , Secur32Const . CALG_ECDHE , Secur32Const . CALG_DH_EPHEM , Secur32Const . CALG_RSA_KEYX , Secur32Const . CALG_RSA_SIGN , Secur32Const . CALG_ECDSA , Secur32Const . CALG_DSS_SIGN , ] if 'TLSv1.2' in arg_0 . _protocols : arg_5 . extend ( [ Secur32Const . CALG_SHA512 , Secur32Const . CALG_SHA384 , Secur32Const . CALG_SHA256 , ] ) arg_6 = new ( secur32 , 'ALG_ID[%s]' % len ( arg_5 ) ) for arg_7 , arg_8 in enumerate ( arg_5 ) : arg_6 [ arg_7 ] = arg_8 arg_9 = Secur32Const . SCH_USE_STRONG_CRYPTO | Secur32Const . SCH_CRED_NO_DEFAULT_CREDS if not arg_0 . _manual_validation and not arg_0 . _extra_trust_roots : arg_9 |= Secur32Const . SCH_CRED_AUTO_CRED_VALIDATION else : arg_9 |= Secur32Const . SCH_CRED_MANUAL_CRED_VALIDATION arg_10 = struct ( secur32 , 'SCHANNEL_CRED' ) arg_11 = unwrap ( arg_10 ) arg_11 . dwVersion = Secur32Const . SCHANNEL_CRED_VERSION arg_11 . cCreds = 0 arg_11 . paCred = null ( ) arg_11 . hRootStore = null ( ) arg_11 . cMappers = 0 arg_11 . aphMappers = null ( ) arg_11 . cSupportedAlgs = len ( arg_6 ) arg_11 . palgSupportedAlgs = arg_6 arg_11 . grbitEnabledProtocols = arg_2 arg_11 . dwMinimumCipherStrength = 0 arg_11 . dwMaximumCipherStrength = 0 arg_11 . dwSessionLifespan = 0 arg_11 . dwFlags = arg_9 arg_11 . dwCredFormat = 0 arg_26 = new ( secur32 , 'CredHandle *' ) arg_27 = secur32 . AcquireCredentialsHandleW ( null ( ) , Secur32Const . UNISP_NAME , Secur32Const . SECPKG_CRED_OUTBOUND , null ( ) , arg_10 , null ( ) , null ( ) , arg_26 , null ( ) ) handle_error ( arg_27 ) arg_0 . _credentials_handle = arg_26

Read a config file and set config values accordingly.

        Returns:
            dict: content of config file.


Question: Calculate the distance between the Eudex hashes of two terms .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'exponential' , arg_4 = 8 , arg_5 = False ) : arg_6 = eudex ( arg_1 , arg_4 = arg_4 ) ^ eudex ( arg_2 , arg_4 = arg_4 ) if not arg_3 : arg_7 = bin ( arg_6 ) arg_8 = arg_7 . count ( '1' ) if arg_5 : return arg_8 / ( len ( arg_7 ) - 2 ) return arg_8 if callable ( arg_3 ) : arg_3 = arg_3 ( ) elif arg_3 == 'exponential' : arg_3 = Eudex . gen_exponential ( ) elif arg_3 == 'fibonacci' : arg_3 = Eudex . gen_fibonacci ( ) if isinstance ( arg_3 , GeneratorType ) : arg_3 = [ next ( arg_3 ) for _ in range ( arg_4 ) ] [ : : - 1 ] arg_8 = 0 arg_9 = 0 while ( arg_6 or arg_5 ) and arg_3 : arg_9 += 8 * arg_3 [ - 1 ] arg_8 += bin ( arg_6 & 0xFF ) . count ( '1' ) * arg_3 . pop ( ) arg_6 >>= 8 if arg_5 : arg_8 /= arg_9 return arg_8


Question: Checks a Security OSStatus error code and throws an exception if there is an error to report

def Func ( arg_0 , arg_1 = None ) : if arg_0 == 0 : return if arg_0 in set ( [ SecurityConst . errSSLClosedNoNotify , SecurityConst . errSSLClosedAbort ] ) : raise TLSDisconnectError ( 'The remote end closed the connection' ) if arg_0 == SecurityConst . errSSLClosedGraceful : raise TLSGracefulDisconnectError ( 'The remote end closed the connection' ) arg_2 = Security . SecCopyErrorMessageString ( arg_0 , null ( ) ) arg_3 = CFHelpers . cf_string_to_unicode ( arg_2 ) CoreFoundation . CFRelease ( arg_2 ) if arg_3 is None or arg_3 == '' : arg_3 = 'OSStatus %s' % arg_0 if arg_1 is None : arg_1 = OSError raise arg_1 ( arg_3 )


Question: r Calculate all atomic surface area .

def Func ( arg_0 ) : return [ arg_0 . atomic_sa ( arg_1 ) for arg_1 in range ( len ( arg_0 . rads ) ) ]

Update Marketing urls in course metadata and return updated course.

        Arguments:
            course_runs (list): List of course runs.
            enterprise_customer (EnterpriseCustomer): enterprise customer instance.
            enterprise_context (dict): The context to inject into URLs.

        Returns:
            (dict): Dictionary containing updated course metadata.


Question: Return a combined dictionary of setting values and attribute values .

def Func ( arg_0 ) : arg_1 = arg_0 . setting_values ( ) arg_1 . update ( arg_0 . __dict__ ) arg_2 = [ "_instance_settings" , "aliases" ] for arg_3 in arg_2 : del arg_1 [ arg_3 ] return arg_1

scan through the java output text and extract the bad java messages that may or may not happened when
    unit tests are run.  It will not record any bad java messages that are stored in g_ok_java_messages.

    :return: none


Question: Compute the functions C1 and C2

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_3 == 0.0 and arg_4 == 0.0 : return arg_1 , arg_2 arg_5 = 1 / ( arg_3 + arg_4 ) arg_6 = ( arg_1 * arg_4 + arg_2 * arg_3 ) * arg_5 arg_7 = ( arg_1 * arg_3 + arg_2 * arg_4 ) * arg_5 return arg_6 , arg_7

Does google-lint on a single file.

  Args:
    filename: The name of the file to parse.

    vlevel: The level of errors to report.  Every error of confidence
    >= verbose_level will be reported.  0 is a good default.

    extra_check_functions: An array of additional check functions that will be
                           run on each source line. Each function takes 4
                           arguments: filename, clean_lines, line, error


Question: Update _handler_map after handlers have been modified .

def Func ( arg_0 ) : arg_1 = defaultdict ( list ) for arg_2 , arg_3 in enumerate ( arg_0 . handlers ) : for arg_4 , arg_5 in inspect . getmembers ( arg_3 , callable ) : if not hasattr ( arg_5 , "_pyxmpp_event_handled" ) : continue arg_6 = arg_5 . _pyxmpp_event_handled arg_1 [ arg_6 ] . append ( ( arg_2 , arg_5 ) ) arg_0 . _handler_map = arg_1

Parse issue and generate single line formatted issue line.

        Example output:
            - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder))
            - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) (@skywinder)

        :param dict issue: Fetched issue from GitHub.
        :rtype: str
        :return: Markdown-formatted single issue.


Question: Write optical flow to file .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = 0 , * arg_4 , ** arg_5 ) : if not arg_2 : with open ( arg_1 , 'wb' ) as f : f . write ( 'PIEH' . encode ( 'utf-8' ) ) np . array ( [ arg_0 . shape [ 1 ] , arg_0 . shape [ 0 ] ] , dtype = np . int32 ) . tofile ( f ) arg_0 = arg_0 . astype ( np . float32 ) arg_0 . tofile ( f ) f . flush ( ) else : assert arg_3 in [ 0 , 1 ] arg_6 , arg_7 = quantize_flow ( arg_0 , * arg_4 , ** arg_5 ) arg_8 = np . concatenate ( ( arg_6 , arg_7 ) , axis = arg_3 ) imwrite ( arg_8 , arg_1 )

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


Question: Formats the elements of an argument set appropriately

def Func ( arg_0 , arg_1 ) : return type ( arg_1 ) ( ( arg_2 , str ( arg_3 ) ) for ( arg_2 , arg_3 ) in arg_1 . items ( ) )

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

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

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


Question: Sets the finish time and computes the runtime in human readable format

def Func ( arg_0 ) : arg_1 = arg_0 . _run_information [ arg_0 . v_crun ] arg_2 = arg_1 [ 'timestamp' ] arg_3 = arg_0 . _summarize_explored_parameters ( ) arg_4 = time . time ( ) arg_5 = datetime . datetime . fromtimestamp ( arg_4 ) arg_6 = datetime . datetime . fromtimestamp ( arg_2 ) arg_7 = str ( arg_5 - arg_6 ) arg_1 [ 'parameter_summary' ] = arg_3 arg_1 [ 'completed' ] = 1 arg_1 [ 'finish_timestamp' ] = arg_4 arg_1 [ 'runtime' ] = arg_7

Discard deposit changes.

        #. The signal :data:`invenio_records.signals.before_record_update` is
            sent before the edit execution.

        #. It restores the last published version.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the edit execution.

        #. The deposit index is updated.

        Status required: ``'draft'``.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.


Question: Format the old format so it can be merged into the newer format .

def Func ( arg_0 ) : if arg_10 . CONFIGURATION [ "inactive_database" ] : arg_1 = ( arg_10 . CURRENT_DIRECTORY + "inactive-db.json" ) if arg_10 . path . isfile ( arg_1 ) : arg_2 = Dict ( ) . from_json ( File ( arg_1 ) . read ( ) ) arg_3 = { } arg_4 = arg_2 . keys ( ) for arg_5 in arg_4 : arg_6 = arg_2 [ arg_5 ] . keys ( ) arg_3 [ arg_5 ] = { } for arg_7 in arg_6 : if arg_7 . isdigit ( ) : arg_3 [ arg_5 ] [ arg_8 ( arg_7 ) - ( arg_0 . one_day_in_seconds * 30 ) ] = arg_2 [ arg_5 ] [ arg_7 ] else : arg_3 [ arg_5 ] [ arg_8 ( arg_10 . time ( ) ) - ( arg_0 . one_day_in_seconds * 30 ) ] = arg_2 [ arg_5 ] [ arg_7 ] if "inactive_db" in arg_10 . INTERN : arg_10 . INTERN [ "inactive_db" ] . update ( arg_3 ) else : arg_10 . INTERN [ "inactive_db" ] = arg_3 File ( arg_1 ) . delete ( )

Waits until TransferFuture is done and returns the result

        If the TransferFuture succeeded, it will return the result. If the
        TransferFuture failed, it will raise the exception associated to the
        failure.


Question: Factory method for Sender links .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = arg_4 or str ( arg_1 ) if arg_6 in arg_0 . _sender_links : raise KeyError ( "Sender %s already exists!" % arg_6 ) arg_7 = _SessionProxy ( "session-%s" % arg_6 , arg_0 ) arg_7 . open ( ) arg_8 = arg_7 . new_sender ( arg_6 ) arg_8 . configure ( arg_2 , arg_1 , arg_3 , arg_5 ) arg_0 . _sender_links [ arg_6 ] = arg_8 return arg_8

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: Convert Python files using lib3to2 .

def Func ( arg_0 = None ) : arg_0 = BASE_ARGS_3TO2 if arg_0 is None else BASE_ARGS_3TO2 + arg_0 try : arg_1 = subprocess . Popen ( [ '3to2' ] + arg_0 , stderr = subprocess . PIPE ) except OSError : for arg_2 in glob . glob ( '*.egg' ) : if os . path . isdir ( arg_2 ) and arg_2 not in sys . path : sys . path . append ( arg_2 ) try : from lib3to2 . main import main as lib3to2_main except ImportError : raise OSError ( '3to2 script is unavailable.' ) else : if lib3to2_main ( 'lib3to2.fixes' , arg_0 ) : raise Exception ( 'lib3to2 parsing error' ) else : arg_3 = 0 while arg_1 . poll ( ) is None : arg_4 = arg_1 . stderr . readline ( ) sys . stderr . write ( arg_4 ) arg_3 += arg_4 . count ( ': ParseError: ' ) if arg_1 . returncode or arg_3 : raise Exception ( 'lib3to2 parsing error' )

Stop streaming samples from device and delete samples buffer


Question: returns a a random string that represent a binary representation

Return single program by name, or None if not found.

        Arguments:
            program_title(string): Program title as seen by students and in Course Catalog Admin

        Returns:
            dict: Program data provided by Course Catalog API


Question: refetch - Fetch a fresh copy of all items in this list . Returns a new list . To update in - place use reload .

def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return IRQueryableList ( ) arg_1 = arg_0 . getModel ( ) arg_2 = [ item . _id for item in arg_0 if item . _id ] return arg_1 . objects . getMultiple ( arg_2 )

Add a node to run on failure.

        =====API DOCS=====
        Add a node to run on failure.

        :param parent: Primary key of parent node to associate failure node to.
        :type parent: int
        :param child: Primary key of child node to be associated.
        :type child: int
        :param `**kwargs`: Fields used to create child node if ``child`` is not provided.
        :returns: Dictionary of only one key "changed", which indicates whether the association succeeded.
        :rtype: dict

        =====API DOCS=====


Question: Check if the translocation of source causes activity of target .

def Func ( arg_0 : arg_1 ) -> bool : return part_has_modifier ( arg_0 , SUBJECT , TRANSLOCATION ) and part_has_modifier ( arg_0 , OBJECT , ACTIVITY )

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: Progress an iterator and updates a pretty status line to the terminal .

def Func ( arg_0 , arg_1 ) : if terminal_width ( arg_1 ) > 25 : arg_1 = ( ".." + get_cut_prefix ( arg_1 , 23 ) ) arg_2 = start = time ( ) arg_3 = written = 0 arg_4 = deque ( maxlen = 5 ) for arg_5 in arg_0 : yield arg_5 arg_6 = time ( ) arg_7 = arg_6 - start written += len ( arg_5 ) arg_8 = arg_6 - arg_2 if arg_8 >= 0.5 : arg_4 . appendleft ( ( written - arg_3 , arg_2 , ) ) arg_2 = arg_6 arg_3 = written arg_9 = sum ( h [ 0 ] for h in arg_4 ) arg_10 = arg_6 - arg_4 [ - 1 ] [ 1 ] arg_11 = arg_9 / arg_10 arg_12 = create_status_line ( arg_1 = arg_1 , written = format_filesize ( written ) , arg_7 = format_time ( arg_7 ) , arg_11 = format_filesize ( arg_11 ) ) print_inplace ( arg_12 ) sys . stderr . write ( "\n" ) sys . stderr . flush ( )

Removes the specfied course from the specified organization


Question: Fetch the status of engine queues .

def Func ( arg_0 , arg_1 = 'all' , arg_2 = False ) : if arg_1 == 'all' : arg_3 = None else : arg_3 = arg_0 . _build_targets ( arg_1 ) [ 1 ] arg_4 = dict ( arg_1 = arg_3 , arg_2 = arg_2 ) arg_0 . session . send ( arg_0 . _query_socket , "queue_request" , arg_4 = arg_4 ) arg_5 , arg_6 = arg_0 . session . recv ( arg_0 . _query_socket , 0 ) if arg_0 . debug : pprint ( arg_6 ) arg_4 = arg_6 [ 'content' ] arg_7 = arg_4 . pop ( 'status' ) if arg_7 != 'ok' : raise arg_0 . _unwrap_exception ( arg_4 ) arg_4 = rekey ( arg_4 ) if isinstance ( arg_1 , int ) : return arg_4 [ arg_1 ] else : return arg_4

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


Question: Parse the document handle .

def Func ( arg_0 ) : arg_1 = LatexCommand ( 'setDocRef' , { 'name' : 'handle' , 'required' : True , 'bracket' : '{' } ) try : arg_2 = next ( arg_1 . parse ( arg_0 . _tex ) ) except StopIteration : arg_0 . _logger . warning ( 'lsstdoc has no setDocRef' ) arg_0 . _handle = None arg_0 . _series = None arg_0 . _serial = None return arg_0 . _handle = arg_2 [ 'handle' ] try : arg_0 . _series , arg_0 . _serial = arg_0 . _handle . split ( '-' , 1 ) except ValueError : arg_0 . _logger . warning ( 'lsstdoc handle cannot be parsed into ' 'series and serial: %r' , arg_0 . _handle ) arg_0 . _series = None arg_0 . _serial = None

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


Question: translate exception str to http code

def Func ( arg_0 ) : if len ( arg_0 ) <= 3 : try : int ( arg_0 ) except BaseException : logger . error ( "JMeter wrote some strange data into codes column: %s" , arg_0 ) else : return int ( arg_0 ) arg_1 = arg_0 . split ( ' ' ) [ - 1 ] if arg_1 in KNOWN_EXC . keys ( ) : return 0 else : logger . warning ( "Unknown Java exception. %s" , arg_0 ) return 0


Question: Strips and filters empty or commented lines .

def Func ( arg_0 ) : for arg_1 in arg_0 : arg_1 = COMMENT_RE . sub ( '' , arg_1 ) arg_1 = arg_1 . strip ( ) if arg_1 : yield arg_1

Use SoftmaxNormal quantiles to form quadrature on `K - 1` simplex.

  A `SoftmaxNormal` random variable `Y` may be generated via

  ```
  Y = SoftmaxCentered(X),
  X = Normal(normal_loc, normal_scale)
  ```

  Args:
    normal_loc: `float`-like `Tensor` with shape `[b1, ..., bB, K-1]`, B>=0.
      The location parameter of the Normal used to construct the SoftmaxNormal.
    normal_scale: `float`-like `Tensor`. Broadcastable with `normal_loc`.
      The scale parameter of the Normal used to construct the SoftmaxNormal.
    quadrature_size: Python `int` scalar representing the number of quadrature
      points.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    name: Python `str` name prefixed to Ops created by this class.

  Returns:
    grid: Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
      convex combination of affine parameters for `K` components.
      `grid[..., :, n]` is the `n`-th grid point, living in the `K - 1` simplex.
    probs:  Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
      associated with each grid point.


Question: Say something in the morning

def Func ( arg_0 , arg_1 = "Breakfast is ready" , arg_2 : arg_3 = False ) : return arg_0 . helper . output ( arg_1 , arg_2 )


Question: Convenience method to wait for a window with the given name to disappear .

def Func ( arg_0 , arg_1 , arg_2 = 10 ) : arg_3 = AXCallbacks . elemDisappearedCallback arg_4 = None arg_5 = ( arg_4 , arg_0 ) arg_6 = arg_0 . findFirst ( AXRole = 'AXWindow' , AXTitle = arg_1 ) return arg_0 . waitFor ( arg_2 , 'AXUIElementDestroyed' , arg_3 = arg_3 , arg_5 = arg_5 , AXRole = 'AXWindow' , AXTitle = arg_1 )

Print informations about PyFunceble and the date of generation of a file
        into a given path, if doesn't exist.


Question: Actions taken at shutdown by the kernel called by python s atexit .

def Func ( arg_0 ) : if arg_0 . _shutdown_message is not None : arg_0 . session . send ( arg_0 . iopub_socket , arg_0 . _shutdown_message , ident = arg_0 . _topic ( 'shutdown' ) ) arg_0 . log . debug ( "%s" , arg_0 . _shutdown_message ) [ arg_1 . flush ( zmq . POLLOUT ) for arg_1 in arg_0 . shell_streams ]

Serialize a dataframe.

    Parameters
    ----------
    writer : file
        File-like object to write to. Must be opened in binary mode.
    data_type_id : dict
        Serialization format to use.
        See the azureml.DataTypeIds class for constants.
    dataframe: pandas.DataFrame
        Dataframe to serialize.


Question: Print birthday contact table .

def Func ( arg_0 , arg_1 ) : arg_0 = [ arg_3 for arg_3 in arg_0 if arg_3 . get_birthday ( ) is not None ] arg_0 . sort ( key = lambda x : ( x . get_birthday ( ) . month , x . get_birthday ( ) . day ) if isinstance ( x . get_birthday ( ) , datetime . datetime ) else ( 0 , 0 , x . get_birthday ( ) ) ) arg_2 = [ ] for arg_3 in arg_0 : arg_4 = arg_3 . get_birthday ( ) if arg_1 : if config . display_by_name ( ) == "first_name" : arg_2 . append ( "%04d.%02d.%02d\t%s" % ( arg_4 . year , arg_4 . month , arg_4 . day , arg_3 . get_first_name_last_name ( ) ) ) else : arg_2 . append ( "%04d.%02d.%02d\t%s" % ( arg_4 . year , arg_4 . month , arg_4 . day , arg_3 . get_last_name_first_name ( ) ) ) else : if config . display_by_name ( ) == "first_name" : arg_2 . append ( "%s\t%s" % ( arg_3 . get_first_name_last_name ( ) , arg_3 . get_formatted_birthday ( ) ) ) else : arg_2 . append ( "%s\t%s" % ( arg_3 . get_last_name_first_name ( ) , arg_3 . get_formatted_birthday ( ) ) ) if arg_2 : if arg_1 : print ( '\n' . join ( arg_2 ) ) else : list_birthdays ( arg_2 ) else : if not arg_1 : print ( "Found no birthdays" ) sys . exit ( 1 )


Question: List files in an allocation directory .

def Func ( arg_0 , arg_1 = None , arg_2 = "/" ) : if arg_1 : return arg_0 . request ( arg_1 , params = { "path" : arg_2 } , method = "get" ) . json ( ) else : return arg_0 . request ( params = { "path" : arg_2 } , method = "get" ) . json ( )


Question: Return a vector of the masked data .

def Func ( arg_0 ) : arg_0 . _check_for_mask ( ) return arg_0 . get_data ( smoothed = True , masked = True , safe_copy = False ) [ arg_0 . get_mask_indices ( ) ] , arg_0 . get_mask_indices ( ) , arg_0 . mask . shape

Receive updates to the packing plan from the statemgrs and update processes as needed.


Question: handler to attach to heartbeater . Called when a new heart starts to beat . Triggers completion of registration .

def Func ( arg_0 , arg_1 ) : arg_0 . log . debug ( "heartbeat::Func(%r)" , arg_1 ) if arg_1 not in arg_0 . incoming_registrations : arg_0 . log . info ( "heartbeat::ignoring new heart: %r" , arg_1 ) else : arg_0 . finish_registration ( arg_1 )


Question: This algorithm factors in both the user - provided weight and the difference between the alpha values of the two colors to decide how to perform the weighted average of the two RGB values .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 50 , * arg_4 ) : if arg_1 and arg_2 : if isinstance ( arg_3 , string_types ) : arg_3 = float ( arg_3 . strip ( '%' ) ) arg_3 = ( ( arg_3 / 100.0 ) * 2 ) - 1 arg_5 = arg_0 . _hextorgb ( arg_1 ) arg_6 = arg_0 . _hextorgb ( arg_2 ) arg_7 = 0 arg_8 = ( ( ( arg_3 if arg_3 * arg_7 == - 1 else arg_3 + arg_7 ) / ( 1 + arg_3 * arg_7 ) ) + 1 ) arg_8 = arg_8 / 2.0 arg_9 = 1 - arg_8 arg_10 = [ arg_5 [ 0 ] * arg_8 + arg_6 [ 0 ] * arg_9 , arg_5 [ 1 ] * arg_8 + arg_6 [ 1 ] * arg_9 , arg_5 [ 2 ] * arg_8 + arg_6 [ 2 ] * arg_9 , ] return arg_0 . _rgbatohex ( arg_10 ) raise ValueError ( 'Illegal color values' )

Print any parsing error and exit with status -1


Question: Put a package

def Func ( arg_0 , arg_1 ) : arg_0 . last_package_index += 1 arg_2 = arg_0 . last_package_index arg_3 = arg_0 . package_fullpath ( arg_2 ) with gzip . open ( arg_3 , 'wb' ) as f : pickle . dump ( arg_1 , f , protocol = pickle . HIGHEST_PROTOCOL ) f . close ( ) arg_4 = arg_0 . result_fullpath ( arg_2 ) arg_5 = os . path . dirname ( arg_4 ) alphatwirl . mkdir_p ( arg_5 ) return arg_2

Temporal distance probability density function.

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


Question: Execute the statement against Presto . Can be used to create views .

def Func ( arg_0 , arg_1 , arg_2 = None ) : return super ( ) . Func ( arg_0 . _strip_sql ( arg_1 ) , arg_2 )

Given a unicode string, will do its dandiest to give you back a
    valid ascii charset string you can use in, say, http headers and the
    like.


Question: Extract elements from an operation event and map to a named event .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( 'description' , '' ) arg_3 = google_base . parse_rfc3339_utc_string ( arg_1 . get ( 'timestamp' , '' ) ) for arg_4 , arg_5 in _EVENT_REGEX_MAP . items ( ) : arg_6 = arg_5 . match ( arg_2 ) if arg_6 : return { 'name' : arg_4 , 'start-time' : arg_3 } , arg_6 return { 'name' : arg_2 , 'start-time' : arg_3 } , None

The speed limit for a boid.

        Boids can momentarily go very fast,
        something that is impossible for real animals.


Question: Read the next frame .

def Func ( arg_0 ) : if arg_0 . _cache : arg_1 = arg_0 . _cache . get ( arg_0 . _position ) if arg_1 is not None : arg_2 = True else : if arg_0 . _position != arg_0 . _get_real_position ( ) : arg_0 . _set_real_position ( arg_0 . _position ) arg_2 , arg_1 = arg_0 . _vcap . Func ( ) if arg_2 : arg_0 . _cache . put ( arg_0 . _position , arg_1 ) else : arg_2 , arg_1 = arg_0 . _vcap . Func ( ) if arg_2 : arg_0 . _position += 1 return arg_1

Remove hidden notes and tag a CERN if detected.


Question: Scans String .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . reg arg_4 = arg_2 . mem . base arg_5 = arg_1 . size arg_6 = arg_1 . read ( ) arg_7 = arg_2 . read ( ) arg_8 = arg_6 - arg_7 arg_0 . _calculate_CMP_flags ( arg_5 , arg_8 , arg_6 , arg_7 ) arg_9 = Operators . ITEBV ( arg_0 . address_bit_size , arg_0 . DF , - arg_5 // 8 , arg_5 // 8 ) arg_0 . write_register ( arg_4 , arg_0 . read_register ( arg_4 ) + arg_9 )

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


Question: Loads a module s code and sets the module s expected hidden variables . For more information on these variables and what they are for please see PEP302 .

def Func ( arg_0 , arg_1 ) : if arg_1 != arg_0 . module_name : raise LoaderError ( 'Requesting a module that the loader is unaware of.' ) if arg_1 in arg_5 . modules : return arg_5 . modules [ arg_1 ] arg_2 = arg_0 . Func_py_path ( arg_1 , arg_0 . load_target ) if arg_0 . is_pkg : arg_2 . __path__ = [ arg_0 . module_path ] arg_2 . __package__ = arg_1 else : arg_2 . __package__ = arg_1 . rpartition ( '.' ) [ 0 ] arg_5 . modules [ arg_1 ] = arg_2 return arg_2

Provide a label for a list of labels.

    The items in the list of labels are assumed to be either instances of
    :class:`Label`, or dicts with at least the key `label` in them. These will
    be passed to the :func:`dict_to_label` function.

    This method tries to find a label by looking if there's
    a pref label for the specified language. If there's no pref label,
    it looks for an alt label. It disregards hidden labels.

    While matching languages, preference will be given to exact matches. But,
    if no exact match is present, an inexact match will be attempted. This might
    be because a label in language `nl-BE` is being requested, but only `nl` or
    even `nl-NL` is present. Similarly, when requesting `nl`, a label with
    language `nl-NL` or even `nl-Latn-NL` will also be considered,
    providing no label is present that has an exact match with the
    requested language.

    If language 'any' was specified, all labels will be considered,
    regardless of language.

    To find a label without a specified language, pass `None` as language.

    If a language or None was specified, and no label could be found, this
    method will automatically try to find a label in some other language.

    Finally, if no label could be found, None is returned.

    :param string language: The preferred language to receive the label in. This
        should be a valid IANA language tag.
    :param boolean sortLabel: Should sortLabels be considered or not? If True,
        sortLabels will be preferred over prefLabels. Bear in mind that these
        are still language dependent. So, it's possible to have a different
        sortLabel per language.
    :rtype: A :class:`Label` or `None` if no label could be found.


Question: Sample the dynamic latent prior .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : if arg_4 : arg_5 = 1 else : arg_5 = arg_2 arg_6 , arg_7 = arg_0 . dynamic_prior . zero_state ( [ arg_1 , arg_5 ] ) arg_8 = [ ] arg_9 = [ ] arg_10 = [ ] for arg_11 in range ( arg_3 ) : arg_12 , arg_7 = arg_0 . dynamic_prior ( arg_6 , arg_7 ) arg_6 = arg_12 . sample ( ) arg_8 . append ( arg_12 . parameters [ "loc" ] ) arg_9 . append ( arg_12 . parameters [ "scale_diag" ] ) arg_10 . append ( arg_6 ) arg_6 = tf . stack ( arg_10 , axis = 2 ) arg_13 = tf . stack ( arg_8 , axis = 2 ) arg_14 = tf . stack ( arg_9 , axis = 2 ) if arg_4 : arg_6 = arg_6 + tf . zeros ( [ arg_2 , 1 , 1 ] ) return arg_6 , tfd . MultivariateNormalDiag ( arg_13 = arg_13 , arg_14 = arg_14 )


Question: Returns a front ID which is the id of the offset front that contains the most overlap with offsets that correspond to the given onset front ID .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 : arg_5 , arg_6 = np . where ( arg_1 == arg_4 ) arg_7 = [ ( f , i ) for f , i in zip ( arg_5 , arg_6 ) ] arg_8 = len ( set ( arg_7 ) . symmetric_difference ( set ( arg_2 ) ) ) arg_3 . append ( ( arg_8 , arg_4 ) ) arg_9 , arg_10 = max ( arg_3 , key = lambda t : t [ 0 ] ) return int ( arg_10 )

Cycles through notifications with latest results from data feeds.


Question: Wait for the page region to load .

def Func ( arg_0 ) : arg_0 . wait . until ( lambda _ : arg_0 . loaded ) arg_0 . pm . hook . pypom_after_Func ( region = arg_0 ) return arg_0

This function creates the command list from available information


Question: Returns list of suggested spelling corrections for the given query .

def Func ( arg_0 , arg_1 = 10 , arg_2 = False , arg_3 = False ) : return YahooSpelling ( arg_0 , arg_1 , arg_2 , arg_3 )

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


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

def Func ( arg_0 ) : return ( spsp . isspmatrix_csc ( arg_0 ) or spsp . isspmatrix_csr ( arg_0 ) or spsp . isspmatrix_bsr ( arg_0 ) or spsp . isspmatrix_dia ( arg_0 ) )


Question: Undo a supposition and all inferences from it .

def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 : arg_0 . curr_domains [ arg_2 ] . append ( arg_3 )


Question: Return - 1 if infinite else return numofsecs .

def Func ( arg_0 ) : arg_1 = 0 arg_2 = arg_0 . split ( "," ) for arg_3 in arg_2 : arg_3 = arg_3 . strip ( ) if arg_3 . lower ( ) == "infinite" : return - 1 else : arg_4 = reSecondsReader . findall ( arg_3 ) for arg_5 in arg_4 : arg_1 = int ( arg_5 ) if arg_1 > MAX_FINITE_TIMEOUT_LIMIT : return - 1 if arg_1 != 0 : return arg_1 return None


Question: Extend gapfilling model .

def Func ( arg_0 , arg_1 = False , arg_2 = True ) : for arg_3 in arg_0 . universal . reactions : arg_3 . gapfilling_type = 'universal' arg_5 = arg_0 . universal . metabolites . query ( lambda metabolite : metabolite not in arg_0 . model . metabolites ) arg_0 . model . add_metabolites ( arg_5 ) arg_6 = [ ] for arg_3 in arg_0 . universal . boundary : arg_6 = arg_6 + [ arg_7 . id for arg_7 in list ( arg_3 . metabolites ) ] for arg_7 in arg_0 . model . metabolites : if arg_1 : if arg_7 . id not in arg_6 : arg_3 = arg_0 . universal . add_boundary ( arg_7 , type = 'exchange_smiley' , lb = - 1000 , ub = 0 , reaction_id = 'EX_{}' . format ( arg_7 . id ) ) arg_3 . gapfilling_type = 'exchange' if arg_2 : arg_3 = arg_0 . universal . add_boundary ( arg_7 , type = 'demand_smiley' , lb = 0 , ub = 1000 , reaction_id = 'DM_{}' . format ( arg_7 . id ) ) arg_3 . gapfilling_type = 'demand' arg_8 = arg_0 . universal . reactions . query ( lambda reaction : reaction not in arg_0 . model . reactions ) arg_0 . model . add_reactions ( arg_8 )

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

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


Question: Returns a color rotated on the artistic RYB color wheel .

Execute the enrich phase for a given backend section

    :param config: a Mordred config object
    :param backend_section: the backend section where the enrich phase is executed


Question: Create a new variant id .

def Func ( arg_0 , arg_1 ) : arg_2 = parse_document_id ( chrom = arg_0 [ 'chromosome' ] , pos = str ( arg_0 [ 'position' ] ) , ref = arg_0 [ 'reference' ] , alt = arg_0 [ 'alternative' ] , variant_type = arg_0 [ 'variant_type' ] , case_id = arg_1 , ) return arg_2

Checks if a Pong message was received.

        :return: