def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
def
is_space
(
arg_3
)
:
return
all
(
[
True
if
arg_4
==
' '
else
False
for
arg_4
in
arg_3
]
)
def
is_empty
(
arg_5
,
arg_6
)
:
arg_7
=
[
]
for
arg_3
in
arg_5
:
if
arg_3
in
arg_6
:
arg_7
.
append
(
True
)
elif
is_space
(
arg_3
)
:
arg_7
.
append
(
True
)
else
:
arg_7
.
append
(
False
)
return
all
(
arg_7
)
arg_8
=
arg_2
arg_7
=
''
arg_6
=
arg_0
.
markup
.
get_markup_vars
(
)
for
arg_9
,
arg_3
in
enumerate
(
arg_1
)
:
if
arg_3
in
arg_6
:
arg_7
+=
arg_3
else
:
if
arg_8
>
0
:
if
len
(
arg_3
)
<=
arg_8
:
arg_7
+=
arg_3
arg_8
-=
len
(
arg_3
)
else
:
arg_10
=
(
arg_3
[
arg_8
:
]
,
)
+
arg_1
[
arg_9
+
1
:
]
arg_11
=
not
is_empty
(
arg_10
,
arg_6
)
if
arg_11
:
arg_7
+=
arg_3
[
:
arg_8
1
]
+
arg_0
.
markup
.
RESET
+
u'\u2026'
else
:
arg_7
+=
arg_3
[
:
arg_8
]
arg_8
=
0
return
arg_7

def Func(arg_0, arg_1, arg_2):
        '''  Cut tuple of line chunks according to it's wisible lenght  '''
        def is_space(arg_3):
            return all([True if arg_4 == ' ' else False for arg_4 in arg_3])

        def is_empty(arg_5, arg_6):
            arg_7 = []
            for arg_3 in arg_5:
                if arg_3 in arg_6:
                    arg_7.append(True)
                elif is_space(arg_3):
                    arg_7.append(True)
                else:
                    arg_7.append(False)
            return all(arg_7)
        arg_8 = arg_2
        arg_7 = ''
        arg_6 = arg_0.markup.get_markup_vars()
        for arg_9, arg_3 in enumerate(arg_1):
            if arg_3 in arg_6:
                arg_7 += arg_3
            else:
                if arg_8 > 0:
                    if len(arg_3) <= arg_8:
                        arg_7 += arg_3
                        arg_8 -= len(arg_3)
                    else:
                        arg_10 = (arg_3[arg_8:],) + arg_1[arg_9 + 1:]
                        arg_11 = not is_empty(arg_10, arg_6)
                        if arg_11:
                            arg_7 += arg_3[:arg_8 - 1] + arg_0.markup.RESET + u'\u2026'
                        else:
                            arg_7 += arg_3[:arg_8]
                        arg_8 = 0
        return arg_7

Cut tuple of line chunks according to it s wisible lenght


def Func ( * arg_0 ) : def outer_decorator ( arg_1 ) : @ Slot ( * arg_0 ) @ functools . wraps ( arg_1 ) def wrapper ( * arg_0 , ** arg_2 ) : asyncio . ensure_future ( arg_1 ( * arg_0 , ** arg_2 ) ) return wrapper return outer_decorator

def Func(*arg_0):
    """Make a Qt async slot run on asyncio loop."""
    def outer_decorator(arg_1):
        @Slot(*arg_0)
        @functools.wraps(arg_1)
        def wrapper(*arg_0, **arg_2):
            asyncio.ensure_future(arg_1(*arg_0, **arg_2))
        return wrapper
    return outer_decorator

Make a Qt async slot run on asyncio loop .


def
Func
(
arg_0
,
arg_1
=
)
:
for
arg_2
in
_collect_refs
(
arg_0
,
arg_1
)
:
arg_3
=
arg_2
[
'value'
]
.
_update_backref
(
arg_2
[
'field_instance'
]
.
_backref_field_name
,
arg_0
,
arg_2
[
'field_name'
]
,
)
if
arg_3
:
logging
.
debug
(
'Updated reference {}:{}:{}:{}:{}'
.
format
(
arg_0
.
_name
,
arg_0
.
_primary_key
,
arg_2
[
'field_name'
]
,
arg_2
[
'value'
]
.
_name
,
arg_2
[
'value'
]
.
_primary_key
,
)
)

def Func(arg_0, arg_1=None):
    """Ensure that all forward references on the provided object have the
    appropriate backreferences.

    :param StoredObject obj: Database record
    :param list fields: Optional list of field names to check

    """
    for arg_2 in _collect_refs(arg_0, arg_1):
        arg_3 = arg_2['value']._update_backref(
            arg_2['field_instance']._backref_field_name,
            arg_0,
            arg_2['field_name'],
        )
        if arg_3:
            logging.debug('Updated reference {}:{}:{}:{}:{}'.format(
                arg_0._name, arg_0._primary_key, arg_2['field_name'],
                arg_2['value']._name, arg_2['value']._primary_key,
            ))

Ensure that all forward references on the provided object have the appropriate backreferences .


(self, output_dir, error_dir, job_names)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        The method that actually runs qsub to invoke the python
        process with the necessary commands to trigger the next
        collation step and next block of jobs.
        """

        arg_4 = "%s_%s_collate_%d" % (arg_0.batch_name,
                                         arg_0.job_timestamp,
                                         arg_0.collate_count)

        arg_5 = [("-e",arg_2), ('-N',arg_4), ("-o",arg_1),
                     ('-hold_jid',','.join(arg_3))]

        arg_6 =["import os, pickle, lancet",
                      ("pickle_path = os.path.join(%r, 'qlauncher.pkl')"
                       % arg_0.root_directory),
                      "launcher = pickle.load(open(pickle_path,'rb'))",
                      "launcher.collate_and_launch()"]

        arg_7 = [arg_0.command.executable,
                    '-c', ';'.join(arg_6)]
        arg_8 = arg_0._qsub_args(arg_5, arg_7)

        arg_9 = subprocess.Popen(arg_8, arg_10=subprocess.PIPE)
        (arg_10, arg_11) = arg_9.communicate()

        arg_0.debug(arg_10)
        if arg_9.poll() != 0:
            raise EnvironmentError("qsub command exit with code: %d" % arg_9.poll())

        arg_0.collate_count += 1
        arg_0.message("Invoked qsub for next batch.")
        return arg_4

The method that actually runs qsub to invoke the python process with the necessary commands to trigger the next collation step and next block of jobs .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 in enumerate ( arg_0 . dtypes ) : if arg_3 == 'object' or is_category ( arg_3 ) : arg_1 . append ( arg_0 . columns . values [ arg_2 ] ) return arg_1

def Func(arg_0):
    """
    Returns names of 'object' columns in the DataFrame.
    """
    arg_1 = []
    for arg_2, arg_3 in enumerate(arg_0.dtypes):
        if arg_3 == 'object' or is_category(arg_3):
            arg_1.append(arg_0.columns.values[arg_2])

    return arg_1

Returns names of object columns in the DataFrame .


def Func(arg_0, arg_1):
        """ instantiate criterion from config string """
        arg_2 = arg_1.split("(")
        arg_3 = arg_2[0].strip().lower()
        arg_2[1] = arg_2[1].split(")")[0].strip()

        for arg_4 in arg_0.custom_criterions:
            if arg_4.get_type_string() == arg_3:
                return arg_4(arg_0, arg_2[1])
        raise ValueError(
            "Unsupported autostop criterion type: %s" % arg_1)


def Func ( arg_0 , arg_1 ) : arg_1 = str ( arg_1 ) if arg_1 in arg_0 . known_types : return True return False

def Func(arg_0, arg_1):
        """Check if type is known to the type system.

        Returns:
            bool: True if the type is a known instantiated simple type, False otherwise
        """

        arg_1 = str(arg_1)
        if arg_1 in arg_0.known_types:
            return True

        return False

Check if type is known to the type system .


def Func ( arg_0 , arg_1 ) : arg_2 = { } try : if arg_0 . parser . has_section ( arg_1 ) : arg_3 = arg_0 . parser . options ( arg_1 ) for arg_4 in arg_3 : arg_5 = arg_0 . parser . get ( arg_1 , arg_4 ) arg_6 = ast . literal_eval ( arg_5 ) arg_2 [ arg_4 ] = arg_6 return arg_2 except : raise

def Func(arg_0, arg_1):
        """Collects all settings within a section"""
        arg_2 = {}
        try:
            if arg_0.parser.has_section(arg_1):
                arg_3 = arg_0.parser.options(arg_1)
                for arg_4 in arg_3:
                    arg_5 = arg_0.parser.get(arg_1, arg_4)
                    arg_6 = ast.literal_eval(arg_5)
                    arg_2[arg_4] = arg_6
            return arg_2
        except:
            raise


returns a seq with complement. Preserves little n's for splitters.

return seq.replace("A", 't')\
              .replace('T', 'a')\
              .replace('C', 'g')\
              .replace('G', 'c')\
              .replace('n', 'Z')\
              .upper()\
              .replace("Z", "n")

def Func ( arg_0 ) : return arg_0 . replace ( "A" , 't' ) . replace ( 'T' , 'a' ) . replace ( 'C' , 'g' ) . replace ( 'G' , 'c' ) . replace ( 'n' , 'Z' ) . upper ( ) . replace ( "Z" , "n" )

def Func(arg_0):
    """ returns a seq with Funclement. Preserves little n's for splitters."""
    ## makes base to its small Funclement then makes upper
    return arg_0.replace("A", 't')\
              .replace('T', 'a')\
              .replace('C', 'g')\
              .replace('G', 'c')\
              .replace('n', 'Z')\
              .upper()\
              .replace("Z", "n")

returns a seq with complement . Preserves little n s for splitters .


def Func ( ) : arg_0 = os . path . join ( os . path . dirname ( __file__ ) , '../..' ) for arg_1 , arg_2 in _DEFAULT_SCHEMA_PATHS . items ( ) : _load_schema ( os . path . join ( arg_0 , arg_2 ) , arg_1 ) _get_validator ( arg_1 )

def Func():
    """Load all default schemas into `_SCHEMAS`."""
    arg_0 = os.path.join(os.path.dirname(__file__), '../..')
    for arg_1, arg_2 in _DEFAULT_SCHEMA_PATHS.items():
        _load_schema(os.path.join(arg_0, arg_2), arg_1)
        _get_validator(arg_1)

Load all default schemas into _SCHEMAS .


def Func ( arg_0 ) : arg_1 = generate_drop_id ( ) arg_2 , arg_3 = splitext ( arg_0 ) if arg_3 : return '%s%s' % ( arg_1 , arg_3 ) else : return arg_1

def Func(arg_0):
    """preserve the file ending, but replace the name with a random token """
    # TODO: fix broken splitext (it reveals everything of the filename after the first `.` - doh!)
    arg_1 = generate_drop_id()
    arg_2, arg_3 = splitext(arg_0)
    if arg_3:
        return '%s%s' % (arg_1, arg_3)
    else:
        return arg_1

preserve the file ending but replace the name with a random token


def Func ( arg_0 , arg_1 ) : arg_0 . get_conn ( ) . transferOperations ( ) . pause ( name = arg_1 ) . execute ( num_retries = arg_0 . num_retries )

def Func(arg_0, arg_1):
        """
        Pauses an transfer operation in Google Storage Transfer Service.

        :param operation_name: (Required) Name of the transfer operation.
        :type operation_name: str
        :rtype: None
        """
        arg_0.get_conn().transferOperations().pause(name=arg_1).execute(num_retries=arg_0.num_retries)

Pauses an transfer operation in Google Storage Transfer Service .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in _Func_parts ( arg_0 . lower ( ) ) : if arg_2 . startswith ( '*' ) : while arg_1 and arg_1 [ - 1 ] == '00000000' : arg_1 . pop ( ) arg_1 . append ( arg_2 ) return tuple ( arg_1 )

def Func(arg_0):
    """Convert a version string to a chronologically-sortable key

    This is a rough cross between distutils' StrictVersion and LooseVersion;
    if you give it versions that would work with StrictVersion, then it behaves
    the same; otherwise it acts like a slightly-smarter LooseVersion. It is
    *possible* to create pathological version coding schemes that will fool
    this parser, but they should be very rare in practice.

    The returned value will be a tuple of strings.  Numeric portions of the
    version are padded to 8 digits so they will compare numerically, but
    without relying on how numbers compare relative to strings.  Dots are
    dropped, but dashes are retained.  Trailing zeros between alpha segments
    or dashes are suppressed, so that e.g. "2.4.0" is considered the same as
    "2.4". Alphanumeric parts are lower-cased.

    The algorithm assumes that strings like "-" and any alpha string that
    alphabetically follows "final"  represents a "patch level".  So, "2.4-1"
    is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is
    considered newer than "2.4-1", which in turn is newer than "2.4".

    Strings like "a", "b", "c", "alpha", "beta", "candidate" and so on (that
    come before "final" alphabetically) are assumed to be pre-release versions,
    so that the version "2.4" is considered newer than "2.4a1".

    Finally, to handle miscellaneous cases, the strings "pre", "preview", and
    "rc" are treated as if they were "c", i.e. as though they were release
    candidates, and therefore are not as new as a version string that does not
    contain them, and "dev" is replaced with an '@' so that it sorts lower than
    than any other pre-release tag.
    """
    arg_1 = []
    for arg_2 in _Func_parts(arg_0.lower()):
        if arg_2.startswith('*'):
            # remove trailing zeros from each series of numeric parts
            while arg_1 and arg_1[-1]=='00000000':
                arg_1.pop()
        arg_1.append(arg_2)
    return tuple(arg_1)

