Question: Draw text on an image .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = ( 0 , 255 , 0 ) , arg_5 = 25 ) : do_assert ( arg_0 . dtype in [ np . uint8 , np . float32 ] ) arg_6 = arg_0 . dtype if arg_0 . dtype == np . float32 : arg_0 = arg_0 . astype ( np . uint8 ) arg_0 = PIL_Image . fromarray ( arg_0 ) arg_7 = PIL_ImageFont . truetype ( DEFAULT_FONT_FP , arg_5 ) arg_8 = PIL_ImageDraw . Draw ( arg_0 ) arg_8 . text ( ( arg_2 , arg_1 ) , arg_3 , fill = tuple ( arg_4 ) , arg_7 = arg_7 ) arg_9 = np . asarray ( arg_0 ) if not arg_9 . flags [ "WRITEABLE" ] : try : arg_9 . setflags ( write = True ) except ValueError as ex : if "cannot set WRITEABLE flag to True of this array" in str ( ex ) : arg_9 = np . copy ( arg_9 ) if arg_9 . dtype != arg_6 : arg_9 = arg_9 . astype ( arg_6 ) return arg_9

main execution loop. query weather data and post to online service.


Question: Return a Tensor containing the ground truth matches Read the file and keep only 3D point ID . Matches are represented with a 1 non matches with a 0 .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] with open ( os . path . join ( arg_0 , arg_1 ) , 'r' ) as f : for arg_3 in f : arg_4 = arg_3 . split ( ) arg_2 . append ( [ int ( arg_4 [ 0 ] ) , int ( arg_4 [ 3 ] ) , int ( arg_4 [ 1 ] == arg_4 [ 4 ] ) ] ) return torch . LongTensor ( arg_2 )


Question: Create a python object from a BridgePoint external entity with bridges realized as python member functions .

def Func ( arg_0 , arg_1 ) : arg_2 = many ( arg_1 ) . S_BRG [ 19 ] ( ) arg_3 = [ brg . Name for brg in arg_2 ] arg_4 = collections . namedtuple ( arg_1 . Key_Lett , arg_3 ) arg_5 = list ( ) for arg_6 in many ( arg_1 ) . S_BRG [ 19 ] ( ) : arg_7 = mk_bridge ( arg_0 , arg_6 ) arg_5 . append ( arg_7 ) return arg_4 ( * arg_5 )

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


Question: Exchange messages between basic pipelines and the Yandex . Dialogs service . If the pipeline returns multiple values only the first one is forwarded to Yandex .

def Func ( arg_0 : arg_1 ) : arg_2 = request . get_json ( ) arg_3 = arg_2 [ 'request' ] . get ( 'command' , '' ) . strip ( ) arg_4 = arg_2 [ 'request' ] . get ( 'payload' ) arg_5 = arg_2 [ 'session' ] [ 'session_id' ] arg_6 = arg_2 [ 'session' ] [ 'user_id' ] arg_7 = arg_2 [ 'session' ] [ 'message_id' ] arg_8 = DialogID ( arg_6 , arg_5 ) arg_9 = { 'response' : { 'end_session' : True , 'text' : '' } , "session" : { 'session_id' : arg_5 , 'message_id' : arg_7 , 'user_id' : arg_6 } , 'version' : '1.0' } arg_10 : Union [ str , RichMessage ] = arg_0 ( [ arg_4 or arg_3 ] , [ arg_8 ] ) [ 0 ] if isinstance ( arg_10 , RichMessage ) : arg_9 [ 'response' ] [ 'text' ] = '\n' . join ( [ j [ 'content' ] for j in arg_10 . json ( ) if j [ 'type' ] == 'plain_text' ] ) else : arg_9 [ 'response' ] [ 'text' ] = str ( arg_10 ) return jsonify ( arg_9 ) , 200

Overriding the default JSONEncoder.default for NDB support.


Question: Check if a hgnc symbol is an alias

def Func ( arg_0 , arg_1 , arg_2 = '37' ) : arg_3 = arg_0 . hgnc_genes ( hgnc_symbol = arg_1 , arg_2 = arg_2 ) if arg_3 : for arg_4 in arg_3 : return arg_4 [ 'hgnc_symbol' ] else : return None

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


Question: Build an xsd complex element out of a C_C including its packaged S_DT and O_OBJ .

def Func ( arg_0 , arg_1 ) : arg_2 = ET . Element ( 'xs:element' , name = arg_1 . name ) arg_3 = ET . SubElement ( arg_2 , 'xs:complexType' ) arg_3 = ET . SubElement ( arg_3 , 'xs:sequence' ) arg_4 = lambda selected : ooaofooa . is_contained_in ( selected , arg_1 ) for arg_5 in arg_0 . select_many ( 'O_OBJ' , arg_4 ) : arg_6 = build_class ( arg_5 ) arg_3 . append ( arg_6 ) return arg_2

Send out a password reset if the provided data is valid.

        If the provided email address exists and is verified, a reset
        email is sent to the address.

        Returns:
            The password reset token if it was returned and ``None``
            otherwise.


Question: Parse and format querystring as per AWS4 auth requirements .

def Func ( arg_0 ) : arg_1 = '&=+' arg_2 = '-_.~' if PY2 : arg_0 = arg_0 . encode ( 'utf-8' ) arg_1 = arg_1 . encode ( ) arg_2 = arg_2 . encode ( ) arg_0 = unquote ( arg_0 ) arg_3 = b' ' if PY2 else ' ' arg_0 = arg_0 . split ( arg_3 ) [ 0 ] arg_0 = quote ( arg_0 , safe = arg_1 ) arg_4 = { } for arg_5 , arg_6 in parse_qs ( arg_0 , keep_blank_values = True ) . items ( ) : arg_5 = quote ( arg_5 , safe = arg_2 ) arg_6 = [ quote ( arg_8 , safe = arg_2 ) for arg_8 in arg_6 ] arg_4 [ arg_5 ] = arg_6 arg_7 = [ ] for arg_5 , arg_6 in arg_4 . items ( ) : for arg_8 in arg_6 : arg_7 . append ( '=' . join ( [ arg_5 , arg_8 ] ) ) arg_0 = '&' . join ( sorted ( arg_7 ) ) if PY2 : arg_0 = unicode ( arg_0 ) return arg_0

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


Question: Save a PNG plot with histograms of weight means and stddevs .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = figure . Figure ( figsize = ( 6 , 3 ) ) arg_5 = backend_agg . FigureCanvasAgg ( arg_4 ) arg_6 = arg_4 . add_subplot ( 1 , 2 , 1 ) for arg_7 , arg_8 in zip ( arg_0 , arg_1 ) : sns . distplot ( arg_8 . flatten ( ) , arg_6 = arg_6 , label = arg_7 ) arg_6 . set_title ( "weight means" ) arg_6 . set_xlim ( [ - 1.5 , 1.5 ] ) arg_6 . legend ( ) arg_6 = arg_4 . add_subplot ( 1 , 2 , 2 ) for arg_7 , arg_9 in zip ( arg_0 , arg_2 ) : sns . distplot ( arg_9 . flatten ( ) , arg_6 = arg_6 ) arg_6 . set_title ( "weight stddevs" ) arg_6 . set_xlim ( [ 0 , 1. ] ) arg_4 . tight_layout ( ) arg_5 . print_figure ( arg_3 , format = "png" ) print ( "saved {}" . format ( arg_3 ) )

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


Question: Load an object from a string and return the processed JSON content

def Func ( arg_0 , Func ) : arg_2 = json . loads ( Func ) return arg_0 . object ( arg_2 )


Question: Parse env input and output parameters into a job parameters and data .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 ) : arg_10 = parse_pair_args ( arg_0 , job_model . EnvParam ) arg_11 = parse_pair_args ( arg_1 , job_model . LabelParam ) arg_12 = set ( ) for ( arg_13 , arg_14 ) in ( ( False , arg_2 ) , ( True , arg_3 ) ) : for arg_15 in arg_14 : arg_16 , arg_17 = split_pair ( arg_15 , '=' , nullable_idx = 0 ) arg_16 = arg_7 . get_variable_name ( arg_16 ) arg_12 . add ( arg_7 . make_param ( arg_16 , arg_17 , arg_13 ) ) arg_18 = set ( ) for ( arg_13 , arg_14 ) in ( ( False , arg_4 ) , ( True , arg_5 ) ) : for arg_15 in arg_14 : arg_16 , arg_17 = split_pair ( arg_15 , '=' , 0 ) arg_16 = arg_8 . get_variable_name ( arg_16 ) arg_18 . add ( arg_8 . make_param ( arg_16 , arg_17 , arg_13 ) ) arg_19 = set ( ) for arg_15 in arg_6 : if ' ' in arg_15 : arg_20 , arg_21 = arg_15 . split ( ' ' ) arg_16 , arg_17 = split_pair ( arg_20 , '=' , 1 ) arg_19 . add ( arg_9 . make_param ( arg_16 , arg_17 , arg_21 ) ) else : arg_16 , arg_17 = split_pair ( arg_15 , '=' , 1 ) arg_19 . add ( arg_9 . make_param ( arg_16 , arg_17 , arg_21 = None ) ) return { 'envs' : arg_10 , 'inputs' : arg_12 , 'outputs' : arg_18 , 'labels' : arg_11 , 'mounts' : arg_19 , }

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: Convert sum .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : print ( 'Converting Sum ...' ) def target_layer ( arg_7 ) : import keras . backend as K return K . sum ( arg_7 ) arg_8 = keras . layers . Lambda ( target_layer ) arg_4 [ arg_2 ] = arg_8 ( arg_4 [ arg_3 [ 0 ] ] )


Question: Iterative over relative filepaths of files in a directory and sub - directories with the given extension .

def Func ( arg_0 , arg_1 = '.' ) : if not arg_0 . startswith ( '.' ) : arg_0 = '.' + arg_0 arg_1 = os . path . abspath ( arg_1 ) for arg_2 , arg_3 , arg_4 in os . walk ( arg_1 ) : for arg_5 in arg_4 : if os . path . splitext ( arg_5 ) [ - 1 ] == arg_0 : arg_6 = os . path . join ( arg_2 , arg_5 ) arg_7 = os . path . relpath ( arg_6 , start = arg_1 ) yield arg_7

An interface for get requests that handles errors more gracefully to
        prevent data loss


Question: Scales out the number of blocks by blocks

def Func ( arg_0 , arg_1 = 1 ) : arg_2 = [ ] for arg_3 in range ( arg_1 ) : if arg_0 . provider : arg_4 = str ( len ( arg_0 . blocks ) ) arg_5 = arg_0 . launch_cmd . format ( block_id = arg_4 ) arg_6 = arg_0 . provider . submit ( arg_5 , 1 , 1 ) logger . debug ( "Launched block {}->{}" . format ( arg_4 , arg_6 ) ) if not arg_6 : raise ( ScalingFailed ( arg_0 . provider . label , "Attempts to provision nodes via provider has failed" ) ) arg_2 . extend ( [ arg_4 ] ) arg_0 . blocks [ arg_4 ] = arg_6 else : logger . error ( "No execution provider available" ) arg_2 = None return arg_2

Calculate the modelled progress state for the given time moment.

        :returns: tuple (x, v) of the progress level and progress speed.


Question: Generator for the LIST EXTENSIONS command .

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . command ( "LIST EXTENSIONS" ) if arg_1 != 202 : raise NNTPReplyError ( arg_1 , arg_2 ) for arg_3 in arg_0 . info_gen ( arg_1 , arg_2 ) : yield arg_3 . strip ( )

Upload a file to s3.

    Args:
        info (ExpectationExecutionInfo): Must expose a boto3 S3 client as its `s3` resource.

    Returns:
        (str, str):
            The bucket and key to which the file was uploaded.


Question: Reads a specific amount of data from a stream and returns it . If there is any data in initial_data that will be popped out first .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if len ( arg_0 . _initial_data ) == 0 : return arg_1 . read ( arg_2 ) if arg_2 <= len ( arg_0 . _initial_data ) : arg_4 = arg_0 . _initial_data [ : arg_2 ] if arg_3 : arg_0 . _initial_data = arg_0 . _initial_data [ arg_2 : ] return arg_4 arg_6 = arg_2 - len ( arg_0 . _initial_data ) arg_4 = arg_0 . _initial_data + arg_1 . read ( arg_6 ) if arg_3 : arg_0 . _initial_data = b'' return arg_4

