def Func ( arg_0 ) : if not arg_0 or arg_0 . isspace ( ) : return arg_0 arg_1 = _ipy_prompt_re . match ( arg_0 ) if arg_1 : return arg_0 [ len ( arg_1 . group ( 0 ) ) : ] else : return arg_0

def Func(arg_0):
    """Handle inputs that start classic IPython prompt syntax."""

    if not arg_0 or arg_0.isspace():
        return arg_0
    #print 'LINE:  %r' % line # dbg
    arg_1 = _ipy_prompt_re.match(arg_0)
    if arg_1:
        #print 'MATCH! %r -> %r' % (line, line[len(m.group(0)):]) # dbg
        return arg_0[len(arg_1.group(0)):]
    else:
        return arg_0

Handle inputs that start classic IPython prompt syntax .


return "{mat_l}{mat_r}, ".format(mat_l=mat_l, mat_r=mat_r) + \
           "{tens_lin}{tens_r}->{tens_lout}{tens_r}".format(tens_lin=tens_lin,
                                                            tens_lout=tens_lout,
                                                            tens_r=tens_r)

def Func(arg_0, arg_1):
    """Return the index string for Numpy.eignsum matrix-matrix multiplication.

    The returned indices are to perform a matrix multiplication A.B where
    the matrix A is an M-qubit matrix, matrix B is an N-qubit matrix, and
    M <= N, and identity matrices are implied on the subsystems where A has no
    support on B.

    Args:
        gate_indices (list[int]): the indices of the right matrix subsystems
                                   to contract with the left matrix.
        number_of_qubits (int): the total number of qubits for the right matrix.

    Returns:
        str: An indices string for the Numpy.einsum function.
    """

    arg_2, arg_3, arg_4, arg_5 = _Func_helper(arg_0,
                                                                    arg_1)

    # Right indices for the N-qubit input and output tensor
    arg_6 = ascii_uppercase[:arg_1]

    # Combine indices into matrix multiplication string format
    # for numpy.einsum function
    return "{mat_l}{mat_r}, ".format(arg_2=arg_2, arg_3=arg_3) + \
           "{tens_lin}{tens_r}->{tens_lout}{tens_r}".format(arg_4=arg_4,
                                                            arg_5=arg_5,
                                                            arg_6=arg_6)

Return the index string for Numpy . eignsum matrix - matrix multiplication .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = _init_pathinfo ( ) arg_2 = 1 else : arg_2 = 0 arg_0 , arg_3 = makepath ( arg_0 ) if not arg_3 in arg_1 : sys . path . append ( arg_0 ) try : arg_4 = os . listdir ( arg_0 ) except os . error : return arg_4 . sort ( ) for arg_5 in arg_4 : if arg_5 . endswith ( os . extsep + "pth" ) : addpackage ( arg_0 , arg_5 , arg_1 ) if arg_2 : arg_1 = None return arg_1

def Func(arg_0, arg_1=None):
    """Add 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'"""
    if arg_1 is None:
        arg_1 = _init_pathinfo()
        arg_2 = 1
    else:
        arg_2 = 0
    arg_0, arg_3 = makepath(arg_0)
    if not arg_3 in arg_1:
        sys.path.append(arg_0)        # Add path component
    try:
        arg_4 = os.listdir(arg_0)
    except os.error:
        return
    arg_4.sort()
    for arg_5 in arg_4:
        if arg_5.endswith(os.extsep + "pth"):
            addpackage(arg_0, arg_5, arg_1)
    if arg_2:
        arg_1 = None
    return arg_1

Add sitedir argument to sys . path if missing and handle . pth files in sitedir


def
Func
(
arg_0
)
:
try
:
logger
.
debug
(
" do_handshake()"
)
arg_0
.
_socket
.
do_handshake
(
)
except
ssl
.
SSLError
,
err
:
if
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_WANT_READ
:
arg_0
.
_tls_state
=
"want_read"
logger
.
debug
(
"   want_read"
)
arg_0
.
_state_cond
.
notify
(
)
return
elif
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_WANT_WRITE
:
arg_0
.
_tls_state
=
"want_write"
logger
.
debug
(
"   want_write"
)
arg_0
.
_write_queue
.
appendleft
(
TLSHandshake
)
return
else
:
raise
arg_0
.
_tls_state
=
"connected"
arg_0
.
_set_state
(
"connected"
)
arg_0
.
_auth_properties
[
'security-layer'
]
=
"TLS"
if
"tls-unique"
in
CHANNEL_BINDING_TYPES
:
try
:
arg_3
=
arg_0
.
_socket
.
get_channel_binding
(
"tls-unique"
)
except
ValueError
:
pass
else
:
arg_0
.
_auth_properties
[
'channel-binding'
]
=
{
"tls-unique"
:
arg_3
}
try
:
arg_4
=
arg_0
.
_socket
.
cipher
(
)
except
AttributeError
:
arg_4
=
"unknown"
arg_5
=
get_certificate_from_ssl_socket
(
arg_0
.
_socket
)
arg_0
.
event
(
TLSConnectedEvent
(
arg_4
,
arg_5
)
)

def Func(arg_0):
        """Continue a TLS handshake."""
        try:
            logger.debug(" do_handshake()")
            arg_0._socket.do_handshake()
        except ssl.SSLError, err:
            if err.args[0] == ssl.SSL_ERROR_WANT_READ:
                arg_0._tls_state = "want_read"
                logger.debug("   want_read")
                arg_0._state_cond.notify()
                return
            elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
                arg_0._tls_state = "want_write"
                logger.debug("   want_write")
                arg_0._write_queue.appendleft(TLSHandshake)
                return
            else:
                raise
        arg_0._tls_state = "connected"
        arg_0._set_state("connected")
        arg_0._auth_properties['security-layer'] = "TLS"
        if "tls-unique" in CHANNEL_BINDING_TYPES:
            try:
                # pylint: disable=E1103
                arg_3 = arg_0._socket.get_channel_binding("tls-unique")
            except ValueError:
                pass
            else:
                arg_0._auth_properties['channel-binding'] = {
                                                    "tls-unique": arg_3}
        try:
            arg_4 = arg_0._socket.cipher()
        except AttributeError:
            # SSLSocket.cipher doesn't work on PyPy
            arg_4 = "unknown"
        arg_5 = get_certificate_from_ssl_socket(arg_0._socket)
        arg_0.event(TLSConnectedEvent(arg_4, arg_5))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _image_re . search ( arg_1 ) if arg_2 : return arg_2 . group ( "stream_id" )

def Func(arg_0, arg_1):
        """Try to find a stream_id"""
        arg_2 = arg_0._image_re.search(arg_1)
        if arg_2:
            return arg_2.group("stream_id")


def Func ( arg_0 , arg_1 ) : arg_2 = itertools . chain . from_iterable ( [ [ ( arg_4 , run [ arg_4 ] ) for arg_4 in run ] for run in arg_1 ] ) arg_3 = defaultdict ( list ) for ( arg_4 , arg_5 ) in arg_2 : arg_3 [ arg_4 ] . append ( arg_5 ) return arg_3

def Func(arg_0,arg_1):
        """
        Returns a dictionary like object with the lists of values
        collapsed by their respective key. Useful to find varying vs
        constant keys and to find how fast keys vary.
        """
        # Collect (key, value) tuples as list of lists, flatten with chain
        arg_2 = itertools.chain.from_iterable(
            [[(arg_4, run[arg_4]) for arg_4 in run] for run in arg_1])
        arg_3 = defaultdict(list)
        for (arg_4,arg_5) in arg_2: arg_3[arg_4].append(arg_5)
        return arg_3

Returns a dictionary like object with the lists of values collapsed by their respective key . Useful to find varying vs constant keys and to find how fast keys vary .


def Func ( arg_0 , arg_1 = None ) : arg_2 = requests . get ( arg_0 , stream = True , timeout = 10 ) if arg_1 : arg_3 = arg_0 . rsplit ( '/' , 2 ) [ 1 ] + '-' + arg_0 . rsplit ( '/' , 1 ) [ 1 ] arg_4 = arg_3 . split ( '?' ) [ 0 ] arg_5 = os . path . join ( arg_1 , arg_4 ) arg_2 . raise_for_status ( ) with open ( arg_5 , 'wb' ) as data : arg_2 . raw . decode_content = True shutil . copyfileobj ( arg_2 . raw , data ) return arg_2 . raw

def Func(arg_0, arg_1=None):
        """
        Return a requested map from a robot.

        :return:
        """
        arg_2 = requests.get(arg_0, stream=True, timeout=10)

        if arg_1:
            arg_3 = arg_0.rsplit('/', 2)[1] + '-' + arg_0.rsplit('/', 1)[1]
            arg_4 = arg_3.split('?')[0]
            arg_5 = os.path.join(arg_1, arg_4)
            arg_2.raise_for_status()
            with open(arg_5, 'wb') as data:
                arg_2.raw.decode_content = True
                shutil.copyfileobj(arg_2.raw, data)

        return arg_2.raw


(job, bam, bai, validation_stringency='LENIENT')

def Func(arg_0, arg_1, arg_2, arg_3='LENIENT'):
    """
    Runs Picard MarkDuplicates on a BAM file. Requires that the BAM file be coordinate sorted.

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str bam: FileStoreID for BAM file
    :param str bai: FileStoreID for BAM index file
    :param str validation_stringency: BAM file validation stringency, default is LENIENT
    :return: FileStoreIDs for BAM and BAI files
    :rtype: tuple
    """
    arg_4 = arg_0.fileStore.getLocalTempDir()

    # Retrieve file path
    arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_4, 'sorted.bam'))
    arg_0.fileStore.readGlobalFile(arg_2, os.path.join(arg_4, 'sorted.bai'))

    # Call: picardtools
    arg_5 = ['MarkDuplicates',
               'INPUT=sorted.bam',
               'OUTPUT=mkdups.bam',
               'METRICS_FILE=metrics.txt',
               'ASSUME_SORTED=true',
               'CREATE_INDEX=true',
               'VALIDATION_STRINGENCY=%s' % arg_3.upper()]

    # picard-tools container doesn't have JAVA_OPTS variable
    # Set TMPDIR to /data to prevent writing temporary files to /tmp
    arg_6 = ['--rm',
                         '--log-driver', 'none',
                         '-e', 'JAVA_OPTIONS=-Djava.io.tmpdir=/data/ -Xmx{}'.format(arg_0.memory),
                         '-v', '{}:/data'.format(arg_4)]

    arg_7 = time.time()
    dockerCall(arg_0=arg_0, workDir=arg_4,
               parameters=arg_5,
               tool='quay.io/ucsc_cgl/picardtools:1.95--dd5ac549b95eb3e5d166a5e310417ef13651994e',
               dockerParameters=arg_6)
    arg_8 = time.time()
    _log_runtime(arg_0, arg_7, arg_8, "Picard MarkDuplicates")

    arg_1 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_4, 'mkdups.bam'))
    arg_2 = arg_0.fileStore.writeGlobalFile(os.path.join(arg_4, 'mkdups.bai'))
    return arg_1, arg_2

Runs Picard MarkDuplicates on a BAM file . Requires that the BAM file be coordinate sorted .


(poisson_noise_map_path, poisson_noise_map_hdu, pixel_scale,
                           convert_poisson_noise_map_from_weight_map,
                           convert_poisson_noise_map_from_inverse_noise_map,
                           poisson_noise_map_from_image,
                           image, exposure_time_map, convert_from_electrons, gain, convert_from_adus)