Convert a version string to a chronologically - sortable key


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
status_code
if
arg_2
==
200
and
arg_1
:
if
arg_1
.
startswith
(
"~"
)
:
arg_1
=
os
.
path
.
expanduser
(
arg_1
)
if
os
.
path
.
isdir
(
arg_1
)
or
arg_1
.
endswith
(
os
.
path
.
sep
)
:
arg_3
=
os
.
path
.
abspath
(
arg_1
)
arg_4
=
H2OConnection
.
_find_file_name
(
arg_0
)
else
:
arg_3
,
arg_4
=
os
.
path
.
split
(
os
.
path
.
abspath
(
arg_1
)
)
arg_5
=
os
.
path
.
join
(
arg_3
,
arg_4
)
try
:
if
not
os
.
path
.
exists
(
arg_3
)
:
os
.
makedirs
(
arg_3
)
with
open
(
arg_5
,
"wb"
)
as
f
:
for
arg_6
in
arg_0
.
iter_content
(
chunk_size
=
65536
)
:
if
arg_6
:
f
.
write
(
arg_6
)
except
OSError
as
e
:
raise
H2OValueError
(
"Cannot write to file %s: %s"
%
(
arg_5
,
e
)
)
return
arg_5
arg_7
=
arg_0
.
headers
.
get
(
"Content-Type"
,
""
)
if
";"
in
arg_7
:
arg_7
=
arg_7
[
:
arg_7
.
index
(
";"
)
]
if
arg_7
==
"application/json"
:
try
:
arg_8
=
arg_0
.
json
(
object_pairs_hook
=
H2OResponse
)
except
(
JSONDecodeError
,
requests
.
exceptions
.
ContentDecodingError
)
as
e
:
raise
H2OServerError
(
"Malformed JSON from server (%s):\n%s"
%
(
str
(
e
)
,
arg_0
.
text
)
)
else
:
arg_8
=
arg_0
.
text
if
arg_2
in
{
200
,
201
,
202
,
204
}
:
return
arg_8
if
arg_2
in
{
400
,
404
,
412
}
and
isinstance
(
arg_8
,
(
H2OErrorV3
,
H2OModelBuilderErrorV3
)
)
:
raise
H2OResponseError
(
arg_8
)
raise
H2OServerError
(
"HTTP %d %s:\n%r"
%
(
arg_2
,
arg_0
.
reason
,
arg_8
)
)

def Func(arg_0, arg_1):
        """
        Given a response object, prepare it to be handed over to the external caller.

        Preparation steps include:
           * detect if the response has error status, and convert it to an appropriate exception;
           * detect Content-Type, and based on that either parse the response as JSON or return as plain text.
        """
        arg_2 = arg_0.status_code
        if arg_2 == 200 and arg_1:
            if arg_1.startswith("~"): arg_1 = os.path.expanduser(arg_1)
            if os.path.isdir(arg_1) or arg_1.endswith(os.path.sep):
                arg_3 = os.path.abspath(arg_1)
                arg_4 = H2OConnection._find_file_name(arg_0)
            else:
                arg_3, arg_4 = os.path.split(os.path.abspath(arg_1))
            arg_5 = os.path.join(arg_3, arg_4)
            try:
                if not os.path.exists(arg_3):
                    os.makedirs(arg_3)
                with open(arg_5, "wb") as f:
                    for arg_6 in arg_0.iter_content(chunk_size=65536):
                        if arg_6:  # Empty chunks may occasionally happen
                            f.write(arg_6)
            except OSError as e:
                raise H2OValueError("Cannot write to file %s: %s" % (arg_5, e))
            return arg_5

        arg_7 = arg_0.headers.get("Content-Type", "")
        if ";" in arg_7:  # Remove a ";charset=..." part
            arg_7 = arg_7[:arg_7.index(";")]

        # Auto-detect response type by its content-type. Decode JSON, all other responses pass as-is.
        if arg_7 == "application/json":
            try:
                arg_8 = arg_0.json(object_pairs_hook=H2OResponse)
            except (JSONDecodeError, requests.exceptions.ContentDecodingError) as e:
                raise H2OServerError("Malformed JSON from server (%s):\n%s" % (str(e), arg_0.text))
        else:
            arg_8 = arg_0.text

        # Success (200 = "Ok", 201 = "Created", 202 = "Accepted", 204 = "No Content")
        if arg_2 in {200, 201, 202, 204}:
            return arg_8

        # Client errors (400 = "Bad Request", 404 = "Not Found", 412 = "Precondition Failed")
        if arg_2 in {400, 404, 412} and isinstance(arg_8, (H2OErrorV3, H2OModelBuilderErrorV3)):
            raise H2OResponseError(arg_8)

        # Server errors (notably 500 = "Server Error")
        # Note that it is possible to receive valid H2OErrorV3 object in this case, however it merely means the server
        # did not provide the correct status code.
        raise H2OServerError("HTTP %d %s:\n%r" % (arg_2, arg_0.reason, arg_8))

Given a response object prepare it to be handed over to the external caller .


return self._mc_client._delete(url=self._build_path(list_id, 'members', subscriber_hash))

