Question: Creates new instance .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = arg_9 . Instance . Type . TYPE_UNSPECIFIED , arg_13 = None , arg_14 = None , arg_15 = arg_9 . StorageType . STORAGE_TYPE_UNSPECIFIED , arg_18 = None ) : arg_15 = arg_9 . StorageType ( arg_15 ) arg_8 = arg_9 . Instance . Type ( arg_8 ) arg_19 = arg_10 ( arg_1 , arg_0 . _get_client ( arg_4 = arg_4 ) , arg_7 , arg_8 , arg_13 , ) arg_20 = [ arg_19 . cluster ( arg_2 , arg_3 , arg_14 , arg_15 ) ] if arg_5 and arg_6 : arg_20 . append ( arg_19 . cluster ( arg_5 , arg_6 , arg_14 , arg_15 ) ) arg_21 = arg_19 . create ( arg_20 = arg_20 ) arg_21 . result ( arg_18 ) return arg_19

Apply all filters to issues and pull requests.

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


Question: Specialized inversion sampler for 3D .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = seed_stream . SeedStream ( arg_2 , salt = 'von_mises_fisher_3d' ) arg_3 = tf . concat ( [ [ arg_1 ] , arg_0 . _batch_shape_tensor ( ) ] , axis = 0 ) arg_4 = tf . random . uniform ( arg_3 , arg_2 = arg_2 ( ) , dtype = arg_0 . dtype ) arg_5 = tf . where ( arg_0 . concentration > 0 , arg_0 . concentration , tf . ones_like ( arg_0 . concentration ) ) arg_6 = tf . where ( arg_4 > 0 , arg_4 , tf . ones_like ( arg_4 ) ) arg_7 = 1 + tf . reduce_logsumexp ( input_tensor = [ tf . math . log ( arg_6 ) , tf . math . log1p ( - arg_6 ) - 2 * arg_5 ] , axis = 0 ) / arg_5 arg_8 = tf . where ( arg_0 . concentration > tf . zeros_like ( arg_7 ) , arg_7 , 2 * arg_4 - 1 ) arg_8 = tf . where ( tf . equal ( arg_4 , 0 ) , - tf . ones_like ( arg_8 ) , arg_8 ) if not arg_0 . _allow_nan_stats : arg_8 = tf . debugging . check_numerics ( arg_8 , 'u in Func' ) return arg_8 [ ... , tf . newaxis ]

Indicates the start of a new sequence. Clears any predictions and makes sure
    synapses don't grow to the currently active cells in the next time step.


Question: Lists keys in a bucket under prefix and not containing delimiter

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = '' , arg_4 = None , arg_5 = None ) : arg_6 = { 'PageSize' : arg_4 , 'MaxItems' : arg_5 , } arg_7 = arg_0 . get_conn ( ) . get_paginator ( 'list_objects_v2' ) arg_8 = arg_7 . paginate ( Bucket = arg_1 , Prefix = arg_2 , Delimiter = arg_3 , PaginationConfig = arg_6 ) arg_9 = False arg_10 = [ ] for arg_11 in arg_8 : if 'Contents' in arg_11 : arg_9 = True for arg_12 in arg_11 [ 'Contents' ] : arg_10 . append ( arg_12 [ 'Key' ] ) if arg_9 : return arg_10

Wrapper method that calls the appropriate main updating methods of
        the inspection.

        It is meant to be used inside a loop (like while), so that it can
        continuously update the class attributes from the trace and log files.
        It already implements checks to parse these files only when they
        change, and they ignore entries that have been previously processes.


Question: given an ID and the dict of files generate a static html for that abf .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : arg_5 = arg_3 + "/swhlab4/%s_index.html" % arg_0 if arg_4 is False and os . path . exists ( arg_5 ) : return arg_6 = TEMPLATES [ 'abf' ] arg_6 = arg_6 . replace ( "~ID~" , arg_0 ) arg_6 = arg_6 . replace ( "~CONTENT~" , Funccontent ( arg_0 , arg_1 , arg_2 ) ) print ( " <- writing [%s]" % os . path . basename ( arg_5 ) ) with open ( arg_5 , 'w' ) as f : f . write ( arg_6 ) return

Processes a scheduled consumption request that has completed

        :type token: RequestToken
        :param token: The token associated to the consumption
            request that is used to identify the request.


Question: When a path has not been specified make the run directory .

def Func ( arg_0 ) : try : if not os . path . exists ( arg_0 ) : os . makedirs ( arg_0 ) arg_1 = glob ( os . path . join ( arg_0 , "[0-9]*" ) ) arg_2 = os . path . join ( arg_0 , '000' ) if arg_1 : arg_3 = sorted ( [ int ( os . path . basename ( arg_3 ) ) for arg_3 in arg_1 ] ) [ - 1 ] arg_2 = os . path . join ( arg_0 , '{0:03}' . format ( arg_3 + 1 ) ) os . makedirs ( arg_2 ) logger . debug ( "Parsl run initializing in rundir: {0}" . format ( arg_2 ) ) return os . path . abspath ( arg_2 ) except Exception as e : logger . error ( "Failed to create a run directory" ) logger . error ( "Error: {0}" . format ( e ) ) raise

initialize the merger model with a coalescent time

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


Question: Returns true iff this interval contains the interval i

def Func ( arg_0 , arg_1 ) : return arg_0 . start <= arg_1 . start and arg_1 . end <= arg_0 . end

Update the profile picture for the current user.

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


Question: Count the occurrences of operation names .

def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 . topological_op_nodes ( ) : arg_3 = arg_2 . name if arg_3 not in arg_1 : arg_1 [ arg_3 ] = 1 else : arg_1 [ arg_3 ] += 1 return arg_1

Scaling Draw Object

        :param x: 0.0 ~ 1.0
        :param y: 0.0 ~ 1.0


Question: format columned data so we can easily print it out on a console this just takes columns of data and it will format it into properly aligned columns it s not fancy but it works for most type of strings that I need it for like server name lists .

def Func ( * arg_0 , ** arg_1 ) : arg_2 = [ ] arg_3 = arg_1 . get ( 'prefix' , '' ) arg_4 = arg_1 . get ( 'buf_count' , 2 ) if len ( arg_0 ) == 1 : arg_0 = list ( arg_0 [ 0 ] ) else : arg_0 = list ( zip ( * arg_0 ) ) arg_5 = arg_1 . get ( "headers" , [ ] ) if arg_5 : arg_0 . insert ( 0 , arg_5 ) arg_6 = arg_1 . get ( "widths" , [ ] ) arg_7 = Counter ( ) for arg_8 in range ( len ( arg_6 ) ) : arg_7 [ arg_8 ] = int ( arg_6 [ arg_8 ] ) arg_9 = int ( arg_1 . get ( "width" , 0 ) ) for arg_10 in arg_0 : for arg_8 , arg_11 in enumerate ( arg_10 ) : if isinstance ( arg_11 , basestring ) : arg_12 = len ( arg_11 ) else : arg_12 = len ( str ( arg_11 ) ) if arg_12 > arg_7 [ arg_8 ] : arg_7 [ arg_8 ] = arg_12 arg_9 = int ( arg_1 . get ( "width" , 0 ) ) if arg_9 : for arg_8 in arg_7 : if arg_7 [ arg_8 ] < arg_9 : arg_7 [ arg_8 ] = arg_9 def colstr ( arg_11 ) : if isinstance ( arg_11 , basestring ) : return arg_11 return str ( arg_11 ) def rowstr ( arg_10 , arg_3 , arg_7 ) : arg_13 = arg_3 arg_14 = list ( map ( colstr , arg_10 ) ) for arg_8 in range ( len ( arg_7 ) ) : arg_11 = arg_14 [ arg_8 ] if re . match ( r"^\d+(?:\.\d+)?$" , arg_11 ) : if arg_8 == 0 : arg_13 += "{:>" + str ( arg_7 [ arg_8 ] ) + "}" else : arg_13 += "{:>" + str ( arg_7 [ arg_8 ] + arg_4 ) + "}" else : arg_13 += "{:<" + str ( arg_7 [ arg_8 ] + arg_4 ) + "}" return arg_13 . format ( * arg_14 ) for arg_10 in arg_0 : arg_2 . append ( rowstr ( arg_10 , arg_3 , arg_7 ) ) out ( os . linesep . join ( arg_2 ) )

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: Update the external tool identified by external_tool_id with the passed json data .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_1 . format ( arg_2 ) + "/external_tools/{}" . format ( arg_3 ) return arg_0 . _put_resource ( arg_5 , body = arg_4 )

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: Given a lib2to3 node return its string representation .

def Func ( arg_0 , * , arg_1 = False ) : arg_2 = str ( arg_0 ) if arg_1 : from retype_hgext import apply_job_security arg_2 = apply_job_security ( arg_2 ) return arg_2

Stop streaming samples from device and delete samples buffer


Question: Creates a course enrollment for an EnterpriseCustomerUser .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_object ( ) arg_4 = serializers . EnterpriseCustomerCourseEnrollmentsSerializer ( data = arg_1 . data , many = True , context = { 'enterprise_customer' : arg_3 , 'request_user' : arg_1 . user , } ) if arg_4 . is_valid ( ) : arg_4 . save ( ) return Response ( arg_4 . data , status = HTTP_200_OK ) return Response ( arg_4 . errors , status = HTTP_400_BAD_REQUEST )

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


Question: Generates a jobs_pending progress bar widget .

def Func ( ) : arg_0 = widgets . IntProgress ( arg_6 = 0 , min = 0 , max = 50 , description = '' , orientation = 'horizontal' , layout = widgets . Layout ( max_width = '180px' ) ) arg_0 . style . bar_color = '#71cddd' arg_3 = widgets . Label ( arg_6 = str ( arg_0 . value ) , layout = widgets . Layout ( min_width = 'auto' ) ) arg_4 = widgets . Label ( arg_6 = str ( arg_0 . max ) , layout = widgets . Layout ( min_width = 'auto' ) ) def _on_max_change ( arg_5 ) : arg_4 . value = str ( arg_5 [ 'new' ] ) def _on_val_change ( arg_5 ) : arg_3 . value = str ( arg_5 [ 'new' ] ) arg_0 . observe ( _on_max_change , names = 'max' ) arg_0 . observe ( _on_val_change , names = 'value' ) arg_7 = widgets . HBox ( [ arg_3 , arg_0 , arg_4 ] , layout = widgets . Layout ( max_width = '250px' , min_width = '250px' , justify_content = 'center' ) ) return arg_7

Run stochastic volatility model.

    This model estimates the volatility of a returns series over time.
    Returns are assumed to be T-distributed. lambda (width of
    T-distributed) is assumed to follow a random-walk.

    Parameters
    ----------
    data : pandas.Series
        Return series to model.
    samples : int, optional
        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: Create a new alert

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = { 'rate_count' : arg_2 or 1 , 'rate_range' : arg_3 or 'hour' , 'limit_count' : arg_4 or 1 , 'limit_range' : arg_5 or 'hour' , 'schedule' : [ ] , 'enabled' : True , } arg_6 . update ( arg_1 . args ( ) ) return arg_0 . _post ( request = ApiActions . CREATE . value , uri = ApiUri . ACTIONS . value , params = arg_6 )

Output some information on CUDA-enabled devices on your computer,
    including current memory usage. Modified to only get number of devices.

    It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1
    from C to Python with ctypes, so it can run without compiling
    anything. Note that this is a direct translation with no attempt to
    make the code Pythonic. It's meant as a general demonstration on how
    to obtain CUDA device information from Python without resorting to
    nvidia-smi or a compiled Python extension.

    .. note:: Author: Jan Schlüter, https://gist.github.com/63a664160d016a491b2cbea15913d549.git