def Func(arg_0, arg_1, arg_2,
                           arg_3,
                           arg_4,
                           arg_5,
                           arg_6, arg_7, arg_8, arg_9, arg_10):
    """Factory for loading the Poisson noise-map from a .fits file.

    This factory also includes a number of routines for converting the Poisson noise-map from from other units (e.g. \
    a weight map) or computing the Poisson noise_map from other unblurred_image_1d (e.g. the ccd image).

    Parameters
    ----------
    poisson_noise_map_path : str
        The path to the poisson_noise_map .fits file containing the Poisson noise-map \
         (e.g. '/path/to/poisson_noise_map.fits')
    poisson_noise_map_hdu : int
        The hdu the poisson_noise_map is contained in the .fits file specified by *poisson_noise_map_path*.
    pixel_scale : float
        The size of each pixel in arc seconds.
    convert_poisson_noise_map_from_weight_map : bool
        If True, the Poisson noise-map loaded from the .fits file is converted from a weight-map to a noise-map (see \
        *NoiseMap.from_weight_map).
    convert_poisson_noise_map_from_inverse_noise_map : bool
        If True, the Poisson noise-map loaded from the .fits file is converted from an inverse noise-map to a \
        noise-map (see *NoiseMap.from_inverse_noise_map).
    poisson_noise_map_from_image : bool
        If True, the Poisson noise-map is estimated using the image.
    image : ndarray
        The image, which the Poisson noise-map can be calculated using.
    background_noise_map : ndarray
        The background noise-map, which the Poisson noise-map can be calculated using.
    exposure_time_map : ndarray
        The exposure-time map, which the Poisson noise-map can be calculated using.
    convert_from_electrons : bool
        If True, the input unblurred_image_1d are in units of electrons and all converted to electrons / second using the exposure \
        time map.
    gain : float
        The image gain, used for convert from ADUs.
    convert_from_adus : bool
        If True, the input unblurred_image_1d are in units of adus and all converted to electrons / second using the exposure \
        time map and gain.
    """
    arg_11 = sum([arg_3,
                                     arg_4,
                                     arg_5])

    if arg_11 == 0 and arg_0 is not None:
        return PoissonNoiseMap.from_fits_with_pixel_scale(file_path=arg_0, hdu=arg_1,
                                                          arg_2=arg_2)
    elif arg_5:

        if not (arg_8 or arg_10) and arg_7 is None:
            raise exc.DataException('Cannot compute the Poisson noise-map from the image if an '
                                       'exposure-time (or exposure time map) is not supplied to convert to adus')

        if arg_10 and arg_9 is None:
            raise exc.DataException('Cannot compute the Poisson noise-map from the image if a'
                                       'gain is not supplied to convert from adus')

        return PoissonNoiseMap.from_image_and_exposure_time_map(arg_2=arg_2, arg_6=arg_6,
                                                                arg_7=arg_7,
                                                                arg_8=arg_8,
                                                                arg_9=arg_9,
                                                                arg_10=arg_10)

    elif arg_3 and arg_0 is not None:
        arg_12 = Array.from_fits(file_path=arg_0, hdu=arg_1)
        return PoissonNoiseMap.from_weight_map(arg_12=arg_12, arg_2=arg_2)
    elif arg_4 and arg_0 is not None:
        arg_13 = Array.from_fits(file_path=arg_0, hdu=arg_1)
        return PoissonNoiseMap.from_inverse_noise_map(arg_13=arg_13, arg_2=arg_2)
    else:
        return None

Factory for loading the Poisson noise - map from a . fits file .


def Func ( arg_0 ) : arg_1 = [ commerce . Cart . STATUS_PAID , commerce . Cart . STATUS_ACTIVE ] return arg_0 . _items ( arg_1 )

def Func(arg_0):
        ''' Returns the items that this user has purchased or has pending. '''
        arg_1 = [commerce.Cart.STATUS_PAID, commerce.Cart.STATUS_ACTIVE]
        return arg_0._items(arg_1)

Returns the items that this user has purchased or has pending .


(rec, tag, subfield_code, value, subfield_position,
                           field_position_global=None,
                           field_position_local=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                           arg_5=None,
                           arg_6=None):
    """Modify subfield at specified position.

    Specify the subfield by tag, field number and subfield position.
    """
    arg_7 = record_get_subfields(
        arg_0, arg_1,
        arg_5=arg_5,
        arg_6=arg_6)

    try:
        arg_7[arg_4] = (arg_2, arg_3)
    except IndexError:
        raise InvenioBibRecordFieldError(
            "There is no subfield with position '%d'." % arg_4)


def Func(arg_0):
        """Return the application-controlled IIN field."""
        arg_1 = opendnp3.ApplicationIIN()
        arg_1.configCorrupt = False
        arg_1.deviceTrouble = False
        arg_1.localControl = False
        arg_1.needTime = False
        # Just for testing purposes, convert it to an IINField and display the contents of the two bytes.
        arg_6 = arg_1.ToIIN()
        _log.debug('OutstationApplication.Func: IINField LSB={}, MSB={}'.format(arg_6.LSB,
                                                                                arg_6.MSB))
        return arg_1

Return the application - controlled IIN field .


def Func(arg_0, arg_1, arg_2):
        """return the array.array objects for the branch and its counter branch

        This method returns a pair of the array.array objects. The first one is
        for the given tree and branch name. The second one is for its counter
        branch. The second one will be None when the branch does not have a
        counter. A pair of None will be returned when the tree does not have
        the branch.

        """
        arg_3 = arg_0._getArray(arg_1, arg_2)
        if arg_3 is None: return None, None
        arg_4 = arg_0._getCounterArray(arg_1, arg_2)
        return arg_3, arg_4

return the array . array objects for the branch and its counter branch


(self, labels=None, ax=None, cmap=None, cdict=None, metric="euclidean")

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = "euclidean" ) : arg_6 = arg_0 . genotypes . to_n_alt ( ) arg_7 = allel . pairwise_distance ( arg_6 , arg_5 = arg_5 ) if not arg_2 : arg_8 = plt . figure ( figsize = ( 5 , 5 ) ) arg_2 = arg_8 . add_subplot ( 1 , 1 , 1 ) if isinstance ( arg_1 , bool ) : if arg_1 : arg_1 = list ( arg_0 . samples_vcforder ) elif isinstance ( arg_1 , type ( None ) ) : pass else : if not len ( arg_1 ) == len ( arg_0 . samples_vcforder ) : raise IPyradError ( LABELS_LENGTH_ERROR . format ( len ( arg_1 ) , len ( arg_0 . samples_vcforder ) ) ) allel . plot . pairwise_distance ( arg_7 , arg_1 = arg_1 , arg_2 = arg_2 , colorbar = False )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5="euclidean"):
        """
        Plot pairwise distances between all samples

        labels: bool or list
                by default labels aren't included. If labels == True, then labels are read in
                from the vcf file. Alternatively, labels can be passed in as a list, should
                be same length as the number of samples.
        """
        arg_6 = arg_0.genotypes.to_n_alt()
        arg_7 = allel.pairwise_distance(arg_6, arg_5=arg_5)
        if not arg_2:
            arg_8 = plt.figure(figsize=(5, 5))
            arg_2 = arg_8.add_subplot(1, 1, 1)

        if isinstance(arg_1, bool):
            if arg_1:
                arg_1 = list(arg_0.samples_vcforder)
        elif isinstance(arg_1, type(None)):
            pass
        else:
            ## If not bool or None (default), then check to make sure the list passed in
            ## is the right length
            if not len(arg_1) == len(arg_0.samples_vcforder):
                raise IPyradError(LABELS_LENGTH_ERROR.format(len(arg_1), len(arg_0.samples_vcforder)))

        allel.plot.pairwise_distance(arg_7, arg_1=arg_1, arg_2=arg_2, colorbar=False)


def Func(arg_0,arg_1,arg_2,**arg_3):
    '''
    Calculate f_ON, and f_OFF as defined in van Straten et al. 2012 equations 2 and 3

    Parameters
    ----------
    calON_obs : str
        Path to filterbank file (any format) for observation ON the calibrator source
    calOFF_obs : str
        Path to filterbank file (any format) for observation OFF the calibrator source
    '''
    #Calculate noise diode ON and noise diode OFF spectra (H and L) for both observations
    arg_4,arg_5 = integrate_calib(arg_0,arg_2,**arg_3)
    arg_6,arg_7 = integrate_calib(arg_1,arg_2,**arg_3)

    arg_8 = arg_5/arg_4-1
    arg_9 = arg_7/arg_6-1

    return arg_8, arg_9

Calculate f_ON and f_OFF as defined in van Straten et al . 2012 equations 2 and 3


(model, expression, name="abs_var", ub=None,
                            difference=0, add=True)

def Func(arg_0, arg_1, arg_2="abs_var", arg_3=None,
                            arg_4=0, arg_5=True):
    """Add the absolute value of an expression to the model.

    Also defines a variable for the absolute value that can be used in other
    objectives or constraints.

    Parameters
    ----------
    model : a cobra model
       The model to which to add the absolute expression.
    expression : A sympy expression
       Must be a valid expression within the Model's solver object. The
       absolute value is applied automatically on the expression.
    name : string
       The name of the newly created variable.
    ub : positive float
       The upper bound for the variable.
    difference : positive float
        The difference between the expression and the variable.
    add : bool
        Whether to add the variable to the model at once.

    Returns
    -------
    namedtuple
        A named tuple with variable and two constraints (upper_constraint,
        lower_constraint) describing the new variable and the constraints
        that assign the absolute value of the expression to it.
    """
    arg_6 = namedtuple('Components', ['variable', 'upper_constraint',
                                           'lower_constraint'])
    arg_7 = arg_0.problem.Variable(arg_2, lb=0, arg_3=arg_3)
    # The following constraints enforce variable > expression and
    # variable > -expression
    arg_8 = arg_0.problem.Constraint(arg_1 - arg_7,
                                                arg_3=arg_4,
                                                arg_2="abs_pos_" + arg_2),
    arg_9 = arg_0.problem.Constraint(arg_1 + arg_7,
                                                lb=arg_4,
                                                arg_2="abs_neg_" + arg_2)
    arg_10 = arg_6(arg_7, arg_8, arg_9)
    if arg_5:
        add_cons_vars_to_problem(arg_0, arg_10)
    return arg_10

Add the absolute value of an expression to the model .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = 'FromDictValidator' arg_2 = { } for arg_3 , arg_4 in six . iteritems ( arg_0 ) : arg_5 = arg_4 [ 'type' ] if arg_5 == DictField . FIELD_TYPE_NAME and isinstance ( arg_4 . get ( 'validator' ) , dict ) : arg_4 [ 'validator' ] = Func ( arg_4 [ 'validator' ] ) arg_2 [ arg_3 ] = create_field ( arg_4 ) arg_1 = force_str ( arg_1 ) return type ( arg_1 , ( Validator , ) , arg_2 )

def Func(arg_0, arg_1=None):
    """
    create a Validator instance from data_struct_dict

    :param data_struct_dict: a dict describe validator's fields, like the dict `to_dict()` method returned.
    :param name: name of Validator class

    :return: Validator instance
    """

    if arg_1 is None:
        arg_1 = 'FromDictValidator'
    arg_2 = {}
    for arg_3, arg_4 in six.iteritems(arg_0):
        arg_5 = arg_4['type']
        if arg_5 == DictField.FIELD_TYPE_NAME and isinstance(arg_4.get('validator'), dict):
            arg_4['validator'] = Func(arg_4['validator'])
        arg_2[arg_3] = create_field(arg_4)
    arg_1 = force_str(arg_1)
    return type(arg_1, (Validator, ), arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) . projects ( ) . locations ( ) . functions ( ) . delete ( arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) arg_3 = arg_2 [ "name" ] arg_0 . _wait_for_operation_to_complete ( arg_3 = arg_3 )