Verifies the given signature matches the expected signature


Question: Deletes all files in filelist

def Func ( arg_0 , arg_1 = '' ) : if not arg_1 : for arg_2 in arg_0 : os . remove ( arg_2 ) else : for arg_2 in arg_0 : os . remove ( op . join ( arg_1 , arg_2 ) )

Fetch the events pages of a given group.


Question: Delete job .

def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = get_job_or_local ( arg_0 . obj . get ( 'project' ) , arg_0 . obj . get ( 'job' ) ) if not click . confirm ( "Are sure you want to Func job `{}`" . format ( arg_3 ) ) : click . echo ( 'Existing without deleting job.' ) sys . exit ( 1 ) try : arg_4 = PolyaxonClient ( ) . job . Func_job ( arg_1 , arg_2 , arg_3 ) JobManager . purge ( ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func job `{}`.' . format ( arg_3 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) if arg_4 . status_code == 204 : Printer . print_success ( "Job `{}` was Func successfully" . format ( arg_3 ) )


Question: Returns the components of an ellipse .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Ellipse ( pen = arg_0 . pen , x_origin = arg_1 [ "x0" ] , y_origin = arg_1 [ "y0" ] , e_width = arg_1 [ "w" ] , e_height = arg_1 [ "h" ] , arg_2 = arg_2 ) return arg_3

Serialize a dataframe.

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


Question: Parse ping command output .

def Func ( arg_0 , arg_1 ) : try : if typepy . is_not_null_string ( arg_1 . stdout ) : arg_1 = arg_1 . stdout except AttributeError : pass logger . debug ( "parsing ping result: {}" . format ( arg_1 ) ) arg_0 . __Funcr = NullPingParser ( ) if typepy . is_null_string ( arg_1 ) : logger . debug ( "ping_message is empty" ) arg_0 . __stats = PingStats ( ) return arg_0 . __stats arg_4 = _to_unicode ( arg_1 ) . splitlines ( ) arg_5 = ( LinuxPingParser , WindowsPingParser , MacOsPingParser , AlpineLinuxPingParser , ) for arg_6 in arg_5 : arg_0 . __Funcr = arg_6 ( ) try : arg_0 . __stats = arg_0 . __Funcr . Func ( arg_4 ) return arg_0 . __stats except ParseError as e : if e . reason != ParseErrorReason . HEADER_NOT_FOUND : raise e except pp . ParseException : pass arg_0 . __Funcr = NullPingParser ( ) return arg_0 . __stats


Question: Launch a new workflow job based on a workflow job template .

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = False , arg_4 = None , arg_5 = None , ** arg_6 ) : if arg_5 is not None and len ( arg_5 ) > 0 : arg_6 [ 'extra_vars' ] = parser . process_extra_vars ( arg_5 ) debug . log ( 'Launching the workflow job.' , header = 'details' ) arg_0 . _pop_none ( arg_6 ) arg_7 = client . post ( 'workflow_job_templates/{0}/Func/' . format ( arg_1 ) , data = arg_6 ) . json ( ) arg_8 = arg_7 [ 'id' ] arg_7 [ 'changed' ] = True if arg_2 : return arg_0 . monitor ( arg_8 , arg_4 = arg_4 ) elif arg_3 : return arg_0 . wait ( arg_8 , arg_4 = arg_4 ) return arg_7

Calculate the phase's magnetic contribution to heat capacity at the
        specified temperature.

        :param T: [K] temperature

        :returns: [J/mol/K] The magnetic heat capacity of the compound phase.

        Dinsdale, A. T. (1991). SGTE data for pure elements. Calphad, 15(4),
        317–425. http://doi.org/10.1016/0364-5916(91)90030-N


Question: Encrypt credentials using the google publickey with the RSA algorithm

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = b64decode ( config . GOOGLE_PUBKEY ) arg_4 = utils . readInt ( arg_3 , 0 ) arg_5 = utils . toBigInt ( arg_3 [ 4 : ] [ 0 : arg_4 ] ) arg_6 = utils . readInt ( arg_3 , arg_4 + 4 ) arg_7 = utils . toBigInt ( arg_3 [ arg_4 + 8 : ] [ 0 : arg_6 ] ) arg_8 = hashes . Hash ( hashes . SHA1 ( ) , backend = default_backend ( ) ) arg_8 . update ( arg_3 ) arg_9 = b'\x00' + arg_8 . finalize ( ) [ 0 : 4 ] arg_10 = encode_dss_signature ( arg_5 , arg_7 ) arg_11 = load_der_public_key ( arg_10 , backend = default_backend ( ) ) arg_12 = arg_1 . encode ( ) + b'\x00' + arg_2 . encode ( ) arg_13 = arg_11 . encrypt ( arg_12 , padding . OAEP ( mgf = padding . MGF1 ( algorithm = hashes . SHA1 ( ) ) , algorithm = hashes . SHA1 ( ) , label = None ) ) return urlsafe_b64encode ( arg_9 + arg_13 )

Decorator. Abortable worker. If wrapped task will be cancelled by
    dispatcher, decorator will send ftp codes of successful interrupt.

    ::

        >>> @worker
        ... async def worker(self, connection, rest):
        ...     ...


Question: Remove a single pair of quotes from the endpoints of a string .

def Func ( arg_0 ) : if not arg_0 : return arg_0 if ( arg_0 [ 0 ] == "'" and arg_0 [ - 1 ] == "'" ) or ( arg_0 [ 0 ] == '"' and arg_0 [ - 1 ] == '"' ) : return arg_0 [ 1 : - 1 ] else : return arg_0

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: Sets cursor as beginning of next line .

def Func ( arg_0 ) : arg_0 . _eol . append ( arg_0 . position ) arg_0 . _lineno += 1 arg_0 . _col_offset = 0

Verify a certificate in a context.

        .. versionadded:: 0.15

        :raises X509StoreContextError: If an error occurred when validating a
          certificate in the context. Sets ``certificate`` attribute to
          indicate which certificate caused the error.


Question: GoSquared tracking template tag .

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

gridSpan is what docx uses to denote that a table cell has a colspan. This
    is much more simple than rowspans in that there is a one-to-one mapping
    from gridSpan to colspan.


Question: Write the index . html file for this report .

def Func ( arg_0 ) : arg_1 = Templite ( data ( "index.html" ) , arg_0 . template_globals ) arg_0 . totals = sum ( [ f [ 'nums' ] for f in arg_0 . files ] ) arg_3 = arg_1 . render ( { 'arcs' : arg_0 . arcs , 'extra_css' : arg_0 . extra_css , 'files' : arg_0 . files , 'totals' : arg_0 . totals , } ) if sys . version_info < ( 3 , 0 ) : arg_3 = arg_3 . decode ( "utf-8" ) arg_0 . write_html ( os . path . join ( arg_0 . directory , "index.html" ) , arg_3 ) arg_0 . status . write ( arg_0 . directory )


Question: Run WsgiDAV using cheroot . server if Cheroot is installed .

def Func ( arg_0 , arg_1 , arg_2 ) : assert arg_2 == "cheroot" try : from cheroot import arg_13 , arg_4 except ImportError : _logger . error ( "*" * 78 ) _logger . error ( "ERROR: Could not import Cheroot." ) _logger . error ( "Try `pip install cheroot` or specify another server using the --server option." ) _logger . error ( "*" * 78 ) raise arg_3 = "WsgiDAV/{} {} Python/{}" . format ( __version__ , arg_4 . Server . version , util . PYTHON_VERSION ) arg_4 . Server . version = arg_3 arg_7 = _get_checked_path ( arg_1 . get ( "ssl_certificate" ) , arg_1 ) arg_8 = _get_checked_path ( arg_1 . get ( "ssl_private_key" ) , arg_1 ) arg_9 = _get_checked_path ( arg_1 . get ( "ssl_certificate_chain" ) , arg_1 ) arg_10 = arg_1 . get ( "ssl_adapter" , "builtin" ) arg_11 = "http" if arg_7 and arg_8 : arg_10 = arg_13 . get_ssl_adapter_class ( arg_10 ) arg_4 . Server . ssl_adapter = arg_10 ( arg_7 , arg_8 , arg_9 ) arg_11 = "https" _logger . info ( "SSL / HTTPS enabled. Adapter: {}" . format ( arg_10 ) ) elif arg_7 or arg_8 : raise RuntimeError ( "Option 'ssl_certificate' and 'ssl_private_key' must be used together." ) _logger . info ( "Running {}" . format ( arg_3 ) ) _logger . info ( "Serving on {}://{}:{} ..." . format ( arg_11 , arg_1 [ "host" ] , arg_1 [ "port" ] ) ) arg_12 = { "bind_addr" : ( arg_1 [ "host" ] , arg_1 [ "port" ] ) , "wsgi_app" : arg_0 , "server_name" : arg_3 , } arg_12 . update ( arg_1 . get ( "server_args" , { } ) ) arg_13 = arg_4 . Server ( ** arg_12 ) arg_14 = arg_1 . get ( "startup_event" ) if arg_14 : def _patched_tick ( ) : arg_13 . tick = arg_16 _logger . info ( "wsgi.Server is ready" ) arg_14 . set ( ) arg_16 ( ) arg_16 = arg_13 . tick arg_13 . tick = _patched_tick try : arg_13 . start ( ) except KeyboardInterrupt : _logger . warning ( "Caught Ctrl-C, shutting down..." ) finally : arg_13 . stop ( ) return

Determine the Fitch profile for a single character of the node's sequence.
        The profile is essentially the intersection between the children's
        profiles or, if the former is empty, the union of the profiles.

        Parameters
        ----------

         node : PhyloTree.Clade:
            Internal node which the profiles are to be determined

         pos : int
            Position in the node's sequence which the profiles should
            be determinedf for.

        Returns
        -------
         state : numpy.array
            Fitch profile for the character at position pos of the given node.


Question: Set the current time in the music in seconds causing the player to seek to this location in the file .

def Func ( arg_0 , arg_1 : arg_2 ) : if arg_1 < 0 : arg_1 = 0 mixer . music . set_pos ( arg_1 )

Restricts a function in n-dimensions to a given direction.

  Suppose f: R^n -> R. Then given a point x0 and a vector p0 in R^n, the
  restriction of the function along that direction is defined by:

  ```None
  g(t) = f(x0 + t * p0)
  ```

  This function performs this restriction on the given function. In addition, it
  also computes the gradient of the restricted function along the restriction
  direction. This is equivalent to computing `dg/dt` in the definition above.

  Args:
    value_and_gradients_function: Callable accepting a single real `Tensor`
      argument of shape `[..., n]` and returning a tuple of a real `Tensor` of
      shape `[...]` and a real `Tensor` of shape `[..., n]`. The multivariate
      function whose restriction is to be computed. The output values of the
      callable are the function value and the gradients at the input argument.
    position: `Tensor` of real dtype and shape consumable by
      `value_and_gradients_function`. Corresponds to `x0` in the definition
      above.
    direction: `Tensor` of the same dtype and shape as `position`. The direction
      along which to restrict the function. Note that the direction need not
      be a unit vector.

  Returns:
    restricted_value_and_gradients_func: A callable accepting a tensor of shape
      broadcastable to `[...]` and same dtype as `position` and returning a
      namedtuple of `Tensors`. The input tensor is the parameter along the
      direction labelled `t` above. The return value contains fields:
        x: A real `Tensor` of shape `[...]`. The input value `t` where the line
          function was evaluated, after any necessary broadcasting.
        f: A real `Tensor` of shape `[...]` containing the value of the
          function at the point `position + t * direction`.
        df: A real `Tensor` of shape `[...]` containing the derivative at
          `position + t * direction`.
        full_gradient: A real `Tensor` of shape `[..., n]`, the full gradient
          of the original `value_and_gradients_function`.


Question: Called when advertisement data is received .

def Func ( arg_0 , arg_1 ) : if 'kCBAdvDataServiceUUIDs' in arg_1 : arg_0 . _advertised = arg_0 . _advertised + map ( cbuuid_to_uuid , arg_1 [ 'kCBAdvDataServiceUUIDs' ] )

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

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


Question: Freezes dict into tuple .