Question: possible hvac modes are auto auxHeatOnly cool heat off

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { "selection" : { "selectionType" : "thermostats" , "selectionMatch" : arg_0 . thermostats [ arg_1 ] [ 'identifier' ] } , "thermostat" : { "settings" : { "hvacMode" : arg_2 } } } arg_4 = "set HVAC mode" return arg_0 . make_request ( arg_3 , arg_4 )

Most of this method is from ``docutils.parser.rst.Directive``.

        docutils version: 0.12


Question: Register filters for Jinja to use

def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . _filters : if not arg_2 : arg_0 . app . jinja_env . filters [ arg_1 . replace ( "f_" , "" ) ] = getattr ( flask_nemo . filters , arg_1 ) else : arg_0 . app . jinja_env . filters [ arg_1 . replace ( "f_" , "" ) ] = getattr ( arg_2 , arg_1 . replace ( "_{}" . format ( arg_2 . name ) , "" ) )

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

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

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


Question: Independant Kaiser window

def Func ( arg_0 , arg_1 ) : from scipy . special import iv as besselI arg_2 = arg_0 - 1 arg_3 = arange ( 0 , arg_2 ) arg_3 = 2. * arg_1 / arg_2 * sqrt ( arg_3 * ( arg_2 - arg_3 ) ) arg_4 = besselI ( 0 , arg_3 ) / besselI ( 0 , arg_1 ) return arg_4

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


Question: process a normal line and check whether it is the start of a new block

def Func ( arg_0 , arg_1 ) : for arg_2 in re_source_block_formats : if arg_2 . start . match ( arg_1 ) : arg_0 . add_block_lines ( ) arg_0 . format = arg_2 arg_0 . lineno = fileinput . filelineno ( ) arg_0 . lines . append ( arg_1 )

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


Question: Waits until the result set changes . Possible changes can be a result being added or the result set becoming complete . If the result set is already completed this method returns immediately .

async def Func ( arg_0 ) : if not arg_0 . is_complete ( ) : arg_1 = arg_0 . _loop . create_future ( ) arg_0 . _waiters . append ( arg_1 ) await arg_1


Question: r Calculate an alternative distance matrix based on the following equation .

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 ] ) -> arg_1 [ arg_2 , arg_1 [ arg_2 , float ] ] : arg_4 = set ( itt . chain . from_iterable ( arg_0 . values ( ) ) ) arg_5 = len ( arg_4 ) arg_6 : Dict [ arg_2 , Dict [ arg_2 , float ] ] = defaultdict ( dict ) for arg_7 , arg_8 in itt . combinations ( arg_0 , 2 ) : arg_6 [ arg_7 ] [ arg_8 ] = arg_6 [ arg_8 ] [ arg_7 ] = 1.0 - len ( arg_0 [ arg_7 ] | arg_0 [ arg_8 ] ) / arg_5 for arg_7 in arg_0 : arg_6 [ arg_7 ] [ arg_7 ] = 1.0 - len ( arg_7 ) / arg_5 return dict ( arg_6 )

Return a list of all enrollments for the passed section_id.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index


Question: Return token s remaining API points

def Func ( arg_0 , arg_1 ) : arg_2 = urijoin ( arg_0 . base_url , "rate_limit" ) arg_0 . session . headers . update ( { 'Authorization' : 'token ' + arg_1 } ) arg_3 = 0 try : arg_4 = super ( ) . fetch ( arg_2 ) . headers if arg_0 . rate_limit_header in arg_4 : arg_3 = int ( arg_4 [ arg_0 . rate_limit_header ] ) except requests . exceptions . HTTPError as error : logger . warning ( "Rate limit not initialized: %s" , error ) return arg_3

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

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


Question: Return True if filename is Python file .

def Func ( arg_0 ) : if arg_0 . endswith ( '.py' ) : return True try : with open_with_encoding ( arg_0 , None , limit_byte_check = MAX_PYTHON_FILE_DETECTION_BYTES ) as f : arg_1 = f . read ( MAX_PYTHON_FILE_DETECTION_BYTES ) if not arg_1 : return False arg_2 = arg_1 . splitlines ( ) [ 0 ] except ( IOError , IndexError ) : return False if not PYTHON_SHEBANG_REGEX . match ( arg_2 ) : return False return True


Question: Configure the MetricRegistry .

def Func ( arg_0 , arg_1 : arg_2 = False ) : if arg_1 : arg_0 . registry . register_additional_collector ( ProcessCollector ( registry = None ) )

Implement a lookup for object level permissions. Basically the same as
        ModelAdmin.has_delete_permission, but also passes the obj parameter in.


Question: Perform the bulk of the work of collectmedia .

def Func ( arg_0 ) : if arg_0 . symlink and not arg_0 . local : raise CommandError ( "Can't symlink to a remote destination." ) if arg_0 . clear : arg_0 . clear_dir ( '' ) if arg_0 . symlink : arg_1 = arg_0 . link_file else : arg_1 = arg_0 . copy_file arg_2 = OrderedDict ( ) for arg_3 in get_finders ( ) : for arg_4 , arg_5 in arg_3 . list ( arg_0 . ignore_patterns ) : if getattr ( arg_5 , 'prefix' , None ) : arg_6 = os . path . join ( arg_5 . prefix , arg_4 ) else : arg_6 = arg_4 if arg_6 not in arg_2 : arg_2 [ arg_6 ] = ( arg_5 , arg_4 ) arg_1 ( arg_4 , arg_6 , arg_5 ) if arg_0 . post_process and hasattr ( arg_0 . storage , 'post_process' ) : arg_7 = arg_0 . storage . post_process ( arg_2 , dry_run = arg_0 . dry_run ) for arg_8 , arg_9 , arg_10 in arg_7 : if isinstance ( arg_10 , Exception ) : arg_0 . stderr . write ( "Post-processing '%s' failed!" % arg_8 ) arg_0 . stderr . write ( "" ) raise arg_10 if arg_10 : arg_0 . log ( "Post-processed '%s' as '%s'" % ( arg_8 , arg_9 ) , level = 1 ) arg_0 . post_processed_files . append ( arg_8 ) else : arg_0 . log ( "Skipped post-processing '%s'" % arg_8 ) return { 'modified' : arg_0 . copied_files + arg_0 . symlinked_files , 'unmodified' : arg_0 . unmodified_files , 'post_processed' : arg_0 . post_processed_files , }


Question: Waits for the call is accepted by workers and starts to collect the results .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = 0 arg_7 = 0 arg_8 = [ ] arg_9 = arg_0 . result_queues [ arg_1 ] try : with Timeout ( arg_2 , False ) : while True : arg_10 = arg_9 . get ( ) if arg_10 is None : arg_6 += 1 if arg_4 is not None : if arg_7 == arg_5 : break arg_4 ( ) arg_7 += 1 continue arg_8 . append ( arg_10 ) if len ( arg_8 ) == arg_3 : break finally : del arg_9 arg_0 . remove_result_queue ( arg_1 ) if not arg_8 : if arg_6 : raise Rejected ( '%d workers rejected' % arg_6 if arg_6 != 1 else 'A worker rejected' ) else : raise WorkerNotFound ( 'failed to find worker' ) return arg_8

load the configuration information from the target hierarchy


Question: Update the simulator to a specific frame of marker data .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . markers . detach ( ) arg_0 . markers . reposition ( arg_1 ) arg_0 . markers . attach ( arg_1 ) arg_0 . ode_space . collide ( None , arg_0 . on_collision ) arg_3 = arg_0 . skeleton . get_body_states ( ) arg_0 . skeleton . set_body_states ( arg_3 ) yield arg_3 arg_0 . ode_world . step ( arg_2 or arg_0 . dt ) arg_0 . ode_contactgroup . empty ( )

Verify course ID and retrieve course details.


Question: Sign in user .

def Func ( arg_0 , arg_1 = True ) : arg_2 . permanent = arg_1 arg_2 [ 'user_id' ] = arg_0 . id


Question: Get the Channel Id from the current Activity on the Turn Context .

def Func ( arg_0 : arg_1 ) -> str : if arg_0 . activity . channel_id is None : return "" else : return arg_0 . activity . channel_id

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

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


Question: Construct a layout . SHOULD BE PRIVATE

def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 ( arg_1 . drivers , maker = arg_1 . maker , ** arg_2 )

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


Question: Does this schedule include the provided time? query_date and query_time are date and time objects interpreted in this schedule s timezone

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_0 . start_date and arg_1 < arg_0 . start_date : return False if arg_0 . end_date and arg_1 > arg_0 . end_date : return False if arg_1 . weekday ( ) not in arg_0 . weekdays : return False if not arg_2 : return True if arg_2 >= arg_0 . period . start and arg_2 <= arg_0 . period . end : return True return False

Release the semaphore

        :param tag: A tag identifying what is releasing the semaphore
        :param acquire_token:  The token returned from when the semaphore was
            acquired. Note that this is not really needed to directly use this
            class but is needed for API compatibility with the
            SlidingWindowSemaphore implementation.


Question: Performs local inhibition . Local inhibition is performed on a column by column basis . Each column observes the overlaps of its neighbors and is selected if its overlap score is within the top numActive in its local neighborhood . 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 .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = numpy . zeros ( arg_0 . _numColumns , dtype = "bool" ) for arg_4 , arg_5 in enumerate ( arg_1 ) : if arg_5 >= arg_0 . _stimulusThreshold : arg_6 = arg_0 . _getColumnNeighborhood ( arg_4 ) arg_7 = arg_1 [ arg_6 ] arg_8 = numpy . count_nonzero ( arg_7 > arg_5 ) arg_9 = numpy . where ( arg_7 == arg_5 ) arg_10 = arg_6 [ arg_9 ] arg_11 = numpy . count_nonzero ( arg_3 [ arg_10 ] ) arg_12 = int ( 0.5 + arg_2 * len ( arg_6 ) ) if arg_8 + arg_11 < arg_12 : arg_3 [ arg_4 ] = True return arg_3 . nonzero ( ) [ 0 ]

Returns protobuf mapcontainer. Read from translation file.


Question: Save ID3v2 data to the AIFF file

def Func ( arg_0 , arg_1 = None , arg_2 = 4 , arg_3 = '/' ) : arg_4 = arg_0 . _prepare_framedata ( arg_2 , arg_3 ) arg_5 = len ( arg_4 ) if arg_1 is None : arg_1 = arg_0 . filename arg_6 = open ( arg_1 , 'rb+' ) arg_7 = IFFFile ( arg_6 ) try : if u'ID3' not in arg_7 : arg_7 . insert_chunk ( u'ID3' ) arg_8 = arg_7 [ u'ID3' ] arg_6 . seek ( arg_8 . data_offset ) arg_9 = arg_6 . read ( 10 ) arg_9 = arg_0 . _prepare_id3_header ( arg_9 , arg_5 , arg_2 ) arg_9 , arg_10 , arg_11 = arg_9 arg_12 = arg_9 + arg_4 + ( b'\x00' * ( arg_10 - arg_5 ) ) arg_10 += 10 if arg_10 > arg_8 . size : arg_13 = arg_8 . offset + arg_8 . size arg_14 = arg_10 - arg_8 . size + arg_10 % 2 insert_bytes ( arg_6 , arg_14 , arg_13 ) arg_8 . resize ( arg_10 ) arg_6 . seek ( arg_8 . data_offset ) arg_6 . write ( arg_12 ) finally : arg_6 . close ( )

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: return the signed string with token .