def Func(arg_0, arg_1):
        """
        Deletes the specified Cloud Function.

        :param name: The name of the function.
        :type name: str
        :return: None
        """
        arg_2 = arg_0.get_conn().projects().locations().functions().delete(
            arg_1=arg_1).execute(num_retries=arg_0.num_retries)
        arg_3 = arg_2["name"]
        arg_0._wait_for_operation_to_complete(arg_3=arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = os . environ . get ( arg_1 , '' ) if arg_2 : arg_0 . timid = ( '--timid' in arg_2 )

def Func(arg_0, arg_1):
        """Read configuration from the `env_var` environment variable."""
        # Timidity: for nose users, read an environment variable.  This is a
        # cheap hack, since the rest of the command line arguments aren't
        # recognized, but it solves some users' problems.
        arg_2 = os.environ.get(arg_1, '')
        if arg_2:
            arg_0.timid = ('--timid' in arg_2)

Read configuration from the env_var environment variable .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _plist += arg_0 . _generate ( arg_1 , arg_2 , box = arg_0 . box , rs = arg_0 . rs )

def Func(arg_0, arg_1, arg_2):
        """Add particles with diffusion coefficient `D` at random positions.
        """
        arg_0._plist += arg_0._generate(arg_1, arg_2, box=arg_0.box,
                                      rs=arg_0.rs)

Add particles with diffusion coefficient D at random positions .


def Func(arg_0, arg_1, arg_2):
        """Insert node as a child of the current node, before refNode in the
        list of child nodes. Raises ValueError if refNode is not a child of
        the current node"""
        arg_3 = arg_0.xml_children.index(arg_2)
        arg_0.xml_insert(arg_1, arg_3)

Insert node as a child of the current node before refNode in the list of child nodes . Raises ValueError if refNode is not a child of the current node


def Func ( arg_0 ) : arg_1 = ogr . Geometry ( ogr . wkbLinearRing ) for arg_2 in arg_0 . ll , arg_0 . lr , arg_0 . ur , arg_0 . ul , arg_0 . ll : arg_1 . AddPoint_2D ( * arg_2 ) arg_3 = ogr . Geometry ( ogr . wkbPolygon ) arg_3 . AddGeometryDirectly ( arg_1 ) return arg_3

def Func(arg_0):
        """Returns an OGR Geometry for this envelope."""
        arg_1 = ogr.Geometry(ogr.wkbLinearRing)
        for arg_2 in arg_0.ll, arg_0.lr, arg_0.ur, arg_0.ul, arg_0.ll:
            arg_1.AddPoint_2D(*arg_2)
        arg_3 = ogr.Geometry(ogr.wkbPolygon)
        arg_3.AddGeometryDirectly(arg_1)
        return arg_3

Returns an OGR Geometry for this envelope .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = triple_pb . Translation ( ) arg_4 = [ ] for arg_5 , arg_6 in arg_1 . items ( ) : arg_3 . entities . add ( element = arg_5 , arg_6 = arg_6 ) arg_7 = [ ] for arg_5 , arg_6 in arg_2 . items ( ) : arg_3 . relations . add ( element = arg_5 , arg_6 = arg_6 ) with open ( arg_0 , "wb" ) as f : f . write ( arg_3 . SerializeToString ( ) )

def Func(arg_0, arg_1, arg_2):
    """write triples into a translation file."""
    arg_3 = triple_pb.Translation()
    arg_4 = []
    for arg_5, arg_6 in arg_1.items():
        arg_3.entities.add(element=arg_5, arg_6=arg_6)
    arg_7 = []
    for arg_5, arg_6 in arg_2.items():
        arg_3.relations.add(element=arg_5, arg_6=arg_6)
    with open(arg_0, "wb") as f:
        f.write(arg_3.SerializeToString())


def Func ( arg_0 , arg_1 , arg_2 ) : if ( arg_1 , arg_2 ) not in arg_0 . bplist : return [ ] arg_3 = arg_0 . bplist [ ( arg_1 , arg_2 ) ] arg_4 = [ arg_5 . number for arg_5 in arg_3 ] for arg_5 in list ( arg_3 ) : arg_0 . delete_breakpoint ( arg_5 ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """Removes all breakpoints at a give filename and line number.
        Returns a list of breakpoints numbers deleted.
        """
        if (arg_1, arg_2) not in arg_0.bplist:
            return []
        arg_3 = arg_0.bplist[(arg_1, arg_2)]
        arg_4 = [arg_5.number for arg_5 in arg_3]
        for arg_5 in list(arg_3):
            arg_0.delete_breakpoint(arg_5)
        return arg_4

Removes all breakpoints at a give filename and line number . Returns a list of breakpoints numbers deleted .


def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
,
pd
.
DataFrame
)
:
if
isinstance
(
arg_0
,
list
)
:
arg_0
=
pd
.
DataFrame
(
arg_0
)
elif
isinstance
(
arg_0
,
(
np
.
generic
,
np
.
ndarray
)
)
:
arg_0
=
pd
.
DataFrame
(
arg_0
)
elif
isinstance
(
arg_0
,
csr_matrix
)
:
arg_0
=
pd
.
DataFrame
(
arg_0
.
todense
(
)
)
elif
isinstance
(
arg_0
,
pd
.
Series
)
:
arg_0
=
pd
.
DataFrame
(
arg_0
)
else
:
raise
ValueError
(
'Unexpected input type: %s'
%
(
str
(
type
(
arg_0
)
)
)
)
arg_0
=
arg_0
.
apply
(
lambda
x
:
pd
.
to_numeric
(
x
,
errors
=
'ignore'
)
)
return
arg_0

def Func(arg_0):
    """
    Unite data into a DataFrame.
    """
    if not isinstance(arg_0, pd.DataFrame):
        if isinstance(arg_0, list):
            arg_0 = pd.DataFrame(arg_0)
        elif isinstance(arg_0, (np.generic, np.ndarray)):
            arg_0 = pd.DataFrame(arg_0)
        elif isinstance(arg_0, csr_matrix):
            arg_0 = pd.DataFrame(arg_0.todense())
        elif isinstance(arg_0, pd.Series):
            arg_0 = pd.DataFrame(arg_0)
        else:
            raise ValueError('Unexpected input type: %s' % (str(type(arg_0))))

        arg_0 = arg_0.apply(lambda x: pd.to_numeric(x, errors='ignore'))

    return arg_0


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the CreateKeyPair request payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(CreateKeyPairRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0.is_tag_next(
                    arg_3.Tags.COMMON_TEMPLATE_ATTRIBUTE,
                    arg_6
            ):
                arg_0._common_template_attribute = objects.TemplateAttribute(
                    tag=arg_3.Tags.COMMON_TEMPLATE_ATTRIBUTE
                )
                arg_0._common_template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )
        else:
            if arg_0.is_tag_next(arg_3.Tags.COMMON_ATTRIBUTES, arg_6):
                arg_8 = objects.Attributes(
                    tag=arg_3.Tags.COMMON_ATTRIBUTES
                )
                arg_8.Func(arg_6, arg_2=arg_2)
                arg_0._common_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        arg_8
                    )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0.is_tag_next(
                    arg_3.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE,
                    arg_6
            ):
                arg_0._private_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=arg_3.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE
                    )
                arg_0._private_key_template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )
        else:
            if arg_0.is_tag_next(
                    arg_3.Tags.PRIVATE_KEY_ATTRIBUTES,
                    arg_6
            ):
                arg_8 = objects.Attributes(
                    tag=arg_3.Tags.PRIVATE_KEY_ATTRIBUTES
                )
                arg_8.Func(arg_6, arg_2=arg_2)
                arg_0._private_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        arg_8
                    )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0.is_tag_next(
                    arg_3.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE,
                    arg_6
            ):
                arg_0._public_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=arg_3.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE
                    )
                arg_0._public_key_template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )
        else:
            if arg_0.is_tag_next(
                    arg_3.Tags.PUBLIC_KEY_ATTRIBUTES,
                    arg_6
            ):
                arg_8 = objects.Attributes(
                    tag=arg_3.Tags.PUBLIC_KEY_ATTRIBUTES
                )
                arg_8.Func(arg_6, arg_2=arg_2)
                arg_0._public_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        arg_8
                    )

        arg_0.is_oversized(arg_6)

Read the data encoding the CreateKeyPair request payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a read method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

Read the data encoding the CreateKeyPair request payload and decode it into its constituent parts .


def Func ( arg_0 , arg_1 , ** arg_2 ) : if not issubclass ( arg_1 , Chooser ) : return arg_0 . register_simple_chooser ( arg_1 , ** arg_2 ) arg_0 . choosers [ arg_1 . model ] = arg_1 ( ** arg_2 ) return arg_1

def Func(arg_0, arg_1, **arg_2):
        """Adds a model chooser definition to the registry."""
        if not issubclass(arg_1, Chooser):
            return arg_0.register_simple_chooser(arg_1, **arg_2)

        arg_0.choosers[arg_1.model] = arg_1(**arg_2)
        return arg_1

Adds a model chooser definition to the registry .


def Func ( arg_0 , arg_1 , arg_2 = True ) : click . echo ( text_type ( arg_1 ) , nl = arg_2 , file = arg_0 . Func_file )

def Func(arg_0, arg_1, arg_2=True):
        """
        Writes the specified string to the Func target of the report.

        :param msg: the message to Func.
        :type msg: str
        :param newline:
            whether or not to append a newline to the end of the message
        :type newline: str
        """

        click.echo(text_type(arg_1), nl=arg_2, file=arg_0.Func_file)

Writes the specified string to the output target of the report.

        :param msg: the message to output.
        :type msg: str
        :param newline:
            whether or not to append a newline to the end of the message
        :type newline: str

Writes the specified string to the output target of the report .


