def
Func
(
arg_0
,
arg_1
=
False
)
:
if
arg_1
:
arg_0
=
arg_0
.
upper
(
)
if
re
.
search
(
'[^0-9A-F]'
,
arg_0
)
:
raise
TypeError
(
'Non-base16 digit found'
)
return
binascii
.
unhexlify
(
arg_0
)

def Func(arg_0, arg_1=False):
    """Decode a Base16 encoded string.

    s is the string to decode.  Optional casefold is a flag specifying whether
    a lowercase alphabet is acceptable as input.  For security purposes, the
    default is False.

    The decoded string is returned.  A TypeError is raised if s is
    incorrectly padded or if there are non-alphabet characters present in the
    string.
    """
    if arg_1:
        arg_0 = arg_0.upper()
    if re.search('[^0-9A-F]', arg_0):
        raise TypeError('Non-base16 digit found')
    return binascii.unhexlify(arg_0)


Alternative naming, you can use `node.vars.name` instead of `node.v_name`

def Func ( arg_0 ) : if arg_0 . _Func is None : arg_0 . _Func = NNTreeNodeVars ( arg_0 ) return arg_0 . _Func

def Func(arg_0):
        """Alternative naming, you can use `node.Func.name` instead of `node.v_name`"""
        if arg_0._Func is None:
            arg_0._Func = NNTreeNodeVars(arg_0)
        return arg_0._Func

Alternative naming you can use node . vars . name instead of node . v_name


def Func(arg_0, arg_1):
        """
        Register the layer so that it's param will be trained.
        But the output of the layer will not be stacked.
        """
        if type(arg_1) == Block:
            arg_1.fix()
        arg_0.parameter_count += arg_1.parameter_count
        arg_0.parameters.extend(arg_1.parameters)
        arg_0.free_parameters.extend(arg_1.free_parameters)
        arg_0.training_monitors.extend(arg_1.training_monitors)
        arg_0.testing_monitors.extend(arg_1.testing_monitors)
        arg_0.updates.extend(arg_1.updates)
        arg_0.training_updates.extend(arg_1.training_updates)
        arg_0.input_variables.extend(arg_1.external_inputs)
        arg_0.target_variables.extend(arg_1.external_targets)

        arg_0.training_callbacks.extend(arg_1.training_callbacks)
        arg_0.testing_callbacks.extend(arg_1.testing_callbacks)
        arg_0.epoch_callbacks.extend(arg_1.epoch_callbacks)

Register the layer so that it s param will be trained . But the output of the layer will not be stacked .


def Func ( ) : arg_0 = dict ( ) arg_1 = os . path . join ( 'sregistry' , 'version.py' ) with open ( arg_1 ) as filey : exec ( filey . read ( ) , arg_0 ) return arg_0

def Func():
    '''get version by way of sregistry.version, returns a
    lookup dictionary with several global variables without
    needing to import singularity
    '''
    arg_0 = dict()
    arg_1 = os.path.join('sregistry', 'version.py')
    with open(arg_1) as filey:
        exec(filey.read(), arg_0)
    return arg_0

get version by way of sregistry . version returns a lookup dictionary with several global variables without needing to import singularity


return "[^/]*".join(
        re.escape(bit).replace(r'\[\^', '[^').replace(r'\[', '[').replace(r'\]', ']')
        for bit in part.split("*")
    )

def Func ( arg_0 ) : return "[^/]*" . join ( re . escape ( arg_1 ) . replace ( r'\[\^' , '[^' ) . replace ( r'\[' , '[' ) . replace ( r'\]' , ']' ) for arg_1 in arg_0 . split ( "*" ) )

def Func(arg_0):
    """Convert a path part to regex syntax."""
    return "[^/]*".join(
        re.escape(arg_1).replace(r'\[\^', '[^').replace(r'\[', '[').replace(r'\]', ']')
        for arg_1 in arg_0.split("*")
    )


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_0 . _egg_fetcher arg_2 . package_index . to_scan = [ ] except AttributeError : from setuptools . command . easy_install import easy_install arg_5 = arg_0 . __class__ ( { 'script_args' : [ 'easy_install' ] } ) arg_5 . parse_config_files ( ) arg_6 = arg_5 . get_option_dict ( 'easy_install' ) arg_7 = ( 'find_links' , 'site_dirs' , 'index_url' , 'optimize' , 'site_dirs' , 'allow_hosts' ) for arg_8 in list ( arg_6 ) : if arg_8 not in arg_7 : del arg_6 [ arg_8 ] if arg_0 . dependency_links : arg_9 = arg_0 . dependency_links [ : ] if 'find_links' in arg_6 : arg_9 = arg_6 [ 'find_links' ] [ 1 ] . split ( ) + arg_9 arg_6 [ 'find_links' ] = ( 'setup' , arg_9 ) arg_10 = arg_0 . get_egg_cache_dir ( ) arg_2 = easy_install ( arg_5 , args = [ "x" ] , arg_10 = arg_10 , exclude_scripts = True , always_copy = False , build_directory = None , editable = False , upgrade = False , multi_version = True , no_report = True , user = False ) arg_2 . ensure_finalized ( ) arg_0 . _egg_fetcher = arg_2 return arg_2 . easy_install ( arg_1 )

def Func(arg_0, arg_1):
        """Fetch an egg needed for building"""

        try:
            arg_2 = arg_0._egg_fetcher
            arg_2.package_index.to_scan = []
        except AttributeError:
            from setuptools.command.easy_install import easy_install
            arg_5 = arg_0.__class__({'script_args':['easy_install']})
            arg_5.parse_config_files()
            arg_6 = arg_5.get_option_dict('easy_install')
            arg_7 = (
                'find_links', 'site_dirs', 'index_url', 'optimize',
                'site_dirs', 'allow_hosts'
            )
            for arg_8 in list(arg_6):
                if arg_8 not in arg_7:
                    del arg_6[arg_8]   # don't use any other settings
            if arg_0.dependency_links:
                arg_9 = arg_0.dependency_links[:]
                if 'find_links' in arg_6:
                    arg_9 = arg_6['find_links'][1].split() + arg_9
                arg_6['find_links'] = ('setup', arg_9)
            arg_10 = arg_0.get_egg_cache_dir()
            arg_2 = easy_install(
                arg_5, args=["x"], arg_10=arg_10, exclude_scripts=True,
                always_copy=False, build_directory=None, editable=False,
                upgrade=False, multi_version=True, no_report=True, user=False
            )
            arg_2.ensure_finalized()
            arg_0._egg_fetcher = arg_2
        return arg_2.easy_install(arg_1)


def Func(arg_0, arg_1):
        """Is the file a wanted test file?

        The file must be a python source file and match testMatch or
        include, and not match exclude. Files that match ignore are *never*
        wanted, regardless of plugin, testMatch, include or exclude settings.
        """
        # never, ever load files that match anything in ignore
        # (.* _* and *setup*.py by default)
        arg_2 = op_basename(arg_1)
        arg_3 = [ ignore_this for ignore_this in arg_0.ignoreFiles
                           if ignore_this.search(arg_2) ]
        if arg_3:
            log.debug('%s matches ignoreFiles pattern; skipped',
                      arg_2)
            return False
        if not arg_0.config.includeExe and os.access(arg_1, os.X_OK):
            log.info('%s is executable; skipped', arg_1)
            return False
        arg_4, arg_5 = op_splitext(arg_2)
        arg_6 = arg_5 == '.py'

        arg_7 = arg_6 and arg_0.matches(arg_2)
        arg_8 = arg_0.plugins.Func(arg_1)
        if arg_8 is not None:
            log.debug("plugin setting want %s to %s", arg_1, arg_8)
            arg_7 = arg_8
        log.debug("Func %s? %s", arg_1, arg_7)
        return arg_7


(data, gene_sets, outdir="ssGSEA_", sample_norm_method='rank', min_size=15, max_size=2000,
           permutation_num=0, weighted_score_type=0.25, scale=True, ascending=False, processes=1,
           figsize=(7,6), format='pdf', graph_num=20, no_plot=False, seed=None, verbose=False)

def Func(arg_0, arg_1, arg_2="ssGSEA_", arg_3='rank', arg_4=15, arg_5=2000,
           arg_6=0, arg_7=0.25, arg_8=True, arg_9=False, arg_10=1,
           arg_11=(7,6), arg_12='pdf', arg_13=20, arg_14=False, arg_15=None, arg_16=False):
    """Run Gene Set Enrichment Analysis with single sample GSEA tool

    :param data: Expression table, pd.Series, pd.DataFrame, GCT file, or .rnk file format.
    :param gene_sets: Enrichr Library name or .gmt gene sets file or dict of gene sets. Same input with GSEA.
    :param outdir: Results output directory.
    :param str sample_norm_method: "Sample normalization method. Choose from {'rank', 'log', 'log_rank'}. Default: rank.

               1. 'rank': Rank your expression data, and transform by 10000*rank_dat/gene_numbers
               2. 'log' : Do not rank, but transform data by log(data + exp(1)), while data = data[data<1] =1.
               3. 'log_rank': Rank your expression data, and transform by log(10000*rank_dat/gene_numbers+ exp(1))
               4. 'custom': Do nothing, and use your own rank value to calculate enrichment score.

    see here: https://github.com/GSEA-MSigDB/ssGSEAProjection-gpmodule/blob/master/src/ssGSEAProjection.Library.R, line 86

    :param int min_size: Minimum allowed number of genes from gene set also the data set. Default: 15.
    :param int max_size: Maximum allowed number of genes from gene set also the data set. Default: 2000.
    :param int permutation_num: Number of permutations for significance computation. Default: 0.
    :param str weighted_score_type: Refer to :func:`algorithm.enrichment_score`. Default:0.25.
    :param bool scale: If True, normalize the scores by number of genes in the gene sets.
    :param bool ascending: Sorting order of rankings. Default: False.
    :param int processes: Number of Processes you are going to use. Default: 1.
    :param list figsize: Matplotlib figsize, accept a tuple or list, e.g. [width,height]. Default: [7,6].
    :param str format: Matplotlib figure format. Default: 'pdf'.
    :param int graph_num: Plot graphs for top sets of each phenotype.
    :param bool no_plot: If equals to True, no figure will be drawn. Default: False.
    :param seed: Random seed. expect an integer. Default:None.
    :param bool verbose: Bool, increase output verbosity, print out progress of your job, Default: False.

    :return: Return a ssGSEA obj.
             All results store to  a dictionary, access enrichment score by obj.resultsOnSamples,
             and normalized enrichment score by obj.res2d.
             if permutation_num > 0, additional results contain::

                 | {es: enrichment score,
                 |  nes: normalized enrichment score,
                 |  p: P-value,
                 |  fdr: FDR,
                 |  size: gene set size,
                 |  matched_size: genes matched to the data,
                 |  genes: gene names from the data set
                 |  ledge_genes: leading edge genes, if permutation_num >0}

    """

    arg_17 = SingleSampleGSEA(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                          arg_6, arg_7, arg_8, arg_9,
                          arg_10, arg_11, arg_12, arg_13, arg_14, arg_15, arg_16)
    arg_17.run()
    return arg_17


def Func ( arg_0 ) : arg_1 = get_namespace ( arg_0 , 'w' ) arg_2 = arg_0 . find ( '%srPr' % arg_1 ) if arg_2 is None : return False arg_3 = arg_2 . find ( '%su' % arg_1 ) return style_is_false ( arg_3 )

def Func(arg_0):
    """
    The function will return True if the r tag passed in is considered
    underlined.
    """
    arg_1 = get_namespace(arg_0, 'w')
    arg_2 = arg_0.find('%srPr' % arg_1)
    if arg_2 is None:
        return False
    arg_3 = arg_2.find('%su' % arg_1)
    return style_is_false(arg_3)

The function will return True if the r tag passed in is considered underlined .


def Func(arg_0, arg_1):
        """
        Estimate the moment when the underlying process is expected to reach completion.

        This function should only return future times. Also this function is not allowed to return time moments less
        than self._next_poll_time if the actual progress is below 100% (this is because we won't know that the
        process have finished until we poll the external progress function).
        """
        assert arg_0._next_poll_time >= arg_1
        arg_2, arg_3 = arg_0._progress_data[-1]
        # If reached 100%, make sure that we finish as soon as possible, but maybe not immediately
        if arg_3 == arg_0._maxval:
            arg_4 = (1 - arg_0._x0) / arg_0._v0 + arg_0._t0
            return clamp(arg_4, arg_1, arg_1 + arg_0.FINISH_DELAY)

        # Calculate the approximate speed of the raw progress based on recent data
        arg_5, arg_6 = 0, 0
        arg_7 = arg_0.GAMMA
        for arg_8, arg_9 in arg_0._progress_data[-2::-1]:
            arg_5 += arg_7 * (arg_2 - arg_8)
            arg_6 += arg_7 * (arg_3 - arg_9)
            arg_7 *= arg_0.GAMMA
            if arg_7 < 1e-2: break

        # If there was no progress at all, then just assume it's 5 minutes from now
        if arg_6 == 0: return arg_1 + 300

        # Estimate the completion time assuming linear progress
        arg_10 = arg_2 + arg_5 * (arg_0._maxval - arg_3) / arg_6

        # Adjust the estimate if it looks like it may happen too soon
        if arg_10 <= arg_0._next_poll_time:
            arg_10 = arg_0._next_poll_time + arg_0.FINISH_DELAY

        return arg_10

