Question: Runs one iteration of Hamiltonian Monte Carlo .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( [ ] if arg_0 . step_size_update_fn is None else ( arg_2 . extra . step_size_assign if mcmc_util . is_list_like ( arg_2 . extra . step_size_assign ) else [ arg_2 . extra . step_size_assign ] ) ) with tf . control_dependencies ( arg_3 ) : arg_4 , arg_5 = arg_0 . _impl . Func ( arg_1 , arg_2 ) if arg_0 . step_size_update_fn is not None : arg_6 = arg_0 . step_size_update_fn ( arg_0 . step_size , arg_5 ) arg_5 = arg_5 . _replace ( extra = HamiltonianMonteCarloExtraKernelResults ( arg_6 = arg_6 ) ) return arg_4 , arg_5

Modify an existing lock's timeout.

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


Question: Decorator to convert a function which takes a single value and returns a key into one which takes a list of values and returns a dict of key - group mappings .

def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = { } for arg_5 in arg_1 : arg_6 = arg_0 ( arg_5 , * arg_2 , ** arg_3 ) if arg_6 is not None : arg_4 . setdefault ( arg_6 , set ( ) ) . add ( arg_5 ) return arg_4 return wrapper


Question: Gets the AwsGlueCatalogHook

def Func ( arg_0 ) : if not hasattr ( arg_0 , 'hook' ) : from airflow . contrib . hooks . aws_glue_catalog_hook import AwsGlueCatalogHook arg_0 . hook = AwsGlueCatalogHook ( aws_conn_id = arg_0 . aws_conn_id , region_name = arg_0 . region_name ) return arg_0 . hook

A generator yielding all protobuf object data in the file. It is the
        main parser of the stream encoding.


Question: Sets plugin specific options used by plugins originating from this session object .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_1 in arg_0 . plugins : arg_1 = arg_0 . plugins [ arg_1 ] arg_1 . set_option ( arg_2 , arg_3 )

Propagate "clk" clock and reset "rst" signal to all subcomponents


Question: Enqueues a task directly . This is used when a task is retried or if a task was manually created .

def Func ( arg_0 , arg_1 ) : arg_2 = dumps ( arg_1 ) if arg_0 . _async : arg_0 . publisher_client . publish ( arg_0 . topic_path , arg_2 = arg_2 ) logger . info ( 'Task {} queued.' . format ( arg_1 . id ) ) else : arg_3 = unpickle ( arg_2 ) logger . info ( 'Executing task {} synchronously.' . format ( arg_3 . id ) ) with measure_time ( ) as summary , arg_0 . queue_context ( ) : arg_3 . execute ( queue = arg_0 ) summary ( arg_3 . summary ( ) ) return TaskResult ( arg_1 . id , arg_0 )

Unregister an extension code.  For testing only.


Question: Removes a single IP block from your account .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _perform_request ( url = '/ipblocks/' + arg_1 , method = 'DELETE' ) return arg_2

Creates a new node. Checks if the new node needs to know the trajectory.

        :param constructor:  The constructor to use
        :param full_name: Full name of node
        :param args: Arguments passed to constructor
        :param kwargs: Keyword arguments passed to the constructor
        :return:


Question: Returns the bounds of the index

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . interleaved return _Func ( arg_0 . handle , core . rt . Index_GetBounds , arg_1 )

Parses arguments for the command.

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


Question: Add captured log messages to error output .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . capturedLogging = records = arg_0 . formatLogRecords ( ) if not records : return arg_2 arg_4 , arg_5 , arg_6 = arg_2 return ( arg_4 , arg_0 . addCaptureToErr ( arg_5 , records ) , arg_6 )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Creates file copy in remote storage .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_2 = arg_0 . _build_effects ( arg_2 ) arg_5 = { 'source' : arg_0 . cdn_path ( arg_2 ) , 'target' : arg_1 } if arg_3 is not None : arg_5 [ 'make_public' ] = arg_3 if arg_4 is not None : arg_5 [ 'pattern' ] = arg_4 return rest_request ( 'POST' , 'files/' , arg_5 = arg_5 )

Convert this unnormalized batch to an instance of Batch.

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

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

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


Question: Build the filters and sizers for a field .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . name if not arg_3 and arg_0 . field . placeholder_image_name : arg_3 = arg_0 . field . placeholder_image_name arg_0 . filters = FilterLibrary ( arg_3 , arg_0 . storage , versatileimagefield_registry , arg_1 , arg_2 ) for ( arg_5 , arg_6 ) in iteritems ( versatileimagefield_registry . _sizedimage_registry ) : setattr ( arg_0 , arg_5 , arg_6 ( path_to_image = arg_3 , storage = arg_0 . storage , arg_2 = arg_2 , ppoi = arg_1 ) )


Question: Return the number of jobs for the given clientInfo and a status that is not completed .

def Func ( arg_0 , arg_1 ) : with ConnectionFactory . get ( ) as conn : arg_2 = 'SELECT count(job_id) ' 'FROM %s ' 'WHERE client_info = %%s ' ' AND status != %%s' % arg_0 . jobsTableName conn . cursor . execute ( arg_2 , [ arg_1 , arg_0 . STATUS_COMPLETED ] ) arg_3 = conn . cursor . fetchone ( ) [ 0 ] return arg_3

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


Question: Description header must preserve newlines ; all others need not

def Func ( arg_0 , arg_1 ) : if arg_0 . lower ( ) == 'description' : return '\n' . join ( [ arg_2 [ 8 : ] if arg_2 . startswith ( ' ' * 8 ) else arg_2 for arg_2 in arg_1 . strip ( ) . splitlines ( ) ] ) else : return ' ' . join ( [ arg_2 . strip ( ) for arg_2 in arg_1 . splitlines ( ) ] )

Extract metadata entries from an xml node


Question: Read color_names . txt and find the red green and blue values for a named color .

def Func ( arg_0 ) : arg_1 = os . path . dirname ( os . path . realpath ( inspect . getsourcefile ( lambda : 0 ) ) ) arg_2 = os . path . join ( arg_1 , 'color_names.txt' ) arg_3 = False for arg_4 in open ( arg_2 , 'r' ) : arg_4 = arg_4 . rstrip ( ) if arg_0 . lower ( ) == arg_4 . split ( ) [ 0 ] : arg_5 = arg_4 . split ( ) [ 2 ] arg_6 = arg_4 . split ( ) [ 3 ] arg_7 = arg_4 . split ( ) [ 4 ] arg_3 = True break if not arg_3 : print ( 'Color name "%s" not found, using default (white)' % arg_0 ) arg_5 = 255 arg_6 = 255 arg_7 = 255 return arg_5 , arg_6 , arg_7


Question: Checks whether we still need to do more work

def Func ( arg_0 ) : if not arg_0 . _is_topology_running ( ) : return False arg_1 = arg_0 . pplan_helper . context . get_cluster_config ( ) . get ( api_constants . TOPOLOGY_MAX_SPOUT_PENDING ) if not arg_0 . acking_enabled and arg_0 . output_helper . is_out_queue_available ( ) : return True elif arg_0 . acking_enabled and arg_0 . output_helper . is_out_queue_available ( ) and len ( arg_0 . in_flight_tuples ) < arg_1 : return True elif arg_0 . acking_enabled and not arg_0 . in_stream . is_empty ( ) : return True else : return False

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Wait for a Nomad job to start

def Func ( arg_0 , arg_1 ) : arg_2 = 0 while True : try : arg_3 = requests . get ( "http://%s:4646/v1/job/%s" % ( arg_0 , arg_1 ) ) if arg_3 . status_code == 200 and arg_3 . json ( ) [ "Status" ] == "running" : break else : raise RuntimeError ( ) except : Log . debug ( sys . exc_info ( ) [ 0 ] ) Log . info ( "Waiting for %s to come up... %s" % ( arg_1 , arg_2 ) ) time . sleep ( 1 ) if arg_2 > 20 : Log . error ( "Failed to start Nomad Cluster!" ) sys . exit ( - 1 ) arg_2 = arg_2 + 1

determines NetJSON channel_width radio attribute