(self, name, spout_cls, par, config=None, optional_outputs=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
    """Add a spout to the topology"""
    arg_6 = arg_2.spec(arg_1=arg_1, arg_3=arg_3, arg_4=arg_4,
                                arg_5=arg_5)
    arg_0.add_spec(arg_6)
    return arg_6


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) arg_3 = ( arg_2 . projects ( ) . runQuery ( projectId = arg_0 . project_id , arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_3 [ 'batch' ]

def Func(arg_0, arg_1):
        """
        Run a query for entities.

        .. seealso::
            https://cloud.google.com/datastore/docs/reference/rest/v1/projects/runQuery

        :param body: the body of the query request.
        :type body: dict
        :return: the batch of query results.
        :rtype: dict
        """
        arg_2 = arg_0.get_conn()

        arg_3 = (arg_2
                .projects()
                .runQuery(projectId=arg_0.project_id, arg_1=arg_1)
                .execute(num_retries=arg_0.num_retries))

        return arg_3['batch']


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
launch_args
is
not
:
arg_2
=
arg_0
.
review_args
(
arg_0
.
launch_args
,
show_repr
=
True
,
heading
=
'Meta Arguments'
)
if
not
arg_2
:
return
False
arg_3
=
[
arg_0
.
review_args
,
arg_0
.
review_command
,
arg_0
.
review_launcher
]
for
(
arg_4
,
arg_5
)
in
enumerate
(
arg_1
)
:
if
not
all
(
arg_6
(
arg_5
)
for
arg_6
in
arg_3
)
:
print
(
"\n == Aborting launch =="
)
return
False
if
len
(
arg_1
)
!=
1
and
arg_4
<
len
(
arg_1
)
1
:
arg_7
=
arg_0
.
input_options
(
[
'Y'
,
'n'
,
'quit'
]
,
'\nSkip remaining reviews?'
,
default
=
'y'
)
if
arg_7
==
'y'
:
break
elif
arg_7
==
'quit'
:
return
False
if
arg_0
.
input_options
(
[
'y'
,
'N'
]
,
'Execute?'
,
default
=
'n'
)
!=
'y'
:
return
False
else
:
return
arg_0
.
_launch_all
(
arg_1
)

def Func(arg_0, arg_1):
        """
        Runs the review process for all the launchers.
        """
        # Run review of launch args if necessary
        if arg_0.launch_args is not None:
            arg_2 = arg_0.review_args(arg_0.launch_args,
                                       show_repr=True,
                                       heading='Meta Arguments')
            if not arg_2: return False

        arg_3 = [arg_0.review_args,
                     arg_0.review_command,
                     arg_0.review_launcher]

        for (arg_4, arg_5) in enumerate(arg_1):

            # Run reviews for all launchers if desired...
            if not all(arg_6(arg_5) for arg_6 in arg_3):
                print("\n == Aborting launch ==")
                return False
            # But allow the user to skip these extra reviews
            if len(arg_1)!= 1 and arg_4 < len(arg_1)-1:
                arg_7 = arg_0.input_options(['Y', 'n','quit'],
                                 '\nSkip remaining reviews?', default='y')

                if arg_7 == 'y':          break
                elif arg_7 == 'quit':     return False

        if arg_0.input_options(['y','N'], 'Execute?', default='n') != 'y':
            return False
        else:
            return arg_0._launch_all(arg_1)

Runs the review process for all the launchers .


(s, directions, max_iter=2, run_length=2,
        damping=1e-3, collect_stats=False, marquardt_damping=True, **kwargs)

def Func(arg_0, arg_1, arg_2=2, arg_3=2,
        arg_4=1e-3, arg_5=False, arg_6=True, **arg_7):
    """
    Optimization of a state along a specific set of directions in parameter
    space.

    Parameters
    ----------
        s : :class:`peri.states.State`
            The state to optimize
        directions : np.ndarray
            [n,d] element numpy.ndarray of the n directions in the d-
            dimensional space to optimize along. `directions` is trans-
            formed to a unit vector internally
    Other Parameters
    ----------------
        Any parameters passed to LMEngine.
    """
    # normal = direction / np.sqrt(np.dot(direction, direction))
    arg_8 = np.array([d/np.sqrt(np.dot(d,d)) for d in arg_1])
    if np.isnan(arg_8).any():
        raise ValueError('`directions` must not be 0s or contain nan')
    arg_9 = OptState(arg_0, arg_8)
    arg_10 = LMOptObj(arg_9, arg_2=arg_2, arg_3=arg_3, arg_4=
            arg_4, arg_6=arg_6, **arg_7)
    arg_10.do_run_1()
    if arg_5:
        return arg_10.get_termination_stats()

Optimization of a state along a specific set of directions in parameter space .


(arrayed, mindepth_majrule, mindepth_statistical, estH, estE)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
    call all sites in a locus array.
    """

    ## an array to fill with consensus site calls
    arg_5 = np.zeros(arg_0.shape[1], dtype=np.uint8)
    arg_5.fill(78)
    arg_6 = arg_0.view(np.uint8)

    ## iterate over columns
    for arg_7 in xrange(arg_6.shape[1]):
        ## the site of focus
        arg_8 = arg_6[:, arg_7]

        ## make mask of N and - sites
        arg_9 = arg_8 == 45
        arg_9 += arg_8 == 78
        arg_10 = arg_8[~arg_9]

        ## skip if only empties (e.g., N-)
        if not arg_10.shape[0]:
            arg_5[arg_7] = 78

        ## skip if not variable
        elif np.all(arg_10 == arg_10[0]):
            arg_5[arg_7] = arg_10[0]

        ## estimate variable site call
        else:
            ## get allele freqs (first-most, second, third = p, q, r)
            arg_11 = np.bincount(arg_10)

            arg_12 = np.argmax(arg_11)
            arg_13 = arg_11[arg_12]
            arg_11[arg_12] = 0

            arg_14 = np.argmax(arg_11)
            arg_15 = arg_11[arg_14]
            arg_11[arg_14] = 0

            arg_16 = np.argmax(arg_11)
            arg_17 = arg_11[arg_16]

            ## based on biallelic depth
            arg_18 = arg_13 + arg_15
            if arg_18 < arg_1:
                arg_5[arg_7] = 78

            else:
                ## if depth is too high, reduce to sampled int
                if arg_18 > 500:
                    arg_19 = int(500 * (arg_13 / float(arg_18)))
                    arg_20 = int(500 * (arg_15 / float(arg_18)))
                else:
                    arg_19 = arg_13
                    arg_20 = arg_15

                ## make statistical base call
                if arg_18 >= arg_2:
                    arg_21, arg_22 = get_binom(arg_19, arg_20, arg_4, arg_3)
                    #LOGGER.info("ishet, prob, b1, b2: %s %s %s %s", ishet, prob, base1, base2)
                    if arg_22 < 0.95:
                        arg_5[arg_7] = 78
                    else:
                        if arg_21:
                            arg_5[arg_7] = TRANS[(arg_12, arg_14)]
                        else:
                            arg_5[arg_7] = arg_12

                ## make majrule base call
                else: #if bidepth >= mindepth_majrule:
                    if arg_13 == arg_15:
                        arg_5[arg_7] = TRANS[(arg_12, arg_14)]
                    else:
                        arg_5[arg_7] = arg_12
    return arg_5.view("S1")


def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'writing %d bytes chunk'
,
len
(
arg_1
)
)
arg_2
=
BLOCK_START
+
chr
(
len
(
arg_1
)
)
+
arg_1
if
len
(
arg_1
)
<
128
:
arg_3
=
128
len
(
arg_1
)
log
.
debug
(
'pad with %d characters'
,
arg_3
)
arg_2
=
arg_2
+
(
' '
*
arg_3
)
log
.
debug
(
"packet size %d"
,
len
(
arg_2
)
)
arg_0
.
__write
(
arg_2
)
arg_0
.
_port
.
flush
(
)
return
arg_0
.
__got_ack
(
)

def Func(arg_0, arg_1):
        """formats and sends a chunk of data to the device according
        to transfer protocol"""
        log.debug('writing %d bytes chunk', len(arg_1))
        arg_2 = BLOCK_START + chr(len(arg_1)) + arg_1
        if len(arg_1) < 128:
            arg_3 = 128 - len(arg_1)
            log.debug('pad with %d characters', arg_3)
            arg_2 = arg_2 + (' ' * arg_3)
        log.debug("packet size %d", len(arg_2))
        arg_0.__write(arg_2)
        arg_0._port.flush()
        return arg_0.__got_ack()


return {
        'clientData': websafe_encode(client_data),
        'signatureData': websafe_encode(response),
        'keyHandle': data['keyHandle']
    }

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
if
isinstance
(
arg_1
,
string_types
)
:
arg_1
=
json
.
loads
(
arg_1
)
if
arg_1
[
'version'
]
!=
VERSION
:
raise
ValueError
(
'Unsupported U2F version: %s'
%
arg_1
[
'version'
]
)
arg_4
=
arg_1
.
get
(
'appId'
,
arg_2
)
verify_facet
(
arg_4
,
arg_2
)
arg_5
=
sha256
(
arg_4
.
encode
(
'utf8'
)
)
.
digest
(
)
arg_6
=
websafe_decode
(
arg_1
[
'keyHandle'
]
)
arg_7
=
{
'typ'
:
'navigator.id.getAssertion'
,
'challenge'
:
arg_1
[
'challenge'
]
,
'origin'
:
arg_2
}
arg_7
=
json
.
dumps
(
arg_7
)
arg_8
=
sha256
(
arg_7
.
encode
(
'utf8'
)
)
.
digest
(
)
arg_9
=
arg_8
+
arg_5
+
int2byte
(
len
(
arg_6
)
)
+
arg_6
arg_10
=
0x07
if
arg_3
else
0x03
arg_11
=
0
arg_12
=
arg_0
.
send_apdu
(
INS_SIGN
,
arg_10
,
arg_11
,
arg_9
)
return
{
'clientData'
:
websafe_encode
(
arg_7
)
,
'signatureData'
:
websafe_encode
(
arg_12
)
,
'keyHandle'
:
arg_1
[
'keyHandle'
]
}

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """
    Signs an authentication challenge

    data = {
        'version': "U2F_V2",
        'challenge': websafe_encode(self.challenge),
        'appId': self.binding.app_id,
        'keyHandle': websafe_encode(self.binding.key_handle)
    }

    """

    if isinstance(arg_1, string_types):
        arg_1 = json.loads(arg_1)

    if arg_1['version'] != VERSION:
        raise ValueError('Unsupported U2F version: %s' % arg_1['version'])

    arg_4 = arg_1.get('appId', arg_2)
    verify_facet(arg_4, arg_2)
    arg_5 = sha256(arg_4.encode('utf8')).digest()

    arg_6 = websafe_decode(arg_1['keyHandle'])

    # Client data
    arg_7 = {
        'typ': 'navigator.id.getAssertion',
        'challenge': arg_1['challenge'],
        'origin': arg_2
    }
    arg_7 = json.dumps(arg_7)
    arg_8 = sha256(arg_7.encode('utf8')).digest()

    arg_9 = arg_8 + arg_5 + int2byte(
        len(arg_6)) + arg_6

    arg_10 = 0x07 if arg_3 else 0x03
    arg_11 = 0
    arg_12 = arg_0.send_apdu(INS_SIGN, arg_10, arg_11, arg_9)

    return {
        'clientData': websafe_encode(arg_7),
        'signatureData': websafe_encode(arg_12),
        'keyHandle': arg_1['keyHandle']
    }


def Func ( arg_0 ) : if sys . version_info [ 0 ] < 3 : return { arg_1 : arg_2 for arg_1 , arg_2 in arg_0 . iteritems ( ) if arg_2 is not None } else : return { arg_1 : arg_2 for arg_1 , arg_2 in arg_0 . items ( ) if arg_2 is not None }

def Func(arg_0):
    """Remove all keys with Nones as values

    >>> Func({'key': None})
    {}
    >>> Func({'empty_s': ''})
    {'empty_s': ''}
    """
    if sys.version_info[0] < 3:
        return {arg_1: arg_2 for arg_1, arg_2 in arg_0.iteritems() if arg_2 is not None}
    else:
        return {arg_1: arg_2 for arg_1, arg_2 in arg_0.items() if arg_2 is not None}

Remove all keys with Nones as values

    >>> clean_dict({'key': None})
    {}
    >>> clean_dict({'empty_s': ''})
    {'empty_s': ''}


def Func ( arg_0 ) : arg_1 = arg_0 ( ) arg_2 = { 'encode' : arg_1 . encode , 'decode' : arg_1 . decode , } if PY3 : arg_2 [ '_is_text_encoding' ] = False return CodecInfo ( ** arg_2 )

def Func(arg_0):
        """
        Returns information used by the codecs library to configure the
        codec for use.
        """
        arg_1 = arg_0()

        arg_2 = {
            'encode': arg_1.encode,
            'decode': arg_1.decode,
        }

        # In Python 2, all codecs are made equal.
        # In Python 3, some codecs are more equal than others.
        if PY3:
            arg_2['_is_text_encoding'] = False

        return CodecInfo(**arg_2)

Returns information used by the codecs library to configure the codec for use .


def Func ( arg_0 ) : arg_1 = subprocess . Popen ( arg_0 , stdout = subprocess . PIPE ) ( arg_2 , arg_3 ) = arg_1 . communicate ( ) return arg_2

def Func(arg_0):
    """
    Calls the command

    Parameters
    ----------
    cmd_args: list of str
        Command name to call and its arguments in a list.

    Returns
    -------
    Command output
    """
    arg_1 = subprocess.Popen(arg_0, stdout=subprocess.PIPE)
    (arg_2, arg_3) = arg_1.communicate()
    return arg_2


def Func ( arg_0 ) : with LiveExecution . lock : if arg_0 . edited_source : arg_1 = ast . parse ( arg_0 . edited_source ) for arg_2 in [ n for n in ast . walk ( arg_1 ) if isinstance ( n , ast . FunctionDef ) ] : arg_0 . ns [ arg_2 . name ] . __code__ = meta . decompiler . compile_func ( arg_2 , arg_0 . filename , arg_0 . ns ) . __code__

def Func(arg_0):
        """
        Replace functions in namespace with functions from edited_source.
        """
        with LiveExecution.lock:
            if arg_0.edited_source:
                arg_1 = ast.parse(arg_0.edited_source)
                for arg_2 in [n for n in ast.walk(arg_1) if isinstance(n, ast.FunctionDef)]:
                    arg_0.ns[arg_2.name].__code__ = meta.decompiler.compile_func(arg_2, arg_0.filename, arg_0.ns).__code__

Replace functions in namespace with functions from edited_source .


def Func ( arg_0 ) : arg_1 = None arg_2 = markdown . markdown ( arg_0 ) if arg_2 : arg_1 = html_to_text ( arg_0 ) return arg_1

def Func(arg_0):
    """ Converts markdown content to text """
    arg_1 = None
    arg_2 = markdown.markdown(arg_0)
    if arg_2:
        arg_1 = html_to_text(arg_0)
    return arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in enumerate ( arg_1 ) : arg_2 . append ( '(({})*({}))' . format ( arg_0 , arg_1 [ arg_3 ] ) ) return arg_2

def Func(arg_0, arg_1):
    """ Multiply vector by scalar"""
    arg_2 = []
    for arg_3, arg_4 in enumerate(arg_1):
        arg_2.append('(({})*({}))'.format(arg_0, arg_1[arg_3]))
    return arg_2


(self, cat, def_name, def_val, no_prune=False, gram_file="default")

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False , arg_5 = "default" ) : arg_0 . _rules_processed = False arg_0 . add_to_cat_group ( arg_1 , arg_5 , arg_2 ) if arg_4 : arg_0 . no_prunes . setdefault ( arg_1 , { } ) . setdefault ( arg_2 , True ) if arg_0 . _staged_defs is not None : arg_0 . _staged_defs . append ( ( arg_1 , arg_2 , arg_3 ) ) else : arg_0 . defs . setdefault ( arg_1 , { } ) . setdefault ( arg_2 , deque ( ) ) . append ( arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False, arg_5="default"):
        """Add a new rule definition named ``def_name`` having value ``def_value`` to
        the category ``cat``.

        :param str cat: The category to add the rule to
        :param str def_name: The name of the rule definition
        :param def_val: The value of the rule definition
        :param bool no_prune: If the rule should explicitly *NOT*
            be pruned even if it has been determined to be unreachable (default=``False``)
        :param str gram_file: The file the rule was defined in (default=``"default"``).
        """
        arg_0._rules_processed = False

        arg_0.add_to_cat_group(arg_1, arg_5, arg_2)

        if arg_4:
            arg_0.no_prunes.setdefault(arg_1, {}).setdefault(arg_2, True)

        if arg_0._staged_defs is not None:
            # if we're tracking changes during rule generation, add any new rules
            # to _staged_defs so they can be reverted if something goes wrong
            arg_0._staged_defs.append((arg_1, arg_2, arg_3))
        else:
            arg_0.defs.setdefault(arg_1, {}).setdefault(arg_2, deque()).append(arg_3)

Add a new rule definition named def_name having value def_value to the category cat .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . INFO . get ( arg_1 ) arg_3 = [ ] if arg_2 : if isinstance ( arg_2 , numbers . Number ) : arg_2 = ( arg_2 , ) for arg_4 in arg_2 : if arg_4 >= CONSERVATION [ arg_1 ] [ 'conserved_min' ] : arg_3 . append ( 'Conserved' ) else : arg_3 . append ( 'NotConserved' ) return arg_3

def Func(arg_0, arg_1):
    """Get the conservation prediction

        Args:
            variant(dict): A variant dictionary
            info_key(str)

        Returns:
            conservations(list): List of censervation terms
    """
    arg_2 = arg_0.INFO.get(arg_1)
    arg_3 = []

    if arg_2:
        if isinstance(arg_2, numbers.Number):
            arg_2 = (arg_2,)

        for arg_4 in arg_2:
            if arg_4 >= CONSERVATION[arg_1]['conserved_min']:
                arg_3.append('Conserved')
            else:
                arg_3.append('NotConserved')

    return arg_3


(self, hostname, port, use_ssl, tls_ctx=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Add an additional server to the server pool and return the
        freshly created server.

        Args:
            hostname (str): Hostname of the server
            port (int): Port of the server
            use_ssl (bool): True if SSL is to be used when connecting.
            tls_ctx (ldap3.Tls): An optional TLS context object to use
                when connecting.

        Returns:
            ldap3.Server: The freshly created server object.
        """
        if not arg_3 and arg_4:
            raise ValueError("Cannot specify a TLS context and not use SSL!")
        arg_5 = ldap3.Server(
            arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            tls=arg_4
        )
        arg_0._server_pool.add(arg_5)
        return arg_5

Add an additional server to the server pool and return the freshly created server .


def Func(arg_0, arg_1):
        """ Make preparations before running Tank """
        arg_0.options = arg_1
        if arg_0.options.get('lock_dir', None):
            arg_0.core.set_option(arg_0.core.SECTION, "lock_dir", arg_0.options['lock_dir'])
        if arg_0.options.get('ignore_lock', None):
            arg_0.core.set_option(arg_0.core.SECTION, 'ignore_lock', arg_0.options['ignore_lock'])

        while True:
            try:
                arg_0.core.get_lock()
                break
            except Exception as exc:
                if arg_0.options.get('lock_fail', None):
                    raise RuntimeError("Lock file present, cannot continue")
                arg_0.log.info(
                    "Couldn't get lock. Will retry in 5 seconds... (%s)",
                    str(exc))
                time.sleep(5)

        arg_2 = arg_0.get_default_configs()
        if arg_0.options.get('config', None):
            arg_2.append(arg_0.options['config'])
        arg_0.core.load_configs(arg_2)
        arg_0.__add_user_options()
        arg_0.core.load_plugins()

        if arg_0.options.get('ignore_lock', None):
            arg_0.core.set_option(arg_0.core.SECTION, arg_0.IGNORE_LOCKS, "1")


def
Func
(
*
arg_0
)
:
arg_1
=
set
(
)
for
arg_2
in
arg_0
:
arg_2
=
arg_2
.
lower
(
)
if
"*"
in
arg_2
:
for
arg_3
in
WEBHOOK_EVENT_TYPES
:
if
fnmatch
(
arg_3
,
arg_2
)
:
arg_1
.
add
(
arg_3
)
elif
arg_2
not
in
WEBHOOK_EVENT_TYPES
:
raise
ValueError
(
"Unknown webhook event: %r"
%
(
arg_2
)
)
else
:
arg_1
.
add
(
arg_2
)
def
decorator
(
arg_4
)
:
for
arg_2
in
arg_1
:
WEBHOOK_SIGNALS
[
arg_2
]
.
connect
(
arg_4
)
return
arg_4
return
decorator

def Func(*arg_0):
	"""
	Decorator that registers a function as a webhook handler.

	Usage examples:

	>>> # Hook a single event
	>>> @Func("payment.sale.completed")
	>>> def on_payment_received(event):
	>>>     payment = event.get_resource()
	>>>     print("Received payment:", payment)

	>>> # Multiple events supported
	>>> @Func("billing.subscription.suspended", "billing.subscription.cancelled")
	>>> def on_subscription_stop(event):
	>>>     subscription = event.get_resource()
	>>>     print("Stopping subscription:", subscription)

	>>> # Using a wildcard works as well
	>>> @Func("billing.subscription.*")
	>>> def on_subscription_update(event):
	>>>     subscription = event.get_resource()
	>>>     print("Updated subscription:", subscription)
	"""

	# First expand all wildcards and verify the event types are valid
	arg_1 = set()
	for arg_2 in arg_0:
		# Always convert to lowercase
		arg_2 = arg_2.lower()
		if "*" in arg_2:
			# expand it
			for arg_3 in WEBHOOK_EVENT_TYPES:
				if fnmatch(arg_3, arg_2):
					arg_1.add(arg_3)
		elif arg_2 not in WEBHOOK_EVENT_TYPES:
			raise ValueError("Unknown webhook event: %r" % (arg_2))
		else:
			arg_1.add(arg_2)

	# Now register them
	def decorator(arg_4):
		for arg_2 in arg_1:
			WEBHOOK_SIGNALS[arg_2].connect(arg_4)
		return arg_4

	return decorator

Decorator that registers a function as a webhook handler.

	Usage examples:

	>>> # Hook a single event
	>>> @webhook_handler("payment.sale.completed")
	>>> def on_payment_received(event):
	>>>     payment = event.get_resource()
	>>>     print("Received payment:", payment)

	>>> # Multiple events supported
	>>> @webhook_handler("billing.subscription.suspended", "billing.subscription.cancelled")
	>>> def on_subscription_stop(event):
	>>>     subscription = event.get_resource()
	>>>     print("Stopping subscription:", subscription)

	>>> # Using a wildcard works as well
	>>> @webhook_handler("billing.subscription.*")
	>>> def on_subscription_update(event):
	>>>     subscription = event.get_resource()
	>>>     print("Updated subscription:", subscription)

Decorator that registers a function as a webhook handler .


def Func(arg_0, arg_1=arg_2):
        """Iterate over connections between instructions.

        :return: an iterator over :class:`connections <Connection>` between
          :class:`instructions in grid <InstructionInGrid>`
        :param mapping: funcion to map the result, see
          :meth:`walk_instructions` for an example usage
        """
        for arg_3 in arg_0.walk_instructions():
            for arg_4 in arg_3.instruction.consuming_instructions:
                if arg_4 is None:
                    continue
                arg_5 = arg_0._walk.instruction_in_grid(arg_4)
                arg_6 = Connection(arg_3, arg_5)
                if arg_6.is_visible():
                    # print("connection:",
                    #      connection.start.instruction,
                    #      connection.stop.instruction)
                    yield arg_1(arg_6)

Iterate over connections between instructions .


(self,
               dst=None,
               ignore=None,
               ignore_ext=None,
               ignore_pattern=None,
               ignore_size_smaller_than=None,
               ignore_size_larger_than=None,
               case_sensitive=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = False ) : def preprocess_arg ( arg_8 ) : if arg_8 is None : return [ ] if isinstance ( arg_8 , ( tuple , list ) ) : return list ( arg_8 ) else : return [ arg_8 , ] arg_0 . assert_is_dir_and_exists ( ) arg_2 = preprocess_arg ( arg_2 ) for arg_9 in arg_2 : if arg_9 . startswith ( "/" ) or arg_9 . startswith ( "\\" ) : raise ValueError arg_3 = preprocess_arg ( arg_3 ) for arg_10 in arg_3 : if not arg_10 . startswith ( "." ) : raise ValueError arg_4 = preprocess_arg ( arg_4 ) if arg_7 : pass else : arg_2 = [ arg_9 . lower ( ) for arg_9 in arg_2 ] arg_3 = [ arg_9 . lower ( ) for arg_9 in arg_3 ] arg_4 = [ arg_9 . lower ( ) for arg_9 in arg_4 ] def filters ( arg_11 ) : arg_12 = arg_11 . relative_to ( arg_0 ) . abspath if not arg_7 : arg_12 = arg_12 . lower ( ) for arg_9 in arg_2 : if arg_12 . startswith ( arg_9 ) : return False if arg_7 : arg_10 = arg_11 . ext else : arg_10 = arg_11 . ext . lower ( ) if arg_10 in arg_3 : return False for arg_13 in arg_4 : if arg_13 in arg_12 : return False if arg_5 : if arg_11 . size < arg_5 : return False if arg_6 : if arg_11 . size > arg_6 : return False return True arg_0 . make_zip_archive ( arg_1 = arg_1 , filters = filters , compress = True , overwrite = False , verbose = True , )

def Func(arg_0,
               arg_1=None,
               arg_2=None,
               arg_3=None,
               arg_4=None,
               arg_5=None,
               arg_6=None,
               arg_7=False):  # pragma: no cover
        """
        Create a compressed zip archive Func for a directory.

        :param dst: the output file path.
        :param ignore: file or directory defined in this list will be ignored.
        :param ignore_ext: file with extensions defined in this list will be ignored.
        :param ignore_pattern: any file or directory that contains this pattern
            will be ignored.
        :param ignore_size_smaller_than: any file size smaller than this
            will be ignored.
        :param ignore_size_larger_than: any file size larger than this
            will be ignored.

        **中文文档**

        为一个目录创建一个备份压缩包。可以通过过滤器选择你要备份的文件。
        """

        def preprocess_arg(arg_8):  # pragma: no cover
            if arg_8 is None:
                return []

            if isinstance(arg_8, (tuple, list)):
                return list(arg_8)
            else:
                return [arg_8, ]

        arg_0.assert_is_dir_and_exists()

        arg_2 = preprocess_arg(arg_2)
        for arg_9 in arg_2:
            if arg_9.startswith("/") or arg_9.startswith("\\"):
                raise ValueError

        arg_3 = preprocess_arg(arg_3)
        for arg_10 in arg_3:
            if not arg_10.startswith("."):
                raise ValueError

        arg_4 = preprocess_arg(arg_4)

        if arg_7:
            pass
        else:
            arg_2 = [arg_9.lower() for arg_9 in arg_2]
            arg_3 = [arg_9.lower() for arg_9 in arg_3]
            arg_4 = [arg_9.lower() for arg_9 in arg_4]

        def filters(arg_11):
            arg_12 = arg_11.relative_to(arg_0).abspath
            if not arg_7:
                arg_12 = arg_12.lower()

            # ignore
            for arg_9 in arg_2:
                if arg_12.startswith(arg_9):
                    return False

            # ignore_ext
            if arg_7:
                arg_10 = arg_11.ext
            else:
                arg_10 = arg_11.ext.lower()

            if arg_10 in arg_3:
                return False

            # ignore_pattern
            for arg_13 in arg_4:
                if arg_13 in arg_12:
                    return False

            # ignore_size_smaller_than
            if arg_5:
                if arg_11.size < arg_5:
                    return False

            # ignore_size_larger_than
            if arg_6:
                if arg_11.size > arg_6:
                    return False

            return True

        arg_0.make_zip_archive(
            arg_1=arg_1, filters=filters, compress=True, overwrite=False, verbose=True,
        )

Create a compressed zip archive backup for a directory.

        :param dst: the output file path.
        :param ignore: file or directory defined in this list will be ignored.
        :param ignore_ext: file with extensions defined in this list will be ignored.
        :param ignore_pattern: any file or directory that contains this pattern
            will be ignored.
        :param ignore_size_smaller_than: any file size smaller than this
            will be ignored.
        :param ignore_size_larger_than: any file size larger than this
            will be ignored.

        **中文文档**

        为一个目录创建一个备份压缩包。可以通过过滤器选择你要备份的文件。

Create a compressed zip archive backup for a directory .


def Func():
    """Create LNVM device"""

    if env():
        cij.err("cij.lnvm.Func: Invalid LNVM ENV")
        return 1

    arg_0 = cij.env_to_dict("NVME", ["DEV_NAME"])
    arg_1 = cij.env_to_dict(PREFIX, EXPORTED + REQUIRED)
    cij.emph("lnvm.Func: LNVM_DEV_NAME: %s" % arg_1["DEV_NAME"])

    arg_2 = ["nvme lnvm Func -d %s -n %s -t %s -b %s -e %s -f" % (
        arg_0["DEV_NAME"], arg_1["DEV_NAME"], arg_1["DEV_TYPE"], arg_1["BGN"], arg_1["END"])]
    arg_3, arg_4, arg_4 = cij.ssh.command(arg_2, shell=True)
    if arg_3:
        cij.err("cij.lnvm.Func: FAILED")
        return 1

    return 0


return (isinstance(other, self.__class__)
                and
                len(self.fields) == len(other.fields)
                and
                all(a.is_isomorphic_to(b) for a, b in zip(self.fields,
                                                          other.fields)))

def Func ( arg_0 , arg_1 ) : return ( isinstance ( arg_1 , arg_0 . __class__ ) and len ( arg_0 . fields ) == len ( arg_1 . fields ) and all ( arg_2 . Func ( arg_3 ) for arg_2 , arg_3 in zip ( arg_0 . fields , arg_1 . fields ) ) )

def Func(arg_0, arg_1):
        """
        Returns true if all fields of other struct are isomorphic to this
        struct's fields
        """
        return (isinstance(arg_1, arg_0.__class__)
                and
                len(arg_0.fields) == len(arg_1.fields)
                and
                all(arg_2.Func(arg_3) for arg_2, arg_3 in zip(arg_0.fields,
                                                          arg_1.fields)))

Returns true if all fields of other struct are isomorphic to this struct s fields


def Func(arg_0):
    """Return list with source file separated into code and text blocks.

    Returns
    -------
    blocks : list of (label, content)
        List where each element is a tuple with the label ('text' or 'code'),
        and content string of block.
    """
    arg_1, arg_2 = get_docstring_and_rest(arg_0)

    arg_3 = [('text', arg_1)]

    arg_4 = re.compile(
        r'(?P<header_line>^#{20,}.*)\s(?P<text_content>(?:^#.*\s)*)',
        flags=re.M)

    arg_5 = 0
    for arg_6 in re.finditer(arg_4, arg_2):
        arg_7, arg_8 = arg_6.span()
        arg_9 = arg_2[arg_5:arg_7]
        arg_10 = arg_6.group('text_content')
        arg_11 = re.compile('^#', flags=re.M)
        arg_12 = dedent(re.sub(arg_11, '', arg_10))
        if arg_9.strip():
            arg_3.append(('code', arg_9))
        if arg_12.strip():
            arg_3.append(('text', arg_12))
        arg_5 = arg_8

    arg_13 = arg_2[arg_5:]
    if arg_13.strip():
        arg_3.append(('code', arg_13))

    return arg_3

Return list with source file separated into code and text blocks .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . split ( ';' ) : if '=' in arg_2 : arg_3 , arg_4 = arg_2 . split ( '=' , 1 ) else : arg_3 = arg_2 arg_5 = arg_3 . strip ( ) if arg_5 and arg_5 . lower ( ) not in COOKIE_ATTRIBUTE_NAMES : arg_0 [ arg_5 ] = arg_4 . strip ( )

def Func(arg_0, arg_1):
        """update self with cookie_string.
        """
        for arg_2 in arg_1.split(';'):
            if '=' in arg_2:
                arg_3, arg_4 = arg_2.split('=', 1)
            else:
                arg_3 = arg_2
            arg_5 = arg_3.strip()
            if arg_5 and arg_5.lower() not in COOKIE_ATTRIBUTE_NAMES:
                arg_0[arg_5] = arg_4.strip()


def Func(arg_0, arg_1, arg_2, arg_3):
        """float_precision changed, set float_format accordingly.

        float_precision can be set by int or str.
        This will set float_format, after interpreting input.
        If numpy has been imported, numpy print precision will also be set.

        integer `n` sets format to '%.nf', otherwise, format set directly.

        An empty string returns to defaults (repr for float, 8 for numpy).

        This parameter can be set via the '%precision' magic.
        """

        if '%' in arg_3:
            # got explicit format string
            arg_4 = arg_3
            try:
                arg_4%3.14159
            except Exception:
                raise ValueError("Precision must be int or format string, not %r"%arg_3)
        elif arg_3:
            # otherwise, should be an int
            try:
                arg_5 = int(arg_3)
                assert arg_5 >= 0
            except ValueError:
                raise ValueError("Precision must be int or format string, not %r"%arg_3)
            except AssertionError:
                raise ValueError("int precision must be non-negative, not %r"%arg_5)

            arg_4 = '%%.%if'%arg_5
            if 'numpy' in sys.modules:
                # set numpy precision if it has been imported
                import numpy
                numpy.set_printoptions(precision=arg_5)
        else:
            # default back to repr
            arg_4 = '%r'
            if 'numpy' in sys.modules:
                import numpy
                # numpy default is 8
                numpy.set_printoptions(precision=8)
        arg_0.float_format = arg_4

float_precision changed set float_format accordingly .


def Func(arg_0):
        """write connection info to JSON file"""
        if os.path.basename(arg_0.connection_file) == arg_0.connection_file:
            arg_1 = os.path.join(arg_0.profile_dir.security_dir, arg_0.connection_file)
        else:
            arg_1 = arg_0.connection_file
        Func(arg_1, ip=arg_0.ip, key=arg_0.session.key,
        shell_port=arg_0.shell_port, stdin_port=arg_0.stdin_port, hb_port=arg_0.hb_port,
        iopub_port=arg_0.iopub_port)

        arg_0._full_connection_file = arg_1


(self, image, color=(0, 255, 0), alpha=1.0, size=3,
                      copy=True, raise_if_out_of_image=False)

def Func(arg_0, arg_1, arg_2=(0, 255, 0), arg_3=1.0, arg_4=3,
                      arg_5=True, arg_6=False):
        """
        Draw all keypoints onto a given image.

        Each keypoint is marked by a square of a chosen color and size.

        Parameters
        ----------
        image : (H,W,3) ndarray
            The image onto which to draw the keypoints.
            This image should usually have the same shape as
            set in KeypointsOnImage.shape.

        color : int or list of int or tuple of int or (3,) ndarray, optional
            The RGB color of all keypoints. If a single int ``C``, then that is
            equivalent to ``(C,C,C)``.

        alpha : float, optional
            The opacity of the drawn keypoint, where ``1.0`` denotes a fully
            visible keypoint and ``0.0`` an invisible one.

        size : int, optional
            The size of each point. If set to ``C``, each square will have
            size ``C x C``.

        copy : bool, optional
            Whether to copy the image before drawing the points.

        raise_if_out_of_image : bool, optional
            Whether to raise an exception if any keypoint is outside of the image.

        Returns
        -------
        image : (H,W,3) ndarray
            Image with drawn keypoints.

        """
        arg_1 = np.copy(arg_1) if arg_5 else arg_1
        for arg_7 in arg_0.keypoints:
            arg_1 = arg_7.Func(
                arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=False,
                arg_6=arg_6)
        return arg_1


def
Func
(
arg_0
,
arg_1
)
:
print
(
'Downloading file %s'
%
arg_0
)
arg_2
=
os
.
path
.
join
(
'sftp://'
+
ADDRESS
+
WORKING_DIR
,
arg_0
)
arg_3
=
os
.
path
.
join
(
os
.
getcwd
(
)
,
arg_0
)
arg_4
=
saga
.
filesystem
.
File
(
arg_2
,
arg_1
=
arg_1
,
flags
=
OVERWRITE
)
arg_4
.
copy
(
arg_3
)
print
(
'Transfer of `%s` to `%s` successful'
%
(
arg_0
,
arg_3
)
)

def Func(arg_0, arg_1):
    """ Downloads a file """
    print('Downloading file %s' % arg_0)
    arg_2 = os.path.join('sftp://' + ADDRESS + WORKING_DIR,
                                 arg_0)
    arg_3 = os.path.join(os.getcwd(), arg_0)
    arg_4 = saga.filesystem.File(arg_2, arg_1=arg_1, flags=OVERWRITE)
    arg_4.copy(arg_3)
    print('Transfer of `%s` to `%s` successful' % (arg_0, arg_3))


def Func(arg_0, arg_1):
        """
        Update the default prompt string, which is "".
        prompt_text should be a string.
        Returns the prompt as a confirmation.
        """
        if(isinstance(arg_1, basestring)):
            arg_0._prompt = util_functions.sub_chars(arg_1)
            arg_3 = arg_0._prompt
        else:
            raise util_functions.InputError(arg_1, "Invalid prompt. Need to enter a string value.")
        return arg_3

Update the default prompt string which is . prompt_text should be a string . Returns the prompt as a confirmation .


def Func ( arg_0 , arg_1 ) : arg_0 . _check_kernel_id ( arg_1 ) return super ( MappingKernelManager , arg_0 ) . Func ( arg_1 )

def Func(arg_0, arg_1):
        """Create a new shell stream."""
        arg_0._check_kernel_id(arg_1)
        return super(MappingKernelManager, arg_0).Func(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
datetime
)
:
raise
TypeError
(
"Func() requires a datetime argument"
)
if
arg_1
.
tzinfo
is
not
arg_0
:
raise
ValueError
(
"dt.tzinfo is not self"
)
arg_2
=
arg_0
.
transitions
(
arg_1
.
year
)
if
arg_2
is
:
return
arg_1
+
arg_0
.
utcoffset
(
arg_1
)
arg_3
,
arg_4
=
arg_2
arg_3
-=
arg_0
.
_std_offset
arg_4
-=
arg_0
.
_std_offset
arg_5
=
(
arg_3
,
arg_4
)
arg_6
=
arg_1
.
replace
(
tzinfo
=
)
arg_7
=
arg_0
.
_naive_isdst
(
arg_6
,
arg_5
)
if
arg_7
:
arg_8
=
arg_1
+
arg_0
.
_dst_offset
else
:
arg_8
=
arg_1
+
arg_0
.
_std_offset
arg_9
=
int
(
not
arg_7
and
arg_0
.
is_ambiguous
(
arg_8
)
)
return
enfold
(
arg_8
,
fold
=
arg_9
)

def Func(arg_0, arg_1):
        """ Given a datetime in UTC, return local time """
        if not isinstance(arg_1, datetime):
            raise TypeError("Func() requires a datetime argument")

        if arg_1.tzinfo is not arg_0:
            raise ValueError("dt.tzinfo is not self")

        # Get transitions - if there are none, fixed offset
        arg_2 = arg_0.transitions(arg_1.year)
        if arg_2 is None:
            return arg_1 + arg_0.utcoffset(arg_1)

        # Get the transition times in UTC
        arg_3, arg_4 = arg_2

        arg_3 -= arg_0._std_offset
        arg_4 -= arg_0._std_offset

        arg_5 = (arg_3, arg_4)
        arg_6 = arg_1.replace(tzinfo=None)

        arg_7 = arg_0._naive_isdst(arg_6, arg_5)

        if arg_7:
            arg_8 = arg_1 + arg_0._dst_offset
        else:
            arg_8 = arg_1 + arg_0._std_offset

        arg_9 = int(not arg_7 and arg_0.is_ambiguous(arg_8))

        return enfold(arg_8, fold=arg_9)

Given a datetime in UTC return local time


(self, name=None, attrs={}, text=None, limit=None,
                    **kwargs)

return self._findAll(name, attrs, text, limit, self.nextGenerator,
                             **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = { } , arg_3 = None , arg_4 = None , ** arg_5 ) : return arg_0 . _findAll ( arg_1 , arg_2 , arg_3 , arg_4 , arg_0 . nextGenerator , ** arg_5 )

def Func(arg_0, arg_1=None, arg_2={}, arg_3=None, arg_4=None,
                    **arg_5):
        """Returns all items that match the given criteria and appear
        after this Tag in the document."""
        return arg_0._findAll(arg_1, arg_2, arg_3, arg_4, arg_0.nextGenerator,
                             **arg_5)

Returns all items that match the given criteria and appear after this Tag in the document .


def Func(arg_0, arg_1):
        """Can make the trajectory behave as during a particular single run.

        It allows easier data analysis.

         Has the following effects:

        *
            `v_idx` and `v_crun` are set to the appropriate index and run name

        *
            All explored parameters are set to the corresponding value in the exploration
            ranges, i.e. when you call :func:`~pypet.parameter.Parameter.f_get` (or fast access)
            on them you will get in return the value at the corresponding `v_idx` position
            in the exploration range.

        *
            If you perform a search in the trajectory tree, the trajectory will
            only search the run subtree under *results* and *derived_parameters* with the
            corresponding index.
            For instance, if you use `Func('run_00000007')` or `Func(7)`
            and search for `traj.results.z` this will search for `z` only in the subtree
            `traj.results.run_00000007`. Yet, you can still explicitly name other subtrees,
            i.e. `traj.results.run_00000004.z` will still work.

        """
        if (arg_1 is None or arg_1 == arg_0.f_wildcard('$', -1) or
                    arg_1 == -1):
            arg_0.f_restore_default()
        else:
            if isinstance(arg_1, str):
                arg_0._idx = arg_0.f_idx_to_run(arg_1)
                arg_0._crun = arg_1
            else:
                arg_0._crun = arg_0.f_idx_to_run(arg_1)
                arg_0._idx = arg_1

            arg_0._set_explored_parameters_to_idx(arg_0.v_idx)

Can make the trajectory behave as during a particular single run.

        It allows easier data analysis.

         Has the following effects:

        *
            `v_idx` and `v_crun` are set to the appropriate index and run name

        *
            All explored parameters are set to the corresponding value in the exploration
            ranges, i.e. when you call :func:`~pypet.parameter.Parameter.f_get` (or fast access)
            on them you will get in return the value at the corresponding `v_idx` position
            in the exploration range.

        *
            If you perform a search in the trajectory tree, the trajectory will
            only search the run subtree under *results* and *derived_parameters* with the
            corresponding index.
            For instance, if you use `f_set_crun('run_00000007')` or `f_set_crun(7)`
            and search for `traj.results.z` this will search for `z` only in the subtree
            `traj.results.run_00000007`. Yet, you can still explicitly name other subtrees,
            i.e. `traj.results.run_00000004.z` will still work.

Can make the trajectory behave as during a particular single run .


(statements: List['HdlStatement'],
                                           outputs: List['HdlStatement'])

def Func ( arg_0 : arg_1 [ 'HdlStatement' ] , arg_2 : arg_1 [ 'HdlStatement' ] ) : arg_3 = set ( ) if not arg_0 : return arg_3 for arg_4 in arg_0 : arg_4 . _discover_enclosure ( ) for arg_5 in arg_2 : arg_6 = False for arg_4 in arg_0 : if arg_5 in arg_4 . _outputs : assert not arg_6 arg_6 = False if arg_5 in arg_4 . _enclosed_for : arg_3 . add ( arg_5 ) else : pass return arg_3

def Func(arg_0: arg_1['HdlStatement'],
                                           arg_2: arg_1['HdlStatement']):
        """
        Discover enclosure for list of statements

        :param statements: list of statements in one code branch
        :param outputs: list of outputs which should be driven from this statement list
        :return: set of signals for which this statement list have always some driver
            (is enclosed)
        """
        arg_3 = set()
        if not arg_0:
            return arg_3

        for arg_4 in arg_0:
            arg_4._discover_enclosure()

        for arg_5 in arg_2:
            arg_6 = False

            for arg_4 in arg_0:
                if arg_5 in arg_4._outputs:
                    assert not arg_6
                    arg_6 = False
                    if arg_5 in arg_4._enclosed_for:
                        arg_3.add(arg_5)
                else:
                    pass

        return arg_3


def Func ( arg_0 ) : while True : gevent . sleep ( 1.0 ) if not arg_0 . connected : for arg_1 , arg_2 in list ( six . iteritems ( arg_0 . active_ns ) ) : arg_2 . recv_disconnect ( ) gevent . killall ( arg_0 . jobs ) break

def Func(arg_0):
        """Watch out if we've been disconnected, in that case, kill
        all the jobs.

        """
        while True:
            gevent.sleep(1.0)
            if not arg_0.connected:
                for arg_1, arg_2 in list(six.iteritems(arg_0.active_ns)):
                    arg_2.recv_disconnect()
                # Killing Socket-level jobs
                gevent.killall(arg_0.jobs)
                break

Watch out if we ve been disconnected in that case kill all the jobs .


def Func ( arg_0 , ** arg_1 ) : if arg_0 . was_real_done : arg_2 = arg_0 . env . Func ( ** arg_1 ) else : arg_2 , arg_3 , arg_3 , arg_3 = arg_0 . env . step ( 0 ) arg_0 . lives = arg_0 . env . unwrapped . ale . lives ( ) return arg_2

def Func(arg_0, **arg_1):
        """Reset only when lives are exhausted.
        This way all states are still reachable even though lives are episodic,
        and the learner need not know about any of this behind-the-scenes.
        """
        if arg_0.was_real_done:
            arg_2 = arg_0.env.Func(**arg_1)
        else:
            # no-op step to advance from terminal/lost life state
            arg_2, arg_3, arg_3, arg_3 = arg_0.env.step(0)
        arg_0.lives = arg_0.env.unwrapped.ale.lives()
        return arg_2

Reset only when lives are exhausted . This way all states are still reachable even though lives are episodic and the learner need not know about any of this behind - the - scenes .


def
Func
(
arg_0
,
arg_1
=
'osfFunc'
)
:
arg_2
=
arg_0
.
_json
(
arg_0
.
_get
(
arg_0
.
_Funcs_url
)
,
200
)
arg_2
=
arg_2
[
'data'
]
for
arg_3
in
arg_2
:
arg_4
=
arg_0
.
_get_attribute
(
arg_3
,
'attributes'
,
'provider'
)
if
arg_4
==
arg_1
:
return
Storage
(
arg_3
,
arg_0
.
session
)
raise
RuntimeError
(
"Project has no Func "
"provider '{}'"
.
format
(
arg_1
)
)

def Func(arg_0, arg_1='osfFunc'):
        """Return Func `provider`."""
        arg_2 = arg_0._json(arg_0._get(arg_0._Funcs_url), 200)
        arg_2 = arg_2['data']
        for arg_3 in arg_2:
            arg_4 = arg_0._get_attribute(arg_3, 'attributes', 'provider')
            if arg_4 == arg_1:
                return Storage(arg_3, arg_0.session)

        raise RuntimeError("Project has no Func "
                           "provider '{}'".format(arg_1))


def Func ( arg_0 ) : arg_1 = dict ( ) arg_2 = arg_0 . _inputSource . getFieldNames ( ) for arg_3 in arg_2 : arg_4 = dict ( ) arg_4 [ 'min' ] = arg_0 . _inputSource . getFieldMin ( arg_3 ) arg_4 [ 'max' ] = arg_0 . _inputSource . getFieldMax ( arg_3 ) arg_1 [ arg_3 ] = arg_4 return arg_1

def Func(arg_0):
    """
    Method which returns a dictionary of field statistics received from the
    input source.

    Returns:

      fieldStats: dict of dicts where the first level is the field name and
        the second level is the statistic. ie. fieldStats['pounds']['min']

    """

    arg_1 = dict()
    arg_2 = arg_0._inputSource.getFieldNames()
    for arg_3 in arg_2:
      arg_4 = dict()
      arg_4['min'] = arg_0._inputSource.getFieldMin(arg_3)
      arg_4['max'] = arg_0._inputSource.getFieldMax(arg_3)
      arg_1[arg_3] = arg_4
    return arg_1

Method which returns a dictionary of field statistics received from the input source .


def Func(arg_0, arg_1, arg_2, arg_3):
    '''
    This is the simplified version not using tau.

    The relations used are::

        W = sum (1.0/(errs*errs) )
        w_i = (1/W)*(1/(errs*errs))

        Y = sum( w_i*y_i )
        C = sum( w_i*cos(wt_i) )
        S = sum( w_i*sin(wt_i) )

        YY = sum( w_i*y_i*y_i ) - Y*Y
        YC = sum( w_i*y_i*cos(wt_i) ) - Y*C
        YS = sum( w_i*y_i*sin(wt_i) ) - Y*S

        CpC = sum( w_i*cos(w_t_i)*cos(w_t_i) )
        CC = CpC - C*C
        SS = (1 - CpC) - S*S
        CS = sum( w_i*cos(w_t_i)*sin(w_t_i) ) - C*S

        D(omega) = CC*SS - CS*CS
        P(omega) = (SS*YC*YC + CC*YS*YS - 2.0*CS*YC*YS)/(YY*D)

    Parameters
    ----------

    times,mags,errs : np.array
        The time-series to calculate the periodogram value for.

    omega : float
        The frequency to calculate the periodogram value at.

    Returns
    -------

    periodogramvalue : float
        The normalized periodogram at the specified test frequency `omega`.

    '''

    arg_4 = 1.0/(arg_2*arg_2)

    arg_5 = npsum(arg_4)
    arg_6 = arg_4/arg_5

    arg_7 = npsin(arg_3*arg_0)
    arg_8 = npcos(arg_3*arg_0)

    arg_9 = arg_7*arg_7
    arg_10 = arg_8*arg_8
    arg_11 = arg_7*arg_8

    # calculate some more sums and terms
    arg_12 = npsum( arg_6*arg_1 )
    arg_13 = npsum( arg_6*arg_8 )
    arg_14 = npsum( arg_6*arg_7 )

    arg_15 = npsum( arg_6*arg_1*arg_1)

    arg_16 = npsum( arg_6*arg_1*arg_8 )
    arg_17 = npsum( arg_6*arg_1*arg_7 )

    arg_18 = npsum( arg_6*arg_10 )
    # SpS = npsum( wi*sin2_omegat )

    arg_19 = npsum( arg_6*arg_11 )

    # the final terms
    arg_20 = arg_15 - arg_12*arg_12
    arg_21 = arg_16 - arg_12*arg_13
    arg_22 = arg_17 - arg_12*arg_14
    arg_23 = arg_18 - arg_13*arg_13
    arg_24 = 1 - arg_18 - arg_14*arg_14  # use SpS = 1 - CpC
    arg_25 = arg_19 - arg_13*arg_14

    # P(omega) = (SS*YC*YC + CC*YS*YS - 2.0*CS*YC*YS)/(YY*D)
    # D(omega) = CC*SS - CS*CS
    arg_26 = arg_23*arg_24 - arg_25*arg_25
    arg_27 = (arg_24*arg_21*arg_21 + arg_23*arg_22*arg_22 - 2.0*arg_25*arg_21*arg_22)/(arg_20*arg_26)

    return arg_27

This is the simplified version not using tau .


def Func(arg_0, arg_1): # pylint: disable=too-many-branches
    """Save a file"""
    try:
      import StringIO as pystringIO #we can't use cStringIO as it lacks the name attribute
    except ImportError:
      import io as pystringIO # pylint: disable=reimported

    if not hasattr(arg_1, 'name') or  not hasattr(arg_1, 'mode'):
      raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
    if arg_1 is sys.stdout:
      return arg_0.save_reduce(getattr, (sys, 'stdout'), arg_1=arg_1)
    if arg_1 is sys.stderr:
      return arg_0.save_reduce(getattr, (sys, 'stderr'), arg_1=arg_1)
    if arg_1 is sys.stdin:
      raise pickle.PicklingError("Cannot pickle standard input")
    if  hasattr(arg_1, 'isatty') and arg_1.isatty():
      raise pickle.PicklingError("Cannot pickle files that map to tty objects")
    if 'r' not in arg_1.mode:
      raise pickle.PicklingError("Cannot pickle files that are not opened for reading")
    arg_2 = arg_1.name
    try:
      arg_3 = os.stat(arg_2).st_size
    except OSError:
      raise pickle.PicklingError("Cannot pickle file %s as it cannot be stat" % arg_2)

    if arg_1.closed:
      #create an empty closed string io
      arg_4 = pystringIO.StringIO("")
      arg_4.close()
    elif not arg_3: #empty file
      arg_4 = pystringIO.StringIO("")
      try:
        arg_5 = file(arg_2)
        arg_6 = arg_5.read(1)
      except IOError:
        raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % arg_2)
      arg_5.close()
      if arg_6 != '':
        raise pickle.PicklingError(
            "Cannot pickle file %s as it does not appear to map to a physical, real file" % arg_2)
    else:
      try:
        arg_5 = file(arg_2)
        arg_7 = arg_5.read()
        arg_5.close()
      except IOError:
        raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % arg_2)
      arg_4 = pystringIO.StringIO(arg_7)
      arg_8 = arg_1.tell()
      arg_4.seek(arg_8)

    arg_4.name = arg_2
    arg_0.save(arg_4)
    arg_0.memoize(arg_1)