def Func ( arg_0 ) : arg_1 = arg_0 . items ( ) arg_2 = operator . itemgetter ( 0 ) return tuple ( sorted ( arg_1 , key = arg_2 ) )

Returns mappable data for a random subset of voxels.

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

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

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


Question: get all fields of model execpt id

def Func ( arg_0 ) : arg_1 = arg_0 . _meta . get_all_field_names ( ) if 'id' in arg_1 : arg_1 . remove ( 'id' ) return arg_1


Question: Replaces the rightmost dims in a Tensor representing a shape .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 , arg_5 = _replace_event_shape_in_tensorshape ( tensorshape_util . constant_value_as_shape ( arg_0 ) , arg_1 , arg_2 ) arg_6 = ( map ( tf . identity , ( arg_1 , arg_2 ) ) if arg_3 else ( ) ) if ( tensorshape_util . is_fully_defined ( arg_4 ) and ( arg_5 or not arg_3 ) ) : with tf . control_dependencies ( arg_6 ) : arg_7 = tf . convert_to_tensor ( value = arg_4 , name = 'output_shape' , dtype_hint = tf . int32 ) return arg_7 , arg_4 with tf . control_dependencies ( arg_6 ) : arg_8 = ( tf . size ( input = arg_1 ) if tensorshape_util . num_elements ( arg_1 . shape ) is None else tensorshape_util . num_elements ( arg_1 . shape ) ) arg_9 , arg_10 = tf . split ( arg_0 , num_or_size_splits = [ - 1 , arg_8 ] ) arg_11 = [ ] if arg_5 : pass elif arg_3 : arg_12 = arg_1 >= 0 arg_13 = tf . boolean_mask ( tensor = arg_10 , arg_12 = arg_12 ) arg_14 = tf . boolean_mask ( tensor = arg_1 , arg_12 = arg_12 ) arg_11 . append ( assert_util . assert_equal ( arg_13 , arg_14 , message = 'Input `event_shape` does not match `event_shape_in`.' ) ) with tf . control_dependencies ( arg_11 ) : arg_7 = tf . concat ( [ arg_9 , arg_2 ] , axis = 0 , name = 'output_shape' ) return arg_7 , arg_4

r'''Method to calculate heat capacity of a solid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to calculate heat capacity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Cp : float
            Heat capacity of the solid at T, [J/mol/K]


Question: Creates a new storage account in Windows Azure .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = 'Standard_GRS' ) : _validate_not_none ( 'service_name' , arg_1 ) _validate_not_none ( 'description' , arg_2 ) _validate_not_none ( 'label' , arg_3 ) if arg_4 is None and arg_5 is None : raise ValueError ( 'location or affinity_group must be specified' ) if arg_4 is not None and arg_5 is not None : raise ValueError ( 'Only one of location or affinity_group needs to be specified' ) if arg_6 == False : arg_8 = 'Standard_LRS' return arg_0 . _perform_post ( arg_0 . _get_storage_service_path ( ) , _XmlSerializer . create_storage_service_input_to_xml ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_8 , arg_7 ) , as_async = True )

Parse an ID3v1 tag, returning a list of ID3v2.4 frames.


Question: apply default settings to commands not static shadow self in eval

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if 'action' in arg_2 and "()" in arg_2 [ 'action' ] : arg_2 [ 'action' ] = eval ( "self.{}" . format ( arg_2 [ 'action' ] ) ) if arg_2 [ 'keys' ] [ 0 ] . startswith ( '-' ) : if 'required' not in arg_2 : arg_2 [ 'required' ] = False

Overriding the default JSONEncoder.default for NDB support.


Question: Get the kibiter vesion .

def Func ( arg_0 ) : arg_1 = None arg_2 = arg_0 . conf [ 'es_enrichment' ] [ 'url' ] arg_3 = '.kibana/config/_search' arg_4 = urijoin ( arg_2 , arg_3 ) arg_1 = None try : arg_5 = arg_0 . grimoire_con . get ( arg_4 ) arg_5 . raise_for_status ( ) arg_1 = arg_5 . json ( ) [ 'hits' ] [ 'hits' ] [ 0 ] [ '_id' ] logger . debug ( "Kibiter version: %s" , arg_1 ) except requests . exceptions . HTTPError : logger . warning ( "Can not find Kibiter version" ) return arg_1

Return all available input formats.

    Returns
    -------
    formats : list
        all available input formats


Question: Encrypts plaintext via CryptoAPI

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = None arg_6 = None try : arg_5 , arg_6 = _advapi32_create_handles ( arg_0 , arg_1 , arg_3 ) arg_7 = new ( advapi32 , 'DWORD *' , len ( arg_2 ) ) arg_8 = advapi32 . CryptEncrypt ( arg_6 , null ( ) , True , 0 , null ( ) , arg_7 , 0 ) handle_error ( arg_8 ) arg_9 = deref ( arg_7 ) arg_10 = buffer_from_bytes ( arg_9 ) write_to_buffer ( arg_10 , arg_2 ) pointer_set ( arg_7 , len ( arg_2 ) ) arg_8 = advapi32 . CryptEncrypt ( arg_6 , null ( ) , True , 0 , arg_10 , arg_7 , arg_9 ) handle_error ( arg_8 ) arg_11 = bytes_from_buffer ( arg_10 , deref ( arg_7 ) ) if arg_0 == 'aes' and not arg_4 : if arg_11 [ - 16 : ] != ( b'\x10' * 16 ) : raise ValueError ( 'Invalid padding generated by OS crypto library' ) arg_11 = arg_11 [ : - 16 ] return arg_11 finally : if arg_6 : advapi32 . CryptDestroyKey ( arg_6 ) if arg_5 : close_context_handle ( arg_5 )

Creates the Nginx configuration for the project


Question: helper method for implementing client . pull via client . apply

def Func ( arg_0 ) : arg_1 = globals ( ) if isinstance ( arg_0 , ( list , tuple , set ) ) : for arg_2 in arg_0 : if not arg_1 . has_key ( arg_2 ) : raise NameError ( "name '%s' is not defined" % arg_2 ) return map ( arg_1 . get , arg_0 ) else : if not arg_1 . has_key ( arg_0 ) : raise NameError ( "name '%s' is not defined" % arg_0 ) return arg_1 . get ( arg_0 )

Creates a service from a constructor and checks which kwargs are not used


Question: Convert UUID to binary blob

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , UUID ) : arg_1 = UUID ( arg_1 ) arg_2 = str ( arg_1 ) . split ( "-" ) arg_3 = '' . join ( [ arg_2 [ 2 ] , arg_2 [ 1 ] , arg_2 [ 0 ] , arg_2 [ 3 ] , arg_2 [ 4 ] ] ) arg_1 = binascii . unhexlify ( arg_3 ) return super ( OrderedUUIDField , arg_0 ) . Func ( arg_1 )

Process data to produce velocity and dropout information.


Question: Print to the screen the rewritten form of the user s command .

def Func ( arg_0 , arg_1 ) : if not arg_0 . show_rewritten_input : return arg_2 = arg_0 . prompt_manager . render ( 'rewrite' ) + arg_1 try : arg_2 = str ( arg_2 ) print >> io . stdout , arg_2 except UnicodeEncodeError : print "------> " + arg_1

Converts xml response to service bus namespace availability

        The xml format:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
    <id>uuid:9fc7c652-1856-47ab-8d74-cd31502ea8e6;id=3683292</id>
    <title type="text"></title>
    <updated>2013-04-16T03:03:37Z</updated>
    <content type="application/xml">
        <NamespaceAvailability
            xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
            xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <Result>false</Result>
        </NamespaceAvailability>
    </content>
</entry>


Question: Converts frame indices to audio sample indices .

def Func ( arg_0 , arg_1 = 512 , arg_2 = None ) : arg_3 = 0 if arg_2 is not None : arg_3 = int ( arg_2 // 2 ) return ( np . asanyarray ( arg_0 ) * arg_1 + arg_3 ) . astype ( int )

Change the given swarm's state to 'newState'. If 'newState' is
    'completed', then bestModelId and bestErrScore must be provided.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:      swarm Id
    newStatus:    new status, either 'active', 'completing', 'completed', or
                    'killed'


Question: Handle pre_migrate signal - disconnect User post_save handler .

def Func ( arg_0 , arg_1 , ** arg_2 ) : from django . db . models . signals import post_save post_save . disconnect ( arg_1 = arg_0 . auth_user_model , dispatch_uid = USER_POST_SAVE_DISPATCH_UID )


Question: Register and upload a function to AWS Lambda .

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None ) : print ( 'Creating your new Lambda function' ) arg_4 = read ( arg_1 , binary_file = True ) arg_5 = arg_0 . get ( 'profile' ) arg_6 = arg_0 . get ( 'aws_access_key_id' ) arg_7 = arg_0 . get ( 'aws_secret_access_key' ) arg_8 = get_account_id ( arg_5 , arg_6 , arg_7 , arg_0 . get ( 'region' , ) , ) arg_9 = get_role_name ( arg_0 . get ( 'region' ) , arg_8 , arg_0 . get ( 'role' , 'lambda_basic_execution' ) , ) arg_10 = get_client ( 'lambda' , arg_5 , arg_6 , arg_7 , arg_0 . get ( 'region' ) , ) arg_11 = ( os . environ . get ( 'S3_BUCKET_NAME' ) or arg_0 . get ( 'bucket_name' ) ) arg_12 = ( os . environ . get ( 'LAMBDA_FUNCTION_NAME' ) or arg_0 . get ( 'function_name' ) ) print ( 'Creating lambda function with name: {}' . format ( arg_12 ) ) if arg_2 : arg_13 = { 'FunctionName' : arg_12 , 'Runtime' : arg_0 . get ( 'runtime' , 'python2.7' ) , 'Role' : arg_9 , 'Handler' : arg_0 . get ( 'handler' ) , 'Code' : { 'S3Bucket' : '{}' . format ( arg_11 ) , 'S3Key' : '{}' . format ( arg_3 ) , } , 'Description' : arg_0 . get ( 'description' , '' ) , 'Timeout' : arg_0 . get ( 'timeout' , 15 ) , 'MemorySize' : arg_0 . get ( 'memory_size' , 512 ) , 'VpcConfig' : { 'SubnetIds' : arg_0 . get ( 'subnet_ids' , [ ] ) , 'SecurityGroupIds' : arg_0 . get ( 'security_group_ids' , [ ] ) , } , 'Publish' : True , } else : arg_13 = { 'FunctionName' : arg_12 , 'Runtime' : arg_0 . get ( 'runtime' , 'python2.7' ) , 'Role' : arg_9 , 'Handler' : arg_0 . get ( 'handler' ) , 'Code' : { 'ZipFile' : arg_4 } , 'Description' : arg_0 . get ( 'description' , '' ) , 'Timeout' : arg_0 . get ( 'timeout' , 15 ) , 'MemorySize' : arg_0 . get ( 'memory_size' , 512 ) , 'VpcConfig' : { 'SubnetIds' : arg_0 . get ( 'subnet_ids' , [ ] ) , 'SecurityGroupIds' : arg_0 . get ( 'security_group_ids' , [ ] ) , } , 'Publish' : True , } if 'tags' in arg_0 : arg_13 . update ( Tags = { arg_14 : str ( arg_15 ) for arg_14 , arg_15 in arg_0 . get ( 'tags' ) . items ( ) } ) if 'environment_variables' in arg_0 : arg_13 . update ( Environment = { 'Variables' : { arg_14 : get_environment_variable_value ( arg_15 ) for arg_14 , arg_15 in arg_0 . get ( 'environment_variables' ) . items ( ) } , } , ) arg_10 . Func ( ** arg_13 ) arg_16 = get_concurrency ( arg_0 ) if arg_16 > 0 : arg_10 . put_function_concurrency ( FunctionName = arg_12 , ReservedConcurrentExecutions = arg_16 )

a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom properties value type set to
       container, which is set when the image is pushed.

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the properties value with type
       as container. It also should have a "uri" in properties to show the
       user, otherwise the user will have to query / download based on the id


Question: Return file content if file else return value as - is

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not isinstance ( arg_1 , str ) : return arg_1 if isinstance ( arg_1 , six . binary_type ) : arg_1 = arg_1 . decode ( 'UTF-8' ) if arg_1 . startswith ( '@' ) : arg_4 = os . path . expanduser ( arg_1 [ 1 : ] ) arg_5 = super ( Variables , arg_0 ) . Func ( arg_4 , arg_2 , arg_3 ) if hasattr ( arg_5 , 'read' ) : return arg_5 . read ( ) return arg_5 return 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: Returns list of ancestor task specs based on inputs

def Func ( arg_0 ) : arg_1 = [ ] def recursive_find_Func ( arg_2 , arg_3 ) : for arg_4 in arg_2 . inputs : if arg_4 not in arg_3 : arg_3 . append ( arg_4 ) recursive_find_Func ( arg_4 , arg_3 ) recursive_find_Func ( arg_0 , arg_1 ) return arg_1

Return True if we should retry. False otherwise.

  Args:
    exception: An exception to test for transience.

  Returns:
    True if we should retry. False otherwise.


Question: Process dict arguments .

def Func ( arg_0 , arg_1 ) : if arg_0 . should_check_whitelist ( arg_1 ) : for arg_2 in arg_1 . keys : if arg_2 . s in arg_0 . whitelist or arg_2 . s . startswith ( "debug_" ) : continue arg_0 . violations . append ( ( arg_0 . current_logging_call , WHITELIST_VIOLATION . format ( arg_2 . s ) ) ) if arg_0 . should_check_extra_exception ( arg_1 ) : for arg_3 in arg_1 . values : arg_0 . check_exception_arg ( arg_3 ) super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 )


Question: Yield chunks generated from received data .

def Func ( arg_0 , arg_1 ) : arg_0 . _buf += arg_1 while True : arg_2 = _best_effort_decode ( arg_0 . _buf ) arg_3 = arg_2 . encode ( 'utf-16' ) [ 2 : ] arg_4 = LEN_REGEX . match ( arg_2 ) if arg_4 is None : break else : arg_5 = arg_4 . group ( 1 ) arg_6 = int ( arg_5 ) * 2 arg_7 = len ( ( arg_5 + '\n' ) . encode ( 'utf-16' ) [ 2 : ] ) if len ( arg_3 ) - arg_7 < arg_6 : break arg_8 = arg_3 [ arg_7 : arg_7 + arg_6 ] yield arg_8 . decode ( 'utf-16' ) arg_9 = ( len ( ( arg_5 + '\n' ) . encode ( ) ) + len ( arg_8 . decode ( 'utf-16' ) . encode ( ) ) ) arg_0 . _buf = arg_0 . _buf [ arg_9 : ]

Get course's duration as a timedelta.

        Arguments:
            obj (CourseOverview): CourseOverview object

        Returns:
            (timedelta): Duration of a course.


Question: Load all plugins from dgit extension

def Func ( arg_0 ) : for arg_1 in pkg_resources . iter_entry_points ( 'dgit.plugins' ) : arg_2 = arg_1 . load ( ) arg_2 . setup ( arg_0 )

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


Question: Create a gui2py control based on the python resource

def Func ( arg_0 , arg_1 = None ) : arg_2 = dict ( arg_0 . items ( ) ) arg_3 = arg_2 . pop ( 'type' ) if 'components' in arg_0 : arg_4 = arg_2 . pop ( 'components' ) elif arg_3 == 'Menu' and 'items' in arg_0 : arg_4 = arg_2 . pop ( 'items' ) else : arg_4 = [ ] from gui import registry if arg_3 in registry . CONTROLS : arg_5 = registry . CONTROLS [ arg_3 ] elif arg_3 in registry . MENU : arg_5 = registry . MENU [ arg_3 ] elif arg_3 in registry . MISC : arg_5 = registry . MISC [ arg_3 ] else : raise RuntimeError ( "%s not in registry" % arg_3 ) arg_6 = arg_5 ( arg_1 = arg_1 , ** arg_2 ) for arg_7 in arg_4 : Func ( arg_7 , arg_1 = arg_6 ) return arg_6

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


Question: Returns the optimizer arguments including the time the list of variables to optimize and various functions which the optimizer might require to perform an update step .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) : arg_8 = dict ( time = arg_0 . global_timestep , variables = arg_0 . get_variables ( ) , arg_8 = dict ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , update = tf . constant ( value = True ) ) , fn_reference = arg_0 . fn_reference , fn_loss = arg_0 . fn_loss ) if arg_0 . global_model is not None : arg_8 [ 'global_variables' ] = arg_0 . global_model . get_variables ( ) return arg_8

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Add this manager s namespace to the graph .

def Func ( arg_0 , arg_1 : arg_2 ) -> Namespace : arg_3 = arg_0 . upload_bel_namespace ( ) arg_1 . namespace_url [ arg_3 . keyword ] = arg_3 . url arg_0 . _add_annotation_to_graph ( arg_1 ) return arg_3

r'''This function handles the retrieval of a chemical's octanol-water
    partition coefficient. Lookup is based on CASRNs. Will automatically
    select a data source to use if no Method is provided; returns None if the
    data is not available.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    logP : float
        Octanol-water partition coefficient, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain logP with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'SYRRES', or 'CRC',
        All valid values are also held in the list logP_methods.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the logP for the desired chemical, and will return methods
        instead of the logP

    Notes
    -----
    .. math::
        \log P_{ oct/wat} = \log\left(\frac{\left[{solute}
        \right]_{ octanol}^{un-ionized}}{\left[{solute}
        \right]_{ water}^{ un-ionized}}\right)

    Examples
    --------
    >>> logP('67-56-1')
    -0.74

    References
    ----------
    .. [1] Syrres. 2006. KOWWIN Data, SrcKowData2.zip.
       http://esc.syrres.com/interkow/Download/SrcKowData2.zip
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.