def Func ( arg_0 , arg_1 , arg_2 ) : return 'WRAP access_token="' + arg_0 . _get_token ( arg_1 . host , arg_1 . path , arg_2 ) + '"'

Selects an open lswitch for a network.

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


Question: Validate data and return a iterator over problems found .

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = 0 , arg_4 = False , arg_5 = None , arg_6 = True ) : arg_7 = arg_0 . _init_unique_sets ( ) for arg_8 , arg_9 in enumerate ( arg_1 ) : if arg_2 and arg_8 == arg_3 : for arg_10 in arg_0 . _apply_header_checks ( arg_8 , arg_9 , arg_4 , arg_5 ) : yield arg_10 elif arg_8 >= arg_3 : arg_11 = False for arg_10 in arg_0 . _apply_skips ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : if arg_10 is True : arg_11 = True else : yield arg_10 if not arg_11 : for arg_10 in arg_0 . _apply_each_methods ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_value_checks ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_record_length_checks ( arg_8 , arg_9 , arg_4 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_value_predicates ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_record_checks ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_record_predicates ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_unique_checks ( arg_8 , arg_9 , arg_7 , arg_4 ) : yield arg_10 for arg_10 in arg_0 . _apply_check_methods ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_assert_methods ( arg_8 , arg_9 , arg_4 , arg_6 , arg_5 ) : yield arg_10 for arg_10 in arg_0 . _apply_finally_assert_methods ( arg_4 , arg_6 , arg_5 ) : yield arg_10


Question: Wait for the page to load .

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

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


Question: Retrieve database hook . This is the actual Postgres or MySQL database hook that uses proxy or connects directly to the Google Cloud SQL database .

def Func ( arg_0 ) : if arg_0 . database_type == 'postgres' : arg_0 . db_hook = PostgresHook ( postgres_conn_id = arg_0 . db_conn_id , schema = arg_0 . database ) else : arg_0 . db_hook = MySqlHook ( mysql_conn_id = arg_0 . db_conn_id , schema = arg_0 . database ) return arg_0 . db_hook

Main executor of the trimmomatic_report template.

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


Question: List all files from all storages for project .

def Func ( arg_0 ) : arg_1 = _setup_osf ( arg_0 ) arg_2 = arg_1 . project ( arg_0 . project ) for arg_3 in arg_2 . storages : arg_4 = arg_3 . name for arg_5 in arg_3 . files : arg_6 = arg_5 . path if arg_6 . startswith ( '/' ) : arg_6 = arg_6 [ 1 : ] print ( os . path . join ( arg_4 , arg_6 ) )

Given a dictionary mapping unique keys to amino acid sequences,
        run MHC binding predictions on all candidate epitopes extracted from
        sequences and return a EpitopeCollection.

        Parameters
        ----------
        fasta_dictionary : dict or string
            Mapping of protein identifiers to protein amino acid sequences.
            If string then converted to dictionary.


Question: Wrap an existing distribution as a traceable random variable .

def Func ( arg_0 , arg_1 = ( ) , arg_2 = None ) : return _build_custom_rv ( arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , name = _simple_name ( arg_0 ) )

Decodes an encoded 7-bit ASCII header value into it's actual value.


Question: Caches the HTML returned by the specified function func . Caches it in the user cache determined by the appdirs package .

def Func ( arg_0 ) : arg_1 = appdirs . user_Func_dir ( 'sportsref' , getpass . getuser ( ) ) if not os . path . isdir ( arg_1 ) : os . makedirs ( arg_1 ) @ funcutils . wraps ( arg_0 ) def wrapper ( arg_2 ) : arg_3 = hashlib . md5 ( ) arg_4 = arg_2 . encode ( errors = 'replace' ) arg_3 . update ( arg_4 ) arg_3 = arg_3 . hexdigest ( ) arg_5 = '{}/{}' . format ( arg_1 , arg_3 ) arg_6 = None for arg_7 , arg_8 in sportsref . SITE_ABBREV . items ( ) : if arg_2 . startswith ( arg_7 ) : arg_6 = arg_8 break else : print ( 'No sport ID found for {}, not able to check Func' . format ( arg_2 ) ) arg_9 = os . path . isfile ( arg_5 ) if arg_6 and arg_9 : arg_10 = int ( time . time ( ) ) arg_11 = int ( os . path . getmtime ( arg_5 ) ) arg_12 = datetime . timedelta ( seconds = ( arg_10 - arg_11 ) ) . days arg_13 = globals ( ) [ '_days_valid_{}' . format ( arg_6 ) ] ( arg_2 ) arg_14 = arg_12 < arg_13 else : arg_14 = False arg_15 = sportsref . get_option ( 'Func' ) if arg_9 and arg_14 and arg_15 : with codecs . open ( arg_5 , 'r' , encoding = 'utf-8' , errors = 'replace' ) as f : arg_16 = f . read ( ) else : arg_16 = arg_0 ( arg_2 ) with codecs . open ( arg_5 , 'w+' , encoding = 'utf-8' ) as f : f . write ( arg_16 ) return arg_16 return wrapper

Propagate negative reset "rst_n" signal
    to all subcomponents


Question: Check for presence of mutually exclusive keys in a dict .

def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 : if arg_2 in arg_0 and arg_3 in arg_0 : raise ValueError , '\n*** ERROR in Arguments *** ' 'Options ' + arg_2 + ' and ' + arg_3 + ' are mutually exclusive.'

Return list of GATT characteristics that have been discovered for this
        service.


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

def Func ( arg_0 ) : with tempfile . NamedTemporaryFile ( 'w' ) as f : for arg_1 in arg_0 : f . write ( json . dumps ( arg_1 . to_dict ( include_meta = True ) , default = datetime_handler ) ) f . write ( '\n' ) f . flush ( ) print_success ( "Starting editor" ) subprocess . call ( [ 'nano' , '-' , f . name ] ) with open ( f . name , 'r' ) as f : return f . readlines ( )

This method takes a list of labels and returns a unique category number.
    This enables this class to store a list of categories for each point since
    the KNN classifier only stores a single number category for each record.


Question: This is a parallel worker for running period - recovery .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = arg_0 try : return periodicvar_recovery ( arg_1 , arg_2 , arg_3 = arg_3 ) except Exception as e : LOGEXCEPTION ( 'periodic var recovery failed for %s' % repr ( arg_0 ) ) return None

Read the value of the Boolean object from the input stream.

        Args:
            istream (Stream): A buffer containing the encoded bytes of the
                value of a Boolean object. Usually a BytearrayStream object.
                Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: if the read boolean value is not a 0 or 1.


Question: Log message optionally providing a logging level

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_3 = Funcging . INFO else : if arg_2 == "trace" or arg_2 == "debug" : arg_3 = Funcging . DEBUG elif arg_2 == "info" : arg_3 = Funcging . INFO elif arg_2 == "warn" : arg_3 = Funcging . WARNING elif arg_2 == "error" : arg_3 = Funcging . ERROR else : raise ValueError ( "%s is not supported as Funcging level" % str ( arg_2 ) ) arg_0 . Funcger . Func ( arg_3 , arg_1 )

Write the index.html file for this report.


Question: Get the number of factor levels for each categorical column .

def Func ( arg_0 ) : arg_1 = arg_0 . levels ( ) return [ len ( arg_2 ) for arg_2 in arg_1 ] if arg_1 else 0

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


Question: Check the syntax of the given URL .

def Func ( arg_0 ) : if arg_0 and isinstance ( arg_0 , str ) : load_config ( True ) return Check ( arg_0 ) . is_url_valid ( ) return None

reads and returns the waveform vlr header, waveform record


Question: Makes a function which applies a list of Bijectors log_det_jacobian s .

def Func ( arg_0 ) : if not mcmc_util . is_list_like ( arg_0 ) : arg_0 = [ arg_0 ] def fn ( arg_1 , arg_2 ) : return sum ( [ arg_3 . forward_log_det_jacobian ( arg_5 , arg_2 = arg_4 ) for arg_3 , arg_4 , arg_5 in zip ( arg_0 , arg_2 , arg_1 ) ] ) return fn

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: Destructively rips this element out of the tree .

def Func ( arg_0 ) : if arg_0 . parent : try : arg_0 . parent . contents . remove ( arg_0 ) except ValueError : pass arg_1 = arg_0 . _lastRecursiveChild ( ) arg_2 = arg_1 . next if arg_0 . previous : arg_0 . previous . next = arg_2 if arg_2 : arg_2 . previous = arg_0 . previous arg_0 . previous = None arg_1 . next = None arg_0 . parent = None if arg_0 . previousSibling : arg_0 . previousSibling . nextSibling = arg_0 . nextSibling if arg_0 . nextSibling : arg_0 . nextSibling . previousSibling = arg_0 . previousSibling arg_0 . previousSibling = arg_0 . nextSibling = None return arg_0

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

        The create key operation can be used to create any key type in Azure
        Key Vault. If the named key already exists, Azure Key Vault creates a
        new version of the key. It requires the keys/create permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param key_name: The name for the new key. The system will generate
         the version name for the new key.
        :type key_name: str
        :param kty: The type of key to create. For valid values, see
         JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA',
         'RSA-HSM', 'oct'
        :type kty: str or ~azure.keyvault.v2016_10_01.models.JsonWebKeyType
        :param key_size: The key size in bits. For example: 2048, 3072, or
         4096 for RSA.
        :type key_size: int
        :param key_ops:
        :type key_ops: list[str or
         ~azure.keyvault.v2016_10_01.models.JsonWebKeyOperation]
        :param key_attributes:
        :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, str]
        :param curve: Elliptic curve name. For valid values, see
         JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384',
         'P-521', 'SECP256K1'
        :type curve: str or
         ~azure.keyvault.v2016_10_01.models.JsonWebKeyCurveName
        :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: KeyBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`


Question: Starts HTTP server with specified parameters .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = functools . partial ( StatsHandler , arg_2 ) if not arg_4 : arg_6 . stderr = open ( os . devnull , 'w' ) print ( 'Starting HTTP server...' ) if not arg_3 : webbrowser . open ( 'http://{}:{}/' . format ( arg_0 , arg_1 ) ) try : StatsServer ( ( arg_0 , arg_1 ) , arg_5 ) . serve_forever ( ) except KeyboardInterrupt : print ( 'Stopping...' ) arg_6 . exit ( 0 )

Add members found in prior versions up till the next major release

    These members are to be considered deprecated. When a new major
    release is made, these members are removed.


Question: Updates an Event Hub .

def Func ( arg_0 , arg_1 , arg_2 = None ) : _validate_not_none ( 'hub_name' , arg_1 ) arg_3 = HTTPRequest ( ) arg_3 . method = 'PUT' arg_3 . host = arg_0 . _get_host ( ) arg_3 . path = '/' + _str ( arg_1 ) + '?api-version=2014-01' arg_3 . body = _get_request_body ( _convert_event_hub_to_xml ( arg_2 ) ) arg_3 . path , arg_3 . query = arg_0 . _httpclient . _update_request_uri_query ( arg_3 ) arg_3 . headers . append ( ( 'If-Match' , '*' ) ) arg_3 . headers = arg_0 . _update_service_bus_header ( arg_3 ) arg_10 = arg_0 . _perform_request ( arg_3 ) return _convert_response_to_event_hub ( arg_10 )

Get a temp filename for atomic download.


Question: Creates new or follows existing group nodes along a given colon separated key .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_3 = arg_0 . _trajectory_group else : arg_3 = arg_2 arg_4 = False if arg_1 == '' : return arg_3 , arg_4 arg_5 = arg_1 . split ( '.' ) for arg_6 in arg_5 : arg_3 , arg_4 = arg_0 . _all_create_or_get_group ( arg_6 , arg_3 ) return arg_3 , arg_4

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

        Based on the instructions from:

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


Question: Returns all valid python strings inside a given argument string .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in ast . walk ( ast . parse ( arg_0 ) ) : if isinstance ( arg_2 , ast . Str ) : arg_1 . append ( arg_2 . s ) return arg_1

Print out stats about how files are getting processed.

        :param known_file_paths: a list of file paths that may contain Airflow
            DAG definitions
        :type known_file_paths: list[unicode]
        :return: None


Question: Calcul du profil annuel

def Func ( arg_0 , arg_1 = 'mean' ) : arg_1 = _get_funky ( arg_1 ) arg_2 = arg_0 . groupby ( lambda x : x . month ) . aggregate ( arg_1 ) arg_2 . index = [ cal . month_name [ i ] for i in range ( 1 , 13 ) ] return arg_2

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


Question: Processes a scheduled consumption request that has completed

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _tokens_to_scheduled_consumption . pop ( arg_1 ) arg_0 . _total_wait = max ( arg_0 . _total_wait - arg_2 [ 'time_to_consume' ] , 0 )

Concatenate multiple videos into a single one.

    Args:
        video_list (list): A list of video filenames
        out_file (str): Output video filename
        vcodec (None or str): Output video codec, None for unchanged
        acodec (None or str): Output audio codec, None for unchanged
        log_level (str): Logging level of ffmpeg.
        print_cmd (bool): Whether to print the final ffmpeg command.


Question: Return a full path to a notebook given its name .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 + arg_0 . filename_ext arg_3 = os . path . join ( arg_0 . notebook_dir , arg_2 ) return arg_3

Whether a connection can be established between those two meshes.


Question: Get the document short title in the specified markup format .

def Func ( arg_0 , arg_1 = 'html5' , arg_2 = True , arg_3 = False , arg_4 = True , arg_5 = None ) : if arg_0 . short_title is None : return None arg_6 = convert_lsstdoc_tex ( arg_0 . short_title , 'html5' , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 ) return arg_6

Perform a rachted step, calculating a new shared secret from the public key and
        deriving new chain keys from this secret.

        New Diffie-Hellman calculations are only performed if the public key is different
        from the previous one.

        :param other_pub: A bytes-like object encoding the public key of the other
            Diffie-Hellman ratchet to synchronize with.


Question: Parse the header from the tasks file into env input output definitions .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 : arg_5 = '--env' arg_6 = arg_4 if arg_4 . startswith ( '-' ) : arg_5 , arg_6 = split_pair ( arg_4 , ' ' , 1 ) if arg_5 == '--env' : arg_3 . append ( job_model . EnvParam ( arg_6 ) ) elif arg_5 == '--label' : arg_3 . append ( job_model . LabelParam ( arg_6 ) ) elif arg_5 == '--input' or arg_5 == '--input-recursive' : arg_7 = arg_1 . get_variable_name ( arg_6 ) arg_3 . append ( job_model . InputFileParam ( arg_7 , recursive = ( arg_5 . endswith ( 'recursive' ) ) ) ) elif arg_5 == '--output' or arg_5 == '--output-recursive' : arg_7 = arg_2 . get_variable_name ( arg_6 ) arg_3 . append ( job_model . OutputFileParam ( arg_7 , recursive = ( arg_5 . endswith ( 'recursive' ) ) ) ) else : raise ValueError ( 'Unrecognized column header: %s' % arg_4 ) return arg_3


Question: Call up the pdb debugger if desired always clean up the tb reference .

def Func ( arg_0 , arg_1 = False ) : if arg_1 or arg_0 . call_pdb : if arg_0 . pdb is None : arg_0 . pdb = Func . Pdb ( arg_0 . color_scheme_table . active_scheme_name ) arg_3 = DisplayTrap ( hook = sys . __displayhook__ ) with arg_3 : arg_0 . pdb . reset ( ) if hasattr ( arg_0 , 'tb' ) and arg_0 . tb is not None : arg_4 = arg_0 . tb else : arg_4 = arg_0 . tb = sys . last_traceback while arg_0 . tb is not None and arg_0 . tb . tb_next is not None : arg_0 . tb = arg_0 . tb . tb_next if arg_4 and arg_4 . tb_next : arg_4 = arg_4 . tb_next arg_0 . pdb . botframe = arg_4 . tb_frame arg_0 . pdb . interaction ( arg_0 . tb . tb_frame , arg_0 . tb ) if hasattr ( arg_0 , 'tb' ) : del arg_0 . tb

Retrieve public information about a user.

        Args:
            id (str): user identifier to lookup

        Returns:
            SkypeUser: resulting user object


Question: Create a new project .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : try : arg_3 = arg_3 . split ( ',' ) if arg_3 else None arg_6 = dict ( arg_1 = arg_1 , arg_2 = arg_2 , is_public = not arg_4 , arg_3 = arg_3 ) arg_7 = ProjectConfig . from_dict ( arg_6 ) except ValidationError : Printer . print_error ( 'Project name should contain only alpha numerical, "-", and "_".' ) sys . exit ( 1 ) try : arg_8 = PolyaxonClient ( ) . project . Func_project ( arg_7 ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func project `{}`.' . format ( arg_1 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) Printer . print_success ( "Project `{}` was Funcd successfully." . format ( arg_8 . name ) ) if arg_5 : arg_0 . obj = { } arg_0 . invoke ( init_project , project = arg_1 )

Dump a certificate revocation list to a buffer.

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

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


Question: Shows a call tip if appropriate at the current cursor location .

def Func ( arg_0 ) : if not arg_0 . enable_calltips : return False arg_1 = arg_0 . _get_cursor ( ) arg_1 . movePosition ( QtGui . QTextCursor . Left ) if arg_1 . document ( ) . characterAt ( arg_1 . position ( ) ) != '(' : return False arg_2 = arg_0 . _get_context ( arg_1 ) if not arg_2 : return False arg_3 = '.' . join ( arg_2 ) arg_4 = arg_0 . kernel_manager . shell_channel . object_info ( arg_3 ) arg_5 = arg_0 . _get_cursor ( ) . position ( ) arg_0 . _request_info [ 'call_tip' ] = arg_0 . _CallTipRequest ( arg_4 , arg_5 ) return True

Remove groups from the model.

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

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


Question: Return packed bytes representation of StreamItem kvlayer key . The result is 20 bytes 16 of md5 hash 4 of int timestamp .

def Func ( arg_0 ) : if len ( arg_0 [ 0 ] ) != 16 : raise ValueError ( 'bad StreamItem key, expected 16 byte ' 'md5 hash binary digest, got: {0!r}' . format ( arg_0 ) ) return struct . pack ( '>16si' , arg_0 [ 0 ] , arg_0 [ 1 ] )


Question: Parse args from command line by creating argument parser instance and process it .

def Func ( arg_0 ) : from argparse import ArgumentParser arg_1 = ( 'Bootstrap Python projects and libraries with virtualenv ' 'and pip.' ) arg_2 = ArgumentParser ( arg_1 = arg_1 ) arg_2 . add_argument ( '--version' , action = 'version' , version = __version__ ) arg_2 . add_argument ( '-c' , '--config' , default = DEFAULT_CONFIG , help = 'Path to config file. By default: {0}' . format ( DEFAULT_CONFIG ) ) arg_2 . add_argument ( '-p' , '--pre-requirements' , default = [ ] , nargs = '+' , help = 'List of pre-requirements to check, separated by space.' ) arg_2 . add_argument ( '-e' , '--env' , help = 'Virtual environment name. By default: {0}' . format ( CONFIG [ __script__ ] [ 'env' ] ) ) arg_2 . add_argument ( '-r' , '--requirements' , help = 'Path to requirements file. By default: {0}' . format ( CONFIG [ __script__ ] [ 'requirements' ] ) ) arg_2 . add_argument ( '-d' , '--install-dev-requirements' , action = 'store_true' , default = None , help = 'Install prefixed or suffixed "dev" requirements after ' 'installation of original requirements file or library completed ' 'without errors.' ) arg_2 . add_argument ( '-C' , '--hook' , help = 'Execute this hook after bootstrap process.' ) arg_2 . add_argument ( '--ignore-activated' , action = 'store_true' , default = None , help = 'Ignore pre-activated virtualenv, like on Travis CI.' ) arg_2 . add_argument ( '--recreate' , action = 'store_true' , default = None , help = 'Recreate virtualenv on every run.' ) arg_2 . add_argument ( '-q' , '--quiet' , action = 'store_true' , default = None , help = 'Minimize output, show only error messages.' ) return arg_2 . Func ( arg_0 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: setting baudrate if supported

def Func ( arg_0 , arg_1 ) : log . info ( 'Changing communication to %s baud' , arg_1 ) arg_0 . __writeln ( UART_SETUP . format ( arg_1 = arg_1 ) ) time . sleep ( 0.1 ) try : arg_0 . _port . setBaudrate ( arg_1 ) except AttributeError : arg_0 . _port . baudrate = arg_1

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


Question: Returns the bit specified from the address .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . read ( arg_2 ) arg_4 = get_bit_mask ( arg_1 ) return 1 if arg_3 & arg_4 else 0

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted


Question: Return a canonical filename for filename .

def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . Func_cache : if not os . path . isabs ( arg_1 ) : for arg_2 in [ os . curdir ] + sys . path : if arg_2 is None : continue arg_3 = os . path . join ( arg_2 , arg_1 ) if os . path . exists ( arg_3 ) : arg_1 = arg_3 break arg_4 = abs_file ( arg_1 ) arg_0 . Func_cache [ arg_1 ] = arg_4 return arg_0 . Func_cache [ arg_1 ]

Whether a connection can be established between those two meshes.


Question: Read the data encoding the GetAttributeList response payload and decode it into its constituent parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( GetAttributeListResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . UNIQUE_IDENTIFIER , arg_6 ) : arg_0 . _unique_identifier = primitives . TextString ( tag = arg_3 . Tags . UNIQUE_IDENTIFIER ) arg_0 . _unique_identifier . Func ( arg_6 , arg_2 = arg_2 ) else : raise exceptions . InvalidKmipEncoding ( "The GetAttributeList response payload encoding is missing " "the unique identifier." ) arg_8 = list ( ) if arg_2 < arg_3 . KMIPVersion . KMIP_2_0 : while arg_0 . is_tag_next ( arg_3 . Tags . ATTRIBUTE_NAME , arg_6 ) : arg_9 = primitives . TextString ( tag = arg_3 . Tags . ATTRIBUTE_NAME ) arg_9 . Func ( arg_6 , arg_2 = arg_2 ) arg_8 . append ( arg_9 ) if len ( arg_8 ) == 0 : raise exceptions . InvalidKmipEncoding ( "The GetAttributeList response payload encoding is " "missing the attribute names." ) arg_0 . _attribute_names = arg_8 else : while arg_0 . is_tag_next ( arg_3 . Tags . ATTRIBUTE_REFERENCE , arg_6 ) : if arg_0 . is_type_next ( arg_3 . Types . STRUCTURE , arg_6 ) : arg_11 = objects . AttributeReference ( ) arg_11 . Func ( arg_6 , arg_2 = arg_2 ) arg_8 . append ( primitives . TextString ( value = arg_11 . attribute_name , tag = arg_3 . Tags . ATTRIBUTE_NAME ) ) elif arg_0 . is_type_next ( arg_3 . Types . ENUMERATION , arg_6 ) : arg_11 = primitives . Enumeration ( arg_3 . Tags , tag = arg_3 . Tags . ATTRIBUTE_REFERENCE ) arg_11 . Func ( arg_6 , arg_2 = arg_2 ) arg_9 = arg_3 . convert_attribute_tag_to_name ( arg_11 . value ) arg_8 . append ( primitives . TextString ( value = arg_9 , tag = arg_3 . Tags . ATTRIBUTE_NAME ) ) else : raise exceptions . InvalidKmipEncoding ( "The GetAttributeList response payload encoding " "contains an invalid AttributeReference type." ) arg_0 . _attribute_names = arg_8 arg_0 . is_oversized ( arg_6 )

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

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

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

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

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

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

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

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


Question: Returns a string representing a numpy array of 0 s and 1 s

def Func ( arg_0 ) : arg_1 = array ( 'c' , '.' * len ( arg_0 ) ) for arg_2 in xrange ( len ( arg_0 ) ) : if arg_0 [ arg_2 ] == 1 : arg_1 [ arg_2 ] = '*' return arg_1

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


Question: Does this filename match any of the patterns?

def Func ( arg_0 , arg_1 ) : return any ( fnmatch . fnmatch ( arg_0 , arg_2 ) for arg_2 in arg_1 )


Question: Apply causal discovery on observational data using CAM .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_0 . arguments [ '{SCORE}' ] = arg_0 . scores [ arg_0 . score ] arg_0 . arguments [ '{CUTOFF}' ] = str ( arg_0 . cutoff ) arg_0 . arguments [ '{VARSEL}' ] = str ( arg_0 . variablesel ) . upper ( ) arg_0 . arguments [ '{SELMETHOD}' ] = arg_0 . var_selection [ arg_0 . selmethod ] arg_0 . arguments [ '{PRUNING}' ] = str ( arg_0 . pruning ) . upper ( ) arg_0 . arguments [ '{PRUNMETHOD}' ] = arg_0 . var_selection [ arg_0 . prunmethod ] arg_0 . arguments [ '{NJOBS}' ] = str ( arg_0 . nb_jobs ) arg_0 . arguments [ '{VERBOSE}' ] = str ( arg_0 . verbose ) . upper ( ) arg_4 = arg_0 . _run_cam ( arg_1 , verbose = arg_0 . verbose ) return nx . relabel_nodes ( nx . DiGraph ( arg_4 ) , { arg_5 : arg_6 for arg_5 , arg_6 in enumerate ( arg_1 . columns ) } )

Generate RENEWING time.

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

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


Question: Draw all polygons onto a given image .

def Func ( arg_0 , arg_1 , arg_2 = ( 0 , 255 , 0 ) , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = 1.0 , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = 1 , arg_11 = None , arg_12 = None , arg_13 = False ) : for arg_14 in arg_0 . polygons : arg_1 = arg_14 . Func ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_11 = arg_11 , arg_12 = arg_12 , arg_13 = arg_13 ) return arg_1

Return the metadata for the specified course run.

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


Question: Pull a device from the API .

def Func ( arg_0 ) : arg_1 = DEVICE_URL % arg_0 arg_2 = requests . get ( arg_1 , headers = HEADERS ) arg_3 = str ( arg_2 . status_code ) if arg_3 == '401' : _LOGGER . error ( "Token expired." ) return False return arg_2 . json ( )

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: Strip all tags from a string except those tags provided in allowed_tags parameter .

def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return if arg_1 is None : arg_1 = ALLOWED_TAGS return bleach . clean ( arg_0 , tags = arg_1 , attributes = [ 'id' , 'class' , 'style' , 'href' , 'title' ] , strip = True )

Return local folder path of header files.


Question: Convert this polygon to a bounding box tightly containing the whole polygon .

def Func ( arg_0 ) : from imgaug . augmentables . bbs import BoundingBox arg_1 = arg_0 . xx arg_2 = arg_0 . yy return BoundingBox ( x1 = min ( arg_1 ) , x2 = max ( arg_1 ) , y1 = min ( arg_2 ) , y2 = max ( arg_2 ) , label = arg_0 . label )

Setup this colorful object by setting a ``colormode`` and
        the ``colorpalette`. The ``extend_colors`` flag is used
        to extend the currently active color palette instead of
        replacing it.

        :param int colormode: the color mode to use. See ``translate_rgb_to_ansi_code``
        :parma dict colorpalette: the colorpalette to use. This ``dict`` should map
                                  color names to it's corresponding RGB value
        :param bool extend_colors: extend the active color palette instead of replacing it