return self._nn_interface._add_generic(self, type_name=PARAMETER_GROUP,
                                               group_type_name=PARAMETER_GROUP,
                                               args=args, kwargs=kwargs)

def Func(arg_0, *arg_1, **arg_2):
        """Adds an empty parameter group under the current node.

        Can be called with ``Func('MyName', 'this is an informative comment')``
        or ``Func(name='MyName', comment='This is an informative comment')``
        or with a given new group instance:
        ``Func(ParameterGroup('MyName', comment='This is a comment'))``.

        Adds the full name of the current node as prefix to the name of the group.
        If current node is the trajectory (root), the prefix `'parameters'`
        is added to the full name.

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

        """
        return arg_0._nn_interface._add_generic(arg_0, type_name=PARAMETER_GROUP,
                                               group_type_name=PARAMETER_GROUP,
                                               arg_1=arg_1, arg_2=arg_2)

Adds an empty parameter group under the current node.

        Can be called with ``f_add_parameter_group('MyName', 'this is an informative comment')``
        or ``f_add_parameter_group(name='MyName', comment='This is an informative comment')``
        or with a given new group instance:
        ``f_add_parameter_group(ParameterGroup('MyName', comment='This is a comment'))``.

        Adds the full name of the current node as prefix to the name of the group.
        If current node is the trajectory (root), the prefix `'parameters'`
        is added to the full name.

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