def Func(arg_0, arg_1, arg_2):
        """
        Delete a member from a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        arg_2 = check_subscriber_hash(arg_2)
        arg_0.list_id = arg_1
        arg_0.subscriber_hash = arg_2
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1, 'members', arg_2))


def Func ( arg_0 ) : with arg_0 . synclock : if arg_0 . syncthread is not None : arg_0 . syncthread . cancel ( ) arg_0 . syncthread = None

def Func(arg_0):
        """Stops the background synchronization thread"""
        with arg_0.synclock:
            if arg_0.syncthread is not None:
                arg_0.syncthread.cancel()
                arg_0.syncthread = None


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( 'channel' , 'general' ) arg_0 . sendMessage ( arg_0 . make_message ( arg_1 [ 'text' ] , arg_2 ) )

def Func(arg_0, arg_1):
        """
        Send message to Slack
        """
        arg_2 = arg_1.get('channel', 'general')
        arg_0.sendMessage(arg_0.make_message(arg_1['text'], arg_2))


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

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

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


def Func ( arg_0 , arg_1 , arg_2 = None ) : from shoebot import data for arg_3 in dir ( data ) : arg_1 [ arg_3 ] = getattr ( data , arg_3 ) for arg_3 in dir ( arg_0 ) : if arg_3 [ 0 ] != '_' : arg_1 [ arg_3 ] = getattr ( arg_0 , arg_3 ) arg_1 [ '_ctx' ] = arg_0 arg_1 [ '__file__' ] = arg_2

def Func(arg_0, arg_1, arg_2=None):
        """
        Initialise bot namespace with info in shoebot.data

        :param filename: Will be set to __file__ in the namespace
        """
        from shoebot import data
        for arg_3 in dir(data):
            arg_1[arg_3] = getattr(data, arg_3)

        for arg_3 in dir(arg_0):
            if arg_3[0] != '_':
                arg_1[arg_3] = getattr(arg_0, arg_3)

        arg_1['_ctx'] = arg_0  # Used in older nodebox scripts.
        arg_1['__file__'] = arg_2

Initialise bot namespace with info in shoebot . data


return np.linalg.norm(s1sq.dot(s2sq), ord='nuc') ** 2

def Func ( arg_0 , arg_1 ) : arg_2 = np . array ( arg_0 ) arg_3 = np . array ( arg_1 ) if arg_2 . ndim == 1 and arg_3 . ndim == 1 : return np . abs ( arg_3 . conj ( ) . dot ( arg_2 ) ) ** 2 elif arg_2 . ndim == 1 : return np . abs ( arg_2 . conj ( ) . dot ( arg_3 ) . dot ( arg_2 ) ) elif arg_3 . ndim == 1 : return np . abs ( arg_3 . conj ( ) . dot ( arg_2 ) . dot ( arg_3 ) ) arg_4 = _funm_svd ( arg_2 , np . sqrt ) arg_5 = _funm_svd ( arg_3 , np . sqrt ) return np . linalg . norm ( arg_4 . dot ( arg_5 ) , ord = 'nuc' ) ** 2

def Func(arg_0, arg_1):
    """Return the state fidelity between two quantum states.

    Either input may be a state vector, or a density matrix. The state
    fidelity (F) for two density matrices is defined as::

        F(rho1, rho2) = Tr[sqrt(sqrt(rho1).rho2.sqrt(rho1))] ^ 2

    For a pure state and mixed state the fidelity is given by::

        F(|psi1>, rho2) = <psi1|rho2|psi1>

    For two pure states the fidelity is given by::

        F(|psi1>, |psi2>) = |<psi1|psi2>|^2

    Args:
        state1 (array_like): a quantum state vector or density matrix.
        state2 (array_like): a quantum state vector or density matrix.

    Returns:
        array_like: The state fidelity F(state1, state2).
    """
    # convert input to numpy arrays
    arg_2 = np.array(arg_0)
    arg_3 = np.array(arg_1)

    # fidelity of two state vectors
    if arg_2.ndim == 1 and arg_3.ndim == 1:
        return np.abs(arg_3.conj().dot(arg_2)) ** 2
    # fidelity of vector and density matrix
    elif arg_2.ndim == 1:
        # psi = s1, rho = s2
        return np.abs(arg_2.conj().dot(arg_3).dot(arg_2))
    elif arg_3.ndim == 1:
        # psi = s2, rho = s1
        return np.abs(arg_3.conj().dot(arg_2).dot(arg_3))
    # fidelity of two density matrices
    arg_4 = _funm_svd(arg_2, np.sqrt)
    arg_5 = _funm_svd(arg_3, np.sqrt)
    return np.linalg.norm(arg_4.dot(arg_5), ord='nuc') ** 2

Return the state fidelity between two quantum states .


Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the trending method. Note that this will return
    a generator

(limit=DEFAULT_SEARCH_LIMIT, api_key=GIPHY_PUBLIC_KEY,
             strict=False, rating=None)

return Giphy(api_key=api_key, strict=strict).trending(
        limit=limit, rating=rating)

def Func(arg_0=arg_1, arg_2=arg_3,
             arg_4=False, arg_5=None):
    """
    Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the Func method. Note that this will return
    a generator
    """
    return Giphy(arg_2=arg_2, arg_4=arg_4).Func(
        arg_0=arg_0, arg_5=arg_5)

Shorthand for creating a Giphy api wrapper with the given api key and then calling the trending method . Note that this will return a generator


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
False
if
not
os
.
path
.
isdir
(
arg_0
)
:
raise
Exception
(
"%s is not a directory"
%
arg_0
)
if
os
.
path
.
exists
(
arg_1
)
:
raise
Exception
(
"%s: junction link name already exists"
%
arg_1
)
arg_1
=
os
.
path
.
abspath
(
arg_1
)
os
.
mkdir
(
arg_1
)
arg_3
=
CreateFile
(
arg_1
,
fs
.
GENERIC_WRITE
,
fs
.
FILE_SHARE_READ
|
fs
.
FILE_SHARE_WRITE
,
,
fs
.
OPEN_EXISTING
,
fs
.
FILE_FLAG_OPEN_REPARSE_POINT
|
fs
.
FILE_FLAG_BACKUP_SEMANTICS
,
)
try
:
if
arg_3
==
fs
.
INVALID_HANDLE_VALUE
:
raise
WinError
(
)
arg_4
=
unparsed_convert
(
arg_0
)
(
arg_5
,
arg_6
)
=
new_junction_reparse_buffer
(
arg_4
)
arg_7
=
DWORD
(
0
)
arg_8
=
DeviceIoControl
(
arg_3
,
FSCTL_SET_REPARSE_POINT
,
byref
(
arg_5
)
,
arg_6
,
,
0
,
byref
(
arg_7
)
,
)
if
arg_8
==
0
:
raise
WinError
(
)
arg_2
=
True
finally
:
if
arg_3
!=
fs
.
INVALID_HANDLE_VALUE
:
CloseHandle
(
arg_3
)
if
not
arg_2
:
os
.
rmdir
(
arg_1
)

def Func(arg_0, arg_1):
    """
    Create a junction at link_name pointing to source.
    """
    arg_2 = False
    if not os.path.isdir(arg_0):
        raise Exception("%s is not a directory" % arg_0)
    if os.path.exists(arg_1):
        raise Exception("%s: junction link name already exists" % arg_1)

    arg_1 = os.path.abspath(arg_1)
    os.mkdir(arg_1)

    # Get a handle to the directory
    arg_3 = CreateFile(arg_1, fs.GENERIC_WRITE,
        fs.FILE_SHARE_READ | fs.FILE_SHARE_WRITE, None, fs.OPEN_EXISTING,
        fs.FILE_FLAG_OPEN_REPARSE_POINT | fs.FILE_FLAG_BACKUP_SEMANTICS,
        None)
    try:
        if arg_3 == fs.INVALID_HANDLE_VALUE:
            raise WinError()

        arg_4 = unparsed_convert(arg_0)
        (arg_5, arg_6) = new_junction_reparse_buffer(arg_4)

        arg_7 = DWORD(0)
        arg_8 = DeviceIoControl(
            arg_3,
            FSCTL_SET_REPARSE_POINT,
            byref(arg_5),
            arg_6,
            None,
            0,
            byref(arg_7),
            None)

        if arg_8 == 0:
            raise WinError()
        arg_2 = True
    finally:
        if arg_3 != fs.INVALID_HANDLE_VALUE:
            CloseHandle(arg_3)
        if not arg_2:
            os.rmdir(arg_1)

Create a junction at link_name pointing to source .


def Func ( arg_0 ) : try : arg_1 = config ( ) [ 'capture' ] [ 'preview_dir' ] arg_2 = config ( ) [ 'capture' ] [ 'preview' ] [ arg_0 ] arg_2 = arg_2 . replace ( '{{previewdir}}' , arg_1 ) arg_2 = os . path . abspath ( arg_2 ) if os . path . isfile ( arg_2 ) : arg_3 , arg_4 = arg_2 . rsplit ( '/' , 1 ) return send_from_directory ( arg_3 , arg_4 ) except ( IndexError , KeyError ) : pass return '' , 404

def Func(arg_0):
    '''Serve the preview image with the given id
    '''
    try:
        arg_1 = config()['capture']['preview_dir']
        arg_2 = config()['capture']['preview'][arg_0]
        arg_2 = arg_2.replace('{{previewdir}}', arg_1)
        arg_2 = os.path.abspath(arg_2)
        if os.path.isfile(arg_2):
            arg_3, arg_4 = arg_2.rsplit('/', 1)
            return send_from_directory(arg_3, arg_4)
    except (IndexError, KeyError):
        pass
    return '', 404


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = 0 if 'maxsplit' not in arg_3 else arg_3 . pop ( 'maxsplit' ) arg_5 = re . compile ( arg_1 , * arg_2 , ** arg_3 ) for arg_6 in arg_0 : yield arg_5 . split ( arg_6 , arg_4 = arg_4 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """The Func pipe split previous pipe input by regular expression.

    Use 'maxsplit' keyword argument to limit the number of split.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The pattern which used to split string.
    :type pattern: str|unicode
    """
    arg_4 = 0 if 'maxsplit' not in arg_3 else arg_3.pop('maxsplit')
    arg_5 = re.compile(arg_1, *arg_2, **arg_3)
    for arg_6 in arg_0:
        yield arg_5.split(arg_6, arg_4=arg_4)

The resplit pipe split previous pipe input by regular expression.

    Use 'maxsplit' keyword argument to limit the number of split.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The pattern which used to split string.
    :type pattern: str|unicode

The resplit pipe split previous pipe input by regular expression .


def Func(arg_0, arg_1: arg_2, arg_3: arg_4) -> None:
        """Insert the given string before the specified index.

        This method has the same effect as ``self[index:index] = string``;
        it only avoids some condition checks as it rules out the possibility
        of the key being an slice, or the need to shrink any of the sub-spans.

        If parse is False, don't parse the Funced string.
        """
        arg_5, arg_6 = arg_0._span
        arg_7 = arg_0._lststr
        arg_8 = arg_7[0]
        if arg_1 < 0:
            arg_1 += arg_6 - arg_5
            if arg_1 < 0:
                arg_1 = 0
        elif arg_1 > arg_6 - arg_5:  # Note that it is not >=. Index can be new.
            arg_1 = arg_6 - arg_5
        arg_1 += arg_5
        # Update lststr
        arg_7[0] = arg_8[:arg_1] + arg_3 + arg_8[arg_1:]
        arg_9 = len(arg_3)
        # Update spans
        arg_0._Func_update(
            arg_1=arg_1,
            length=arg_9)
        # Remember newly added spans by the string.
        arg_10 = arg_0._type_to_spans
        for arg_11, arg_12 in parse_to_spans(
            bytearray(arg_3, 'ascii', 'replace')
        ).items():
            for arg_13, arg_14 in arg_12:
                insort(arg_10[arg_11], [arg_1 + arg_13, arg_1 + arg_14])

Insert the given string before the specified index.

        This method has the same effect as ``self[index:index] = string``;
        it only avoids some condition checks as it rules out the possibility
        of the key being an slice, or the need to shrink any of the sub-spans.

        If parse is False, don't parse the inserted string.

Insert the given string before the specified index .


(_context, component, backend, base, name='')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = '' ) : arg_0 . action ( discriminator = ( 'currency' , 'Func' , arg_1 ) , callable = _register_Func , args = ( arg_4 , arg_1 , arg_2 , arg_3 ) )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=''):
        """Handle Func subdirectives."""
        arg_0.action(
            discriminator=('currency', 'Func', arg_1),
            callable=_register_Func,
            args=(arg_4, arg_1, arg_2, arg_3)
        )


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . round ) : if not hasattr ( arg_0 , 'dtype' ) : arg_0 = arg_3 . asarray ( arg_0 ) return arg_2 ( arg_0 / arg_1 ) * arg_1

def Func(arg_0, arg_1, arg_2=arg_3.round):
    """
    Round to multiple of any number.
    """
    if not hasattr(arg_0, 'dtype'):
        arg_0 = arg_3.asarray(arg_0)

    return arg_2(arg_0 / arg_1) * arg_1


(self, dataset, y, features=None,
                    feature_type='features')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 'features' ) : if arg_4 == 'features' : arg_5 = np . rot90 ( arg_1 . feature_table . data . toarray ( ) ) elif arg_4 == 'voxels' : arg_5 = np . rot90 ( arg_1 . image_table . data . toarray ( ) ) arg_0 . sk_classifier . fit ( arg_5 , arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=None,
                    arg_4='features'):
        """ Given a dataset, fits either features or voxels to y """

        # Get data from dataset

        if arg_4 == 'features':
            arg_5 = np.rot90(arg_1.feature_table.data.toarray())
        elif arg_4 == 'voxels':
            arg_5 = np.rot90(arg_1.image_table.data.toarray())

        arg_0.sk_classifier.fit(arg_5, arg_2)

Given a dataset fits either features or voxels to y


return {
        'type': tag,
        'coordinates': coordinates
    }

def Func(arg_0):
    """Given an lxml Element of a GML geometry, returns a dict in GeoJSON format."""
    if arg_0.get('srsName') not in ('urn:ogc:def:crs:EPSG::4326', None):
        if arg_0.get('srsName') == 'EPSG:4326':
            return _gmlv2_to_geojson(arg_0)
        else:
            raise NotImplementedError("Unrecognized srsName %s" % arg_0.get('srsName'))
    arg_1 = arg_0.tag.replace('{%s}' % NS_GML, '')
    if arg_1 == 'Point':
        arg_2 = _reverse_gml_coords(arg_0.findtext('{%s}pos' % NS_GML))[0]
    elif arg_1 == 'LineString':
        arg_2 = _reverse_gml_coords(arg_0.findtext('{%s}posList' % NS_GML))
    elif arg_1 == 'Polygon':
        arg_2 = []
        for arg_3 in arg_0.xpath('gml:exterior/gml:LinearRing/gml:posList', namespaces=NSMAP) \
                + arg_0.xpath('gml:interior/gml:LinearRing/gml:posList', namespaces=NSMAP):
            arg_2.append(_reverse_gml_coords(arg_3.text))
    elif arg_1 in ('MultiPoint', 'MultiLineString', 'MultiPolygon'):
        arg_4 = arg_1[5:]
        arg_5 = arg_4[0].lower() + arg_4[1:] + 'Member'
        arg_2 = [
            Func(member)['coordinates']
            for member in arg_0.xpath('gml:%s/gml:%s' % (arg_5, arg_4), namespaces=NSMAP)
        ]
    else:
        raise NotImplementedError

    return {
        'type': arg_1,
        'coordinates': arg_2
    }

Given an lxml Element of a GML geometry returns a dict in GeoJSON format .


def
Func
(
arg_0
,
arg_1
=
""
,
arg_2
=
" "
,
arg_3
=
" "
)
:
if
not
arg_0
:
return
[
]
if
not
arg_1
:
return
arg_0
.
items
(
)
else
:
arg_4
=
[
]
arg_2
,
arg_3
=
_wash_indicators
(
arg_2
,
arg_3
)
if
'%'
in
arg_1
:
for
arg_5
in
arg_0
:
if
_tag_matches_pattern
(
arg_5
,
arg_1
)
:
for
arg_6
in
arg_0
[
arg_5
]
:
if
(
arg_2
in
(
'%'
,
arg_6
[
1
]
)
and
arg_3
in
(
'%'
,
arg_6
[
2
]
)
)
:
arg_4
.
append
(
arg_6
)
else
:
for
arg_6
in
arg_0
.
get
(
arg_1
,
[
]
)
:
if
(
arg_2
in
(
'%'
,
arg_6
[
1
]
)
and
arg_3
in
(
'%'
,
arg_6
[
2
]
)
)
:
arg_4
.
append
(
arg_6
)
return
arg_4

def Func(arg_0, arg_1="", arg_2=" ", arg_3=" "):
    """
    Return the list of field instances for the specified tag and indications.

    Return empty list if not found.
    If tag is empty string, returns all fields

    Parameters (tag, ind1, ind2) can contain wildcard %.

    :param rec: a record structure as returned by create_record()
    :param tag: a 3 characters long string
    :param ind1: a 1 character long string
    :param ind2: a 1 character long string
    :param code: a 1 character long string
    :return: a list of field tuples (Subfields, ind1, ind2, value,
             field_position_global) where subfields is list of (code, value)
    """
    if not arg_0:
        return []
    if not arg_1:
        return arg_0.items()
    else:
        arg_4 = []
        arg_2, arg_3 = _wash_indicators(arg_2, arg_3)

        if '%' in arg_1:
            # Wildcard in tag. Check all possible
            for arg_5 in arg_0:
                if _tag_matches_pattern(arg_5, arg_1):
                    for arg_6 in arg_0[arg_5]:
                        if (arg_2 in ('%', arg_6[1]) and
                                arg_3 in ('%', arg_6[2])):
                            arg_4.append(arg_6)
        else:
            # Completely defined tag. Use dict
            for arg_6 in arg_0.get(arg_1, []):
                if (arg_2 in ('%', arg_6[1]) and
                        arg_3 in ('%', arg_6[2])):
                    arg_4.append(arg_6)
        return arg_4

Return the list of field instances for the specified tag and indications .


def Func(arg_0):
    """Gets the initial win probability of a game given its Vegas line.

    :line: The Vegas line from the home team's perspective (negative means
    home team is favored).
    :returns: A float in [0., 100.] that represents the win probability.
    """
    arg_0 = float(arg_0)
    arg_1 = 1. - norm.cdf(0.5, -arg_0, 13.86)
    arg_2 = norm.cdf(0.5, -arg_0, 13.86) - norm.cdf(-0.5, -arg_0, 13.86)
    return 100. * (arg_1 + 0.5 * arg_2)

Gets the initial win probability of a game given its Vegas line .


def Func ( arg_0 ) : arg_1 = GLMM . covariance ( arg_0 ) arg_2 = arg_0 . _ep . _posterior . tau return pinv ( pinv ( arg_1 ) + diag ( 1 / arg_2 ) )

def Func(arg_0):
        r""" Covariance of the estimated posteriori."""
        arg_1 = GLMM.covariance(arg_0)
        arg_2 = arg_0._ep._posterior.tau
        return pinv(pinv(arg_1) + diag(1 / arg_2))

r Covariance of the estimated posteriori .


def Func(arg_0, arg_1):
    """Delete a Func from the database"""
    LOG.info("Running scout delete Func")
    arg_2 = arg_0.obj['adapter']
    arg_3 = arg_2.Func(arg_1)
    if not arg_3:
        LOG.warning("User {0} could not be found in database".format(arg_1))
    else:
        arg_2.delete_Func(arg_1)


def Func ( arg_0 , arg_1 = 10 ) : arg_2 = vy = vz = 0 for arg_3 in arg_0 . boids : if arg_3 != arg_0 : if abs ( arg_0 . x - arg_3 . x ) < arg_1 : arg_2 += ( arg_0 . x - arg_3 . x ) if abs ( arg_0 . y - arg_3 . y ) < arg_1 : vy += ( arg_0 . y - arg_3 . y ) if abs ( arg_0 . z - arg_3 . z ) < arg_1 : vz += ( arg_0 . z - arg_3 . z ) return arg_2 , vy , vz

def Func(arg_0, arg_1=10):

        """ Boids keep a small distance from other boids.

        Ensures that boids don't collide into each other,
        in a smoothly accelerated motion.

        """

        arg_2 = vy = vz = 0
        for arg_3 in arg_0.boids:
            if arg_3 != arg_0:
                if abs(arg_0.x-arg_3.x) < arg_1: arg_2 += (arg_0.x-arg_3.x)
                if abs(arg_0.y-arg_3.y) < arg_1: vy += (arg_0.y-arg_3.y)
                if abs(arg_0.z-arg_3.z) < arg_1: vz += (arg_0.z-arg_3.z)

        return arg_2, vy, vz

Boids keep a small distance from other boids . Ensures that boids don t collide into each other in a smoothly accelerated motion .


def Func(arg_0, arg_1):
        """Hack in program directory"""
        arg_2 = list(arg_0.PROGRAM_DIRS)
        arg_2.append(arg_1)
        arg_0.PROGRAM_DIRS = arg_2


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . xpath_ctxt . xpathEval ( "d:item" ) if arg_3 is None : return False for arg_4 in arg_3 : arg_5 = DiscoItem ( arg_0 , arg_4 ) if arg_5 . jid == arg_1 and arg_5 . node == arg_2 : return True return False

def Func(arg_0,arg_1,arg_2=None):
        """Check if `self` contains an item.

        :Parameters:
            - `jid`: JID of the item.
            - `node`: node name of the item.
        :Types:
            - `jid`: `JID`
            - `node`: `libxml2.xmlNode`

        :return: `True` if the item is found in `self`.
        :returntype: `bool`"""
        arg_3=arg_0.xpath_ctxt.xpathEval("d:item")
        if arg_3 is None:
            return False
        for arg_4 in arg_3:
            arg_5=DiscoItem(arg_0,arg_4)
            if arg_5.jid==arg_1 and arg_5.node==arg_2:
                return True
        return False


def Func ( arg_0 , arg_1 = None ) : if not arg_0 : return "" arg_2 = str ( inspect . signature ( arg_0 ) ) [ 1 : - 1 ] if arg_1 : arg_2 = re . sub ( r"\b%s\b" % arg_1 , Style . BRIGHT + Fore . WHITE + arg_1 + Fore . LIGHTBLACK_EX + Style . NORMAL , arg_2 ) return arg_2

def Func(arg_0, arg_1=None):
    """
    Return function's declared arguments as a string.

    For example for this function it returns "func, highlight=None"; for the ``_wrap`` function it returns
    "text, wrap_at=120, indent=4". This should usually coincide with the function's declaration (the part
    which is inside the parentheses).
    """
    if not arg_0: return ""
    arg_2 = str(inspect.signature(arg_0))[1:-1]
    if arg_1:
        arg_2 = re.sub(r"\b%s\b" % arg_1, Style.BRIGHT + Fore.WHITE + arg_1 + Fore.LIGHTBLACK_EX + Style.NORMAL, arg_2)
    return arg_2

Return function s declared arguments as a string .


def Func ( arg_0 , arg_1 = None ) : if arg_0 . next : arg_2 = arg_0 . next . Func ( arg_0 . func ( arg_1 , * arg_0 . args , ** arg_0 . kw ) ) else : arg_2 = arg_0 . func ( arg_1 , * arg_0 . args , ** arg_0 . kw ) return arg_2

def Func(arg_0, arg_1=None):
        """Return an generator as Funcator object.

        :param prev: Previous Pipe object which used for data input.
        :returns: A generator for Funcation.
        """

        if arg_0.next:
            arg_2 = arg_0.next.Func(arg_0.func(arg_1, *arg_0.args, **arg_0.kw))
        else:
            arg_2 = arg_0.func(arg_1, *arg_0.args, **arg_0.kw)
        return arg_2

Return an generator as iterator object.

        :param prev: Previous Pipe object which used for data input.
        :returns: A generator for iteration.

Return an generator as iterator object .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = _list_all_latest ( ) if arg_0 is True or not _is_valid_cache ( ) else _list_all_cached ( ) arg_5 = filter_entries ( arg_4 , arg_1 , arg_2 ) if arg_3 is not None : return arg_5 [ : arg_3 ] else : return arg_5

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Lists all available instances.

    :param latest: If true, ignores the cache and grabs the latest list.
    :type latest: ``bool``
    :param filters: Filters to apply to results. A result will only be shown
                    if it includes all text in all filters.
    :type filters: [``str``]
    :param exclude: The opposite of filters. Results will be rejected if they
                    include any of these strings.
    :type exclude: [``str``]
    :param limit: Maximum number of entries to show (default no maximum).
    :type limit: ``int`` or ``NoneType``

    :return: A list of host entries.
    :rtype: ``list`` of :py:class:`HostEntry`
    """
    arg_4 = _list_all_latest() if arg_0 is True or not _is_valid_cache()\
                 else _list_all_cached()
    arg_5 = filter_entries(arg_4, arg_1, arg_2)
    if arg_3 is not None:
        return arg_5[:arg_3]
    else:
        return arg_5