Question: Augmenter that sets rectangular areas within images to zero .

def Func ( arg_0 = 0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = 4 , arg_5 = None , arg_6 = False , arg_7 = None ) : if ia . is_single_number ( arg_0 ) : arg_8 = iap . Binomial ( 1 - arg_0 ) elif ia . is_iterable ( arg_0 ) : ia . do_assert ( len ( arg_0 ) == 2 ) ia . do_assert ( arg_0 [ 0 ] < arg_0 [ 1 ] ) ia . do_assert ( 0 <= arg_0 [ 0 ] <= 1.0 ) ia . do_assert ( 0 <= arg_0 [ 1 ] <= 1.0 ) arg_8 = iap . Binomial ( iap . Uniform ( 1 - arg_0 [ 1 ] , 1 - arg_0 [ 0 ] ) ) elif isinstance ( arg_0 , iap . StochasticParameter ) : arg_8 = arg_0 else : raise Exception ( "Expected p to be float or int or StochasticParameter, got %s." % ( type ( arg_0 ) , ) ) if arg_1 is not None : arg_9 = iap . FromLowerResolution ( other_param = arg_8 , arg_1 = arg_1 , arg_4 = arg_4 ) elif arg_2 is not None : arg_9 = iap . FromLowerResolution ( other_param = arg_8 , arg_2 = arg_2 , arg_4 = arg_4 ) else : raise Exception ( "Either size_px or size_percent must be set." ) if arg_5 is None : arg_5 = "Unnamed%s" % ( ia . caller_name ( ) , ) return MultiplyElementwise ( arg_9 , arg_3 = arg_3 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 )


Question: Label new data with cluster identities .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ arg_0 . analytes [ 0 ] ] . size arg_3 , arg_4 = arg_0 . format_data ( arg_1 ) arg_5 = arg_0 . classifier . Func ( arg_3 ) arg_6 = arg_0 . map_clusters ( arg_2 , arg_4 , arg_5 ) return arg_6

Remove card from tradepile.

        :params trade_id: Trade id.


Question: Raise an ApiUsageError if the given object is not a token that is currently participating in the game . To be participating in the game the given token must have an id number and be associated with the world .

def Func ( arg_0 ) : require_token ( arg_0 ) arg_1 = arg_0 if not arg_1 . has_id : raise ApiUsageError ( """\                token {token} should have an id, but doesn't.                This error usually means that a token was added to the world                 without being assigned an id number.  To correct this, make                 sure that you're using a message (i.e. CreateToken) to create                 all of your tokens.""" ) if not arg_1 . has_world : raise ApiUsageError ( """\                token {token} (id={token.id}) not in world.                You can get this error if you try to remove the same token from                 the world twice.  This might happen is you don't get rid of                 every reference to a token after it's removed the first time,                 then later on you try to remove the stale reference.""" )

Adds a highlight tag to the given edges.

    :param graph: A BEL graph
    :param edges: The edges (4-tuples of u, v, k, d) to add a highlight tag on
    :type edges: iter[tuple]
    :param str color: The color to highlight (use something that works with CSS)


Question: This function will disown so the Ardexa service can be restarted

def Func ( arg_0 ) : arg_1 = os . getpid ( ) arg_2 = "/proc/" + str ( arg_1 ) + "/cgroup" try : arg_3 = open ( arg_2 , "r" ) except IOError : print ( "Could not open cgroup file: " , arg_2 ) return False for arg_4 in arg_3 : if arg_4 . find ( "ardexa.service" ) == - 1 : continue arg_4 = arg_4 . replace ( "name=" , "" ) arg_5 = arg_4 . split ( ':' ) arg_6 = arg_5 [ 1 ] arg_7 = arg_6 + "/ardexa.Func" if not arg_6 : continue arg_8 = "/sys/fs/cgroup/" + arg_7 if not os . path . exists ( arg_8 ) : os . makedirs ( arg_8 ) if arg_0 >= 1 : print ( "Making directory: " , arg_8 ) else : if arg_0 >= 1 : print ( "Directory already exists: " , arg_8 ) arg_9 = arg_8 + "/cgroup.procs" arg_10 = [ "echo" , str ( arg_1 ) , ">" , arg_9 ] run_program ( arg_10 , arg_0 , True ) if arg_6 . find ( "," ) != - 1 : arg_11 = arg_6 . split ( ',' ) arg_6 = arg_11 [ 1 ] + "," + arg_11 [ 0 ] arg_7 = arg_6 + "/ardexa.Func" arg_8 = "/sys/fs/cgroup/" + arg_7 try : if not os . path . exists ( arg_8 ) : os . makedirs ( arg_8 ) except : continue arg_9 = arg_8 + "/cgroup.procs" arg_10 = [ "echo" , str ( arg_1 ) , ">" , arg_9 ] run_program ( arg_10 , arg_0 , True ) arg_3 . close ( ) if arg_0 >= 1 : arg_10 = [ "cat" , arg_2 ] run_program ( arg_10 , arg_0 , False ) arg_10 = [ "grep" , "-q" , "ardexa.service" , arg_2 ] if run_program ( arg_10 , arg_0 , False ) : return False return True

Defines the ``Content-Type`` outgoing header value to match.

        You can pass one of the following type aliases instead of the full
        MIME type representation:

        - ``json`` = ``application/json``
        - ``xml`` = ``application/xml``
        - ``html`` = ``text/html``
        - ``text`` = ``text/plain``
        - ``urlencoded`` = ``application/x-www-form-urlencoded``
        - ``form`` = ``application/x-www-form-urlencoded``
        - ``form-data`` = ``application/x-www-form-urlencoded``

        Arguments:
            value (str): type alias or header value to match.

        Returns:
            self: current Mock instance.


Question: r Method to set the pressure - dependent property methods desired for consideration by the user . Can be used to exclude certain methods which might have unacceptable accuracy .

def Func ( arg_0 , arg_1 , arg_2 = False ) : if isinstance ( arg_1 , str ) : arg_1 = [ arg_1 ] arg_0 . user_methods_P = arg_1 arg_0 . forced_P = arg_2 if set ( arg_0 . user_methods_P ) . difference ( arg_0 . all_methods_P ) : raise Exception ( "One of the given methods is not available for this chemical" ) if not arg_0 . user_methods_P and arg_0 . forced : raise Exception ( 'Only user specified methods are considered when forced is True, but no methods were provided' ) arg_0 . method_P = None arg_0 . sorted_valid_methods_P = [ ] arg_0 . TP_cached = None

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


Question: Parses all data from the source saving model instances .