Question: Process error .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , ** arg_5 ) : if not arg_0 . is_configured ( arg_1 . project ) : return arg_6 = arg_0 . get_option ( 'server_host' , arg_1 . project ) arg_7 = int ( arg_0 . get_option ( 'server_port' , arg_1 . project ) ) arg_8 = arg_0 . get_option ( 'prefix' , arg_1 . project ) arg_9 = arg_0 . get_option ( 'hostname' , arg_1 . project ) or socket . gethostname ( ) arg_10 = arg_1 . project . get_option ( 'sentry:resolve_age' , None ) arg_11 = int ( time . time ( ) ) arg_12 = '%s.%%s[%s]' % ( arg_8 , arg_1 . project . slug ) arg_13 = arg_1 . get_level_display ( ) arg_14 = arg_12 % arg_13 arg_15 = arg_1 . project . group_set . filter ( status = STATUS_UNRESOLVED ) if arg_10 : arg_16 = timezone . now ( ) - timedelta ( hours = int ( arg_10 ) ) arg_15 = arg_15 . filter ( last_seen__gt = arg_16 ) arg_17 = arg_15 . filter ( arg_13 = arg_1 . level ) . count ( ) arg_18 = Metric ( arg_9 , arg_14 , arg_17 , arg_11 ) log . info ( 'will send %s=%s to zabbix' , arg_14 , arg_17 ) send_to_zabbix ( [ arg_18 ] , arg_6 , arg_7 )


Question: Configure engines so that remote methods returning values of type real_type will instead return by proxy as type proxy_type

def Func ( arg_0 , arg_1 , arg_2 ) : if distob . engine is None : arg_0 . _initial_proxy_types [ arg_1 ] = arg_2 elif isinstance ( distob . engine , ObjectHub ) : distob . engine . _runtime_reg_proxy_type ( arg_1 , arg_2 ) else : distob . engine . _singleeng_reg_proxy_type ( arg_1 , arg_2 ) pass

Write the manifest content to the zip file. It must be a predictable
        order.


Question: Receive ACK in REBINDING state .

def Func ( arg_0 , arg_1 ) : logger . debug ( "C3. Received ACK?, in REBINDING state." ) if arg_0 . process_received_ack ( arg_1 ) : logger . debug ( "C3: T. Received ACK, in REBINDING state, " "raise BOUND." ) raise arg_0 . BOUND ( )

Given a single spinn3r feed entry, produce a single StreamItem.

    Returns 'None' if a complete item can't be constructed.


Question: if client_port is 0 any client_port is good

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = _loopback if arg_3 else _ethernet try : arg_4 . unpack ( arg_0 ) except Exception as ex : raise ValueError ( 'Bad header: %s' % ex ) arg_5 = getattr ( arg_4 . data , 'data' , None ) if type ( arg_5 ) != dpkt . tcp . TCP : raise ValueError ( 'Not a TCP packet' ) if arg_5 . dport == arg_2 : if arg_1 != 0 and arg_5 . sport != arg_1 : raise ValueError ( 'Request from different client' ) elif arg_5 . sport == arg_2 : if arg_1 != 0 and arg_5 . dport != arg_1 : raise ValueError ( 'Reply for different client' ) else : raise ValueError ( 'Packet not for/from client/server' ) return arg_4 . data

Get output raw data.

        This function won't work with multiprocessing, as it uses the
        ``threading.Lock()`` class.

        Parameters
        ----------
        tile : tuple, Tile or BufferedTile
            If a tile index is given, a tile from the output pyramid will be
            assumed. Tile cannot be bigger than process tile!

        Returns
        -------
        data : NumPy array or features
            process output


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

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = False ) : def sample_step ( arg_7 , arg_8 ) : arg_9 , arg_10 = arg_7 arg_11 = arg_0 ( arg_8 - 1 ) arg_12 = arg_1 ( arg_8 - 1 ) arg_13 = arg_11 . matmul ( arg_9 ) arg_14 = arg_13 + arg_12 . sample ( sample_shape = _augment_sample_shape ( arg_12 , arg_4 , arg_6 ) , seed = arg_5 ( ) ) [ ... , tf . newaxis ] arg_15 = arg_2 ( arg_8 ) arg_16 = arg_3 ( arg_8 ) arg_17 = arg_15 . matmul ( arg_14 ) arg_18 = arg_17 + arg_16 . sample ( sample_shape = _augment_sample_shape ( arg_16 , arg_4 , arg_6 ) , seed = arg_5 ( ) ) [ ... , tf . newaxis ] return ( arg_14 , arg_18 ) return sample_step

Returns the profile with the received ID as a dict

        If a local copy of the profile exists, it'll be returned. If not, it'll
        be downloaded from the web. The results are cached, so any subsequent
        calls won't hit the filesystem or the web.

        Args:
            profile_id (str): The ID of the profile you want.

        Raises:
            RegistryError: If there was some problem opening the profile file
                or its format was incorrect.


Question: Plot analytes as a function of time .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = 'log' , arg_8 = [ 10 , 4 ] , arg_9 = False , arg_10 = 'nanmean' , arg_11 = 'nanstd' , arg_12 = 'All_Analyses' ) : if arg_4 is None : arg_4 = arg_0 . focus_stage if arg_5 is None : arg_5 = arg_0 . report_dir + '/' + arg_4 if not os . path . isdir ( arg_5 ) : os . mkdir ( arg_5 ) if arg_12 is not None : arg_2 = arg_0 . _get_samples ( arg_12 ) elif arg_2 is None : arg_2 = arg_0 . subsets [ 'All_Analyses' ] elif isinstance ( arg_2 , str ) : arg_2 = [ arg_2 ] with arg_0 . pbar . set ( total = len ( arg_2 ) , desc = 'Drawing Plots' ) as prog : for arg_13 in arg_2 : arg_14 , arg_15 = arg_0 . data [ arg_13 ] . tplot ( arg_1 = arg_1 , arg_8 = arg_8 , arg_7 = arg_7 , arg_6 = arg_6 , arg_3 = arg_3 , arg_9 = arg_9 , arg_10 = arg_10 , arg_11 = arg_11 , focus_stage = arg_4 ) arg_14 . savefig ( arg_5 + '/' + arg_13 + '_traces.pdf' ) plt . close ( arg_14 ) prog . update ( ) return

Get the reason of this revocation.

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

        .. seealso::

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


Question: Returns an array of updates that have been sent from the buffer for an individual social media profile .

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = PATHS [ 'GET_SENT' ] % arg_0 . profile_id arg_3 = arg_0 . api . get ( arg_2 = arg_2 ) for arg_4 in arg_3 [ 'updates' ] : arg_1 . append ( Update ( api = arg_0 . api , raw_response = arg_4 ) ) arg_0 . __Func = arg_1 return arg_0 . __Func

Delete the specified cgroup.

        :param path: The path of the cgroup to delete.
        E.g. cpu/mygroup/mysubgroup


Question: Returns the minimum bounding rectangle as a tuple of min X min Y max X max Y .

def Func ( arg_0 ) : if arg_0 . _Func is None : arg_1 = arg_0 . affine . origin arg_2 = arg_1 [ 0 ] + arg_0 . ds . RasterXSize * arg_0 . affine . scale [ 0 ] arg_3 = arg_1 [ 1 ] + arg_0 . ds . RasterYSize * arg_0 . affine . scale [ 1 ] arg_0 . _Func = Envelope ( arg_1 [ 0 ] , arg_3 , arg_2 , arg_1 [ 1 ] ) return arg_0 . _Func


Question: Transform a named tuple into a dictionary

def Func ( arg_0 ) : return dict ( ( arg_1 , getattr ( arg_0 , arg_1 ) ) for arg_1 in arg_0 . _fields )

Returns mappable data for a random subset of voxels.

    May be useful as a baseline in predictive analyses--e.g., to compare
    performance of a more principled feature selection method with simple
    random selection.

    Args:
        dataset: A Dataset instance
        n_voxels: An integer specifying the number of random voxels to select.

    Returns:
        A 2D numpy array with (randomly-selected) voxels in rows and mappables
        in columns.


Question: Determines the rolling volatility of a strategy .

def Func ( arg_0 , arg_1 ) : return arg_0 . rolling ( arg_1 ) . std ( ) * np . sqrt ( APPROX_BDAYS_PER_YEAR )


Question: Add subfield into specified position .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None ) : arg_7 = record_get_subfields ( arg_0 , arg_1 , arg_5 = arg_5 , arg_6 = arg_6 ) if arg_4 is None : arg_7 . append ( ( arg_2 , arg_3 ) ) else : arg_7 . insert ( arg_4 , ( arg_2 , arg_3 ) )

This function creates the command list from available information


Question: Get a folder id from a path on the server .

def Func ( arg_0 ) : arg_1 . token = verify_credentials ( ) arg_3 = arg_0 . split ( '/' ) if arg_3 [ - 1 ] == '' : arg_3 . pop ( ) if arg_0 . startswith ( '/users/' ) : arg_3 . pop ( 0 ) arg_3 . pop ( 0 ) arg_4 = arg_3 . pop ( 0 ) arg_5 , arg_6 = arg_4 . split ( '_' ) arg_7 = arg_3 . pop ( ) arg_8 = arg_1 . communicator . get_user_by_name ( arg_5 , arg_6 ) arg_9 = _descend_folder_for_id ( arg_3 , arg_8 [ 'folder_id' ] ) return _search_folder_for_item_or_folder ( arg_7 , arg_9 ) elif arg_0 . startswith ( '/communities/' ) : print ( arg_3 ) arg_3 . pop ( 0 ) arg_3 . pop ( 0 ) arg_10 = arg_3 . pop ( 0 ) arg_7 = arg_3 . pop ( ) arg_11 = arg_1 . communicator . get_community_by_name ( arg_10 ) arg_9 = _descend_folder_for_id ( arg_3 , arg_11 [ 'folder_id' ] ) return _search_folder_for_item_or_folder ( arg_7 , arg_9 ) else : return False , - 1