def Func(arg_0, arg_1, arg_2=None):
        """
        Executes a BigQuery query, and returns the job ID.

        :param operation: The query to Func.
        :type operation: str
        :param parameters: Parameters to substitute into the query.
        :type parameters: dict
        """
        arg_3 = _bind_parameters(arg_1,
                               arg_2) if arg_2 else arg_1
        arg_0.job_id = arg_0.run_query(arg_3)

Executes a BigQuery query, and returns the job ID.

        :param operation: The query to execute.
        :type operation: str
        :param parameters: Parameters to substitute into the query.
        :type parameters: dict

Executes a BigQuery query and returns the job ID .


def Func(arg_0):
    """
    Raises a TLSVerificationError due to certificate being expired, or not yet
    being valid

    :param certificate:
        An asn1crypto.x509.Certificate object

    :raises:
        TLSVerificationError
    """

    arg_1 = arg_0['tbs_certificate']['validity']
    arg_2 = arg_1['not_after'].native
    arg_3 = arg_1['not_before'].native

    arg_4 = datetime.now(timezone.utc)

    if arg_3 > arg_4:
        arg_5 = arg_3.strftime('%Y-%m-%d %H:%M:%SZ')
        arg_6 = 'Server certificate verification failed - certificate not valid until %s' % arg_5
    elif arg_2 < arg_4:
        arg_7 = arg_2.strftime('%Y-%m-%d %H:%M:%SZ')
        arg_6 = 'Server certificate verification failed - certificate expired %s' % arg_7

    raise TLSVerificationError(arg_6, arg_0)

Raises a TLSVerificationError due to certificate being expired or not yet being valid


(self, results, types=[], sensors=[], N=1)

def Func ( arg_0 , arg_1 , arg_2 = [ ] , arg_3 = [ ] , arg_4 = 1 ) : if not len ( arg_1 ) : return None if arg_2 : arg_1 = [ r for r in arg_1 if r [ 'type' ] in arg_2 ] if arg_3 : arg_1 = [ r for r in arg_1 if r [ 'properties' ] . get ( 'sensorPlatformName' ) in arg_3 ] arg_5 = sorted ( arg_1 , key = lambda k : k [ 'properties' ] . get ( 'timestamp' ) , reverse = True ) return arg_5 [ : arg_4 ]

def Func(arg_0, arg_1, arg_2=[], arg_3=[], arg_4=1):
        ''' Return the most recent image

        Args:
            results: a catalog resultset, as returned from a search
            types: array of types you want. optional.
            sensors: array of sensornames. optional.
            N: number of recent images to return.  defaults to 1.

        Returns:
            single catalog item, or none if not found

        '''
        if not len(arg_1):
            return None

        # filter on type
        if arg_2:
            arg_1 = [r for r in arg_1 if r['type'] in arg_2]

        # filter on sensor
        if arg_3:
            arg_1 = [r for r in arg_1 if r['properties'].get('sensorPlatformName') in arg_3]

        # sort by date:
        #sorted(results, key=results.__getitem__('properties').get('timestamp'))
        arg_5 = sorted(arg_1, key=lambda k: k['properties'].get('timestamp'), reverse=True)
        return arg_5[:arg_4]


def Func ( arg_0 , arg_1 ) : if ( arg_0 . index [ 0 ] < arg_1 . index [ 0 ] ) or ( arg_0 . index [ - 1 ] > arg_1 . index [ - 1 ] ) : arg_2 = arg_0 [ arg_1 . index ] else : arg_2 = arg_0 return arg_2

def Func(arg_0, arg_1):
    """
    Drop entries from rets so that the start and end dates of rets match those
    of benchmark_rets.

    Parameters
    ----------
    rets : pd.Series
        Daily returns of the strategy, noncumulative.
         - See pf.tears.create_full_tear_sheet for more details

    benchmark_rets : pd.Series
        Daily returns of the benchmark, noncumulative.

    Returns
    -------
    clipped_rets : pd.Series
        Daily noncumulative returns with index clipped to match that of
        benchmark returns.
    """

    if (arg_0.index[0] < arg_1.index[0]) \
            or (arg_0.index[-1] > arg_1.index[-1]):
        arg_2 = arg_0[arg_1.index]
    else:
        arg_2 = arg_0

    return arg_2

Drop entries from rets so that the start and end dates of rets match those of benchmark_rets .


def Func ( arg_0 ) : if arg_0 . _path : return os . path . basename ( arg_0 . _path ) else : return hashlib . sha256 ( hashlib . sha256 ( repr ( arg_0 . _data ) . encode ( ) ) ) . hexdigest ( )

def Func(arg_0):
        """Return identifier which is either the machine file name or sha256 checksum of data."""
        if arg_0._path:
            return os.path.basename(arg_0._path)
        else:
            return hashlib.sha256(hashlib.sha256(repr(arg_0._data).encode())).hexdigest()

Return identifier which is either the machine file name or sha256 checksum of data .


return info.byte_offset == self.component_type.size * self.components

def Func ( arg_0 , arg_1 ) : return arg_1 . byte_offset == arg_0 . component_type . size * arg_0 . components

def Func(arg_0, arg_1):
        """Does the buffer interleave with this one?"""
        return arg_1.byte_offset == arg_0.component_type.size * arg_0.components


def Func(arg_0):
        "Initialize the message-digest and set all fields to zero."

        arg_0.length = 0
        arg_0.input = []

        # Initial 160 bit message digest (5 times 32 bit).
        arg_0.H0 = 0x67452301
        arg_0.H1 = 0xEFCDAB89
        arg_0.H2 = 0x98BADCFE
        arg_0.H3 = 0x10325476
        arg_0.H4 = 0xC3D2E1F0

Initialize the message - digest and set all fields to zero .


(sr, n_fft, n_mels=128, fmin=0.0, fmax=None, htk=False,
        norm=1, dtype=np.float32)

