def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
==
SIMPLE
:
arg_6
=
[
i
(
arg_1
)
for
i
in
arg_0
.
SurfaceTensions
]
return
mixing_simple
(
arg_3
,
arg_6
)
elif
arg_5
==
DIGUILIOTEJA
:
return
Diguilio_Teja
(
arg_1
=
arg_1
,
xs
=
arg_3
,
sigmas_Tb
=
arg_0
.
sigmas_Tb
,
Tbs
=
arg_0
.
Tbs
,
Tcs
=
arg_0
.
Tcs
)
elif
arg_5
==
WINTERFELDSCRIVENDAVIS
:
arg_6
=
[
i
(
arg_1
)
for
i
in
arg_0
.
SurfaceTensions
]
arg_7
=
[
1.
/
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
VolumeLiquids
]
return
Winterfeld_Scriven_Davis
(
arg_3
,
arg_6
,
arg_7
)
else
:
raise
Exception
(
'Method not valid'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func surface tension 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
        -------
        sigma : float
            Surface tension of the liquid at given conditions, [N/m]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1) for i in arg_0.SurfaceTensions]
            return mixing_simple(arg_3, arg_6)
        elif arg_5 == DIGUILIOTEJA:
            return Diguilio_Teja(arg_1=arg_1, xs=arg_3, sigmas_Tb=arg_0.sigmas_Tb,
                                 Tbs=arg_0.Tbs, Tcs=arg_0.Tcs)
        elif arg_5 == WINTERFELDSCRIVENDAVIS:
            arg_6 = [i(arg_1) for i in arg_0.SurfaceTensions]
            arg_7 = [1./i(arg_1, arg_2) for i in arg_0.VolumeLiquids]
            return Winterfeld_Scriven_Davis(arg_3, arg_6, arg_7)
        else:
            raise Exception('Method not valid')