Question: Updates the directives attribute from a dictionary object .

def Func ( arg_0 , arg_1 ) : arg_2 = [ "pid" , "ignore_type" , "ignore_pid" , "extra_input" , "group" , "input_type" ] for arg_3 , arg_4 in arg_1 . items ( ) : if arg_3 in arg_2 and hasattr ( arg_0 , arg_3 ) : setattr ( arg_0 , arg_3 , arg_4 ) elif arg_3 == "params" : for arg_5 , arg_6 in arg_4 . items ( ) : if arg_5 in arg_0 . params : arg_0 . params [ arg_5 ] [ "default" ] = arg_6 else : raise eh . ProcessError ( "The parameter name '{}' does not exist for " "component '{}'" . format ( arg_5 , arg_0 . template ) ) else : for arg_8 in arg_0 . directives : arg_0 . directives [ arg_8 ] [ arg_3 ] = arg_4

A list of row indices to remove. There are two caveats. First, this is
    a potentially slow operation. Second, pattern indices will shift if
    patterns before them are removed.


Question: run a server binding to port

def Func ( arg_0 , arg_1 ) : try : arg_0 . server = MultiThreadedHTTPServer ( ( '0.0.0.0' , arg_1 ) , Handler ) except socket . error , e : logger . error ( str ( e ) ) sys . exit ( 1 ) logger . info ( "HTTP serve at http://0.0.0.0:%d (ctrl-c to stop) ..." % arg_1 ) try : arg_0 . server . serve_forever ( ) except KeyboardInterrupt : logger . info ( "^C received, shutting down server" ) arg_0 . shutdown_server ( )