def Func(arg_0, arg_1, arg_2=128, arg_3=0.0, arg_4=None, arg_5=False,
        arg_6=1, arg_7=arg_8.float32):
    """Create a Filterbank matrix to combine FFT bins into Mel-frequency bins

    Parameters
    ----------
    sr        : number > 0 [scalar]
        sampling rate of the incoming signal

    n_fft     : int > 0 [scalar]
        number of FFT components

    n_Funcs    : int > 0 [scalar]
        number of Mel bands to generate

    fmin      : float >= 0 [scalar]
        lowest frequency (in Hz)

    fmax      : float >= 0 [scalar]
        highest frequency (in Hz).
        If `None`, use `fmax = sr / 2.0`

    htk       : bool [scalar]
        use HTK formula instead of Slaney

    norm : {None, 1, np.inf} [scalar]
        if 1, divide the triangular Func weights by the width of the Func band
        (area normalization).  Otherwise, leave all the triangles aiming for
        a peak value of 1.0

    dtype : np.dtype
        The data type of the output basis.
        By default, uses 32-bit (single-precision) floating point.

    Returns
    -------
    M         : np.ndarray [shape=(n_Funcs, 1 + n_fft/2)]
        Mel transform matrix

    Notes
    -----
    This function caches at level 10.

    Examples
    --------
    >>> Funcfb = librosa.filters.Func(22050, 2048)
    >>> Funcfb
    array([[ 0.   ,  0.016, ...,  0.   ,  0.   ],
           [ 0.   ,  0.   , ...,  0.   ,  0.   ],
           ...,
           [ 0.   ,  0.   , ...,  0.   ,  0.   ],
           [ 0.   ,  0.   , ...,  0.   ,  0.   ]])

    Clip the maximum frequency to 8KHz

    >>> librosa.filters.Func(22050, 2048, fmax=8000)
    array([[ 0.  ,  0.02, ...,  0.  ,  0.  ],
           [ 0.  ,  0.  , ...,  0.  ,  0.  ],
           ...,
           [ 0.  ,  0.  , ...,  0.  ,  0.  ],
           [ 0.  ,  0.  , ...,  0.  ,  0.  ]])

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> librosa.display.specshow(Funcfb, x_axis='linear')
    >>> plt.ylabel('Mel filter')
    >>> plt.title('Mel filter bank')
    >>> plt.colorbar()
    >>> plt.tight_layout()
    """

    if arg_4 is None:
        arg_4 = float(arg_0) / 2

    if arg_6 is not None and arg_6 != 1 and arg_6 != arg_8.inf:
        raise ParameterError('Unsupported norm: {}'.format(repr(arg_6)))

    # Initialize the weights
    arg_2 = int(arg_2)
    arg_10 = arg_8.zeros((arg_2, int(1 + arg_1 // 2)), arg_7=arg_7)

    # Center freqs of each FFT bin
    arg_11 = fft_frequencies(arg_0=arg_0, arg_1=arg_1)

    # 'Center freqs' of Func bands - uniformly spaced between limits
    arg_12 = Func_frequencies(arg_2 + 2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5)

    arg_13 = arg_8.diff(arg_12)
    arg_14 = arg_8.subtract.outer(arg_12, arg_11)

    for arg_15 in range(arg_2):
        # lower and upper slopes for all bins
        arg_16 = -arg_14[arg_15] / arg_13[arg_15]
        arg_17 = arg_14[arg_15+2] / arg_13[arg_15+1]

        # .. then intersect them with each other and zero
        arg_10[arg_15] = arg_8.maximum(0, arg_8.minimum(arg_16, arg_17))

    if arg_6 == 1:
        # Slaney-style Func is scaled to be approx constant energy per channel
        arg_18 = 2.0 / (arg_12[2:arg_2+2] - arg_12[:arg_2])
        arg_10 *= arg_18[:, arg_8.newaxis]

    # Only check weights if f_Func[0] is positive
    if not arg_8.all((arg_12[:-2] == 0) | (arg_10.max(axis=1) > 0)):
        # This means we have an empty channel somewhere
        warnings.warn('Empty filters detected in Func frequency basis. '
                      'Some channels will produce empty responses. '
                      'Try increasing your sampling rate (and fmax) or '
                      'reducing n_Funcs.')

    return arg_10

Create a Filterbank matrix to combine FFT bins into Mel-frequency bins

    Parameters
    ----------
    sr        : number > 0 [scalar]
        sampling rate of the incoming signal

    n_fft     : int > 0 [scalar]
        number of FFT components

    n_mels    : int > 0 [scalar]
        number of Mel bands to generate

    fmin      : float >= 0 [scalar]
        lowest frequency (in Hz)

    fmax      : float >= 0 [scalar]
        highest frequency (in Hz).
        If `None`, use `fmax = sr / 2.0`

    htk       : bool [scalar]
        use HTK formula instead of Slaney

    norm : {None, 1, np.inf} [scalar]
        if 1, divide the triangular mel weights by the width of the mel band
        (area normalization).  Otherwise, leave all the triangles aiming for
        a peak value of 1.0

    dtype : np.dtype
        The data type of the output basis.
        By default, uses 32-bit (single-precision) floating point.

    Returns
    -------
    M         : np.ndarray [shape=(n_mels, 1 + n_fft/2)]
        Mel transform matrix

    Notes
    -----
    This function caches at level 10.

    Examples
    --------
    >>> melfb = librosa.filters.mel(22050, 2048)
    >>> melfb
    array([[ 0.   ,  0.016, ...,  0.   ,  0.   ],
           [ 0.   ,  0.   , ...,  0.   ,  0.   ],
           ...,
           [ 0.   ,  0.   , ...,  0.   ,  0.   ],
           [ 0.   ,  0.   , ...,  0.   ,  0.   ]])

    Clip the maximum frequency to 8KHz

    >>> librosa.filters.mel(22050, 2048, fmax=8000)
    array([[ 0.  ,  0.02, ...,  0.  ,  0.  ],
           [ 0.  ,  0.  , ...,  0.  ,  0.  ],
           ...,
           [ 0.  ,  0.  , ...,  0.  ,  0.  ],
           [ 0.  ,  0.  , ...,  0.  ,  0.  ]])

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> librosa.display.specshow(melfb, x_axis='linear')
    >>> plt.ylabel('Mel filter')
    >>> plt.title('Mel filter bank')
    >>> plt.colorbar()
    >>> plt.tight_layout()

Create a Filterbank matrix to combine FFT bins into Mel - frequency bins


def Func(arg_0, arg_1):
        """Handle alias input lines. """
        arg_2 = arg_0.shell.alias_manager.expand_aliases(arg_1.ifun,arg_1.the_rest)
        # pre is needed, because it carries the leading whitespace.  Otherwise
        # aliases won't work in indented sections.
        arg_3 = '%sget_ipython().system(%r)' % (arg_1.pre_whitespace, arg_2)

        return arg_3


def Func ( arg_0 ) : arg_1 = VARIANT ( ) _WinHttpRequest . _ResponseBody ( arg_0 , byref ( arg_1 ) ) if arg_1 . is_safearray_of_bytes ( ) : arg_2 = arg_1 . str_from_safearray ( ) return arg_2 else : return ''

def Func(arg_0):
        '''
        Gets response body as a SAFEARRAY and converts the SAFEARRAY to str.
        '''
        arg_1 = VARIANT()
        _WinHttpRequest._ResponseBody(arg_0, byref(arg_1))
        if arg_1.is_safearray_of_bytes():
            arg_2 = arg_1.str_from_safearray()
            return arg_2
        else:
            return ''

Gets response body as a SAFEARRAY and converts the SAFEARRAY to str .


def Func ( arg_0 = None , arg_1 = None ) : def decorator ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( * arg_2 , ** arg_3 ) : try : return arg_0 ( * arg_2 , ** arg_3 ) except ObjectDoesNotExist : if callable ( arg_1 ) : return arg_1 ( ) else : return arg_1 return wrapper if arg_0 is None : return decorator else : return decorator ( arg_0 )

def Func(arg_0=None, arg_1=None):
    """
    Wrapper around Django's ORM `get` functionality.
    Wrap anything that raises ObjectDoesNotExist exception
    and provide the default value if necessary.
    `default` by default is None. `default` can be any callable,
    if it is callable it will be called when ObjectDoesNotExist
    exception will be raised.
    """
    def decorator(arg_0):
        @wraps(arg_0)
        def wrapper(*arg_2, **arg_3):
            try:
                return arg_0(*arg_2, **arg_3)
            except ObjectDoesNotExist:
                if callable(arg_1):
                    return arg_1()
                else:
                    return arg_1
        return wrapper
    if arg_0 is None:
        return decorator
    else:
        return decorator(arg_0)

Wrapper around Django s ORM get functionality . Wrap anything that raises ObjectDoesNotExist exception and provide the default value if necessary . default by default is None . default can be any callable if it is callable it will be called when ObjectDoesNotExist exception will be raised .


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

def Func(arg_0=None):
    """
    Returns the jQuery Smooth Scroll 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_SMOOTHSCROLL', DJFRONTEND_JQUERY_SMOOTHSCROLL_DEFAULT)

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

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


return Guesser().open(name=name, fileobj=fileobj, closefd=closefd)

def Func ( arg_0 = None , arg_1 = None , arg_2 = True ) : return Guesser ( ) . Func ( arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0=None, arg_1=None, arg_2=True):
    """
    Use all decompressor possible to make the stream
    """
    return Guesser().Func(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = int ( time . time ( ) ) arg_3 = WindowContext ( arg_2 - arg_0 . window_duration , arg_2 ) arg_0 . processWindow ( arg_3 , list ( arg_0 . current_tuples ) ) for arg_1 in arg_0 . current_tuples : arg_0 . ack ( arg_1 ) arg_0 . current_tuples . clear ( )

def Func(arg_0, arg_1):
    """Called every window_duration
    """
    arg_2 = int(time.time())
    arg_3 = WindowContext(arg_2 - arg_0.window_duration, arg_2)
    arg_0.processWindow(arg_3, list(arg_0.current_tuples))
    for arg_1 in arg_0.current_tuples:
      arg_0.ack(arg_1)
    arg_0.current_tuples.clear()


def Func(arg_0, arg_1, arg_2):
    """
    Check if not redefining property on obj
    """
    if getattr(arg_0, arg_1, None) is not None:
        raise IntfLvlConfErr("%r already has property %s old:%s new:%s" %
                             (arg_0, arg_1, repr(getattr(arg_0, arg_1)), arg_2))


return nib.Nifti1Image(as_ndarray(get_img_data(img), dtype=bool), img.get_affine(), img.get_header())

def Func(arg_0, arg_1=True):
    """Load a Nifti mask volume.

    Parameters
    ----------
    image: img-like object or boyle.nifti.NeuroImage or str
        Can either be:
        - a file path to a Nifti image
        - any object with get_data() and get_affine() methods, e.g., nibabel.Nifti1Image.
        If niimg is a string, consider it as a path to Nifti image and
        call nibabel.load on it. If it is an object, check if get_data()
        and get_affine() methods are present, raise TypeError otherwise.

    allow_empty: boolean, optional
        Allow loading an empty mask (full of 0 values)

    Returns
    -------
    nibabel.Nifti1Image with boolean data.
    """
    arg_2    = check_img(arg_0, make_it_3d=True)
    arg_3 = np.unique(arg_2.get_data())

    if len(arg_3) == 1:
        # We accept a single value if it is not 0 (full true mask).
        if arg_3[0] == 0 and not arg_1:
            raise ValueError('Given mask is invalid because it masks all data')

    elif len(arg_3) == 2:
        # If there are 2 different values, one of them must be 0 (background)
        if 0 not in arg_3:
            raise ValueError('Background of the mask must be represented with 0.'
                             ' Given mask contains: {}.'.format(arg_3))

    elif len(arg_3) != 2:
        # If there are more than 2 values, the mask is invalid
            raise ValueError('Given mask is not made of 2 values: {}. '
                             'Cannot interpret as true or false'.format(arg_3))

    return nib.Nifti1Image(as_ndarray(get_img_data(arg_2), dtype=bool), arg_2.get_affine(), arg_2.get_header())


def Func ( arg_0 ) : return dict ( urlparse . parse_qsl ( urlparse . urlparse ( arg_0 ) . query , True ) )

def Func(arg_0):
    """Return query parameters as a dict from the specified URL.

    :param url: URL.
    :type url: str
    :rtype: dict
    """
    return dict(urlparse.parse_qsl(urlparse.urlparse(arg_0).query, True))

Return query parameters as a dict from the specified URL .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
arg_3
)
:
arg_4
=
np
.
get_printoptions
(
)
np
.
set_printoptions
(
precision
=
5
,
threshold
=
64
,
edgeitems
=
2
)
arg_5
=
list
(
)
arg_6
=
arg_1
arg_7
=
',\n'
+
(
1
+
arg_1
//
2
)
*
' '
for
arg_8
,
(
arg_9
,
arg_10
)
in
enumerate
(
sorted
(
six
.
iteritems
(
arg_0
)
)
)
:
if
type
(
arg_10
)
is
float
:
arg_11
=
'%s=%s'
%
(
arg_9
,
str
(
arg_10
)
)
else
:
arg_11
=
'%s=%s'
%
(
arg_9
,
arg_2
(
arg_10
)
)
if
len
(
arg_11
)
>
500
:
arg_11
=
arg_11
[
:
300
]
+
'...'
+
arg_11
[
100
:
]
if
arg_8
>
0
:
if
(
arg_6
+
len
(
arg_11
)
>=
75
or
'\n'
in
arg_11
)
:
arg_5
.
append
(
arg_7
)
arg_6
=
len
(
arg_7
)
else
:
arg_5
.
append
(
', '
)
arg_6
+=
2
arg_5
.
append
(
arg_11
)
arg_6
+=
len
(
arg_11
)
np
.
set_printoptions
(
**
arg_4
)
arg_12
=
''
.
join
(
arg_5
)
arg_12
=
'\n'
.
join
(
l
.
rstrip
(
' '
)
for
l
in
arg_12
.
split
(
'\n'
)
)
return
arg_12

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """Pretty print the dictionary 'params'

    Parameters
    ----------
    params: dict
        The dictionary to pretty print

    offset: int
        The offset in characters to add at the begin of each line.

    printer:
        The function to convert entries to strings, typically
        the builtin str or repr

    """
    # Do a multi-line justified repr:
    arg_4 = np.get_printoptions()
    np.set_printoptions(precision=5, threshold=64, edgeitems=2)
    arg_5 = list()
    arg_6 = arg_1
    arg_7 = ',\n' + (1 + arg_1 // 2) * ' '
    for arg_8, (arg_9, arg_10) in enumerate(sorted(six.iteritems(arg_0))):
        if type(arg_10) is float:
            # use str for representing floating point numbers
            # this way we get consistent representation across
            # architectures and versions.
            arg_11 = '%s=%s' % (arg_9, str(arg_10))
        else:
            # use repr of the rest
            arg_11 = '%s=%s' % (arg_9, arg_2(arg_10))
        if len(arg_11) > 500:
            arg_11 = arg_11[:300] + '...' + arg_11[-100:]
        if arg_8 > 0:
            if (arg_6 + len(arg_11) >= 75 or '\n' in arg_11):
                arg_5.append(arg_7)
                arg_6 = len(arg_7)
            else:
                arg_5.append(', ')
                arg_6 += 2
        arg_5.append(arg_11)
        arg_6 += len(arg_11)

    np.set_printoptions(**arg_4)
    arg_12 = ''.join(arg_5)
    # Strip trailing space to avoid nightmare in doctests
    arg_12 = '\n'.join(l.rstrip(' ') for l in arg_12.split('\n'))
    return arg_12


(exprs, method, permutation_num, pos, neg, classes,
                          ascending, rs=np.random.RandomState())

return cor_mat_ind[:, ::-1], cor_mat[:, ::-1]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                          arg_6, arg_7=arg_8.random.RandomState()):
    """Build shuffled ranking matrix when permutation_type eq to phenotype.

       :param exprs:   gene_expression DataFrame, gene_name indexed.
       :param str method:  calculate correlation or ranking. methods including:
                           1. 'signal_to_noise'.
                           2. 't_test'.
                           3. 'ratio_of_classes' (also referred to as fold change).
                           4. 'diff_of_classes'.
                           5. 'log2_ratio_of_classes'.
       :param int permuation_num: how many times of classes is being shuffled
       :param str pos: one of labels of phenotype's names.
       :param str neg: one of labels of phenotype's names.
       :param list classes:  a list of phenotype labels, to specify which column of
                             dataframe belongs to what class of phenotype.
       :param bool ascending:  bool. Sort ascending vs. descending.

       :return:
                returns two 2d ndarray with shape (nperm, gene_num).

                | cor_mat_indices: the indices of sorted and permutated (exclude last row) ranking matrix.
                | cor_mat: sorted and permutated (exclude last row) ranking matrix.

    """
    # S: samples, G: gene number
    arg_11, arg_12 = arg_0.shape
    # genes = exprs.index.values
    arg_13 = arg_0.values.T
    arg_14 = arg_8.tile(arg_13, (arg_2+1,1,1))
    # random shuffle on the first dim, last matrix is not shuffled
    for arg_15 in arg_14[:-1]: arg_7.shuffle(arg_15)
    arg_5 = arg_8.array(arg_5)
    arg_3 = arg_5 == arg_3
    arg_4 = arg_5 == arg_4
    arg_16 = arg_14[:,arg_3,:].mean(axis=1)
    arg_17 = arg_14[:,arg_4,:].mean(axis=1)
    arg_18 = arg_14[:,arg_3,:].std(axis=1, ddof=1)
    arg_19 = arg_14[:,arg_4,:].std(axis=1, ddof=1)

    if arg_1 == 'signal_to_noise':
        arg_20 = (arg_16 - arg_17)/(arg_18 + arg_19)
    elif arg_1 == 't_test':
        arg_21 = 1.0/arg_11
        arg_20 = (arg_16 - arg_17)/ arg_8.sqrt(arg_21*arg_18**2 + arg_21*arg_19**2)
    elif arg_1 == 'ratio_of_classes':
        arg_20 = arg_16 / arg_17
    elif arg_1 == 'diff_of_classes':
        arg_20  = arg_16 - arg_17
    elif arg_1 == 'log2_ratio_of_classes':
        arg_20  =  arg_8.log2(arg_16 / arg_17)
    else:
        logging.error("Please provide correct method name!!!")
        sys.exit(0)
    # return matix[nperm+1, perm_cors]
    arg_22 = arg_20.argsort()
    # ndarray: sort in place
    arg_20.sort()
    # genes_mat = genes.take(cor_mat_ind)
    if arg_6: return arg_22, arg_20
    # descending order of ranking and genes
    # return genes_mat[:,::-1], cor_mat[:,::-1]
    return arg_22[:, ::-1], arg_20[:, ::-1]

Build shuffled ranking matrix when permutation_type eq to phenotype .


def Func ( arg_0 ) : arg_1 = "" arg_2 = "" if PyFunceble . path . isfile ( arg_0 . structure ) : arg_1 = arg_0 . structure elif PyFunceble . path . isfile ( arg_0 . base + "dir_structure_production.json" ) : arg_1 = arg_0 . base + "dir_structure_production.json" else : if "dev" not in PyFunceble . VERSION : arg_2 = PyFunceble . requests . get ( PyFunceble . LINKS [ "dir_structure" ] . replace ( "dev" , "master" ) ) else : arg_2 = PyFunceble . requests . get ( PyFunceble . LINKS [ "dir_structure" ] . replace ( "master" , "dev" ) ) if arg_1 . endswith ( "_production.json" ) : return arg_0 . _update_structure_from_config ( Dict ( ) . from_json ( File ( arg_1 ) . read ( ) ) ) if arg_1 . endswith ( ".json" ) : return arg_0 . _update_structure_from_config ( Dict ( ) . from_json ( File ( arg_1 ) . read ( ) ) ) return arg_0 . _update_structure_from_config ( Dict ( ) . from_json ( arg_2 . text ) )

def Func(arg_0):
        """
        Get the structure we are going to work with.

        :return: The structure we have to work with.
        :rtype: dict
        """

        # We initiate an empty variable which is going to save the location of
        # file we are going to download.
        arg_1 = ""

        # We initiate the variable which will save the request instance.
        arg_2 = ""

        if PyFunceble.path.isfile(arg_0.structure):
            # The structure path file exist.

            # We set it as the destination file.
            arg_1 = arg_0.structure
        elif PyFunceble.path.isfile(arg_0.base + "dir_structure_production.json"):
            # * The structure path file does not exist.
            # but
            # * The production structure path file exist.

            # We set it as the destination file
            arg_1 = arg_0.base + "dir_structure_production.json"
        else:
            # * The structure path file does not exist.
            # and
            # * The production structure path file does not exist.

            if "dev" not in PyFunceble.VERSION:
                # `dev` is not into the local version name.

                # We get the production file from the master branch.
                arg_2 = PyFunceble.requests.get(
                    PyFunceble.LINKS["dir_structure"].replace("dev", "master")
                )
            else:
                # `dev` is into the local version name.

                # We get the production file from the dev branch.
                arg_2 = PyFunceble.requests.get(
                    PyFunceble.LINKS["dir_structure"].replace("master", "dev")
                )

        if arg_1.endswith("_production.json"):
            # The destination is the production file.

            # And we return the updated the structure from the last read file.
            # (with the names from the configuration file).
            return arg_0._update_structure_from_config(
                Dict().from_json(File(arg_1).read())
            )

        # The destination is not the production file.

        if arg_1.endswith(".json"):
            # The destination ends with `.json`.

            # And we return the updated the structure from the given file.
            # (with the names from the configuration file).
            return arg_0._update_structure_from_config(
                Dict().from_json(File(arg_1).read())
            )

        # The destination does not ends with `.json`.

        # We return the updated the structure from the link we previously got.
        # (with the names from the configuration file).
        return arg_0._update_structure_from_config(Dict().from_json(arg_2.text))

Get the structure we are going to work with .


return self.request(path, method, call_params)

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

def Func(arg_0, arg_1):
        """REST Reload Plivo Config helper
        """
        arg_2 = '/' + arg_0.api_version + '/ReloadConfig/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def
Func
(
arg_0
,
arg_1
=
False
)
:
def
format
(
arg_2
)
:
return
""
if
arg_2
==
1
else
str
(
arg_2
)
.
rstrip
(
"."
)
+
" "
arg_3
=
'id'
if
arg_1
:
arg_3
=
'name'
arg_4
=
[
]
arg_5
=
[
]
for
arg_6
in
sorted
(
arg_0
.
_metabolites
,
key
=
attrgetter
(
"id"
)
)
:
arg_7
=
arg_0
.
_metabolites
[
arg_6
]
arg_8
=
str
(
getattr
(
arg_6
,
arg_3
)
)
if
arg_7
>=
0
:
arg_5
.
append
(
format
(
arg_7
)
+
arg_8
)
else
:
arg_4
.
append
(
format
(
abs
(
arg_7
)
)
+
arg_8
)
arg_9
=
' + '
.
join
(
arg_4
)
if
not
arg_0
.
reversibility
:
if
arg_0
.
lower_bound
<
0
and
arg_0
.
upper_bound
<=
0
:
arg_9
+=
' <-- '
else
:
arg_9
+=
' --> '
else
:
arg_9
+=
' <=> '
arg_9
+=
' + '
.
join
(
arg_5
)
return
arg_9

def Func(arg_0, arg_1=False):
        """Generate a human readable reaction string"""

        def format(arg_2):
            return "" if arg_2 == 1 else str(arg_2).rstrip(".") + " "

        arg_3 = 'id'
        if arg_1:
            arg_3 = 'name'
        arg_4 = []
        arg_5 = []
        for arg_6 in sorted(arg_0._metabolites, key=attrgetter("id")):
            arg_7 = arg_0._metabolites[arg_6]
            arg_8 = str(getattr(arg_6, arg_3))
            if arg_7 >= 0:
                arg_5.append(format(arg_7) + arg_8)
            else:
                arg_4.append(format(abs(arg_7)) + arg_8)

        arg_9 = ' + '.join(arg_4)
        if not arg_0.reversibility:
            if arg_0.lower_bound < 0 and arg_0.upper_bound <= 0:
                arg_9 += ' <-- '
            else:
                arg_9 += ' --> '
        else:
            arg_9 += ' <=> '
        arg_9 += ' + '.join(arg_5)
        return arg_9


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _meta arg_3 = collections . OrderedDict ( ( arg_10 ( arg_4 ) , None ) for arg_4 in arg_1 ) if isinstance ( arg_2 . pk , AleaIdField ) : return collections . OrderedDict ( ( arg_4 , arg_4 ) for arg_4 in arg_1 ) arg_5 = [ field for field in arg_2 . local_fields if isinstance ( field , AleaIdField ) and field . unique and not field . null ] if len ( arg_5 ) == 1 : arg_6 = arg_5 [ 0 ] . name arg_7 = arg_0 . objects . filter ( pk__in = arg_1 , ) . values_list ( 'pk' , arg_6 ) else : arg_8 = ContentType . objects . get_for_model ( arg_0 ) arg_7 = ObjectMapping . objects . filter ( arg_8 = arg_8 , object_id__in = list ( arg_3 ) ) . values_list ( 'object_id' , 'meteor_id' ) for arg_4 , arg_9 in arg_7 : arg_3 [ arg_10 ( arg_4 ) ] = arg_9 for arg_4 , arg_9 in arg_3 . items ( ) : if arg_9 is None : arg_3 [ arg_4 ] = get_meteor_id ( arg_0 , arg_4 ) return arg_3

def Func(arg_0, arg_1):
    """Return Alea ID mapping for all given ids of specified model."""
    # Django model._meta is now public API -> pylint: disable=W0212
    arg_2 = arg_0._meta
    arg_3 = collections.OrderedDict(
        (arg_10(arg_4), None)
        for arg_4
        in arg_1
    )
    if isinstance(arg_2.pk, AleaIdField):
        # primary_key is an AleaIdField, use it.
        return collections.OrderedDict(
            (arg_4, arg_4) for arg_4 in arg_1
        )
    arg_5 = [
        field
        for field in arg_2.local_fields
        if isinstance(field, AleaIdField) and field.unique and not field.null
    ]
    if len(arg_5) == 1:
        arg_6 = arg_5[0].name
        arg_7 = arg_0.objects.filter(
            pk__in=arg_1,
        ).values_list('pk', arg_6)
    else:
        arg_8 = ContentType.objects.get_for_model(arg_0)
        arg_7 = ObjectMapping.objects.filter(
            arg_8=arg_8,
            object_id__in=list(arg_3)
        ).values_list('object_id', 'meteor_id')
    for arg_4, arg_9 in arg_7:
        arg_3[arg_10(arg_4)] = arg_9
    for arg_4, arg_9 in arg_3.items():
        if arg_9 is None:
            arg_3[arg_4] = get_meteor_id(arg_0, arg_4)
    return arg_3

Return Alea ID mapping for all given ids of specified model .


def Func(arg_0, arg_1, arg_2=None):
    """Converts encoded spans to a different encoding.

    param spans: encoded input spans.
    type spans: byte array
    param output_encoding: desired output encoding.
    type output_encoding: Encoding
    param input_encoding: optional input encoding. If this is not specified, it'll
        try to understand the encoding automatically by inspecting the input spans.
    type input_encoding: Encoding
    :returns: encoded spans.
    :rtype: byte array
    """
    if not isinstance(arg_2, Encoding):
        arg_2 = detect_span_version_and_encoding(message=arg_0)

    if arg_2 == arg_1:
        return arg_0

    arg_3 = get_decoder(arg_2)
    arg_4 = get_encoder(arg_1)
    arg_5 = arg_3.decode_spans(arg_0)
    arg_6 = []

    # Encode each indivicual span
    for arg_7 in arg_5:
        arg_6.append(arg_4.encode_span(arg_7))

    # Outputs from encoder.encode_span() can be easily concatenated in a list
    return arg_4.encode_queue(arg_6)

Converts encoded spans to a different encoding .


def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_1 . endswith ( '.ipynb' ) : return 'notebook' elif arg_2 and arg_0 . dir_exists ( arg_1 ) : return 'directory' else : return 'file'

def Func(arg_0, arg_1, arg_2=True):
        """
        Guess the type of a file.

        If allow_directory is False, don't consider the possibility that the
        file is a directory.
        """
        if arg_1.endswith('.ipynb'):
            return 'notebook'
        elif arg_2 and arg_0.dir_exists(arg_1):
            return 'directory'
        else:
            return 'file'


return np.concatenate((arr, np.ones_like(arr)), axis=-1)

def Func ( arg_0 ) : arg_0 = arg_0 [ ... , np . newaxis ] return np . concatenate ( ( arg_0 , np . ones_like ( arg_0 ) ) , axis = - 1 )

def Func(arg_0):
    "Adds a dimensions with ones to array."
    arg_0 = arg_0[..., np.newaxis]
    return np.concatenate((arg_0, np.ones_like(arg_0)), axis=-1)


Verify if the file is already downloaded and complete. If they don't
        exists or if are not complete, use homura download function to fetch
        files. Return a list with the path of the downloaded file and the size
        of the remote file.

return [join(path, filename), remote_file_size]

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
logger
.
debug
(
'initializing download in '
,
arg_1
)
arg_4
=
arg_0
.
get_remote_file_size
(
arg_1
)
if
exists
(
join
(
arg_2
,
arg_3
)
)
:
arg_5
=
getsize
(
join
(
arg_2
,
arg_3
)
)
if
arg_5
==
arg_4
:
logger
.
error
(
'%s already exists on your system'
%
arg_3
)
print
(
'%s already exists on your system'
%
arg_3
)
return
[
join
(
arg_2
,
arg_3
)
,
arg_5
]
logger
.
debug
(
'Downloading: %s'
%
arg_3
)
print
(
'Downloading: %s'
%
arg_3
)
Func
(
arg_1
,
arg_2
)
print
(
'stored at %s'
%
arg_2
)
logger
.
debug
(
'stored at %s'
%
arg_2
)
return
[
join
(
arg_2
,
arg_3
)
,
arg_4
]

def Func(arg_0, arg_1, arg_2, arg_3):
        """Verify if the file is already downloaded and complete. If they don't
        exists or if are not complete, use homura download function to Func
        files. Return a list with the path of the downloaded file and the size
        of the remote file.
        """
        logger.debug('initializing download in ', arg_1)
        arg_4 = arg_0.get_remote_file_size(arg_1)

        if exists(join(arg_2, arg_3)):
            arg_5 = getsize(join(arg_2, arg_3))
            if arg_5 == arg_4:
                logger.error('%s already exists on your system' % arg_3)
                print('%s already exists on your system' % arg_3)
                return [join(arg_2, arg_3), arg_5]

        logger.debug('Downloading: %s' % arg_3)
        print('Downloading: %s' % arg_3)
        Func(arg_1, arg_2)
        print('stored at %s' % arg_2)
        logger.debug('stored at %s' % arg_2)
        return [join(arg_2, arg_3), arg_4]

Verify if the file is already downloaded and complete . If they don t exists or if are not complete use homura download function to fetch files . Return a list with the path of the downloaded file and the size of the remote file .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . get_conn ( ) . projects ( ) . locations ( ) . functions ( ) . patch ( updateMask = "," . join ( arg_3 ) , arg_1 = arg_1 , arg_2 = arg_2 ) . execute ( num_retries = arg_0 . num_retries ) arg_5 = arg_4 [ "name" ] arg_0 . _wait_for_operation_to_complete ( arg_5 = arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Updates Cloud Functions according to the specified update mask.

        :param name: The name of the function.
        :type name: str
        :param body: The body required by the cloud function patch API.
        :type body: dict
        :param update_mask: The update mask - array of fields that should be patched.
        :type update_mask: [str]
        :return: None
        """
        arg_4 = arg_0.get_conn().projects().locations().functions().patch(
            updateMask=",".join(arg_3),
            arg_1=arg_1,
            arg_2=arg_2
        ).execute(num_retries=arg_0.num_retries)
        arg_5 = arg_4["name"]
        arg_0._wait_for_operation_to_complete(arg_5=arg_5)

Updates Cloud Functions according to the specified update mask .


def Func ( arg_0 ) : if os . path . exists ( arg_0 . path ) : os . remove ( arg_0 . path )

def Func(arg_0):
        """
        Clean up the saved state.
        """
        if os.path.exists(arg_0.path):
            os.remove(arg_0.path)


def Func(arg_0):
        """Return real, effective and saved group ids."""
        arg_1, arg_2, arg_3 = _psutil_bsd.Func(arg_0.pid)
        return nt_gids(arg_1, arg_2, arg_3)

Return real effective and saved group ids .


def Func(arg_0, arg_1):
        """Returns the valid offsets for the token at the given position."""
        # The closing brace on a dict or the 'for' in a dict comprehension may
        # reset two indent levels because the dict value is ended implicitly
        arg_2 = -1
        if (
            arg_0._tokens.token(arg_1) in ("}", "for")
            and arg_0._cont_stack[-1].token == ":"
        ):
            arg_2 = -2
        arg_3 = arg_0._cont_stack[arg_2]
        if arg_0._tokens.token(arg_1) in _CLOSING_BRACKETS:
            arg_4 = arg_3.valid_outdent_strings
        else:
            arg_4 = arg_3.valid_continuation_strings
        return arg_3, arg_4.copy()

Returns the valid offsets for the token at the given position .


def Func ( arg_0 , arg_1 ) : arg_2 = cStringIO . StringIO ( ) arg_3 = gzip . GzipFile ( fileobj = arg_2 , mode = 'wb' ) arg_3 . write ( arg_1 ) arg_3 . close ( ) return arg_2 . getvalue ( )

def Func(arg_0, arg_1):
        """
        Compress the log message in order to send less bytes to the wire.
        """
        arg_2 = cStringIO.StringIO()

        arg_3 = gzip.GzipFile(fileobj=arg_2, mode='wb')
        arg_3.write(arg_1)
        arg_3.close()

        return arg_2.getvalue()

Compress the log message in order to send less bytes to the wire .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
[
]
arg_4
=
[
]
for
arg_5
in
arg_1
:
for
arg_6
,
arg_7
in
sorted
(
arg_5
.
get_phone_numbers
(
)
.
items
(
)
,
key
=
lambda
k
:
k
[
0
]
.
lower
(
)
)
:
for
arg_8
in
sorted
(
arg_7
)
:
if
config
.
display_by_name
(
)
==
"first_name"
:
arg_9
=
arg_5
.
get_first_name_last_name
(
)
else
:
arg_9
=
arg_5
.
get_last_name_first_name
(
)
arg_10
=
"\t"
.
join
(
[
arg_9
,
arg_6
,
arg_8
]
)
arg_11
=
"\t"
.
join
(
[
arg_8
,
arg_9
,
arg_6
]
)
if
arg_2
:
arg_12
=
arg_11
else
:
arg_12
=
arg_10
if
re
.
search
(
arg_0
,
"%s\n%s"
%
(
arg_10
,
arg_11
)
,
re
.
IGNORECASE
|
re
.
DOTALL
)
:
arg_4
.
append
(
arg_12
)
elif
len
(
re
.
sub
(
"\D"
,
""
,
arg_0
)
)
>=
3
:
if
re
.
search
(
re
.
sub
(
"\D"
,
""
,
arg_0
)
,
re
.
sub
(
"\D"
,
""
,
arg_8
)
,
re
.
IGNORECASE
)
:
arg_4
.
append
(
arg_12
)
arg_3
.
append
(
arg_12
)
if
arg_4
:
if
arg_2
:
print
(
'\n'
.
join
(
arg_4
)
)
else
:
list_phone_numbers
(
arg_4
)
elif
arg_3
:
if
arg_2
:
print
(
'\n'
.
join
(
arg_3
)
)
else
:
list_phone_numbers
(
arg_3
)
else
:
if
not
arg_2
:
print
(
"Found no phone numbers"
)
sys
.
exit
(
1
)

def Func(arg_0, arg_1, arg_2):
    """Print a phone application friendly contact table.

    :param search_terms: used as search term to filter the contacts before
        printing
    :type search_terms: str
    :param vcard_list: the vcards to search for matching entries which should
        be printed
    :type vcard_list: list of carddav_object.CarddavObject
    :param parsable: machine readable output: columns devided by tabulator (\t)
    :type parsable: bool
    :returns: None
    :rtype: None

    """
    arg_3 = []
    arg_4 = []
    for arg_5 in arg_1:
        for arg_6, arg_7 in sorted(arg_5.get_phone_numbers().items(),
                                        key=lambda k: k[0].lower()):
            for arg_8 in sorted(arg_7):
                if config.display_by_name() == "first_name":
                    arg_9 = arg_5.get_first_name_last_name()
                else:
                    arg_9 = arg_5.get_last_name_first_name()
                # create output lines
                arg_10 = "\t".join([arg_9, arg_6, arg_8])
                arg_11 = "\t".join([arg_8, arg_9, arg_6])
                if arg_2:
                    # parsable option: start with phone number
                    arg_12 = arg_11
                else:
                    # else: start with name
                    arg_12 = arg_10
                if re.search(arg_0,
                             "%s\n%s" % (arg_10, arg_11),
                             re.IGNORECASE | re.DOTALL):
                    arg_4.append(arg_12)
                elif len(re.sub("\D", "", arg_0)) >= 3:
                    # The user likely searches for a phone number cause the
                    # search string contains at least three digits.  So we
                    # remove all non-digit chars from the phone number field
                    # and match against that.
                    if re.search(re.sub("\D", "", arg_0),
                                 re.sub("\D", "", arg_8), re.IGNORECASE):
                        arg_4.append(arg_12)
                # collect all phone numbers in a different list as fallback
                arg_3.append(arg_12)
    if arg_4:
        if arg_2:
            print('\n'.join(arg_4))
        else:
            list_phone_numbers(arg_4)
    elif arg_3:
        if arg_2:
            print('\n'.join(arg_3))
        else:
            list_phone_numbers(arg_3)
    else:
        if not arg_2:
            print("Found no phone numbers")
        sys.exit(1)

Print a phone application friendly contact table .


def Func(arg_0, arg_1):
        """ Send a block of bytes to the consumer.

        Args:
            block (str): Block of bytes
        """
        arg_0._consumer.write(arg_1)
        arg_0._sent += len(arg_1)
        if arg_0._callback:
            arg_0._callback(arg_0._sent, arg_0.length)


def Func(arg_0, arg_1):
        """Utility class method to instantiate a Credentials subclass from JSON.

        Expects the JSON string to have been produced by to_json().

        Args:
            json_data: string or bytes, JSON from to_json().

        Returns:
            An instance of the subclass of Credentials that was serialized with
            to_json().
        """
        arg_2 = _helpers._from_bytes(arg_1)
        arg_3 = json.loads(arg_2)
        # Find and call the right classmethod from_json() to restore
        # the object.
        arg_4 = arg_3['_module']
        try:
            arg_5 = __import__(arg_4)
        except ImportError:
            # In case there's an object from the old package structure,
            # update it
            arg_4 = arg_4.replace('.googleapiclient', '')
            arg_5 = __import__(arg_4)

        arg_5 = __import__(arg_4,
                                fromlist=arg_4.split('.')[:-1])
        arg_6 = getattr(arg_5, arg_3['_class'])
        return arg_6.from_json(arg_2)

Utility class method to instantiate a Credentials subclass from JSON .


return cls.query.filter_by(
            admin_type=resolve_admin_type(admin), admin_id=admin.get_id())

def Func ( arg_0 , arg_1 ) : return arg_0 . query . filter_by ( admin_type = resolve_admin_type ( arg_1 ) , admin_id = arg_1 . get_id ( ) )

def Func(arg_0, arg_1):
        """Get all groups for for a specific admin."""
        return arg_0.query.filter_by(
            admin_type=resolve_admin_type(arg_1), admin_id=arg_1.get_id())

Get all groups for for a specific admin .


def Func(arg_0):
    """Add function 'prerank' argument parsers."""

    arg_1 = arg_0.add_parser("prerank", help="Run GSEApy Prerank tool on preranked gene list.")

    # group for input files
    arg_2 = arg_1.add_argument_group("Input files arguments")
    arg_2.add_argument("-r", "--rnk", dest="rnk", action="store", type=str, required=True,
                             help="Ranking metric file in .rnk format. Same with GSEA.")
    arg_2.add_argument("-g", "--gmt", dest="gmt", action="store", type=str, required=True,
                             help="Gene set database in GMT format. Same with GSEA.")
    arg_2.add_argument("-l", "--label", action='store', nargs=2, dest='label',
                             metavar=('pos', 'neg'), type=str, default=('Pos','Neg'),
                             help="The phenotype label argument need two parameters to define. Default: ('Pos','Neg')")

    # group for output files
    arg_3 = arg_1.add_argument_group("Output arguments")
    add_output_option(arg_3)

    # group for General options.
    arg_4 = arg_1.add_argument_group("GSEA advanced arguments")
    arg_4.add_argument("-n", "--permu-num", dest = "n", action="store", type=int, default=1000, metavar='nperm',
                             help="Number of random permutations. For calculating esnulls. Default: 1000")
    arg_4.add_argument("--min-size",  dest="mins", action="store", type=int, default=15, metavar='int',
                             help="Min size of input genes presented in Gene Sets. Default: 15")
    arg_4.add_argument("--max-size", dest = "maxs", action="store", type=int, default=500, metavar='int',
                             help="Max size of input genes presented in Gene Sets. Default: 500")
    arg_4.add_argument("-w", "--weight", action='store', dest='weight', default=1.0, type=float, metavar='float',
                             help='Weighted_score of rank_metrics. For weighting input genes. Choose from {0, 1, 1.5, 2}. Default: 1',)
    arg_4.add_argument("-a", "--ascending", action='store_true', dest='ascending', default=False,
                             help='Rank metric sorting order. If the -a flag was chosen, then ascending equals to True. Default: False.')
    arg_4.add_argument("-s", "--seed", dest = "seed", action="store", type=int, default=None, metavar='',
                             help="Number of random seed. Default: None")
    arg_4.add_argument("-p", "--threads", dest = "threads", action="store", type=int, default=1, metavar='procs',
                           help="Number of Processes you are going to use. Default: 1")

    return


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in range ( arg_1 , arg_2 ) : arg_0 [ arg_3 ] = '/**/'

def Func(arg_0, arg_1, arg_2):
  """Clears a range of lines for multi-line comments."""
  # Having // dummy comments makes the lines non-empty, so we will not get
  # unnecessary blank line warnings later in the code.
  for arg_3 in range(arg_1, arg_2):
    arg_0[arg_3] = '/**/'

Clears a range of lines for multi - line comments .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = { arg : True for arg in arg_1 } arg_3 . update ( arg_2 ) return arg_3

def Func(arg_0, *arg_1, **arg_2):
        """Add switches as 'options' with value True to the options dict."""
        arg_3 = {arg: True for arg in arg_1}   # switches are kwargs with value True
        arg_3.update(arg_2)
        return arg_3

Add switches as options with value True to the options dict .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . bump = arg_0 . some_things_at ( arg_2 , Obstacle ) if not arg_1 . bump : arg_1 . location = arg_2 for arg_5 in arg_0 . observers : arg_5 . thing_moved ( arg_1 )

def Func(arg_0, arg_1, arg_2):
        "Move a thing to a new location."
        arg_1.bump = arg_0.some_things_at(arg_2, Obstacle)
        if not arg_1.bump:
            arg_1.location = arg_2
            for arg_5 in arg_0.observers:
                arg_5.thing_moved(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
mgmt_client
.
Func
(
arg_1
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
raise
ServiceBusConnectionError
(
"Namespace: {} not found"
.
format
(
arg_0
.
service_namespace
)
,
e
)
except
AzureServiceBusResourceNotFound
:
raise
ServiceBusResourceNotFound
(
"Specificed topic does not exist."
)
arg_3
=
[
]
for
arg_4
in
arg_2
:
arg_3
.
append
(
SubscriptionClient
.
from_entity
(
arg_0
.
_get_host
(
)
,
arg_1
,
arg_4
,
shared_access_key_name
=
arg_0
.
shared_access_key_name
,
shared_access_key_value
=
arg_0
.
shared_access_key_value
,
loop
=
arg_0
.
loop
,
debug
=
arg_0
.
debug
)
)
return
arg_3

def Func(arg_0, arg_1):
        """Get an async client for all subscription entities in the topic.

        :param topic_name: The topic to list subscriptions for.
        :type topic_name: str
        :rtype: list[~azure.servicebus.aio.async_client.SubscriptionClient]
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the topic is not found.
        """
        try:
            arg_2 = arg_0.mgmt_client.Func(arg_1)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except AzureServiceBusResourceNotFound:
            raise ServiceBusResourceNotFound("Specificed topic does not exist.")
        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(SubscriptionClient.from_entity(
                arg_0._get_host(), arg_1, arg_4,
                shared_access_key_name=arg_0.shared_access_key_name,
                shared_access_key_value=arg_0.shared_access_key_value,
                loop=arg_0.loop,
                debug=arg_0.debug))
        return arg_3

Get an async client for all subscription entities in the topic .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
_logger
.
debug
(
"Releasing connection"
)
arg_2
.
close
(
)
arg_1
.
close
(
)
return

def Func(arg_0, arg_1, arg_2):
    """ Release database connection and cursor; passed as a callback to
    ConnectionWrapper
    """
    arg_0._logger.debug("Releasing connection")

    # Close the cursor
    arg_2.close()

    # ... then close the database connection
    arg_1.close()
    return

Release database connection and cursor ; passed as a callback to ConnectionWrapper


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 == GHARAGHEIZI_G : arg_3 = Gharagheizi_gas ( arg_1 , arg_0 . MW , arg_0 . Tb , arg_0 . Pc , arg_0 . omega ) elif arg_2 == DIPPR_9B : arg_4 = arg_0 . Cvgm ( arg_1 ) if hasattr ( arg_0 . Cvgm , '__call__' ) else arg_0 . Cvgm arg_5 = arg_0 . mug ( arg_1 ) if hasattr ( arg_0 . mug , '__call__' ) else arg_0 . mug arg_3 = DIPPR9B ( arg_1 , arg_0 . MW , arg_4 , arg_5 , arg_0 . Tc ) elif arg_2 == CHUNG : arg_4 = arg_0 . Cvgm ( arg_1 ) if hasattr ( arg_0 . Cvgm , '__call__' ) else arg_0 . Cvgm arg_5 = arg_0 . mug ( arg_1 ) if hasattr ( arg_0 . mug , '__call__' ) else arg_0 . mug arg_3 = Chung ( arg_1 , arg_0 . MW , arg_0 . Tc , arg_0 . omega , arg_4 , arg_5 ) elif arg_2 == ELI_HANLEY : arg_4 = arg_0 . Cvgm ( arg_1 ) if hasattr ( arg_0 . Cvgm , '__call__' ) else arg_0 . Cvgm arg_3 = eli_hanley ( arg_1 , arg_0 . MW , arg_0 . Tc , arg_0 . Vc , arg_0 . Zc , arg_0 . omega , arg_4 ) elif arg_2 == EUCKEN_MOD : arg_4 = arg_0 . Cvgm ( arg_1 ) if hasattr ( arg_0 . Cvgm , '__call__' ) else arg_0 . Cvgm arg_5 = arg_0 . mug ( arg_1 ) if hasattr ( arg_0 . mug , '__call__' ) else arg_0 . mug arg_3 = Eucken_modified ( arg_0 . MW , arg_4 , arg_5 ) elif arg_2 == EUCKEN : arg_4 = arg_0 . Cvgm ( arg_1 ) if hasattr ( arg_0 . Cvgm , '__call__' ) else arg_0 . Cvgm arg_5 = arg_0 . mug ( arg_1 ) if hasattr ( arg_0 . mug , '__call__' ) else arg_0 . mug arg_3 = Eucken ( arg_0 . MW , arg_4 , arg_5 ) elif arg_2 == DIPPR_PERRY_8E : arg_3 = EQ102 ( arg_1 , * arg_0 . Perrys2_314_coeffs ) elif arg_2 == VDI_PPDS : arg_3 = horner ( arg_0 . VDI_PPDS_coeffs , arg_1 ) elif arg_2 == BAHADORI_G : arg_3 = Bahadori_gas ( arg_1 , arg_0 . MW ) elif arg_2 == COOLPROP : arg_3 = CoolProp_T_dependent_property ( arg_1 , arg_0 . CASRN , 'L' , 'g' ) elif arg_2 in arg_0 . tabular_data : arg_3 = arg_0 . interpolate ( arg_1 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        r'''Method to Func low-pressure gas thermal conductivity at
        tempearture `T` with a given method.

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

        Parameters
        ----------
        T : float
            Temperature of the gas, [K]
        method : str
            Name of the method to use

        Returns
        -------
        kg : float
            Thermal conductivity of the gas at T and a low pressure, [W/m/K]
        '''
        if arg_2 == GHARAGHEIZI_G:
            arg_3 = Gharagheizi_gas(arg_1, arg_0.MW, arg_0.Tb, arg_0.Pc, arg_0.omega)
        elif arg_2 == DIPPR_9B:
            arg_4 = arg_0.Cvgm(arg_1) if hasattr(arg_0.Cvgm, '__call__') else arg_0.Cvgm
            arg_5 = arg_0.mug(arg_1) if hasattr(arg_0.mug, '__call__') else arg_0.mug
            arg_3 = DIPPR9B(arg_1, arg_0.MW, arg_4, arg_5, arg_0.Tc)
        elif arg_2 == CHUNG:
            arg_4 = arg_0.Cvgm(arg_1) if hasattr(arg_0.Cvgm, '__call__') else arg_0.Cvgm
            arg_5 = arg_0.mug(arg_1) if hasattr(arg_0.mug, '__call__') else arg_0.mug
            arg_3 = Chung(arg_1, arg_0.MW, arg_0.Tc, arg_0.omega, arg_4, arg_5)
        elif arg_2 == ELI_HANLEY:
            arg_4 = arg_0.Cvgm(arg_1) if hasattr(arg_0.Cvgm, '__call__') else arg_0.Cvgm
            arg_3 = eli_hanley(arg_1, arg_0.MW, arg_0.Tc, arg_0.Vc, arg_0.Zc, arg_0.omega, arg_4)
        elif arg_2 == EUCKEN_MOD:
            arg_4 = arg_0.Cvgm(arg_1) if hasattr(arg_0.Cvgm, '__call__') else arg_0.Cvgm
            arg_5 = arg_0.mug(arg_1) if hasattr(arg_0.mug, '__call__') else arg_0.mug
            arg_3 = Eucken_modified(arg_0.MW, arg_4, arg_5)
        elif arg_2 == EUCKEN:
            arg_4 = arg_0.Cvgm(arg_1) if hasattr(arg_0.Cvgm, '__call__') else arg_0.Cvgm
            arg_5 = arg_0.mug(arg_1) if hasattr(arg_0.mug, '__call__') else arg_0.mug
            arg_3 = Eucken(arg_0.MW, arg_4, arg_5)
        elif arg_2 == DIPPR_PERRY_8E:
            arg_3 = EQ102(arg_1, *arg_0.Perrys2_314_coeffs)
        elif arg_2 == VDI_PPDS:
            arg_3 = horner(arg_0.VDI_PPDS_coeffs, arg_1)
        elif arg_2 == BAHADORI_G:
            arg_3 = Bahadori_gas(arg_1, arg_0.MW)
        elif arg_2 == COOLPROP:
            arg_3 = CoolProp_T_dependent_property(arg_1, arg_0.CASRN, 'L', 'g')
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3

r'''Method to calculate low-pressure gas thermal conductivity at
        tempearture `T` with a given method.

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

        Parameters
        ----------
        T : float
            Temperature of the gas, [K]
        method : str
            Name of the method to use

        Returns
        -------
        kg : float
            Thermal conductivity of the gas at T and a low pressure, [W/m/K]

r Method to calculate low - pressure gas thermal conductivity at tempearture T with a given method .


(
    src, pyi_dir, targets, *, src_explicitly_given=False, quiet=False, hg=False
)

def Func ( arg_0 , arg_1 , arg_2 , * , arg_3 = False , arg_4 = False , arg_5 = False ) : if arg_0 . is_dir ( ) : for arg_6 in arg_0 . iterdir ( ) : if arg_6 == arg_1 or arg_6 == arg_2 : continue yield from Func ( arg_6 , arg_1 / arg_0 . name , arg_2 / arg_0 . name , arg_4 = arg_4 , arg_5 = arg_5 , ) elif arg_0 . suffix == '.py' or arg_3 : try : retype_file ( arg_0 , arg_1 , arg_2 , arg_4 = arg_4 , arg_5 = arg_5 ) except Exception as e : yield ( arg_0 , str ( e ) , type ( e ) , traceback . format_tb ( e . __traceback__ ) , )

def Func(
    arg_0, arg_1, arg_2, *, arg_3=False, arg_4=False, arg_5=False
):
    """Recursively retype files or directories given. Generate errors."""
    if arg_0.is_dir():
        for arg_6 in arg_0.iterdir():
            if arg_6 == arg_1 or arg_6 == arg_2:
                continue
            yield from Func(
                arg_6, arg_1 / arg_0.name, arg_2 / arg_0.name, arg_4=arg_4, arg_5=arg_5,
            )
    elif arg_0.suffix == '.py' or arg_3:
        try:
            retype_file(arg_0, arg_1, arg_2, arg_4=arg_4, arg_5=arg_5)
        except Exception as e:
            yield (
                arg_0,
                str(e),
                type(e),
                traceback.format_tb(e.__traceback__),
            )

Recursively retype files or directories given . Generate errors .


(self, projection_matrix=None, camera_matrix=None, all=True)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : arg_1 = arg_1 . astype ( 'f4' ) . tobytes ( ) arg_2 = arg_2 . astype ( 'f4' ) . tobytes ( ) arg_0 . bbox_program [ "m_proj" ] . write ( arg_1 ) arg_0 . bbox_program [ "m_view" ] . write ( arg_0 . _view_matrix . astype ( 'f4' ) . tobytes ( ) ) arg_0 . bbox_program [ "m_cam" ] . write ( arg_2 ) arg_0 . bbox_program [ "bb_min" ] . write ( arg_0 . bbox_min . astype ( 'f4' ) . tobytes ( ) ) arg_0 . bbox_program [ "bb_max" ] . write ( arg_0 . bbox_max . astype ( 'f4' ) . tobytes ( ) ) arg_0 . bbox_program [ "color" ] . value = ( 1.0 , 0.0 , 0.0 ) arg_0 . bbox_vao . render ( arg_0 . bbox_program ) if not arg_3 : return for arg_6 in arg_0 . root_nodes : arg_6 . Func ( arg_1 , arg_2 , arg_0 . bbox_program , arg_0 . bbox_vao )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True):
        """Draw scene and mesh bounding boxes"""
        arg_1 = arg_1.astype('f4').tobytes()
        arg_2 = arg_2.astype('f4').tobytes()

        # Scene bounding box
        arg_0.bbox_program["m_proj"].write(arg_1)
        arg_0.bbox_program["m_view"].write(arg_0._view_matrix.astype('f4').tobytes())
        arg_0.bbox_program["m_cam"].write(arg_2)
        arg_0.bbox_program["bb_min"].write(arg_0.bbox_min.astype('f4').tobytes())
        arg_0.bbox_program["bb_max"].write(arg_0.bbox_max.astype('f4').tobytes())
        arg_0.bbox_program["color"].value = (1.0, 0.0, 0.0)
        arg_0.bbox_vao.render(arg_0.bbox_program)

        if not arg_3:
            return

        # Draw bounding box for children
        for arg_6 in arg_0.root_nodes:
            arg_6.Func(arg_1, arg_2, arg_0.bbox_program, arg_0.bbox_vao)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
replace
(
"-"
,
"_"
)
for
arg_3
in
os
.
listdir
(
arg_1
)
:
arg_4
=
dist_info_re
.
match
(
arg_3
)
if
arg_4
and
arg_4
.
group
(
'name'
)
==
arg_2
:
with
open
(
os
.
path
.
join
(
arg_1
,
arg_3
,
'WHEEL'
)
)
as
wheel
:
for
arg_5
in
wheel
:
arg_5
=
arg_5
.
lower
(
)
.
rstrip
(
)
if
arg_5
==
"root-is-purelib: true"
:
return
True
return
False

def Func(arg_0, arg_1):
    """
    Return True if the extracted wheel in wheeldir should go into purelib.
    """
    arg_2 = arg_0.replace("-", "_")
    for arg_3 in os.listdir(arg_1):
        arg_4 = dist_info_re.match(arg_3)
        if arg_4 and arg_4.group('name') == arg_2:
            with open(os.path.join(arg_1, arg_3, 'WHEEL')) as wheel:
                for arg_5 in wheel:
                    arg_5 = arg_5.lower().rstrip()
                    if arg_5 == "root-is-purelib: true":
                        return True
    return False

Return True if the extracted wheel in wheeldir should go into purelib .