Estimate the moment when the underlying process is expected to reach completion .


def Func ( arg_0 ) : def update_single_w ( arg_1 ) : arg_2 = base . matrix ( np . float64 ( np . dot ( - arg_0 . data . T , arg_7 [ : , arg_1 ] ) ) ) arg_3 = solvers . qp ( arg_5 , arg_2 , arg_8 , arg_9 , arg_10 , arg_6 ) arg_0 . beta [ arg_1 , : ] = np . array ( arg_3 [ 'x' ] ) . reshape ( ( 1 , arg_0 . _num_samples ) ) arg_5 = base . matrix ( np . float64 ( np . dot ( arg_0 . data [ : , : ] . T , arg_0 . data [ : , : ] ) ) ) arg_6 = base . matrix ( 1.0 , ( 1 , 1 ) ) arg_7 = np . dot ( arg_0 . data , pinv ( arg_0 . H ) ) arg_8 = base . matrix ( - np . eye ( arg_0 . _num_samples ) ) arg_9 = base . matrix ( 0.0 , ( arg_0 . _num_samples , 1 ) ) arg_10 = base . matrix ( 1.0 , ( 1 , arg_0 . _num_samples ) ) for arg_1 in range ( arg_0 . _num_bases ) : update_single_w ( arg_1 ) arg_0 . W = np . dot ( arg_0 . beta , arg_0 . data . T ) . T

def Func(arg_0):
        """ alternating least squares step, update W under the convexity
        constraint """
        def update_single_w(arg_1):
            """ compute single W[:,i] """
            # optimize beta     using qp solver from cvxopt
            arg_2 = base.matrix(np.float64(np.dot(-arg_0.data.T, arg_7[:,arg_1])))
            arg_3 = solvers.qp(arg_5, arg_2, arg_8, arg_9, arg_10, arg_6)
            arg_0.beta[arg_1,:] = np.array(arg_3['x']).reshape((1, arg_0._num_samples))

        # float64 required for cvxopt
        arg_5 = base.matrix(np.float64(np.dot(arg_0.data[:,:].T, arg_0.data[:,:])))
        arg_6 = base.matrix(1.0, (1, 1))
        arg_7 = np.dot(arg_0.data, pinv(arg_0.H))
        arg_8 = base.matrix(-np.eye(arg_0._num_samples))
        arg_9 = base.matrix(0.0, (arg_0._num_samples, 1))
        arg_10 = base.matrix(1.0, (1, arg_0._num_samples))

        for arg_1 in range(arg_0._num_bases):
            update_single_w(arg_1)

        arg_0.W = np.dot(arg_0.beta, arg_0.data.T).T

alternating least squares step update W under the convexity constraint


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
if
not
_is_tensor_image
(
arg_0
)
:
raise
TypeError
(
'tensor is not a torch image.'
)
if
not
arg_3
:
arg_0
=
arg_0
.
clone
(
)
arg_1
=
torch
.
as_tensor
(
arg_1
,
dtype
=
torch
.
float32
,
device
=
arg_0
.
device
)
arg_2
=
torch
.
as_tensor
(
arg_2
,
dtype
=
torch
.
float32
,
device
=
arg_0
.
device
)
arg_0
.
sub_
(
arg_1
[
:
,
,
]
)
.
div_
(
arg_2
[
:
,
,
]
)
return
arg_0

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """Normalize a tensor image with mean and standard deviation.

    .. note::
        This transform acts out of place by default, i.e., it does not mutates the input tensor.

    See :class:`~torchvision.transforms.Normalize` for more details.

    Args:
        tensor (Tensor): Tensor image of size (C, H, W) to be Funcd.
        mean (sequence): Sequence of means for each channel.
        std (sequence): Sequence of standard deviations for each channel.

    Returns:
        Tensor: Normalized Tensor image.
    """
    if not _is_tensor_image(arg_0):
        raise TypeError('tensor is not a torch image.')

    if not arg_3:
        arg_0 = arg_0.clone()

    arg_1 = torch.as_tensor(arg_1, dtype=torch.float32, device=arg_0.device)
    arg_2 = torch.as_tensor(arg_2, dtype=torch.float32, device=arg_0.device)
    arg_0.sub_(arg_1[:, None, None]).div_(arg_2[:, None, None])
    return arg_0

Normalize a tensor image with mean and standard deviation.

    .. note::
        This transform acts out of place by default, i.e., it does not mutates the input tensor.

    See :class:`~torchvision.transforms.Normalize` for more details.

    Args:
        tensor (Tensor): Tensor image of size (C, H, W) to be normalized.
        mean (sequence): Sequence of means for each channel.
        std (sequence): Sequence of standard deviations for each channel.

    Returns:
        Tensor: Normalized Tensor image.

Normalize a tensor image with mean and standard deviation .


return render(request, self.template, context)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _build_context ( arg_1 , arg_2 ) arg_4 = TransmitEnterpriseCoursesForm ( ) arg_3 . update ( { arg_0 . ContextParameters . TRANSMIT_COURSES_METADATA_FORM : arg_4 } ) return render ( arg_1 , arg_0 . template , arg_3 )

def Func(arg_0, arg_1, arg_2):
        """
        Handle GET request - render "Transmit courses metadata" form.

        Arguments:
            request (django.http.request.HttpRequest): Request instance
            enterprise_customer_uuid (str): Enterprise Customer UUID

        Returns:
            django.http.response.HttpResponse: HttpResponse
        """
        arg_3 = arg_0._build_context(arg_1, arg_2)
        arg_4 = TransmitEnterpriseCoursesForm()
        arg_3.update({arg_0.ContextParameters.TRANSMIT_COURSES_METADATA_FORM: arg_4})

        return render(arg_1, arg_0.template, arg_3)

Handle GET request - render Transmit courses metadata form .


def Func ( arg_0 , arg_1 = '' , arg_2 = arg_3 ( arg_4 . date . today ( ) ) ) : arg_0 . remove_date ( arg_1 = arg_1 , arg_2 = arg_2 ) arg_6 = os . path . isfile ( arg_1 ) with open ( arg_1 , 'a' ) as out_languages : if not arg_6 : out_languages . write ( 'date,language,count,size,size_log\n' ) arg_7 = sorted ( arg_0 . languages_size ) for arg_8 in arg_7 : try : out_languages . write ( arg_2 + ',' + arg_8 + ',' + arg_3 ( arg_0 . languages [ arg_8 ] ) + ',' + arg_3 ( arg_0 . languages_size [ arg_8 ] ) + ',' + arg_3 ( math . log10 ( int ( arg_0 . languages_size [ arg_8 ] ) ) ) + '\n' ) except ( TypeError , KeyError ) as e : out_languages . write ( arg_2 + ',' + arg_8 + ',' + arg_3 ( 0 ) + ',' + arg_3 ( arg_0 . languages_size [ arg_8 ] ) + ',' + arg_3 ( math . log10 ( int ( arg_0 . languages_size [ arg_8 ] ) ) ) + '\n' )

def Func(arg_0, arg_1='',arg_2=arg_3(arg_4.date.today())):
        """
        Updates languages.csv file with current data.
        """
        arg_0.remove_date(arg_1=arg_1, arg_2=arg_2)
        arg_6 = os.path.isfile(arg_1)
        with open(arg_1, 'a') as out_languages:
            if not arg_6:
                out_languages.write('date,language,count,size,size_log\n')
            arg_7 = sorted(arg_0.languages_size)
            #self.delete_last_line(date=date, file_path=file_path)
            for arg_8 in arg_7:
                try:
                    out_languages.write(arg_2 + ',' + arg_8 + ','
                        + arg_3(arg_0.languages[arg_8]) + ','
                        + arg_3(arg_0.languages_size[arg_8]) + ','
                        + arg_3(math.log10(int(arg_0.languages_size[arg_8])))
                        + '\n')
                except (TypeError, KeyError) as e:
                    out_languages.write(arg_2 + ',' + arg_8 + ','
                        + arg_3(0) + ','
                        + arg_3(arg_0.languages_size[arg_8]) + ','
                        + arg_3(math.log10(int(arg_0.languages_size[arg_8])))
                        + '\n')

Updates languages . csv file with current data .