Question: assign dates to nodes

def Func ( arg_0 ) : if arg_0 . tree is None : arg_0 . logger ( "ClockTree.Func: tree is not set, can't assign dates" , 0 ) return ttconf . ERROR arg_1 = 0 for arg_2 in arg_0 . tree . find_clades ( order = 'postorder' ) : if arg_2 . name in arg_0 . date_dict : arg_3 = arg_0 . date_dict [ arg_2 . name ] if np . isscalar ( arg_3 ) and np . isnan ( arg_3 ) : arg_0 . logger ( "WARNING: ClockTree.init: node %s has a bad date: %s" % ( arg_2 . name , str ( arg_3 ) ) , 2 , warn = True ) arg_2 . raw_date_constraint = None arg_2 . bad_branch = True else : try : arg_6 = np . mean ( arg_3 ) arg_2 . raw_date_constraint = arg_3 arg_2 . bad_branch = False except : arg_0 . logger ( "WARNING: ClockTree.init: node %s has a bad date: %s" % ( arg_2 . name , str ( arg_3 ) ) , 2 , warn = True ) arg_2 . raw_date_constraint = None arg_2 . bad_branch = True else : arg_2 . raw_date_constraint = None if arg_2 . is_terminal ( ) : arg_2 . bad_branch = True else : arg_2 . bad_branch = np . all ( [ x . bad_branch for x in arg_2 ] ) if arg_2 . is_terminal ( ) and arg_2 . bad_branch : arg_1 += 1 if arg_1 > arg_0 . tree . count_terminals ( ) - 3 : arg_0 . logger ( "ERROR: ALMOST NO VALID DATE CONSTRAINTS, EXITING" , 1 , warn = True ) return ttconf . ERROR return ttconf . SUCCESS

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Removes a volume from the data center .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _perform_request ( url = '/datacenters/%s/volumes/%s' % ( arg_1 , arg_2 ) , method = 'DELETE' ) return arg_3

Simple and fast implementation of the covariance AR estimate

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

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

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

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

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

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

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

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

    :References: Mathworks


Question: Calculate a subcircuit that implements this initialization

def Func ( arg_0 ) : arg_1 = arg_0 . gates_to_uncompute ( ) arg_2 = arg_1 . to_instruction ( ) . inverse ( ) arg_3 = QuantumRegister ( arg_0 . num_qubits , 'q' ) arg_4 = QuantumCircuit ( arg_3 , name = 'init_def' ) for arg_5 in arg_3 : arg_4 . append ( Reset ( ) , [ arg_5 ] ) arg_4 . append ( arg_2 , arg_3 [ : ] ) arg_0 . definition = arg_4 . data

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: Generate a slice array from an index array .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = True ) : arg_5 = fix_frames ( arg_0 , arg_1 , arg_2 , arg_4 = arg_4 ) return [ slice ( arg_6 , arg_7 , arg_3 ) for ( arg_6 , arg_7 ) in zip ( arg_5 , arg_5 [ 1 : ] ) ]

Parse a Supybot IRC log file.

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

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

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


Question: Return a dictionary with ensembl ids as keys and transcripts as value .

def Func ( arg_0 , arg_1 = '37' ) : Func = { } LOG . info ( "Fetching all transcripts" ) for arg_3 in arg_0 . transcript_collection . find ( { 'build' : arg_1 } ) : arg_4 = arg_3 [ 'transcript_id' ] Func [ arg_4 ] = arg_3 LOG . info ( "Ensembl transcripts fetched" ) return Func


Question: Plot the temporal distance cumulative density function .

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . profile_block_analyzer . _temporal_distance_cdf ( ) arg_3 = plt . figure ( ) arg_4 = arg_3 . add_subplot ( 111 ) arg_1 = numpy . array ( arg_1 ) / 60.0 arg_4 . plot ( arg_1 , arg_2 , "-k" ) arg_4 . fill_between ( arg_1 , arg_2 , color = "red" , alpha = 0.2 ) arg_4 . set_ylabel ( "CDF(t)" ) arg_4 . set_xlabel ( "Temporal distance t (min)" ) return arg_3

Runs the review process for all the launchers.


Question: Return the type object corresponding to a type name .

def Func ( arg_0 , arg_1 ) : arg_1 = arg_0 . _canonicalize_type ( arg_1 ) if str ( arg_1 ) == 'int' : arg_1 = 'integer' elif str ( arg_1 ) == 'str' : arg_1 = 'string' elif str ( arg_1 ) == 'dict' : arg_1 = 'basic_dict' if arg_0 . is_known_type ( arg_1 ) : return arg_0 . known_types [ arg_1 ] arg_2 , arg_3 , arg_4 = arg_0 . split_type ( arg_1 ) if arg_3 and arg_2 in arg_0 . type_factories : arg_0 . instantiate_type ( arg_1 , arg_2 , arg_4 ) return arg_0 . known_types [ arg_1 ] arg_5 = 0 for arg_5 , ( arg_6 , arg_7 ) in enumerate ( arg_0 . _lazy_type_sources ) : if isinstance ( arg_6 , str ) : import pkg_resources for arg_8 in pkg_resources . iter_entry_points ( arg_6 ) : try : arg_9 = arg_8 . load ( ) type_system . load_type_module ( arg_9 ) except : arg_10 = ( "Entry point group: %s, name: %s" % ( arg_6 , arg_8 . name ) , sys . exc_info ) logging . exception ( "Error loading external type source from entry point, group: %s, name: %s" , arg_6 , arg_8 . name ) arg_0 . failed_sources . append ( arg_10 ) else : try : arg_6 ( arg_0 ) except : arg_10 = ( "source: %s" % arg_7 , sys . exc_info ) logging . exception ( "Error loading external type source, source: %s" , arg_6 ) arg_0 . failed_sources . append ( arg_10 ) if arg_0 . is_known_type ( arg_1 ) or ( arg_3 and arg_2 in arg_0 . type_factories ) : break arg_0 . _lazy_type_sources = arg_0 . _lazy_type_sources [ arg_5 : ] if not ( arg_0 . is_known_type ( arg_1 ) or ( arg_3 and arg_2 in arg_0 . type_factories ) ) : raise ArgumentError ( "Func called on unknown type" , type = arg_1 , failed_external_sources = [ arg_12 [ 0 ] for arg_12 in arg_0 . failed_sources ] ) return arg_0 . Func ( arg_1 )