def Func ( arg_0 ) : if not arg_0 . loaded : arg_0 . load ( arg_0 . source ) for arg_1 in arg_0 . get_items ( ) : arg_2 = arg_0 . Func_item ( arg_1 ) arg_3 = arg_0 . get_instance ( arg_2 ) arg_0 . feed_instance ( arg_2 , arg_3 ) try : arg_0 . save_item ( arg_1 , arg_2 , arg_3 ) except Exception as e : arg_0 . save_error ( arg_2 , sys . exc_info ( ) ) arg_0 . unload ( )

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: return true if the message associated to the given message id is enabled

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_0 . config . confidence and arg_3 : if arg_3 . name not in arg_0 . config . confidence : return False try : arg_4 = arg_0 . msgs_store . get_message_definitions ( arg_1 ) arg_5 = [ md . msgid for md in arg_4 ] except UnknownMessageError : arg_5 = [ arg_1 ] for arg_6 in arg_5 : if arg_0 . is_one_message_enabled ( arg_6 , arg_2 ) : return True return False

Write the index.html file for this report.


Question: Implementation of the LOAD_NAME operation

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . globals_ : return arg_0 . globals_ [ arg_1 ] arg_2 = arg_0 . globals_ [ '__builtins__' ] if isinstance ( arg_2 , dict ) : return arg_2 [ arg_1 ] else : return getattr ( arg_2 , arg_1 )

Main function to start change log generation

        :rtype: str
        :return: Generated change log file


Question: Convert an AST sepcial handling to python source code .

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_1 . value . svalue if arg_3 in PB_SPECIAL_HANDLING : return [ "PB.{0}" . format ( arg_3 ) ] else : return [ "self.{0}" . format ( arg_3 ) ]


Question: The text representation of an end tag for a tag . Includes trailing whitespace when appropriate .

def Func ( arg_0 ) : if arg_0 . tail and start_whitespace_re . search ( arg_0 . tail ) : arg_1 = ' ' else : arg_1 = '' return '</%s>%s' % ( arg_0 . tag , arg_1 )


Question: Compute and store metric value

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_0 . value = arg_0 . avg ( arg_2 )


Question: Determine the protocol used to record an ABF file

def Func ( arg_0 ) : arg_1 = open ( arg_0 , 'rb' ) arg_2 = arg_1 . read ( 30 * 1000 ) arg_1 . close ( ) arg_2 = arg_2 . decode ( "utf-8" , "ignore" ) arg_2 = arg_2 . split ( "Clampex" ) [ 1 ] . split ( ".pro" ) [ 0 ] arg_3 = os . path . basename ( arg_2 ) arg_4 = arg_3 . split ( " " ) [ 0 ] return arg_4

Whether a connection can be established between those two meshes.


Question: Stop the threads .

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : logger . debug ( "Closing the io handlers..." ) for arg_3 in arg_0 . io_handlers : arg_3 . close ( ) if arg_0 . event_thread and arg_0 . event_thread . is_alive ( ) : logger . debug ( "Sending the QUIT signal" ) arg_0 . event_queue . put ( QUIT ) logger . debug ( "  sent" ) arg_4 = arg_0 . io_threads + arg_0 . timeout_threads for arg_5 in arg_4 : logger . debug ( "Stopping thread: {0!r}" . format ( arg_5 ) ) arg_5 . Func ( ) if not arg_1 : return if arg_0 . event_thread : arg_4 . append ( arg_0 . event_thread ) if arg_2 is None : for arg_5 in arg_4 : arg_5 . join ( ) else : arg_6 = ( arg_2 * 0.01 ) / len ( arg_4 ) arg_7 = [ ] for arg_5 in arg_4 : logger . debug ( "Quick-joining thread {0!r}..." . format ( arg_5 ) ) arg_5 . join ( arg_6 ) if arg_5 . is_alive ( ) : logger . debug ( "  thread still alive" . format ( arg_5 ) ) arg_7 . append ( arg_5 ) if arg_7 : arg_8 = ( arg_2 * 0.99 ) / len ( arg_7 ) for arg_5 in arg_7 : logger . debug ( "Joining thread {0!r}..." . format ( arg_5 ) ) arg_5 . join ( arg_8 ) arg_0 . io_threads = [ ] arg_0 . event_thread = None


Question: Restore resource s path and name from storage s table .

def Func ( arg_0 ) : arg_1 = None arg_2 = arg_0 . split ( '___' ) arg_3 = arg_2 [ 0 ] if len ( arg_2 ) == 2 : arg_1 = arg_2 [ 1 ] arg_3 = arg_3 . replace ( '__' , os . path . sep ) arg_3 += '.csv' return arg_3 , arg_1

Create an excel sheet ready to be used in SPIA software.

    :param graph: BELGraph
    :return: dictionary with matrices


Question: Build an observation_noise_fn that observes a Tensor timeseries .

def Func ( arg_0 ) : def observation_noise_fn ( arg_1 ) : arg_2 = arg_0 [ ... , arg_1 , : ] return tfd . MultivariateNormalDiag ( loc = arg_2 , scale_diag = tf . zeros_like ( arg_2 ) ) return observation_noise_fn

Look through the jobs table and get the list of running jobs whose
    cancel field is true.

    Parameters:
    ----------------------------------------------------------------
    retval:      A (possibly empty) sequence of running job IDs with cancel field
                  set to true


Question: Run a command .

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . ctx . Func if arg_0 . ctx else None return Func ( arg_1 , arg_4 = arg_4 , * arg_2 , ** arg_3 )

A factory method which can be overridden in subclasses to create
        specialized LogRecords.


Question: Replaces the event shape dims of a TensorShape .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tensorshape_util . num_elements ( arg_1 . shape ) if tensorshape_util . rank ( arg_0 ) is None or arg_3 is None : return tf . TensorShape ( None ) , False arg_4 = tensorshape_util . rank ( arg_0 ) - arg_3 if arg_4 < 0 : raise ValueError ( 'Input has fewer ndims ({}) than event shape ndims ({}).' . format ( tensorshape_util . rank ( arg_0 ) , arg_3 ) ) arg_5 = arg_0 [ : arg_4 ] arg_6 = arg_0 [ arg_4 : ] arg_7 = tf . get_static_value ( arg_1 ) arg_8 = ( tensorshape_util . is_fully_defined ( arg_6 ) and arg_7 is not None ) if arg_8 : arg_9 = np . int32 ( arg_6 ) arg_10 = arg_7 >= 0 arg_11 = arg_9 [ arg_10 ] arg_12 = arg_7 [ arg_10 ] if not all ( arg_11 == arg_12 ) : raise ValueError ( 'Input `event_shape` does not match `event_shape_in`. ' '({} vs {}).' . format ( arg_9 , arg_7 ) ) arg_13 = tensorshape_util . constant_value_as_shape ( arg_2 ) if tensorshape_util . rank ( arg_13 ) is None : arg_14 = tf . TensorShape ( None ) else : arg_14 = tensorshape_util . concatenate ( arg_5 , arg_13 ) return arg_14 , arg_8


Question: Apply updates to the next tuple metrics

def Func ( arg_0 , arg_1 ) : arg_0 . update_reduced_metric ( arg_0 . NEXT_TUPLE_LATENCY , arg_1 ) arg_0 . update_count ( arg_0 . NEXT_TUPLE_COUNT )

Validate min and max bounds are within waveform's independent variable vector.


Question: Synced API call to get all cluster names

def Func ( ) : arg_0 = tornado . ioloop . IOLoop . instance ( ) try : return arg_0 . run_sync ( lambda : API . Func ( ) ) except Exception : Log . debug ( traceback . format_exc ( ) ) raise

Discard deposit changes.

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

        #. It restores the last published version.

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

        .. code-block:: python

            deposit['$schema'] = deposit_schema_from_record_schema

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

        #. The deposit index is updated.

        Status required: ``'draft'``.

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


Question: Remove all of the ancestor operation nodes of node .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , int ) : warnings . warn ( 'Calling Func() with a node id is deprecated,' ' use a DAGNode instead' , DeprecationWarning , 2 ) arg_1 = arg_0 . _id_to_node [ arg_1 ] arg_2 = nx . ancestors ( arg_0 . _multi_graph , arg_1 ) for arg_3 in arg_2 : if arg_3 . type == "op" : arg_0 . remove_op_node ( arg_3 )

Connect to the stream

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


Question: Script to make pMHC binding predictions from amino acid sequences .

def Func ( arg_0 = None ) : arg_1 = parse_args ( arg_0 ) arg_2 = run_predictor ( arg_1 ) arg_3 = arg_2 . to_dataframe ( ) logger . info ( '\n%s' , arg_3 ) if arg_1 . output_csv : arg_3 . to_csv ( arg_1 . output_csv , index = False ) print ( "Wrote: %s" % arg_1 . output_csv )

Make a GET request using the session object to a SuccessFactors endpoint for inactive learners.

        Example:
            sap_search_student_url: "/learning/odatav4/searchStudent/v1/Students?
                $filter=criteria/isActive eq False&$select=studentID"

            SAP API response: {
                u'@odata.metadataEtag': u'W/"17090d86-20fa-49c8-8de0-de1d308c8b55"',
                u'value': [
                    {
                        u'studentID': u'admint6',
                    },
                    {
                        u'studentID': u'adminsap1',
                    }
                ]
            }

        Returns: List of inactive learners
        [
            {
                u'studentID': u'admint6'
            },
            {
                u'studentID': u'adminsap1'
            }
        ]


Question: Woopra tracking template tag .

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

gridSpan is what docx uses to denote that a table cell has a colspan. This
    is much more simple than rowspans in that there is a one-to-one mapping
    from gridSpan to colspan.


Question: Get available datasets from mart you ve selected

def Func ( arg_0 , arg_1 = 'ENSEMBL_MART_ENSEMBL' ) : arg_2 = arg_0 . datasets ( arg_1 , raw = True ) return pd . read_csv ( StringIO ( arg_2 ) , header = None , usecols = [ 1 , 2 ] , names = [ "Name" , "Description" ] , sep = "\t" )

Call the timeout handlers due.

        :Return: (next_event_timeout, sources_handled) tuple.
            next_event_timeout is number of seconds until the next timeout
            event, sources_handled is number of handlers called.


Question: Removes a specific mock instance by object reference .

def Func ( arg_0 , arg_1 ) : arg_0 . mocks = [ m for m in arg_0 . mocks if m is not arg_1 ]

Handle marking messages as read and keeping client active.


Question: A generator to convert raw text segments with xml and other non - textual content to a list of words without any markup . Additionally dates are replaced by 7777 for normalization along with wikipedia anchors kept .

def Func ( arg_0 , arg_1 = False , arg_2 = True ) : arg_3 = arg_0 arg_3 = _remove_mvar ( arg_3 ) arg_3 = _remove_squiggly_bracket ( arg_3 ) arg_3 = _remove_table ( arg_3 ) arg_3 = remove_markup ( arg_3 ) arg_3 = remove_wikipedia_link . sub ( anchor_replacer , arg_3 ) arg_3 = remove_bullets_nbsps . sub ( empty_space , arg_3 ) arg_3 = remove_math_sections ( arg_3 ) arg_3 = remove_html ( arg_3 ) for arg_4 in sent_tokenize ( arg_3 , arg_1 , arg_2 ) : yield arg_4

Registers `block` to `block_type` in the registry.


Question: Add a new item to the DiscoItems object .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : return DiscoItem ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

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: Escape all non - alphanumeric characters in pattern .

def Func ( arg_0 ) : arg_1 = list ( arg_0 ) arg_2 = _alphanum for arg_3 , arg_4 in enumerate ( arg_0 ) : if arg_4 not in arg_2 : if arg_4 == "\000" : arg_1 [ arg_3 ] = "\\000" else : arg_1 [ arg_3 ] = "\\" + arg_4 return arg_0 [ : 0 ] . join ( arg_1 )

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: Leave a one - to - one conversation .

async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . DeleteConversationResponse ( ) await arg_0 . _pb_request ( 'conversations/deleteconversation' , arg_1 , arg_2 ) return arg_2

Calculate statistics for given data.

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


Question: Half - duplex SPI write then read . Send command and payload to slave as bytearray then consequently read out response from the slave for length in bytes . Designed for use with NOR or NAND flash chips and possibly SD cards ... etc ... Read command is cut in half and performed twice in series to prevent single byte errors . Hardware limits per command are enforced before doing anything . Read length is an optional argument so that it can function similar to transfer but still half - duplex . For reading without writing one can send a blank array or skip that argument .