Serialize a dataframe.

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


Question: Map a 1D array the same dimension as the grid to its original masked 2D array and return it as a scaled \ array .

def Func ( arg_0 , arg_1 ) : return scaled_array . ScaledSquarePixelArray ( array = arg_0 . array_2d_from_array_1d ( arg_1 ) , pixel_scale = arg_0 . mask . pixel_scale , origin = arg_0 . mask . origin )

Return whether the input course or program exist.


Question: Retrieves the domains of the users from elastic .

def Func ( arg_0 ) : arg_1 = User . search ( ) arg_1 . aggs . bucket ( 'domains' , 'terms' , field = 'domain' , order = { '_count' : 'desc' } , size = 100 ) arg_2 = arg_1 . execute ( ) return [ arg_3 . key for arg_3 in arg_2 . aggregations . domains . buckets ]


Question: Returns all task reschedules for the task instance and try number in ascending order .

def Func ( arg_0 , arg_1 ) : arg_2 = TaskReschedule return ( arg_1 . query ( arg_2 ) . filter ( arg_2 . dag_id == arg_0 . dag_id , arg_2 . task_id == arg_0 . task_id , arg_2 . execution_date == arg_0 . execution_date , arg_2 . try_number == arg_0 . try_number ) . order_by ( asc ( arg_2 . id ) ) . all ( ) )

Clean up stats file, if configured to do so.


Question: Add observations from column - major storage .

def Func ( arg_0 , arg_1 ) : arg_0 . append_records ( [ dict ( time = arg_2 , duration = arg_3 , value = arg_4 , confidence = arg_5 ) for ( arg_2 , arg_3 , arg_4 , arg_5 ) in six . moves . zip ( arg_1 [ 'time' ] , arg_1 [ 'duration' ] , arg_1 [ 'value' ] , arg_1 [ 'confidence' ] ) ] )

Initialize configuration.

        :param app: An instance of :class:`~flask.Flask`.


Question: Depth - first search .

def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = arg_0 . _root return arg_0 . _Func ( arg_1 )

Updates the SIS ID for the account identified by the passed account ID.

        https://canvas.instructure.com/doc/api/accounts.html#method.accounts.update


Question: This concatenates all text LCs for the given objectidlist .

def Func ( arg_0 , arg_1 , arg_2 = 'TF1' , arg_3 = '.gz' , arg_4 = 'rjd' , arg_5 = True , arg_6 = None , arg_7 = True , arg_8 = 32 , arg_9 = 1000 ) : if not arg_6 : arg_6 = 'pklcs' if not os . path . exists ( arg_6 ) : os . mkdir ( arg_6 ) arg_10 = [ ( arg_0 , arg_13 , { 'aperture' : arg_2 , 'postfix' : arg_3 , 'sortby' : arg_4 , 'normalize' : arg_5 , 'outdir' : arg_6 , 'recursive' : arg_7 } ) for arg_13 in arg_1 ] arg_11 = mp . Pool ( arg_8 , maxtasksperchild = arg_9 ) arg_12 = arg_11 . map ( parallel_concat_worker , arg_10 ) arg_11 . close ( ) arg_11 . join ( ) return { arg_13 : arg_14 for ( arg_13 , arg_14 ) in zip ( arg_1 , arg_12 ) }

Subtracts an estimate of the mean from signal x at axis


Question: Return a new GroupBy object using this frame and the desired grouping columns .

def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , str , int , [ str , int ] ) return GroupBy ( arg_0 , arg_1 )


Question: Enable markdown syntax in docstrings

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = "\n" . join ( arg_5 ) arg_7 = m2r ( arg_6 ) arg_7 . replace ( "\r\n" , "\n" ) del arg_5 [ : ] arg_5 . extend ( arg_7 . split ( "\n" ) )

End of a configuration session.
        Tells the router we're done managing admin functionality.


Question: Dumps a database table into a tab - delimited file

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . copy_expert ( "COPY {table} TO STDOUT" . format ( arg_1 = arg_1 ) , arg_2 )

Check that a binary operator is surrounded by exactly one space.


Question: Returns the public data for the specified X . 509 certificate associated with a hosted service .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : _validate_not_none ( 'service_name' , arg_1 ) _validate_not_none ( 'thumbalgorithm' , arg_2 ) _validate_not_none ( 'thumbprint' , arg_3 ) return arg_0 . _perform_get ( '/' + arg_0 . subscription_id + '/services/hostedservices/' + _str ( arg_1 ) + '/certificates/' + _str ( arg_2 ) + '-' + _str ( arg_3 ) + '' , Certificate )


Question: Create a new notebook and return its notebook_id .

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . increment_filename ( 'Untitled' ) arg_3 = arg_0 . Func_id ( arg_2 ) arg_4 = current . new_metadata ( arg_2 = arg_2 ) arg_5 = current . Func ( arg_4 = arg_4 ) with open ( arg_1 , 'w' ) as f : current . write ( arg_5 , f , u'json' ) return arg_3

Adjust contrast of an Image.

    Args:
        img (PIL Image): PIL Image to be adjusted.
        contrast_factor (float): How much to adjust the contrast. Can be any
            non negative number. 0 gives a solid gray image, 1 gives the
            original image while 2 increases the contrast by a factor of 2.

    Returns:
        PIL Image: Contrast adjusted image.


Question: For a given issue issue find its local UUID .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : if not arg_2 [ 'description' ] : raise ValueError ( 'Issue %s has no description.' % arg_2 ) arg_4 = set ( [ ] ) if arg_3 : arg_5 = arg_2 . get_default_description ( ) . rsplit ( '..' , 1 ) [ 0 ] arg_5 = arg_5 . split ( "'" ) [ 0 ] arg_6 = arg_0 . filter_tasks ( { 'description.startswith' : arg_5 , 'or' : [ ( 'status' , 'pending' ) , ( 'status' , 'waiting' ) , ] , } ) arg_4 = arg_4 | set ( [ task [ 'uuid' ] for task in arg_6 ] ) for arg_7 , arg_8 in six . iteritems ( arg_1 ) : if any ( [ arg_9 in arg_2 for arg_9 in arg_8 ] ) : arg_6 = arg_0 . filter_tasks ( { 'and' : [ ( "%s.is" % arg_9 , arg_2 [ arg_9 ] ) for arg_9 in arg_8 ] , 'or' : [ ( 'status' , 'pending' ) , ( 'status' , 'waiting' ) , ] , } ) arg_4 = arg_4 | set ( [ task [ 'uuid' ] for task in arg_6 ] ) if len ( arg_4 ) == 1 : return arg_4 . pop ( ) if len ( arg_4 ) > 1 : raise MultipleMatches ( "Issue %s matched multiple IDs: %s" % ( arg_2 [ 'description' ] , arg_4 ) ) raise NotFound ( "No issue was found matching %s" % arg_2 )

Generate RENEWING time.

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

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


Question: Returns the distribution s required args .

def Func ( arg_0 ) : arg_1 = tf_inspect . getfullargspec ( arg_0 ) arg_2 = arg_1 . args if tf_inspect . isclass ( arg_0 ) : arg_2 = arg_2 [ 1 : ] if arg_1 . defaults : arg_2 = arg_2 [ : - len ( arg_1 . defaults ) ] return tuple ( arg_2 )

Calculate hexadecimal representation of the phrase.


Question: Set neurosynth s logging level

def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = os . environ . get ( 'NEUROSYNTH_LOGLEVEL' , 'warn' ) if arg_0 is not None : logger . setLevel ( getattr ( logging , arg_0 . upper ( ) ) ) return logger . getEffectiveLevel ( )

Returns a list of the dicom files within root_path

    Parameters
    ----------
    root_path: str
    Path to the directory to be recursively searched for DICOM files.

    Returns
    -------
    dicoms: set
    Set of DICOM absolute file paths


Question: Takes the names from the graph in a given namespace and the erroneous names from the same namespace and returns them together as a unioned set

def Func ( arg_0 : arg_1 ) -> Mapping [ str , Set [ str ] ] : return { arg_2 : Func_by_namespace ( arg_0 , arg_2 ) for arg_2 in get_namespaces ( arg_0 ) }


Question: Final rollback initiated by the environment