Question: Get the default logging handler for Basilisp .

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> logging . Handler : arg_3 : logging . Handler = logging . NullHandler ( ) if os . getenv ( "BASILISP_USE_DEV_LOGGER" ) == "true" : arg_3 = logging . StreamHandler ( ) arg_3 . setFormatter ( logging . Formatter ( arg_2 ) ) arg_3 . setLevel ( arg_0 ) return arg_3


Question: Python default hsv to rgb conversion for when hue values in the range 0 - 359 are preferred . Due to requiring float math this method is slower than hsv2rgb_rainbow and hsv2rgb_spectrum .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = arg_0 arg_4 , arg_5 , arg_6 = colorsys . hsv_to_rgb ( arg_1 / 360.0 , arg_2 , arg_3 ) return ( int ( arg_4 * 255.0 ) , int ( arg_5 * 255.0 ) , int ( arg_6 * 255.0 ) )

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


Question: This smooths the magseries with a Gaussian kernel .

def Func ( arg_0 , arg_1 , arg_2 = 7 ) : arg_3 = Gaussian1DKernel ( arg_2 , x_size = arg_1 ) arg_4 = convolve ( arg_0 , arg_3 , boundary = 'extend' ) return arg_4

Returns a string contains start time and the secondary training job status message.

    :param job_description: Returned response from DescribeTrainingJob call
    :type job_description: dict
    :param prev_description: Previous job description from DescribeTrainingJob call
    :type prev_description: dict

    :return: Job status string to be printed.


Question: Turn any URLs into links .

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 , arg_5 = arg_6 , arg_7 = arg_8 ) : if arg_0 . tag in arg_3 : return arg_9 = arg_0 . get ( 'class' ) if arg_9 : arg_9 = arg_9 . split ( ) for arg_10 in arg_7 : if arg_10 in arg_9 : return for arg_11 in list ( arg_0 ) : Func ( arg_11 , arg_1 = arg_1 , arg_3 = arg_3 , arg_5 = arg_5 , arg_7 = arg_7 ) if arg_11 . tail : arg_12 , arg_13 = _link_text ( arg_11 . tail , arg_1 , arg_5 , factory = arg_0 . makeelement ) if arg_13 : arg_11 . tail = arg_12 arg_15 = arg_0 . index ( arg_11 ) arg_0 [ arg_15 + 1 : arg_15 + 1 ] = arg_13 if arg_0 . text : arg_12 , arg_16 = _link_text ( arg_0 . text , arg_1 , arg_5 , factory = arg_0 . makeelement ) if arg_16 : arg_0 . text = arg_12 arg_0 [ : 0 ] = arg_16

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


Question: If we don t merge the shas from the sha store and if we build a subgraph the . shastore will only contain the shas of the files from the subgraph and the rest of the graph will have to be rebuilt

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 : for arg_3 in arg_2 : if arg_3 in arg_1 [ 'files' ] : del arg_1 [ 'files' ] [ arg_3 ] return arg_1 for arg_4 in arg_0 [ 'files' ] : if arg_4 not in arg_1 [ 'files' ] and arg_4 not in arg_2 : arg_1 [ 'files' ] [ arg_4 ] = arg_0 [ 'files' ] [ arg_4 ] for arg_3 in arg_2 : if arg_3 in arg_1 [ 'files' ] : del arg_1 [ 'files' ] [ arg_3 ] return arg_1


Question: Use a PEG to parse expression and return study IDs .

def Func ( arg_0 , arg_1 , arg_2 = 0.001 , arg_3 = arg_4 . sum ) : arg_6 = lp . Lexer ( ) arg_6 . build ( ) arg_7 = lp . Parser ( arg_6 , arg_0 . dataset , arg_2 = arg_2 , arg_3 = arg_3 ) arg_7 . build ( ) return arg_7 . parse ( arg_1 ) . keys ( ) . values

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted


Question: Write a window from a numpy array to an output file .

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None ) : if not isinstance ( arg_4 , str ) : raise TypeError ( "out_path must be a string" ) logger . debug ( "write %s" , arg_4 ) if arg_4 == "memoryfile" : raise DeprecationWarning ( "Writing to memoryfile with Func() is deprecated. " "Please use RasterWindowMemoryFile." ) arg_3 = arg_0 if arg_3 is None else arg_3 _validate_write_window_params ( arg_0 , arg_3 , arg_1 , arg_2 ) arg_7 = extract_from_array ( in_raster = arg_1 , in_affine = arg_0 . affine , arg_3 = arg_3 ) if arg_0 != arg_3 else arg_1 if "affine" in arg_2 : arg_2 [ "transform" ] = arg_2 . pop ( "affine" ) if arg_7 . all ( ) is not ma . masked : try : if arg_4 . startswith ( "s3://" ) : with RasterWindowMemoryFile ( arg_0 = arg_3 , arg_1 = arg_7 , arg_2 = arg_2 , arg_3 = arg_3 , arg_5 = arg_5 ) as memfile : logger . debug ( ( arg_3 . id , "upload tile" , arg_4 ) ) arg_6 . put_object ( Key = "/" . join ( arg_4 . split ( "/" ) [ 3 : ] ) , Body = memfile ) else : with rasterio . open ( arg_4 , 'w' , ** arg_2 ) as dst : logger . debug ( ( arg_3 . id , "write tile" , arg_4 ) ) dst . write ( arg_7 . astype ( arg_2 [ "dtype" ] , copy = False ) ) _write_tags ( dst , arg_5 ) except Exception as e : logger . exception ( "error while writing file %s: %s" , arg_4 , e ) raise else : logger . debug ( ( arg_3 . id , "array window empty" , arg_4 ) )


Question: Receives a dictionary connection_params to setup a connection to the database .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . pop ( 'name' ) arg_3 = arg_1 . pop ( 'enforce_schema' ) arg_1 [ 'document_class' ] = OrderedDict if arg_0 . client_connection is not None : arg_0 . client_connection . close ( ) arg_0 . client_connection = Database . connect ( ** arg_1 ) arg_5 = arg_0 . client_connection [ arg_2 ] arg_0 . djongo_connection = DjongoClient ( arg_5 , arg_3 ) return arg_0 . client_connection [ arg_2 ]

Verify that the contents of the OpaqueObject are valid.

        Raises:
            TypeError: if the types of any OpaqueObject attributes are invalid.


Question: Creates an one - off record for each record in the inputs . Appends new records to the same inputs list .

def Func ( arg_0 ) : arg_1 = len ( arg_0 ) for arg_2 in xrange ( arg_1 ) : arg_3 = arg_0 [ arg_2 ] for arg_4 in xrange ( len ( arg_3 ) - 1 ) : if arg_3 [ arg_4 ] == 1 and arg_3 [ arg_4 + 1 ] == 0 : arg_5 = copy . deepcopy ( arg_3 ) arg_5 [ arg_4 ] = 0 arg_5 [ arg_4 + 1 ] = 1 arg_0 . append ( arg_5 ) break

hyperpolarization step. Use to calculate tau and stuff.


Question: Refresh the project from the original cookiecutter template .

def Func ( arg_0 , arg_1 = '' ) : arg_1 = arg_1 or "https://github.com/Springerle/py-generic-project.git" arg_2 = os . path . join ( tempfile . gettempdir ( ) , "cc-upgrade-pygments-markdown-lexer" ) if os . path . isdir ( '.git' ) : pass if os . path . isdir ( arg_2 ) : shutil . rmtree ( arg_2 ) if os . path . exists ( arg_1 ) : shutil . copytree ( arg_1 , arg_2 , ignore = shutil . ignore_patterns ( ".git" , ".svn" , "*~" , ) ) else : arg_0 . run ( "git clone {} {}" . format ( arg_1 , arg_2 ) ) shutil . copy2 ( "project.d/cookiecutter.json" , arg_2 ) with pushd ( '..' ) : arg_0 . run ( "cookiecutter --no-input {}" . format ( arg_2 ) ) if os . path . exists ( '.git' ) : arg_0 . run ( "git status" )

Convert reflection coefficients to inverse sine parameters.

    :param k: reflection coefficients
    :return: inverse sine parameters

    .. seealso:: :func:`is2rc`, :func:`rc2poly`, :func:`rc2acC`, :func:`rc2lar`.

    Reference: J.R. Deller, J.G. Proakis, J.H.L. Hansen, "Discrete-Time
       Processing of Speech Signals", Prentice Hall, Section 7.4.5.


Question: Parses the version data license name SPDX Identifier namespace and comment .

def Func ( arg_0 , arg_1 ) : try : arg_0 . builder . set_doc_spdx_id ( arg_0 . doc , arg_1 ) except SPDXValueError : arg_0 . value_error ( 'DOC_SPDX_ID_VALUE' , arg_1 ) try : if arg_1 . count ( '#' , 0 , len ( arg_1 ) ) <= 1 : arg_2 = arg_1 . split ( '#' ) [ 0 ] arg_0 . builder . set_doc_namespace ( arg_0 . doc , arg_2 ) else : arg_0 . value_error ( 'DOC_NAMESPACE_VALUE' , arg_1 ) except SPDXValueError : arg_0 . value_error ( 'DOC_NAMESPACE_VALUE' , arg_1 ) for arg_3 , arg_4 , arg_5 in arg_0 . graph . triples ( ( arg_1 , arg_0 . spdx_namespace [ 'specVersion' ] , None ) ) : try : arg_0 . builder . set_doc_version ( arg_0 . doc , six . text_type ( arg_5 ) ) except SPDXValueError : arg_0 . value_error ( 'DOC_VERS_VALUE' , arg_5 ) except CardinalityError : arg_0 . more_than_one_error ( 'specVersion' ) break for arg_3 , arg_4 , arg_5 in arg_0 . graph . triples ( ( arg_1 , arg_0 . spdx_namespace [ 'dataLicense' ] , None ) ) : try : arg_0 . builder . set_doc_data_lic ( arg_0 . doc , six . text_type ( arg_5 ) ) except SPDXValueError : arg_0 . value_error ( 'DOC_D_LICS' , arg_5 ) except CardinalityError : arg_0 . more_than_one_error ( 'dataLicense' ) break for arg_3 , arg_4 , arg_5 in arg_0 . graph . triples ( ( arg_1 , arg_0 . spdx_namespace [ 'name' ] , None ) ) : try : arg_0 . builder . set_doc_name ( arg_0 . doc , six . text_type ( arg_5 ) ) except CardinalityError : arg_0 . more_than_one_error ( 'name' ) break for arg_3 , arg_4 , arg_5 in arg_0 . graph . triples ( ( arg_1 , RDFS . comment , None ) ) : try : arg_0 . builder . set_doc_comment ( arg_0 . doc , six . text_type ( arg_5 ) ) except CardinalityError : arg_0 . more_than_one_error ( 'Document comment' ) break


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