r'''Method to calculate surface tension 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
        -------
        sigma : float
            Surface tension of the liquid at given conditions, [N/m]

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


(self, score_map, type="valid", epoch=-1, new_best=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"valid"
,
arg_3
=
1
,
arg_4
=
False
)
:
arg_5
=
arg_2
if
len
(
arg_5
)
<
5
:
arg_5
+=
" "
*
(
5
len
(
arg_5
)
)
arg_6
=
" "
.
join
(
"%s=%.2f"
%
el
for
el
in
arg_1
.
items
(
)
)
arg_7
=
arg_3
if
arg_3
>
0
else
arg_0
.
current_epoch
(
)
arg_8
=
"epoch={}"
.
format
(
arg_7
+
1
)
if
arg_3
<
0
:
arg_8
=
"dryrun"
sys
.
stdout
.
write
(
"\r"
)
sys
.
stdout
.
flush
(
)
arg_9
=
" *"
if
arg_4
else
""
arg_10
=
"{} ({}) {}{}"
.
format
(
arg_5
,
arg_8
,
arg_6
,
arg_9
)
arg_0
.
network
.
train_logger
.
record
(
arg_10
)
logging
.
info
(
arg_10
)

def Func(arg_0, arg_1, arg_2="valid", arg_3=-1, arg_4=False):
        """
        Report the scores and record them in the log.
        """
        arg_5 = arg_2
        if len(arg_5) < 5:
            arg_5 += " " * (5 - len(arg_5))
        arg_6 = " ".join("%s=%.2f" % el for el in arg_1.items())
        arg_7 = arg_3 if arg_3 > 0 else arg_0.current_epoch()
        arg_8 = "epoch={}".format(arg_7 + 1)
        if arg_3 < 0:
            arg_8 = "dryrun"
            sys.stdout.write("\r")
            sys.stdout.flush()
        arg_9 = " *" if arg_4 else ""
        arg_10 = "{} ({}) {}{}".format(arg_5, arg_8, arg_6, arg_9)
        arg_0.network.train_logger.record(arg_10)
        logging.info(arg_10)

Report the scores and record them in the log .


(
    dist='dist',
    minver=None,
    maxver=None,
    use_markdown_readme=True,
    use_stdeb=False,
    use_distribute=False,
    )

def Func(
    arg_0='dist',
    arg_1=None,
    arg_2=None,
    arg_3=True,
    arg_4=False,
    arg_5=False,
    ):
    """Imports and returns a setup function.

    If use_markdown_readme is set,
    then README.md is added to setuptools READMES list.

    If use_stdeb is set on a Debian based system,
    then module stdeb is imported.
    Stdeb supports building deb packages on Debian based systems.
    The package should only be installed on the same system version
    it was built on, though. See http://github.com/astraw/stdeb.

    If use_distribute is set, then distribute_setup.py is imported.
    """
    if not arg_1 == arg_2 == None:
        import sys
        if not arg_1 <= sys.version < (arg_2 or 'Any'):
            sys.stderr.write(
                '%s: requires python version in <%s, %s), not %s\n' % (
                sys.argv[0], arg_1 or 'any', arg_2 or 'any', sys.version.split()[0]))
            sys.exit(1)

    if arg_5:
        from distribute_setup import use_setuptools
        use_setuptools(to_dir=arg_0)
        from arg_6 import setup
    else:
        try:
            from arg_6 import setup
        except ImportError:
            from distutils.core import setup

    if arg_3:
        try:
            import arg_6.command.sdist
            arg_6.command.sdist.READMES = tuple(list(getattr(arg_6.command.sdist, 'READMES', ()))
                + ['README.md'])
        except ImportError:
            pass

    if arg_4:
        import platform
        if 'debian' in platform.dist():
            try:
                import stdeb
            except ImportError:
                pass

    return setup


def Func(arg_0, arg_1, arg_2):
        """Produce two gametes, an egg and a sperm, from the input strings.
        Combine them to produce a genome a la sexual reproduction.
        """
        arg_3 = arg_0.generate_gamete(arg_1)
        arg_4 = arg_0.generate_gamete(arg_2)

        arg_0.genome = list(set(arg_3 + arg_4)) # Eliminate duplicates
        arg_0.generation = 1
        arg_0.divinity = god

Produce two gametes an egg and a sperm from the input strings . Combine them to produce a genome a la sexual reproduction .


(directory, filename, config={}, ignore_predicate=None, ignored_files=['.git', '.svn'])

def
Func
(
arg_0
,
arg_1
,
arg_2
=
{
}
,
arg_3
=
,
arg_4
=
[
'.git'
,
'.svn'
]
)
:
with
zipfile
.
ZipFile
(
arg_1
,
'w'
,
compression
=
zipfile
.
ZIP_DEFLATED
)
as
zip_file
:
arg_5
=
len
(
os
.
path
.
abspath
(
arg_0
)
)
out
(
"Creating archive: "
+
str
(
arg_1
)
)
for
arg_6
,
arg_7
,
arg_8
in
os
.
walk
(
arg_0
,
followlinks
=
True
)
:
arg_9
=
os
.
path
.
abspath
(
arg_6
)
[
arg_5
+
1
:
]
for
arg_10
in
arg_8
:
arg_11
=
os
.
path
.
join
(
arg_6
,
arg_10
)
arg_12
=
os
.
path
.
join
(
arg_9
,
arg_10
)
if
arg_1
in
arg_11
:
continue
if
arg_4
is
not
:
for
arg_13
in
arg_4
:
if
arg_11
.
endswith
(
arg_13
)
:
out
(
"Skipping: "
+
str
(
arg_13
)
)
continue
if
arg_3
is
not
:
if
not
arg_3
(
arg_12
)
:
out
(
"Skipping: "
+
str
(
arg_12
)
)
continue
out
(
"Adding: "
+
str
(
arg_12
)
)
zip_file
.
write
(
arg_11
,
arg_12
,
zipfile
.
ZIP_DEFLATED
)
return
arg_1

def Func(arg_0, arg_1, arg_2={}, arg_3=None, arg_4=['.git', '.svn']):
    """
    Creates an archive from a directory and returns
    the file that was created.
    """
    with zipfile.ZipFile(arg_1, 'w', compression=zipfile.ZIP_DEFLATED) as zip_file:
        arg_5 = len(os.path.abspath(arg_0))

        # create it
        out("Creating archive: " + str(arg_1))
        for arg_6, arg_7, arg_8 in os.walk(arg_0, followlinks=True):
            arg_9 = os.path.abspath(arg_6)[arg_5 + 1:]
            for arg_10 in arg_8:
                arg_11 = os.path.join(arg_6, arg_10)
                arg_12 = os.path.join(arg_9, arg_10)

                # ignore the file we're creating
                if arg_1 in arg_11:
                    continue

                # ignored files
                if arg_4 is not None:
                    for arg_13 in arg_4:
                        if arg_11.endswith(arg_13):
                            out("Skipping: " + str(arg_13))
                            continue

                # do predicate
                if arg_3 is not None:
                    if not arg_3(arg_12):
                        out("Skipping: " + str(arg_12))
                        continue

                out("Adding: " + str(arg_12))
                zip_file.write(arg_11, arg_12, zipfile.ZIP_DEFLATED)

    return arg_1

Creates an archive from a directory and returns the file that was created .


def Func(arg_0, arg_1):
        """
        Turn tokens into a tokens of n-grams

        ref: https://github.com/scikit-learn/scikit-learn/blob/ef5cb84a/sklearn/feature_extraction/text.py#L124-L153
        """
        # handle stop words
        if arg_0.stop_words is not None:
            arg_1 = [w for w in arg_1 if w not in arg_0.stop_words]

        # handle token n-grams
        arg_2, arg_3 = arg_0.ngram_range
        if arg_3 != 1:
            arg_4 = arg_1
            if arg_2 == 1:
                # no need to do any slicing for unigrams
                # just iterate through the original tokens
                arg_1 = list(arg_4)
                arg_2 += 1
            else:
                arg_1 = []

            arg_5 = len(arg_4)

            # bind method outside of loop to reduce overhead
            arg_6 = arg_1.append
            arg_7 = " ".join

            for arg_8 in range(arg_2,
                           min(arg_3 + 1, arg_5 + 1)):
                for arg_9 in range(arg_5 - arg_8 + 1):
                    arg_6(arg_7(arg_4[arg_9: arg_9 + arg_8]))

        return arg_1


def Func ( arg_0 ) : arg_0 . ctx . fbo . Func ( red = arg_0 . Func_color [ 0 ] , green = arg_0 . Func_color [ 1 ] , blue = arg_0 . Func_color [ 2 ] , alpha = arg_0 . Func_color [ 3 ] , depth = arg_0 . Func_depth , )

def Func(arg_0):
        """
        Clear the window buffer
        """
        arg_0.ctx.fbo.Func(
            red=arg_0.Func_color[0],
            green=arg_0.Func_color[1],
            blue=arg_0.Func_color[2],
            alpha=arg_0.Func_color[3],
            depth=arg_0.Func_depth,
        )


(
    input_files,
    tile,
    indexes=None,
    resampling="nearest",
    src_nodata=None,
    dst_nodata=None,
    gdal_opts=None
)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
"nearest"
,
arg_4
=
,
arg_5
=
,
arg_6
=
)
:
with
rasterio
.
Env
(
**
get_gdal_options
(
arg_6
,
is_remote
=
path_is_remote
(
arg_0
[
0
]
if
isinstance
(
arg_0
,
list
)
else
arg_0
,
s3
=
True
)
)
)
as
env
:
logger
.
debug
(
"reading %s with GDAL options %s"
,
arg_0
,
env
.
options
)
return
_Func
(
arg_0
,
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
)

def Func(
    arg_0,
    arg_1,
    arg_2=None,
    arg_3="nearest",
    arg_4=None,
    arg_5=None,
    arg_6=None
):
    """
    Return NumPy arrays from an input raster.

    NumPy arrays are reprojected and resampled to tile properties from input
    raster. If tile boundaries cross the antimeridian, data on the other side
    of the antimeridian will be read and concatenated to the numpy array
    accordingly.

    Parameters
    ----------
    input_files : string or list
        path to a raster file or list of paths to multiple raster files readable by
        rasterio.
    tile : Tile
        a Tile object
    indexes : list or int
        a list of band numbers; None will read all.
    resampling : string
        one of "nearest", "average", "bilinear" or "lanczos"
    src_nodata : int or float, optional
        if not set, the nodata value from the source dataset will be used
    dst_nodata : int or float, optional
        if not set, the nodata value from the source dataset will be used
    gdal_opts : dict
        GDAL options passed on to rasterio.Env()

    Returns
    -------
    raster : MaskedArray
    """
    with rasterio.Env(
        **get_gdal_options(
            arg_6,
            is_remote=path_is_remote(
                arg_0[0] if isinstance(arg_0, list) else arg_0, s3=True
            )
        )
    ) as env:
        logger.debug("reading %s with GDAL options %s", arg_0, env.options)
        return _Func(
            arg_0,
            arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5
        )

Return NumPy arrays from an input raster .


def Func(arg_0, arg_1, arg_2=False):
    """
    Encrypts a value using an RSA public key via CryptoAPI

    :param certificate_or_public_key:
        A Certificate or PublicKey instance to encrypt with

    :param data:
        A byte string of the data to encrypt

    :param rsa_oaep_padding:
        If OAEP padding should be used instead of PKCS#1 v1.5

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    """

    arg_3 = 0
    if arg_2:
        arg_3 = Advapi32Const.CRYPT_OAEP

    arg_4 = new(advapi32, 'DWORD *', len(arg_1))
    arg_5 = advapi32.CryptEncrypt(
        arg_0.ex_key_handle,
        null(),
        True,
        arg_3,
        null(),
        arg_4,
        0
    )
    handle_error(arg_5)

    arg_6 = deref(arg_4)
    arg_7 = buffer_from_bytes(arg_6)
    write_to_buffer(arg_7, arg_1)

    pointer_set(arg_4, len(arg_1))
    arg_5 = advapi32.CryptEncrypt(
        arg_0.ex_key_handle,
        null(),
        True,
        arg_3,
        arg_7,
        arg_4,
        arg_6
    )
    handle_error(arg_5)

    return bytes_from_buffer(arg_7, deref(arg_4))[::-1]


def
Func
(
arg_0
)
:
try
:
arg_0
.
log_parser
(
)
except
(
FileNotFoundError
,
StopIteration
)
as
e
:
logger
.
debug
(
"ERROR: "
+
str
(
sys
.
exc_info
(
)
[
0
]
)
)
arg_0
.
log_retry
+=
1
if
arg_0
.
log_retry
==
arg_0
.
MAX_RETRIES
:
raise
e
try
:
arg_0
.
trace_parser
(
)
except
(
FileNotFoundError
,
StopIteration
)
as
e
:
logger
.
debug
(
"ERROR: "
+
str
(
sys
.
exc_info
(
)
[
0
]
)
)
arg_0
.
trace_retry
+=
1
if
arg_0
.
trace_retry
==
arg_0
.
MAX_RETRIES
:
raise
e

def Func(arg_0):
        """Wrapper method that calls the appropriate main updating methods of
        the inspection.

        It is meant to be used inside a loop (like while), so that it can
        continuously update the class attributes from the trace and log files.
        It already implements checks to parse these files only when they
        change, and they ignore entries that have been previously processes.
        """

        try:
            arg_0.log_parser()
        except (FileNotFoundError, StopIteration) as e:
            logger.debug("ERROR: " + str(sys.exc_info()[0]))
            arg_0.log_retry += 1
            if arg_0.log_retry == arg_0.MAX_RETRIES:
                raise e
        try:
            arg_0.trace_parser()
        except (FileNotFoundError, StopIteration) as e:
            logger.debug("ERROR: " + str(sys.exc_info()[0]))
            arg_0.trace_retry += 1
            if arg_0.trace_retry == arg_0.MAX_RETRIES:
                raise e

Wrapper method that calls the appropriate main updating methods of the inspection .


(self, imagefile, save_path, file_ext, mime_type)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = InMemoryUploadedFile ( arg_1 , None , 'foo.%s' % arg_3 , arg_4 , arg_1 . tell ( ) , None ) arg_5 . seek ( 0 ) arg_0 . storage . save ( arg_2 , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Save an image to self.storage at `save_path`.

        Arguments:
            `imagefile`: Raw image data, typically a BytesIO instance.
            `save_path`: The path within self.storage where the image should
                         be saved.
            `file_ext`: The file extension of the image-to-be-saved.
            `mime_type`: A valid image mime type (as found in
                         versatileimagefield.utils)
        """
        arg_5 = InMemoryUploadedFile(
            arg_1,
            None,
            'foo.%s' % arg_3,
            arg_4,
            arg_1.tell(),
            None
        )
        arg_5.seek(0)
        arg_0.storage.save(arg_2, arg_5)

Save an image to self . storage at save_path .


def Func ( ) : arg_0 = libcrypto . ERR_peek_error ( ) arg_1 = int ( ( arg_0 >> 24 ) & 0xff ) arg_2 = int ( ( arg_0 >> 12 ) & 0xfff ) arg_3 = int ( arg_0 & 0xfff ) return ( arg_1 , arg_2 , arg_3 )

def Func():
    """
    Peeks into the error stack and pulls out the lib, func and reason

    :return:
        A three-element tuple of integers (lib, func, reason)
    """

    arg_0 = libcrypto.ERR_peek_error()
    arg_1 = int((arg_0 >> 24) & 0xff)
    arg_2 = int((arg_0 >> 12) & 0xfff)
    arg_3 = int(arg_0 & 0xfff)

    return (arg_1, arg_2, arg_3)

Peeks into the error stack and pulls out the lib func and reason


Assert that there is exactly one node in the give list, and return it.

def Func(arg_0, arg_1=False):
    """
    Assert that there is exactly Func node in the give list, and return it.
    """
    if not arg_0 and arg_1:
        return NFunc
    assert len(
        arg_0) == 1, 'Expected 1 result. Received %d results.' % (len(arg_0))
    return arg_0[0]

Assert that there is exactly one node in the give list and return it .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
info
(
"Loading user information for %s/%s"
,
arg_1
.
id
,
arg_1
.
username
)
arg_0
.
load_user_info
(
arg_1
)
arg_0
.
log
.
info
(
"Loading user rights for %s/%s"
,
arg_1
.
id
,
arg_1
.
username
)
arg_0
.
load_user_rights
(
arg_1
)
arg_0
.
log
.
info
(
"Added user: %s/%s"
,
arg_1
.
id
,
arg_1
.
username
)
arg_0
.
_add_user_to_cache
(
arg_1
)
return
arg_1

def Func(arg_0, arg_1):
        """
        Adds a user object to the user manager

        user - a SlackUser object
        """

        arg_0.log.info("Loading user information for %s/%s", arg_1.id, arg_1.username)
        arg_0.load_user_info(arg_1)
        arg_0.log.info("Loading user rights for %s/%s", arg_1.id, arg_1.username)
        arg_0.load_user_rights(arg_1)
        arg_0.log.info("Added user: %s/%s", arg_1.id, arg_1.username)
        arg_0._add_user_to_cache(arg_1)
        return arg_1


def Func(arg_0, arg_1, arg_2=None):
        """Backs up a trajectory.

        :param traj: Trajectory that should be backed up

        :param backup_filename:

            Path and filename of backup file. If None is specified the storage service
            defaults to `path_to_trajectory_hdf5_file/backup_trajectory_name.hdf`.

        """
        arg_0._logger.info('Storing backup of %s.' % arg_1.v_name)

        arg_3, arg_4 = os.path.split(arg_0._filename)

        if arg_2 is None:
            arg_2 = os.path.join('%s' % arg_3, 'backup_%s.hdf5' % arg_1.v_name)

        arg_5 = pt.open_file(filename=arg_2,
                                             mode='a', title=arg_2)

        if '/' + arg_0._trajectory_name in arg_5:
            raise ValueError('I cannot backup  `%s` into file `%s`, there is already a '
                             'trajectory with that name.' % (arg_1.v_name, arg_2))

        arg_6 = arg_5.root

        arg_0._trajectory_group._f_copy(newparent=arg_6, recursive=True)

        arg_5.flush()
        arg_5.close()

        arg_0._logger.info('Finished backup of %s.' % arg_1.v_name)


def Func(arg_0):
    """Like os.makedirs but takes care about race conditions"""
    if os.path.isfile(arg_0):
        raise IOError('Path `%s` is already a file not a directory')
    while True:
        try:
            if os.path.isdir(arg_0):
                # only break if full path has been created or exists
                break
            os.makedirs(arg_0)
        except EnvironmentError as exc:
            # Part of the directory path already exist
            if exc.errno != 17:
                # This error won't be any good
                raise

Like os . makedirs but takes care about race conditions


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 . parent , astroid . Call ) : return if PY35 and isinstance ( arg_1 . parent , ( astroid . List , astroid . Tuple , astroid . Set , astroid . Dict ) ) : return arg_2 = arg_1 . statement ( ) if not isinstance ( arg_2 , astroid . Assign ) : return if arg_2 . value is arg_1 or arg_2 . value . parent_of ( arg_1 ) : arg_0 . add_message ( "star-needs-assignment-target" , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Check that a Starred expression is used in an assignment target."""
        if isinstance(arg_1.parent, astroid.Call):
            # f(*args) is converted to Call(args=[Starred]), so ignore
            # them for this check.
            return
        if PY35 and isinstance(
            arg_1.parent, (astroid.List, astroid.Tuple, astroid.Set, astroid.Dict)
        ):
            # PEP 448 unpacking.
            return

        arg_2 = arg_1.statement()
        if not isinstance(arg_2, astroid.Assign):
            return

        if arg_2.value is arg_1 or arg_2.value.parent_of(arg_1):
            arg_0.add_message("star-needs-assignment-target", arg_1=arg_1)

Check that a Starred expression is used in an assignment target .


(alt_len, ref_len, category, pos, end, svtype=None, svlen=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None , arg_6 = None ) : arg_7 = - 1 if arg_2 in ( 'snv' , 'indel' , 'cancer' ) : if arg_1 == arg_0 : arg_7 = arg_0 else : arg_7 = abs ( arg_1 - arg_0 ) elif arg_2 == 'sv' : if arg_5 == 'bnd' : arg_7 = int ( 10e10 ) else : if arg_6 : arg_7 = abs ( int ( arg_6 ) ) elif arg_4 : if arg_4 != arg_3 : arg_7 = arg_4 - arg_3 return arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None, arg_6=None):
    """Return the length of a variant

    Args:
        alt_len(int)
        ref_len(int)
        category(str)
        svtype(str)
        svlen(int)
    """
    # -1 would indicate uncertain length
    arg_7 = -1
    if arg_2 in ('snv', 'indel', 'cancer'):
        if arg_1 == arg_0:
            arg_7 = arg_0
        else:
            arg_7 = abs(arg_1 - arg_0)

    elif arg_2 == 'sv':
        if arg_5 == 'bnd':
            arg_7 = int(10e10)
        else:
            if arg_6:
                arg_7 = abs(int(arg_6))
            # Some software does not give a length but they give END
            elif arg_4:
                if arg_4 != arg_3:
                    arg_7 = arg_4 - arg_3
    return arg_7


def Func(arg_0):
    """Return source code based on tokens.

    This is like tokenize.Func(), but it preserves spacing between
    tokens. So if the original soure code had multiple spaces between
    some tokens or if escaped newlines were used, those things will be
    reflected by Func().

    """
    arg_1 = ''
    arg_2 = ''
    arg_3 = 0
    arg_4 = -1
    arg_5 = None

    for (arg_6, arg_7, arg_8, arg_9, arg_10) in arg_0:
        if TOKENIZE_HAS_ENCODING and arg_6 == tokenize.ENCODING:
            continue

        (arg_11, arg_12) = arg_8
        (arg_13, arg_14) = arg_9

        # Preserve escaped newlines.
        if (
            arg_5 != tokenize.COMMENT and
            arg_11 > arg_3 and
            arg_2.endswith(('\\\n', '\\\r\n', '\\\r'))
        ):
            arg_1 += arg_2[len(arg_2.rstrip(' \t\n\r\\')):]

        # Preserve spacing.
        if arg_11 > arg_3:
            arg_4 = 0
        if arg_12 > arg_4:
            arg_1 += arg_10[arg_4:arg_12]

        arg_1 += arg_7

        arg_2 = arg_10

        arg_3 = arg_13
        arg_4 = arg_14

        if arg_6 not in WHITESPACE_TOKENS:
            arg_5 = arg_6

    return arg_1

Return source code based on tokens.

    This is like tokenize.untokenize(), but it preserves spacing between
    tokens. So if the original soure code had multiple spaces between
    some tokens or if escaped newlines were used, those things will be
    reflected by untokenize().


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = len ( arg_2 ) arg_4 = int ( math . log2 ( arg_3 ) ) + 1 arg_5 = QuantumRegister ( arg_4 ) arg_6 = QuantumCircuit ( arg_5 , name = "multiplex" + arg_4 . __str__ ( ) ) arg_7 = arg_5 [ 0 ] arg_8 = arg_5 [ arg_4 - 1 ] if arg_4 == 1 : arg_6 . append ( arg_1 ( arg_2 [ 0 ] ) , [ arg_5 [ 0 ] ] ) return arg_6 arg_9 = scipy . kron ( [ [ 0.5 , 0.5 ] , [ 0.5 , - 0.5 ] ] , np . identity ( 2 ** ( arg_4 - 2 ) ) ) arg_2 = arg_9 . dot ( np . array ( arg_2 ) ) . tolist ( ) arg_10 = arg_0 . Func ( arg_1 , arg_2 [ 0 : ( arg_3 // 2 ) ] ) arg_6 . append ( arg_10 . to_instruction ( ) , arg_5 [ 0 : - 1 ] ) arg_6 . append ( CnotGate ( ) , [ arg_8 , arg_7 ] ) arg_11 = arg_0 . Func ( arg_1 , arg_2 [ ( arg_3 // 2 ) : ] ) if arg_3 > 1 : arg_6 . append ( arg_11 . to_instruction ( ) . mirror ( ) , arg_5 [ 0 : - 1 ] ) else : arg_6 . append ( arg_11 . to_instruction ( ) , arg_5 [ 0 : - 1 ] ) arg_6 . append ( CnotGate ( ) , [ arg_8 , arg_7 ] ) return arg_6

def Func(arg_0, arg_1, arg_2):
        """
        Return a recursive implementation of a multiplexor circuit,
        where each instruction itself has a decomposition based on
        smaller multiplexors.

        The LSB is the multiplexor "data" and the other bits are multiplexor "select".

        Args:
            target_gate (Gate): Ry or Rz gate to apply to target qubit, multiplexed
                over all other "select" qubits
            list_of_angles (list[float]): list of rotation angles to apply Ry and Rz

        Returns:
            DAGCircuit: the circuit implementing the multiplexor's action
        """
        arg_3 = len(arg_2)
        arg_4 = int(math.log2(arg_3)) + 1

        arg_5 = QuantumRegister(arg_4)
        arg_6 = QuantumCircuit(arg_5, name="multiplex" + arg_4.__str__())

        arg_7 = arg_5[0]
        arg_8 = arg_5[arg_4 - 1]

        # case of no multiplexing: base case for recursion
        if arg_4 == 1:
            arg_6.append(arg_1(arg_2[0]), [arg_5[0]])
            return arg_6

        # calc angle weights, assuming recursion (that is the lower-level
        # requested angles have been correctly implemented by recursion
        arg_9 = scipy.kron([[0.5, 0.5], [0.5, -0.5]],
                                  np.identity(2 ** (arg_4 - 2)))

        # calc the combo angles
        arg_2 = arg_9.dot(np.array(arg_2)).tolist()

        # recursive step on half the angles fulfilling the above assumption
        arg_10 = arg_0.Func(arg_1, arg_2[0:(arg_3 // 2)])
        arg_6.append(arg_10.to_instruction(), arg_5[0:-1])

        # attach CNOT as follows, thereby flipping the LSB qubit
        arg_6.append(CnotGate(), [arg_8, arg_7])

        # implement extra efficiency from the paper of cancelling adjacent
        # CNOTs (by leaving out last CNOT and reversing (NOT inverting) the
        # second lower-level multiplex)
        arg_11 = arg_0.Func(arg_1, arg_2[(arg_3 // 2):])
        if arg_3 > 1:
            arg_6.append(arg_11.to_instruction().mirror(), arg_5[0:-1])
        else:
            arg_6.append(arg_11.to_instruction(), arg_5[0:-1])

        # attach a final CNOT
        arg_6.append(CnotGate(), [arg_8, arg_7])

        return arg_6

Return a recursive implementation of a multiplexor circuit where each instruction itself has a decomposition based on smaller multiplexors .


def
Func
(
arg_0
,
arg_1
=
[
]
,
arg_2
=
False
)
:
global
arg_5
arg_3
=
sys
.
argv
[
1
:
]
for
arg_4
in
filter
(
os
.
path
.
isfile
,
arg_1
)
:
arg_3
.
insert
(
0
,
"@"
+
arg_4
)
arg_5
,
arg_6
=
arg_0
.
parse_known_args
(
arg_3
)
if
arg_6
and
not
arg_2
:
arg_7
=
gettext
(
'unrecognized arguments: %s'
)
arg_0
.
error
(
arg_7
%
' '
.
join
(
arg_6
)
)
if
arg_5
.
stream
:
arg_5
.
stream
=
[
arg_8
.
lower
(
)
for
arg_8
in
arg_5
.
stream
]
if
not
arg_5
.
url
and
arg_5
.
url_param
:
arg_5
.
url
=
arg_5
.
url_param

def Func(arg_0, arg_1=[], arg_2=False):
    """Parses arguments."""
    global arg_5
    arg_3 = sys.argv[1:]

    # Load arguments from config files
    for arg_4 in filter(os.path.isfile, arg_1):
        arg_3.insert(0, "@" + arg_4)

    arg_5, arg_6 = arg_0.parse_known_args(arg_3)
    if arg_6 and not arg_2:
        arg_7 = gettext('unrecognized arguments: %s')
        arg_0.error(arg_7 % ' '.join(arg_6))

    # Force lowercase to allow case-insensitive lookup
    if arg_5.stream:
        arg_5.stream = [arg_8.lower() for arg_8 in arg_5.stream]

    if not arg_5.url and arg_5.url_param:
        arg_5.url = arg_5.url_param


def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
"utf-8"
)
:
if
not
arg_2
:
arg_2
=
{
}
if
type
(
arg_1
)
is
unicode
:
arg_1
=
arg_1
.
replace
(
u"\r\n"
,
u"\\n"
)
arg_1
=
arg_1
.
replace
(
u"\n"
,
u"\\n"
)
arg_1
=
arg_1
.
replace
(
u"\r"
,
u"\\n"
)
arg_1
=
arg_1
.
encode
(
arg_3
,
"replace"
)
elif
type
(
arg_1
)
is
not
str
:
raise
TypeError
(
"Bad type for rfc2425 value"
)
elif
not
valid_string_re
.
match
(
arg_1
)
:
arg_2
[
"encoding"
]
=
"b"
arg_1
=
binascii
.
b2a_base64
(
arg_1
)
arg_4
=
str
(
arg_0
)
.
lower
(
)
for
arg_5
,
arg_6
in
arg_2
.
items
(
)
:
arg_4
+=
";%s=%s"
%
(
str
(
arg_5
)
,
str
(
arg_6
)
)
arg_4
+=
":"
while
(
len
(
arg_1
)
>
70
)
:
arg_4
+=
arg_1
[
:
70
]
+
"\r\n "
arg_1
=
arg_1
[
70
:
]
arg_4
+=
arg_1
+
"\r\n"
return
arg_4

def Func(arg_0,arg_1,arg_2=None,arg_3="utf-8"):
    """Encodes a vCard field into an RFC2425 line.

    :Parameters:
        - `name`: field type name
        - `value`: field value
        - `parameters`: optional parameters
        - `charset`: encoding of the output and of the `value` (if not
          `unicode`)
    :Types:
        - `name`: `str`
        - `value`: `unicode` or `str`
        - `parameters`: `dict` of `str` -> `str`
        - `charset`: `str`

    :return: the encoded RFC2425 line (possibly folded)
    :returntype: `str`"""
    if not arg_2:
        arg_2={}
    if type(arg_1) is unicode:
        arg_1=arg_1.replace(u"\r\n",u"\\n")
        arg_1=arg_1.replace(u"\n",u"\\n")
        arg_1=arg_1.replace(u"\r",u"\\n")
        arg_1=arg_1.encode(arg_3,"replace")
    elif type(arg_1) is not str:
        raise TypeError("Bad type for rfc2425 value")
    elif not valid_string_re.match(arg_1):
        arg_2["encoding"]="b"
        arg_1=binascii.b2a_base64(arg_1)

    arg_4=str(arg_0).lower()
    for arg_5,arg_6 in arg_2.items():
        arg_4+=";%s=%s" % (str(arg_5),str(arg_6))
    arg_4+=":"
    while(len(arg_1)>70):
        arg_4+=arg_1[:70]+"\r\n "
        arg_1=arg_1[70:]
    arg_4+=arg_1+"\r\n"
    return arg_4

Encodes a vCard field into an RFC2425 line .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . connection . container_groups . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Delete a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        """
        arg_0.connection.container_groups.Func(arg_1, arg_2)


def
Func
(
arg_0
)
:
if
arg_0
.
_hsObj
.
_fixedFields
is
not
:
return
dict
(
)
,
dict
(
)
arg_1
=
arg_0
.
_hsObj
.
_predictedFieldEncoder
arg_2
=
[
]
for
arg_3
,
arg_4
in
arg_0
.
_state
[
'swarms'
]
.
iteritems
(
)
:
arg_5
=
arg_3
.
split
(
'.'
)
if
len
(
arg_5
)
!=
1
:
continue
arg_6
=
arg_0
.
getEncoderNameFromKey
(
arg_5
[
0
]
)
arg_7
=
arg_4
[
'bestErrScore'
]
if
arg_7
is
:
(
arg_8
,
arg_7
)
=
arg_0
.
_hsObj
.
_resultsDB
.
bestModelIdAndErrScore
(
arg_3
)
arg_2
.
append
(
(
arg_7
,
arg_6
)
)
if
arg_0
.
_hsObj
.
_searchType
==
HsSearchType
.
legacyTemporal
:
assert
(
len
(
arg_2
)
==
1
)
(
arg_9
,
arg_10
)
=
arg_2
[
0
]
for
arg_3
,
arg_4
in
arg_0
.
_state
[
'swarms'
]
.
iteritems
(
)
:
arg_5
=
arg_3
.
split
(
'.'
)
if
len
(
arg_5
)
!=
2
:
continue
arg_11
=
[
arg_0
.
getEncoderNameFromKey
(
name
)
for
name
in
arg_5
]
arg_11
.
remove
(
arg_10
)
arg_2
.
append
(
(
arg_4
[
'bestErrScore'
]
,
arg_11
[
0
]
)
)
else
:
arg_2
.
sort
(
reverse
=
True
)
if
arg_0
.
_hsObj
.
_maxBranching
>
0
and
len
(
arg_2
)
>
arg_0
.
_hsObj
.
_maxBranching
:
arg_9
=
arg_2
[
arg_0
.
_hsObj
.
_maxBranching
1
]
[
0
]
else
:
arg_9
=
arg_2
[
0
]
[
0
]
arg_12
=
dict
(
)
arg_13
=
dict
(
)
if
arg_9
is
not
:
if
abs
(
arg_9
)
<
0.00001
:
arg_9
=
0.00001
for
(
arg_14
,
arg_6
)
in
arg_2
:
if
arg_14
is
not
:
arg_15
=
(
arg_9
arg_14
)
*
100.0
/
arg_9
else
:
arg_15
=
0.0
arg_14
=
arg_9
arg_12
[
arg_6
]
=
arg_15
arg_13
[
arg_6
]
=
arg_9
arg_14
arg_0
.
logger
.
debug
(
"FieldContributions: %s"
%
(
arg_12
)
)
return
arg_12
,
arg_13

def Func(arg_0):
    """Return the field contributions statistics.

    Parameters:
    ---------------------------------------------------------------------
    retval:   Dictionary where the keys are the field names and the values
                are how much each field contributed to the best score.
    """

    #in the fast swarm, there is only 1 sprint and field contributions are
    #not defined
    if arg_0._hsObj._fixedFields is not None:
      return dict(), dict()
    # Get the predicted field encoder name
    arg_1 = arg_0._hsObj._predictedFieldEncoder

    # -----------------------------------------------------------------------
    # Collect all the single field scores
    arg_2 = []
    for arg_3, arg_4 in arg_0._state['swarms'].iteritems():
      arg_5 = arg_3.split('.')
      if len(arg_5) != 1:
        continue
      arg_6 = arg_0.getEncoderNameFromKey(arg_5[0])
      arg_7 = arg_4['bestErrScore']

      # If the bestScore is None, this swarm hasn't completed yet (this could
      #  happen if we're exiting because of maxModels), so look up the best
      #  score so far
      if arg_7 is None:
        (arg_8, arg_7) = \
            arg_0._hsObj._resultsDB.bestModelIdAndErrScore(arg_3)

      arg_2.append((arg_7, arg_6))

    # -----------------------------------------------------------------------
    # If we only have 1 field that was tried in the first sprint, then use that
    #  as the base and get the contributions from the fields in the next sprint.
    if arg_0._hsObj._searchType == HsSearchType.legacyTemporal:
      assert(len(arg_2)==1)
      (arg_9, arg_10) = arg_2[0]

      for arg_3, arg_4 in arg_0._state['swarms'].iteritems():
        arg_5 = arg_3.split('.')
        if len(arg_5) != 2:
          continue

        arg_11 = [arg_0.getEncoderNameFromKey(name) for name in arg_5]
        arg_11.remove(arg_10)

        arg_2.append((arg_4['bestErrScore'], arg_11[0]))

    # The first sprint tried a bunch of fields, pick the worst performing one
    #  (within the top self._hsObj._maxBranching ones) as the base
    else:
      arg_2.sort(reverse=True)

      # If maxBranching was specified, pick the worst performing field within
      #  the top maxBranching+1 fields as our base, which will give that field
      #  a contribution of 0.
      if arg_0._hsObj._maxBranching > 0 \
              and len(arg_2) > arg_0._hsObj._maxBranching:
        arg_9 = arg_2[-arg_0._hsObj._maxBranching-1][0]
      else:
        arg_9 = arg_2[0][0]

    # -----------------------------------------------------------------------
    # Prepare and return the fieldContributions dict
    arg_12 = dict()
    arg_13 = dict()

    # If we have no base score, can't compute field contributions. This can
    #  happen when we exit early due to maxModels or being cancelled
    if arg_9 is not None:

      # If the base error score is 0, we can't compute a percent difference
      #  off of it, so move it to a very small float
      if abs(arg_9) < 0.00001:
        arg_9 = 0.00001
      for (arg_14, arg_6) in arg_2:
        if arg_14 is not None:
          arg_15 = (arg_9 - arg_14) * 100.0 / arg_9
        else:
          arg_15 = 0.0
          arg_14 = arg_9   # for absFieldContribution

        arg_12[arg_6] = arg_15
        arg_13[arg_6] = arg_9 - arg_14

    arg_0.logger.debug("FieldContributions: %s" % (arg_12))
    return arg_12, arg_13

Return the field contributions statistics .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_2 : return 6 if arg_1 == '' or arg_2 == '' : return 0 arg_1 = list ( mra ( arg_1 ) ) arg_2 = list ( mra ( arg_2 ) ) if abs ( len ( arg_1 ) - len ( arg_2 ) ) > 2 : return 0 arg_3 = len ( arg_1 ) + len ( arg_2 ) if arg_3 < 5 : arg_4 = 5 elif arg_3 < 8 : arg_4 = 4 elif arg_3 < 12 : arg_4 = 3 else : arg_4 = 2 for arg_5 in range ( 2 ) : arg_6 = [ ] arg_7 = [ ] arg_8 = min ( len ( arg_1 ) , len ( arg_2 ) ) for arg_9 in range ( arg_8 ) : if arg_1 [ arg_9 ] != arg_2 [ arg_9 ] : arg_6 . append ( arg_1 [ arg_9 ] ) arg_7 . append ( arg_2 [ arg_9 ] ) arg_1 = arg_6 + arg_1 [ arg_8 : ] arg_2 = arg_7 + arg_2 [ arg_8 : ] arg_1 . reverse ( ) arg_2 . reverse ( ) arg_10 = 6 - max ( len ( arg_1 ) , len ( arg_2 ) ) if arg_10 >= arg_4 : return arg_10 return 0

def Func(arg_0, arg_1, arg_2):
        """Return the MRA comparison rating of two strings.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        int
            MRA comparison rating

        Examples
        --------
        >>> cmp = MRA()
        >>> cmp.Func('cat', 'hat')
        5
        >>> cmp.Func('Niall', 'Neil')
        6
        >>> cmp.Func('aluminum', 'Catalan')
        0
        >>> cmp.Func('ATCG', 'TAGC')
        5

        """
        if arg_1 == arg_2:
            return 6
        if arg_1 == '' or arg_2 == '':
            return 0
        arg_1 = list(mra(arg_1))
        arg_2 = list(mra(arg_2))

        if abs(len(arg_1) - len(arg_2)) > 2:
            return 0

        arg_3 = len(arg_1) + len(arg_2)
        if arg_3 < 5:
            arg_4 = 5
        elif arg_3 < 8:
            arg_4 = 4
        elif arg_3 < 12:
            arg_4 = 3
        else:
            arg_4 = 2

        for arg_5 in range(2):
            arg_6 = []
            arg_7 = []
            arg_8 = min(len(arg_1), len(arg_2))
            for arg_9 in range(arg_8):
                if arg_1[arg_9] != arg_2[arg_9]:
                    arg_6.append(arg_1[arg_9])
                    arg_7.append(arg_2[arg_9])
            arg_1 = arg_6 + arg_1[arg_8:]
            arg_2 = arg_7 + arg_2[arg_8:]
            arg_1.reverse()
            arg_2.reverse()

        arg_10 = 6 - max(len(arg_1), len(arg_2))

        if arg_10 >= arg_4:
            return arg_10
        return 0

Return the MRA comparison rating of two strings.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        int
            MRA comparison rating

        Examples
        --------
        >>> cmp = MRA()
        >>> cmp.dist_abs('cat', 'hat')
        5
        >>> cmp.dist_abs('Niall', 'Neil')
        6
        >>> cmp.dist_abs('aluminum', 'Catalan')
        0
        >>> cmp.dist_abs('ATCG', 'TAGC')
        5

Return the MRA comparison rating of two strings .


return crawler_wrapper(self.config.parser_class, parsers, crawl_candidate)

def Func ( arg_0 , arg_1 ) : def crawler_wrapper ( arg_2 , arg_3 , arg_1 ) : try : arg_4 = Crawler ( arg_0 . config , arg_0 . fetcher ) arg_5 = arg_4 . crawl ( arg_1 ) except ( UnicodeDecodeError , ValueError ) as ex : if arg_3 : arg_2 = arg_3 . pop ( 0 ) return crawler_wrapper ( arg_2 , arg_3 , arg_1 ) else : raise ex return arg_5 arg_6 = list ( arg_0 . config . available_parsers ) arg_6 . remove ( arg_0 . config . parser_class ) return crawler_wrapper ( arg_0 . config . parser_class , arg_6 , arg_1 )

def Func(arg_0, arg_1):
        ''' wrap the crawling functionality '''
        def crawler_wrapper(arg_2, arg_3, arg_1):
            try:
                arg_4 = Crawler(arg_0.config, arg_0.fetcher)
                arg_5 = arg_4.crawl(arg_1)
            except (UnicodeDecodeError, ValueError) as ex:
                if arg_3:
                    arg_2 = arg_3.pop(0)  # remove it also!
                    return crawler_wrapper(arg_2, arg_3, arg_1)
                else:
                    raise ex
            return arg_5

        # use the wrapper
        arg_6 = list(arg_0.config.available_parsers)
        arg_6.remove(arg_0.config.parser_class)
        return crawler_wrapper(arg_0.config.parser_class, arg_6, arg_1)


A simple memoize decorator for functions.

def Func ( arg_0 ) : arg_1 = { } def memf ( * arg_2 ) : if arg_2 not in arg_1 : arg_1 [ arg_2 ] = arg_0 ( * arg_2 ) return arg_1 [ arg_2 ] return memf

def Func(arg_0):
    """A simple Func decorator for functions."""
    arg_1= {}
    def memf(*arg_2):
        if arg_2 not in arg_1:
            arg_1[arg_2] = arg_0(*arg_2)
        return arg_1[arg_2]
    return memf

A simple memoize decorator for functions .


(self, alarm_status_callback=None,
                             zone_changed_callback=None,
                             output_changed_callback=None)

async def Func(arg_0, arg_1=None,
                             arg_2=None,
                             arg_3=None):
        """Start monitoring of the alarm status.

        Send command to satel integra to start sending updates. Read in a
        loop and call respective callbacks when received messages.
        """
        arg_0._alarm_status_callback = arg_1
        arg_0._zone_changed_callback = arg_2
        arg_0._output_changed_callback = arg_3

        _LOGGER.info("Starting Func loop")

        while not arg_0.closed:
            _LOGGER.debug("Iteration... ")
            while not arg_0.connected:
                _LOGGER.info("Not connected, re-connecting... ")
                await arg_0.connect()
                if not arg_0.connected:
                    _LOGGER.warning("Not connected, sleeping for 10s... ")
                    await asyncio.sleep(arg_0._reconnection_timeout)
                    continue
            await arg_0.start_monitoring()
            if not arg_0.connected:
                _LOGGER.warning("Start monitoring failed, sleeping for 10s...")
                await asyncio.sleep(arg_0._reconnection_timeout)
                continue
            while True:
                await arg_0._update_status()
                _LOGGER.debug("Got status!")
                if not arg_0.connected:
                    _LOGGER.info("Got connection broken, reconnecting!")
                    break
        _LOGGER.info("Closed, quit monitoring.")


def
Func
(
arg_0
)
:
arg_1
=
[
'.jpg'
,
'.png'
]
for
arg_2
in
[
x
for
x
in
arg_0
.
files1
if
cm
.
ext
(
x
)
in
arg_1
]
:
arg_3
=
"UNKNOWN"
if
len
(
arg_2
)
>
8
and
arg_2
[
:
8
]
in
arg_0
.
IDs
:
arg_3
=
arg_2
[
:
8
]
arg_4
=
arg_3
+
"_jpg_"
+
arg_2
if
not
arg_4
in
arg_0
.
files2
:
arg_0
.
log
.
info
(
"copying over [%s]"
%
arg_4
)
shutil
.
copy
(
os
.
path
.
join
(
arg_0
.
folder1
,
arg_2
)
,
os
.
path
.
join
(
arg_0
.
folder2
,
arg_4
)
)
if
not
arg_2
[
:
8
]
+
".abf"
in
arg_0
.
files1
:
arg_0
.
log
.
error
(
"orphan image: %s"
,
arg_2
)
arg_1
=
[
'.tif'
,
'.tiff'
]
for
arg_2
in
[
x
for
x
in
arg_0
.
files1
if
cm
.
ext
(
x
)
in
arg_1
]
:
arg_3
=
"UNKNOWN"
if
len
(
arg_2
)
>
8
and
arg_2
[
:
8
]
in
arg_0
.
IDs
:
arg_3
=
arg_2
[
:
8
]
arg_4
=
arg_3
+
"_tif_"
+
arg_2
+
".jpg"
if
not
arg_4
in
arg_0
.
files2
:
arg_0
.
log
.
info
(
"converting micrograph [%s]"
%
arg_4
)
imaging
.
TIF_to_jpg
(
os
.
path
.
join
(
arg_0
.
folder1
,
arg_2
)
,
saveAs
=
os
.
path
.
join
(
arg_0
.
folder2
,
arg_4
)
)
if
not
arg_2
[
:
8
]
+
".abf"
in
arg_0
.
files1
:
arg_0
.
log
.
error
(
"orphan image: %s"
,
arg_2
)

def Func(arg_0):
        """
        run this to turn all folder1 TIFs and JPGs into folder2 data.
        TIFs will be treated as micrographs and converted to JPG with enhanced
        contrast. JPGs will simply be copied over.
        """

        # copy over JPGs (and such)
        arg_1=['.jpg','.png']
        for arg_2 in [x for x in arg_0.files1 if cm.ext(x) in arg_1]:
            arg_3="UNKNOWN"
            if len(arg_2)>8 and arg_2[:8] in arg_0.IDs:
                arg_3=arg_2[:8]
            arg_4=arg_3+"_jpg_"+arg_2
            if not arg_4 in arg_0.files2:
                arg_0.log.info("copying over [%s]"%arg_4)
                shutil.copy(os.path.join(arg_0.folder1,arg_2),os.path.join(arg_0.folder2,arg_4))
            if not arg_2[:8]+".abf" in arg_0.files1:
                arg_0.log.error("orphan image: %s",arg_2)

        # convert TIFs (and such) to JPGs
        arg_1=['.tif','.tiff']
        for arg_2 in [x for x in arg_0.files1 if cm.ext(x) in arg_1]:
            arg_3="UNKNOWN"
            if len(arg_2)>8 and arg_2[:8] in arg_0.IDs:
                arg_3=arg_2[:8]
            arg_4=arg_3+"_tif_"+arg_2+".jpg"
            if not arg_4 in arg_0.files2:
                arg_0.log.info("converting micrograph [%s]"%arg_4)
                imaging.TIF_to_jpg(os.path.join(arg_0.folder1,arg_2),saveAs=os.path.join(arg_0.folder2,arg_4))
            if not arg_2[:8]+".abf" in arg_0.files1:
                arg_0.log.error("orphan image: %s",arg_2)

run this to turn all folder1 TIFs and JPGs into folder2 data . TIFs will be treated as micrographs and converted to JPG with enhanced contrast . JPGs will simply be copied over .


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , Operators . OR ( arg_0 . ZF , arg_0 . SF != arg_0 . OF ) , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if not greater.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, Operators.OR(arg_0.ZF, arg_0.SF != arg_0.OF), arg_1.read(), arg_0.PC)


def Func(arg_0, arg_1, arg_2, arg_3):
        """Add a route.

        Arguments:
          method (str): HTTP method, e.g. GET, POST, etc.
          pattern (str): Pattern that request paths must match.
          callback (str): Route handler that is invoked when a request
            path matches the *pattern*.
        """
        arg_4, arg_5 = arg_0._normalize_pattern(arg_2)
        if arg_4 == 'literal':
            arg_0._literal[arg_1][arg_5] = arg_3
        elif arg_4 == 'wildcard':
            arg_0._wildcard[arg_1].append(WildcardRoute(arg_5, arg_3))
        else:
            arg_0._regex[arg_1].append(RegexRoute(arg_5, arg_3))


def Func(arg_0, arg_1, arg_2):
        """
        Saves a value to session.
        """

        arg_0.session[arg_0._session_key(arg_1)] = arg_2


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . _lookup ( arg_1 ) arg_0 . _file . seek ( arg_2 ) arg_4 = arg_0 . _file . readline ( ) . replace ( mailbox . linesep , b'' ) arg_5 = arg_0 . _file . read ( arg_3 - arg_0 . _file . tell ( ) ) arg_6 = arg_0 . _message_factory ( arg_5 . replace ( mailbox . linesep , b'\n' ) ) try : arg_6 . set_from ( arg_4 [ 5 : ] . decode ( 'ascii' ) ) return arg_6 except UnicodeDecodeError : pass try : arg_6 . set_from ( arg_4 [ 5 : ] . decode ( 'utf-8' ) ) except UnicodeDecodeError : arg_6 . set_from ( arg_4 [ 5 : ] . decode ( 'iso-8859-1' ) ) return arg_6

def Func(arg_0, arg_1):
        """Return a Message representation or raise a KeyError."""

        arg_2, arg_3 = arg_0._lookup(arg_1)
        arg_0._file.seek(arg_2)
        arg_4 = arg_0._file.readline().replace(mailbox.linesep, b'')
        arg_5 = arg_0._file.read(arg_3 - arg_0._file.tell())
        arg_6 = arg_0._message_factory(arg_5.replace(mailbox.linesep, b'\n'))

        try:
            arg_6.set_from(arg_4[5:].decode('ascii'))
            return arg_6
        except UnicodeDecodeError:
            pass

        try:
            arg_6.set_from(arg_4[5:].decode('utf-8'))
        except UnicodeDecodeError:
            arg_6.set_from(arg_4[5:].decode('iso-8859-1'))

        return arg_6

Return a Message representation or raise a KeyError .


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
bytes
)
:
raise
TypeError
(
"when must be a byte string"
)
arg_2
=
_lib
.
ASN1_TIME_set_string
(
arg_0
,
arg_1
)
if
arg_2
==
0
:
raise
ValueError
(
"Invalid string"
)

def Func(arg_0, arg_1):
    """
    The the time value of an ASN1 time object.

    @param boundary: An ASN1_TIME pointer (or an object safely
        castable to that type) which will have its value set.
    @param when: A string representation of the desired time value.

    @raise TypeError: If C{when} is not a L{bytes} string.
    @raise ValueError: If C{when} does not represent a time in the required
        format.
    @raise RuntimeError: If the time value cannot be set for some other
        (unspecified) reason.
    """
    if not isinstance(arg_1, bytes):
        raise TypeError("when must be a byte string")

    arg_2 = _lib.ASN1_TIME_set_string(arg_0, arg_1)
    if arg_2 == 0:
        raise ValueError("Invalid string")

The the time value of an ASN1 time object .


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . mathml_elements : arg_0 . fed . append ( "</{0}>" . format ( arg_1 ) )

def Func(arg_0, arg_1):
        """Return representation of html end tag."""
        if arg_1 in arg_0.mathml_elements:
            arg_0.fed.append("</{0}>".format(arg_1))


def Func(arg_0=None, arg_1=6006):
    """Close TensorFlow session, TensorBoard and Nvidia-process if available.

    Parameters
    ----------
    sess : Session
        TensorFlow Session.
    tb_port : int
        TensorBoard port you want to close, `6006` as default.

    """
    arg_2 = "[TL] Close tensorboard and nvidia-process if available"
    arg_3 = "[TL] Close tensorboard and nvidia-process not yet supported by this function (tl.ops.exit_tf) on "

    if arg_0 is not None:
        arg_0.close()

    if _platform == "linux" or _platform == "linux2":
        tl.logging.info('linux: %s' % arg_2)
        os.system('nvidia-smi')
        os.system('fuser ' + arg_1 + '/tcp -k')  # kill tensorboard 6006
        os.system("nvidia-smi | grep python |awk '{print $3}'|xargs kill")  # kill all nvidia-smi python process
        _exit()

    elif _platform == "darwin":
        tl.logging.info('OS X: %s' % arg_2)
        subprocess.Popen(
            "lsof -i tcp:" + str(arg_1) + "  | grep -v PID | awk '{print $2}' | xargs kill", shell=True
        )  # kill tensorboard
    elif _platform == "win32":
        raise NotImplementedError("this function is not supported on the Windows platform")

    else:
        tl.logging.info(arg_3 + _platform)

Close TensorFlow session TensorBoard and Nvidia - process if available .


def Func ( arg_0 ) : arg_1 = '' if arg_0 . groups . filter ( name = 'Admin' ) . exists ( ) or arg_0 . is_superuser : arg_1 = 'admin' return arg_1

def Func(arg_0):
        """Returns the user's permissions."""

        arg_1 = ''
        if arg_0.groups.filter(name='Admin').exists() or arg_0.is_superuser:
            arg_1 = 'admin'

        return arg_1


return len([g for g in step['gates_mapped']
                if len(g.qargs) == 2]) - 3 * step['swaps_added']

def Func ( arg_0 ) : return len ( [ arg_1 for arg_1 in arg_0 [ 'gates_mapped' ] if len ( arg_1 . qargs ) == 2 ] ) - 3 * arg_0 [ 'swaps_added' ]

def Func(arg_0):

    """Count the mapped two-qubit gates, less the number of added SWAPs."""
    # Each added swap will add 3 ops to gates_mapped, so subtract 3.
    return len([arg_1 for arg_1 in arg_0['gates_mapped']
                if len(arg_1.qargs) == 2]) - 3 * arg_0['swaps_added']

Count the mapped two - qubit gates less the number of added SWAPs .


def Func(arg_0):
        '''Run build.'''
        if ON_READ_THE_DOCS:
            # PySide not available.
            return

        try:
            arg_1 = 'pyside-rcc'

            # On Windows, pyside-rcc is not automatically available on the
            # PATH so try to find it manually.
            if sys.platform == 'win32':
                import PySide
                arg_1 = os.path.join(
                    os.path.dirname(PySide.__file__),
                    'pyside-rcc.exe'
                )

            subprocess.check_call([
                arg_1,
                '-o',
                arg_0.resource_target_path,
                arg_0.resource_source_path
            ])
        except (subprocess.CalledProcessError, OSError):
            print(
                'Error compiling resource.py using pyside-rcc. Possibly '
                'pyside-rcc could not be found. You might need to manually add '
                'it to your PATH.'
            )
            raise SystemExit()


def Func ( arg_0 ) : import pandas as pd return pd . Series ( arg_0 ) . dt . second . values

def Func(arg_0):
    """Extracts the second out of a datetime samples.

    :returns: an expression containing the second extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.second
    Expression = Func(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0   0
    1  34
    2  22
    """
    import pandas as pd
    return pd.Series(arg_0).dt.second.values

Extracts the second out of a datetime samples.

    :returns: an expression containing the second extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.second
    Expression = dt_second(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0   0
    1  34
    2  22

Extracts the second out of a datetime samples .


return [token[:i] for i in range(min, len(token))]

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = config . MIN_EDGE_NGRAMS arg_0 = arg_0 [ : config . MAX_EDGE_NGRAMS + 1 ] return [ arg_0 [ : arg_2 ] for arg_2 in range ( arg_1 , len ( arg_0 ) ) ]

def Func(arg_0, arg_1=None):
    """Compute edge ngram of token from min. Does not include token itself."""
    if arg_1 is None:
        arg_1 = config.MIN_EDGE_NGRAMS
    arg_0 = arg_0[:config.MAX_EDGE_NGRAMS + 1]
    return [arg_0[:arg_2] for arg_2 in range(arg_1, len(arg_0))]

Compute edge ngram of token from min . Does not include token itself .


def Func ( ) : arg_0 = Environment ( ) arg_1 = parser . parse_args ( arg_1 = [ '/' , '--ignore-stdin' ] , arg_0 = arg_0 ) arg_1 . output_options = 'HB' arg_3 = 'HTTPony/{0}' . format ( __version__ ) def application ( arg_4 , arg_5 ) : if arg_4 . get ( 'CONTENT_LENGTH' ) == '' : del arg_4 [ 'CONTENT_LENGTH' ] if arg_4 . get ( 'CONTENT_TYPE' ) == '' : del arg_4 [ 'CONTENT_TYPE' ] arg_6 = WerkzeugRequest ( arg_4 ) arg_7 = arg_6 . get_data ( ) arg_8 = Request ( method = arg_6 . method , url = arg_6 . url , headers = arg_6 . headers , arg_7 = arg_7 , ) arg_9 = arg_8 . prepare ( ) arg_10 = streams . build_output_stream ( arg_1 , arg_0 , arg_9 , arg_11 = None , arg_2 = arg_1 . output_options ) streams . write_stream ( arg_10 , arg_0 . stdout , arg_0 . stdout_isatty ) if arg_7 : print ( "\n" , file = arg_0 . stdout ) arg_11 = Response ( headers = { 'Server' : arg_3 } ) return arg_11 ( arg_4 , arg_5 ) return application

def Func():
    """Make a WSGI app that has all the HTTPie pieces baked in."""
    arg_0 = Environment()
    # STDIN is ignored because HTTPony runs a server that doesn't care.
    # Additionally, it is needed or else pytest blows up.
    arg_1 = parser.parse_args(arg_1=['/', '--ignore-stdin'], arg_0=arg_0)
    arg_1.output_options = 'HB'  # Output only requests.
    arg_3 = 'HTTPony/{0}'.format(__version__)

    def application(arg_4, arg_5):
        # The WSGI server puts content length and type in the environment
        # even when not provided with the request. Drop them if they are empty.
        if arg_4.get('CONTENT_LENGTH') == '':
            del arg_4['CONTENT_LENGTH']
        if arg_4.get('CONTENT_TYPE') == '':
            del arg_4['CONTENT_TYPE']

        arg_6 = WerkzeugRequest(arg_4)
        arg_7 = arg_6.get_data()
        arg_8 = Request(
            method=arg_6.method,
            url=arg_6.url,
            headers=arg_6.headers,
            arg_7=arg_7,
        )
        arg_9 = arg_8.prepare()

        arg_10 = streams.build_output_stream(
            arg_1, arg_0, arg_9, arg_11=None,
            arg_2=arg_1.output_options)
        streams.write_stream(arg_10, arg_0.stdout, arg_0.stdout_isatty)

        # When there is data in the request, give the next one breathing room.
        if arg_7:
            print("\n", file=arg_0.stdout)

        # Make dreams come true.
        arg_11 = Response(headers={'Server': arg_3})
        return arg_11(arg_4, arg_5)

    return application

Make a WSGI app that has all the HTTPie pieces baked in .


def Func(arg_0, arg_1):
  """Wraps new_fn with the doc of original_fn."""
  arg_2 = tf_inspect.getfullargspec(arg_0)
  arg_3 = tf_inspect.getfullargspec(arg_1)
  if arg_2 != arg_3:
    raise ValueError(
        'Arg specs do not match: original={}, new={}, fn={}'.format(
            arg_2, arg_3, arg_0))
  @decorator.decorator
  def wrap(arg_4, *arg_5, **arg_6):
    del arg_4
    return arg_1(*arg_5, **arg_6)
  return wrap(arg_0)

Wraps new_fn with the doc of original_fn .


return self.request(path, method, call_params)

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

def Func(arg_0, arg_1):
        """REST Conference Play helper
        """
        arg_2 = '/' + arg_0.api_version + '/ConferencePlay/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_2
=
arg_0
.
subsets
[
'All_Samples'
]
else
:
try
:
arg_2
=
arg_0
.
subsets
[
arg_1
]
except
KeyError
:
raise
KeyError
(
(
"Subset '{:s}' does not "
.
format
(
arg_1
)
+
"exist.\nUse 'make_subset' to create a"
+
"subset."
)
)
return
arg_2

def Func(arg_0, arg_1=None):
        """
        Helper function to get sample names from subset.

        Parameters
        ----------
        subset : str
            Subset name. If None, returns all samples.

        Returns
        -------
        List of sample names
        """
        if arg_1 is None:
            arg_2 = arg_0.subsets['All_Samples']
        else:
            try:
                arg_2 = arg_0.subsets[arg_1]
            except KeyError:
                raise KeyError(("Subset '{:s}' does not ".format(arg_1) +
                                "exist.\nUse 'make_subset' to create a" +
                                "subset."))
        return arg_2

Helper function to get sample names from subset .


return (
            self._tibber_control.sub_manager is not None
            and self._tibber_control.sub_manager.is_running
            and self._subscription_id is not None
        )

def Func ( arg_0 ) : return ( arg_0 . _tibber_control . sub_manager is not None and arg_0 . _tibber_control . sub_manager . is_running and arg_0 . _subscription_id is not None )

def Func(arg_0):
        """Is real time subscription running."""
        return (
            arg_0._tibber_control.sub_manager is not None
            and arg_0._tibber_control.sub_manager.is_running
            and arg_0._subscription_id is not None
        )


def Func ( arg_0 ) : for arg_1 in np . uint8 ( [ 82 , 83 , 75 , 87 , 89 , 77 ] ) : arg_2 , arg_3 = np . where ( arg_0 == arg_1 ) arg_4 , arg_5 = AMBIGS [ arg_1 . view ( "S1" ) ] arg_6 = np . random . choice ( [ True , False ] , arg_2 . shape [ 0 ] ) for arg_7 in xrange ( arg_6 . shape [ 0 ] ) : if arg_6 [ arg_7 ] : arg_0 [ arg_2 [ arg_7 ] , arg_3 [ arg_7 ] ] = np . array ( arg_4 ) . view ( np . uint8 ) else : arg_0 [ arg_2 [ arg_7 ] , arg_3 [ arg_7 ] ] = np . array ( arg_5 ) . view ( np . uint8 ) return arg_0

def Func(arg_0):
    """ returns a seq array with 'RSKYWM' randomly replaced with resolved bases"""
    ## iterate over the bases 'RSKWYM': [82, 83, 75, 87, 89, 77]
    for arg_1 in np.uint8([82, 83, 75, 87, 89, 77]):
        ## get all site in this ambig
        arg_2, arg_3 = np.where(arg_0 == arg_1)
        ## get the two resolutions of the ambig
        arg_4, arg_5 = AMBIGS[arg_1.view("S1")]
        ## randomly sample half those sites
        arg_6 = np.random.choice([True, False], arg_2.shape[0])
        ## replace ambig bases with their resolutions
        for arg_7 in xrange(arg_6.shape[0]):
            if arg_6[arg_7]:
                arg_0[arg_2[arg_7], arg_3[arg_7]] = np.array(arg_4).view(np.uint8)
            else:
                arg_0[arg_2[arg_7], arg_3[arg_7]] = np.array(arg_5).view(np.uint8)
    return arg_0

returns a seq array with RSKYWM randomly replaced with resolved bases


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( SRVResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60):
        """
        Creates a SRV record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created SRVResourceRecordSet instance.
        """

        arg_0._halt_if_already_deleted()

        # Grab the params/kwargs here for brevity's sake.
        arg_2 = locals()
        del arg_2['self']

        return arg_0._add_record(SRVResourceRecordSet, **arg_2)

Creates a SRV record attached to this hosted zone .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
[
"sprint"
]
arg_3
=
arg_1
[
"quiet"
]
arg_4
=
arg_1
[
"error"
]
arg_5
=
True
arg_6
=
if
arg_1
[
"no_enhanced_errors"
]
:
arg_5
=
False
if
"shell"
in
arg_1
:
arg_6
=
arg_1
[
"shell"
]
arg_7
=
sys
.
platform
==
"win32"
arg_8
=
arg_9
=
if
arg_3
:
arg_8
=
PIPE
arg_9
=
PIPE
arg_0
=
arg_0
.
rstrip
(
)
arg_2
(
"About to run commands '{}'"
.
format
(
arg_0
)
,
level
=
"verbose"
)
if
not
arg_3
:
arg_2
(
arg_0
)
if
arg_6
:
arg_10
=
shlex
.
split
(
arg_6
)
arg_6
=
arg_10
[
0
]
arg_10
=
arg_10
[
1
:
]
if
arg_5
and
not
arg_7
:
arg_10
.
append
(
"-e"
)
arg_10
.
append
(
arg_0
)
arg_0
=
arg_10
else
:
if
arg_5
and
not
arg_7
:
arg_0
=
[
"-e"
,
arg_0
]
arg_11
=
Popen
(
arg_0
,
shell
=
True
,
stdout
=
arg_8
,
stderr
=
arg_9
,
executable
=
arg_6
)
arg_12
,
arg_13
=
arg_11
.
communicate
(
)
if
arg_11
.
returncode
:
if
arg_3
:
arg_4
(
arg_13
.
decode
(
locale
.
getpreferredencoding
(
)
)
)
arg_4
(
"Command failed to run"
)
sys
.
exit
(
1
)

def Func(arg_0, arg_1):
    """
    Runs the commands supplied as an argument
    It will exit the program if the commands return a
    non-zero code

    Args:
        the commands to run
        The settings dictionary
    """
    arg_2 = arg_1["sprint"]
    arg_3 = arg_1["quiet"]
    arg_4 = arg_1["error"]
    arg_5 = True
    arg_6 = None
    if arg_1["no_enhanced_errors"]:
        arg_5 = False
    if "shell" in arg_1:
        arg_6 = arg_1["shell"]
    arg_7 = sys.platform == "win32"

    arg_8 = None
    arg_9 = None
    if arg_3:
        arg_8 = PIPE
        arg_9 = PIPE

    arg_0 = arg_0.rstrip()
    arg_2("About to run commands '{}'".format(arg_0), level="verbose")
    if not arg_3:
        arg_2(arg_0)

    if arg_6:
        arg_10 = shlex.split(arg_6)
        arg_6 = arg_10[0]
        arg_10 = arg_10[1:]
        if arg_5 and not arg_7:
            arg_10.append("-e")
        arg_10.append(arg_0)
        arg_0 = arg_10
    else:
        if arg_5 and not arg_7:
            arg_0 = ["-e", arg_0]

    arg_11 = Popen(arg_0, shell=True, stdout=arg_8, stderr=arg_9,
              executable=arg_6)
    arg_12, arg_13 = arg_11.communicate()
    if arg_11.returncode:
        if arg_3:
            arg_4(arg_13.decode(locale.getpreferredencoding()))
        arg_4("Command failed to run")
        sys.exit(1)

Runs the commands supplied as an argument It will exit the program if the commands return a non - zero code


def
Func
(
arg_0
)
:
arg_1
,
arg_2
,
arg_3
=
Func_build_or_local
(
arg_0
.
obj
.
Func
(
'project'
)
,
arg_0
.
obj
.
Func
(
'build'
)
)
try
:
arg_4
=
PolyaxonClient
(
)
.
build_job
.
Func_build
(
arg_1
,
arg_2
,
arg_3
)
cache
.
cache
(
config_manager
=
BuildJobManager
,
arg_4
=
arg_4
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func build job `{}`.'
.
format
(
arg_3
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Func_build_details
(
arg_4
)

def Func(arg_0):
    """Get build job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon build -b 1 Func
    ```

    \b
    ```bash
    $ polyaxon build --build=1 --project=project_name Func
    ```
    """
    arg_1, arg_2, arg_3 = Func_build_or_local(arg_0.obj.Func('project'), arg_0.obj.Func('build'))
    try:
        arg_4 = PolyaxonClient().build_job.Func_build(arg_1, arg_2, arg_3)
        cache.cache(config_manager=BuildJobManager, arg_4=arg_4)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func build job `{}`.'.format(arg_3))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Func_build_details(arg_4)

Get build job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon build -b 1 get
    ```

    \b
    ```bash
    $ polyaxon build --build=1 --project=project_name get
    ```


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . getAttribute ( 'name' ) arg_4 = arg_2 . getAttribute ( 'value' ) return arg_3 , arg_4

def Func(arg_0, arg_1, arg_2):
        """
        Reads a "data" or "define" tag from the given node.

        start_node -- the xml node (xml.dom.minidom.Node)
        """
        arg_3 = arg_2.getAttribute('name')
        arg_4 = arg_2.getAttribute('value')
        return arg_3, arg_4

Reads a data or define tag from the given node .


def Func ( arg_0 ) : def _success_date ( ) : arg_1 = { 'date' : arg_0 . new_bookmark or datetime . datetime . utcnow ( ) . strftime ( arg_0 . doc_id_suffix ) } yield dict ( _index = arg_0 . last_index_written , _type = arg_0 . bookmark_doc_type , _source = arg_1 ) if arg_0 . last_index_written : bulk ( arg_0 . client , _success_date ( ) , stats_only = True )

def Func(arg_0):
        """Set bookmark for starting next aggregation."""
        def _success_date():
            arg_1 = {
                'date': arg_0.new_bookmark or datetime.datetime.utcnow().
                strftime(arg_0.doc_id_suffix)
            }

            yield dict(_index=arg_0.last_index_written,
                       _type=arg_0.bookmark_doc_type,
                       _source=arg_1)
        if arg_0.last_index_written:
            bulk(arg_0.client,
                 _success_date(),
                 stats_only=True)

Set bookmark for starting next aggregation .


Create a new institute and add it to the database

(ctx, internal_id, display_name, sanger_recipients)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
obj
[
'adapter'
]
if
not
arg_1
:
logger
.
warning
(
"A Func has to have an internal id"
)
arg_0
.
abort
(
)
if
not
arg_2
:
arg_2
=
arg_1
if
arg_3
:
arg_3
=
list
(
arg_3
)
try
:
load_Func
(
arg_4
=
arg_4
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
except
Exception
as
e
:
logger
.
warning
(
e
)
arg_0
.
abort
(
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Create a new Func and add it to the database

    """
    arg_4 = arg_0.obj['adapter']

    if not arg_1:
        logger.warning("A Func has to have an internal id")
        arg_0.abort()

    if not arg_2:
        arg_2 = arg_1

    if arg_3:
        arg_3 = list(arg_3)

    try:
        load_Func(
            arg_4=arg_4,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3
        )
    except Exception as e:
        logger.warning(e)
        arg_0.abort()


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
db
.
is_patch
(
arg_2
)
:
return
arg_3
=
arg_0
.
db
.
patches_after
(
arg_2
)
for
arg_2
in
arg_3
:
arg_4
=
arg_0
.
quilt_pc
+
File
(
os
.
path
.
join
(
arg_2
.
get_name
(
)
,
arg_1
)
)
if
arg_4
.
exists
(
)
:
raise
QuiltError
(
"File %s is modified by patch %s"
%
(
arg_1
,
arg_2
.
get_name
(
)
)
)

def Func(arg_0, arg_1, arg_2):
        """ Checks if a backup file of the filename in the applied patches after
        patch exists """

        if not arg_0.db.is_patch(arg_2):
            # no patches applied
            return

        arg_3 = arg_0.db.patches_after(arg_2)
        for arg_2 in arg_3:
            arg_4 = arg_0.quilt_pc + File(os.path.join(arg_2.get_name(),
                                                     arg_1))
            if arg_4.exists():
                raise QuiltError("File %s is modified by patch %s" %
                                 (arg_1, arg_2.get_name()))


(
            self, text_content_type, text_content, language=None, autocorrect=False, pii=False, list_id=None, classify=False, custom_headers=None, raw=False, callback=None, **operation_config)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = False , arg_5 = False , arg_6 = None , arg_7 = False , arg_8 = None , arg_9 = False , arg_10 = None , ** arg_11 ) : arg_12 = arg_0 . Func . metadata [ 'url' ] arg_13 = { 'Endpoint' : arg_0 . _serialize . url ( "self.config.endpoint" , arg_0 . config . endpoint , 'str' , skip_quote = True ) } arg_12 = arg_0 . _client . format_url ( arg_12 , ** arg_13 ) arg_14 = { } if arg_3 is not None : arg_14 [ 'language' ] = arg_0 . _serialize . query ( "language" , arg_3 , 'str' ) if arg_4 is not None : arg_14 [ 'autocorrect' ] = arg_0 . _serialize . query ( "autocorrect" , arg_4 , 'bool' ) if arg_5 is not None : arg_14 [ 'PII' ] = arg_0 . _serialize . query ( "pii" , arg_5 , 'bool' ) if arg_6 is not None : arg_14 [ 'listId' ] = arg_0 . _serialize . query ( "list_id" , arg_6 , 'str' ) if arg_7 is not None : arg_14 [ 'classify' ] = arg_0 . _serialize . query ( "classify" , arg_7 , 'bool' ) arg_15 = { } arg_15 [ 'Accept' ] = 'application/json' arg_15 [ 'Content-Type' ] = 'text/plain' if arg_8 : arg_15 . update ( arg_8 ) arg_15 [ 'Content-Type' ] = arg_0 . _serialize . header ( "text_content_type" , arg_1 , 'str' ) arg_16 = arg_0 . _client . stream_upload ( arg_2 , arg_10 ) arg_17 = arg_0 . _client . post ( arg_12 , arg_14 , arg_15 , arg_16 ) arg_18 = arg_0 . _client . send ( arg_17 , stream = False , ** arg_11 ) if arg_18 . status_code not in [ 200 ] : raise models . APIErrorException ( arg_0 . _deserialize , arg_18 ) arg_19 = None if arg_18 . status_code == 200 : arg_19 = arg_0 . _deserialize ( 'Screen' , arg_18 ) if arg_9 : arg_20 = ClientRawResponse ( arg_19 , arg_18 ) return arg_20 return arg_19

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=False, arg_5=False, arg_6=None, arg_7=False, arg_8=None, arg_9=False, arg_10=None, **arg_11):
        """Detect profanity and match against custom and shared blacklists.

        Detects profanity in more than 100 languages and match against custom
        and shared blacklists.

        :param text_content_type: The content type. Possible values include:
         'text/plain', 'text/html', 'text/xml', 'text/markdown'
        :type text_content_type: str
        :param text_content: Content to screen.
        :type text_content: Generator
        :param language: Language of the text.
        :type language: str
        :param autocorrect: Autocorrect text.
        :type autocorrect: bool
        :param pii: Detect personal identifiable information.
        :type pii: bool
        :param list_id: The list Id.
        :type list_id: str
        :param classify: Classify input.
        :type classify: bool
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param callback: When specified, will be called with each chunk of
         data that is streamed. The callback should take two arguments, the
         bytes of the current chunk of data and the response object. If the
         data is uploading, response will be None.
        :type callback: Callable[Bytes, response=None]
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: Screen or ClientRawResponse if raw=true
        :rtype: ~azure.cognitiveservices.vision.contentmoderator.models.Screen
         or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`APIErrorException<azure.cognitiveservices.vision.contentmoderator.models.APIErrorException>`
        """
        # Construct URL
        arg_12 = arg_0.Func.metadata['url']
        arg_13 = {
            'Endpoint': arg_0._serialize.url("self.config.endpoint", arg_0.config.endpoint, 'str', skip_quote=True)
        }
        arg_12 = arg_0._client.format_url(arg_12, **arg_13)

        # Construct parameters
        arg_14 = {}
        if arg_3 is not None:
            arg_14['language'] = arg_0._serialize.query("language", arg_3, 'str')
        if arg_4 is not None:
            arg_14['autocorrect'] = arg_0._serialize.query("autocorrect", arg_4, 'bool')
        if arg_5 is not None:
            arg_14['PII'] = arg_0._serialize.query("pii", arg_5, 'bool')
        if arg_6 is not None:
            arg_14['listId'] = arg_0._serialize.query("list_id", arg_6, 'str')
        if arg_7 is not None:
            arg_14['classify'] = arg_0._serialize.query("classify", arg_7, 'bool')

        # Construct headers
        arg_15 = {}
        arg_15['Accept'] = 'application/json'
        arg_15['Content-Type'] = 'text/plain'
        if arg_8:
            arg_15.update(arg_8)
        arg_15['Content-Type'] = arg_0._serialize.header("text_content_type", arg_1, 'str')

        # Construct body
        arg_16 = arg_0._client.stream_upload(arg_2, arg_10)

        # Construct and send request
        arg_17 = arg_0._client.post(arg_12, arg_14, arg_15, arg_16)
        arg_18 = arg_0._client.send(arg_17, stream=False, **arg_11)

        if arg_18.status_code not in [200]:
            raise models.APIErrorException(arg_0._deserialize, arg_18)

        arg_19 = None

        if arg_18.status_code == 200:
            arg_19 = arg_0._deserialize('Screen', arg_18)

        if arg_9:
            arg_20 = ClientRawResponse(arg_19, arg_18)
            return arg_20

        return arg_19

Detect profanity and match against custom and shared blacklists .


def Func(arg_0, arg_1):
        """Whether a connection can be established between those two meshes."""
        assert arg_1.is_mesh()
        arg_2 = not arg_1.is_connected() and not arg_0.is_connected()
        arg_3 = arg_0._is_consumed_mesh() != arg_1._is_consumed_mesh()
        return arg_2 and arg_3

Whether a connection can be established between those two meshes .


def Func():
    """For OS X versions before Yosemite, many launchd processes run simultaneously under
    different users and different permission models. The simpler `asuser` trick we use
    in Yosemite doesn't work, since it gets routed to the wrong launchd. We instead need
    to find the running ssh-agent process and use its PID to navigate ourselves
    to the correct launchd."""
    for arg_0 in psutil.process_iter():
        if arg_0.name() == 'ssh-agent':
            ssh_auth_sock = subprocess.check_output(['launchctl', 'bsexec', str(arg_0.pid), 'launchctl', 'getenv', 'SSH_AUTH_SOCK']).rstrip()
            if ssh_auth_sock:
                _set_ssh_auth_sock(ssh_auth_sock)
                break
    else:
        daemon_warnings.warn('ssh', 'No running ssh-agent found linked to SSH_AUTH_SOCK')

For OS X versions before Yosemite many launchd processes run simultaneously under different users and different permission models . The simpler asuser trick we use in Yosemite doesn t work since it gets routed to the wrong launchd . We instead need to find the running ssh - agent process and use its PID to navigate ourselves to the correct launchd .


def Func ( arg_0 ) : arg_1 = arg_0 . _w if type ( arg_1 ) is list : return arg_1 [ arg_0 . _random . getUInt32 ( len ( arg_1 ) ) ] else : return arg_1

def Func(arg_0):
    """
    Gets a value of `w` for use in generating a pattern.
    """
    arg_1 = arg_0._w

    if type(arg_1) is list:
      return arg_1[arg_0._random.getUInt32(len(arg_1))]
    else:
      return arg_1

Gets a value of w for use in generating a pattern .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 . get ( 'last_player_shot' ) == arg_3 . frame : return arg_3 [ 'last_player_shot' ] = arg_3 . frame arg_4 , arg_5 = arg_2 [ 'P' ] . position arg_0 . _teleport ( ( arg_4 - 1 , arg_5 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Launches a new bolt from the player."""
    # We don't fire if the player fired another bolt just now.
    if arg_3.get('last_player_shot') == arg_3.frame: return
    arg_3['last_player_shot'] = arg_3.frame
    # We start just above the player.
    arg_4, arg_5 = arg_2['P'].position
    arg_0._teleport((arg_4-1, arg_5))


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
if
arg_4
==
terminal
.
NO_COLORS
:
return
''
,
''
if
arg_4
==
terminal
.
ANSI_8_COLORS
or
arg_4
==
terminal
.
ANSI_16_COLORS
:
arg_5
=
ansi
.
rgb_to_ansi16
(
arg_0
,
arg_1
,
arg_2
)
arg_6
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
arg_5
+
arg_3
ansi
.
FOREGROUND_COLOR_OFFSET
)
arg_7
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
arg_3
+
ansi
.
COLOR_CLOSE_OFFSET
)
return
arg_6
,
arg_7
if
arg_4
==
terminal
.
ANSI_256_COLORS
:
arg_5
=
ansi
.
rgb_to_ansi256
(
arg_0
,
arg_1
,
arg_2
)
arg_6
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
'{base};5;{code}'
.
format
(
base
=
8
+
arg_3
,
code
=
arg_5
)
)
arg_7
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
arg_3
+
ansi
.
COLOR_CLOSE_OFFSET
)
return
arg_6
,
arg_7
if
arg_4
==
terminal
.
TRUE_COLORS
:
arg_6
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
'{base};2;{red};{green};{blue}'
.
format
(
base
=
8
+
arg_3
,
arg_0
=
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)
)
arg_7
=
ansi
.
ANSI_ESCAPE_CODE
.
format
(
code
=
arg_3
+
ansi
.
COLOR_CLOSE_OFFSET
)
return
arg_6
,
arg_7
raise
ColorfulError
(
'invalid color mode "{0}"'
.
format
(
arg_4
)
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
    Translate the given RGB color into the appropriate ANSI escape code
    for the given color mode.
    The offset is used for the base color which is used.

    The ``colormode`` has to be one of:
        * 0: no colors / disabled
        * 8: use ANSI 8 colors
        * 16: use ANSI 16 colors (same as 8 but with brightness)
        * 256: use ANSI 256 colors
        * 0xFFFFFF / 16777215: use 16 Million true colors

    :param int red: the red channel value
    :param int green: the green channel value
    :param int blue: the blue channel value
    :param int offset: the offset to use for the base color
    :param int colormode: the color mode to use. See explanation above
    """
    if arg_4 == terminal.NO_COLORS:  # colors are disabled, thus return empty string
        return '', ''

    if arg_4 == terminal.ANSI_8_COLORS or arg_4 == terminal.ANSI_16_COLORS:
        arg_5 = ansi.rgb_to_ansi16(arg_0, arg_1, arg_2)
        arg_6 = ansi.ANSI_ESCAPE_CODE.format(
            code=arg_5 + arg_3 - ansi.FOREGROUND_COLOR_OFFSET)
        arg_7 = ansi.ANSI_ESCAPE_CODE.format(code=arg_3 + ansi.COLOR_CLOSE_OFFSET)
        return arg_6, arg_7

    if arg_4 == terminal.ANSI_256_COLORS:
        arg_5 = ansi.rgb_to_ansi256(arg_0, arg_1, arg_2)
        arg_6 = ansi.ANSI_ESCAPE_CODE.format(code='{base};5;{code}'.format(
            base=8 + arg_3, code=arg_5))
        arg_7 = ansi.ANSI_ESCAPE_CODE.format(code=arg_3 + ansi.COLOR_CLOSE_OFFSET)
        return arg_6, arg_7

    if arg_4 == terminal.TRUE_COLORS:
        arg_6 = ansi.ANSI_ESCAPE_CODE.format(code='{base};2;{red};{green};{blue}'.format(
            base=8 + arg_3, arg_0=arg_0, arg_1=arg_1, arg_2=arg_2))
        arg_7 = ansi.ANSI_ESCAPE_CODE.format(code=arg_3 + ansi.COLOR_CLOSE_OFFSET)
        return arg_6, arg_7

    raise ColorfulError('invalid color mode "{0}"'.format(arg_4))

Translate the given RGB color into the appropriate ANSI escape code for the given color mode . The offset is used for the base color which is used .


def Func(arg_0, arg_1, arg_2):
        """Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match."""
        # Make sure we are using the previously input bounds, if any
        if arg_0.in_bound_idxs is not None:
            arg_3 = arg_0._preprocess()
            arg_2 = U.synchronize_labels(arg_0.in_bound_idxs, arg_1,
                                              arg_2, arg_3.shape[0])
            arg_1 = arg_0.in_bound_idxs

        # Remove empty segments if needed
        arg_1, arg_2 = U.remove_empty_segments(arg_1, arg_2)

        assert len(arg_1) - 1 == len(arg_2), "Number of boundaries " \
            "(%d) and number of labels(%d) don't match" % (len(arg_1),
                                                           len(arg_2))

        # Make sure the indeces are integers
        arg_1 = np.asarray(arg_1, dtype=int)

        return arg_1, arg_2

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


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 is None : arg_1 = arg_0 . min ( ) if arg_2 is None : arg_2 = arg_0 . max ( ) return arg_1 , arg_2

def Func(arg_0, arg_1, arg_2):
    """Get the minimum and maximum of the normalization of the array, which sets the lower and upper limits of the \
    colormap.

    If norm_min / norm_max are not supplied, the minimum / maximum values of the array of data are used.

    Parameters
    -----------
    array : data.array.scaled_array.ScaledArray
        The 2D array of data which is plotted.
    norm_min : float or None
        The minimum array value the colormap map spans (all values below this value are plotted the same color).
    norm_max : float or None
        The maximum array value the colormap map spans (all values above this value are plotted the same color).
    """
    if arg_1 is None:
        arg_1 = arg_0.min()
    if arg_2 is None:
        arg_2 = arg_0.max()

    return arg_1, arg_2

Get the minimum and maximum of the normalization of the array which sets the lower and upper limits of the \ colormap .


def Func ( arg_0 , Func ) : arg_2 = arg_0 . RUSERS + '/' + Func arg_3 = arg_0 . _fetch ( arg_2 , None ) return arg_3

def Func(arg_0, Func):
        """Fetch user data."""

        arg_2 = arg_0.RUSERS + '/' + Func
        arg_3 = arg_0._fetch(arg_2, None)

        return arg_3


def Func(arg_0, arg_1, arg_2):
        """
        Returns participation data for the given account_id and term_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.department_participation
        """
        arg_3 = ("/api/v1/accounts/sis_account_id:%s/analytics/"
               "terms/sis_term_id:%s/activity.json") % (arg_1, arg_2)
        return arg_0._get_resource(arg_3)

Returns participation data for the given account_id and term_id .


(graph: BELGraph,
                                victim_namespaces: Strings,
                                survivor_namespaces: str,
                                relations: Strings)

def Func(arg_0: arg_1,
                                arg_2: arg_3,
                                arg_4: arg_5,
                                arg_6: arg_3) -> None:
    """Collapse pairs of nodes with the given namespaces that have the given relationship.

    :param graph: A BEL Graph
    :param victim_namespaces: The namespace(s) of the node to collapse
    :param survivor_namespaces: The namespace of the node to keep
    :param relations: The relation(s) to search
    """
    arg_7 = build_relation_predicate(arg_6)
    arg_8 = build_source_namespace_filter(arg_2)
    arg_9 = build_target_namespace_filter(arg_4)

    arg_10 = [
        arg_7,
        arg_8,
        arg_9
    ]

    _collapse_edge_passing_predicates(arg_0, arg_10=arg_10)

Collapse pairs of nodes with the given namespaces that have the given relationship .


def
Func
(
arg_0
)
:
debug
(
'Funcing incomming socket messages'
)
try
:
while
True
:
arg_1
=
arg_0
.
socket
.
recv
(
arg_0
.
buffer_size
)
debug
(
b'< '
+
arg_1
)
except
socket
.
error
:
pass

def Func(arg_0):
        """Flush incomming socket messages."""
        debug('Funcing incomming socket messages')
        try:
            while True:
                arg_1 = arg_0.socket.recv(arg_0.buffer_size)
                debug(b'< ' + arg_1)
        except socket.error:
            pass


def Func(arg_0):
        """parse gene_sets input file type"""

        arg_1 = arg_0.get_libraries()
        if isinstance(arg_0.gene_sets, list):
            arg_2 = arg_0.gene_sets
        elif isinstance(arg_0.gene_sets, str):
            arg_2 = [ arg_4.strip() for arg_4 in arg_0.gene_sets.strip().split(",") ]
        elif isinstance(arg_0.gene_sets, dict):
            arg_2 = [arg_0.gene_sets]
        else:
            raise Exception("Error parsing enrichr libraries, please provided corrected one")

        # gss: a list contain .gmt, dict, enrichr_liraries.
        # now, convert .gmt to dict
        arg_3 = []
        for arg_4 in arg_2:
            if isinstance(arg_4, dict):
                arg_3.append(arg_4)
                continue

            if isinstance(arg_4, str):
                if arg_4 in arg_1:
                    arg_3.append(arg_4)
                    continue
                if arg_4.lower().endswith(".gmt") and os.path.exists(arg_4):
                    arg_0._logger.info("User Defined gene sets is given: %s"%arg_4)
                    with open(arg_4) as genesets:
                        arg_5 = { line.strip().split("\t")[0]: line.strip().split("\t")[2:]
                                        for line in genesets.readlines() }
                    arg_3.append(arg_5)
        return arg_3


return cls(
            version=required_values[cls._KEY_VERSION],
            frequency=int(required_values[cls._KEY_FREQUENCY]),
            timestamp=int(required_values[cls._KEY_TIMESTAMP]),
            seed_value=required_values[cls._KEY_SEED_VALUE],
            previous_output_value=required_values[
                cls._KEY_PREVIOUS_OUTPUT_VALUE
            ],
            signature_value=required_values[cls._KEY_SIGNATURE_VALUE],
            output_value=required_values[cls._KEY_OUTPUT_VALUE],
            status_code=required_values[cls._KEY_STATUS_CODE],
        )

def Func(arg_0, arg_1: arg_2) -> 'NistBeaconValue':
        """
        Convert a string of JSON which represents a NIST randomness beacon
        value into a 'NistBeaconValue' object.

        :param input_json: JSON to build a 'Nist RandomnessBeaconValue' from
        :return: A 'NistBeaconValue' object, 'None' otherwise
        """

        try:
            arg_3 = json.loads(arg_1)
        except ValueError:
            return None

        # Our required values are "must haves". This makes it simple
        # to verify we loaded everything out of JSON correctly.
        arg_4 = {
            arg_0._KEY_FREQUENCY: None,
            arg_0._KEY_OUTPUT_VALUE: None,
            arg_0._KEY_PREVIOUS_OUTPUT_VALUE: None,
            arg_0._KEY_SEED_VALUE: None,
            arg_0._KEY_SIGNATURE_VALUE: None,
            arg_0._KEY_STATUS_CODE: None,
            arg_0._KEY_TIMESTAMP: None,
            arg_0._KEY_VERSION: None,
        }

        for arg_5 in arg_4:
            if arg_5 in arg_3:
                arg_4[arg_5] = arg_3[arg_5]

        # Confirm that the required values are set, and not 'None'
        if None in arg_4.values():
            return None

        # We have all the required values, return a node object
        return arg_0(
            version=arg_4[arg_0._KEY_VERSION],
            frequency=int(arg_4[arg_0._KEY_FREQUENCY]),
            timestamp=int(arg_4[arg_0._KEY_TIMESTAMP]),
            seed_value=arg_4[arg_0._KEY_SEED_VALUE],
            previous_output_value=arg_4[
                arg_0._KEY_PREVIOUS_OUTPUT_VALUE
            ],
            signature_value=arg_4[arg_0._KEY_SIGNATURE_VALUE],
            output_value=arg_4[arg_0._KEY_OUTPUT_VALUE],
            status_code=arg_4[arg_0._KEY_STATUS_CODE],
        )

Convert a string of JSON which represents a NIST randomness beacon value into a NistBeaconValue object .


return format_html(template, static=_static_url, v=version)

def Func(arg_0=None):
    """
    Returns the jQuery ScrollTo plugin file according to version number.
    TEMPLATE_DEBUG returns full file, otherwise returns minified file.
    """
    if arg_0 is None:
        arg_0 = getattr(settings, 'DJFRONTEND_JQUERY_SCROLLTO', DJFRONTEND_JQUERY_SCROLLTO_DEFAULT)

    if getattr(settings, 'TEMPLATE_DEBUG', False):
        arg_1 = '<script src="{static}djfrontend/js/jquery/jquery.scrollTo/{v}/jquery.scrollTo.js"></script>'
    else:
        arg_1 = (
            '<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/{v}/jquery.scrollTo.min.js"></script>'
            '<script>window.jQuery.fn.scrollTo || document.write(\'<script src="{static}djfrontend/js/jquery/jquery.scrollTo/{v}/jquery.scrollTo.min.js"><\/script>\')</script>')
    return format_html(arg_1, static=_static_url, v=arg_0)

Returns the jQuery ScrollTo plugin file according to version number . TEMPLATE_DEBUG returns full file otherwise returns minified file .


def Func ( arg_0 ) : arg_1 = partial ( is_valid_in_template , arg_0 ) return list ( filter ( arg_1 , dir ( arg_0 ) ) )

def Func(arg_0):
    """
    Given a varaible, return the list of attributes that are available inside
    of a template
    """
    arg_1 = partial(is_valid_in_template, arg_0)
    return list(filter(arg_1, dir(arg_0)))

Given a varaible return the list of attributes that are available inside of a template


Creates a new layer from file, Layer, PIL Image.

        If img is an image file or PIL Image object,
        Creates a new layer with the given image file.
        The image is positioned on the canvas at x, y.

        If img is a Layer,
        uses that layer's x and y position and name.

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = 0 , arg_4 = "" ) : from types import StringType if isinstance ( arg_1 , Image . Image ) : arg_1 = arg_1 . convert ( "RGBA" ) arg_0 . Funcs . append ( Layer ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) ) return len ( arg_0 . Funcs ) - 1 if isinstance ( arg_1 , Layer ) : arg_1 . canvas = arg_0 arg_0 . Funcs . append ( arg_1 ) return len ( arg_0 . Funcs ) - 1 if type ( arg_1 ) == StringType : arg_1 = Image . open ( arg_1 ) arg_1 = arg_1 . convert ( "RGBA" ) arg_0 . Funcs . append ( Layer ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) ) return len ( arg_0 . Funcs ) - 1

def Func(arg_0, arg_1, arg_2=0, arg_3=0, arg_4=""):

        """Creates a new Func from file, Layer, PIL Image.

        If img is an image file or PIL Image object,
        Creates a new Func with the given image file.
        The image is positioned on the canvas at x, y.

        If img is a Layer,
        uses that Func's x and y position and name.

        """

        from types import StringType
        if isinstance(arg_1, Image.Image):
            arg_1 = arg_1.convert("RGBA")
            arg_0.Funcs.append(Layer(arg_0, arg_1, arg_2, arg_3, arg_4))
            return len(arg_0.Funcs)-1
        if isinstance(arg_1, Layer):
            arg_1.canvas = arg_0
            arg_0.Funcs.append(arg_1)
            return len(arg_0.Funcs)-1
        if type(arg_1) == StringType:
            arg_1 = Image.open(arg_1)
            arg_1 = arg_1.convert("RGBA")
            arg_0.Funcs.append(Layer(arg_0, arg_1, arg_2, arg_3, arg_4))
            return len(arg_0.Funcs)-1

Creates a new layer from file Layer PIL Image . If img is an image file or PIL Image object Creates a new layer with the given image file . The image is positioned on the canvas at x y . If img is a Layer uses that layer s x and y position and name .


def Func(arg_0, arg_1):
        """
        Returns a count of effective members for the group identified by the
        passed group ID.
        """
        arg_0._valid_group_id(arg_1)

        arg_2 = "{}/group/{}/effective_member?view=count".format(arg_0.API,
                                                               arg_1)

        arg_3 = arg_0._get_resource(arg_2)

        arg_4 = arg_3.get("data").get("count")
        return int(arg_4)

Returns a count of effective members for the group identified by the passed group ID .


def Func ( arg_0 ) : def translate_result ( arg_1 ) : arg_2 = copy . copy ( arg_1 ) arg_3 = arg_2 . pop ( "_source" ) arg_2 . update ( { "data" : arg_3 , "score" : arg_2 [ "_score" ] } ) return arg_2 def translate_facet ( arg_1 ) : arg_4 = { term [ "term" ] : term [ "count" ] for term in arg_1 [ "terms" ] } return { "terms" : arg_4 , "total" : arg_1 [ "total" ] , "other" : arg_1 [ "other" ] , } arg_5 = [ translate_result ( hit ) for hit in arg_0 [ "hits" ] [ "hits" ] ] arg_6 = { "took" : arg_0 [ "took" ] , "total" : arg_0 [ "hits" ] [ "total" ] , "max_score" : arg_0 [ "hits" ] [ "max_score" ] , "results" : arg_5 , } if "facets" in arg_0 : arg_6 [ "facets" ] = { facet : translate_facet ( arg_0 [ "facets" ] [ facet ] ) for facet in arg_0 [ "facets" ] } return arg_6

def Func(arg_0):
    """ Provide resultset in our desired format from elasticsearch results """

    def translate_result(arg_1):
        """ Any conversion from ES result syntax into our search engine syntax """
        arg_2 = copy.copy(arg_1)
        arg_3 = arg_2.pop("_source")

        arg_2.update({
            "data": arg_3,
            "score": arg_2["_score"]
        })

        return arg_2

    def translate_facet(arg_1):
        """ Any conversion from ES facet syntax into our search engine sytax """
        arg_4 = {term["term"]: term["count"] for term in arg_1["terms"]}
        return {
            "terms": arg_4,
            "total": arg_1["total"],
            "other": arg_1["other"],
        }

    arg_5 = [translate_result(hit) for hit in arg_0["hits"]["hits"]]
    arg_6 = {
        "took": arg_0["took"],
        "total": arg_0["hits"]["total"],
        "max_score": arg_0["hits"]["max_score"],
        "results": arg_5,
    }

    if "facets" in arg_0:
        arg_6["facets"] = {facet: translate_facet(arg_0["facets"][facet]) for facet in arg_0["facets"]}

    return arg_6


(self, names=None, stores=None, workspaces=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_2 = arg_0 . get_stores ( arg_1 = arg_2 , arg_3 = arg_3 ) arg_4 = [ ] for arg_5 in arg_2 : try : arg_4 . extend ( arg_5 . Func ( ) ) except FailedRequestError : continue if arg_1 is None : arg_1 = [ ] elif isinstance ( arg_1 , basestring ) : arg_1 = [ arg_5 . strip ( ) for arg_5 in arg_1 . split ( ',' ) if arg_5 . strip ( ) ] if arg_4 and arg_1 : return ( [ arg_6 for arg_6 in arg_4 if arg_6 . name in arg_1 ] ) return arg_4

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''
        Resources include feature stores, coverage stores and WMS stores, however does not include layer groups.
        names, stores and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering.
        Will always return an array.
        '''

        arg_2 = arg_0.get_stores(
            arg_1 = arg_2,
            arg_3 = arg_3
        )

        arg_4 = []
        for arg_5 in arg_2:
            try:
                arg_4.extend(arg_5.Func())
            except FailedRequestError:
                continue

        if arg_1 is None:
            arg_1 = []
        elif isinstance(arg_1, basestring):
            arg_1 = [arg_5.strip() for arg_5 in arg_1.split(',') if arg_5.strip()]

        if arg_4 and arg_1:
            return ([arg_6 for arg_6 in arg_4 if arg_6.name in arg_1])

        return arg_4