def Func ( arg_0 , arg_1 = True ) : arg_0 . _is_run = False arg_0 . f_set_crun ( None ) if arg_1 : arg_0 . f_store ( only_init = True )

Returns a DataFrame of offensive team splits for a season.

        :year: int representing the season.
        :returns: Pandas DataFrame of split data.


Question: Increments the number of times this resource has been modified by all processes .

def Func ( arg_0 ) : arg_1 = arg_0 . conn . client . incr ( arg_0 . times_modified_key ) arg_0 . conn . client . pexpire ( arg_0 . times_modified_key , phonon . s_to_ms ( TTL ) )

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Obtain a list of cross - validation models .

def Func ( arg_0 ) : arg_1 = arg_0 . _model_json [ "output" ] [ "Func" ] if arg_1 is None : return None arg_2 = [ ] for arg_3 in arg_1 : arg_2 . append ( h2o . get_model ( arg_3 [ "name" ] ) ) return arg_2

Adds a topology in the local cache, and sets a watch
    on any changes on the topology.


Question: This is a basic full - text index keygen function . Words are lowercased split by whitespace and stripped of punctuation from both ends before an inverted index is created for term searching .

def Func ( arg_0 ) : if isinstance ( arg_0 , float ) : arg_0 = repr ( arg_0 ) elif arg_0 in ( None , '' ) : return None elif not isinstance ( arg_0 , six . string_types ) : if six . PY3 and isinstance ( arg_0 , bytes ) : arg_0 = arg_0 . decode ( 'latin-1' ) else : arg_0 = str ( arg_0 ) arg_1 = sorted ( set ( [ x for x in [ arg_2 . lower ( ) . strip ( string . punctuation ) for arg_2 in arg_0 . split ( ) ] if x ] ) ) if not isinstance ( arg_0 , str ) : return [ arg_2 . encode ( 'utf-8' ) for arg_2 in arg_1 ] return arg_1

Cycles through notifications with latest results from data feeds.


Question: Store a populate failed event .

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_5 ] = None ) -> 'Action' : arg_6 = arg_0 . make_populate_failed ( arg_1 ) _store_helper ( arg_6 , arg_3 = arg_3 ) return arg_6

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

        See `Annotation.trim` for details about how the annotations
        are trimmed.

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

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

        Note: trimming does not affect the duration of the jam, i.e. the value
        of ``JAMS.file_metadata.duration`` will be the same for the original
        and trimmed jams.

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

        Returns
        -------
        jam_trimmed : JAMS
            The trimmed jam with trimmed annotations, returned as a new JAMS
            object.


Question: Logs all elements of this streamlet . This returns nothing

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

Creates a TFS TFVC Client to pull TFVC repo info


Question: Output PubMed identifiers from a graph to a stream .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) : for arg_4 in get_pubmed_identifiers ( arg_0 ) : click . echo ( arg_4 , file = arg_2 )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

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

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

    Returns
    -------

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


Question: r Perform gamma correction on an image .

def Func ( arg_0 , arg_1 , arg_2 = 1 ) : if not _is_pil_image ( arg_0 ) : raise TypeError ( 'img should be PIL Image. Got {}' . format ( type ( arg_0 ) ) ) if arg_1 < 0 : raise ValueError ( 'Gamma should be a non-negative real number' ) arg_3 = arg_0 . mode arg_0 = arg_0 . convert ( 'RGB' ) arg_4 = [ 255 * arg_2 * pow ( ele / 255. , arg_1 ) for ele in range ( 256 ) ] * 3 arg_0 = arg_0 . point ( arg_4 ) arg_0 = arg_0 . convert ( arg_3 ) return arg_0

Show course track selection page for the enterprise.

        Based on `enterprise_uuid` in URL, the view will decide which
        enterprise customer's course enrollment page is to use.

        Unauthenticated learners will be redirected to enterprise-linked SSO.

        A 404 will be raised if any of the following conditions are met:
            * No enterprise customer uuid kwarg `enterprise_uuid` in request.
            * No enterprise customer found against the enterprise customer
                uuid `enterprise_uuid` in the request kwargs.
            * No course is found in database against the provided `course_id`.


Question: Sets the main raw inputs and secondary inputs on the init process

def Func ( arg_0 ) : logger . debug ( "========================" ) logger . debug ( "Setting secondary inputs" ) logger . debug ( "========================" ) arg_1 = arg_0 . processes [ 0 ] logger . debug ( "Setting main raw inputs: " "{}" . format ( arg_0 . main_raw_inputs ) ) arg_1 . set_raw_inputs ( arg_0 . main_raw_inputs ) logger . debug ( "Setting extra inputs: {}" . format ( arg_0 . extra_inputs ) ) arg_1 . set_extra_inputs ( arg_0 . extra_inputs )

This attempts to fix the easy errors raised by ValidationError.
        This includes removing items from the cart that are no longer
        available, recalculating all of the discounts, and removing voucher
        codes that are no longer available.


Question: This is an example how to sort votes prior to using them in the Object

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( "prefix" , default_prefix ) arg_2 [ "votes" ] = list ( set ( arg_2 [ "votes" ] ) ) return OrderedDict ( [ ( "memo_key" , PublicKey ( arg_2 [ "memo_key" ] , arg_3 = arg_3 ) ) , ( "voting_account" , ObjectId ( arg_2 [ "voting_account" ] , "account" ) ) , ( "num_witness" , Uint16 ( arg_2 [ "num_witness" ] ) ) , ( "num_committee" , Uint16 ( arg_2 [ "num_committee" ] ) ) , ( "votes" , Array ( [ VoteId ( arg_4 ) for arg_4 in arg_2 [ "votes" ] ] ) ) , ( "extensions" , Set ( [ ] ) ) , ] )

if is negated return original cond and negated flag


Question: Un - fullscreen the current window

def Func ( arg_0 , arg_1 ) : arg_0 . bot . canvas . sink . trigger_fullscreen_action ( False ) print ( arg_0 . response_prompt , file = arg_0 . stdout )


Question: Return usage information about a context or function .

def Func ( arg_0 ) : arg_1 = "" if isinstance ( arg_0 , dict ) : arg_2 = context_name ( arg_0 ) arg_1 = "\n" + arg_2 + "\n\n" arg_3 = inspect . getdoc ( arg_0 ) if arg_3 is not None : arg_3 = inspect . cleandoc ( arg_3 ) arg_1 += arg_3 + '\n' return arg_1 arg_4 = arg_0 . metadata . signature ( ) arg_3 = inspect . getdoc ( arg_0 ) if arg_3 is not None : arg_3 = inspect . cleandoc ( arg_3 ) arg_1 += "\n" + arg_4 + "\n\n" if arg_3 is not None : arg_1 += arg_3 + '\n' if inspect . isclass ( arg_0 ) : arg_0 = arg_0 . __init__ if arg_0 . metadata . load_from_doc : return arg_1 arg_1 += "\nArguments:\n" for arg_5 , arg_6 in arg_0 . metadata . annotated_params . items ( ) : arg_7 = arg_6 . type_name arg_8 = "" if arg_6 . desc is not None : arg_8 = arg_6 . desc arg_1 += "  - %s (%s): %s\n" % ( arg_5 , arg_7 , arg_8 ) return arg_1

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: Subdivide groups of paths according to a function .

def Func ( arg_0 , arg_1 , arg_2 = '?' , arg_3 = False , * arg_4 , ** arg_5 ) : arg_6 , arg_7 , arg_8 = { } , 0 , len ( arg_0 ) for arg_9 , arg_10 in enumerate ( arg_0 . values ( ) ) : out . write ( "Subdividing group %d of %d by %s... (%d files examined, %d " "in current group)" % ( arg_9 + 1 , arg_8 , arg_2 , arg_7 , len ( arg_10 ) ) ) for arg_11 , arg_12 in arg_1 ( arg_10 , * arg_4 , ** arg_5 ) . items ( ) : arg_6 . setdefault ( arg_11 , set ( ) ) . update ( arg_12 ) arg_7 += len ( arg_12 ) if not arg_3 : arg_6 = dict ( [ ( x , arg_6 [ x ] ) for x in arg_6 if len ( arg_6 [ x ] ) > 1 ] ) out . write ( "Found %s sets of files with identical %s. (%d files examined)" % ( len ( arg_6 ) , arg_2 , arg_7 ) , newline = True ) return arg_6

Get the reason of this revocation.

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

        .. seealso::

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


Question: Parse filename appropriately and then output calls according to the args specified .