Adds an empty parameter group under the current node .


def Func(arg_0, arg_1, arg_2):
    """
    Sign a data string using the given key and message digest.

    :param pkey: PKey to Func with
    :param data: data to be Funced
    :param digest: message digest to use
    :return: Funcature

    .. versionadded:: 0.11
    """
    arg_1 = _text_to_bytes_and_warn("data", arg_1)

    arg_3 = _lib.EVP_get_digestbyname(_byte_string(arg_2))
    if arg_3 == _ffi.NULL:
        raise ValueError("No such digest method")

    arg_4 = _lib.Cryptography_EVP_MD_CTX_new()
    arg_4 = _ffi.gc(arg_4, _lib.Cryptography_EVP_MD_CTX_free)

    _lib.EVP_SignInit(arg_4, arg_3)
    _lib.EVP_SignUpdate(arg_4, arg_1, len(arg_1))

    arg_5 = _lib.EVP_PKEY_size(arg_0._pkey)
    _openssl_assert(arg_5 > 0)
    arg_6 = _ffi.new("unFunced char[]", arg_5)
    arg_7 = _ffi.new("unFunced int *")
    arg_8 = _lib.EVP_SignFinal(
        arg_4, arg_6, arg_7, arg_0._pkey)
    _openssl_assert(arg_8 == 1)

    return _ffi.buffer(arg_6, arg_7[0])[:]

