Question: Create a matrix representation of the problem .

def Func ( arg_0 , arg_1 = 'dense' , arg_2 = False , arg_3 = 1e-6 ) : if arg_1 not in ( 'DataFrame' , 'dense' ) and not dok_matrix : raise ValueError ( 'Sparse matrices require scipy' ) arg_4 = { 'dense' : np . array , 'dok' : dok_matrix , 'lil' : lil_matrix , 'DataFrame' : pd . DataFrame , } [ arg_1 ] arg_5 = namedtuple ( "Problem" , [ "equalities" , "b" , "inequalities" , "bounds" , "variable_fixed" , "variable_bounds" ] ) arg_6 = [ ] arg_7 = [ ] arg_8 = [ ] arg_9 = [ ] for arg_10 in arg_0 . constraints : arg_11 = - np . inf if arg_10 . lb is None else arg_10 . lb arg_12 = np . inf if arg_10 . ub is None else arg_10 . ub arg_13 = ( arg_12 - arg_11 ) < arg_3 arg_14 = arg_10 . get_linear_coefficients ( arg_0 . variables ) arg_14 = [ arg_14 [ v ] for v in arg_0 . variables ] if arg_13 : arg_9 . append ( arg_11 if abs ( arg_11 ) > arg_3 else 0.0 ) arg_6 . append ( arg_14 ) else : arg_7 . append ( arg_14 ) arg_8 . append ( [ arg_11 , arg_12 ] ) arg_15 = np . array ( [ [ v . lb , v . ub ] for v in arg_0 . variables ] ) arg_16 = arg_15 [ : , 1 ] - arg_15 [ : , 0 ] < arg_3 arg_17 = arg_5 ( equalities = arg_4 ( arg_6 ) , arg_9 = np . array ( arg_9 ) , inequalities = arg_4 ( arg_7 ) , bounds = arg_4 ( arg_8 ) , variable_fixed = np . array ( arg_16 ) , variable_bounds = arg_4 ( arg_15 ) ) return arg_17

Converts py_zipkin's annotations dict to protobuf.

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


Question: Go through the layout and build the SVG .

def Func ( arg_0 ) : arg_1 = arg_0 . _zoom arg_2 = arg_0 . _layout arg_3 = arg_0 . _builder arg_4 = list ( map ( lambda f : f * arg_1 , arg_2 . bounding_box ) ) arg_3 . bounding_box = arg_4 arg_6 = arg_4 [ 2 ] + arg_4 [ 0 ] * 2 arg_7 = arg_4 [ 3 ] + arg_4 [ 1 ] * 2 arg_8 = list ( arg_2 . walk_instructions ( lambda i : ( arg_6 - ( i . x + i . width ) * arg_1 , arg_7 - ( i . y + i . height ) * arg_1 , i . instruction ) ) ) arg_8 . sort ( key = lambda x_y_i : x_y_i [ 2 ] . render_z ) for arg_9 , arg_10 , arg_11 in arg_8 : arg_12 = arg_11 . render_z arg_13 = ( "" if not arg_12 else "-{}" . format ( arg_12 ) ) arg_14 = "row-{}{}" . format ( arg_11 . row . id , arg_13 ) arg_15 = arg_0 . _register_instruction_in_defs ( arg_11 ) arg_16 = arg_0 . _symbol_id_to_scale [ arg_15 ] arg_17 = { "@class" : "instruction" , "@id" : "instruction-{}" . format ( arg_11 . id ) , "@transform" : "translate({},{}),scale({})" . format ( arg_9 , arg_10 , arg_16 ) } arg_3 . place_svg_use ( arg_15 , arg_14 , arg_17 ) arg_3 . insert_defs ( arg_0 . _instruction_type_color_to_symbol . values ( ) ) return arg_3 . get_svg_dict ( )

Handle marking messages as read and keeping client active.


Question: allocate - allocate virtual memory

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_4 not in arg_1 . memory : logger . info ( "ALLOCATE: addr points to invalid address. Returning EFAULT" ) return Decree . CGC_EFAULT arg_5 = [ 'rw ' , 'rwx' ] [ bool ( arg_3 ) ] try : arg_6 = arg_1 . memory . mmap ( None , arg_2 , arg_5 ) except Exception as e : logger . info ( "ALLOCATE exception %s. Returning ENOMEM %r" , str ( e ) , arg_2 ) return Decree . CGC_ENOMEM arg_1 . write_int ( arg_4 , arg_6 , 32 ) logger . info ( "ALLOCATE(%d, %s, 0x%08x) -> 0x%08x" % ( arg_2 , arg_5 , arg_4 , arg_6 ) ) arg_0 . syscall_trace . append ( ( "_allocate" , - 1 , arg_2 ) ) return 0

Gets the fuel prices for a specific fuel station.


Question: Marshal cmd line args into a requirement set .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : for arg_7 in arg_1 : arg_0 . add_requirement ( InstallRequirement . from_line ( arg_7 , None , isolated = arg_2 . isolated_mode , arg_6 = arg_6 ) ) for arg_7 in arg_2 . editables : arg_0 . add_requirement ( InstallRequirement . from_editable ( arg_7 , default_vcs = arg_2 . default_vcs , isolated = arg_2 . isolated_mode , arg_6 = arg_6 ) ) arg_8 = False for arg_9 in arg_2 . requirements : for arg_7 in parse_requirements ( arg_9 , arg_3 = arg_3 , arg_2 = arg_2 , arg_4 = arg_4 , arg_6 = arg_6 ) : arg_8 = True arg_0 . add_requirement ( arg_7 ) if not ( arg_1 or arg_2 . editables or arg_8 ) : arg_10 = { 'name' : arg_5 } if arg_2 . find_links : arg_11 = ( 'You must give at least one requirement to ' '%(name)s (maybe you meant "pip %(name)s ' '%(links)s"?)' % dict ( arg_10 , links = ' ' . join ( arg_2 . find_links ) ) ) else : arg_11 = ( 'You must give at least one requirement ' 'to %(name)s (see "pip help %(name)s")' % arg_10 ) logger . warning ( arg_11 )

Handle the kernel's death by asking if the user wants to restart.


Question: Turns a intensity array to a monochrome image by replacing each intensity by a scaled color

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = np . nanmin ( arg_0 ) if arg_3 is None : arg_3 = np . nanmax ( arg_0 ) arg_4 = ( arg_0 - arg_2 ) / ( arg_3 - arg_2 ) return np . clip ( arg_4 [ ... , np . newaxis ] , 0 , 1 ) * np . array ( arg_1 )

Unmarks the remote server as currently being deployed to.


Question: Patch OptionParser . expand_default with custom behaviour

def Func ( arg_0 , arg_1 ) : if arg_0 . parser is None or not arg_0 . default_tag : return arg_1 . help arg_2 = arg_1 . _long_opts [ 0 ] [ 2 : ] try : arg_3 = arg_0 . parser . options_manager . _all_options [ arg_2 ] except KeyError : arg_4 = None else : arg_5 = arg_3 . get_option_def ( arg_2 ) arg_2 = arg_3 . option_attrname ( arg_2 , arg_5 ) arg_4 = getattr ( arg_3 . config , arg_2 , arg_5 ) arg_4 = utils . _format_option_value ( arg_5 , arg_4 ) if arg_4 is optparse . NO_DEFAULT or not arg_4 : arg_4 = arg_0 . NO_DEFAULT_VALUE return arg_1 . help . replace ( arg_0 . default_tag , str ( arg_4 ) )

Estimate whether the line string is at least partially inside the image.

        Parameters
        ----------
        image : ndarray or tuple of int
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.

        default
            Default value to return if the line string contains no points.

        Returns
        -------
        bool
            True if the line string is at least partially inside the image area.
            False otherwise.


Question: Computes the product of a matrix with a vector on the right .

def Func ( arg_0 , arg_1 ) : return tf . squeeze ( tf . matmul ( arg_0 , tf . expand_dims ( arg_1 , axis = - 1 ) ) , axis = - 1 )

Return a list of all enrollments for the passed section_id.

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


Question: move cursor left

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . _index arg_0 . _select_index ( arg_1 , arg_2 - 1 )

Get the information of a list of bugs.

        :param from_date: retrieve bugs that where updated from that date;
            dates are converted to UTC
        :param offset: starting position for the search; i.e to return 11th
            element, set this value to 10.
        :param max_bugs: maximum number of bugs to reteurn per query


Question: Forces unregistration of tree admin class with following re - registration .

def Func ( ) : try : admin . site . unregister ( MODEL_TREE_CLASS ) except NotRegistered : pass admin . site . register ( MODEL_TREE_CLASS , _TREE_ADMIN ( ) )

Read the maximum volume level of the device.


Question: Map with func chunk by chunk the input pytable array . The result is stored in the output pytable array out_array .

def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in iter_chunk_slice ( arg_1 . shape [ - 1 ] , arg_1 . chunkshape [ - 1 ] ) : arg_2 . append ( arg_0 ( arg_1 [ ... , arg_3 ] ) ) return arg_2

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

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

        Returns:
            dict: Program data provided by Course Catalog API


Question: Stop all workers .

def Func ( arg_0 ) : if not arg_0 . join_signal . is_set ( ) : arg_0 . join_signal . set ( ) time . sleep ( 0.01 ) if arg_0 . main_worker_thread . is_alive ( ) : arg_0 . main_worker_thread . join ( ) if arg_0 . threaded : for arg_1 in arg_0 . workers : if arg_1 . is_alive ( ) : arg_1 . join ( ) else : for arg_1 in arg_0 . workers : if arg_1 . is_alive ( ) : arg_1 . Func ( ) arg_1 . join ( ) while not arg_0 . all_finished ( ) : time . sleep ( 0.001 ) if arg_0 . queue . full ( ) : arg_0 . queue . get ( ) arg_0 . queue . put ( pickle . dumps ( None , protocol = - 1 ) ) time . sleep ( 0.01 ) while True : try : arg_0 . _queue_internal . get ( timeout = 0.005 ) except QueueEmpty : break if not arg_0 . _queue_internal . _closed : arg_0 . _queue_internal . close ( ) if not arg_0 . queue . _closed : arg_0 . queue . close ( ) arg_0 . _queue_internal . join_thread ( ) arg_0 . queue . join_thread ( ) time . sleep ( 0.025 )

This is our parsing dispatcher

        :param stype: Search type category
        :param soup: The beautifulsoup object that contains the parsed html


Question: Read a nbytes bytes long big endian unsigned integer from data starting at offset

def Func ( arg_0 , arg_1 = 32 , arg_2 = 0 , arg_3 = 0 ) : assert isinstance ( arg_0 , ( bytearray , Array ) ) arg_4 = ABI . _readBE ( arg_0 , arg_1 , arg_2 = True , arg_3 = arg_3 ) arg_4 = Operators . ZEXTEND ( arg_4 , ( arg_1 + arg_2 ) * 8 ) return arg_4


Question: Returns the rendered URL of the chart

def Func ( arg_0 ) : arg_0 . render ( ) return arg_0 . _apiFunc + '&' . join ( arg_0 . _parts ( ) ) . replace ( ' ' , '+' )

Re-enable the FTDI drivers for the current platform.


Question: Upload a file to S3 possibly using the multi - part uploader Return the key uploaded

async def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None , ** arg_6 ) : arg_7 = False if hasattr ( arg_2 , 'read' ) : if hasattr ( arg_2 , 'seek' ) : arg_2 . seek ( 0 ) arg_2 = arg_2 . read ( ) arg_8 = len ( arg_2 ) elif arg_4 : arg_8 = len ( arg_2 ) else : arg_7 = True arg_8 = os . stat ( arg_2 ) . st_size arg_4 = os . path . basename ( arg_2 ) assert arg_4 , 'key not available' if not arg_5 : arg_5 , arg_9 = mimetypes . guess_type ( arg_4 ) if arg_3 : if not arg_3 . endswith ( '/' ) : arg_3 = '%s/' % arg_3 arg_4 = '%s%s' % ( arg_3 , arg_4 ) arg_10 = dict ( Bucket = arg_1 , Key = arg_4 ) if not arg_5 : arg_5 = 'application/octet-stream' arg_10 [ 'ContentType' ] = arg_5 if arg_8 > MULTI_PART_SIZE and arg_7 : arg_11 = await _multipart ( arg_0 , arg_2 , arg_10 ) elif arg_7 : with open ( arg_2 , 'rb' ) as fp : arg_10 [ 'Body' ] = fp . read ( ) arg_11 = await arg_0 . put_object ( ** arg_10 ) else : arg_10 [ 'Body' ] = arg_2 arg_11 = await arg_0 . put_object ( ** arg_10 ) if 'Key' not in arg_11 : arg_11 [ 'Key' ] = arg_4 if 'Bucket' not in arg_11 : arg_11 [ 'Bucket' ] = arg_1 return arg_11