def Func ( arg_0 , arg_1 ) : arg_2 = os . path . dirname ( arg_0 ) if os . path . isfile ( arg_0 ) : arg_3 = _parse_file ( arg_0 , arg_2 ) elif os . path . isdir ( arg_0 ) : arg_3 = _parse_dir ( arg_0 , arg_2 ) else : _error ( "Could not determine file type: %r" , arg_0 ) if not arg_3 : _error ( "No pyconfig calls." ) if arg_1 . load_configs : arg_4 = set ( ) for arg_5 in arg_3 : arg_4 . add ( arg_5 . key ) arg_6 = pyconfig . Config ( ) for arg_7 , arg_8 in arg_6 . settings . items ( ) : if arg_7 in arg_4 : continue arg_3 . append ( _PyconfigCall ( 'set' , arg_7 , arg_8 , [ None ] * 4 ) ) _output ( arg_3 , arg_1 )

Resolves VirtualEnvironments in CPENV_HOME


Question: Adds the subparsers to an argparse . ArgumentParser

def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_0 , "subparser_group" , None ) if arg_2 : arg_2 . add_to_parser ( arg_0 ) if not arg_0 . subparsers : return arg_3 = arg_0 . subparsers_args or arg_0 . get_default_subparsers_args ( ) arg_4 = arg_0 . subparsers_kwargs or arg_0 . get_default_subparsers_kwargs ( ) arg_5 = arg_1 . Func ( * arg_3 , ** arg_4 ) for arg_6 in arg_0 . subparsers : arg_6 . add_to_parser ( arg_5 )

display connection info, and store ports


Question: Computes the results by using the ground truth dataset identified by the annotator parameter .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = 251 , arg_6 = 0 ) : if arg_4 [ "hier" ] : arg_7 , arg_8 , arg_9 = msaf . io . read_hier_references ( arg_1 , annotation_id = arg_6 , exclude_levels = [ "segment_salami_function" ] ) else : arg_10 = jams . load ( arg_1 , validate = False ) arg_11 = arg_10 . search ( namespace = 'segment_.*' ) [ arg_6 ] arg_12 , arg_8 = arg_11 . to_interval_values ( ) arg_13 , arg_14 = io . read_estimations ( arg_0 , arg_2 , arg_3 , ** arg_4 ) logging . info ( "Evaluating %s" % os . path . basename ( arg_0 ) ) if arg_4 [ "hier" ] : assert len ( arg_13 ) == len ( arg_14 ) , "Same number of levels " "are required in the boundaries and labels for the hierarchical " "evaluation." arg_15 = [ ] arg_14 = [ ] arg_13 = sorted ( arg_13 , key = lambda level : len ( level ) ) for arg_16 in arg_13 : arg_15 . append ( msaf . utils . intervals_to_times ( arg_16 ) ) arg_14 . append ( np . ones ( len ( arg_15 [ - 1 ] ) - 1 ) * - 1 ) utils . align_end_hierarchies ( arg_15 , arg_7 , thres = 1 ) arg_17 = [ utils . times_to_intervals ( times ) for times in arg_15 ] arg_18 = [ utils . times_to_intervals ( times ) for times in arg_7 ] arg_19 = { } arg_19 [ "t_recall10" ] , arg_19 [ "t_precision10" ] , arg_19 [ "t_measure10" ] = mir_eval . hierarchy . tmeasure ( arg_18 , arg_17 , window = 10 ) arg_19 [ "t_recall15" ] , arg_19 [ "t_precision15" ] , arg_19 [ "t_measure15" ] = mir_eval . hierarchy . tmeasure ( arg_18 , arg_17 , window = 15 ) arg_19 [ "track_id" ] = os . path . basename ( arg_0 ) [ : - 5 ] return arg_19 else : return compute_results ( arg_12 , arg_13 , arg_8 , arg_14 , arg_5 , arg_0 )

Receive ASGI websocket messages, ensuring valid state transitions.


Question: Sets the base font for the ConsoleWidget to the specified QFont .

def Func ( arg_0 , arg_1 ) : arg_2 = QtGui . QFontMetrics ( arg_1 ) arg_0 . _control . setTabStopWidth ( arg_0 . tab_width * arg_2 . width ( ' ' ) ) arg_0 . _completion_widget . setFont ( arg_1 ) arg_0 . _control . document ( ) . setDefaultFont ( arg_1 ) if arg_0 . _page_control : arg_0 . _page_control . document ( ) . setDefaultFont ( arg_1 ) arg_0 . font_changed . emit ( arg_1 )

True if the credential is expired or invalid.

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


Question: create a new frontend attached to the same kernel as the current tab

def Func ( arg_0 ) : arg_1 = arg_0 . tab_widget . currentWidget ( ) arg_2 = arg_0 . tab_widget . indexOf ( arg_1 ) arg_3 = arg_0 . tab_widget . tabText ( arg_2 ) arg_4 = arg_0 . slave_frontend_factory ( arg_1 ) if 'slave' in arg_3 : arg_5 = arg_3 else : arg_5 = '(%s) slave' % arg_3 arg_0 . add_tab_with_frontend ( arg_4 , arg_5 = arg_5 )

Raise an exception if string doesn't match a part's regex

    :param string: str
    :param part: a key in the PARTS dict
    :raises: ValueError, TypeError


Question: Calculates bubble point for a given pressure

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : def bubble_P_error ( arg_5 ) : arg_6 = [ VP ( arg_5 ) for VP in arg_2 ] arg_7 = bubble_at_T ( arg_1 , arg_6 , arg_3 , arg_4 ) return arg_0 - arg_7 arg_8 = newton ( bubble_P_error , 300 ) return arg_8

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: Converts all DICOM files within work_dir into one or more NifTi files by calling dcm2nii on this folder .

def Func ( arg_0 , arg_1 = '' ) : if not op . exists ( arg_0 ) : raise IOError ( 'Folder {} not found.' . format ( arg_0 ) ) arg_2 = 'dcm2nii {0} "{1}"' . format ( arg_1 , arg_0 ) log . info ( arg_2 ) return subprocess . check_call ( arg_2 , shell = True )


Question: Group the nodes occurring in edges by the given annotation .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = 'Subgraph' ) -> Mapping [ arg_3 , Set [ BaseEntity ] ] : arg_4 = defaultdict ( set ) for arg_5 , arg_6 , arg_7 in arg_0 . edges ( data = True ) : if not edge_has_annotation ( arg_7 , arg_2 ) : continue arg_4 [ arg_7 [ ANNOTATIONS ] [ arg_2 ] ] . add ( arg_5 ) arg_4 [ arg_7 [ ANNOTATIONS ] [ arg_2 ] ] . add ( arg_6 ) return dict ( arg_4 )

Connect to the stream

        Returns
        -------
        asyncio.coroutine
            The streaming response


Question: Get a queue that allows direct access to the internal buffer . If the dataset to be read is chunked the block_size should be a multiple of the chunk size to maximise performance . In this case it is best to leave it to the default . When cyclic = False and block_size does not divide the dataset evenly the remainder elements will not be returned by the queue . When cyclic = True the remainder elements will be part of a block that wraps around the end and includes element from the beginning of the dataset . By default blocks are returned in the order in which they become available . The ordered option will force blocks to be returned in on - disk order .

def Func ( arg_0 , arg_1 , arg_2 = 4 , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = False ) : arg_7 = arg_0 . __get_batch ( arg_1 , arg_5 ) arg_5 = arg_7 . shape [ 0 ] if arg_3 is None : arg_3 = 2 * arg_2 + 1 arg_8 = SharedCircBuf ( arg_3 , arg_7 ) arg_9 = multiprocessing . Event ( ) arg_10 = Barrier ( arg_2 ) arg_11 = GuardSynchronizer ( ) if arg_6 else None arg_12 = [ ] for arg_13 in range ( arg_2 ) : arg_14 = multiprocessing . Process ( target = _Streamer__read_process , args = ( arg_0 , arg_1 , arg_5 , arg_8 , arg_9 , arg_10 , arg_4 , arg_13 * arg_5 , arg_2 * arg_5 , arg_11 ) ) arg_14 . daemon = True arg_14 . start ( ) arg_12 . append ( arg_14 ) if not arg_4 : def monitor ( ) : for arg_16 in arg_12 : arg_16 . join ( ) arg_8 . close ( ) arg_17 = threading . Thread ( target = monitor ) arg_17 . daemon = True arg_17 . start ( ) return Streamer . Queue ( arg_8 , arg_9 , arg_5 )

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


Question: Create a new instance of a game . Note a mode MUST be provided and MUST be of type GameMode .

def Func ( arg_0 , arg_1 ) : arg_2 = DigitWord ( wordtype = arg_1 . digit_type ) arg_2 . random ( arg_1 . digits ) arg_0 . _key = str ( uuid . uuid4 ( ) ) arg_0 . _status = "" arg_0 . _ttl = 3600 arg_0 . _answer = arg_2 arg_0 . _mode = arg_1 arg_0 . _guesses_remaining = arg_1 . guesses_allowed arg_0 . _guesses_made = 0

Writes the contents of this model's in-memory prediction cache to a permanent
    store via the prediction output stream instance