def Func ( arg_0 , arg_1 = [ ] , arg_2 = 'None' , arg_3 = 1 ) : if ( 1 > arg_2 > 65536 ) | ( len ( arg_1 ) > 65536 ) : print ( 'the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!' ) print ( 'use for loops for larger reads' ) exit ( 1 ) if ( arg_2 == 'None' ) & ( arg_3 == 1 ) : arg_2 = len ( arg_1 ) arg_4 = 0x10 | ( arg_0 . lsbfirst << 3 ) | arg_0 . write_clock_ve arg_5 = len ( arg_1 ) - 1 arg_6 = ( arg_5 ) & 0xFF arg_7 = ( ( arg_5 ) >> 8 ) & 0xFF arg_8 = 0x20 | ( arg_0 . lsbfirst << 3 ) | ( arg_0 . read_clock_ve << 2 ) arg_9 = arg_2 if arg_2 % 2 == 1 : arg_9 += 1 arg_9 = arg_9 / 2 arg_10 = arg_2 - arg_9 arg_11 = ( arg_9 - 1 ) & 0xFF arg_12 = ( ( arg_9 - 1 ) >> 8 ) & 0xFF logger . debug ( 'SPI Func with write command {0:2X}.' . format ( arg_4 ) ) logger . debug ( 'and read command {0:2X}.' . format ( arg_8 ) ) arg_0 . _assert_cs ( ) arg_0 . _ft232h . _write ( str ( bytearray ( ( arg_4 , arg_6 , arg_7 ) ) ) ) arg_0 . _ft232h . _write ( str ( bytearray ( arg_1 ) ) ) arg_0 . _ft232h . _write ( str ( bytearray ( ( arg_8 , arg_11 , arg_12 ) ) ) ) arg_13 = arg_0 . _ft232h . _poll_read ( arg_9 ) arg_0 . _ft232h . _write ( str ( bytearray ( ( arg_8 , arg_11 , arg_12 ) ) ) ) arg_14 = arg_0 . _ft232h . _poll_read ( arg_10 ) arg_0 . _deassert_cs ( ) return bytearray ( arg_13 + arg_14 )

notify all listeners about aggregate data and stats


Question: Checks if sting is valid for bidirectional printing .

def Func ( arg_0 ) : arg_1 = False arg_2 = False for arg_3 in arg_0 : if stringprep . in_table_d1 ( arg_3 ) : arg_2 = True elif stringprep . in_table_d2 ( arg_3 ) : arg_1 = True if arg_1 and arg_2 : raise StringprepError ( "Both RandALCat and LCat characters present" ) if arg_2 and ( not stringprep . in_table_d1 ( arg_0 [ 0 ] ) or not stringprep . in_table_d1 ( arg_0 [ - 1 ] ) ) : raise StringprepError ( "The first and the last character must" " be RandALCat" ) return arg_0

Update the cache stats.

        If no cache-result is specified, we iniitialize the key.
        Otherwise, we increment the correct cache-result.

        Note the behavior for expired.  A client can be expired and the key
        still exists.


Question: Transport a local file to a directory on a remote machine

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 + '/' + os . path . basename ( arg_1 ) try : arg_0 . makedirs ( arg_2 , exist_ok = True ) except IOError as e : logger . exception ( "Pushing {0} to {1} failed" . format ( arg_1 , arg_2 ) ) if e . errno == 2 : raise BadScriptPath ( e , arg_0 . hostname ) elif e . errno == 13 : raise BadPermsScriptPath ( e , arg_0 . hostname ) else : logger . exception ( "File push failed due to SFTP client failure" ) raise FileCopyException ( e , arg_0 . hostname ) try : arg_0 . sftp_client . put ( arg_1 , arg_3 , confirm = True ) arg_0 . sftp_client . chmod ( arg_3 , 0o777 ) except Exception as e : logger . exception ( "File push from local source {} to remote destination {} failed" . format ( arg_1 , arg_3 ) ) raise FileCopyException ( e , arg_0 . hostname ) return arg_3

Augment endlessly images in the source queue.

        This is a worker function for that endlessly queries the source queue (input batches),
        augments batches in it and sends the result to the output queue.


Question: Return True if we are looking at a class definition statement

def Func ( arg_0 , arg_1 ) : return ( arg_0 and _re_class . match ( arg_0 ) and stmt_contains_opcode ( arg_1 . f_code , arg_1 . f_lineno , 'BUILD_CLASS' ) )

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


Question: Selects even - odd nuclei from the table

def Func ( arg_0 ) : return arg_0 . select ( lambda Z , N : not ( Z % 2 ) and ( N % 2 ) , name = arg_0 . name )

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

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


Question: Get conversion method for instruction .

def Func ( arg_0 , arg_1 ) : try : return arg_0 . _bound_instructions [ type ( arg_1 ) ] except KeyError : raise PulseError ( 'Qobj conversion method for %s is not found.' % arg_1 )

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


Question: Create message content and properties to delete queue with QMFv2

def Func ( arg_0 , arg_1 ) : arg_2 = { "_object_id" : { "_object_name" : arg_0 . object_name } , "_method_name" : "delete" , "_arguments" : { "type" : "queue" , "name" : arg_1 , "options" : dict ( ) } } logger . debug ( "Message content -> {0}" . format ( arg_2 ) ) return arg_2 , arg_0 . method_properties

Stop the timer

        Returns:
            The time the timer was stopped


Question: Parse ascii post source return dict

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 , arg_5 = libFuncr . Func ( arg_1 ) if arg_2 == - 1 : raise SeparatorNotFound elif arg_2 == - 2 : raise PostTitleNotFound arg_3 , arg_4 , arg_5 = map ( to_unicode , ( arg_3 , arg_4 , arg_5 ) ) arg_6 = arg_0 . markdown . render ( arg_5 ) arg_7 = arg_0 . markdown . render ( arg_5 [ : 200 ] ) return { 'title' : arg_3 , 'markdown' : arg_5 , 'html' : arg_6 , 'summary' : arg_7 , 'title_pic' : arg_4 }

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: Get merge version detail

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = urijoin ( arg_0 . base_url , GitLabClient . PROJECTS , arg_0 . owner + '%2F' + arg_0 . repository , GitLabClient . MERGES , arg_1 , GitLabClient . VERSIONS , arg_2 ) arg_4 = arg_0 . fetch ( arg_3 ) return arg_4 . text

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: return the likelihood of the observed sequences given the tree

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : if not hasattr ( arg_0 . tree , "total_Func" ) : arg_0 . logger ( "TreeAnc.Func: you need to run marginal ancestral inference first!" , 1 ) arg_0 . infer_ancestral_sequences ( marginal = True ) if arg_1 is not None : if arg_2 : arg_3 = arg_0 . full_to_reduced_sequence_map [ arg_1 ] else : arg_3 = arg_1 return arg_0 . tree . Func [ arg_3 ] else : return arg_0 . tree . total_Func

This method is called before first step of simulation.


Question: Check if the profiler is running .

def Func ( arg_0 ) : arg_0 . write ( { "running" : arg_0 . running } ) arg_0 . set_status ( 200 ) arg_0 . finish ( )

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: Stores the zipkin attributes to thread local .

def Func ( arg_0 ) : from py_zipkin . storage import ThreadLocalStack log . warning ( 'Func is deprecated. See DEPRECATIONS.rst for' 'details on how to migrate to using Tracer.' ) return ThreadLocalStack ( ) . push ( arg_0 )

Safely join `directory` and `filename`.

    Example usage::

        @app.route('/wiki/<path:filename>')
        def wiki_page(filename):
            filename = safe_join(app.config['WIKI_FOLDER'], filename)
            with open(filename, 'rb') as fd:
                content = fd.read() # Read and process the file content...

    :param directory: the base directory.
    :param filename: the untrusted filename relative to that directory.
    :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
             would fall out of `directory`.


Question: Sample a new feasible point from the point x in direction delta .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 0 ) : arg_5 = arg_0 . problem arg_6 = ( ( np . abs ( arg_2 ) > arg_0 . feasibility_tol ) & np . logical_not ( arg_5 . variable_fixed ) ) arg_7 = ( ( 1.0 - arg_0 . bounds_tol ) * arg_5 . variable_bounds - arg_1 ) [ : , arg_6 ] arg_7 = ( arg_7 / arg_2 [ arg_6 ] ) . flatten ( ) if arg_5 . bounds . shape [ 0 ] > 0 : arg_8 = arg_5 . inequalities . dot ( arg_2 ) arg_6 = np . abs ( arg_8 ) > arg_0 . feasibility_tol arg_9 = ( ( 1.0 - arg_0 . bounds_tol ) * arg_5 . bounds - arg_5 . inequalities . dot ( arg_1 ) ) [ : , arg_6 ] arg_9 = ( arg_9 / arg_8 [ arg_6 ] ) . flatten ( ) arg_10 = np . hstack ( [ arg_7 , arg_9 ] ) else : arg_10 = arg_7 arg_11 = arg_10 [ arg_10 > 0.0 ] arg_12 = arg_10 [ arg_10 <= 0.0 ] arg_13 = np . array ( [ arg_12 . max ( ) if len ( arg_12 ) > 0 else 0 , arg_11 . min ( ) if len ( arg_11 ) > 0 else 0 ] ) if arg_3 : arg_14 = arg_13 [ 0 ] + arg_3 * ( arg_13 [ 1 ] - arg_13 [ 0 ] ) else : arg_14 = np . random . uniform ( arg_13 [ 0 ] , arg_13 [ 1 ] ) arg_15 = arg_1 + arg_14 * arg_2 if ( np . any ( arg_0 . _bounds_dist ( arg_15 ) < - arg_0 . bounds_tol ) or np . abs ( np . abs ( arg_13 ) . max ( ) * arg_2 ) . max ( ) < arg_0 . bounds_tol ) : if arg_4 > MAX_TRIES : raise RuntimeError ( "Can not escape sampling region, model seems" " numerically unstable :( Reporting the " "model to " "https://github.com/opencobra/cobrapy/issues " "will help us to fix this :)" ) LOGGER . info ( "found bounds infeasibility in sample, " "resetting to center" ) arg_16 = arg_0 . warmup [ np . random . randint ( arg_0 . n_warmup ) ] arg_0 . retries += 1 return Func ( arg_0 , arg_0 . center , arg_16 - arg_0 . center , None , arg_4 + 1 ) return arg_15

Create a tuning job

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


Question: Helper to choose which expand_dims is_accepted and applies tf . where .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : def _expand_is_accepted_like ( arg_4 ) : with tf . compat . v1 . name_scope ( 'expand_is_accepted_like' ) : arg_5 = tf . concat ( [ tf . shape ( input = arg_0 ) , tf . ones ( [ tf . rank ( arg_4 ) - tf . rank ( arg_0 ) ] , dtype = tf . int32 ) , ] , axis = 0 ) arg_6 = tf . concat ( [ tf . ones ( [ tf . rank ( arg_0 ) ] , dtype = tf . int32 ) , tf . shape ( input = arg_4 ) [ tf . rank ( arg_0 ) : ] , ] , axis = 0 ) arg_7 = tf . tile ( tf . reshape ( arg_0 , arg_5 ) , arg_6 ) arg_7 . set_shape ( arg_7 . shape . merge_with ( arg_4 . shape ) ) return arg_7 def _where ( arg_1 , arg_2 ) : if arg_1 is arg_2 : return arg_1 arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_3 = 'accepted' ) arg_2 = tf . convert_to_tensor ( value = arg_2 , arg_3 = 'rejected' ) arg_8 = tf . where ( _expand_is_accepted_like ( arg_1 ) , arg_1 , arg_2 ) arg_8 . set_shape ( arg_8 . shape . merge_with ( arg_1 . shape . merge_with ( arg_2 . shape ) ) ) return arg_8 with tf . compat . v1 . name_scope ( arg_3 , 'choose' , values = [ arg_0 , arg_1 , arg_2 ] ) : if not is_list_like ( arg_1 ) : return _where ( arg_1 , arg_2 ) return [ ( choose ( arg_0 , arg_9 , arg_8 , arg_3 = arg_3 ) if is_namedtuple_like ( arg_9 ) else _where ( arg_9 , arg_8 ) ) for arg_9 , arg_8 in zip ( arg_1 , arg_2 ) ]