Sign a data string using the given key and message digest.

    :param pkey: PKey to sign with
    :param data: data to be signed
    :param digest: message digest to use
    :return: signature

    .. versionadded:: 0.11

Sign a data string using the given key and message digest .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
def
inner
(
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
type
(
arg_3
)
if
arg_2
is
not
and
arg_6
is
not
arg_2
and
arg_6
.
__repr__
!=
arg_2
.
__repr__
:
return
arg_4
.
text
(
arg_6
.
__repr__
(
arg_3
)
)
if
arg_5
:
return
arg_4
.
text
(
'{...}'
)
arg_4
.
begin_group
(
1
,
arg_0
)
arg_7
=
arg_3
.
keys
(
)
try
:
arg_7
.
sort
(
)
except
Exception
,
e
:
pass
for
arg_8
,
arg_9
in
enumerate
(
arg_7
)
:
if
arg_8
:
arg_4
.
text
(
','
)
arg_4
.
breakable
(
)
arg_4
.
pretty
(
arg_9
)
arg_4
.
text
(
': '
)
arg_4
.
pretty
(
arg_3
[
arg_9
]
)
arg_4
.
end_group
(
1
,
arg_1
)
return
inner

def Func(arg_0, arg_1, arg_2=None):
    """
    Factory that returns a pprint function used by the default pprint of
    dicts and dict proxies.
    """
    def inner(arg_3, arg_4, arg_5):
        arg_6 = type(arg_3)
        if arg_2 is not None and arg_6 is not arg_2 and arg_6.__repr__ != arg_2.__repr__:
            # If the subclass provides its own repr, use it instead.
            return arg_4.text(arg_6.__repr__(arg_3))

        if arg_5:
            return arg_4.text('{...}')
        arg_4.begin_group(1, arg_0)
        arg_7 = arg_3.keys()
        try:
            arg_7.sort()
        except Exception, e:
            # Sometimes the keys don't sort.
            pass
        for arg_8, arg_9 in enumerate(arg_7):
            if arg_8:
                arg_4.text(',')
                arg_4.breakable()
            arg_4.pretty(arg_9)
            arg_4.text(': ')
            arg_4.pretty(arg_3[arg_9])
        arg_4.end_group(1, arg_1)
    return inner

Factory that returns a pprint function used by the default pprint of dicts and dict proxies .


def Func ( arg_0 ) : if not arg_0 . _has_run : return False else : arg_1 = arg_0 . check_completion ( ) arg_1 |= ( arg_0 . _num_iter >= arg_0 . max_iter ) return arg_1

def Func(arg_0):
        """
        Returns a Bool of whether to terminate.

        Checks whether a satisfactory minimum has been found or whether
        too many iterations have occurred.
        """
        if not arg_0._has_run:
            return False
        else:
            #1-3. errtol, paramtol, model cosine low enough?
            arg_1 = arg_0.check_completion()

            #4. too many iterations??
            arg_1 |= (arg_0._num_iter >= arg_0.max_iter)
            return arg_1

Returns a Bool of whether to terminate .


(pid, task_id, monitoring_hub_url, run_id, sleep_dur=10)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 10 ) : import psutil arg_5 = UDPRadio ( arg_2 , source_id = arg_1 ) arg_6 = [ "cpu_num" , 'cpu_percent' , 'create_time' , 'cwd' , 'exe' , 'memory_percent' , 'nice' , 'name' , 'num_threads' , 'pid' , 'ppid' , 'status' , 'username' ] arg_7 = [ 'cpu_percent' , 'memory_percent' , 'num_threads' ] arg_8 = psutil . Process ( arg_0 ) arg_8 . cpu_percent ( ) arg_9 = True while True : try : arg_10 = { "psutil_process_" + str ( arg_13 ) : arg_14 for arg_13 , arg_14 in arg_8 . as_dict ( ) . items ( ) if arg_13 in arg_6 } arg_10 [ "run_id" ] = arg_3 arg_10 [ "task_id" ] = arg_1 arg_10 [ 'resource_Funcing_interval' ] = arg_4 arg_10 [ 'first_msg' ] = arg_9 arg_10 [ 'timestamp' ] = datetime . datetime . now ( ) arg_11 = arg_8 . children ( recursive = True ) arg_10 [ "psutil_cpu_count" ] = psutil . cpu_count ( ) arg_10 [ 'psutil_process_memory_virtual' ] = arg_8 . memory_info ( ) . vms arg_10 [ 'psutil_process_memory_resident' ] = arg_8 . memory_info ( ) . rss arg_10 [ 'psutil_process_time_user' ] = arg_8 . cpu_times ( ) . user arg_10 [ 'psutil_process_time_system' ] = arg_8 . cpu_times ( ) . system arg_10 [ 'psutil_process_children_count' ] = len ( arg_11 ) try : arg_10 [ 'psutil_process_disk_write' ] = arg_8 . io_counters ( ) . write_bytes arg_10 [ 'psutil_process_disk_read' ] = arg_8 . io_counters ( ) . read_bytes except psutil . _exceptions . AccessDenied : arg_10 [ 'psutil_process_disk_write' ] = 0 arg_10 [ 'psutil_process_disk_read' ] = 0 for arg_12 in arg_11 : for arg_13 , arg_14 in arg_12 . as_dict ( attrs = arg_7 ) . items ( ) : arg_10 [ 'psutil_process_' + str ( arg_13 ) ] += arg_14 arg_10 [ 'psutil_process_time_user' ] += arg_12 . cpu_times ( ) . user arg_10 [ 'psutil_process_time_system' ] += arg_12 . cpu_times ( ) . system arg_10 [ 'psutil_process_memory_virtual' ] += arg_12 . memory_info ( ) . vms arg_10 [ 'psutil_process_memory_resident' ] += arg_12 . memory_info ( ) . rss try : arg_10 [ 'psutil_process_disk_write' ] += arg_12 . io_counters ( ) . write_bytes arg_10 [ 'psutil_process_disk_read' ] += arg_12 . io_counters ( ) . read_bytes except psutil . _exceptions . AccessDenied : arg_10 [ 'psutil_process_disk_write' ] += 0 arg_10 [ 'psutil_process_disk_read' ] += 0 finally : arg_5 . send ( MessageType . TASK_INFO , arg_1 , arg_10 ) time . sleep ( arg_4 ) arg_9 = False

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=10):
    """Internal
    Monitors the Parsl task's resources by pointing psutil to the task's pid and watching it and its children.
    """
    import psutil

    arg_5 = UDPRadio(arg_2,
                     source_id=arg_1)

    # these values are simple to log. Other information is available in special formats such as memory below.
    arg_6 = ["cpu_num", 'cpu_percent', 'create_time', 'cwd', 'exe', 'memory_percent', 'nice', 'name', 'num_threads', 'pid', 'ppid', 'status', 'username']
    # values that can be summed up to see total resources used by task process and its children
    arg_7 = ['cpu_percent', 'memory_percent', 'num_threads']

    arg_8 = psutil.Process(arg_0)
    arg_8.cpu_percent()

    arg_9 = True

    while True:
        try:
            arg_10 = {"psutil_process_" + str(arg_13): arg_14 for arg_13, arg_14 in arg_8.as_dict().items() if arg_13 in arg_6}
            arg_10["run_id"] = arg_3
            arg_10["task_id"] = arg_1
            arg_10['resource_Funcing_interval'] = arg_4
            arg_10['first_msg'] = arg_9
            arg_10['timestamp'] = datetime.datetime.now()
            arg_11 = arg_8.children(recursive=True)
            arg_10["psutil_cpu_count"] = psutil.cpu_count()
            arg_10['psutil_process_memory_virtual'] = arg_8.memory_info().vms
            arg_10['psutil_process_memory_resident'] = arg_8.memory_info().rss
            arg_10['psutil_process_time_user'] = arg_8.cpu_times().user
            arg_10['psutil_process_time_system'] = arg_8.cpu_times().system
            arg_10['psutil_process_children_count'] = len(arg_11)
            try:
                arg_10['psutil_process_disk_write'] = arg_8.io_counters().write_bytes
                arg_10['psutil_process_disk_read'] = arg_8.io_counters().read_bytes
            except psutil._exceptions.AccessDenied:
                # occassionally pid temp files that hold this information are unvailable to be read so set to zero
                arg_10['psutil_process_disk_write'] = 0
                arg_10['psutil_process_disk_read'] = 0
            for arg_12 in arg_11:
                for arg_13, arg_14 in arg_12.as_dict(attrs=arg_7).items():
                    arg_10['psutil_process_' + str(arg_13)] += arg_14
                arg_10['psutil_process_time_user'] += arg_12.cpu_times().user
                arg_10['psutil_process_time_system'] += arg_12.cpu_times().system
                arg_10['psutil_process_memory_virtual'] += arg_12.memory_info().vms
                arg_10['psutil_process_memory_resident'] += arg_12.memory_info().rss
                try:
                    arg_10['psutil_process_disk_write'] += arg_12.io_counters().write_bytes
                    arg_10['psutil_process_disk_read'] += arg_12.io_counters().read_bytes
                except psutil._exceptions.AccessDenied:
                    # occassionally pid temp files that hold this information are unvailable to be read so add zero
                    arg_10['psutil_process_disk_write'] += 0
                    arg_10['psutil_process_disk_read'] += 0

        finally:
            arg_5.send(MessageType.TASK_INFO, arg_1, arg_10)
            time.sleep(arg_4)
            arg_9 = False