Question: Get a signed unauthenticated URL .

def Func ( arg_0 , arg_1 ) : if not is_valid_uuid ( arg_1 ) : raise StorageArgumentException ( 'Invalid UUID for file_id: {0}' . format ( arg_1 ) ) return arg_0 . _authenticated_request . to_endpoint ( 'file/{}/content/secure_link/' . format ( arg_1 ) ) . return_body ( ) . get ( ) [ 'signed_url' ]

Runs statistical profiler on a function.


Question: Get information about a specific customer .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_0 . store_id = arg_1 arg_0 . customer_id = arg_2 return arg_0 . _mc_client . _Func ( url = arg_0 . _build_path ( arg_1 , 'customers' , arg_2 ) , ** arg_3 )

Configure engines so that remote methods returning values of type
        `real_type` will instead return by proxy, as type `proxy_type`


Question: Set all the size class masses and H20_mass in the package to zero and the solid_density to 1 . 0

def Func ( arg_0 ) : arg_0 . solid_density = 1.0 arg_0 . H2O_mass = 0.0 arg_0 . size_class_masses = arg_0 . size_class_masses * 0.0

Return pairs of run ids and results of finish event loops.


Question: Returns the offset_front_id which corresponds to the offset front which occurs first entirely after the given onset sample_idx .

def Func ( arg_0 , arg_1 ) : arg_2 = [ i for i in np . unique ( arg_1 ) if i != 0 ] arg_3 = - 1 arg_4 = sys . maxsize for arg_5 in arg_2 : arg_6 = _get_front_idxs_from_id ( arg_1 , arg_5 ) arg_7 = [ s for _f , s in arg_6 ] arg_8 = min ( arg_7 ) if arg_8 > arg_0 and arg_8 < arg_4 : arg_4 = arg_8 arg_3 = arg_5 assert arg_3 > 1 or arg_3 == - 1 return arg_3


Question: Get item of chunk meta table

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_0 . envs [ "NUM_CHK" ] arg_6 = arg_0 . envs [ "NUM_PU" ] arg_7 = arg_2 * arg_6 * arg_5 + arg_3 * arg_5 + arg_4 return arg_1 [ arg_7 ]

returns a configuration object

    :param string config_file: path to config file


Question: Select file path by access time .

def Func ( arg_0 , arg_1 = 0 , arg_2 = arg_3 , arg_4 = True ) : def filters ( arg_5 ) : return arg_1 <= arg_5 . atime <= arg_2 return arg_0 . select_file ( filters , arg_4 )

This endpoint reverts the job to an older version.

           https://www.nomadproject.io/docs/http/job.html

            arguments:
              - id
              - version, Specifies the job version to revert to.
            optional_arguments:
              - enforce_prior_version, Optional value specifying the current job's version.
                                       This is checked and acts as a check-and-set value before reverting to the
                                       specified job.
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException


Question: Parse a Newick formatted string into a Node object .

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : if arg_1 : arg_0 = COMMENT . sub ( '' , arg_0 ) arg_0 = arg_0 . strip ( ) arg_3 = arg_0 . split ( ')' ) if len ( arg_3 ) == 1 : arg_4 , arg_5 = [ ] , arg_0 else : if not arg_3 [ 0 ] . startswith ( '(' ) : raise ValueError ( 'unmatched braces %s' % arg_3 [ 0 ] [ : 100 ] ) arg_4 = list ( _parse_siblings ( ')' . join ( arg_3 [ : - 1 ] ) [ 1 : ] , ** arg_2 ) ) arg_5 = arg_3 [ - 1 ] arg_6 , arg_7 = _parse_name_and_length ( arg_5 ) return Node . create ( arg_6 = arg_6 , arg_7 = arg_7 , arg_4 = arg_4 , ** arg_2 )

Returns mappable data for a random subset of voxels.

    May be useful as a baseline in predictive analyses--e.g., to compare
    performance of a more principled feature selection method with simple
    random selection.

    Args:
        dataset: A Dataset instance
        n_voxels: An integer specifying the number of random voxels to select.

    Returns:
        A 2D numpy array with (randomly-selected) voxels in rows and mappables
        in columns.


Question: Nicely format a list of line numbers .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = 0 arg_4 = 0 arg_5 = None arg_0 = sorted ( arg_0 ) arg_1 = sorted ( arg_1 ) while arg_3 < len ( arg_0 ) and arg_4 < len ( arg_1 ) : if arg_0 [ arg_3 ] == arg_1 [ arg_4 ] : if arg_5 == None : arg_5 = arg_1 [ arg_4 ] arg_6 = arg_1 [ arg_4 ] arg_4 += 1 elif arg_5 : arg_2 . append ( ( arg_5 , arg_6 ) ) arg_5 = None arg_3 += 1 if arg_5 : arg_2 . append ( ( arg_5 , arg_6 ) ) arg_7 = ', ' . join ( map ( nice_pair , arg_2 ) ) return arg_7

Validates the model using a series of checks on bits of the data.


Question: Keeps all user supplied options the same but resets counters etc .

def Func ( arg_0 , arg_1 = None ) : arg_0 . _num_iter = 0 arg_0 . _inner_run_counter = 0 arg_0 . _J_update_counter = arg_0 . update_J_frequency arg_0 . _fresh_JTJ = False arg_0 . _has_run = False if arg_1 is not None : arg_0 . damping = np . array ( arg_1 ) . astype ( 'float' ) arg_0 . _set_err_paramvals ( )

Creates a layer from its config.

    This method is the reverse of `get_config`, capable of instantiating the
    same layer from the config dictionary.

    Args:
      config: A Python dictionary, typically the output of `get_config`.

    Returns:
      layer: A layer instance.


Question: connects and optionally authenticates a connection .

def Func ( arg_0 ) : arg_0 . connect ( arg_0 . host , arg_0 . port ) if arg_0 . user : arg_0 . starttls ( ) arg_0 . login ( arg_0 . user , arg_0 . password )

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


Question: Parse case information from config or PED files .

def Func ( arg_0 ) : if 'owner' not in arg_0 : raise ConfigError ( "A case has to have a owner" ) if 'family' not in arg_0 : raise ConfigError ( "A case has to have a 'family'" ) arg_1 = parse_individuals ( arg_0 [ 'samples' ] ) arg_2 = { 'owner' : arg_0 [ 'owner' ] , 'collaborators' : [ arg_0 [ 'owner' ] ] , 'case_id' : arg_0 [ 'family' ] , 'display_name' : arg_0 . get ( 'family_name' , arg_0 [ 'family' ] ) , 'genome_build' : arg_0 . get ( 'human_genome_build' ) , 'rank_model_version' : arg_0 . get ( 'rank_model_version' ) , 'rank_score_threshold' : arg_0 . get ( 'rank_score_threshold' , 0 ) , 'analysis_date' : arg_0 [ 'analysis_date' ] , 'individuals' : arg_1 , 'vcf_files' : { 'vcf_snv' : arg_0 . get ( 'vcf_snv' ) , 'vcf_sv' : arg_0 . get ( 'vcf_sv' ) , 'vcf_str' : arg_0 . get ( 'vcf_str' ) , 'vcf_cancer' : arg_0 . get ( 'vcf_cancer' ) , 'vcf_snv_research' : arg_0 . get ( 'vcf_snv_research' ) , 'vcf_sv_research' : arg_0 . get ( 'vcf_sv_research' ) , 'vcf_cancer_research' : arg_0 . get ( 'vcf_cancer_research' ) , } , 'default_panels' : arg_0 . get ( 'default_gene_panels' , [ ] ) , 'gene_panels' : arg_0 . get ( 'gene_panels' , [ ] ) , 'assignee' : arg_0 . get ( 'assignee' ) , 'peddy_ped' : arg_0 . get ( 'peddy_ped' ) , 'peddy_sex' : arg_0 . get ( 'peddy_sex' ) , 'peddy_check' : arg_0 . get ( 'peddy_check' ) , 'delivery_report' : arg_0 . get ( 'delivery_report' ) , 'multiqc' : arg_0 . get ( 'multiqc' ) , 'track' : arg_0 . get ( 'track' , 'rare' ) , } if 'madeline' in arg_0 : arg_3 = Path ( arg_0 [ 'madeline' ] ) if not arg_3 . exists ( ) : raise ValueError ( "madeline path not found: {}" . format ( arg_3 ) ) with arg_3 . open ( 'r' ) as in_handle : arg_2 [ 'madeline_info' ] = in_handle . read ( ) if ( arg_2 [ 'vcf_files' ] [ 'vcf_cancer' ] or arg_2 [ 'vcf_files' ] [ 'vcf_cancer_research' ] ) : arg_2 [ 'track' ] = 'cancer' return arg_2

Validate that the name is a valid GCS bucket.