Resources include feature stores coverage stores and WMS stores however does not include layer groups . names stores and workspaces can be provided as a comma delimited strings or as arrays and are used for filtering . Will always return an array .


Logs into the specified ftp server and returns connector.

def Func(arg_0):
        """Logs into the specified ftp server and returns Funcor."""
        for arg_1 in range(CFG_FTP_CONNECTION_ATTEMPTS):
            try:
                arg_0.ftp = FtpHandler(arg_0.config.OXFORD.URL,
                                      arg_0.config.OXFORD.LOGIN,
                                      arg_0.config.OXFORD.PASSWORD)
                arg_0.logger.debug(("Successful Funcion to the "
                                   "Oxford University Press server"))
                return
            except socket_timeout_exception as err:
                arg_0.logger.error(('Failed to Func %d of %d times. '
                                   'Will sleep for %d seconds and try again.')
                                  % (arg_1+1,
                                     CFG_FTP_CONNECTION_ATTEMPTS,
                                     CFG_FTP_TIMEOUT_SLEEP_DURATION))
                time.sleep(CFG_FTP_TIMEOUT_SLEEP_DURATION)
            except Exception as err:
                arg_0.logger.error(('Failed to Func to the Oxford '
                                   'University Press server. %s') % (err,))
                break

        raise LoginException(err)

Logs into the specified ftp server and returns connector .


return \
       [(_wrapper(f), l) for (f, l) in \
       _XFORMER.PARSER.parseString(sig, parseAll=True)]

def Func ( arg_0 ) : return [ ( _wrapper ( arg_1 ) , arg_2 ) for ( arg_1 , arg_2 ) in _XFORMER . PARSER . parseString ( arg_0 , parseAll = True ) ]

def Func(arg_0):
    """
    Get the list of xformer functions for the given signature.

    :param str sig: a signature
    :returns: a list of xformer functions for the given signature.
    :rtype: list of tuple of a function * str

    Each function catches all TypeErrors it encounters and raises
    corresponding IntoDPValueError exceptions.
    """
    return \
       [(_wrapper(arg_1), arg_2) for (arg_1, arg_2) in \
       _XFORMER.PARSER.parseString(arg_0, parseAll=True)]

Get the list of xformer functions for the given signature .