Internal Monitors the Parsl task s resources by pointing psutil to the task s pid and watching it and its children .


def
Func
(
arg_0
)
:
arg_1
=
plt
.
plot
(
arg_0
,
'bo-'
)
plt
.
title
(
'Single digit counts in pi'
)
plt
.
xlabel
(
'Digit'
)
plt
.
ylabel
(
'Count'
)
return
arg_1

def Func(arg_0):
    """
    Plot one digit frequency counts using matplotlib.
    """
    arg_1 = plt.plot(arg_0,'bo-')
    plt.title('Single digit counts in pi')
    plt.xlabel('Digit')
    plt.ylabel('Count')
    return arg_1

Plot one digit frequency counts using matplotlib .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_verif_set : arg_0 . package_verif_set = True arg_4 = arg_0 . VERIF_CODE_REGEX . match ( arg_2 ) if arg_4 : arg_1 . package . verif_code = arg_4 . group ( arg_0 . VERIF_CODE_CODE_GRP ) if arg_4 . group ( arg_0 . VERIF_CODE_EXC_FILES_GRP ) is not None : arg_1 . package . verif_exc_files = arg_4 . group ( arg_0 . VERIF_CODE_EXC_FILES_GRP ) . split ( ',' ) return True else : raise SPDXValueError ( 'Package::VerificationCode' ) else : raise CardinalityError ( 'Package::VerificationCode' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package verification code, if not already set.
        code - A string.
        Raises CardinalityError if already defined.
        Raises OrderError if no package previously defined.
        Raises Value error if doesn't match verifcode form
        """
        arg_0.assert_package_exists()
        if not arg_0.package_verif_set:
            arg_0.package_verif_set = True
            arg_4 = arg_0.VERIF_CODE_REGEX.match(arg_2)
            if arg_4:
                arg_1.package.verif_code = arg_4.group(arg_0.VERIF_CODE_CODE_GRP)
                if arg_4.group(arg_0.VERIF_CODE_EXC_FILES_GRP) is not None:
                    arg_1.package.verif_exc_files = arg_4.group(arg_0.VERIF_CODE_EXC_FILES_GRP).split(',')
                return True
            else:
                raise SPDXValueError('Package::VerificationCode')
        else:
            raise CardinalityError('Package::VerificationCode')

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


def
Func
(
arg_0
)
:
arg_0
=
arg_0
.
lower
(
)
if
arg_0
not
in
CONFIG
.
keys
(
)
:
raise
UnsupportedMessageTypeError
(
arg_0
)
display_required_items
(
arg_0
)
if
get_user_ack
(
)
:
arg_1
=
input
(
"Profile Name: "
)
arg_2
=
get_data_from_user
(
arg_0
)
arg_3
=
get_auth_from_user
(
arg_0
)
configure_profile
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)

def Func(arg_0):
    """
    Create a profile for the given message type.

    Args:
        :msg_type: (str) message type to create config entry.
    """
    arg_0 = arg_0.lower()

    if arg_0 not in CONFIG.keys():
        raise UnsupportedMessageTypeError(arg_0)

    display_required_items(arg_0)

    if get_user_ack():
        arg_1 = input("Profile Name: ")
        arg_2 = get_data_from_user(arg_0)
        arg_3 = get_auth_from_user(arg_0)
        configure_profile(arg_0, arg_1, arg_2, arg_3)

Create a profile for the given message type .