(obj, arg, msg_on_error, min_value=None, max_value=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
)
:
if
''
==
arg_1
.
strip
(
)
:
arg_0
.
errmsg
(
"You need to supply a number."
)
return
arg_0
.
debugger
.
settings
[
arg_0
.
name
]
=
get_an_int
(
arg_0
.
errmsg
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
return
arg_0
.
debugger
.
settings
[
arg_0
.
name
]

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
    """set an Integer-valued debugger setting. 'obj' is a generally a
    subcommand that has 'name' and 'debugger.settings' attributes"""
    if '' == arg_1.strip():
        arg_0.errmsg("You need to supply a number.")
        return
    arg_0.debugger.settings[arg_0.name] = \
        get_an_int(arg_0.errmsg, arg_1, arg_2, arg_3, arg_4)
    return arg_0.debugger.settings[arg_0.name]

set an Integer - valued debugger setting . obj is a generally a subcommand that has name and debugger . settings attributes


return reverse('%s:detail' % URL_NAMESPACE, kwargs={
            'module': self.module,
            'preview': type(self).__name__,
        })

def Func ( arg_0 ) : return reverse ( '%s:detail' % URL_NAMESPACE , kwargs = { 'module' : arg_0 . module , 'preview' : type ( arg_0 ) . __name__ , } )

def Func(arg_0):
        """
        The URL to access this preview.
        """
        return reverse('%s:detail' % URL_NAMESPACE, kwargs={
            'module': arg_0.module,
            'preview': type(arg_0).__name__,
        })


def Func ( arg_0 , ** arg_1 ) : arg_0 . yacc = arg_2 . yacc ( module = arg_0 , ** arg_1 )

def Func(arg_0, **arg_1):
        """Must be called before parse."""
        arg_0.yacc = arg_2.yacc(module=arg_0, **arg_1)


def Func ( arg_0 ) : if arg_0 . _Func is None : arg_0 . _Func = ImageDriver ( arg_0 . ds . GetDriver ( ) ) return arg_0 . _Func

def Func(arg_0):
        """Returns the underlying ImageDriver instance."""
        if arg_0._Func is None:
            arg_0._Func = ImageDriver(arg_0.ds.GetDriver())
        return arg_0._Func

Returns the underlying ImageDriver instance .


def Func(arg_0, arg_1):
        """Retrieve a list of metadata objects associated with the specified
        list of CoreBluetooth objects.  If an object cannot be found then an
        exception is thrown.
        """
        try:
            with arg_0._lock:
                return [arg_0._metadata[arg_2] for arg_2 in arg_1]
        except KeyError:
            # Note that if this error gets thrown then the assumption that OSX
            # will pass back to callbacks the exact CoreBluetooth objects that
            # were used previously is broken! (i.e. the CoreBluetooth objects
            # are not stateless)
            raise RuntimeError('Failed to find expected metadata for CoreBluetooth object!')

Retrieve a list of metadata objects associated with the specified list of CoreBluetooth objects . If an object cannot be found then an exception is thrown .


def
Func
(
arg_0
)
:
arg_1
=
[
]
if
arg_0
is
:
return
out_str
arg_2
=
arg_0
.
split
(
','
)
for
arg_3
in
arg_2
:
arg_4
=
arg_3
.
split
(
'='
)
arg_5
=
arg_4
[
0
]
.
split
(
' '
)
if
arg_5
[
1
]
==
''
and
len
(
arg_5
)
>
1
:
arg_6
=
arg_5
[
2
]
else
:
arg_6
=
arg_5
[
1
]
if
len
(
arg_4
)
>
1
:
arg_6
+=
'='
+
arg_4
[
1
]
arg_1
.
append
(
arg_6
)
return
','
.
join
(
arg_1
)

def Func(arg_0):
    """
    Remove types from function arguments in cython
    """
    arg_1 = []
    # If there aren't any arguments return the empty string
    if arg_0 is None:
        return out_str
    arg_2 = arg_0.split(',')
    for arg_3 in arg_2:
        arg_4 = arg_3.split('=')
        arg_5=arg_4[0].split(' ')
        # There is probably type info
        if arg_5[-1]=='' and len(arg_5)>1:
            arg_6=arg_5[-2]
        else:
            arg_6=arg_5[-1]
        # if there are default parameters
        if len(arg_4)>1:
            arg_6+='='+arg_4[1]

        arg_1.append(arg_6)
    return ','.join(arg_1)


(lines_or_file, namedtuples=False, dicts=False, encoding='utf-8', **kw)

def Func(arg_0, arg_1=False, arg_2=False, arg_3='utf-8', **arg_4):
    """Convenience factory function for csv reader.

    :param lines_or_file: Content to be read. Either a file handle, a file path or a list\
    of strings.
    :param namedtuples: Yield namedtuples.
    :param dicts: Yield dicts.
    :param encoding: Encoding of the content.
    :param kw: Keyword parameters are passed through to csv.reader.
    :return: A generator over the rows.
    """
    if arg_1 and arg_2:
        raise ValueError('either namedtuples or dicts can be chosen as output format')
    elif arg_1:
        arg_5 = NamedTupleReader
    elif arg_2:
        arg_5 = UnicodeDictReader
    else:
        arg_5 = UnicodeReader

    with arg_5(arg_0, arg_3=arg_3, **fix_kw(arg_4)) as r:
        for arg_6 in r:
            yield arg_6

Convenience factory function for csv reader .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
in
(
arg_0
.
CORNER
,
arg_0
.
CENTER
,
arg_0
.
CORNERS
)
:
arg_0
.
ellipsemode
=
arg_1
return
arg_0
.
ellipsemode
elif
arg_1
is
:
return
arg_0
.
ellipsemode
else
:
raise
ShoebotError
(
_
(
"ellipsemode: invalid input"
)
)

def Func(arg_0, arg_1=None):
        '''
        Set the current ellipse drawing mode.

        :param mode: CORNER, CENTER, CORNERS
        :return: ellipsemode if mode is None or valid.
        '''
        if arg_1 in (arg_0.CORNER, arg_0.CENTER, arg_0.CORNERS):
            arg_0.ellipsemode = arg_1
            return arg_0.ellipsemode
        elif arg_1 is None:
            return arg_0.ellipsemode
        else:
            raise ShoebotError(_("ellipsemode: invalid input"))


Returns a sorted list of physical_qubits

def Func ( arg_0 ) : if arg_0 . _qubit_list is None : arg_0 . _qubit_list = sorted ( [ pqubit for pqubit in arg_0 . graph . nodes ] ) return arg_0 . _qubit_list

def Func(arg_0):
        """Returns a sorted list of Func"""
        if arg_0._qubit_list is None:
            arg_0._qubit_list = sorted([pqubit for pqubit in arg_0.graph.nodes])
        return arg_0._qubit_list


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/SendDigits/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Send digits to a Call
        """
        arg_2 = '/' + arg_0.api_version + '/SendDigits/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0):
        """
        Look at the stdout log and figure out which port the JVM chose.

        If successful, port number is stored in self.port; otherwise the
        program is terminated. This call is blocking, and will wait for
        up to 30s for the server to start up.
        """
        arg_1 = re.compile(r"Open H2O Flow in your web browser: https?://([^:]+):(\d+)")
        arg_2 = 30
        while arg_2 and not arg_0.terminated:
            with open(arg_0.output_file_name, "r") as f:
                for arg_3 in f:
                    arg_4 = re.search(arg_1, arg_3)
                    if arg_4 is not None:
                        arg_0.port = arg_4.group(2)
                        print("H2O cloud %d node %d listening on port %s\n    with output file %s" %
                              (arg_0.cloud_num, arg_0.node_num, arg_0.port, arg_0.output_file_name))
                        return
            if arg_0.terminated: break
            arg_2 -= 1
            time.sleep(1)

        if arg_0.terminated: return
        print("\nERROR: Too many retries starting cloud %d.\nCheck the output log %s.\n" %
              (arg_0.cloud_num, arg_0.output_file_name))
        sys.exit(1)

Look at the stdout log and figure out which port the JVM chose .


def Func ( arg_0 , arg_1 = 3 , arg_2 = 'int' ) : if not hasattr ( arg_0 , '__iter__' ) : return np . array ( [ arg_0 ] * arg_1 , arg_2 = arg_2 ) return np . array ( arg_0 ) . astype ( arg_2 )

def Func(arg_0, arg_1=3, arg_2='int'):
    """
    Convert an integer or iterable list to numpy array of length dim. This func
    is used to allow other methods to take both scalars non-numpy arrays with
    flexibility.

    Parameters
    ----------
    a : number, iterable, array-like
        The object to convert to numpy array

    dim : integer
        The length of the resulting array

    dtype : string or np.dtype
        Type which the resulting array should be, e.g. 'float', np.int8

    Returns
    -------
    arr : numpy array
        Resulting numpy array of length ``dim`` and type ``dtype``

    Examples
    --------
    >>> Func(1, dim=2, dtype='float')
    array([ 1.,  1.])

    >>> Func(1, dtype='int')
    array([1, 1, 1])

    >>> Func(np.array([1,2,3]), dtype='float')
    array([ 1.,  2.,  3.])
    """
    if not hasattr(arg_0, '__iter__'):
        return np.array([arg_0]*arg_1, arg_2=arg_2)
    return np.array(arg_0).astype(arg_2)

Convert an integer or iterable list to numpy array of length dim. This func
    is used to allow other methods to take both scalars non-numpy arrays with
    flexibility.

    Parameters
    ----------
    a : number, iterable, array-like
        The object to convert to numpy array

    dim : integer
        The length of the resulting array

    dtype : string or np.dtype
        Type which the resulting array should be, e.g. 'float', np.int8

    Returns
    -------
    arr : numpy array
        Resulting numpy array of length ``dim`` and type ``dtype``

    Examples
    --------
    >>> aN(1, dim=2, dtype='float')
    array([ 1.,  1.])

    >>> aN(1, dtype='int')
    array([1, 1, 1])

    >>> aN(np.array([1,2,3]), dtype='float')
    array([ 1.,  2.,  3.])

Convert an integer or iterable list to numpy array of length dim . This func is used to allow other methods to take both scalars non - numpy arrays with flexibility .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = messages . ResponseBatchItem ( result_status = contents . ResultStatus ( enums . ResultStatus . OPERATION_FAILED ) , result_reason = contents . ResultReason ( arg_2 ) , result_message = contents . ResultMessage ( arg_3 ) ) return arg_0 . _build_response ( arg_1 , [ arg_4 ] )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Build a simple ResponseMessage with a single error result.

        Args:
            version (ProtocolVersion): The protocol version the response
                should be addressed with.
            reason (ResultReason): An enumeration classifying the type of
                error occurred.
            message (str): A string providing additional information about
                the error.

        Returns:
            ResponseMessage: The simple ResponseMessage containing a
                single error result.
        """
        arg_4 = messages.ResponseBatchItem(
            result_status=contents.ResultStatus(
                enums.ResultStatus.OPERATION_FAILED
            ),
            result_reason=contents.ResultReason(arg_2),
            result_message=contents.ResultMessage(arg_3)
        )
        return arg_0._build_response(arg_1, [arg_4])

Build a simple ResponseMessage with a single error result .


def Func ( arg_0 ) : arg_1 = arg_0 . registry . settings arg_2 = SignedCookieSessionFactory ( arg_1 [ 'session_key' ] ) arg_0 . set_session_factory ( arg_2 )

def Func(arg_0):
    """Configures the session manager"""
    arg_1 = arg_0.registry.settings
    arg_2 = SignedCookieSessionFactory(arg_1['session_key'])
    arg_0.set_session_factory(arg_2)


def Func(arg_0):
    '''
    get the xsd name of a S_DT
    '''
    arg_1 = nav_one(arg_0).S_CDT[17]()
    if arg_1 and arg_1.Core_Typ in range(1, 6):
        return arg_0.Name

    arg_2 = nav_one(arg_0).S_EDT[17]()
    if arg_2:
        return arg_0.Name

    arg_3 = nav_one(arg_0).S_UDT[17]()
    if arg_3:
        return arg_0.Name


return Metric(self,
                  "# predicted => active cells per column for each sequence",
                  numCellsPerColumn)

def Func(arg_0):
    """
    Metric for number of predicted => active cells per column for each sequence

    @return (Metric) metric
    """
    arg_0._mmComputeTransitionTraces()

    arg_1 = []

    for arg_2 in (
        arg_0._mmData["predictedActiveCellsForSequence"].values()):
      arg_3 = arg_0.mapCellsToColumns(arg_2)
      arg_1 += [len(arg_4) for arg_4 in arg_3.values()]

    return Metric(arg_0,
                  "# predicted => active cells per column for each sequence",
                  arg_1)

Metric for number of predicted = > active cells per column for each sequence


Returns the current token if it satisfies the guard function provided.

    Fails otherwise.
    This is the a generalisation of one_of.

def
Func
(
arg_0
)
:
arg_1
=
peek
(
)
if
(
arg_1
is
EndOfFile
)
or
(
not
arg_0
(
arg_1
)
)
:
fail
(
[
"<Func predicate "
+
_fun_to_str
(
arg_0
)
+
">"
]
)
next
(
)
return
arg_1

def Func(arg_0):
    """Returns the current token if it Func the guard function provided.

    Fails otherwise.
    This is the a generalisation of one_of.
    """
    arg_1 = peek()
    if (arg_1 is EndOfFile) or (not arg_0(arg_1)):
        fail(["<Func predicate " + _fun_to_str(arg_0) + ">"])
    next()
    return arg_1

Returns the current token if it satisfies the guard function provided . Fails otherwise . This is the a generalisation of one_of .


def Func ( arg_0 ) : if arg_0 . _server is not None : arg_0 . _server . shutdown ( ) arg_0 . _server . server_close ( ) arg_0 . _server = None

def Func(arg_0):
        """Stop the simple WSGI server running the appliation."""
        if arg_0._server is not None:
            arg_0._server.shutdown()
            arg_0._server.server_close()
            arg_0._server = None

Stop the simple WSGI server running the appliation .


def Func(arg_0, arg_1, arg_2=False):
    """Find path for given workspace and|or repository."""
    arg_3 = Workspace(arg_1)
    arg_1 = arg_1["workspaces"]

    arg_4 = {}

    if arg_0.find('/') != -1:
        arg_2 = False
        try:
            arg_5, arg_6 = arg_0.split('/')
        except ValueError:
            raise ValueError("There is too many / in `name` argument. "
                             "Argument syntax: `workspace/repository`.")
        if (arg_3.exists(arg_5)):
            if (arg_6 in arg_1[arg_5]["repositories"]):
                arg_7 = "%s/%s" % (arg_5, arg_6)
                arg_4[arg_7] = arg_1[arg_5]["repositories"][arg_6]

    for arg_8, arg_5 in sorted(arg_1.items()):
        if (arg_0 == arg_8):
            if arg_2 is True:
                return {arg_8: arg_5["path"]}
            arg_9 = sorted(arg_1[arg_8]["repositories"].items())
            for arg_0, arg_10 in arg_9:
                arg_4["%s/%s" % (arg_8, arg_0)] = arg_10
            break

        for arg_11, arg_12 in sorted(arg_5["repositories"].items()):
            if (arg_11 == arg_0):
                arg_4["%s/%s" % (arg_8, arg_11)] = arg_12

    return arg_4

Find path for given workspace and|or repository .


(
    fullname: str, mtime: int, source_size: int, cache_data: bytes
)

def Func(
    arg_0: arg_1, arg_2: arg_3, arg_4: arg_3, arg_5: arg_6
) -> List[types.CodeType]:
    """Unmarshal the bytes from a Basilisp bytecode cache file, validating the
    file header prior to returning. If the file header does not match, throw
    an exception."""
    arg_7 = {"name": arg_0}
    arg_8 = arg_5[:4]
    arg_9 = arg_5[4:8]
    arg_10 = arg_5[8:12]
    if arg_8 != MAGIC_NUMBER:
        arg_11 = (
            f"Incorrect magic number ({magic}) in {fullname}; expected {MAGIC_NUMBER}"
        )
        logger.debug(arg_11)
        raise ImportError(arg_11, **arg_7)  # type: ignore
    elif len(arg_9) != 4:
        arg_11 = f"Reached EOF while reading timestamp in {fullname}"
        logger.debug(arg_11)
        raise EOFError(arg_11)
    elif _r_long(arg_9) != arg_2:
        arg_11 = f"Non-matching timestamp ({_r_long(raw_timestamp)}) in {fullname} bytecode cache; expected {mtime}"
        logger.debug(arg_11)
        raise ImportError(arg_11, **arg_7)  # type: ignore
    elif len(arg_10) != 4:
        arg_11 = f"Reached EOF while reading size of source in {fullname}"
        logger.debug(arg_11)
        raise EOFError(arg_11)
    elif _r_long(arg_10) != arg_4:
        arg_11 = f"Non-matching filesize ({_r_long(raw_size)}) in {fullname} bytecode cache; expected {source_size}"
        logger.debug(arg_11)
        raise ImportError(arg_11, **arg_7)  # type: ignore

    return marshal.loads(arg_5[12:])

Unmarshal the bytes from a Basilisp bytecode cache file validating the file header prior to returning . If the file header does not match throw an exception .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
np
.
zeros
(
4
,
dtype
=
float
)
if
arg_1
==
'x'
:
arg_2
[
1
]
=
1
elif
arg_1
==
'y'
:
arg_2
[
2
]
=
1
elif
arg_1
==
'z'
:
arg_2
[
3
]
=
1
else
:
raise
ValueError
(
'Invalid axis input.'
)
arg_2
*=
math
.
sin
(
arg_0
/
2.0
)
arg_2
[
0
]
=
math
.
cos
(
arg_0
/
2.0
)
return
Quaternion
(
arg_2
)

def Func(arg_0, arg_1):
    """Return quaternion for rotation about given axis.

    Args:
        angle (float): Angle in radians.
        axis (str): Axis for rotation

    Returns:
        Quaternion: Quaternion for axis rotation.

    Raises:
        ValueError: Invalid input axis.
    """
    arg_2 = np.zeros(4, dtype=float)
    if arg_1 == 'x':
        arg_2[1] = 1
    elif arg_1 == 'y':
        arg_2[2] = 1
    elif arg_1 == 'z':
        arg_2[3] = 1
    else:
        raise ValueError('Invalid axis input.')
    arg_2 *= math.sin(arg_0/2.0)
    arg_2[0] = math.cos(arg_0/2.0)
    return Quaternion(arg_2)

Return quaternion for rotation about given axis .


def Func(arg_0):
        ''' Passes cleanly if we're allowed to pay, otherwise raise
        a ValidationError. '''

        arg_0._refresh()

        if not arg_0.invoice.is_unpaid:
            raise ValidationError("You can only pay for unpaid invoices.")

        if not arg_0.invoice.cart:
            return

        if not arg_0._invoice_matches_cart():
            raise ValidationError("The registration has been amended since "
                                  "generating this invoice.")

        CartController(arg_0.invoice.cart).validate_cart()

Passes cleanly if we re allowed to pay otherwise raise a ValidationError .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = chunk_to_matrices ( arg_0 , arg_1 , arg_2 ) arg_5 = np . zeros ( ( 3 , 16 ) , dtype = np . float64 ) arg_6 = np . zeros ( 3 , dtype = np . float64 ) arg_7 = np . zeros ( 3 , dtype = np . float64 ) for arg_8 in range ( 3 ) : arg_5 [ arg_8 ] = np . linalg . svd ( arg_4 [ arg_8 ] . astype ( np . float64 ) ) [ 1 ] arg_7 [ arg_8 ] = np . linalg . matrix_rank ( arg_4 [ arg_8 ] . astype ( np . float64 ) ) arg_9 = int ( min ( 11 , arg_7 . min ( ) ) ) for arg_8 in range ( 3 ) : arg_6 [ arg_8 ] = np . sqrt ( np . sum ( arg_5 [ arg_8 , arg_9 : ] ** 2 ) ) arg_10 = np . where ( arg_6 == arg_6 . min ( ) ) [ 0 ] arg_11 = arg_3 [ arg_10 ] [ 0 ] arg_12 = count_snps ( arg_4 [ arg_10 ] [ 0 ] ) return arg_11 , arg_12

def Func(arg_0, arg_1, arg_2, arg_3):
    """ groups together several numba compiled funcs """

    ## create empty matrices
    #LOGGER.info("tests[0] %s", tests[0])
    #LOGGER.info('seqnon[[tests[0]]] %s', seqnon[[tests[0]]])
    arg_4 = chunk_to_matrices(arg_0, arg_1, arg_2)

    ## empty svdscores for each arrangement of seqchunk
    arg_5 = np.zeros((3, 16), dtype=np.float64)
    arg_6 = np.zeros(3, dtype=np.float64)
    arg_7 = np.zeros(3, dtype=np.float64)

    for arg_8 in range(3):
        ## get svd scores
        arg_5[arg_8] = np.linalg.svd(arg_4[arg_8].astype(np.float64))[1]
        arg_7[arg_8] = np.linalg.matrix_rank(arg_4[arg_8].astype(np.float64))

    ## get minrank, or 11
    arg_9 = int(min(11, arg_7.min()))
    for arg_8 in range(3):
        arg_6[arg_8] = np.sqrt(np.sum(arg_5[arg_8, arg_9:]**2))

    ## sort to find the best qorder
    arg_10 = np.where(arg_6 == arg_6.min())[0]
    #best = qscores[qscores == qscores.min()][0]
    arg_11 = arg_3[arg_10][0]
    arg_12 = count_snps(arg_4[arg_10][0])

    return arg_11, arg_12


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
arg_0
.
_is_owned
(
)
:
raise
RuntimeError
(
"cannot Func on un-acquired lock"
)
arg_2
=
_allocate_lock
(
)
arg_2
.
acquire
(
)
arg_0
.
__Funcers
.
append
(
arg_2
)
arg_3
=
arg_0
.
_release_save
(
)
try
:
if
arg_1
is
:
arg_2
.
acquire
(
)
if
__debug__
:
arg_0
.
_note
(
"%s.Func(): got it"
,
arg_0
)
else
:
arg_4
=
_time
(
)
+
arg_1
arg_5
=
0.0005
while
True
:
arg_6
=
arg_2
.
acquire
(
0
)
if
arg_6
:
break
arg_7
=
arg_4
_time
(
)
if
arg_7
<=
0
:
break
arg_5
=
min
(
arg_5
*
2
,
arg_7
,
.05
)
_sleep
(
arg_5
)
if
not
arg_6
:
if
__debug__
:
arg_0
.
_note
(
"%s.Func(%s): timed out"
,
arg_0
,
arg_1
)
try
:
arg_0
.
__Funcers
.
remove
(
arg_2
)
except
ValueError
:
pass
else
:
if
__debug__
:
arg_0
.
_note
(
"%s.Func(%s): got it"
,
arg_0
,
arg_1
)
finally
:
arg_0
.
_acquire_restore
(
arg_3
)

def Func(arg_0, arg_1=None):
        """Wait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notifyAll() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        """
        if not arg_0._is_owned():
            raise RuntimeError("cannot Func on un-acquired lock")
        arg_2 = _allocate_lock()
        arg_2.acquire()
        arg_0.__Funcers.append(arg_2)
        arg_3 = arg_0._release_save()
        try:    # restore state no matter what (e.g., KeyboardInterrupt)
            if arg_1 is None:
                arg_2.acquire()
                if __debug__:
                    arg_0._note("%s.Func(): got it", arg_0)
            else:
                # Balancing act:  We can't afford a pure busy loop, so we
                # have to sleep; but if we sleep the whole timeout time,
                # we'll be unresponsive.  The scheme here sleeps very
                # little at first, longer as time goes on, but never longer
                # than 20 times per second (or the timeout time remaining).
                arg_4 = _time() + arg_1
                arg_5 = 0.0005 # 500 us -> initial delay of 1 ms
                while True:
                    arg_6 = arg_2.acquire(0)
                    if arg_6:
                        break
                    arg_7 = arg_4 - _time()
                    if arg_7 <= 0:
                        break
                    arg_5 = min(arg_5 * 2, arg_7, .05)
                    _sleep(arg_5)
                if not arg_6:
                    if __debug__:
                        arg_0._note("%s.Func(%s): timed out", arg_0, arg_1)
                    try:
                        arg_0.__Funcers.remove(arg_2)
                    except ValueError:
                        pass
                else:
                    if __debug__:
                        arg_0._note("%s.Func(%s): got it", arg_0, arg_1)
        finally:
            arg_0._acquire_restore(arg_3)

Wait until notified or until a timeout occurs .


def Func(arg_0):
        """Method representing the thread's activity.

        You may override this method in a subclass. The standard Func() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        """
        try:
            if arg_0.__target:
                arg_0.__target(*arg_0.__args, **arg_0.__kwargs)
        finally:
            # Avoid a refcycle if the thread is Funcning a function with
            # an argument that has a member that points to the thread.
            del arg_0.__target, arg_0.__args, arg_0.__kwargs

Method representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

Method representing the thread s activity .


def
Func
(
arg_0
)
:
def
Func_str
(
arg_0
)
:
arg_1
=
arg_0
.
split
(
';'
)
if
len
(
arg_1
)
<
2
:
return
arg_0
arg_2
=
arg_1
[
1
]
.
lstrip
(
)
if
not
re
.
match
(
"^((\\w+(\\.\\w+)?|'.*?'|\".*?\")\\s+"
'(in|==|!=|not in)\\s+'
"(\\w+(\\.\\w+)?|'.*?'|\".*?\")"
'(\\s+(or|and)\\s+)?)+$'
,
arg_2
)
:
raise
ValueError
(
'bad environment marker: %r'
%
arg_2
)
arg_2
=
re
.
sub
(
r"(platform\.\w+)"
,
r"\1()"
,
arg_2
)
return
arg_1
[
0
]
if
eval
(
arg_2
)
else
''
if
isinstance
(
arg_0
,
list
)
:
arg_3
=
[
]
for
arg_4
in
arg_0
:
arg_4
=
Func_str
(
arg_4
)
if
arg_4
:
arg_3
.
append
(
arg_4
)
elif
isinstance
(
arg_0
,
str
)
:
arg_3
=
Func_str
(
arg_0
)
else
:
arg_3
=
arg_0
return
arg_3

def Func(arg_0):
    """Evaluate environment markers."""
    def Func_str(arg_0):
        arg_1 = arg_0.split(';')
        if len(arg_1) < 2:
            return arg_0
        arg_2 = arg_1[1].lstrip()
        if not re.match("^((\\w+(\\.\\w+)?|'.*?'|\".*?\")\\s+"
                        '(in|==|!=|not in)\\s+'
                        "(\\w+(\\.\\w+)?|'.*?'|\".*?\")"
                        '(\\s+(or|and)\\s+)?)+$', arg_2):
            raise ValueError('bad environment marker: %r' % arg_2)
        arg_2 = re.sub(r"(platform\.\w+)", r"\1()", arg_2)
        return arg_1[0] if eval(arg_2) else ''

    if isinstance(arg_0, list):
        arg_3 = []
        for arg_4 in arg_0:
            arg_4 = Func_str(arg_4)
            if arg_4:
                arg_3.append(arg_4)
    elif isinstance(arg_0, str):
        arg_3 = Func_str(arg_0)
    else:
        arg_3 = arg_0

    return arg_3


(states,
                          filter_threshold=0.,
                          filter_beyond_lag=None,
                          name=None)

def Func ( arg_0 , arg_1 = 0. , arg_2 = None , arg_3 = None ) : arg_4 = _is_list_like ( arg_0 ) if not arg_4 : arg_0 = [ arg_0 ] arg_2 = _broadcast_maybelist_arg ( arg_0 , arg_2 , 'filter_beyond_lag' ) arg_1 = _broadcast_maybelist_arg ( arg_0 , arg_1 , 'filter_threshold' ) with tf . compat . v1 . name_scope ( arg_3 , 'Func' ) : arg_5 = [ _Func_single_state ( s , ml , mlt ) for ( s , ml , mlt ) in zip ( arg_0 , arg_2 , arg_1 ) ] if arg_4 : return arg_5 return arg_5 [ 0 ]

def Func(arg_0,
                          arg_1=0.,
                          arg_2=None,
                          arg_3=None):
  """Estimate a lower bound on effective sample size for each independent chain.

  Roughly speaking, "effective sample size" (ESS) is the size of an iid sample
  with the same variance as `state`.

  More precisely, given a stationary sequence of possibly correlated random
  variables `X_1, X_2,...,X_N`, each identically distributed ESS is the number
  such that

  ```Variance{ N**-1 * Sum{X_i} } = ESS**-1 * Variance{ X_1 }.```

  If the sequence is uncorrelated, `ESS = N`.  In general, one should expect
  `ESS <= N`, with more highly correlated sequences having smaller `ESS`.

  Args:
    states:  `Tensor` or list of `Tensor` objects.  Dimension zero should index
      identically distributed states.
    filter_threshold:  `Tensor` or list of `Tensor` objects.
      Must broadcast with `state`.  The auto-correlation sequence is truncated
      after the first appearance of a term less than `filter_threshold`.
      Setting to `None` means we use no threshold filter.  Since `|R_k| <= 1`,
      setting to any number less than `-1` has the same effect.
    filter_beyond_lag:  `Tensor` or list of `Tensor` objects.  Must be
      `int`-like and scalar valued.  The auto-correlation sequence is truncated
      to this length.  Setting to `None` means we do not filter based on number
      of lags.
    name:  `String` name to prepend to created ops.

  Returns:
    ess:  `Tensor` or list of `Tensor` objects.  The effective sample size of
      each component of `states`.  Shape will be `states.shape[1:]`.

  Raises:
    ValueError:  If `states` and `filter_threshold` or `states` and
      `filter_beyond_lag` are both lists with different lengths.

  #### Examples

  We use ESS to estimate standard error.

  ```
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  target = tfd.MultivariateNormalDiag(scale_diag=[1., 2.])

  # Get 1000 states from one chain.
  states = tfp.mcmc.sample_chain(
      num_burnin_steps=200,
      num_results=1000,
      current_state=tf.constant([0., 0.]),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=target.log_prob,
        step_size=0.05,
        num_leapfrog_steps=20))
  states.shape
  ==> (1000, 2)

  ess = Func(states)
  ==> Shape (2,) Tensor

  mean, variance = tf.nn.moments(states, axis=0)
  standard_error = tf.sqrt(variance / ess)
  ```

  Some math shows that, with `R_k` the auto-correlation sequence,
  `R_k := Covariance{X_1, X_{1+k}} / Variance{X_1}`, we have

  ```ESS(N) =  N / [ 1 + 2 * ( (N - 1) / N * R_1 + ... + 1 / N * R_{N-1}  ) ]```

  This function estimates the above by first estimating the auto-correlation.
  Since `R_k` must be estimated using only `N - k` samples, it becomes
  progressively noisier for larger `k`.  For this reason, the summation over
  `R_k` should be truncated at some number `filter_beyond_lag < N`.  Since many
  MCMC methods generate chains where `R_k > 0`, a reasonable criteria is to
  truncate at the first index where the estimated auto-correlation becomes
  negative.

  The arguments `filter_beyond_lag`, `filter_threshold` are filters intended to
  remove noisy tail terms from `R_k`.  They combine in an "OR" manner meaning
  terms are removed if they were to be filtered under the `filter_beyond_lag` OR
  `filter_threshold` criteria.
  """
  arg_4 = _is_list_like(arg_0)

  # Convert all args to lists.
  if not arg_4:
    arg_0 = [arg_0]

  arg_2 = _broadcast_maybelist_arg(arg_0, arg_2,
                                               'filter_beyond_lag')
  arg_1 = _broadcast_maybelist_arg(arg_0, arg_1,
                                              'filter_threshold')

  # Process items, one at a time.
  with tf.compat.v1.name_scope(arg_3, 'Func'):
    arg_5 = [
        _Func_single_state(s, ml, mlt)
        for (s, ml, mlt) in zip(arg_0, arg_2, arg_1)
    ]

  if arg_4:
    return arg_5
  return arg_5[0]

Estimate a lower bound on effective sample size for each independent chain.

  Roughly speaking, "effective sample size" (ESS) is the size of an iid sample
  with the same variance as `state`.

  More precisely, given a stationary sequence of possibly correlated random
  variables `X_1, X_2,...,X_N`, each identically distributed ESS is the number
  such that

  ```Variance{ N**-1 * Sum{X_i} } = ESS**-1 * Variance{ X_1 }.```

  If the sequence is uncorrelated, `ESS = N`.  In general, one should expect
  `ESS <= N`, with more highly correlated sequences having smaller `ESS`.

  Args:
    states:  `Tensor` or list of `Tensor` objects.  Dimension zero should index
      identically distributed states.
    filter_threshold:  `Tensor` or list of `Tensor` objects.
      Must broadcast with `state`.  The auto-correlation sequence is truncated
      after the first appearance of a term less than `filter_threshold`.
      Setting to `None` means we use no threshold filter.  Since `|R_k| <= 1`,
      setting to any number less than `-1` has the same effect.
    filter_beyond_lag:  `Tensor` or list of `Tensor` objects.  Must be
      `int`-like and scalar valued.  The auto-correlation sequence is truncated
      to this length.  Setting to `None` means we do not filter based on number
      of lags.
    name:  `String` name to prepend to created ops.

  Returns:
    ess:  `Tensor` or list of `Tensor` objects.  The effective sample size of
      each component of `states`.  Shape will be `states.shape[1:]`.

  Raises:
    ValueError:  If `states` and `filter_threshold` or `states` and
      `filter_beyond_lag` are both lists with different lengths.

  #### Examples

  We use ESS to estimate standard error.

  ```
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  target = tfd.MultivariateNormalDiag(scale_diag=[1., 2.])

  # Get 1000 states from one chain.
  states = tfp.mcmc.sample_chain(
      num_burnin_steps=200,
      num_results=1000,
      current_state=tf.constant([0., 0.]),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=target.log_prob,
        step_size=0.05,
        num_leapfrog_steps=20))
  states.shape
  ==> (1000, 2)

  ess = effective_sample_size(states)
  ==> Shape (2,) Tensor

  mean, variance = tf.nn.moments(states, axis=0)
  standard_error = tf.sqrt(variance / ess)
  ```

  Some math shows that, with `R_k` the auto-correlation sequence,
  `R_k := Covariance{X_1, X_{1+k}} / Variance{X_1}`, we have

  ```ESS(N) =  N / [ 1 + 2 * ( (N - 1) / N * R_1 + ... + 1 / N * R_{N-1}  ) ]```

  This function estimates the above by first estimating the auto-correlation.
  Since `R_k` must be estimated using only `N - k` samples, it becomes
  progressively noisier for larger `k`.  For this reason, the summation over
  `R_k` should be truncated at some number `filter_beyond_lag < N`.  Since many
  MCMC methods generate chains where `R_k > 0`, a reasonable criteria is to
  truncate at the first index where the estimated auto-correlation becomes
  negative.

  The arguments `filter_beyond_lag`, `filter_threshold` are filters intended to
  remove noisy tail terms from `R_k`.  They combine in an "OR" manner meaning
  terms are removed if they were to be filtered under the `filter_beyond_lag` OR
  `filter_threshold` criteria.

Estimate a lower bound on effective sample size for each independent chain .


(self, bucket_name, object_name, filename,
               mime_type='application/octet-stream', gzip=False)

def Func(arg_0, arg_1, arg_2, arg_3,
               arg_4='application/octet-stream', arg_5=False):
        """
        Uploads a local file to Google Cloud Storage.

        :param bucket_name: The bucket to Func to.
        :type bucket_name: str
        :param object_name: The object name to set when Funcing the local file.
        :type object_name: str
        :param filename: The local file path to the file to be Funced.
        :type filename: str
        :param mime_type: The MIME type to set when Funcing the file.
        :type mime_type: str
        :param gzip: Option to compress file for Func
        :type gzip: bool
        """

        if arg_5:
            arg_6 = arg_3 + '.gz'

            with open(arg_3, 'rb') as f_in:
                with gz.open(arg_6, 'wb') as f_out:
                    shutil.copyfileobj(f_in, f_out)
                    arg_3 = arg_6

        arg_7 = arg_0.get_conn()
        arg_8 = arg_7.get_bucket(arg_1=arg_1)
        arg_9 = arg_8.blob(blob_name=arg_2)
        arg_9.Func_from_filename(arg_3=arg_3,
                                  content_type=arg_4)

        if arg_5:
            os.remove(arg_3)
        arg_0.log.info('File %s Funced to %s in %s bucket', arg_3, arg_2, arg_1)

Uploads a local file to Google Cloud Storage.

        :param bucket_name: The bucket to upload to.
        :type bucket_name: str
        :param object_name: The object name to set when uploading the local file.
        :type object_name: str
        :param filename: The local file path to the file to be uploaded.
        :type filename: str
        :param mime_type: The MIME type to set when uploading the file.
        :type mime_type: str
        :param gzip: Option to compress file for upload
        :type gzip: bool

Uploads a local file to Google Cloud Storage .


(
        self,
        fullname: str,
        path,  # Optional[List[str]] # MyPy complains this is incompatible with supertype
        target: types.ModuleType = None,
    )

def Func(
        arg_0,
        arg_1: arg_2,
        arg_3,  # Optional[List[str]] # MyPy complains this is incompatible with supertype
        arg_4: arg_5.ModuleType = None,
    ) -> Optional[importlib.machinery.ModuleSpec]:
        """Find the ModuleSpec for the specified Basilisp module.

        Returns None if the module is not a Basilisp module to allow import processing to continue."""
        arg_7 = arg_1.split(".")
        if arg_3 is None:
            arg_3 = sys.path
            arg_8 = arg_7
        else:
            arg_8 = [arg_7[-1]]

        for arg_9 in arg_3:
            arg_10 = [
                f"{os.path.join(entry, *module_name, '__init__')}.lpy",
                f"{os.path.join(entry, *module_name)}.lpy",
            ]
            for arg_11 in arg_10:
                if os.path.exists(arg_11):
                    arg_12 = {
                        "fullname": arg_1,
                        "filename": arg_11,
                        "path": arg_9,
                        "target": arg_4,
                        "cache_filename": _cache_from_source(arg_11),
                    }
                    logger.debug(
                        f"Found potential Basilisp module '{fullname}' in file '{filename}'"
                    )
                    return importlib.machinery.ModuleSpec(
                        arg_1, arg_0, origin=arg_11, loader_state=arg_12
                    )
        return None

Find the ModuleSpec for the specified Basilisp module .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
==
SIMPLE
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
VolumeLiquids
]
return
Amgat
(
arg_3
,
arg_6
)
elif
arg_5
==
COSTALD_MIXTURE
:
return
COSTALD_mixture
(
arg_3
,
arg_1
,
arg_0
.
Tcs
,
arg_0
.
Vcs
,
arg_0
.
omegas
)
elif
arg_5
==
COSTALD_MIXTURE_FIT
:
return
COSTALD_mixture
(
arg_3
,
arg_1
,
arg_0
.
Tcs
,
arg_0
.
COSTALD_Vchars
,
arg_0
.
COSTALD_omegas
)
elif
arg_5
==
RACKETT
:
return
Rackett_mixture
(
arg_1
,
arg_3
,
arg_0
.
MWs
,
arg_0
.
Tcs
,
arg_0
.
Pcs
,
arg_0
.
Zcs
)
elif
arg_5
==
RACKETT_PARAMETERS
:
return
Rackett_mixture
(
arg_1
,
arg_3
,
arg_0
.
MWs
,
arg_0
.
Tcs
,
arg_0
.
Pcs
,
arg_0
.
Z_RAs
)
elif
arg_5
==
LALIBERTE
:
arg_4
=
list
(
arg_4
)
arg_4
.
pop
(
arg_0
.
index_w
)
arg_7
=
Laliberte_density
(
arg_1
,
arg_4
,
arg_0
.
wCASs
)
arg_8
=
mixing_simple
(
arg_3
,
arg_0
.
MWs
)
return
rho_to_Vm
(
arg_7
,
arg_8
)
else
:
raise
Exception
(
'Method not valid'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func molar volume of a liquid mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        P : float
            Pressure at which to Func the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid mixture at the given conditions,
            [m^3/mol]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.VolumeLiquids]
            return Amgat(arg_3, arg_6)
        elif arg_5 == COSTALD_MIXTURE:
            return COSTALD_mixture(arg_3, arg_1, arg_0.Tcs, arg_0.Vcs, arg_0.omegas)
        elif arg_5 == COSTALD_MIXTURE_FIT:
            return COSTALD_mixture(arg_3, arg_1, arg_0.Tcs, arg_0.COSTALD_Vchars, arg_0.COSTALD_omegas)
        elif arg_5 == RACKETT:
            return Rackett_mixture(arg_1, arg_3, arg_0.MWs, arg_0.Tcs, arg_0.Pcs, arg_0.Zcs)
        elif arg_5 == RACKETT_PARAMETERS:
            return Rackett_mixture(arg_1, arg_3, arg_0.MWs, arg_0.Tcs, arg_0.Pcs, arg_0.Z_RAs)
        elif arg_5 == LALIBERTE:
            arg_4 = list(arg_4) ; arg_4.pop(arg_0.index_w)
            arg_7 = Laliberte_density(arg_1, arg_4, arg_0.wCASs)
            arg_8 = mixing_simple(arg_3, arg_0.MWs)
            return rho_to_Vm(arg_7, arg_8)
        else:
            raise Exception('Method not valid')