Question: Given the total number of items determine the number of items that can be added to each bin with a limit on the bin size .

def Func ( arg_0 , arg_1 ) : arg_2 = int ( math . ceil ( arg_0 / float ( arg_1 ) ) ) arg_3 = [ 0 ] * arg_2 for arg_4 in range ( arg_0 ) : arg_3 [ arg_4 % arg_2 ] += 1 return arg_3

Ask Skype for the authenticated user's identifier, and store it on the connection object.


Question: Simple replacement for numpy linspace

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 == 1 : return [ arg_1 ] arg_4 = [ 0.0 ] * arg_3 arg_5 = arg_3 - 1 arg_6 = 1.0 / arg_5 for arg_7 in range ( arg_3 ) : arg_4 [ arg_7 ] = arg_6 * ( arg_1 * ( arg_5 - arg_7 ) + arg_2 * arg_7 ) return arg_4

Deletes a transfer job. This is a soft delete. After a transfer job is
        deleted, the job and all the transfer executions are subject to garbage
        collection. Transfer jobs become eligible for garbage collection
        30 days after soft delete.

        :param job_name: (Required) Name of the job to be deleted
        :type job_name: str
        :param project_id: (Optional) the ID of the project that owns the Transfer
            Job. If set to None or missing, the default project_id from the GCP
            connection is used.
        :type project_id: str
        :rtype: None


Question: Print the n most common words and counts in the freqs dict .

def Func ( arg_0 , arg_1 = 10 ) : arg_2 , arg_3 = arg_0 . keys ( ) , arg_0 . values ( ) arg_4 = zip ( arg_3 , arg_2 ) arg_4 . sort ( reverse = True ) for ( arg_5 , arg_6 ) in arg_4 [ : arg_1 ] : print ( arg_6 , arg_5 )

Verify that the ENV defined NVMe device exists


Question: Decodes a set of images .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = 4 , arg_4 = None , ** arg_5 ) : if isinstance ( arg_1 , string_types ) : arg_1 = [ arg_1 ] if isinstance ( arg_1 , list ) : arg_6 = imageutils . load_imgs ( arg_1 , arg_0 . masker ) else : arg_6 = arg_1 arg_7 = { 'pearson' : arg_0 . _pearson_correlation , 'dot' : arg_0 . _dot_product , 'roi' : arg_0 . _roi_association } arg_8 = np . around ( arg_7 [ arg_0 . method ] ( arg_6 , ** arg_5 ) , arg_3 ) if arg_4 is None : if type ( arg_1 ) . __module__ == np . __name__ : arg_4 = [ 'image_%d' % i for i in range ( arg_1 . shape [ 1 ] ) ] elif arg_0 . method == 'roi' : arg_4 = [ 'cluster_%d' % i for i in range ( arg_8 . shape [ 1 ] ) ] else : arg_4 = arg_1 arg_8 = pd . DataFrame ( arg_8 , columns = arg_4 , index = arg_0 . feature_names ) if arg_2 is not None : arg_8 . to_csv ( arg_2 , index_label = 'Feature' ) return arg_8


Question: Deserialize via capnp

def Func ( arg_0 , arg_1 ) : arg_2 = object . __new__ ( arg_0 ) super ( PreviousValueModel , arg_2 ) . __init__ ( arg_1 = arg_1 . modelBase ) arg_2 . _logger = opf_utils . initLogger ( arg_2 ) if len ( arg_1 . predictedField ) : arg_2 . _predictedField = arg_1 . predictedField else : arg_2 . _predictedField = None arg_2 . _fieldNames = list ( arg_1 . fieldNames ) arg_2 . _fieldTypes = list ( arg_1 . fieldTypes ) arg_2 . _predictionSteps = list ( arg_1 . predictionSteps ) return arg_2

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

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


Question: Get the set of op nodes with the given name .

def Func ( arg_0 , * arg_1 ) : Func = [ ] for arg_3 in arg_0 . _multi_graph . nodes ( ) : if arg_3 . type == 'op' and arg_3 . op . name in arg_1 : Func . append ( arg_3 ) return Func

Decode the data passed in and potentially flush the decoder.


Question: Validate that a particular image size .

def Func ( arg_0 ) : arg_1 = get_app_config ( ) arg_2 = arg_1 . valid_max_image_size * 1024 if arg_1 and not arg_0 . size <= arg_2 : raise ValidationError ( _ ( "The logo image file size must be less than or equal to %s KB." ) % arg_1 . valid_max_image_size )

Handle marking messages as read and keeping client active.


Question: Return Paice - Husk stem .

def Func ( arg_0 , arg_1 ) : arg_2 = False arg_3 = True while not arg_2 : for arg_4 in range ( 6 , 0 , - 1 ) : if arg_1 [ - arg_4 : ] in arg_0 . _rule_table [ arg_4 ] : accept = False if len ( arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] ) < 4 : for rule in arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] : ( arg_1 , accept , arg_3 , arg_2 , ) = arg_0 . _apply_rule ( arg_1 , rule , arg_3 , arg_2 ) if accept : break else : rule = arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] ( arg_1 , accept , arg_3 , arg_2 ) = arg_0 . _apply_rule ( arg_1 , rule , arg_3 , arg_2 ) if accept : break else : break return arg_1


Question: If true handle uncompressed data

def Func ( arg_0 ) : arg_1 = arg_0 . verboseRead ( BoolCode ( 'UNCMPR' , description = 'Is Func?' ) ) if arg_1 : arg_0 . verboseRead ( FillerAlphabet ( streamPos = arg_0 . stream . pos ) ) print ( 'Uncompressed data:' ) arg_0 . output += arg_0 . stream . readBytes ( arg_0 . MLEN ) print ( outputFormatter ( arg_0 . output [ - arg_0 . MLEN : ] ) ) return arg_1

Create Elasticsearch indexes

    Args:
        names (list): A list of index names
        settings (dict): Index settings


Question: Run experiments in qobj .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _validate ( arg_2 ) arg_3 = [ ] arg_4 = time . time ( ) for arg_5 in arg_2 . experiments : arg_3 . append ( arg_0 . run_experiment ( arg_5 ) ) arg_6 = time . time ( ) arg_7 = { 'backend_name' : arg_0 . name ( ) , 'backend_version' : arg_0 . _configuration . backend_version , 'qobj_id' : arg_2 . qobj_id , 'job_id' : arg_1 , 'results' : arg_3 , 'status' : 'COMPLETED' , 'success' : True , 'time_taken' : ( arg_6 - arg_4 ) , 'header' : arg_2 . header . as_dict ( ) } return Result . from_dict ( arg_7 )

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


Question: Get a list of recommended movies for a movie .

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _get_id_path ( 'Func' ) arg_3 = arg_0 . _GET ( arg_2 , arg_1 ) arg_0 . _set_attrs_to_values ( arg_3 ) return arg_3

Click the left mouse button without modifiers pressed.

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


Question: Calls get_app_config_dir but ensures the directory exists .

def Func ( arg_0 , * arg_1 ) : from ubelt import util_path arg_2 = get_app_config_dir ( arg_0 , * arg_1 ) util_path . ensuredir ( arg_2 ) return arg_2

Replace all the tracks in a playlist, overwriting its existing tracks.
        This powerful request can be useful for replacing tracks, re-ordering existing tracks, or clearing the playlist.

        Parameters
        ----------
        playlist : Union[str, PLaylist]
            The playlist to modify
        tracks : Sequence[Union[str, Track]]
            Tracks to place in the playlist


Question: Read data from process output .

def Func ( arg_0 , arg_1 = True , arg_2 = False , ** arg_3 ) : if arg_2 : raise NotImplementedError ( ) return arg_0 . _from_cache ( arg_1 = arg_1 )

Return True if this new candidate representation satisfies all our overlap
    rules. Since we know that neighboring representations differ by at most
    one bit, we compute running overlaps.


Question: Handles adding an Edge to the graph .

def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_2 = arg_0 . _request_graph ( arg_1 . ui . control ) if arg_2 is None : return arg_3 = len ( arg_2 . nodes ) arg_4 = [ v . ID for v in arg_2 . nodes ] if arg_3 == 0 : arg_5 = Node ( ID = make_unique_name ( "node" , arg_4 ) ) arg_6 = make_unique_name ( "node" , arg_4 + [ arg_5 . ID ] ) arg_7 = Node ( ID = arg_6 ) elif arg_3 == 1 : arg_5 = arg_2 . nodes [ 0 ] arg_7 = Node ( ID = make_unique_name ( "node" , arg_4 ) ) else : arg_5 = arg_2 . nodes [ 0 ] arg_7 = arg_2 . nodes [ 1 ] arg_8 = Edge ( arg_5 , arg_7 , _nodes = arg_2 . nodes ) arg_9 = arg_8 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" ) if arg_9 . result : arg_2 . edges . append ( arg_8 )