def Func ( arg_0 , arg_1 ) : arg_0 . _genes . add ( arg_1 ) arg_1 . _reaction . add ( arg_0 ) arg_1 . _model = arg_0 . _model

True if the credential is expired or invalid.

        If the token_expiry isn't set, we assume the token doesn't expire.


Question: Get the default API key for a user .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dict ( ) arg_3 [ 'email' ] = arg_1 arg_3 [ 'password' ] = arg_2 arg_4 = arg_0 . request ( 'midas.user.apikey.default' , arg_3 ) return arg_4 [ 'apikey' ]

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: For each edge expecting a word of this category here extend the edge .

def Func ( arg_0 , arg_1 , arg_2 ) : for ( arg_3 , arg_1 , arg_4 , arg_5 , arg_6 ) in arg_0 . chart [ arg_1 ] : if arg_6 and arg_0 . grammar . isa ( arg_2 , arg_6 [ 0 ] ) : arg_0 . add_edge ( [ arg_3 , arg_1 + 1 , arg_4 , arg_5 + [ ( arg_6 [ 0 ] , arg_2 ) ] , arg_6 [ 1 : ] ] )


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

def Func ( arg_0 , arg_1 ) : return np . multiply ( np . multiply ( arg_0 . intensity_prime , np . power ( np . add ( 1 , np . power ( np . divide ( arg_0 . radius_break , arg_1 ) , arg_0 . alpha ) ) , ( arg_0 . gamma / arg_0 . alpha ) ) ) , np . exp ( np . multiply ( - arg_0 . sersic_constant , ( np . power ( np . divide ( np . add ( np . power ( arg_1 , arg_0 . alpha ) , ( arg_0 . radius_break ** arg_0 . alpha ) ) , ( arg_0 . effective_radius ** arg_0 . alpha ) ) , ( 1.0 / ( arg_0 . alpha * arg_0 . sersic_index ) ) ) ) ) ) )

Get course's duration as a timedelta.

        Arguments:
            obj (CourseOverview): CourseOverview object

        Returns:
            (timedelta): Duration of a course.


Question: Bayesian Estimation Supersedes the T - Test

def Func ( arg_0 , arg_1 , arg_2 = 1000 , arg_3 = True ) : arg_4 = np . concatenate ( ( arg_0 , arg_1 ) ) arg_5 = np . mean ( arg_4 ) arg_6 = 0.000001 * 1 / np . std ( arg_4 ) ** 2 arg_7 = np . std ( arg_4 ) / 1000 arg_8 = np . std ( arg_4 ) * 1000 with pm . Model ( ) as model : arg_9 = pm . Normal ( 'group1_mean' , mu = arg_5 , tau = arg_6 , testval = arg_0 . mean ( ) ) arg_10 = pm . Normal ( 'group2_mean' , mu = arg_5 , tau = arg_6 , testval = arg_1 . mean ( ) ) arg_11 = pm . Uniform ( 'group1_std' , lower = arg_7 , upper = arg_8 , testval = arg_0 . std ( ) ) arg_12 = pm . Uniform ( 'group2_std' , lower = arg_7 , upper = arg_8 , testval = arg_1 . std ( ) ) arg_13 = pm . Exponential ( 'nu_minus_two' , 1 / 29. , testval = 4. ) + 2. arg_14 = pm . StudentT ( 'group1' , arg_13 = arg_13 , mu = arg_9 , lam = arg_11 ** - 2 , observed = arg_0 ) arg_15 = pm . StudentT ( 'group2' , arg_13 = arg_13 , mu = arg_10 , lam = arg_12 ** - 2 , observed = arg_1 ) arg_16 = pm . Deterministic ( 'difference of means' , arg_10 - arg_9 ) pm . Deterministic ( 'difference of stds' , arg_12 - arg_11 ) pm . Deterministic ( 'effect size' , arg_16 / pm . math . sqrt ( ( arg_11 ** 2 + arg_12 ** 2 ) / 2 ) ) pm . Deterministic ( 'group1_annual_volatility' , arg_14 . distribution . variance ** .5 * np . sqrt ( 252 ) ) pm . Deterministic ( 'group2_annual_volatility' , arg_15 . distribution . variance ** .5 * np . sqrt ( 252 ) ) pm . Deterministic ( 'group1_sharpe' , arg_14 . distribution . mean / arg_14 . distribution . variance ** .5 * np . sqrt ( 252 ) ) pm . Deterministic ( 'group2_sharpe' , arg_15 . distribution . mean / arg_15 . distribution . variance ** .5 * np . sqrt ( 252 ) ) arg_17 = pm . sample ( arg_2 , arg_3 = arg_3 ) return model , arg_17

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


Question: Creates a copy of this request context with the same request object . This can be used to move a request context to a different greenlet . Because the actual request object is the same this cannot be used to move a request context to a different thread unless access to the request object is locked .

def Func ( arg_0 ) : return arg_0 . __class__ ( arg_0 . app , environ = arg_0 . request . environ , request = arg_0 . request )

Lists all of the service certificates associated with the specified
        hosted service.

        service_name:
            Name of the hosted service.


Question: Return an iterable of possible completions matching the given prefix from the list of aliased namespaces . If name_in_ns is given further attempt to refine the list to matching names in that namespace .

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_2 ] = None ) -> Iterable [ arg_2 ] : arg_5 = filter ( Namespace . __completion_matcher ( arg_1 ) , [ ( s , n ) for s , n in arg_0 . aliases ] ) if arg_3 is not None : for arg_6 , arg_7 in arg_5 : for arg_8 in arg_7 . __complete_interns ( arg_3 , include_private_vars = False ) : yield f"{prefix}/{match}" else : for arg_9 , arg_6 in arg_5 : yield f"{alias}/"

Top Chartbeat template tag.

    Render the top Javascript code for Chartbeat.


Question: Job version of s3am_upload

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = arg_0 . fileStore . getLocalTempDir ( ) arg_6 = arg_0 . fileStore . readGlobalFile ( arg_1 , os . path . join ( arg_5 , arg_2 ) ) s3am_upload ( arg_0 = arg_0 , arg_6 = arg_6 , arg_3 = arg_3 , num_cores = arg_0 . cores , arg_4 = arg_4 )


Question: This is a parallel worker for parallel_update_cp_objectinfo .

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 try : arg_3 = update_checkplot_objectinfo ( arg_1 , ** arg_2 ) return arg_3 except Exception as e : LOGEXCEPTION ( 'failed to update objectinfo for %s' % arg_1 ) return None

Find the id of a group given its name by iterating on the list of subscriptions


Question: Check if current line contains an inherited function .

def Func ( arg_0 , arg_1 ) : for arg_2 in xrange ( arg_1 , max ( - 1 , arg_1 - 10 ) , - 1 ) : arg_3 = Match ( r'^([^()]*\w+)\(' , arg_0 . elided [ arg_2 ] ) if arg_3 : arg_4 , arg_5 , arg_6 = CloseExpression ( arg_0 , arg_2 , len ( arg_3 . group ( 1 ) ) ) return ( arg_6 >= 0 and Search ( r'\boverride\b' , arg_4 [ arg_6 : ] ) ) return False

Update a Label

        :param label: The data to update. Must include keys:

            * id (str)
            * appearance (dict)
            * description (str)
            * name (str)
            * title (str)
        :type label: dict

        Example:

        .. code-block:: python

            Labels().update(
                label={
                    'id': 'd9d4596e-49e4-4135-b3b3-847f9e7c1f43',
                    'appearance': {'color': '278abe'},
                    'name': 'My Sandbox',
                    'description': 'My Sandbox',
                    'title': 'My Sandbox',
                }
            )

        :return:
        :rtype: dict


Question: Retrieve a single domain record given the id

def Func ( arg_0 , arg_1 , ** arg_2 ) : return super ( DomainRecords , arg_0 ) . Func ( arg_1 , ** arg_2 )

Handle marking messages as read and keeping client active.


Question: Evaluate XPath expression in context of self . xmlnode .

def Func ( arg_0 , arg_1 ) : arg_2 = common_doc . xpathNewContext ( ) arg_2 . setContextNode ( arg_0 . xmlnode ) arg_2 . xpathRegisterNs ( "muc" , arg_0 . ns . getContent ( ) ) arg_3 = arg_2 . xpathEval ( to_utf8 ( arg_1 ) ) arg_2 . xpathFreeContext ( ) return arg_3

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: Save the metadata to the given filename .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = sorted ( arg_0 . items ( ) , arg_4 = MP4Tags . __get_sort_stats ) for arg_4 , arg_5 in arg_3 : arg_6 = arg_0 . __atoms . get ( arg_4 [ : 4 ] , ( None , type ( arg_0 ) . __render_text ) ) try : arg_2 . append ( arg_6 [ 1 ] ( arg_0 , arg_4 , arg_5 , * arg_6 [ 2 : ] ) ) except ( TypeError , ValueError ) as s : reraise ( MP4MetadataValueError , s , sys . exc_info ( ) [ 2 ] ) arg_7 = Atom . render ( b"ilst" , b"" . join ( arg_2 ) ) arg_8 = open ( arg_1 , "rb+" ) try : arg_9 = Atoms ( arg_8 ) try : arg_10 = arg_9 . path ( b"moov" , b"udta" , b"meta" , b"ilst" ) except KeyError : arg_0 . __Func_new ( arg_8 , arg_9 , arg_7 ) else : arg_0 . __Func_existing ( arg_8 , arg_9 , arg_10 , arg_7 ) finally : arg_8 . close ( )

Update self._type_to_spans according to the added length.


Question: Convert cylindrical polar velocities to Cartesian .

def Func ( arg_0 , arg_1 = 'x' , arg_2 = 'y' , arg_3 = None , arg_4 = 'vr_polar' , arg_5 = 'vphi_polar' , arg_6 = 'vx' , arg_7 = 'vy' , arg_8 = False ) : arg_1 = arg_0 . _expr ( arg_1 ) arg_2 = arg_0 . _expr ( arg_2 ) arg_4 = arg_0 . _expr ( arg_4 ) arg_5 = arg_0 . _expr ( arg_5 ) if arg_3 is not None : arg_3 = arg_0 . _expr ( arg_3 ) arg_3 = np . deg2rad ( arg_3 ) else : arg_3 = np . arctan2 ( arg_2 , arg_1 ) arg_3 = arg_0 . _expr ( arg_3 ) arg_0 [ arg_6 ] = arg_4 * np . cos ( arg_3 ) - arg_5 * np . sin ( arg_3 ) arg_0 [ arg_7 ] = arg_4 * np . sin ( arg_3 ) + arg_5 * np . cos ( arg_3 ) if arg_8 : arg_0 . propagate_uncertainties ( [ arg_0 [ arg_6 ] , arg_0 [ arg_7 ] ] )

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