r'''Method to calculate molar volume of a liquid mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid mixture at the given conditions,
            [m^3/mol]

r Method to calculate molar volume of a liquid mixture at temperature T pressure P mole fractions zs and weight fractions ws with a given method .


(self, endpoint, data=None, headers=None, extra_options=None)

return self.run_and_check(session, prepped_request, extra_options)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
arg_4
=
arg_4
or
{
}
arg_5
=
arg_0
.
get_conn
(
arg_3
)
if
arg_0
.
base_url
and
not
arg_0
.
base_url
.
endswith
(
'/'
)
and
arg_1
and
not
arg_1
.
startswith
(
'/'
)
:
arg_6
=
arg_0
.
base_url
+
'/'
+
arg_1
else
:
arg_6
=
(
arg_0
.
base_url
or
''
)
+
(
arg_1
or
''
)
arg_7
=
if
arg_0
.
method
==
'GET'
:
arg_7
=
requests
.
Request
(
arg_0
.
method
,
arg_6
,
params
=
arg_2
,
arg_3
=
arg_3
)
elif
arg_0
.
method
==
'HEAD'
:
arg_7
=
requests
.
Request
(
arg_0
.
method
,
arg_6
,
arg_3
=
arg_3
)
else
:
arg_7
=
requests
.
Request
(
arg_0
.
method
,
arg_6
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
arg_8
=
arg_5
.
prepare_request
(
arg_7
)
arg_0
.
log
.
info
(
"Sending '%s' to url: %s"
,
arg_0
.
method
,
arg_6
)
return
arg_0
.
Func_and_check
(
arg_5
,
arg_8
,
arg_4
)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Performs the request

        :param endpoint: the endpoint to be called i.e. resource/v1/query?
        :type endpoint: str
        :param data: payload to be uploaded or request parameters
        :type data: dict
        :param headers: additional headers to be passed through as a dictionary
        :type headers: dict
        :param extra_options: additional options to be used when executing the request
            i.e. {'check_response': False} to avoid checking raising exceptions on non
            2XX or 3XX status codes
        :type extra_options: dict
        """
        arg_4 = arg_4 or {}

        arg_5 = arg_0.get_conn(arg_3)

        if arg_0.base_url and not arg_0.base_url.endswith('/') and \
           arg_1 and not arg_1.startswith('/'):
            arg_6 = arg_0.base_url + '/' + arg_1
        else:
            arg_6 = (arg_0.base_url or '') + (arg_1 or '')

        arg_7 = None
        if arg_0.method == 'GET':
            # GET uses params
            arg_7 = requests.Request(arg_0.method,
                                   arg_6,
                                   params=arg_2,
                                   arg_3=arg_3)
        elif arg_0.method == 'HEAD':
            # HEAD doesn't use params
            arg_7 = requests.Request(arg_0.method,
                                   arg_6,
                                   arg_3=arg_3)
        else:
            # Others use data
            arg_7 = requests.Request(arg_0.method,
                                   arg_6,
                                   arg_2=arg_2,
                                   arg_3=arg_3)

        arg_8 = arg_5.prepare_request(arg_7)
        arg_0.log.info("Sending '%s' to url: %s", arg_0.method, arg_6)
        return arg_0.Func_and_check(arg_5, arg_8, arg_4)


def Func(arg_0, arg_1):
        """Handles an oauth1 authorization response."""
        arg_2 = arg_0.make_client()
        arg_2.verifier = arg_1.get('oauth_verifier')
        arg_4 = session.get('%s_oauthtok' % arg_0.name)
        if not arg_4:
            raise OAuthException(
                'Token not found, maybe you disabled cookie',
                type='token_not_found'
            )
        arg_2.resource_owner_key = arg_4[0]
        arg_2.resource_owner_secret = arg_4[1]

        arg_7, arg_8, arg_9 = arg_2.sign(
            arg_0.expand_url(arg_0.access_token_url),
            _encode(arg_0.access_token_method)
        )
        arg_8.update(arg_0._access_token_headers)

        arg_10, arg_11 = arg_0.http_request(
            arg_7, arg_8, to_bytes(arg_9, arg_0.encoding),
            method=arg_0.access_token_method
        )
        arg_9 = parse_response(arg_10, arg_11)
        if arg_10.code not in (200, 201):
            raise OAuthException(
                'Invalid response from %s' % arg_0.name,
                type='invalid_response', arg_9=arg_9
            )
        return arg_9

Handles an oauth1 authorization response .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
<=
0
:
raise
ParameterError
(
'rate must be a positive number'
)
arg_2
=
core
.
stft
(
arg_0
)
arg_3
=
core
.
phase_vocoder
(
arg_2
,
arg_1
)
arg_4
=
core
.
istft
(
arg_3
,
dtype
=
arg_0
.
dtype
)
return
arg_4

def Func(arg_0, arg_1):
    '''Time-stretch an audio series by a fixed rate.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series

    rate : float > 0 [scalar]
        Stretch factor.  If `rate > 1`, then the signal is sped up.

        If `rate < 1`, then the signal is slowed down.

    Returns
    -------
    y_stretch : np.ndarray [shape=(rate * n,)]
        audio time series stretched by the specified rate

    See Also
    --------
    pitch_shift : pitch shifting
    librosa.core.phase_vocoder : spectrogram phase vocoder

    Examples
    --------
    Compress to be twice as fast

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> y_fast = librosa.effects.Func(y, 2.0)

    Or half the original speed

    >>> y_slow = librosa.effects.Func(y, 0.5)

    '''

    if arg_1 <= 0:
        raise ParameterError('rate must be a positive number')

    # Construct the stft
    arg_2 = core.stft(arg_0)

    # Stretch by phase vocoding
    arg_3 = core.phase_vocoder(arg_2, arg_1)

    # Invert the stft
    arg_4 = core.istft(arg_3, dtype=arg_0.dtype)

    return arg_4

Time-stretch an audio series by a fixed rate.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series

    rate : float > 0 [scalar]
        Stretch factor.  If `rate > 1`, then the signal is sped up.

        If `rate < 1`, then the signal is slowed down.

    Returns
    -------
    y_stretch : np.ndarray [shape=(rate * n,)]
        audio time series stretched by the specified rate

    See Also
    --------
    pitch_shift : pitch shifting
    librosa.core.phase_vocoder : spectrogram phase vocoder

    Examples
    --------
    Compress to be twice as fast

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> y_fast = librosa.effects.time_stretch(y, 2.0)

    Or half the original speed

    >>> y_slow = librosa.effects.time_stretch(y, 0.5)

Time - stretch an audio series by a fixed rate .


def Func ( arg_0 , arg_1 = - 1 ) : if arg_1 == - 1 or not isinstance ( arg_1 , list ) : arg_1 = set ( range ( len ( arg_0 . word_starts ) ) ) else : arg_1 = set ( arg_1 ) arg_2 = arg_0 . _find_Func ( arg_0 . root , arg_1 ) arg_3 = arg_2 . idx arg_4 = arg_2 . idx + arg_2 . depth return arg_0 . word [ arg_3 : arg_4 ]

def Func(arg_0, arg_1=-1):
        """Returns the Largest Common Substring of Strings provided in stringIdxs.
        If stringIdxs is not provided, the LCS of all strings is returned.

        ::param stringIdxs: Optional: List of indexes of strings.
        """
        if arg_1 == -1 or not isinstance(arg_1, list):
            arg_1 = set(range(len(arg_0.word_starts)))
        else:
            arg_1 = set(arg_1)

        arg_2 = arg_0._find_Func(arg_0.root, arg_1)
        arg_3 = arg_2.idx
        arg_4 = arg_2.idx + arg_2.depth
        return arg_0.word[arg_3:arg_4]

Returns the Largest Common Substring of Strings provided in stringIdxs . If stringIdxs is not provided the LCS of all strings is returned .


def Func ( arg_0 , arg_1 ) : try : return valid_numeric ( arg_0 ) * valid_numeric ( arg_1 ) except ( ValueError , TypeError ) : try : return arg_0 * arg_1 except Exception : return ''

def Func(arg_0, arg_1):
    """Multiply the arg with the value."""
    try:
        return valid_numeric(arg_0) * valid_numeric(arg_1)
    except (ValueError, TypeError):
        try:
            return arg_0 * arg_1
        except Exception:
            return ''


return cls.Meta.collection_endpoint if cls.Meta.collection_endpoint is not None else cls.__name__.lower() + "s/"

def Func ( arg_0 ) : return arg_0 . Meta . collection_endpoint if arg_0 . Meta . collection_endpoint is not None else arg_0 . __name__ . lower ( ) + "s/"

def Func(arg_0):
        """
        Get the relative path to the API resource collection

        If self.collection_endpoint is not set, it will default to the lowercase name of the resource class plus an "s" and the terminating "/"
        :param cls: Resource class
        :return: Relative path to the resource collection
        """
        return arg_0.Meta.collection_endpoint if arg_0.Meta.collection_endpoint is not None else arg_0.__name__.lower() + "s/"


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
len
(
arg_1
.
get_shape
(
)
)
!=
1
:
raise
AssertionError
(
"This is not a 1D Tensor"
)
arg_1
=
tf
.
expand_dims
(
arg_1
,
1
)
arg_1
=
tf
.
tile
(
arg_1
,
[
1
,
arg_2
]
)
arg_1
=
arg_0
.
tf_flatten
(
arg_1
)
return
arg_1

def Func(arg_0, arg_1, arg_2):
        """Tensorflow version of np.repeat for 1D"""
        # https://github.com/tensorflow/tensorflow/issues/8521

        if len(arg_1.get_shape()) != 1:
            raise AssertionError("This is not a 1D Tensor")

        arg_1 = tf.expand_dims(arg_1, -1)
        arg_1 = tf.tile(arg_1, [1, arg_2])
        arg_1 = arg_0.tf_flatten(arg_1)
        return arg_1

Tensorflow version of np . repeat for 1D


(seq: list, r: ref(Edge), sr: state.StateRegister)

def Func(arg_0: arg_1, arg_2: arg_3(arg_4), arg_5: arg_6.StateRegister):
    """ function that connect each other one sequence of MatchExpr. """
    arg_8 = arg_2
    # we need to detect the last state of the sequence
    arg_9 = len(arg_0) - 1
    arg_10 = 0
    for arg_11 in arg_0:
        # alternatives are represented by builtin list
        if isinstance(arg_11, arg_1):
            # so recursively connect all states of each alternative sequences.
            for arg_12 in arg_11:
                Func(arg_12, arg_2, arg_5)
        elif isinstance(arg_11, MatchExpr):
            # from the current state, have we a existing edge for this event?
            arg_13 = arg_2().get_next_edge(arg_11)
            if arg_13 is None:
                arg_14 = None
                if arg_10 != arg_9:
                    arg_14 = arg_6.State(arg_5)
                    arg_14.matchDefault(arg_8().s)
                else:
                    # last state of sequence return to the base
                    arg_14 = arg_8().s
                arg_13 = arg_4(arg_14)
                arg_2().next_edge[arg_16(arg_14)] = arg_13
                arg_11.attach(arg_2().s, arg_14, arg_5)
            arg_2 = arg_3(arg_13)
        arg_10 += 1

function that connect each other one sequence of MatchExpr .


(self, local_path, remote_path, nthreads=64, overwrite=True,
                    buffersize=4194304, blocksize=4194304)

def Func(arg_0, arg_1, arg_2, arg_3=64, arg_4=True,
                    arg_5=4194304, arg_6=4194304):
        """
        Upload a file to Azure Data Lake.

        :param local_path: local path. Can be single file, directory (in which case,
            upload recursively) or glob pattern. Recursive glob patterns using `**`
            are not supported.
        :type local_path: str
        :param remote_path: Remote path to upload to; if multiple files, this is the
            directory root to write within.
        :type remote_path: str
        :param nthreads: Number of threads to use. If None, uses the number of cores.
        :type nthreads: int
        :param overwrite: Whether to forcibly overwrite existing files/directories.
            If False and remote path is a directory, will quit regardless if any files
            would be overwritten or not. If True, only matching filenames are actually
            overwritten.
        :type overwrite: bool
        :param buffersize: int [2**22]
            Number of bytes for internal buffer. This block cannot be bigger than
            a chunk and cannot be smaller than a block.
        :type buffersize: int
        :param blocksize: int [2**22]
            Number of bytes for a block. Within each chunk, we write a smaller
            block for each API call. This block cannot be bigger than a chunk.
        :type blocksize: int
        """
        multithread.ADLUploader(arg_0.connection,
                                lpath=arg_1,
                                rpath=arg_2,
                                arg_3=arg_3,
                                arg_4=arg_4,
                                arg_5=arg_5,
                                arg_6=arg_6)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . ipy_shell . user_global_ns arg_3 = arg_0 . ipy_shell . user_ns arg_2 . update ( { "__ipy_scope__" : None , } ) try : with redirect_stdout ( arg_0 . stdout ) : arg_0 . run ( arg_1 , arg_2 , arg_3 ) except : arg_0 . code_error = True if arg_0 . options . debug : raise BdbQuit finally : arg_0 . finalize ( )

def Func(arg_0, arg_1):
        """Run the Cell code using the IPython globals and locals

        Args:
            cell (str): Python code to be executed
        """
        arg_2 = arg_0.ipy_shell.user_global_ns
        arg_3 = arg_0.ipy_shell.user_ns
        arg_2.update({
            "__ipy_scope__": None,
        })
        try:
            with redirect_stdout(arg_0.stdout):
                arg_0.run(arg_1, arg_2, arg_3)
        except:
            arg_0.code_error = True
            if arg_0.options.debug:
                raise BdbQuit
        finally:
            arg_0.finalize()


return [int(x) for x in re.split(r'[\|/]', genome_data[gt_idx]) if
                x != '.']

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ 8 ] . split ( ':' ) arg_3 = arg_1 [ 9 ] . split ( ':' ) try : arg_4 = arg_2 . index ( 'GT' ) except ValueError : return [ ] return [ int ( arg_5 ) for arg_5 in re . split ( r'[\|/]' , arg_3 [ arg_4 ] ) if arg_5 != '.' ]

def Func(arg_0, arg_1):
        """Parse genotype from VCF line data"""
        arg_2 = arg_1[8].split(':')
        arg_3 = arg_1[9].split(':')
        try:
            arg_4 = arg_2.index('GT')
        except ValueError:
            return []
        return [int(arg_5) for arg_5 in re.split(r'[\|/]', arg_3[arg_4]) if
                arg_5 != '.']


(self, pred_map, succ_map, input_circuit,
                             wire_map)

def Func(arg_0, arg_1, arg_2, arg_3,
                             arg_4):
        """Map all wires of the input circuit.

        Map all wires of the input circuit to predecessor and
        successor nodes in self, keyed on wires in self.

        Args:
            pred_map (dict): comes from _make_pred_succ_maps
            succ_map (dict): comes from _make_pred_succ_maps
            input_circuit (DAGCircuit): the input circuit
            wire_map (dict): the map from wires of input_circuit to wires of self

        Returns:
            tuple: full_pred_map, full_succ_map (dict, dict)

        Raises:
            DAGCircuitError: if more than one predecessor for output nodes
        """
        arg_5 = {}
        arg_6 = {}
        for arg_7 in arg_3.input_map:
            # If w is wire mapped, find the corresponding predecessor
            # of the node
            if arg_7 in arg_4:
                arg_5[arg_4[arg_7]] = arg_1[arg_4[arg_7]]
                arg_6[arg_4[arg_7]] = arg_2[arg_4[arg_7]]
            else:
                # Otherwise, use the corresponding output nodes of self
                # and compute the predecessor.
                arg_6[arg_7] = arg_0.output_map[arg_7]
                arg_5[arg_7] = arg_0._multi_graph.predecessors(
                    arg_0.output_map[arg_7])[0]
                if len(list(arg_0._multi_graph.predecessors(arg_0.output_map[arg_7]))) != 1:
                    raise DAGCircuitError("too many predecessors for %s[%d] "
                                          "output node" % (arg_7[0], arg_7[1]))

        return arg_5, arg_6


def Func ( arg_0 , arg_1 = False ) : from poseidon . ssh import SSHClient arg_2 = SSHClient ( arg_0 . ip_address , arg_1 = arg_1 ) return arg_2

def Func(arg_0, arg_1=False):
        """
        Open SSH Funcion to droplet

        Parameters
        ----------
        interactive: bool, default False
            If True then SSH client will prompt for password when necessary
            and also print output to console
        """
        from poseidon.ssh import SSHClient
        arg_2 = SSHClient(arg_0.ip_address, arg_1=arg_1)
        return arg_2

Open SSH connection to droplet

        Parameters
        ----------
        interactive: bool, default False
            If True then SSH client will prompt for password when necessary
            and also print output to console


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : try : arg_4 = super ( CustomFormatter , arg_0 ) return arg_4 . Func ( arg_1 , arg_2 , arg_3 ) except KeyError : return ( "_" , arg_1 ) except IndexError : return ( "_" , arg_1 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Return an underscore if the attribute is absent.
        Not all components have the same attributes.
        """
        try:
            arg_4 = super(CustomFormatter, arg_0)
            return arg_4.Func(arg_1, arg_2, arg_3)
        except KeyError:    # Key is missing
            return ("_", arg_1)
        except IndexError:  # Value is missing
            return ("_", arg_1)

Return an underscore if the attribute is absent . Not all components have the same attributes .


def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_0 . _check ( ) arg_3 = arg_0 . db . top_patch ( ) if arg_3 : arg_4 = arg_0 . series . patches_after ( arg_3 ) else : arg_4 = arg_0 . series . patches ( ) if not arg_4 : raise AllPatchesApplied ( arg_0 . series , arg_3 ) try : for arg_5 in arg_4 : arg_0 . applying ( arg_5 ) arg_0 . _apply_patch ( arg_5 , arg_1 , arg_2 ) finally : arg_0 . db . save ( ) arg_0 . applied ( arg_0 . db . top_patch ( ) )

def Func(arg_0, arg_1=False, arg_2=False):
        """ Apply all patches in series file """
        arg_0._check()
        arg_3 = arg_0.db.top_patch()
        if arg_3:
            arg_4 = arg_0.series.patches_after(arg_3)
        else:
            arg_4 = arg_0.series.patches()

        if not arg_4:
            raise AllPatchesApplied(arg_0.series, arg_3)

        try:
            for arg_5 in arg_4:
                arg_0.applying(arg_5)
                arg_0._apply_patch(arg_5, arg_1, arg_2)
        finally:
            arg_0.db.save()

        arg_0.applied(arg_0.db.top_patch())


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
stream
:
arg_1
=
arg_1
.
rstrip
(
'\n'
)
arg_2
=
False
arg_0
.
nline
+=
1
while
not
arg_2
:
arg_2
=
arg_0
.
handlers
[
arg_0
.
state
]
(
arg_1
)
if
arg_0
.
state
==
arg_0
.
COMMIT
and
arg_0
.
commit
:
arg_3
=
arg_0
.
_build_commit
(
)
logger
.
debug
(
"Commit %s Funcd"
,
arg_3
[
'commit'
]
)
yield
arg_3
if
arg_0
.
commit
:
arg_3
=
arg_0
.
_build_commit
(
)
logger
.
debug
(
"Commit %s Funcd"
,
arg_3
[
'commit'
]
)
yield
arg_3

def Func(arg_0):
        """Parse the Git log stream."""

        for arg_1 in arg_0.stream:
            arg_1 = arg_1.rstrip('\n')
            arg_2 = False
            arg_0.nline += 1

            while not arg_2:
                arg_2 = arg_0.handlers[arg_0.state](arg_1)

                if arg_0.state == arg_0.COMMIT and arg_0.commit:
                    arg_3 = arg_0._build_commit()
                    logger.debug("Commit %s Funcd", arg_3['commit'])
                    yield arg_3

        # Return the last commit, if any
        if arg_0.commit:
            arg_3 = arg_0._build_commit()
            logger.debug("Commit %s Funcd", arg_3['commit'])
            yield arg_3


def Func(arg_0, *arg_1):
        """
        Return an array with the same data but a new shape.

        Currently only supports reshaping that independently
        Funcs the keys, or the values, or both.

        Parameters
        ----------
        shape :  tuple of ints, or n ints
            New shape
        """
        arg_2 = argpack(arg_1)
        isFuncable(arg_2, arg_0.shape)

        if arg_2 == arg_0.shape:
            return arg_0

        arg_3 = arg_0._Funcbasic(arg_2)
        if arg_3 == -1:
            raise NotImplementedError("Currently no support for reshaping between "
                                      "keys and values for BoltArraySpark")
        else:
            arg_4, arg_5 = arg_2[:arg_3], arg_2[arg_3:]
            return arg_0.keys.Func(arg_4).values.Func(arg_5)

Return an array with the same data but a new shape.

        Currently only supports reshaping that independently
        reshapes the keys, or the values, or both.

        Parameters
        ----------
        shape :  tuple of ints, or n ints
            New shape

Return an array with the same data but a new shape .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_supplier_set : arg_0 . package_supplier_set = True if validations . validate_pkg_supplier ( arg_2 ) : arg_1 . package . supplier = arg_2 return True else : raise SPDXValueError ( 'Package::Supplier' ) else : raise CardinalityError ( 'Package::Supplier' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package supplier, if not already set.
        entity - Organization, Person or NoAssert.
        Raises CardinalityError if already has a supplier.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_supplier_set:
            arg_0.package_supplier_set = True
            if validations.validate_pkg_supplier(arg_2):
                arg_1.package.supplier = arg_2
                return True
            else:
                raise SPDXValueError('Package::Supplier')
        else:
            raise CardinalityError('Package::Supplier')

Sets the package supplier if not already set . entity - Organization Person or NoAssert . Raises CardinalityError if already has a supplier . Raises OrderError if no package previously defined .


(self, monitor=False, wait=False, timeout=None, **kwargs)

def Func(arg_0, arg_1=False, arg_2=False, arg_3=None, **arg_4):
        """Launch a new ad-hoc command.

        Runs a user-defined command from Ansible Tower, immediately starts it,
        and returns back an ID in order for its status to be monitored.

        =====API DOCS=====
        Launch a new ad-hoc command.

        :param monitor: Flag that if set, immediately calls ``monitor`` on the newly Funced command rather
                        than exiting with a success.
        :type monitor: bool
        :param wait: Flag that if set, monitor the status of the job, but do not print while job is in progress.
        :type wait: bool
        :param timeout: If provided with ``monitor`` flag set, this attempt will time out after the given number
                        of seconds.
        :type timeout: int
        :param `**kwargs`: Fields needed to create and Func an ad hoc command.
        :returns: Result of subsequent ``monitor`` call if ``monitor`` flag is on; Result of subsequent ``wait``
                  call if ``wait`` flag is on; dictionary of "id" and "changed" if none of the two flags are on.
        :rtype: dict
        :raises tower_cli.exceptions.TowerCLIError: When ad hoc commands are not available in Tower backend.

        =====API DOCS=====
        """
        # This feature only exists for versions 2.2 and up
        arg_5 = client.get('/')
        if 'ad_hoc_commands' not in arg_5.json():
            raise exc.TowerCLIError('Your host is running an outdated version'
                                    'of Ansible Tower that can not run '
                                    'ad-hoc commands (2.2 or earlier)')

        # Pop the None arguments because we have no .write() method in
        # inheritance chain for this type of resource. This is needed
        arg_0._pop_none(arg_4)

        # Actually start the command.
        debug.log('Launching the ad-hoc command.', header='details')
        arg_6 = client.post(arg_0.endpoint, data=arg_4)
        arg_7 = arg_6.json()
        arg_8 = arg_7['id']

        # If we were told to monitor the command once it started, then call
        # monitor from here.
        if arg_1:
            return arg_0.monitor(arg_8, arg_3=arg_3)
        elif arg_2:
            return arg_0.wait(arg_8, arg_3=arg_3)

        # Return the command ID and other response data
        arg_9 = OrderedDict((
            ('changed', True),
            ('id', arg_8),
        ))
        arg_9.update(arg_6.json())
        return arg_9

Launch a new ad-hoc command.

        Runs a user-defined command from Ansible Tower, immediately starts it,
        and returns back an ID in order for its status to be monitored.

        =====API DOCS=====
        Launch a new ad-hoc command.

        :param monitor: Flag that if set, immediately calls ``monitor`` on the newly launched command rather
                        than exiting with a success.
        :type monitor: bool
        :param wait: Flag that if set, monitor the status of the job, but do not print while job is in progress.
        :type wait: bool
        :param timeout: If provided with ``monitor`` flag set, this attempt will time out after the given number
                        of seconds.
        :type timeout: int
        :param `**kwargs`: Fields needed to create and launch an ad hoc command.
        :returns: Result of subsequent ``monitor`` call if ``monitor`` flag is on; Result of subsequent ``wait``
                  call if ``wait`` flag is on; dictionary of "id" and "changed" if none of the two flags are on.
        :rtype: dict
        :raises tower_cli.exceptions.TowerCLIError: When ad hoc commands are not available in Tower backend.

        =====API DOCS=====


(cls, user, with_pending=False, eager=False)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : arg_4 = Group . query . join ( Membership ) . filter_by ( user_id = arg_1 . get_id ( ) ) if not arg_2 : arg_4 = arg_4 . filter_by ( state = MembershipState . ACTIVE ) if arg_3 : arg_4 = arg_4 . options ( joinedload ( Group . members ) ) arg_5 = Group . query . join ( GroupAdmin ) . filter_by ( admin_id = arg_1 . get_id ( ) , admin_type = resolve_admin_type ( arg_1 ) ) if arg_3 : arg_5 = arg_5 . options ( joinedload ( Group . members ) ) arg_6 = arg_4 . union ( arg_5 ) . with_entities ( Group . id ) return Group . query . filter ( Group . id . in_ ( arg_6 ) )

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
        """Query group by user.

        :param user: User object.
        :param bool with_pending: Whether to include pending users.
        :param bool eager: Eagerly fetch group members.
        :returns: Query object.
        """
        arg_4 = Group.query.join(Membership).filter_by(user_id=arg_1.get_id())
        if not arg_2:
            arg_4 = arg_4.filter_by(state=MembershipState.ACTIVE)
        if arg_3:
            arg_4 = arg_4.options(joinedload(Group.members))

        arg_5 = Group.query.join(GroupAdmin).filter_by(
            admin_id=arg_1.get_id(), admin_type=resolve_admin_type(arg_1))
        if arg_3:
            arg_5 = arg_5.options(joinedload(Group.members))

        arg_6 = arg_4.union(arg_5).with_entities(Group.id)

        return Group.query.filter(Group.id.in_(arg_6))


def Func(arg_0):
    """Obtains the label module given a label algorithm identificator.

    Parameters
    ----------
    labels_id: str
        Label algorithm identificator (e.g., fmc2d, cnmf).

    Returns
    -------
    module: object
        Object containing the selected label module.
        None for not computing the labeling part of music segmentation.
    """
    if arg_0 is None:
        return None
    try:
        arg_1 = eval(algorithms.__name__ + "." + arg_0)
    except AttributeError:
        raise RuntimeError("Algorithm %s can not be found in msaf!" %
                           arg_0)
    if not arg_1.is_label_type:
        raise RuntimeError("Algorithm %s can not label segments!" %
                           arg_0)
    return arg_1

Obtains the label module given a label algorithm identificator .


def Func ( arg_0 , arg_1 ) : if len ( arg_0 ) != len ( arg_1 ) : return False arg_2 = True for arg_3 in range ( len ( arg_0 ) ) : arg_2 &= ( arg_0 [ arg_3 ] == arg_1 [ arg_3 ] ) return arg_2

def Func(arg_0, arg_1):
    '''Constant time string comparison'''

    if len(arg_0) != len(arg_1):
        return False

    arg_2 = True
    for arg_3 in range(len(arg_0)):
        arg_2 &= (arg_0[arg_3] == arg_1[arg_3])

    return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
import
subprocess
if
arg_0
.
imageType
==
"png"
:
arg_0
.
imagePixmap
.
save
(
arg_1
+
".png"
,
"PNG"
,
1
)
if
arg_2
==
"Physics"
:
arg_3
=
"convert "
+
arg_1
+
".png "
+
arg_1
+
".ps"
arg_4
=
subprocess
.
Popen
(
arg_3
,
shell
=
True
)
arg_4
.
wait
(
)
arg_5
=
arg_0
.
imagePixmap
.
scaled
(
500
,
450
,
Qt
.
KeepAspectRatio
)
arg_5
.
save
(
arg_1
+
".png"
,
"PNG"
,
1
)
else
:
arg_6
=
"cp "
+
arg_0
.
image
+
" "
+
arg_1
+
".gif"
arg_4
=
subprocess
.
Popen
(
arg_6
,
shell
=
True
)
arg_4
.
wait
(
)
if
arg_2
==
"Physics"
:
arg_5
=
arg_0
.
imagePixmap
.
scaled
(
500
,
450
,
Qt
.
KeepAspectRatio
)
arg_5
.
save
(
arg_1
+
".png"
,
"PNG"
,
1
)

def Func(arg_0, arg_1, arg_2):
        """Convert supplied QPixmap object to image file."""
        import subprocess

        if arg_0.imageType == "png":
            arg_0.imagePixmap.save(arg_1 + ".png", "PNG", -1)
            if arg_2 == "Physics":
                arg_3 = "convert " + arg_1 + ".png " + arg_1 + ".ps"
                arg_4 = subprocess.Popen(arg_3, shell=True)
                arg_4.wait()
                arg_5 = arg_0.imagePixmap.scaled(500, 450, Qt.KeepAspectRatio)
                arg_5.save(arg_1 + ".png", "PNG", -1)
        else:
            arg_6 = "cp " + arg_0.image + " " + arg_1 + ".gif"
            arg_4 = subprocess.Popen(arg_6, shell=True)
            arg_4.wait()
            if arg_2 == "Physics":
                arg_5 = arg_0.imagePixmap.scaled(500, 450, Qt.KeepAspectRatio)
                arg_5.save(arg_1 + ".png", "PNG", -1)

Convert supplied QPixmap object to image file .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
list
(
arg_0
.
graph
.
triples
(
(
,
arg_0
.
spdx_namespace
.
fileName
,
Literal
(
arg_1
.
name
)
)
)
)
if
len
(
arg_2
)
==
1
:
return
arg_2
[
0
]
[
0
]
else
:
raise
InvalidDocumentError
(
'Func could not'
+
' find file node for file: {0}'
.
format
(
arg_1
.
name
)
)

def Func(arg_0, arg_1):
        """
        Return node representing pkg_file
        pkg_file should be instance of spdx.file.
        """
        arg_2 = list(arg_0.graph.triples((None, arg_0.spdx_namespace.fileName, Literal(arg_1.name))))
        if len(arg_2) == 1:
            return arg_2[0][0]
        else:
            raise InvalidDocumentError('Func could not' +
                                       ' find file node for file: {0}'.format(arg_1.name))

Return node representing pkg_file pkg_file should be instance of spdx . file .


def Func ( arg_0 ) : arg_1 = arg_0 . config [ 'PROPAGATE_EXCEPTIONS' ] if arg_1 is not None : return arg_1 return arg_0 . testing or arg_0 . debug

def Func(arg_0):
        """Returns the value of the `PROPAGATE_EXCEPTIONS` configuration
        value in case it's set, otherwise a sensible default is returned.

        .. versionadded:: 0.7
        """
        arg_1 = arg_0.config['PROPAGATE_EXCEPTIONS']
        if arg_1 is not None:
            return arg_1
        return arg_0.testing or arg_0.debug

Returns the value of the PROPAGATE_EXCEPTIONS configuration value in case it s set otherwise a sensible default is returned .


def Func ( arg_0 ) : try : arg_1 = arg_0 . shell . history_manager . input_hist_parsed [ arg_0 . prompt_count ] if arg_1 . rstrip ( ) . endswith ( ';' ) : return True except IndexError : pass return False

def Func(arg_0):
        """Should we silence the display hook because of ';'?"""
        # do not print output if input ends in ';'
        try:
            arg_1 = arg_0.shell.history_manager.input_hist_parsed[arg_0.prompt_count]
            if arg_1.rstrip().endswith(';'):
                return True
        except IndexError:
            # some uses of ipshellembed may fail here
            pass
        return False

Should we silence the display hook because of ; ?


def Func(arg_0):
    '''Argparse function to get the program parameters'''

    arg_1 = argparse.ArgumentParser(description='Time stretching example')

    arg_1.add_argument('input_file',
                        action='store',
                        help='path to the input file (wav, mp3, etc)')

    arg_1.add_argument('output_file',
                        action='store',
                        help='path to the stretched output (wav)')

    arg_1.add_argument('-s', '--speed',
                        action='store',
                        type=float,
                        default=2.0,
                        required=False,
                        help='speed')

    return vars(arg_1.parse_args(arg_0))


def
Func
(
arg_0
)
:
arg_1
=
"SHORT"
arg_2
=
"LONG"
try
:
arg_3
=
tcase_comment
(
arg_0
)
except
(
IOError
,
OSError
,
ValueError
)
as
exc
:
arg_3
=
[
]
cij
.
err
(
"Func: failed: %r, tcase: %r"
%
(
exc
,
arg_0
)
)
arg_3
=
[
l
for
l
in
arg_3
if
l
.
strip
(
)
]
for
arg_4
,
arg_5
in
enumerate
(
arg_3
)
:
if
arg_5
.
startswith
(
"#"
)
:
arg_3
[
arg_4
]
=
arg_5
[
1
:
]
if
arg_3
:
arg_1
=
arg_3
[
0
]
if
len
(
arg_3
)
>
1
:
arg_2
=
"\n"
.
join
(
arg_3
[
1
:
]
)
return
arg_1
,
arg_2

def Func(arg_0):
    """Parse descriptions from the the given tcase"""

    arg_1 = "SHORT"
    arg_2 = "LONG"

    try:
        arg_3 = tcase_comment(arg_0)
    except (IOError, OSError, ValueError) as exc:
        arg_3 = []
        cij.err("Func: failed: %r, tcase: %r" % (exc, arg_0))

    arg_3 = [l for l in arg_3 if l.strip()]     # Remove empty lines

    for arg_4, arg_5 in enumerate(arg_3):
        if arg_5.startswith("#"):
            arg_3[arg_4] = arg_5[1:]

    if arg_3:
        arg_1 = arg_3[0]

    if len(arg_3) > 1:
        arg_2 = "\n".join(arg_3[1:])

    return arg_1, arg_2


def Func ( arg_0 , arg_1 ) : arg_0 = arg_0 . astimezone ( arg_1 ) if hasattr ( arg_1 , 'normalize' ) : arg_0 = arg_1 . normalize ( arg_0 ) return arg_0 . replace ( tzinfo = None )

def Func(arg_0, arg_1):
    """
    Makes an aware datetime.datetime naive in a given time zone.
    """
    arg_0 = arg_0.astimezone(arg_1)
    if hasattr(arg_1, 'normalize'):
        # available for pytz time zones
        arg_0 = arg_1.normalize(arg_0)
    return arg_0.replace(tzinfo=None)

Makes an aware datetime . datetime naive in a given time zone .


def Func ( * arg_0 ) : arg_0 = tuple ( arg_0 ) arg_1 = list ( map ( len , arg_0 ) ) arg_2 = len ( arg_0 ) arg_3 = 1 for arg_4 in arg_1 : arg_3 *= arg_4 arg_5 = [ ] for arg_6 , arg_7 in enumerate ( arg_0 ) : arg_8 = [ 1 ] * arg_2 arg_8 [ arg_6 ] = arg_1 [ arg_6 ] arg_9 = numpy . asanyarray ( arg_7 ) . reshape ( arg_8 ) for arg_10 , arg_3 in enumerate ( arg_1 ) : if arg_10 != arg_6 : arg_9 = arg_9 . repeat ( arg_3 , axis = arg_10 ) arg_5 . append ( arg_9 ) return tuple ( arg_5 )

def Func(*arg_0):
    """Return a mesh grid for N dimensions.

    The input are N arrays, each of which contains the values along one axis of
    the coordinate system. The arrays do not have to have the same number of
    entries. The function returns arrays that can be fed into numpy functions
    so that they produce values for *all* points spanned by the axes *arrs*.

    Original from
    http://stackoverflow.com/questions/1827489/numpy-meshgrid-in-3d and fixed.

    .. SeeAlso: :func:`numpy.meshgrid` for the 2D case.
    """
    #arrs = tuple(reversed(arrs)) <-- wrong on stackoverflow.com
    arg_0 = tuple(arg_0)
    arg_1 = list(map(len, arg_0))
    arg_2 = len(arg_0)

    arg_3 = 1
    for arg_4 in arg_1:
        arg_3 *= arg_4

    arg_5 = []
    for arg_6, arg_7 in enumerate(arg_0):
        arg_8 = [1] * arg_2
        arg_8[arg_6] = arg_1[arg_6]
        arg_9 = numpy.asanyarray(arg_7).reshape(arg_8)
        for arg_10, arg_3 in enumerate(arg_1):
            if arg_10 != arg_6:
                arg_9 = arg_9.repeat(arg_3, axis=arg_10)
        arg_5.append(arg_9)

    return tuple(arg_5)


A basic interface around both queue and send_now. This honors a global
    flag NOTIFICATION_QUEUE_ALL that helps determine whether all calls should
    be queued or not. A per call ``queue`` or ``now`` keyword argument can be
    used to always override the default global behavior.

def Func(*arg_0, **arg_1):
    """
    A basic interface around both queue and Func_now. This honors a global
    flag NOTIFICATION_QUEUE_ALL that helps determine whether all calls should
    be queued or not. A per call ``queue`` or ``now`` keyword argument can be
    used to always override the default global behavior.
    """
    arg_2 = arg_1.pop("queue", False)
    arg_3 = arg_1.pop("now", False)
    assert not (arg_2 and arg_3), "'queue' and 'now' cannot both be True."
    if arg_2:
        return queue(*arg_0, **arg_1)
    elif arg_3:
        return Func_now(*arg_0, **arg_1)
    else:
        if QUEUE_ALL:
            return queue(*arg_0, **arg_1)
        else:
            return Func_now(*arg_0, **arg_1)

A basic interface around both queue and send_now . This honors a global flag NOTIFICATION_QUEUE_ALL that helps determine whether all calls should be queued or not . A per call queue or now keyword argument can be used to always override the default global behavior .