Compute the yticks labels of this grid_stack, used for plotting the y-axis ticks when visualizing an image \


Question: clean repository given before and after states

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : arg_4 = [ ] arg_5 = { } [ arg_5 . setdefault ( list ( arg_6 ) [ 0 ] , [ ] ) . append ( arg_6 ) for arg_6 in arg_2 ] for arg_7 in reversed ( arg_1 ) : arg_8 = list ( arg_7 ) [ 0 ] arg_9 = os . path . basename ( arg_8 ) arg_10 = arg_7 [ arg_8 ] [ 'type' ] arg_11 = arg_5 . get ( arg_8 , [ ] ) arg_6 = [ a for a in arg_11 if a [ arg_8 ] [ 'type' ] == arg_10 ] if len ( arg_6 ) > 1 : arg_4 . append ( "Multiple '%s' of type '%s' where found in '%s', this should never had happened. Please report issue" % ( arg_9 , arg_10 , arg_8 ) ) continue if not len ( arg_6 ) : arg_12 = [ ] arg_13 = [ ] if arg_10 == 'dir' : if not len ( arg_8 ) : arg_4 . append ( "Removing main repository directory is not allowed" ) continue arg_12 . append ( os . path . join ( arg_0 . __path , arg_8 ) ) arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 , arg_0 . __dirInfo ) ) arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 , arg_0 . __dirLock ) ) elif arg_10 == 'file' : arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 ) ) arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 , arg_0 . __fileInfo % arg_9 ) ) arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 , arg_0 . __fileLock % arg_9 ) ) else : arg_12 . append ( os . path . join ( arg_0 . __path , arg_8 ) ) arg_13 . append ( os . path . join ( arg_0 . __path , arg_8 , arg_0 . __fileInfo % arg_9 ) ) for arg_14 in arg_13 : if os . path . isfile ( arg_14 ) : try : os . remove ( arg_14 ) except Exception as err : arg_4 . append ( "Unable to clean file '%s' (%s)" % ( arg_14 , str ( err ) ) ) for arg_15 in arg_12 : if os . path . isdir ( arg_15 ) : if arg_3 or not len ( os . listdir ( arg_15 ) ) : try : shutil . rmtree ( arg_15 ) except Exception as err : arg_4 . append ( "Unable to clean directory '%s' (%s)" % ( arg_14 , str ( err ) ) ) return len ( arg_4 ) == 0 , arg_4

Create a plot of weights, visualized as "bottom-level" pixel arrays.


Question: Setup coverage related extensions .

def Func ( arg_0 ) : arg_0 . config [ 'SQLALCHEMY_TRACK_MODIFICATIONS' ] = True if arg_0 . debug else False if chanjo_api : chanjo_api . init_app ( arg_0 ) configure_template_filters ( arg_0 ) arg_0 . register_blueprint ( report_bp , url_prefix = '/reports' ) arg_2 = Babel ( arg_0 ) @ arg_2 . localeselector def get_locale ( ) : arg_3 = current_app . config . get ( 'ACCEPT_LANGUAGES' , [ 'en' ] ) arg_4 = request . args . get ( 'lang' ) if arg_4 in arg_3 : current_app . logger . info ( "using session language: %s" , arg_4 ) return arg_4 arg_5 = current_app . config . get ( 'REPORT_LANGUAGE' ) if arg_5 : return arg_5 return request . accept_languages . best_match ( arg_3 )

Updates the target temperature on the NuHeat API

        :param temperature: The desired temperature in NuHeat format
        :param permanent: Permanently hold the temperature. If set to False, the schedule will
                          resume at the next programmed event


Question: Return general information about cases

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = { } arg_4 = arg_2 arg_5 = arg_0 . cases ( owner = arg_1 , arg_4 = arg_4 ) arg_6 = 0 arg_7 = 0 arg_8 = 0 arg_9 = 0 arg_10 = { 1 : { 'title' : 'Single' , 'count' : 0 } , 2 : { 'title' : 'Duo' , 'count' : 0 } , 3 : { 'title' : 'Trio' , 'count' : 0 } , 'many' : { 'title' : 'Many' , 'count' : 0 } , } arg_11 = set ( ) arg_12 = 0 for arg_12 , arg_13 in enumerate ( arg_5 , 1 ) : if arg_1 : arg_11 . add ( arg_13 [ '_id' ] ) if arg_13 . get ( 'phenotype_terms' ) : arg_6 += 1 if arg_13 . get ( 'causatives' ) : arg_7 += 1 if arg_13 . get ( 'suspects' ) : arg_8 += 1 if arg_13 . get ( 'cohorts' ) : arg_9 += 1 arg_14 = len ( arg_13 . get ( 'individuals' , [ ] ) ) if arg_14 == 0 : continue if arg_14 > 3 : arg_10 [ 'many' ] [ 'count' ] += 1 else : arg_10 [ arg_14 ] [ 'count' ] += 1 arg_3 [ 'total_cases' ] = arg_12 arg_3 [ 'phenotype_cases' ] = arg_6 arg_3 [ 'causative_cases' ] = arg_7 arg_3 [ 'pinned_cases' ] = arg_8 arg_3 [ 'cohort_cases' ] = arg_9 arg_3 [ 'pedigree' ] = arg_10 arg_3 [ 'case_ids' ] = arg_11 return arg_3

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: Get the arguments given to the template tag element and complete these with the ones from the settings . py if necessary .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_2 arg_4 = deepcopy ( inplace_settings . DEFAULT_INPLACE_EDIT_OPTIONS ) arg_5 = inplace_settings . DEFAULT_INPLACE_EDIT_OPTIONS_ONE_BY_ONE if not arg_5 : if not arg_3 and arg_4 : arg_3 = arg_4 else : arg_3 = dict ( arg_4 , ** arg_3 ) return arg_3

Verify scrollbar is vertical

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success.
        @rtype: integer


Question: Starts a new article

def Func ( arg_0 ) : arg_1 = arg_0 . obj arg_2 = click . prompt ( 'Title' ) arg_3 = click . prompt ( 'Author' , default = arg_1 . get ( 'DEFAULT_AUTHOR' ) ) arg_4 = slugify ( arg_2 ) arg_5 = datetime . now ( ) arg_6 = '{:%Y-%m-%d}_{}.md' . format ( arg_5 , arg_4 ) arg_7 = ( ( 'Title' , arg_2 ) , ( 'Date' , '{:%Y-%m-%d %H:%M}:00' . format ( arg_5 ) ) , ( 'Modified' , '{:%Y-%m-%d %H:%M}:00' . format ( arg_5 ) ) , ( 'Author' , arg_3 ) , ) arg_8 = '' for arg_9 , arg_10 in arg_7 : arg_8 += '{}: {}\n' . format ( arg_9 , arg_10 ) arg_8 += '\n\n' arg_8 += 'Text...\n\n' arg_8 += '![image description]({filename}/images/my-photo.jpg)\n\n' arg_8 += 'Text...\n\n' os . makedirs ( arg_1 [ 'CONTENT_DIR' ] , exist_ok = True ) arg_11 = os . path . join ( arg_1 [ 'CONTENT_DIR' ] , arg_6 ) with click . open_file ( arg_11 , 'w' ) as f : f . Func ( arg_8 ) click . echo ( arg_11 ) click . launch ( arg_11 )