Question: Gets the transit start middle and end times for transits in a given time - series of observations .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = True , arg_6 = 1 , arg_7 = None , arg_8 = 0.03 ) : arg_9 = 1.05 * ( np . nanmax ( arg_0 ) - np . nanmin ( arg_0 ) ) / 2 arg_10 = kbls . bls_parallel_pfind ( arg_0 , arg_1 , arg_2 , arg_5 = arg_5 , startp = 0.1 , arg_9 = arg_9 , maxtransitduration = 0.3 , arg_6 = arg_6 , arg_7 = arg_7 ) arg_11 = kbls . bls_stats_singleperiod ( arg_0 , arg_1 , arg_2 , arg_10 [ 'bestperiod' ] , arg_5 = True , arg_7 = arg_7 , perioddeltapercent = 5 ) if arg_3 : make_fit_plot ( arg_11 [ 'phases' ] , arg_11 [ 'phasedmags' ] , None , arg_11 [ 'blsmodel' ] , arg_11 [ 'period' ] , arg_11 [ 'epoch' ] , arg_11 [ 'epoch' ] , arg_3 , arg_5 = arg_5 ) arg_12 = arg_11 [ 'transitduration' ] * 0.2 arg_13 = [ arg_11 [ 'period' ] , arg_11 [ 'epoch' ] , arg_11 [ 'transitdepth' ] , arg_11 [ 'transitduration' ] , arg_12 ] if arg_4 : arg_14 = traptransit_fit_magseries ( arg_0 , arg_1 , arg_2 , arg_13 , arg_5 = arg_5 , arg_7 = arg_7 , plotfit = arg_4 ) arg_15 , arg_16 , arg_17 = get_transit_times ( arg_11 , arg_0 , arg_8 , arg_14 = arg_14 ) return arg_15 , arg_16 , arg_17


Question: create a copy of each selected object

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 . selection : if arg_3 : if DEBUG : print "duplicating" , arg_3 . name arg_3 . sel_marker . destroy ( ) arg_3 . sel_marker = None arg_5 = arg_3 . Func ( ) arg_5 . sel_marker = SelectionMarker ( arg_5 ) arg_5 . sel_marker . show ( True ) arg_2 . append ( arg_5 ) arg_0 . selection = arg_2 arg_0 . inspector . load_object ( )

Perform a quick check on a BAM via `samtools quickcheck`.
    This will detect obvious BAM errors such as truncation.

    :param str bam_path: path to BAM file to checked

    :rtype: boolean
    :return: True if the BAM is valid, False is BAM is invalid or something related to the call went wrong


Question: Verify that the contents of the SecretData object are valid .

def Func ( arg_0 ) : if not isinstance ( arg_0 . value , bytes ) : raise TypeError ( "secret value must be bytes" ) elif not isinstance ( arg_0 . data_type , enums . SecretDataType ) : raise TypeError ( "secret data type must be a SecretDataType " "enumeration" ) arg_1 = len ( arg_0 . cryptographic_usage_masks ) for arg_2 in range ( arg_1 ) : arg_3 = arg_0 . cryptographic_usage_masks [ arg_2 ] if not isinstance ( arg_3 , enums . CryptographicUsageMask ) : arg_4 = "({0} in list)" . format ( arg_2 ) raise TypeError ( "secret data mask {0} must be a CryptographicUsageMask " "enumeration" . format ( arg_4 ) ) arg_5 = len ( arg_0 . names ) for arg_2 in range ( arg_5 ) : arg_6 = arg_0 . names [ arg_2 ] if not isinstance ( arg_6 , six . string_types ) : arg_4 = "({0} in list)" . format ( arg_2 ) raise TypeError ( "secret data name {0} must be a string" . format ( arg_4 ) )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Return a Tensor containing the patches

def Func ( arg_0 , arg_1 , arg_2 ) : def PIL2array ( arg_3 ) : return np . array ( arg_3 . getdata ( ) , dtype = np . uint8 ) . reshape ( 64 , 64 ) def find_files ( arg_4 , arg_5 ) : arg_6 = [ ] for arg_7 in os . listdir ( arg_4 ) : if arg_7 . endswith ( arg_5 ) : arg_6 . append ( os . path . join ( arg_4 , arg_7 ) ) return sorted ( arg_6 ) arg_8 = [ ] arg_9 = find_files ( arg_0 , arg_1 ) for arg_10 in arg_9 : arg_11 = Image . open ( arg_10 ) for arg_12 in range ( 0 , 1024 , 64 ) : for arg_13 in range ( 0 , 1024 , 64 ) : arg_14 = arg_11 . crop ( ( arg_13 , arg_12 , arg_13 + 64 , arg_12 + 64 ) ) arg_8 . append ( PIL2array ( arg_14 ) ) return torch . ByteTensor ( np . array ( arg_8 [ : arg_2 ] ) )

Verify course ID and retrieve course details.


Question: Configure plugin . Plugin is enabled by default .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . conf = arg_2 if not arg_1 . capture : arg_0 . enabled = False

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

        This is better than a serial dump+load when:
        1. The network connection is reliable.
        2. You don't need to save the dump file.

        The benefits of this over a dump+load are:
        1. Usually runs faster, since the load and dump happen in parallel.
        2. Usually takes up less disk space since no separate dump file is
            downloaded.


Question: Load . PyFunceble . yaml into the system .

def Func ( arg_0 ) : try : PyFunceble . CONFIGURATION . update ( Dict . from_yaml ( File ( arg_0 . path_to_config ) . read ( ) ) ) arg_0 . _install_iana_config ( ) arg_0 . _install_psl_config ( ) arg_0 . _install_directory_structure_file ( ) except FileNotFoundError as exception : if PyFunceble . path . isfile ( arg_0 . path_to_default_config ) : File ( arg_0 . path_to_default_config ) . copy ( arg_0 . path_to_config ) arg_0 . Func ( ) else : raise exception

Awake one process waiting to receive data on fd


Question: Corrects Wikipedia image markup .

def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = 0 for arg_4 in range ( len ( arg_1 ) ) : if arg_1 [ arg_4 ] == "[" : arg_2 += 1 if arg_1 [ arg_4 ] == "]" : arg_3 += 1 if arg_2 == arg_3 : return arg_1 [ : arg_4 + 1 ] return arg_1

Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.


Question: !DEMO! Simple file parsing generator

def Func ( arg_0 , arg_1 = None ) : with open ( arg_0 , arg_1 = arg_1 ) as source : for arg_2 in source : for arg_3 in arg_2 . split ( ) : yield arg_3

Remove procid from waitlists and reestablish it in the running list


Question: Takes one or more index files and optionally one structure file and returns a path for a new merged index file .

def Func ( * arg_0 ) : arg_1 = [ ] arg_2 = None for arg_3 in arg_0 : if arg_3 . endswith ( '.ndx' ) : arg_1 . append ( arg_3 ) else : if arg_2 is not None : raise ValueError ( "only one structure file supported" ) arg_2 = arg_3 arg_4 , arg_5 = tempfile . mkstemp ( suffix = '.ndx' , prefix = 'multi_' ) os . close ( arg_4 ) atexit . register ( os . unlink , arg_5 ) if arg_2 : arg_6 = registry [ 'Make_ndx' ] ( f = arg_2 , n = arg_1 , o = arg_5 ) else : arg_6 = registry [ 'Make_ndx' ] ( n = arg_1 , o = arg_5 ) arg_7 , arg_7 , arg_7 = arg_6 ( input = [ 'q' ] , stdout = False , stderr = False ) return arg_5

This function hides the error message when all values are correct.


Question: The Einstein Radius of this galaxy which is the sum of Einstein Radii of its mass profiles .

def Func ( arg_0 , arg_1 = 'arcsec' , arg_2 = None ) : if arg_0 . has_mass_profile : return sum ( map ( lambda p : p . Func ( arg_1 = arg_1 , arg_2 = arg_2 ) , arg_0 . mass_profiles ) ) else : return None

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

        Arguments:
            quantity (int): The number of IDs to reserve

        Returns:
            int[quantity]: List of IDs you've been granted


Question: Random sampler for equal_splits functions

def Func ( arg_0 , arg_1 ) : arg_2 = np . concatenate ( [ np . random . choice ( arg_0 , 2 , replace = False ) , np . random . choice ( arg_1 , 2 , replace = False ) ] ) return arg_2

Remove hidden notes and tag a CERN if detected.


Question: Run the PC algorithm .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_0 . arguments [ '{CITEST}' ] = arg_0 . dir_CI_test [ arg_0 . CI_test ] arg_0 . arguments [ '{METHOD_INDEP}' ] = arg_0 . dir_method_indep [ arg_0 . method_indep ] arg_0 . arguments [ '{DIRECTED}' ] = 'TRUE' arg_0 . arguments [ '{ALPHA}' ] = str ( arg_0 . alpha ) arg_0 . arguments [ '{NJOBS}' ] = str ( arg_0 . nb_jobs ) arg_0 . arguments [ '{VERBOSE}' ] = str ( arg_0 . verbose ) . upper ( ) arg_4 = arg_0 . _run_pc ( arg_1 , verbose = arg_0 . verbose ) return nx . relabel_nodes ( nx . DiGraph ( arg_4 ) , { arg_5 : arg_6 for arg_5 , arg_6 in enumerate ( arg_1 . columns ) } )

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted


Question: Returns an active connection cursor to the database .

def Func ( arg_0 , arg_1 = None ) : return Cursor ( arg_0 . client_connection , arg_0 . connection , arg_0 . djongo_connection )

Register a file reader for use in parse_config_file.

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

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

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

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

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


Question: Get information about a single role for the passed account SIS ID .

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . get_role ( arg_0 . _sis_id ( arg_1 , sis_field = "account" ) , arg_2 )

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


Question: Mix all values and make the query

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ 0 ] arg_3 = arg_1 [ 1 ] arg_4 = arg_1 [ 2 ] arg_5 = arg_0 . model if '.' in arg_2 : arg_6 = arg_2 . split ( '.' ) arg_7 = getattr ( arg_5 , arg_6 [ 0 ] , None ) arg_8 = arg_7 . property . mapper . class_ arg_9 = getattr ( arg_8 , arg_6 [ 1 ] ) return arg_7 . has ( OPERATORS [ arg_3 ] ( arg_9 , arg_4 ) ) return OPERATORS [ arg_3 ] ( getattr ( arg_5 , arg_2 , None ) , arg_4 )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: get home directory of remote host

def Func ( arg_0 , arg_1 ) : arg_2 = "echo ~" if not is_self ( arg_0 ) : arg_2 = ssh_remote_execute ( arg_2 , arg_0 , arg_1 ) arg_3 = subprocess . Popen ( arg_2 , shell = True , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) arg_4 = arg_3 . wait ( ) arg_5 = arg_3 . communicate ( ) if arg_4 != 0 : Log . error ( "Failed to get home path for remote host %s with output:\n%s" % ( arg_0 , arg_5 ) ) sys . exit ( - 1 ) return arg_5 [ 0 ] . strip ( "\n" )

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: Return a random sample from the distribution .

def Func ( arg_0 ) : if arg_0 . Funcr is None : arg_0 . Funcr = weighted_Funcr ( arg_0 . dictionary . keys ( ) , arg_0 . dictionary . values ( ) ) return arg_0 . Funcr ( )

Return an existing or new ConversationWidget.


Question: KISSinsights set - up template tag .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split_contents ( ) if len ( arg_2 ) > 1 : raise TemplateSyntaxError ( "'%s' takes no arguments" % arg_2 [ 0 ] ) return KissInsightsNode ( )

Drop a node from the network

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


Question: Build authorization URL for User Agent .

def Func ( arg_0 , arg_1 = None ) : if not arg_0 . client_id : raise AuthMissingError ( 'No client_id specified' ) return '{}?{}' . format ( arg_0 . auth_url_user , urllib . urlencode ( dict ( client_id = arg_0 . client_id , arg_1 = ' ' . join ( arg_1 or arg_0 . auth_scope ) , response_type = 'code' , redirect_uri = arg_0 . auth_redirect_uri ) ) )

Remove rows with NAs from the H2OFrame.

        :returns: new H2OFrame with all rows from the original frame containing any NAs removed.