Collects memory stats for specified Python program.


Question: Parse response from QTM instances

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = RTheader . unpack_from ( arg_1 , 0 ) arg_5 , = struct . unpack_from ( "{0}s" . format ( arg_3 - 3 - 8 ) , arg_1 , RTheader . size ) arg_6 , = QRTDiscoveryBasePort . unpack_from ( arg_1 , arg_3 - 2 ) if arg_0 . receiver is not None : arg_0 . receiver ( QRTDiscoveryResponse ( arg_5 , arg_2 [ 0 ] , arg_6 ) )

Resets builder's state for building new documents.
        Must be called between usage with different documents.


Question: If a change occurs when we have a websocket connection active notify the websocket client of the change .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . root_object ( ) if isinstance ( arg_2 , Html ) : arg_3 = arg_1 [ 'name' ] arg_1 = { 'ref' : arg_0 . ref , 'type' : arg_1 [ 'type' ] , 'name' : arg_1 [ 'name' ] , 'value' : arg_1 [ 'value' ] } arg_2 . modified ( arg_1 )

Store a "populate failed" event.

        :param resource: The normalized name of the resource to store

        Example:

        >>> from bio2bel.models import Action
        >>> Action.store_populate_failed('hgnc')


Question: r Bartlett - Hann window

Expand all environment variables in an environment dict

    :param env: Environment dict


Question: Publish new deposit .

def Func ( arg_0 , arg_1 = None ) : arg_2 = current_pidstore . minters [ current_app . config [ 'DEPOSIT_PID_MINTER' ] ] arg_1 = arg_1 or uuid . uuid4 ( ) arg_3 = arg_2 ( arg_1 , arg_0 ) arg_0 [ '_deposit' ] [ 'pid' ] = { 'type' : arg_3 . pid_type , 'value' : arg_3 . pid_value , 'revision_id' : 0 , } arg_4 = dict ( arg_0 . dumps ( ) ) arg_4 [ '$schema' ] = arg_0 . record_schema with arg_0 . _process_files ( arg_1 , arg_4 ) : arg_5 = arg_0 . published_record_class . create ( arg_4 , arg_1 = arg_1 ) return arg_5

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: Return a list of notification templates .

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_0 . _separate ( arg_2 ) return super ( Resource , arg_0 ) . Func ( arg_1 = arg_1 , ** arg_2 )

Sets byte if not greater.

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


Question: Returns a list of Task objects with the given state .

def Func ( arg_0 , arg_1 = arg_2 . ANY_MASK ) : return [ arg_4 for arg_4 in arg_2 . Iterator ( arg_0 . task_tree , arg_1 ) ]

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


Question: Remove node with given id .

def Func ( arg_0 , arg_1 ) : if arg_0 . has_key ( arg_1 ) : arg_2 = arg_0 [ arg_1 ] arg_0 . nodes . remove ( arg_2 ) del arg_0 [ arg_1 ] for arg_3 in list ( arg_0 . edges ) : if arg_2 in ( arg_3 . node1 , arg_3 . node2 ) : if arg_2 in arg_3 . node1 . links : arg_3 . node1 . links . remove ( arg_2 ) if arg_2 in arg_3 . node2 . links : arg_3 . node2 . links . remove ( arg_2 ) arg_0 . edges . remove ( arg_3 )

main execution loop. query weather data and post to online service.


Question: This calculates the residual and chi - sq values for a Legendre function fit .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 10 ) : try : arg_4 = Legendre . fit ( arg_0 , arg_1 , arg_3 ) arg_5 = arg_4 ( arg_0 ) except Exception as e : arg_5 = npzeros_like ( arg_1 ) arg_6 = npsum ( ( ( arg_5 - arg_1 ) * ( arg_5 - arg_1 ) ) / ( arg_2 * arg_2 ) ) arg_7 = arg_3 + 1 arg_8 = arg_6 / ( len ( arg_1 ) - arg_7 - 1 ) LOGINFO ( 'legendre detrend applied. chisq = %.5f, reduced chisq = %.5f' % ( arg_6 , arg_8 ) ) return arg_5 , arg_6 , arg_8

Overriding the default JSONEncoder.default for NDB support.


Question: Creates an array like a with all values set to 0 except one .

def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = np . zeros_like ( arg_0 ) arg_3 [ arg_1 ] = arg_2 return arg_3

Creates a layer from its config.

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

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

    Returns:
      layer: A layer instance.


Question: Retrive the topic with topic_id identifier .

def Func ( arg_0 , arg_1 ) : arg_2 = { arg_0 . PKEY : arg_0 . api_key } arg_3 = arg_0 . _call ( arg_0 . TOPIC , arg_1 , arg_2 = arg_2 ) return arg_3


Question: This downloads a DSS FITS stamp centered on the coordinates specified .

def Func ( arg_0 , arg_1 , arg_2 = 'DSS2 Red' , arg_3 = 'Linear' , arg_4 = True , arg_5 = None , arg_6 = False , arg_7 = '~/.astrobase/stamp-cache' , arg_8 = 10.0 , arg_9 = False , arg_10 = True , arg_11 = False ) : arg_12 = get_stamp ( arg_0 , arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_11 = arg_11 ) if arg_12 : arg_13 = pyfits . open ( arg_12 [ 'fitsfile' ] ) arg_14 = arg_13 [ 0 ] . header arg_15 = arg_13 [ 0 ] . data arg_13 . close ( ) if arg_4 : arg_15 = np . flipud ( arg_15 ) if arg_11 : LOGINFO ( 'fetched stamp successfully for (%.3f, %.3f)' % ( arg_0 , arg_1 ) ) if arg_5 : arg_16 = aconv . convolve ( arg_15 , arg_5 ) if arg_10 : return arg_16 , arg_14 else : return arg_16 else : if arg_10 : return arg_15 , arg_14 else : return arg_15 else : LOGERROR ( 'could not fetch the requested stamp for ' 'coords: (%.3f, %.3f) from survey: %s and scaling: %s' % ( arg_0 , arg_1 , arg_2 , arg_3 ) ) return None

Removes a player from the current players.


Question: Fetch the pull requests

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . client . pulls ( arg_1 = arg_1 ) for arg_4 in arg_3 : arg_5 = json . loads ( arg_4 ) if str_to_datetime ( arg_5 [ 'updated_at' ] ) > arg_2 : return arg_0 . __init_extra_pull_fields ( arg_5 ) for arg_6 in TARGET_PULL_FIELDS : if not arg_5 [ arg_6 ] : continue if arg_6 == 'user' : arg_5 [ arg_6 + '_data' ] = arg_0 . __get_user ( arg_5 [ arg_6 ] [ 'login' ] ) elif arg_6 == 'merged_by' : arg_5 [ arg_6 + '_data' ] = arg_0 . __get_user ( arg_5 [ arg_6 ] [ 'login' ] ) elif arg_6 == 'review_comments' : arg_5 [ arg_6 + '_data' ] = arg_0 . __get_pull_review_comments ( arg_5 [ 'number' ] ) elif arg_6 == 'requested_reviewers' : arg_5 [ arg_6 + '_data' ] = arg_0 . __get_pull_requested_reviewers ( arg_5 [ 'number' ] ) elif arg_6 == 'commits' : arg_5 [ arg_6 + '_data' ] = arg_0 . __get_pull_commits ( arg_5 [ 'number' ] ) yield arg_5

Overriding the default JSONEncoder.default for NDB support.


Question: Converts from HH MM SS to a decimal value .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if arg_0 > 24 : return None else : arg_4 = fabs ( arg_0 ) + fabs ( arg_1 ) / 60.0 + fabs ( arg_2 ) / 3600.0 if arg_3 : arg_5 = arg_4 * 15.0 if arg_5 < 0 : arg_5 = arg_5 + 360.0 arg_5 = arg_5 % 360.0 return arg_5 else : return arg_4

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: Given a string or a list will return true if the last word or element is a digit . sep is used when a string is given to know what separates one word from another .

def Func ( arg_0 , arg_1 = "_" ) : if isinstance ( arg_0 , ( tuple , list ) ) : arg_2 = len ( arg_0 ) if arg_2 : return six . text_type ( arg_0 [ - 1 ] ) . isdigit ( ) else : return False else : return Func ( arg_0 . split ( arg_1 ) )

Adjust contrast of an Image.

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

    Returns:
        PIL Image: Contrast adjusted image.