r"""
    Convert number to string guaranteeing result is not in scientific notation.

    :param number: Number to convert
    :type  number: integer or float

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for peng.functions.no_exp

    :raises: RuntimeError (Argument \`number\` is not valid)

    .. [[[end]]]


Question: Takes a list of filters and returns JSON

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if isinstance ( arg_3 , Filter ) : if arg_3 . filters : arg_2 . extend ( arg_0 . Func ( arg_3 . filters ) ) elif isinstance ( arg_3 , dict ) : arg_4 = list ( arg_3 . keys ( ) ) [ 0 ] arg_5 = arg_3 [ arg_4 ] if isinstance ( arg_5 , dict ) : arg_6 = arg_0 . Func ( [ arg_5 ] ) if len ( arg_6 ) == 1 : arg_6 = arg_6 [ 0 ] arg_2 . append ( { arg_4 : arg_6 } ) else : arg_2 . append ( { arg_4 : arg_0 . Func ( arg_5 ) } ) else : arg_2 . extend ( ( arg_3 , ) ) return arg_2


Question: Generate a tag for the alignment of the geometry of the bulge and disk of a bulge - disk system to customize \ phase names based on the bulge - disk model . This adds together the bulge_disk tags generated in the 3 functions above

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = align_bulge_disk_centre_tag_from_align_bulge_disk_centre ( arg_0 = arg_0 ) arg_4 = align_bulge_disk_axis_ratio_tag_from_align_bulge_disk_axis_ratio ( arg_1 = arg_1 ) arg_5 = align_bulge_disk_phi_tag_from_align_bulge_disk_phi ( arg_2 = arg_2 ) return arg_3 + arg_4 + arg_5

Multiply tensor of matrices by vectors assuming values stored are logs.


Question: Rename this conversation .

async def Func ( arg_0 , arg_1 ) : await arg_0 . _client . Func_conversation ( hangouts_pb2 . RenameConversationRequest ( request_header = arg_0 . _client . get_request_header ( ) , new_name = arg_1 , event_request_header = arg_0 . _get_event_request_header ( ) , ) )

Clean up stats file, if configured to do so.


Question: Restart the stream as needed after SASL and StartTLS negotiation .

def Func ( arg_0 ) : arg_0 . _input_state = "restart" arg_0 . _output_state = "restart" arg_0 . features = None arg_0 . transport . restart ( ) if arg_0 . initiator : arg_0 . _send_stream_start ( arg_0 . stream_id )

Prepare received data for representation.

        Args:
            data (dict): values to represent (ex. {'001' : 130})
            number_to_keep (int): number of elements to show individually.

        Returns:
            dict: processed data to show.


Question: See token counts as pandas dataframe

def Func ( arg_0 ) : arg_1 = pd . DataFrame . from_dict ( arg_0 . indexer . word_counts , orient = 'index' ) arg_1 . columns = [ 'count' ] return arg_1 . sort_values ( 'count' , ascending = False )


Question: Get the lines for a file from the cache . Update the cache if it doesn t contain an entry for this file already .

def Func ( arg_0 , arg_1 = None ) : if arg_0 in cache : return cache [ arg_0 ] [ 2 ] try : return updatecache ( arg_0 , arg_1 ) except MemoryError : clearcache ( ) return [ ]


Question: Reduce a technote project s metadata from multiple sources into a single JSON - LD resource .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = parse_repo_slug_from_url ( arg_0 ) arg_5 = { '@context' : [ "https://raw.githubusercontent.com/codemeta/codemeta/2.0-rc/" "codemeta.jsonld" , "http://schema.org" ] , '@type' : [ 'Report' , 'SoftwareSourceCode' ] , 'codeRepository' : arg_0 } if 'url' in arg_1 : arg_6 = arg_1 [ 'url' ] elif 'published_url' in arg_3 : arg_6 = arg_3 [ 'published_url' ] else : raise RuntimeError ( 'No identifying url could be found: ' '{}' . format ( arg_0 ) ) arg_5 [ '@id' ] = arg_6 arg_5 [ 'url' ] = arg_6 if 'series' in arg_1 and 'serial_number' in arg_1 : arg_5 [ 'reportNumber' ] = '{series}-{serial_number}' . format ( ** arg_1 ) else : raise RuntimeError ( 'No reportNumber: {}' . format ( arg_0 ) ) if 'doc_title' in arg_1 : arg_5 [ 'name' ] = arg_1 [ 'doc_title' ] if 'description' in arg_1 : arg_5 [ 'description' ] = arg_1 [ 'description' ] if 'authors' in arg_1 : arg_5 [ 'author' ] = [ { '@type' : 'Person' , 'name' : author_name } for author_name in arg_1 [ 'authors' ] ] if 'last_revised' in arg_1 : arg_5 [ 'dateModified' ] = datetime . datetime . strptime ( arg_1 [ 'last_revised' ] , '%Y-%m-%d' ) else : try : arg_7 = arg_2 [ 'data' ] [ 'repository' ] arg_8 = arg_7 [ 'defaultBranchRef' ] arg_5 [ 'dateModified' ] = datetime . datetime . strptime ( arg_8 [ 'target' ] [ 'committedDate' ] , '%Y-%m-%dT%H:%M:%SZ' ) except KeyError : pass try : arg_9 = arg_2 [ 'data' ] [ 'repository' ] [ 'licenseInfo' ] arg_10 = arg_9 [ 'spdxId' ] if arg_10 is not None : arg_11 = 'https://spdx.org/licenses/{}.html' . format ( arg_10 ) arg_5 [ 'license' ] = arg_11 except KeyError : pass try : arg_8 = arg_2 [ 'data' ] [ 'repository' ] [ 'defaultBranchRef' ] arg_12 = arg_8 [ 'target' ] [ 'tree' ] [ 'entries' ] for arg_13 in arg_12 : arg_14 = arg_13 [ 'name' ] arg_15 = arg_14 . lower ( ) if arg_15 . startswith ( 'readme' ) : arg_16 = make_raw_content_url ( arg_4 , 'master' , arg_14 ) arg_5 [ 'readme' ] = arg_16 break except KeyError : pass arg_17 = 'https://travis-ci.org/{}' . format ( arg_4 . full ) arg_5 [ 'contIntegration' ] = arg_17 return arg_5

Handle the kernel's death by asking if the user wants to restart.


Question: Simply merge the older into the new one .

def Func ( arg_0 ) : arg_1 = [ ] arg_0 . new_config = Dict ( Dict ( arg_0 . upstream_config ) . merge ( PyFunceble . CONFIGURATION ) ) . remove_key ( arg_1 )


Question: send a transaction immediately . Failed transactions are picked up by the TxBroadcaster

def Func ( arg_0 , arg_1 = True , arg_2 = True , ** arg_3 ) : if not arg_1 : arg_4 = arg_3 . get ( 'ip' ) arg_5 = arg_3 . get ( 'port' ) arg_6 = 'http://{}:{}' . format ( arg_4 , arg_5 ) arg_7 = arky . rest . POST . peer . transactions ( arg_6 = arg_6 , transactions = [ arg_0 . tx . tx ] ) else : arg_7 = arky . core . sendPayload ( arg_0 . tx . tx ) if arg_0 . tx . success != '0.0%' : arg_0 . tx . error = None arg_0 . tx . success = True else : arg_0 . tx . error = arg_7 [ 'messages' ] arg_0 . tx . success = False arg_0 . tx . tries += 1 arg_0 . tx . res = arg_7 if arg_2 : arg_0 . tx . send = True arg_0 . __save ( ) return arg_7

Set the maximum forces for this object's degrees of freedom.

        Parameters
        ----------
        max_forces : float or sequence of float
            A maximum force value to set on all degrees of freedom, or a list
            containing one such value for each degree of freedom.


Question: Start listening for incoming connections .

def Func ( arg_0 ) : arg_0 . service_info = ServiceInfo ( '_webthing._tcp.local.' , '{}._webthing._tcp.local.' . format ( arg_0 . name ) , address = socket . inet_aton ( get_ip ( ) ) , port = arg_0 . port , properties = { 'path' : '/' , } , server = '{}.local.' . format ( socket . gethostname ( ) ) ) arg_0 . zeroconf = Zeroconf ( ) arg_0 . zeroconf . register_service ( arg_0 . service_info ) arg_0 . server . listen ( arg_0 . port ) tornado . ioloop . IOLoop . current ( ) . Func ( )

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

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


Question: Reconstruct ancestral sequences

def Func ( arg_0 , arg_1 = 'probabilistic' , arg_2 = False , arg_3 = False , ** arg_4 ) : arg_0 . logger ( "TreeAnc.infer_ancestral_sequences with method: %s, %s" % ( arg_1 , 'marginal' if arg_3 else 'joint' ) , 1 ) if ( arg_0 . tree is None ) or ( arg_0 . aln is None ) : arg_0 . logger ( "TreeAnc.infer_ancestral_sequences: ERROR, alignment or tree are missing" , 0 ) return ttconf . ERROR if arg_1 in [ 'ml' , 'probabilistic' ] : if arg_3 : arg_5 = arg_0 . _ml_anc_marginal else : arg_5 = arg_0 . _ml_anc_joint else : arg_5 = arg_0 . _fitch_anc if arg_2 : arg_6 = arg_0 . infer_gtr ( arg_3 = arg_3 , ** arg_4 ) if arg_6 == ttconf . ERROR : return arg_6 arg_7 = arg_5 ( ** arg_4 ) else : arg_7 = arg_5 ( ** arg_4 ) return arg_7

Updates the target temperature on the NuHeat API

        :param temperature: The desired temperature in NuHeat format
        :param permanent: Permanently hold the temperature. If set to False, the schedule will
                          resume at the next programmed event


Question: Used to specify edge indices from different types of arguments .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = numbers . Integral if isinstance ( arg_1 , arg_4 ) : arg_1 = [ arg_1 ] elif arg_1 is None : if arg_2 is not None : if isinstance ( arg_2 , tuple ) : if isinstance ( arg_2 [ 0 ] , arg_4 ) and isinstance ( arg_2 [ 1 ] , arg_4 ) : arg_1 = [ arg_0 . edge_index [ arg_2 ] ] elif isinstance ( arg_2 [ 0 ] , collections . Iterable ) : if np . array ( [ len ( arg_5 ) == 2 for arg_5 in arg_2 ] ) . all ( ) : arg_1 = [ arg_0 . edge_index [ arg_5 ] for arg_5 in arg_2 ] else : arg_1 = [ arg_0 . edge_index [ arg_2 ] ] elif arg_3 is not None : if isinstance ( arg_3 , collections . Iterable ) : arg_3 = set ( arg_3 ) else : arg_3 = set ( [ arg_3 ] ) arg_6 = [ ] for arg_5 in arg_0 . edges ( ) : if arg_0 . ep ( arg_5 , 'edge_type' ) in arg_3 : arg_6 . append ( arg_0 . edge_index [ arg_5 ] ) arg_1 = np . array ( arg_6 , int ) if arg_1 is None : arg_1 = range ( arg_0 . number_of_edges ( ) ) return arg_1

Updates a player's state when a payload with opcode ``playerUpdate`` is received.


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

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _check_space ( arg_1 , arg_2 , ( _MUST , _MUST ) )

Gets a 3D CoordinateMap from img.

    Parameters
    ----------
    img: nib.Nifti1Image or nipy Image

    Returns
    -------
    nipy.core.reference.coordinate_map.CoordinateMap


Question: Get document from index with its id . GET 772210180J

def Func ( arg_0 , arg_1 ) : arg_2 = doc_by_id ( arg_1 ) if not arg_2 : return arg_0 . error ( 'id "{}" not found' . format ( arg_1 ) ) for arg_3 , arg_4 in arg_2 . items ( ) : if arg_3 == config . HOUSENUMBERS_FIELD : continue print ( '{} {}' . format ( white ( arg_3 ) , magenta ( arg_4 ) ) ) if arg_2 . get ( 'housenumbers' ) : def sorter ( arg_5 ) : try : return int ( re . match ( r'^\d+' , arg_5 [ 'raw' ] ) . group ( ) ) except AttributeError : return - 1 arg_6 = sorted ( arg_2 [ 'housenumbers' ] . values ( ) , arg_3 = sorter ) print ( white ( 'housenumbers' ) , magenta ( ', ' . join ( arg_5 [ 'raw' ] for arg_5 in arg_6 ) ) )


Question: Creates and starts the workers as well as attaching a handler to terminate them gracefully when a SIGINT signal is received .

def Func ( arg_0 , arg_1 = 1 ) : if not arg_0 . workers : for arg_2 in range ( arg_1 ) : arg_0 . workers . append ( Worker ( arg_0 . _download , arg_0 . queues [ 'download' ] , arg_0 . queues [ 'convert' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _convert , arg_0 . queues [ 'convert' ] , arg_0 . queues [ 'upload' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _upload , arg_0 . queues [ 'upload' ] , arg_0 . queues [ 'delete' ] , arg_0 . stopper ) ) arg_0 . workers . append ( Worker ( arg_0 . _delete , arg_0 . queues [ 'delete' ] , arg_0 . queues [ 'done' ] , arg_0 . stopper ) ) arg_0 . signal_handler = SignalHandler ( arg_0 . workers , arg_0 . stopper ) signal . signal ( signal . SIGINT , arg_0 . signal_handler ) for arg_4 in arg_0 . workers : arg_4 . start ( )


Question: Stop this Tracer .

def Func ( arg_0 ) : arg_0 . Funcped = True if arg_0 . thread != threading . currentThread ( ) : return if hasattr ( sys , "gettrace" ) and arg_0 . warn : if sys . gettrace ( ) != arg_0 . _trace : arg_2 = "Trace function changed, measurement is likely wrong: %r" arg_0 . warn ( arg_2 % ( sys . gettrace ( ) , ) ) sys . settrace ( None )

Creates file copy in remote storage.

        Args:
            - target:
                Name of a custom storage connected to the project.
            - effects:
                Adds CDN image effects to ``self.default_effects`` if any.
            - make_public:
                To forbid public from accessing your files on the storage set
                ``make_public`` option to be False.
                Default value is None. Files have public access by default.
            - pattern:
                Specify ``pattern`` option to set S3 object key name.
                Takes precedence over pattern set in project settings.
                If neither is specified defaults to
                `${uuid}/${filename}${effects}${ext}`.

        For more information on each of the options above please refer to
        REST API docs https://uploadcare.com/docs/api_reference/rest/accessing_files/.

        Following example copies a file to custom storage named ``samplefs``:

             >>> file = File('e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a')
             >>> file.create_remote_copy(target='samplefs',
             >>>                         make_public=True,
             >>>                         pattern='${uuid}/${filename}${ext}')

        Now custom storage ``samplefs`` contains publicly available file
        with original filename billmurray.jpg in
        in the directory named ``e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a``.


Question: Load cron modules for applications listed in INSTALLED_APPS .

def Func ( ) : autodiscover_modules ( 'cron' ) if PROJECT_MODULE : if '.' in PROJECT_MODULE . __name__ : try : import_module ( '%s.cron' % '.' . join ( PROJECT_MODULE . __name__ . split ( '.' ) [ 0 : - 1 ] ) ) except ImportError as e : if 'No module named' not in str ( e ) : print ( e ) for arg_0 , arg_1 in get_commands ( ) . items ( ) : try : Func_command_class ( arg_1 , arg_0 ) except django . core . exceptions . ImproperlyConfigured : pass


Question: Rip the events from a given rss feed normalize the data and store .

def Func ( arg_0 , arg_1 ) : arg_2 = load_feed ( arg_1 ) arg_3 = arg_2 [ 'feed' ] arg_4 = arg_2 [ 'entries' ] arg_5 = 'community' arg_6 = 'Czech Republic' for arg_7 in arg_4 : arg_8 = sluggify ( arg_7 [ 'id' ] ) arg_9 = arg_7 [ 'tags' ] [ 0 ] [ 'term' ] arg_10 = arg_7 [ 'link' ] arg_11 = dt_normalize ( arg_7 [ 'published_parsed' ] , local_tz = True ) arg_12 = arg_7 [ 'title' ] arg_13 = arg_7 [ 'summary' ] arg_14 = arg_7 [ 'link' ] ipdb . set_trace ( )


Question: Read the coverage data from filename .

def Func ( arg_0 , arg_1 ) : arg_0 . lines , arg_0 . arcs = arg_0 . _Func ( arg_1 )

Delete existing messages.

        http://dev.wheniwork.com/#delete-existing-message


Question: Prettifies the dictionary of metrics .

def Func ( arg_0 : arg_1 [ arg_2 [ arg_3 , arg_4 ] ] , arg_5 : arg_6 = 4 ) -> OrderedDict : arg_7 = OrderedDict ( ) for arg_8 , arg_9 in arg_0 : arg_9 = round ( arg_9 , arg_5 ) arg_7 [ arg_8 ] = arg_9 return arg_7

Drop a node from the network

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


Question: Return the length of the indentation on the given token s line .

def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 : if arg_2 == " " : arg_1 += 1 elif arg_2 == "\t" : arg_1 += _TAB_LENGTH else : break return arg_1

Launches GBDX workflow.

        Args:
            workflow (dict): Dictionary specifying workflow tasks.

        Returns:
            Workflow id (str).


Question: Check if files in input file list have the same number of channels

def Func ( arg_0 , arg_1 ) : arg_2 = [ file_info . channels ( f ) for f in arg_0 ] if not core . all_equal ( arg_2 ) : raise IOError ( "Input files do not have the same number of channels. The " "{} combine type requires that all files have the same " "number of channels" . format ( arg_1 ) )

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: Create physics bodies corresponding to each marker in our data .

def Func ( arg_0 ) : arg_0 . bodies = { } for arg_2 in arg_0 . channels : arg_3 = arg_0 . world . create_body ( 'sphere' , name = 'marker:{}' . format ( arg_2 ) , radius = 0.02 ) arg_3 . is_kinematic = True arg_3 . color = 0.9 , 0.1 , 0.1 , 0.5 arg_0 . bodies [ arg_2 ] = arg_3


Question: Brings down a Heroku app .

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_2 : click . echo ( 'WARNING: Inferring the app name when deleting is deprecated. ' 'Starting with happy 2.0, the app_name parameter will be required.' ) arg_2 = arg_2 or _read_app_name ( ) if not arg_2 : click . echo ( 'No app name given.' ) sys . exit ( 1 ) if not arg_1 : click . confirm ( 'Are you sure you want to delete %s?' % arg_2 , abort = True , ) arg_3 = Happy ( arg_0 = arg_0 ) click . echo ( 'Destroying app %s... ' % arg_2 , nl = False ) arg_3 . delete ( arg_2 = arg_2 ) _delete_app_name_file ( ) click . echo ( 'done' ) click . echo ( "It's Func. :(" )

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


Question: Renders a javascript snippet suitable for use as a mapbox - gl line paint entry

def Func ( arg_0 ) : arg_1 = { 'line-opacity' : VectorStyle . get_style_value ( arg_0 . opacity ) , 'line-color' : VectorStyle . get_style_value ( arg_0 . color ) , 'line-width' : VectorStyle . get_style_value ( arg_0 . width ) , } if arg_0 . translate : arg_1 [ 'line-translate' ] = arg_0 . translate if arg_0 . dasharray : arg_1 [ 'line-dasharray' ] = VectorStyle . get_style_value ( arg_0 . dasharray ) return arg_1

Fit structure-based AD. The training model  memorizes the unique set of reaction signature.

        Parameters
        ----------
        X : after read rdf file

        Returns
        -------
        self : object


Question: Save Model Details of an H2O Model in JSON Format to disk .

def Func ( arg_0 , arg_1 = "" , arg_2 = False ) : assert_is_type ( arg_1 , str ) assert_is_type ( arg_2 , bool ) arg_1 = os . path . join ( os . getcwd ( ) if arg_1 == "" else arg_1 , arg_0 . model_id + ".json" ) return h2o . api ( "GET /99/Models/%s/json" % arg_0 . model_id , data = { "dir" : arg_1 , "force" : arg_2 } ) [ "dir" ]

Yields blocks starting from ``start``.

            :param int start: Starting block
            :param int stop: Stop at this block
            :param str mode: We here have the choice between
             "head" (the last block) and "irreversible" (the block that is
             confirmed by 2/3 of all block producers and is thus irreversible)


Question: use the GUI to pop up a message .

def Func ( arg_0 , arg_1 ) : arg_2 = tkinter . Tk ( ) arg_2 . withdraw ( ) arg_2 . attributes ( "-topmost" , True ) arg_2 . lift ( ) tkinter . messagebox . showwarning ( arg_0 , arg_1 ) arg_2 . destroy ( )

Overriding the default JSONEncoder.default for NDB support.


Question: uses results from marginal ancestral inference to return a joint distribution of the sequence states at both ends of the branch .

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 , arg_4 = arg_0 . marginal_branch_profile ( arg_1 ) arg_5 = arg_0 . gtr . expQt ( arg_0 . _branch_length_to_gtr ( arg_1 ) ) if len ( arg_5 . shape ) == 3 : arg_6 = np . einsum ( 'ai,aj,ija->aij' , arg_4 , arg_3 , arg_5 ) else : arg_6 = np . einsum ( 'ai,aj,ij->aij' , arg_4 , arg_3 , arg_5 ) arg_7 = arg_6 . sum ( axis = 2 ) . sum ( axis = 1 ) arg_6 = np . einsum ( 'aij,a->aij' , arg_6 , 1.0 / arg_7 ) if arg_2 : return arg_6 [ arg_0 . full_to_reduced_sequence_map ] else : return arg_6

For use in tests; applied UTC timestamp to DataFrame.


Question: Turn column inputs from user into list of simple numbers .

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : for arg_3 in arg_2 . split ( ',' ) : arg_3 = arg_3 . strip ( ) try : arg_2 = int ( arg_3 ) arg_1 . append ( arg_2 ) except ( TypeError , ValueError ) : arg_4 , arg_5 , arg_6 = arg_3 . partition ( '-' ) try : arg_4 = int ( arg_4 ) arg_6 = int ( arg_6 ) except ( TypeError , ValueError ) : raise ValueError ( 'Did not understand %r, expected digit-digit' % arg_2 ) arg_7 = 1 if arg_4 < arg_6 else - 1 arg_1 . extend ( range ( arg_4 , arg_6 + arg_7 , arg_7 ) ) return [ arg_8 - 1 for arg_8 in arg_1 ]

Generates and writes the media pages for all media in the gallery


Question: Run a command or just echo it depending on commit .

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : if arg_0 . _commit : return arg_0 . run ( arg_1 , * arg_2 , ** arg_3 ) else : notify . warning ( "WOULD RUN: {}" . format ( arg_1 ) ) arg_3 = arg_3 . copy ( ) arg_3 [ 'echo' ] = False return arg_0 . run ( 'true' , * arg_2 , ** arg_3 )

Return a list of examples which violate the schema.


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

def Func ( arg_0 ) : if isinstance ( arg_0 , six . text_type ) : try : import unidecode except ImportError : pass else : arg_0 = unidecode . unidecode ( arg_0 ) arg_0 = arg_0 . encode ( 'ascii' , 'replace' ) arg_0 = arg_0 . replace ( b'\\' , b'\\\\' ) . replace ( b'"' , b'\\"' ) return '"{0!s}"' . format ( arg_0 . decode ( ) )

Given two templates and their respective versions, return True if a new cookiecutter
    config needs to be obtained from the user


Question: Create a new Set produce by the intersection of 2 Set

def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : arg_3 = arg_2 ( arg_1 = arg_0 . _hsig . values ( ) , state = arg_0 . state ) arg_3 &= arg_1 return arg_3

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: This will output the nginx location config string for specific port spec

def Func ( arg_0 , arg_1 ) : arg_2 = "\t \t location / { \n" for arg_3 in [ 'proxy_http_version 1.1;' , 'proxy_set_header Upgrade $http_upgrade;' , 'proxy_set_header Connection "upgrade";' , 'proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' , 'proxy_set_header Host $http_host;' , _nginx_proxy_string ( arg_0 , arg_1 ) ] : arg_2 += "\t \t \t {} \n" . format ( arg_3 ) arg_2 += "\t \t } \n" return arg_2

Return an existing or new ConversationWidget.


Question: Tell the Hub to forget results .

def Func ( arg_0 , arg_1 = [ ] , arg_2 = [ ] ) : if not arg_2 and not arg_1 : raise ValueError ( "Must specify at least one of `targets` and `jobs`" ) if arg_2 : arg_2 = arg_0 . _build_targets ( arg_2 ) [ 1 ] if arg_1 == 'all' : arg_3 = arg_1 else : arg_3 = [ ] if isinstance ( arg_1 , ( basestring , AsyncResult ) ) : arg_1 = [ arg_1 ] arg_4 = filter ( lambda obj : not isinstance ( obj , ( basestring , AsyncResult ) ) , arg_1 ) if arg_4 : raise TypeError ( "Invalid msg_id type %r, expected str or AsyncResult" % arg_4 [ 0 ] ) for arg_5 in arg_1 : if isinstance ( arg_5 , AsyncResult ) : arg_3 . extend ( arg_5 . msg_ids ) else : arg_3 . append ( arg_5 ) arg_6 = dict ( engine_ids = arg_2 , arg_3 = arg_3 ) arg_0 . session . send ( arg_0 . _query_socket , "purge_request" , arg_6 = arg_6 ) arg_7 , arg_8 = arg_0 . session . recv ( arg_0 . _query_socket , 0 ) if arg_0 . debug : pprint ( arg_8 ) arg_6 = arg_8 [ 'content' ] if arg_6 [ 'status' ] != 'ok' : raise arg_0 . _unwrap_exception ( arg_6 )

r'''Method to calculate pressure-dependent liquid molar volume at
        temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        P : float
            Pressure at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and P, [m^3/mol]


Question: If there are edits to the current input buffer store them .

def Func ( arg_0 ) : arg_1 = arg_0 . input_buffer if arg_0 . _history_index == len ( arg_0 . _history ) or arg_0 . _history [ arg_0 . _history_index ] != arg_1 : arg_0 . _history_edits [ arg_0 . _history_index ] = arg_1

Handle the kernel's death by asking if the user wants to restart.


Question: Returns a list of patches after patch from the patches list

def Func ( arg_0 , arg_1 ) : return [ arg_2 . get_patch ( ) for arg_2 in arg_0 . _patchlines_after ( arg_1 ) if arg_2 . get_patch ( ) ]

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


Question: Query the oracle to find out whether i and j should be must - linked

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . queries_cnt < arg_0 . max_queries_cnt : arg_0 . queries_cnt += 1 return arg_0 . labels [ arg_1 ] == arg_0 . labels [ arg_2 ] else : raise MaximumQueriesExceeded

stupidly print an iterable of iterables in TSV format


Question: Replace macros with content defined in the config .

def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : def _sub ( arg_3 ) : arg_4 = arg_3 . group ( 'body' ) arg_5 = arg_0 . get_options ( arg_3 . group ( 'options' ) ) return arg_0 . options [ 'macros' ] . get ( arg_4 , '' ) . format_map ( arg_5 ) return arg_0 . pattern . sub ( _sub , arg_1 )

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

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


Question: Checks if name_node has corresponding assign statement in same scope

def Func ( arg_0 ) : arg_1 = arg_0 . scope ( ) . nodes_of_class ( astroid . AssignName ) return any ( arg_2 . name == arg_0 . name for arg_2 in arg_1 )

This method is called before first step of simulation.


Question: r Return the phase of a waveform s dependent variable vector .

def Func ( arg_0 , arg_1 = True , arg_2 = True ) : arg_3 = copy . copy ( arg_0 ) arg_3 . dep_units = "rad" if arg_2 else "deg" arg_3 . dep_name = "Func({0})" . format ( arg_3 . dep_name ) arg_3 . _dep_vector = ( np . unwrap ( np . angle ( arg_3 . _dep_vector ) ) if arg_1 else np . angle ( arg_3 . _dep_vector ) ) if not arg_2 : arg_3 . _dep_vector = np . rad2deg ( arg_3 . _dep_vector ) return arg_3

Extracts start row from the bookmark information


Question: Set self . thermostats to a json list of thermostats from ecobee

def Func ( arg_0 ) : arg_1 = 'https://api.ecobee.com/1/thermostat' arg_2 = { 'Content-Type' : 'application/json;charset=UTF-8' , 'Authorization' : 'Bearer ' + arg_0 . access_token } arg_3 = { 'json' : ( '{"selection":{"selectionType":"registered",' '"includeRuntime":"true",' '"includeSensors":"true",' '"includeProgram":"true",' '"includeEquipmentStatus":"true",' '"includeEvents":"true",' '"includeWeather":"true",' '"includeSettings":"true"}}' ) } try : arg_4 = requests . get ( arg_1 , headers = arg_2 , arg_3 = arg_3 ) except RequestException : logger . warn ( "Error connecting to Ecobee.  Possible connectivity outage." ) return None if arg_4 . status_code == requests . codes . ok : arg_0 . authenticated = True arg_0 . thermostats = arg_4 . json ( ) [ 'thermostatList' ] return arg_0 . thermostats else : arg_0 . authenticated = False logger . info ( "Error connecting to Ecobee while attempting to get " "thermostat data.  Refreshing tokens and trying again." ) if arg_0 . refresh_tokens ( ) : return arg_0 . Func ( ) else : return None

Check if number or constant is power of two


Question: Returns an AudioSegment object from the given file based on its file extension . If the extension is wrong this will throw some sort of error .

def Func ( arg_0 ) : arg_1 , arg_2 = os . path . splitext ( arg_0 ) arg_2 = arg_2 . lower ( ) [ 1 : ] arg_3 = pydub . AudioSegment . Func ( arg_0 , arg_2 ) return AudioSegment ( arg_3 , arg_0 )

Return a random sample from the distribution.


Question: Converts a user type to RECORD that contains n fields where n is the number of attributes . Each element in the user type class will be converted to its corresponding data type in BQ .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . _fields arg_4 = [ arg_0 . convert_value ( arg_1 , getattr ( arg_2 , arg_1 ) ) for arg_1 in arg_3 ] return arg_0 . generate_data_dict ( arg_3 , arg_4 )

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


Question: Get the label for the metric being optimized . This function also caches the label in the instance variable self . _optimizedMetricLabel

def Func ( arg_0 ) : arg_1 = matchPatterns ( [ arg_0 . _optimizeKeyPattern ] , arg_0 . _getMetricLabels ( ) ) if len ( arg_1 ) == 0 : raise Exception ( "None of the generated metrics match the specified " "optimization pattern: %s. Available metrics are %s" % ( arg_0 . _optimizeKeyPattern , arg_0 . _getMetricLabels ( ) ) ) elif len ( arg_1 ) > 1 : raise Exception ( "The specified optimization pattern '%s' matches more " "than one metric: %s" % ( arg_0 . _optimizeKeyPattern , arg_1 ) ) return arg_1 [ 0 ]

write lines, one by one, separated by \n to device


Question: Download a Google Drive file from and place it in root .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : import requests arg_4 = "https://docs.google.com/uc?export=download" arg_1 = os . path . expanduser ( arg_1 ) if not arg_2 : arg_2 = arg_0 arg_5 = os . path . join ( arg_1 , arg_2 ) makedir_exist_ok ( arg_1 ) if os . path . isfile ( arg_5 ) and check_integrity ( arg_5 , arg_3 ) : print ( 'Using downloaded and verified file: ' + arg_5 ) else : arg_6 = requests . Session ( ) arg_7 = arg_6 . get ( arg_4 , arg_9 = { 'id' : arg_0 } , stream = True ) arg_8 = _get_confirm_token ( arg_7 ) if arg_8 : arg_9 = { 'id' : arg_0 , 'confirm' : arg_8 } arg_7 = arg_6 . get ( arg_4 , arg_9 = arg_9 , stream = True ) _save_response_content ( arg_7 , arg_5 )


Question: Returns the number of nucleotides and the size per contig for the provided assembly file path

def Func ( arg_0 ) : arg_1 = 0 arg_2 = { } arg_3 = "" with open ( arg_0 ) as fh : for arg_4 in fh : if arg_4 . strip ( ) == "" : continue if arg_4 . startswith ( ">" ) : arg_3 = arg_4 . strip ( ) [ 1 : ] arg_2 [ arg_3 ] = 0 else : arg_5 = len ( arg_4 . strip ( ) ) arg_1 += arg_5 arg_2 [ arg_3 ] += arg_5 return arg_1 , arg_2

Used to identify when buffered messages should be processed and responded to.

        When max_in_flight > 1 and you're batching messages together to perform work
        is isn't possible to just compare the len of your list of buffered messages against
        your configured max_in_flight (because max_in_flight may not be evenly divisible
        by the number of producers you're connected to, ie. you might never get that many
        messages... it's a *max*).

        Example::

            def message_handler(self, nsq_msg, reader):
                # buffer messages
                if reader.is_starved():
                    # perform work

            reader = nsq.Reader(...)
            reader.set_message_handler(functools.partial(message_handler, reader=reader))
            nsq.run()


Question: Make an HTTP request using aiohttp directly .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : if not urllib . parse . urlparse ( arg_2 ) . hostname . endswith ( '.google.com' ) : raise Exception ( 'expected google.com domain' ) arg_4 = arg_4 or { } arg_4 . update ( arg_0 . _authorization_headers ) return arg_0 . _session . request ( arg_1 , arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , proxy = arg_0 . _proxy )

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


Question: Calculates the coordinates of a point from the origin .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_1 + cos ( radians ( arg_4 ) ) * arg_3 arg_6 = arg_2 + sin ( radians ( arg_4 ) ) * arg_3 return Point ( arg_5 , arg_6 )

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

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


Question: Returns this context s metrics collector

def Func ( arg_0 ) : if arg_0 . metrics_collector is None or not isinstance ( arg_0 . metrics_collector , MetricsCollector ) : raise RuntimeError ( "Metrics collector is not registered in this context" ) return arg_0 . metrics_collector

Transforms X according to the linear transformation corresponding to
        flipping the input eigenvalues.

        Parameters
        ----------
        X : array, shape [n_test, n]
            The test similarities to training points.

        Returns
        -------
        Xt : array, shape [n_test, n]
            The transformed test similarites to training points.


Question: Create Y - axis

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False ) : arg_5 = { } if arg_4 and arg_3 : arg_5 [ 'tickFormat' ] = arg_3 elif arg_3 : arg_5 [ 'tickFormat' ] = "d3.format(',%s')" % arg_3 if arg_2 : arg_5 [ 'axisLabel' ] = "'" + arg_2 + "'" arg_0 . axislist [ arg_1 ] = arg_5

Load roster from an XML file.

        Can be used before the connection is started to load saved
        roster copy, for efficient retrieval of versioned roster.

        :Parameters:
            - `source`: file name or a file object
        :Types:
            - `source`: `str` or file-like object


Question: Return a stack of frames which the debugger will use for in showing backtraces and in frame switching . As such various frame that are really around may be excluded unless we are debugging the sebugger . Also we will add traceback frame on top if that exists .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = lambda arg_0 : False if arg_3 : arg_5 = arg_3 . debugger . settings if not arg_5 [ 'dbg_trepan' ] : arg_4 = lambda arg_0 : arg_3 . core . ignore_filter . is_included ( arg_0 ) pass pass arg_6 = [ ] if arg_1 and arg_1 . tb_frame is arg_0 : arg_1 = arg_1 . tb_next while arg_0 is not None : if arg_4 ( arg_0 ) : break arg_6 . append ( ( arg_0 , arg_0 . f_lineno ) ) arg_0 = arg_0 . f_back pass arg_6 . reverse ( ) arg_7 = max ( 0 , len ( arg_6 ) - 1 ) while arg_1 is not None : arg_6 . append ( ( arg_1 . tb_frame , arg_1 . tb_lineno ) ) arg_1 = arg_1 . tb_next pass return arg_6 , arg_7


Question: List names of options and positional arguments .

def Func ( arg_0 ) : return arg_0 . options . Func ( ) + [ arg_1 . name for arg_1 in arg_0 . positional_args ]

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


Question: Save the pylab figure somewhere . If fname == False show it instead . Height force > dpi force if a tag is given instead of a filename save it alongside the ABF

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = 700 , arg_4 = True , arg_5 = 'w' , arg_6 = True ) : if len ( pylab . gca ( ) . get_lines ( ) ) == 0 : print ( "can't Func, no figure!" ) return if arg_6 : pylab . tight_layout ( ) pylab . subplots_adjust ( bottom = .1 ) annotate ( arg_0 ) if arg_2 : arg_1 = arg_0 . outpath + arg_0 . ID + "_" + arg_2 + ".png" arg_7 , arg_8 = pylab . gcf ( ) . get_size_inches ( ) arg_9 = arg_3 / arg_7 if arg_1 : if not os . path . exists ( arg_0 . outpath ) : os . mkdir ( arg_0 . outpath ) print ( " <- saving [%s] at %d DPI (%dx%d)" % ( os . path . basename ( arg_1 ) , arg_9 , arg_7 * arg_9 , arg_8 * arg_9 ) ) pylab . Funcfig ( arg_1 , arg_9 = arg_9 , arg_5 = arg_5 ) else : pylab . show ( ) if arg_4 : pylab . close ( )

Return line with the star import expanded.


Question: Check if the given IP is an IP range .

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

Overriding the default JSONEncoder.default for NDB support.


Question: Evaluate layer outputs for x

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_2 : return None arg_3 = [ arg_0 . net . input ] if arg_0 . learning_phase is not None : arg_3 . append ( arg_0 . learning_phase ) arg_4 = K . function ( arg_3 , [ arg_0 . get_layer_output ( layer_name ) for layer_name in arg_2 ] ) arg_5 = arg_4 ( [ arg_1 ] ) arg_6 = dict ( zip ( arg_2 , arg_5 ) ) return arg_6

Calculates bubble point for a given pressure

    Parameters
    ----------
    P : float
        Pressure, [Pa]
    zs : list[float]
        Overall mole fractions of all species, [-]
    vapor_pressure_eqns : list[functions]
        Temperature dependent function for each specie, Returns Psat, [Pa]
    fugacities : list[float], optional
        fugacities of each species, defaults to list of ones, [-]
    gammas : list[float], optional
        gammas of each species, defaults to list of ones, [-]

    Returns
    -------
    Tbubble : float, optional
        Temperature of bubble point at pressure `P`, [K]


Question: Return a dictionary with hgnc_symbol as key and gene_obj as value

def Func ( arg_0 , arg_1 = '37' , arg_2 = None ) : arg_3 = { } LOG . info ( "Building Func" ) if not arg_2 : arg_2 = arg_0 . hgnc_collection . find ( { 'build' : arg_1 } ) for arg_4 in arg_2 : arg_3 [ arg_4 [ 'hgnc_symbol' ] ] = arg_4 LOG . info ( "All genes fetched" ) return arg_3

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: This function returns a dictionary representation of a docker - compose . yml file based on assembled_specs from the spec_assembler and port_specs from the port_spec compiler

def Func ( arg_0 , arg_1 ) : arg_2 = _compose_dict_for_nginx ( arg_1 ) for arg_3 in arg_0 [ 'apps' ] . keys ( ) : arg_2 [ arg_3 ] = _composed_app_dict ( arg_3 , arg_0 , arg_1 ) for arg_4 in arg_0 [ 'services' ] . values ( ) : arg_2 [ arg_4 . name ] = _composed_service_dict ( arg_4 ) return 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: Get an effect class by the class name

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 = None ) -> Type [ 'Effect' ] : return arg_0 . _project . Func ( arg_1 , arg_3 = arg_3 )

Get the SSH parameters for connecting to a vagrant VM.


Question: Creates ES filters for key ranges used in scanning .

def Func ( arg_0 , * arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_1 : if isinstance ( arg_3 , basestring ) : arg_3 = eid ( arg_3 ) if isinstance ( arg_4 , basestring ) : arg_4 += u'\U0010FFFF' arg_4 = eid ( arg_4 ) if arg_3 == ( ) and arg_4 == ( ) : arg_2 . append ( { 'match_all' : { } } ) elif arg_4 == ( ) : arg_2 . append ( { 'range' : { '_id' : { 'gte' : arg_3 } } } ) elif arg_3 == ( ) : arg_2 . append ( { 'range' : { '_id' : { 'lte' : arg_4 } } } ) else : arg_2 . append ( { 'range' : { '_id' : { 'gte' : arg_3 , 'lte' : arg_4 } } } ) if len ( arg_2 ) == 0 : return [ { 'match_all' : { } } ] else : return arg_2

Computes the standard deviation of a mixture distribution.

  This function works regardless of the component distribution, so long as
  each component's mean and standard deviation can be provided.

  Args:
    mixture_weight_vector: A 2D tensor with shape [batch_size, num_components]
    mean_vector: A 2D tensor of mixture component means. Has shape `[batch_size,
      num_components]`.
    stddev_vector: A 2D tensor of mixture component standard deviations. Has
      shape `[batch_size, num_components]`.

  Returns:
    A 1D tensor of shape `[batch_size]` representing the standard deviation of
    the mixture distribution with given weights and component means and standard
    deviations.
  Raises:
    ValueError: If the shapes of the input tensors are not as expected.


Question: Updates the manual rank for all variants in a case

def Func ( arg_0 , arg_1 , arg_2 = 'clinical' , arg_3 = 'snv' ) : arg_4 = arg_0 . variant_collection . find ( { 'case_id' : arg_1 [ '_id' ] , 'category' : arg_3 , 'variant_type' : arg_2 , } ) . sort ( 'rank_score' , pymongo . DESCENDING ) LOG . info ( "Updating variant_rank for all variants" ) arg_5 = [ ] for arg_6 , arg_7 in enumerate ( arg_4 ) : if len ( arg_5 ) > 5000 : try : arg_0 . variant_collection . bulk_write ( arg_5 , ordered = False ) arg_5 = [ ] except BulkWriteError as err : LOG . warning ( "Updating variant rank failed" ) raise err arg_8 = pymongo . UpdateOne ( { '_id' : arg_7 [ '_id' ] } , { '$set' : { 'variant_rank' : arg_6 + 1 , } } ) arg_5 . append ( arg_8 ) try : arg_0 . variant_collection . bulk_write ( arg_5 , ordered = False ) except BulkWriteError as err : LOG . warning ( "Updating variant rank failed" ) raise err LOG . info ( "Updating variant_rank done" )


Question: Counts the number of lines in a file .

def Func ( arg_0 ) : arg_1 = 0 with open ( arg_0 ) as f : for arg_1 , arg_2 in enumerate ( f ) : pass return arg_1 + 1


Question: Purge all database records for the current user .

def Func ( arg_0 ) : with arg_0 . engine . begin ( ) as db : purge_remote_checkpoints ( db , arg_0 . user_id )

Sleep for the time specified in the exception. If not specified, wait
        for 60 seconds.


Question: Desaturates the layer making it grayscale . Instantly removes all color information from the layer while maintaing its alpha channel .

def Func ( arg_0 ) : arg_1 = arg_0 . img . split ( ) [ 3 ] arg_0 . img = arg_0 . img . convert ( "L" ) arg_0 . img = arg_0 . img . convert ( "RGBA" ) arg_0 . img . putalpha ( arg_1 )

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


Question: Parse a mbox file .

def Func ( arg_0 ) : arg_1 = _MBox ( arg_0 , create = False ) for arg_2 in arg_1 : arg_3 = message_to_dict ( arg_2 ) yield arg_3

Associate an existing reservedIP to a deployment.

        name:
            Required. Name of the reserved IP address.

        service_name:
            Required. Name of the hosted service.

        deployment_name:
            Required. Name of the deployment.

        virtual_ip_name:
            Optional. Name of the VirtualIP in case of multi Vip tenant.
            If this value is not specified default virtualIP is used
            for this operation.


Question: Starts over again at the new line . If number is specified it will leave multiple lines .

def Func ( arg_0 , arg_1 = 1 ) : if isinstance ( arg_1 , int ) : try : arg_0 . page . _Func ( arg_0 . font , arg_1 , arg_0 . double_spacing ) except ValueError : arg_0 . add_page ( ) else : raise TypeError ( "Number of newlines must be an integer." )

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


Question: Create and initialize a network .

def Func ( arg_0 ) : with open ( _PARAMS_PATH , "r" ) as f : arg_1 = yaml . safe_load ( f ) [ "modelParams" ] arg_2 = Network ( ) arg_2 . addRegion ( "sensor" , "py.RecordSensor" , '{}' ) arg_3 = arg_2 . regions [ "sensor" ] . getSelf ( ) arg_3 . encoder = createEncoder ( arg_1 [ "sensorParams" ] [ "encoders" ] ) arg_3 . dataSource = arg_0 arg_1 [ "spParams" ] [ "inputWidth" ] = arg_3 . encoder . getWidth ( ) arg_2 . addRegion ( "SP" , "py.SPRegion" , json . dumps ( arg_1 [ "spParams" ] ) ) arg_2 . addRegion ( "TM" , "py.TMRegion" , json . dumps ( arg_1 [ "tmParams" ] ) ) arg_5 = "py.%s" % arg_1 [ "clParams" ] . pop ( "regionName" ) arg_2 . addRegion ( "classifier" , arg_5 , json . dumps ( arg_1 [ "clParams" ] ) ) createSensorToClassifierLinks ( arg_2 , "sensor" , "classifier" ) createDataOutLink ( arg_2 , "sensor" , "SP" ) createFeedForwardLink ( arg_2 , "SP" , "TM" ) createFeedForwardLink ( arg_2 , "TM" , "classifier" ) createResetLink ( arg_2 , "sensor" , "SP" ) createResetLink ( arg_2 , "sensor" , "TM" ) arg_2 . initialize ( ) return arg_2

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: Causes the bot to write its current state to backend .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . send_message ( arg_1 . channel , "Saving current state..." ) arg_0 . _bot . plugins . Func_state ( ) arg_0 . send_message ( arg_1 . channel , "Done." )

Adds an empty derived parameter group under the current node.

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

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


Question: Deletes the specified table in Cloud Bigtable . Raises google . api_core . exceptions . NotFound if the table does not exist .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_0 . get_instance ( arg_1 = arg_1 , arg_3 = arg_3 ) . table ( arg_2 = arg_2 ) arg_4 . delete ( )

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

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


Question: Returns the data for a certain media item .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = { "media_id" : arg_1 } if arg_2 : arg_4 [ "fields" ] = "," . join ( arg_2 ) return arg_0 . _api_call ( "info" , arg_4 , arg_3 = arg_3 )

Stop streaming samples from device and delete samples buffer


Question: count number of sites with cov = 4 and number of variable sites .

def Func ( arg_0 ) : arg_1 = np . array ( [ list ( i . split ( ) [ - 1 ] ) for i in arg_0 ] ) arg_2 = np . any ( arg_1 == "N" , axis = 0 ) arg_3 = arg_1 [ : , ~ arg_2 ] arg_4 = np . invert ( np . all ( arg_3 == arg_3 [ 0 , : ] , axis = 0 ) ) . sum ( ) return arg_3 . shape [ 1 ] , arg_4

Returns a Certificate object by its ID.

            Args:
                id (str): Certificate ID


Question: API call to create a template

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = '' , arg_5 = None ) : arg_6 = { 'name' : arg_1 , 'subject' : arg_2 , 'html' : arg_3 , 'text' : arg_4 } return arg_0 . _api_request ( arg_0 . TEMPLATES_ENDPOINT , arg_0 . HTTP_POST , arg_6 = arg_6 , arg_5 = arg_5 )

Fetch the events pages of a given group.


Question: Handles IntentRequest Alexa request .

def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : arg_3 = arg_0 . config [ 'intent_name' ] arg_4 = arg_0 . config [ 'slot_name' ] arg_5 = arg_1 [ 'request' ] [ 'requestId' ] arg_6 : arg_2 = arg_1 [ 'request' ] [ 'intent' ] if arg_3 != arg_6 [ 'name' ] : log . error ( f"Wrong intent name received: {request_intent['name']} in request {request_id}" ) return { 'error' : 'wrong intent name' } if arg_4 not in arg_6 [ 'slots' ] . keys ( ) : log . error ( f'No slot named {slot_name} found in request {request_id}' ) return { 'error' : 'no slot found' } arg_7 = arg_6 [ 'slots' ] [ arg_4 ] [ 'value' ] arg_8 = arg_0 . _act ( arg_7 ) if not arg_8 : log . error ( f'Some error during response generation for request {request_id}' ) return { 'error' : 'error during response generation' } arg_9 : RichMessage = arg_8 [ 0 ] arg_9 : list = arg_9 . alexa ( ) if not arg_9 : log . error ( f'Some error during response generation for request {request_id}' ) return { 'error' : 'error during response generation' } arg_10 = arg_0 . _generate_response ( arg_9 [ 0 ] , arg_1 ) return arg_10

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: Verify the signaure of an XML document with the given certificate . Returns True if the document is signed with a valid signature . Returns False if the document is not signed or if the signature is invalid .

def Func ( arg_0 , arg_1 ) : import xmlsec arg_2 = xmlsec . tree . find_node ( arg_0 , xmlsec . Node . SIGNATURE ) if arg_2 is None : return False arg_3 = xmlsec . SignatureContext ( ) arg_3 . register_id ( arg_0 ) for arg_4 in arg_0 . xpath ( "//*[local-name()='Assertion']" ) : arg_3 . register_id ( arg_4 ) arg_5 = None for arg_6 in [ xmlsec . KeyFormat . PEM , xmlsec . KeyFormat . CERT_PEM ] : arg_1 . seek ( 0 ) try : arg_5 = xmlsec . Key . from_memory ( arg_1 , arg_6 ) break except ValueError : pass arg_3 . key = arg_5 try : arg_3 . Func ( arg_2 ) return True except Exception : return False

Create required links from a sensor region to a classifier region.


Question: Generate new sequences .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 , arg_4 = False , arg_5 = False ) : arg_6 , arg_7 = arg_0 . sample_static_prior ( arg_3 , arg_1 , arg_4 ) arg_8 , arg_7 = arg_0 . sample_dynamic_prior ( arg_3 , arg_1 , arg_2 , arg_5 ) arg_9 = arg_0 . decoder ( ( arg_8 , arg_6 ) ) return arg_9


Question: Function to find local minima .

Loads a certificate, public key or private key into a Certificate,
    PublicKey or PrivateKey object via CryptoAPI

    :param key_object:
        An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or
        asn1crypto.keys.PrivateKeyInfo object

    :param key_info:
        An asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo
        object

    :param container:
        The class of the object to hold the key_handle

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        oscrypto.errors.AsymmetricKeyError - when the key is incompatible with the OS crypto library
        OSError - when an error is returned by the OS crypto library

    :return:
        A PrivateKey, PublicKey or Certificate object, based on container


Question: A get or create method for encrypted fields we cache the field in the module to avoid recreation . This also allows us to always return the same class reference for a field .

def Func ( arg_0 ) : assert not isinstance ( arg_0 , models . Field ) arg_1 = 'Encrypted' + arg_0 . __name__ if arg_0 not in arg_2 : arg_2 [ arg_0 ] = type ( arg_1 , ( EncryptedMixin , arg_0 ) , { 'base_class' : arg_0 , } ) return arg_2 [ arg_0 ]

Cycles through notifications with latest results from data feeds.


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

def Func ( arg_0 ) : if not arg_0 . tokenFile : raise SkypeAuthException ( "No token file specified" ) try : with open ( arg_0 . tokenFile , "r" ) as f : arg_1 = f . read ( ) . splitlines ( ) except OSError : raise SkypeAuthException ( "Token file doesn't exist or not readable" ) try : arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 = arg_1 arg_4 = datetime . fromtimestamp ( int ( arg_4 ) ) arg_6 = datetime . fromtimestamp ( int ( arg_6 ) ) except ValueError : raise SkypeAuthException ( "Token file is malformed" ) if datetime . now ( ) >= arg_4 : raise SkypeAuthException ( "Token file has expired" ) arg_0 . userId = arg_2 arg_0 . tokens [ "skype" ] = arg_3 arg_0 . tokenExpiry [ "skype" ] = arg_4 if datetime . now ( ) < arg_6 : arg_0 . tokens [ "reg" ] = arg_5 arg_0 . tokenExpiry [ "reg" ] = arg_6 arg_0 . msgsHost = arg_7 else : arg_0 . getRegToken ( )

Returns an iterator for the comments on a certain card.


Question: Create a new list in your MailChimp account .

def Func ( arg_0 , arg_1 ) : if 'name' not in arg_1 : raise KeyError ( 'The list must have a name' ) if 'contact' not in arg_1 : raise KeyError ( 'The list must have a contact' ) if 'company' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a company' ) if 'address1' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a address1' ) if 'city' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a city' ) if 'state' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a state' ) if 'zip' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a zip' ) if 'country' not in arg_1 [ 'contact' ] : raise KeyError ( 'The list contact must have a country' ) if 'permission_reminder' not in arg_1 : raise KeyError ( 'The list must have a permission_reminder' ) if 'campaign_defaults' not in arg_1 : raise KeyError ( 'The list must have a campaign_defaults' ) if 'from_name' not in arg_1 [ 'campaign_defaults' ] : raise KeyError ( 'The list campaign_defaults must have a from_name' ) if 'from_email' not in arg_1 [ 'campaign_defaults' ] : raise KeyError ( 'The list campaign_defaults must have a from_email' ) check_email ( arg_1 [ 'campaign_defaults' ] [ 'from_email' ] ) if 'subject' not in arg_1 [ 'campaign_defaults' ] : raise KeyError ( 'The list campaign_defaults must have a subject' ) if 'language' not in arg_1 [ 'campaign_defaults' ] : raise KeyError ( 'The list campaign_defaults must have a language' ) if 'email_type_option' not in arg_1 : raise KeyError ( 'The list must have an email_type_option' ) if arg_1 [ 'email_type_option' ] not in [ True , False ] : raise TypeError ( 'The list email_type_option must be True or False' ) arg_2 = arg_0 . _mc_client . _post ( url = arg_0 . _build_path ( ) , arg_1 = arg_1 ) if arg_2 is not None : arg_0 . list_id = arg_2 [ 'id' ] else : arg_0 . list_id = None return 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: Get a multi - line string as input

def Func ( arg_0 = 'Multi-line input\n' + 'Enter EOF on a blank line to end ' + '(ctrl-D in *nix, ctrl-Z in windows)' , arg_1 = None , arg_2 = None ) : arg_3 = [ ] print ( arg_0 ) arg_4 = 1 try : while True : if arg_1 : if arg_4 > arg_1 : break else : if arg_2 : arg_3 . append ( string_input ( '' ) [ : arg_2 ] ) else : arg_3 . append ( string_input ( '' ) ) arg_4 += 1 else : if arg_2 : arg_3 . append ( string_input ( '' ) [ : arg_2 ] ) else : arg_3 . append ( string_input ( '' ) ) except EOFError : pass finally : return '\n' . join ( arg_3 )

Prepare received data for representation.

        Args:
            data (dict): values to represent (ex. {'001' : 130})
            number_to_keep (int): number of elements to show individually.

        Returns:
            dict: processed data to show.


Question: Convert a sigma in a Gaussian kernel to a FWHM value .

def Func ( arg_0 ) : arg_0 = np . asarray ( arg_0 ) return np . sqrt ( 8 * np . log ( 2 ) ) * arg_0

Associate an existing reservedIP to a deployment.

        name:
            Required. Name of the reserved IP address.

        service_name:
            Required. Name of the hosted service.

        deployment_name:
            Required. Name of the deployment.

        virtual_ip_name:
            Optional. Name of the VirtualIP in case of multi Vip tenant.
            If this value is not specified default virtualIP is used
            for this operation.


Question: Convert a tuple of OM objects into an OM object

def Func ( arg_0 , arg_1 ) : return om . OMApplication ( elem = arg_0 . OMSymbol ( module = 'Python' , name = 'tuple' ) , arguments = arg_1 )

virtue discovers and runs tests found in the given objects.

    Provide it with one or more tests (packages, modules or objects) to run.


Question: Convert bytes into human - readable representation .

def Func ( arg_0 , arg_1 = True , arg_2 = False , arg_3 = True , arg_4 = True ) : arg_5 = "" arg_6 = "" if arg_2 : arg_7 = 0 if arg_3 : while arg_0 >= 1024 : arg_7 += 1 arg_0 = arg_0 >> 10 else : while arg_0 >= 1000 : arg_7 += 1 arg_0 /= 1000.0 arg_5 = [ "" , "K" , "M" , "G" , "T" , "P" ] [ arg_7 ] if arg_4 : if arg_0 == 1 : arg_6 = " Byte" else : arg_6 = " Bytes" if arg_1 and ( arg_0 >= 1000 or arg_5 ) : arg_8 = "{:,d}" . format ( arg_0 ) else : arg_8 = str ( arg_0 ) return "{}{}{}" . format ( arg_8 , arg_5 , arg_6 )

Removes a subtree from the trajectory tree.

        Does not delete stuff from disk only from RAM.

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

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


Question: Downloads the latest Ubuntu image and writes it to a microSD card .

def Func ( arg_0 , arg_1 = 0 ) : arg_0 . assume_localhost ( ) arg_1 = int ( arg_1 ) if not arg_0 . dryrun : arg_2 = 'SD card present at %s? ' % arg_0 . env . sd_device arg_3 = raw_input ( arg_2 ) . strip ( ) print ( 'inp:' , arg_3 ) if not arg_1 and arg_3 and not arg_3 . lower ( ) . startswith ( 'y' ) : return arg_4 = arg_0 . local_renderer arg_4 . local ( 'ls {sd_device}' ) arg_4 . env . ubuntu_image_fn = os . path . abspath ( os . path . split ( arg_0 . env . ubuntu_download_url ) [ - 1 ] ) arg_4 . local ( '[ ! -f {ubuntu_image_fn} ] && wget {ubuntu_download_url} || true' ) with arg_0 . settings ( warn_only = True ) : arg_4 . sudo ( '[ -d "{sd_media_mount_dir}" ] && umount {sd_media_mount_dir}' ) with arg_0 . settings ( warn_only = True ) : arg_4 . sudo ( '[ -d "{sd_media_mount_dir2}" ] && umount {sd_media_mount_dir2}' ) arg_4 . pc ( 'Writing the image onto the card.' ) arg_4 . sudo ( 'xzcat {ubuntu_image_fn} | dd bs=4M of={sd_device}' ) arg_4 . run ( 'sync' )

Remove a room from the list of managed rooms.

        :Parameters:
            - `rs`: the state object of the room.
        :Types:
            - `rs`: `MucRoomState`


Question: Outputs a list of all plugins Streamlink has loaded .

def Func ( ) : arg_0 = list ( streamlink . get_plugins ( ) . keys ( ) ) arg_1 = ", " . join ( sorted ( arg_0 ) ) if console . json : console . msg_json ( arg_0 ) else : console . msg ( "Loaded plugins: {0}" , arg_1 )


Question: Set the axis scaling

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dict ( ) if arg_2 == 'x' : arg_4 = 'linthreshx' arg_5 = 'basex' arg_6 = 'linscalex' arg_7 = arg_0 . set_xscale arg_8 = arg_0 . set_xlim else : arg_4 = 'linthreshy' arg_5 = 'basey' arg_6 = 'linscaley' arg_7 = arg_0 . set_yscale arg_8 = arg_0 . set_ylim if arg_1 == 'mel' : arg_9 = 'symlog' arg_3 [ arg_4 ] = 1000.0 arg_3 [ arg_5 ] = 2 elif arg_1 == 'log' : arg_9 = 'symlog' arg_3 [ arg_5 ] = 2 arg_3 [ arg_4 ] = core . note_to_hz ( 'C2' ) arg_3 [ arg_6 ] = 0.5 elif arg_1 in [ 'cqt' , 'cqt_hz' , 'cqt_note' ] : arg_9 = 'log' arg_3 [ arg_5 ] = 2 elif arg_1 == 'tempo' : arg_9 = 'log' arg_3 [ arg_5 ] = 2 arg_8 ( 16 , 480 ) else : return arg_7 ( arg_9 , ** arg_3 )


Question: r Computes power spectral density given ARMA values .

def Func ( arg_0 = None , arg_1 = None , arg_2 = 1. , arg_3 = 1. , arg_4 = 4096 , arg_5 = 'default' , arg_6 = False ) : if arg_4 is None : arg_4 = 4096 if arg_0 is None and arg_1 is None : raise ValueError ( "Either AR or MA model must be provided" ) arg_7 = np . zeros ( arg_4 , dtype = complex ) if arg_0 is not None : arg_8 = len ( arg_0 ) arg_9 = np . zeros ( arg_4 , dtype = complex ) arg_9 [ 0 ] = 1. + 0j for arg_10 in range ( 0 , arg_8 ) : arg_9 [ arg_10 + 1 ] = arg_0 [ arg_10 ] arg_11 = fft ( arg_9 , arg_4 ) if arg_1 is not None : arg_12 = len ( arg_1 ) arg_13 = np . zeros ( arg_4 , dtype = complex ) arg_13 [ 0 ] = 1. + 0j for arg_10 in range ( 0 , arg_12 ) : arg_13 [ arg_10 + 1 ] = arg_1 [ arg_10 ] arg_14 = fft ( arg_13 , arg_4 ) if arg_0 is not None and arg_1 is not None : arg_7 = arg_2 / arg_3 * abs ( arg_14 ) ** 2. / abs ( arg_11 ) ** 2. elif arg_0 is not None : arg_7 = arg_2 / arg_3 / abs ( arg_11 ) ** 2. elif arg_1 is not None : arg_7 = arg_2 / arg_3 * abs ( arg_14 ) ** 2. arg_7 = np . real ( arg_7 ) if arg_5 != 'default' : from . import tools assert arg_5 in [ 'centerdc' ] if arg_5 == 'centerdc' : arg_7 = tools . twosided_2_centerdc ( arg_7 ) if arg_6 == True : arg_7 /= max ( arg_7 ) return arg_7

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: shortcut to render data with template and then write to path . Just add exception catch to renderer . render_to

def Func ( arg_0 , arg_1 , ** arg_2 ) : try : renderer . Func ( arg_0 , arg_1 , ** arg_2 ) except JinjaTemplateNotFound as e : logger . error ( e . __doc__ + ', Template: %r' % arg_1 ) sys . exit ( e . exit_code )


Question: Override this method to get called right after self . index is set .

def Func ( arg_0 , arg_1 ) : if arg_0 . animation : log . debug ( '%s: %s' , arg_0 . __class__ . __name__ , arg_0 . current_animation . title ) arg_0 . frames = arg_0 . animation . generate_frames ( False )

Show Program Landing page for the Enterprise's Program.

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

        Unauthenticated learners will be redirected to enterprise-linked SSO.

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


Question: list profiles in a given root directory

def Func ( arg_0 ) : arg_1 = os . listdir ( arg_0 ) arg_2 = [ ] for arg_3 in arg_1 : arg_4 = os . path . join ( arg_0 , arg_3 ) if os . path . isdir ( arg_4 ) and arg_3 . startswith ( 'profile_' ) : arg_2 . append ( arg_3 . split ( '_' , 1 ) [ - 1 ] ) return arg_2


Question: Return a list of personalities readed from the input line .

def Func ( arg_0 , arg_1 ) : return [ split ( '\W+' , arg_2 ) [ 1 ] for arg_2 in arg_1 . split ( ':' ) [ 1 ] . split ( ' ' ) if arg_2 . startswith ( '[' ) ]

Remove storeitems from storage.

        :param keys:
        :return:


Question: Asynchronously download a set of lsst - texmf BibTeX bibliographies from GitHub .

async def Func ( arg_0 ) : arg_1 = ( 'https://raw.githubusercontent.com/lsst/lsst-texmf/master/texmf/' 'bibtex/bib/{name}.bib' ) arg_2 = [ arg_1 . format ( name = name ) for name in arg_0 ] arg_3 = [ ] async with ClientSession ( ) as session : for arg_4 in arg_2 : arg_5 = asyncio . ensure_future ( _download_text ( arg_4 , session ) ) arg_3 . append ( arg_5 ) return await asyncio . gather ( * arg_3 )

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


Question: Add or create the default assettypes for the given project

def Func ( arg_0 ) : for arg_1 , arg_2 in DEFAULT_ASSETTYPES : arg_3 , arg_4 = Atype . objects . get_or_create ( arg_1 = arg_1 , defaults = { 'description' : arg_2 } ) arg_3 . projects . add ( arg_0 ) arg_3 . full_clean ( ) arg_3 . save ( )

If there are edits to the current input buffer, store them.


Question: Returns uptime in seconds or None on MINIX .

def Func ( ) : try : arg_0 = open ( '/proc/uptime' , 'r' ) arg_1 = float ( arg_0 . read ( ) ) arg_0 . close ( ) return arg_1 except ( IOError , ValueError ) : return None

Like `os.walk` and taking the same keyword arguments,
            but generating paths relative to the root.

            Starts in the fileset's root and filters based on its patterns.
            If ``with_root=True`` is passed in, the generated paths include
            the root path.


Question: Process a single token .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : if arg_0 . current_block . is_comment : if arg_1 == tokenize . COMMENT : arg_0 . current_block . add ( arg_2 , arg_3 , arg_4 , arg_5 ) else : arg_0 . new_noncomment ( arg_3 [ 0 ] , arg_4 [ 0 ] ) else : if arg_1 == tokenize . COMMENT : arg_0 . new_comment ( arg_2 , arg_3 , arg_4 , arg_5 ) else : arg_0 . current_block . add ( arg_2 , arg_3 , arg_4 , arg_5 )

Decorator for methods accepting old_path and new_path.


Question: Sets the is_confirmed for the bundle .

def Func ( arg_0 , arg_1 ) : arg_0 . _is_confirmed = arg_1 for arg_3 in arg_0 : arg_3 . is_confirmed = arg_1

Generate a list of 2 month ranges for the range requested with an
        intersection between months. This is necessary because we can't search
        for ranges longer than 3 months and the period searched has to encompass
        the whole period of the mission.


Question: Formats a name for storage

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _get_name_list ( arg_2 ) return tuple ( [ 'explored%s.set_%05d.xspm_%s_%08d' % ( SparseParameter . IDENTIFIER , arg_1 // 200 , arg_4 , arg_1 ) for arg_4 in arg_3 ] )

Read data synchronous from an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: data name
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**


Question: Get median latitude AND longitude of stops

def Func ( arg_0 ) : arg_1 = arg_0 . get_table ( "stops" ) arg_2 = numpy . percentile ( arg_1 [ 'lat' ] . values , 50 ) arg_3 = numpy . percentile ( arg_1 [ 'lon' ] . values , 50 ) return arg_2 , arg_3

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: Calculate the scores over all biological processes in the sub - graph .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 ] = None , arg_5 : arg_3 [ arg_4 ] = None , arg_6 : arg_3 [ arg_7 ] = None , arg_8 : arg_3 [ arg_9 ] = None , arg_10 : arg_11 = False , ) : arg_12 = generate_bioprocess_mechanisms ( arg_0 , arg_2 = arg_2 ) arg_13 = calculate_average_scores_on_subgraphs ( arg_12 , arg_2 = arg_2 , arg_5 = arg_5 , arg_6 = arg_6 , arg_8 = arg_8 , arg_10 = arg_10 ) return arg_13

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: Checks if the game is over due to checkmate stalemate or fourfold repetition .

def Func ( arg_0 ) : try : next ( arg_0 . generate_legal_moves ( ) . __iter__ ( ) ) except StopIteration : return True if arg_0 . is_fourfold_repetition ( ) : return True return False

Loads the named descriptor from the pool.

    Args:
      full_name: The full name of the descriptor to load.

    Returns:
      The descriptor for the named type.


Question: Handles the user attempting to exit Godot .

def Func ( arg_0 , arg_1 ) : if arg_0 . prompt_Func : arg_2 = confirm ( parent = arg_1 . ui . control , message = "Exit Godot?" , title = "Confirm exit" , default = YES ) if arg_2 == YES : arg_0 . _on_close ( arg_1 ) else : arg_0 . _on_close ( arg_1 )

Collects memory stats for specified Python program.


Question: Flask view that handles the user s return from OAuth2 provider .

def Func ( arg_0 ) : if 'error' in request . args : arg_1 = request . args . get ( 'error_description' , request . args . get ( 'error' , '' ) ) arg_1 = markupsafe . escape ( arg_1 ) return ( 'Authorization failed: {0}' . format ( arg_1 ) , httplib . BAD_REQUEST ) try : arg_2 = request . args [ 'state' ] arg_3 = session [ _CSRF_KEY ] arg_4 = request . args [ 'code' ] except KeyError : return 'Invalid request' , httplib . BAD_REQUEST try : arg_5 = json . loads ( arg_2 ) arg_6 = arg_5 [ 'csrf_token' ] arg_7 = arg_5 [ 'return_url' ] except ( ValueError , KeyError ) : return 'Invalid request state' , httplib . BAD_REQUEST if arg_6 != arg_3 : return 'Invalid request state' , httplib . BAD_REQUEST arg_8 = _get_flow_for_token ( arg_3 ) if arg_8 is None : return 'Invalid request state' , httplib . BAD_REQUEST try : arg_9 = arg_8 . step2_exchange ( arg_4 ) except client . FlowExchangeError as exchange_error : current_app . logger . exception ( exchange_error ) arg_10 = 'An error occurred: {0}' . format ( exchange_error ) return arg_10 , httplib . BAD_REQUEST arg_0 . storage . put ( arg_9 ) if arg_0 . authorize_callback : arg_0 . authorize_callback ( arg_9 ) return redirect ( arg_7 )


Question: Returns the factor of exceedance

def Func ( arg_0 , arg_1 ) : return ( np . sum ( arg_0 > arg_1 , dtype = float ) / len ( arg_0 ) - 0.5 ) * 100


Question: Returns a weak reference to the given method or function . If the callback argument is not None it is called as soon as the referenced function is garbage deleted .

def Func ( arg_0 , arg_1 = None ) : try : arg_0 . __func__ except AttributeError : return _WeakMethodFree ( arg_0 , arg_1 ) return _WeakMethodBound ( arg_0 , arg_1 )

Dumps different debug info about cluster to default logger


Question: r Convert a number to engineering notation .

def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_0 == 0 : arg_0 = "0.{zrs}" . format ( zrs = "0" * arg_1 ) if arg_1 else "0" return "{0} " . format ( arg_0 . rjust ( 5 + arg_1 ) ) if arg_2 else arg_0 arg_3 = + 1 if arg_0 >= 0 else - 1 arg_4 = "-" if arg_3 == - 1 else "" arg_5 = abs ( arg_0 ) if arg_5 < 1e-24 : arg_5 = 1e-24 arg_0 = arg_3 * 1e-24 arg_6 = 3.0 * math . floor ( math . floor ( math . log10 ( arg_5 ) ) / 3.0 ) arg_7 = arg_0 / 10 ** arg_6 arg_8 = str ( arg_7 ) arg_9 = arg_8 . find ( "." ) if len ( arg_8 ) - arg_9 - 1 > arg_1 : arg_7 += arg_3 * 5 * 10 ** ( - arg_1 - 1 ) if abs ( arg_7 ) >= 1000 : arg_6 += 3 arg_7 = arg_7 / 1e3 arg_8 = str ( arg_7 ) arg_9 = arg_8 . find ( "." ) arg_10 = bool ( arg_1 ) arg_11 = arg_9 - ( not arg_10 ) + arg_1 + 1 arg_12 = arg_8 [ : arg_11 ] . ljust ( arg_11 , "0" ) if arg_6 > 24 : arg_12 , arg_6 = ( "{sign}999.{frac}" . format ( arg_3 = arg_4 , frac = "9" * arg_1 ) , 24 , ) arg_12 = arg_12 . rjust ( arg_2 * ( 4 + arg_10 + arg_1 ) ) arg_13 = "{mant}{suffix}" . format ( arg_7 = arg_12 , suffix = _POWER_TO_SUFFIX_DICT [ arg_6 ] if arg_6 else " " * bool ( arg_2 ) ) return arg_13

Connect to the stream

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


Question: Builds all indices listed in model s Meta class .

def Func ( arg_0 ) : for arg_1 in arg_0 . _meta . indices : arg_1 . ensure ( arg_0 . collection )

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

        :return: The exit code returned when applying rows to the table


Question: Update received packet metrics

def Func ( arg_0 , arg_1 ) : arg_0 . update_count ( arg_0 . RECEIVED_PKT_COUNT ) arg_0 . update_count ( arg_0 . RECEIVED_PKT_SIZE , incr_by = arg_1 )


Question: Register Param object on interface level object

def Func ( arg_0 , arg_1 , arg_2 ) -> None : nameAvailabilityCheck ( arg_0 , arg_1 , arg_2 ) try : arg_3 = arg_2 . _name is not None except AttributeError : arg_3 = False if not arg_3 : arg_2 . _name = arg_1 arg_2 . _registerScope ( arg_1 , arg_0 ) if arg_2 . hasGenericName : arg_2 . name = arg_1 if arg_2 . _parent is None : arg_2 . _parent = arg_0 arg_0 . _params . append ( arg_2 )

pass in a word string that you
        would like to see probable matches for.


Question: parse results from cutadapt into sample data

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . stats_dfs . s2 [ "trim_adapter_bp_read1" ] = 0 arg_1 . stats_dfs . s2 [ "trim_quality_bp_read1" ] = 0 arg_1 . stats_dfs . s2 [ "reads_filtered_by_Ns" ] = 0 arg_1 . stats_dfs . s2 [ "reads_filtered_by_minlen" ] = 0 arg_1 . stats_dfs . s2 [ "reads_passed_filter" ] = 0 arg_5 = arg_2 . strip ( ) . split ( "\n" ) for arg_6 in arg_5 : if "Total reads processed:" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 3 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "reads_raw" ] = arg_7 if "Reads with adapters:" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 3 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "trim_adapter_bp_read1" ] = arg_7 if "Quality-trimmed" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 1 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "trim_quality_bp_read1" ] = arg_7 if "Reads that were too short" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 5 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "reads_filtered_by_minlen" ] = arg_7 if "Reads with too many N" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 5 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "reads_filtered_by_Ns" ] = arg_7 if "Reads written (passing filters):" in arg_6 : arg_7 = int ( arg_6 . split ( ) [ 4 ] . replace ( "," , "" ) ) arg_1 . stats_dfs . s2 [ "reads_passed_filter" ] = arg_7 if arg_1 . stats_dfs . s2 . reads_passed_filter : arg_1 . stats . state = 2 arg_1 . stats . reads_passed_filter = arg_1 . stats_dfs . s2 . reads_passed_filter arg_1 . files . edits = [ ( OPJ ( arg_0 . dirs . edits , arg_1 . name + ".trimmed_R1_.fastq.gz" ) , 0 ) ] LOGGER . info ( arg_2 ) else : print ( "{}No reads passed filtering in Sample: {}" . format ( arg_0 . _spacer , arg_1 . name ) )

Attaches a bundle object

        :param bundle: :class:`flask_journey.BlueprintBundle` object
        :raises:
            - IncompatibleBundle if the bundle is not of type `BlueprintBundle`
            - ConflictingPath if a bundle already exists at bundle.path
            - MissingBlueprints if the bundle doesn't contain any blueprints


Question: Checks if the page doesn t have the given title .

def Func ( arg_0 , arg_1 , ** arg_2 ) : try : arg_0 . assert_no_title ( arg_1 , ** arg_2 ) return True except ExpectationNotMet : return False

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: Given a sequence convert it to a comma separated string . If however the argument is a single object return its string representation .

def Func ( arg_0 , arg_1 = "," ) : if isinstance ( arg_0 , string_classes ) : return arg_0 elif isinstance ( arg_0 , ( list , tuple ) ) : return arg_1 . join ( [ str ( arg_2 ) for arg_2 in arg_0 ] ) else : return str ( arg_0 )

Given task instance, try_number, filename_template, return the rendered log
    filename

    :param ti: task instance
    :param try_number: try_number of the task
    :param filename_template: filename template, which can be jinja template or
        python string template


Question: Data for a given pull request .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = get_api_response ( arg_0 , arg_1 , "/repos/{{repo_name}}/pulls/{0}" . format ( arg_2 ) ) if not arg_3 . ok : raise Exception ( "Unable to get pull request: status code {}" . format ( arg_3 . status_code ) ) return arg_3 . json

Overriding the default JSONEncoder.default for NDB support.


Question: Get a live version string using versiontools

def Func ( arg_0 ) : try : import versiontools except ImportError : return None else : return str ( versiontools . Version . from_expression ( arg_0 . name ) )

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: Build a basic 035 subfield with basic information from the OAI - PMH request .

def Func ( arg_0 ) : arg_1 = arg_0 . find ( 'request' ) arg_2 = arg_0 . find ( 'responseDate' ) arg_3 = [ ( "9" , arg_1 . text ) , ( "h" , arg_2 . text ) , ( "m" , arg_1 . attrib [ "metadataPrefix" ] ) ] return arg_3

Generic preset function, marks a parameter or config for presetting.


Question: Extract the JSON payload from a JWT .

def Func ( arg_0 ) : if type ( arg_0 ) == bytes : arg_1 = arg_0 . split ( b'.' ) else : arg_1 = arg_0 . split ( u'.' ) if len ( arg_1 ) != 3 : raise VerifyJwtTokenError ( 'Wrong number of segments in token: {0}' . format ( arg_0 ) ) return json . loads ( _helpers . _from_bytes ( _helpers . _urlsafe_b64decode ( arg_1 [ 1 ] ) ) )

Return an open file-object to the index file


Question: Get a set of evenly spaced colors in HUSL hue space .

Try to load schedule from the Matterhorn core. Returns a valid schedule
    or None on failure.


Question: Gets the configuration dictionary from the current parameters of the algorithms to be evaluated .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = { } arg_5 [ "annot_beats" ] = arg_1 arg_5 [ "feature" ] = arg_0 arg_5 [ "framesync" ] = arg_2 arg_6 = { } if arg_3 != "gt" : arg_6 = eval ( msaf . algorithms . __name__ + "." + arg_3 ) . config arg_5 . update ( arg_6 ) if arg_4 is not None : arg_7 = eval ( msaf . algorithms . __name__ + "." + arg_4 ) . config if arg_4 != arg_3 : arg_8 = set ( arg_6 . keys ( ) ) . intersection ( set ( arg_7 . keys ( ) ) ) assert len ( arg_8 ) == 0 , "Parameter %s must not exist both in %s and %s algorithms" % ( arg_8 , arg_3 , arg_4 ) arg_5 . update ( arg_7 ) return arg_5


Question: publish a message to nsq

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_0 . _Func ( 'Func' , arg_1 , arg_2 , arg_3 = arg_3 )

Return an open file-object to the index file


Question: Checks if the blocks in the RDD matches the expected types .

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_0 , BlockRDD ) : raise TypeError ( "Expected {0} for parameter rdd, got {1}." . format ( BlockRDD , type ( arg_0 ) ) ) if isinstance ( arg_0 , DictRDD ) : if not isinstance ( arg_1 , dict ) : raise TypeError ( 'Expected {0} for parameter ' 'expected_dtype, got {1}.' . format ( dict , type ( arg_1 ) ) ) arg_2 = True arg_3 = dict ( list ( zip ( arg_0 . columns , arg_0 . dtype ) ) ) for arg_4 , arg_5 in arg_1 . items ( ) : if not isinstance ( arg_5 , ( tuple , list ) ) : arg_5 = [ arg_5 ] arg_2 = arg_2 and arg_3 [ arg_4 ] in arg_5 return arg_2 if not isinstance ( arg_1 , ( tuple , list ) ) : arg_1 = [ arg_1 ] return arg_0 . dtype in arg_1