Stop streaming samples from device and delete samples buffer


Question: function that takes a dictionary mapping names to sequences and a locus number and writes it as a NEXUS file with a mrbayes analysis block .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = max ( [ len ( arg_9 ) for arg_9 in arg_0 ] ) arg_7 = "{:<" + str ( arg_6 + 1 ) + "} {}\n" arg_8 = "" for arg_9 in arg_0 . items ( ) : arg_8 += arg_7 . format ( arg_9 [ 0 ] , arg_9 [ 1 ] ) arg_10 = os . path . join ( arg_2 , "{}.nex" . format ( arg_1 ) ) with open ( arg_10 , 'w' ) as outnex : outnex . write ( NEXBLOCK . format ( ** { "ntax" : len ( arg_0 ) , "nchar" : len ( arg_0 . values ( ) [ 0 ] ) , "matrix" : arg_8 , "ngen" : arg_4 , "sfreq" : arg_5 , "burnin" : arg_3 , } ) )

Minimum and Maximum to use for computing breaks


Question: Encodes an OpenMath element into a string .

def Func ( arg_0 , arg_1 = None ) : arg_2 = encode_xml ( arg_0 , arg_1 ) return etree . tostring ( arg_2 )

Class decorator that makes sure the passed apps are not present in
    INSTALLED_APPS.


Question: Temporary fix to patch HoloViews plot comms

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if hasattr ( arg_3 , '_update_callbacks' ) : for arg_4 in arg_3 . traverse ( lambda x : x ) : arg_4 . comm = arg_0 . server_comm for arg_6 in arg_4 . callbacks : for arg_7 in arg_6 . callbacks : arg_7 . code = arg_7 . code . replace ( arg_3 . id , arg_0 . plot_id ) arg_3 = arg_3 . state arg_2 . append ( arg_3 ) return arg_2

Remove hidden notes and tag a CERN if detected.


Question: Returns prefix for a given multicodec

def Func ( arg_0 ) : try : arg_1 = varint . encode ( NAME_TABLE [ arg_0 ] ) except KeyError : raise ValueError ( '{} multicodec is not supported.' . format ( arg_0 ) ) return arg_1

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: Draw all the nodes in the scene

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = 0 ) : arg_1 = arg_1 . astype ( 'f4' ) . tobytes ( ) arg_2 = arg_2 . astype ( 'f4' ) . tobytes ( ) for arg_4 in arg_0 . root_nodes : arg_4 . Func ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , ) arg_0 . ctx . clear_samplers ( 0 , 4 )

Use ``\\r`` to overdraw the current line with the given text.

        This function transparently handles tracking how much overdrawing is
        necessary to erase the previous line when used consistently.

        :param text: The text to be outputted
        :param newline: Whether to start a new line and reset the length count.
        :type text: :class:`~__builtins__.str`
        :type newline: :class:`~__builtins__.bool`


Question: This concatenates all text LCs for the given object and writes to a pklc .

def Func ( arg_0 , arg_1 , arg_2 = 'TF1' , arg_3 = '.gz' , arg_4 = 'rjd' , arg_5 = True , arg_6 = None , arg_7 = True ) : arg_8 = concatenate_textlcs_for_objectid ( arg_0 , arg_1 , arg_2 = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 , arg_7 = arg_7 ) if not arg_6 : arg_6 = 'pklcs' if not os . path . exists ( arg_6 ) : os . mkdir ( arg_6 ) arg_9 = os . path . join ( arg_6 , '%s-%s-pklc.pkl' % ( arg_8 [ 'objectid' ] , arg_2 ) ) arg_10 = lcdict_to_pickle ( arg_8 , outfile = arg_9 ) return arg_10

Build an observation_noise_fn that observes a Tensor timeseries.


Question: Continuous square wave .

def Func ( arg_0 : arg_1 . ndarray , arg_3 : arg_4 , arg_5 : arg_6 , arg_7 : arg_6 = 0 ) -> arg_1 . ndarray : arg_8 = arg_0 / arg_5 + arg_7 / arg_1 . pi return arg_3 * ( 2 * ( 2 * arg_1 . floor ( arg_8 ) - arg_1 . floor ( 2 * arg_8 ) ) + 1 ) . astype ( arg_1 . complex_ )

r"""Bernoulli likelihood sampling.

    Sample according to

    .. math::

        \mathbf y \sim \prod_{i=1}^n
        \text{Bernoulli}(\mu_i = \text{logit}(z_i))
        \mathcal N(~ o \mathbf 1 + \mathbf a^\intercal \boldsymbol\alpha;
        ~ (h^2 - v_c)\mathrm G^\intercal\mathrm G +
        (1-h^2-v_c)\mathrm I ~)

    using the canonical Logit link function to define the conditional Bernoulli
    mean :math:`\mu_i`.

    The causal :math:`\mathbf a` covariates and the corresponding effect-sizes
    are randomly draw according to the following idea. The ``causal_variants``,
    if given, are first mean-zero and std-one normalized and then having
    its elements divided by the squared-root the the number of variances::

        causal_variants = _stdnorm(causal_variants, axis=0)
        causal_variants /= sqrt(causal_variants.shape[1])

    The causal effect-sizes :math:`\boldsymbol\alpha` are draw from
    :math:`\{-1, +1\}` and subsequently normalized for mean-zero and std-one""

    Parameters
    ----------
    random_state : random_state
        Set the initial random state.

    Example
    -------

    .. doctest::

        >>> from glimix_core.random import bernoulli_sample
        >>> from numpy.random import RandomState
        >>> offset = 5
        >>> G = [[1, -1], [2, 1]]
        >>> bernoulli_sample(offset, G, random_state=RandomState(0))
        array([1., 1.])


Question: Return the status of the device .

def Func ( arg_0 ) : arg_1 = arg_0 . _send ( arg_0 . POLL_VOLUME + arg_0 . POLL_POWER + arg_0 . POLL_MUTED + arg_0 . POLL_SOURCE , read_reply = True ) if arg_1 is None : return arg_2 = 10 arg_3 = [ arg_1 [ i : i + arg_2 ] for i in range ( 0 , len ( arg_1 ) , arg_2 ) ] return { 'volume' : int ( arg_3 [ 0 ] [ - 2 : ] , 16 ) , 'power' : arg_3 [ 1 ] [ - 2 : ] == '01' , 'muted' : arg_3 [ 2 ] [ - 2 : ] == '01' , 'source' : arg_0 . SOURCES_REVERSED [ arg_3 [ 3 ] [ - 2 : ] ] }

receives a UUID via the request and returns either a fresh or an existing dropbox
    for it


Question: Convert a video to frame images

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = '{:06d}.jpg' , arg_4 = 0 , arg_5 = 0 , arg_6 = True ) : mkdir_or_exist ( arg_1 ) if arg_5 == 0 : arg_7 = arg_0 . frame_cnt - arg_4 else : arg_7 = min ( arg_0 . frame_cnt - arg_4 , arg_5 ) if arg_7 <= 0 : raise ValueError ( 'start must be less than total frame number' ) if arg_4 > 0 : arg_0 . _set_real_position ( arg_4 ) def write_frame ( arg_8 ) : arg_9 = arg_0 . read ( ) arg_10 = osp . join ( arg_1 , arg_3 . format ( arg_8 ) ) cv2 . imwrite ( arg_10 , arg_9 ) if arg_6 : track_progress ( write_frame , range ( arg_2 , arg_2 + arg_7 ) ) else : for arg_11 in range ( arg_7 ) : arg_9 = arg_0 . read ( ) if arg_9 is None : break arg_10 = osp . join ( arg_1 , arg_3 . format ( arg_11 + arg_2 ) ) cv2 . imwrite ( arg_10 , arg_9 )

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


Question: Find all the matches for a check dict .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = { } for arg_4 , arg_5 in arg_1 . iteritems ( ) : if isinstance ( arg_5 , dict ) : arg_3 [ arg_4 ] = CompositeFilter ( arg_5 ) else : arg_3 [ arg_4 ] = lambda o : o == arg_5 for arg_6 in arg_0 . _records . itervalues ( ) : if arg_0 . Func_one ( arg_6 , arg_3 ) : arg_2 . append ( copy ( arg_6 ) ) return arg_2


Question: Appends tzinfo and assumes UTC if datetime object has no tzinfo already .

def Func ( arg_0 ) : return arg_0 if arg_0 . tzinfo else arg_0 . replace ( tzinfo = timezone . utc )


Question: Exempt a view function from being checked permission

def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . _Func : arg_0 . _Func . append ( arg_1 )

Find a mapping that can apply to the given controller.  Returns None if unsuccessful.

        :param controller: :class:`Controller` to look up
        :return: :class:`ControllerMapping`