Question: Decorator to allow a simple logging configuration .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def new_func ( arg_1 , * arg_2 , ** arg_3 ) : if use_simple_logging ( arg_3 ) : if 'log_config' in arg_3 : raise ValueError ( 'Please do not specify `log_config` ' 'if you want to use the simple ' 'way of providing logging configuration ' '(i.e using `log_folder`, `logger_names` and/or `log_levels`).' ) _change_logging_kwargs ( arg_3 ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return new_func


Question: Decorated methods progress will be displayed to the user as a spinner . Mostly for slower functions that do some network IO .

def Func ( arg_0 = "" , arg_1 = "Please wait" ) : def decorator ( arg_2 ) : @ functools . wraps ( arg_2 ) def wrapper ( * arg_3 , ** arg_4 ) : arg_5 = Spinner ( arg_0 = arg_0 , arg_1 = arg_1 ) arg_5 . start ( ) arg_6 = None try : arg_6 = arg_2 ( * arg_3 , ** arg_4 ) except Exception as e : arg_5 . msg = "Something went wrong: " arg_5 . stop_spinning ( ) arg_5 . join ( ) raise e arg_5 . stop_spinning ( ) arg_5 . join ( ) return arg_6 return wrapper return decorator

Main executor of the trimmomatic_report template.

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


Question: Load the projects config data from local path

def Func ( arg_0 ) : arg_1 = { } arg_2 = os . path . expanduser ( arg_0 . path ) if not os . path . isdir ( arg_2 ) : return arg_1 logger . debug ( "Load project configs from %s" , arg_2 ) for arg_3 in os . listdir ( arg_2 ) : arg_4 = os . path . splitext ( arg_3 ) if arg_4 [ 1 ] [ 1 : ] != PROJECT_CONFIG_EXTENSION : continue arg_5 = arg_4 [ 0 ] try : arg_6 = os . path . join ( arg_2 , arg_3 ) with open ( arg_6 ) as f : arg_7 = yaml . Func ( f ) arg_1 [ arg_5 ] = arg_7 except ValueError : continue logger . debug ( "Project '{}' config readed from {}" . format ( arg_5 , arg_6 ) ) return arg_1

Set the rotation of this body using a rotation matrix.

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


Question: Downloads all variable star observations by a given observer .

def Func ( arg_0 ) : arg_1 = 1 arg_2 = [ ] while True : logger . info ( 'Downloading page %d...' , arg_1 ) arg_3 = requests . get ( WEBOBS_RESULTS_URL , params = { 'obscode' : arg_0 , 'num_results' : 200 , 'obs_types' : 'all' , 'page' : arg_1 , } ) logger . debug ( arg_3 . request . url ) arg_4 = WebObsResultsParser ( arg_3 . text ) arg_2 . extend ( arg_4 . get_observations ( ) ) if '>Next</a>' not in arg_3 . text : break arg_1 += 1 return arg_2

Call the segmenter in order to split text in sentences.

        Args:
            text (str): Text to be segmented.

        Returns:
            dict, int: A dict containing a list of dicts with the offsets of
                each sentence; an integer representing the response code.


Question: This does a cross - match with TIC .

def Func ( arg_0 , arg_1 , arg_2 = 5.0 , arg_3 = 'v0' , arg_4 = False , arg_5 = '~/.astrobase/mast-cache' , arg_6 = True , arg_7 = 90.0 , arg_8 = 5.0 , arg_9 = 180.0 , arg_10 = 3 , arg_11 = 5.0 , arg_12 = False ) : arg_13 = 'Mast.Tic.Crossmatch' arg_14 = { 'fields' : [ { 'name' : 'ra' , 'type' : 'float' } , { 'name' : 'dec' , 'type' : 'float' } ] } arg_14 [ 'data' ] = [ { 'ra' : x , 'dec' : y } for ( x , y ) in zip ( arg_0 , arg_1 ) ] arg_15 = { 'raColumn' : 'ra' , 'decColumn' : 'dec' , 'radius' : arg_2 / 3600.0 } return mast_query ( arg_13 , arg_15 , data = arg_14 , arg_11 = arg_11 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_12 = arg_12 )

Stop streaming samples from device and delete samples buffer


Question: Find lines in home that are inspectable . Walk back from the err line up to 3 lines but don t walk back over changes in indent level .

def Func ( arg_0 , arg_1 ) : arg_2 = re . compile ( r'\\[\s\n]*$' ) arg_3 = re . compile ( r':[\s\n]*$' ) arg_4 = re . compile ( r'^(\s*)' ) arg_5 = [ ] arg_6 = arg_0 [ arg_1 ] arg_7 = arg_4 . match ( arg_6 ) . groups ( ) [ 0 ] arg_8 = arg_0 [ max ( arg_1 - 3 , 0 ) : arg_1 ] arg_8 . reverse ( ) arg_9 = arg_0 [ arg_1 + 1 : min ( arg_1 + 4 , len ( arg_0 ) ) ] for arg_10 in arg_8 : if arg_4 . match ( arg_10 ) . groups ( ) [ 0 ] == arg_7 : arg_5 . append ( arg_10 ) else : break arg_5 . reverse ( ) arg_5 . append ( arg_6 ) arg_11 = len ( arg_5 ) - 1 arg_12 = arg_2 . search ( arg_6 ) for arg_10 in arg_9 : if ( ( arg_12 or arg_4 . match ( arg_10 ) . groups ( ) [ 0 ] == arg_7 ) and not arg_3 . search ( arg_10 ) ) : arg_5 . append ( arg_10 ) arg_12 = arg_2 . search ( arg_10 ) else : break log . debug ( "Inspecting lines '''%s''' around %s" , arg_5 , arg_11 ) return arg_5 , arg_11


Question: Flush to this and the redirected stream

def Func ( arg_0 ) : if arg_0 . redirect is not None : arg_0 . redirect . Func ( ) super ( TeeStringIO , arg_0 ) . Func ( )

Provide a label for a list of labels.

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

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

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

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

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

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

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

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


Question: Returns the representation of logical plan that will be returned from Tracker .

def Func ( arg_0 , arg_1 ) : arg_2 = { "spouts" : { } , "bolts" : { } , } for arg_3 in arg_1 . spouts ( ) : arg_4 = arg_3 . comp . name arg_5 = "default" arg_6 = "NA" arg_7 = "NA" arg_8 = arg_3 . comp . config . kvs for arg_9 in arg_8 : if arg_9 . key == "spout.type" : arg_5 = javaobj . loads ( arg_9 . serialized_value ) elif arg_9 . key == "spout.source" : arg_6 = javaobj . loads ( arg_9 . serialized_value ) elif arg_9 . key == "spout.version" : arg_7 = javaobj . loads ( arg_9 . serialized_value ) arg_10 = { "config" : convert_pb_kvs ( arg_8 , include_non_primitives = False ) , "type" : arg_5 , "source" : arg_6 , "version" : arg_7 , "outputs" : [ ] } for arg_11 in list ( arg_3 . outputs ) : arg_10 [ "outputs" ] . append ( { "stream_name" : arg_11 . stream . id } ) arg_2 [ "spouts" ] [ arg_4 ] = arg_10 for arg_12 in arg_1 . bolts ( ) : arg_13 = arg_12 . comp . name arg_14 = { "config" : convert_pb_kvs ( arg_12 . comp . config . kvs , include_non_primitives = False ) , "outputs" : [ ] , "inputs" : [ ] } for arg_11 in list ( arg_12 . outputs ) : arg_14 [ "outputs" ] . append ( { "stream_name" : arg_11 . stream . id } ) for arg_15 in list ( arg_12 . inputs ) : arg_14 [ "inputs" ] . append ( { "stream_name" : arg_15 . stream . id , "component_name" : arg_15 . stream . component_name , "grouping" : topology_pb2 . Grouping . Name ( arg_15 . gtype ) } ) arg_2 [ "bolts" ] [ arg_13 ] = arg_14 return arg_2

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


Question: Get the user s umask .

def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_1 and run_as_root or arg_0 . run return arg_2 ( 'Func' )

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Return a list of all enrollments for the passed section sis id .

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_enrollments_for_section ( arg_0 . _sis_id ( arg_1 , sis_field = "section" ) , arg_2 )


Question: Create new storage service client .

def Func ( arg_0 , arg_1 , arg_2 = 'prod' ) : arg_3 = ApiClient . Func ( arg_1 , arg_2 ) return arg_0 ( arg_3 )

Clip input array with a vector list.

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

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


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

def Func ( arg_0 ) : def decorator ( arg_1 ) : @ functools . wraps ( arg_1 ) def wrapper ( arg_2 , arg_3 ) : arg_3 = arg_3 or [ ] for arg_4 in arg_3 : arg_5 = arg_3 [ arg_4 ] if isinstance ( arg_4 , str ) else arg_4 arg_5 . redshift = arg_5 . redshift or conf . instance . general . get ( "redshift" , arg_0 , float ) return arg_1 ( arg_2 , arg_3 ) return wrapper return decorator


Question: Shortcut function to create a cookie

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : return http . cookiejar . Cookie ( 0 , arg_4 , arg_5 , None , False , arg_0 , arg_0 . startswith ( '.' ) , arg_0 . startswith ( '.' ) , arg_1 , True , arg_2 , arg_3 , False , None , None , { } )

Equivalent to map, compatibility purpose only.
        Column parameter ignored.


Question: Learn the linear transformation to flipped eigenvalues .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_1 . shape [ 0 ] if arg_1 . shape != ( arg_3 , arg_3 ) : raise TypeError ( "Input must be a square matrix." ) arg_4 = get_memory ( arg_0 . memory ) arg_5 , arg_6 = arg_4 . cache ( scipy . linalg . eigh , ignore = [ 'overwrite_a' ] ) ( arg_1 , overwrite_a = not arg_0 . copy ) arg_5 = arg_5 [ : , None ] arg_0 . flip_ = np . dot ( arg_6 , np . sign ( arg_5 ) * arg_6 . T ) return arg_0

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


Question: compute centrality score of sentences .

def Func ( arg_0 , arg_1 = False , arg_2 = 0.1 , arg_3 = 0.9 , arg_4 = False , arg_5 = 0.25 ) : arg_6 = { 'max_iter' : 1000 } if arg_4 : arg_7 = divrank_scipy arg_6 [ 'alpha' ] = arg_5 arg_6 [ 'd' ] = arg_3 else : arg_7 = networkx . pagerank_scipy arg_6 [ 'alpha' ] = arg_3 arg_8 = networkx . DiGraph ( ) arg_9 = [ ] for arg_10 in arg_0 : arg_11 = tools . word_segmenter_ja ( arg_10 ) arg_12 = collections . Counter ( arg_11 ) arg_9 . append ( arg_12 ) arg_13 = DictVectorizer ( sparse = True ) arg_14 = arg_13 . fit_transform ( arg_9 ) arg_15 = 1 - pairwise_distances ( arg_14 , arg_14 , metric = 'cosine' ) if arg_1 : arg_16 , arg_17 = numpy . where ( arg_15 > 0 ) else : arg_16 , arg_17 = numpy . where ( arg_15 >= arg_2 ) arg_8 . add_nodes_from ( range ( arg_14 . shape [ 0 ] ) ) for arg_18 , arg_19 in zip ( arg_16 , arg_17 ) : if arg_18 == arg_19 : continue arg_20 = arg_15 [ arg_18 , arg_19 ] if arg_1 else 1.0 arg_8 . add_edge ( arg_18 , arg_19 , { 'weight' : arg_20 } ) arg_21 = arg_7 ( arg_8 , ** arg_6 ) return arg_21 , arg_15

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 whether where function type arguments are expected .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . elided [ arg_1 ] return ( Match ( r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(' , arg_2 ) or ( arg_1 >= 2 and ( Match ( r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$' , arg_0 . elided [ arg_1 - 1 ] ) or Match ( r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$' , arg_0 . elided [ arg_1 - 2 ] ) or Search ( r'\bstd::m?function\s*\<\s*$' , arg_0 . elided [ arg_1 - 1 ] ) ) ) )


Question: Removes a link from disk

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . _trajectory_name + '/' + arg_1 . replace ( '.' , '/' ) arg_3 = arg_0 . _hdf5file . get_node ( where = arg_2 ) arg_3 . _f_remove ( )

Inform the widget about the encoding of the underlying character stream.


Question: Starts a swarm given a path to a JSON file containing configuration .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if "verbosityCount" in arg_1 : arg_4 = arg_1 [ "verbosityCount" ] del arg_1 [ "verbosityCount" ] else : arg_4 = 1 _setupInterruptHandling ( ) with open ( arg_0 , "r" ) as jsonFile : arg_5 = json . loads ( jsonFile . read ( ) ) arg_6 = os . path . dirname ( arg_0 ) return runWithConfig ( arg_5 , arg_1 , arg_6 = arg_6 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )


Question: Add a linked file .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : if arg_3 is None : arg_3 = arg_0 . MIMES [ arg_1 . split ( '.' ) [ - 1 ] ] arg_0 . media_descriptors . append ( { 'MEDIA_URL' : arg_1 , 'RELATIVE_MEDIA_URL' : arg_2 , 'MIME_TYPE' : arg_3 , 'TIME_ORIGIN' : arg_4 , 'EXTRACTED_FROM' : arg_5 } )


Question: Determine the geometry of the rectangular grid by overlaying it over a grid of coordinates such that its \ outer - most pixels align with the grid s outer most coordinates plus a small buffer .

def Func ( arg_0 , arg_1 , arg_2 = 1e-8 ) : arg_3 = np . min ( arg_1 [ : , 0 ] ) - arg_2 arg_4 = np . max ( arg_1 [ : , 0 ] ) + arg_2 arg_5 = np . min ( arg_1 [ : , 1 ] ) - arg_2 arg_6 = np . max ( arg_1 [ : , 1 ] ) + arg_2 arg_7 = ( float ( ( arg_4 - arg_3 ) / arg_0 . shape [ 0 ] ) , float ( ( arg_6 - arg_5 ) / arg_0 . shape [ 1 ] ) ) arg_8 = ( ( arg_4 + arg_3 ) / 2.0 , ( arg_6 + arg_5 ) / 2.0 ) arg_9 , arg_10 = arg_0 . neighbors_from_pixelization ( ) return arg_0 . Geometry ( shape = arg_0 . shape , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 )

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

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

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


Question: Creates all the zookeeper state_managers and returns them in a list

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . get_state_locations_of_type ( "zookeeper" ) for arg_3 in arg_2 : arg_4 = arg_3 [ 'name' ] arg_5 = arg_3 [ 'hostport' ] arg_6 = [ ] for arg_7 in arg_5 . split ( ',' ) : arg_8 = None arg_9 = None if ':' in arg_5 : arg_10 = arg_7 . split ( ':' ) if len ( arg_10 ) == 2 : arg_8 = arg_10 [ 0 ] arg_9 = int ( arg_10 [ 1 ] ) if not arg_8 or not arg_9 : raise Exception ( "Hostport for %s must be of the format 'host:port'." % ( arg_4 ) ) arg_6 . append ( ( arg_8 , arg_9 ) ) arg_11 = arg_3 [ 'tunnelhost' ] arg_12 = arg_3 [ 'rootpath' ] LOG . info ( "Connecting to zk hostports: " + str ( arg_6 ) + " rootpath: " + arg_12 ) arg_13 = ZkStateManager ( arg_4 , arg_6 , arg_12 , arg_11 ) arg_1 . append ( arg_13 ) return arg_1


Question: Compute daily risk factor exposures .

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : if arg_2 : arg_0 = _stack_positions ( arg_0 , arg_3 = arg_3 ) return ep . Func ( arg_0 , arg_1 )

Unlock a message for processing by other receivers on a given
        subscription. This operation deletes the lock object, causing the
        message to be unlocked. A message must have first been locked by a
        receiver before this operation is called.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        sequence_number:
            The sequence number of the message to be unlocked as returned in
            BrokerProperties['SequenceNumber'] by the Peek Message operation.
        lock_token:
            The ID of the lock as returned by the Peek Message operation in
            BrokerProperties['LockToken']