(self, project_id, model_name, version_name)

return _poll_with_exponential_delay(
            request=get_request,
            max_n=9,
            is_done_func=lambda resp: resp.get('done', False),
            is_error_func=lambda resp: resp.get('error', None) is not None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = 'projects/{}/models/{}/versions/{}' . format ( arg_1 , arg_2 , arg_3 ) arg_5 = arg_0 . _mlengine . projects ( ) . models ( ) . versions ( ) . delete ( name = arg_4 ) arg_6 = arg_5 . execute ( ) arg_7 = arg_0 . _mlengine . projects ( ) . operations ( ) . get ( name = arg_6 [ 'name' ] ) return _poll_with_exponential_delay ( request = arg_7 , max_n = 9 , is_done_func = lambda resp : resp . get ( 'done' , False ) , is_error_func = lambda resp : resp . get ( 'error' , None ) is not None )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Deletes the given version of a model. Blocks until finished.
        """
        arg_4 = 'projects/{}/models/{}/versions/{}'.format(
            arg_1, arg_2, arg_3)
        arg_5 = arg_0._mlengine.projects().models().versions().delete(
            name=arg_4)
        arg_6 = arg_5.execute()
        arg_7 = arg_0._mlengine.projects().operations().get(
            name=arg_6['name'])

        return _poll_with_exponential_delay(
            request=arg_7,
            max_n=9,
            is_done_func=lambda resp: resp.get('done', False),
            is_error_func=lambda resp: resp.get('error', None) is not None)

Deletes the given version of a model . Blocks until finished .


def Func ( arg_0 ) : ClientStream . Func ( arg_0 ) arg_0 . available_auth_methods = None arg_0 . auth_stanza = None arg_0 . registration_callback = None

def Func(arg_0):
        """Reset the `LegacyClientStream` object state, making the object ready
        to handle new connections."""
        ClientStream.Func(arg_0)
        arg_0.available_auth_methods = None
        arg_0.auth_stanza = None
        arg_0.registration_callback = None

Reset the LegacyClientStream object state making the object ready to handle new connections .


def Func ( arg_0 ) : from pip . utils import FakeFile arg_1 = csv . reader ( FakeFile ( arg_0 . get_metadata_lines ( 'RECORD' ) ) ) for arg_2 in arg_1 : arg_3 = os . path . join ( arg_0 . location , arg_2 [ 0 ] ) yield arg_3 if arg_3 . endswith ( '.py' ) : arg_4 , arg_5 = os . path . split ( arg_3 ) arg_6 = arg_5 [ : - 3 ] arg_3 = os . path . join ( arg_4 , arg_6 + '.pyc' ) yield arg_3

def Func(arg_0):
    """
    Yield all the uninstallation paths for dist based on RECORD-without-.pyc

    Yield paths to all the files in RECORD. For each .py file in RECORD, add
    the .pyc in the same directory.

    UninstallPathSet.add() takes care of the __pycache__ .pyc.
    """
    from pip.utils import FakeFile  # circular import
    arg_1 = csv.reader(FakeFile(arg_0.get_metadata_lines('RECORD')))
    for arg_2 in arg_1:
        arg_3 = os.path.join(arg_0.location, arg_2[0])
        yield arg_3
        if arg_3.endswith('.py'):
            arg_4, arg_5 = os.path.split(arg_3)
            arg_6 = arg_5[:-3]
            arg_3 = os.path.join(arg_4, arg_6 + '.pyc')
            yield arg_3

Yield all the uninstallation paths for dist based on RECORD - without - . pyc


def Func ( arg_0 ) : arg_1 = peek ( ) arg_2 = "Func" + repr ( arg_0 ) try : if ( arg_1 is EndOfFile ) or ( arg_1 in arg_0 ) : fail ( [ arg_2 ] ) except TypeError : if arg_1 != arg_0 : fail ( [ arg_2 ] ) next ( ) return arg_1

def Func(arg_0):
    """Returns the current token if it is not found in the collection provided.

    The negative of one_of.
    """
    arg_1 = peek()
    arg_2 = "Func" + repr(arg_0)
    try:
        if (arg_1 is EndOfFile) or (arg_1 in arg_0):
            fail([arg_2])
    except TypeError:
        if arg_1 != arg_0:
            fail([arg_2])
    next()
    return arg_1

Returns the current token if it is not found in the collection provided . The negative of one_of .


(self, token, channel,
                                       x_start, y_start, z_start,
                                       data, resolution)

def Func(arg_0, arg_1, arg_2,
                                       arg_3, arg_4, arg_5,
                                       arg_6, arg_7):
        """
        Accepts data in zyx. !!!
        """
        arg_6 = numpy.expand_dims(arg_6, axis=0)
        arg_8 = blosc.pack_array(arg_6)
        arg_9 = arg_0.url("{}/{}/blosc/{}/{},{}/{},{}/{},{}/0,0/".format(
            arg_1, arg_2,
            arg_7,
            arg_3, arg_3 + arg_6.shape[3],
            arg_4, arg_4 + arg_6.shape[2],
            arg_5, arg_5 + arg_6.shape[1]
        ))

        arg_10 = arg_0.remote_utils.post_url(arg_9, arg_6=arg_8, headers={
            'Content-Type': 'application/octet-stream'
        })

        if arg_10.status_code is not 200:
            raise RemoteDataUploadError(arg_10.text)
        else:
            return True


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_unpack_message
(
arg_1
)
logger
.
debug
(
arg_2
)
if
arg_2
!=
arg_0
.
RTM_HANDSHAKE
:
raise
SlackApiError
(
'Unexpected response: {!r}'
.
format
(
arg_2
)
)
logger
.
info
(
'Joined real-time messaging.'
)

def Func(arg_0, arg_1):
        """Check the first message matches the expected handshake.

        Note:
          The handshake is provided as :py:attr:`RTM_HANDSHAKE`.

        Arguments:
          msg (:py:class:`aiohttp.Message`): The message to validate.

        Raises:
          :py:class:`SlackApiError`: If the data doesn't match the
            expected handshake.

        """
        arg_2 = arg_0._unpack_message(arg_1)
        logger.debug(arg_2)
        if arg_2 != arg_0.RTM_HANDSHAKE:
            raise SlackApiError('Unexpected response: {!r}'.format(arg_2))
        logger.info('Joined real-time messaging.')

Check the first message matches the expected handshake .


def Func ( arg_0 , arg_1 = False ) : try : iter ( arg_0 ) except Exception : return False else : return arg_1 or not isinstance ( arg_0 , six . string_types )

def Func(arg_0, arg_1=False):
    """
    Checks if the input implements the iterator interface. An exception is made
    for strings, which return False unless `strok` is True

    Args:
        obj (object): a scalar or Func input

        strok (bool): if True allow strings to be interpreted as Func

    Returns:
        bool: True if the input is Func

    Example:
        >>> obj_list = [3, [3], '3', (3,), [3, 4, 5], {}]
        >>> result = [Func(obj) for obj in obj_list]
        >>> assert result == [False, True, False, True, True, True]
        >>> result = [Func(obj, strok=True) for obj in obj_list]
        >>> assert result == [False, True, True, True, True, True]
    """
    try:
        iter(arg_0)
    except Exception:
        return False
    else:
        return arg_1 or not isinstance(arg_0, six.string_types)

Checks if the input implements the iterator interface. An exception is made
    for strings, which return False unless `strok` is True

    Args:
        obj (object): a scalar or iterable input

        strok (bool): if True allow strings to be interpreted as iterable

    Returns:
        bool: True if the input is iterable

    Example:
        >>> obj_list = [3, [3], '3', (3,), [3, 4, 5], {}]
        >>> result = [iterable(obj) for obj in obj_list]
        >>> assert result == [False, True, False, True, True, True]
        >>> result = [iterable(obj, strok=True) for obj in obj_list]
        >>> assert result == [False, True, True, True, True, True]

Checks if the input implements the iterator interface . An exception is made for strings which return False unless strok is True


(self, start_date, end_date, rate="MID")

def Func(arg_0, arg_1, arg_2, arg_3="MID"):
        """
        Compute the return of the currency between two dates
        """
        if arg_3 not in ["MID", "ASK", "BID"]:
            raise ValueError("Unknown rate type (%s)- must be 'MID', 'ASK' or 'BID'" % str(arg_3))

        if arg_2 <= arg_1:
            raise ValueError("End date must be on or after start date")

        arg_4 = arg_0.generate_dataframe(arg_1=arg_1, arg_2=arg_2)
        arg_5 = arg_4.ix[arg_1][arg_3]
        arg_6 = arg_4.ix[arg_2][arg_3]

        arg_7 = (arg_6 / arg_5) - 1.0

        return arg_7


def Func(arg_0):
    """Uploads new version of the blog website"""

    arg_1 = arg_0.obj

    header('Generating HTML...')
    pelican(arg_1, '--verbose', production=True)

    header('Removing unnecessary output...')
    arg_2 = [
        'author', 'category', 'tag', 'feeds', 'tags.html',
        'authors.html', 'categories.html', 'archives.html',
    ]
    for arg_3 in arg_2:
        remove_path(os.path.join(arg_1['OUTPUT_DIR'], arg_3))

    if os.environ.get('TRAVIS'):  # Travis CI
        header('Setting up Git...')
        run(
            'git config user.name ' +
            run('git show --format="%cN" -s', capture=True)
        )
        run(
            'git config user.email ' +
            run('git show --format="%cE" -s', capture=True)
        )

        arg_4 = os.environ.get('GITHUB_TOKEN')
        arg_5 = os.environ.get('TRAVIS_REPO_SLUG')
        arg_6 = 'https://{}@github.com/{}.git'.format(arg_4, arg_5)
        run('git remote set-url origin ' + arg_6)

    header('Rewriting gh-pages branch...')
    run('ghp-import -m "{message}" {dir}'.format(
        message='Deploying {}'.format(choose_commit_emoji()),
        dir=arg_1['OUTPUT_DIR'],
    ))

    header('Pushing to GitHub...')
    run('git push origin gh-pages:gh-pages --force')


(path=None, regx='\.jpg', printable=True, keep_prefix=False)

def
Func
(
arg_0
=
,
arg_1
=
'\.jpg'
,
arg_2
=
True
,
arg_3
=
False
)
:
if
arg_0
is
:
arg_0
=
os
.
getcwd
(
)
arg_4
=
os
.
listdir
(
arg_0
)
arg_5
=
[
]
for
arg_6
,
arg_7
in
enumerate
(
arg_4
)
:
if
re
.
search
(
arg_1
,
arg_7
)
:
arg_5
.
append
(
arg_7
)
if
arg_3
:
for
arg_8
,
arg_7
in
enumerate
(
arg_5
)
:
arg_5
[
arg_8
]
=
os
.
path
.
join
(
arg_0
,
arg_7
)
if
arg_2
:
logging
.
info
(
'Match file list = %s'
%
arg_5
)
logging
.
info
(
'Number of files = %d'
%
len
(
arg_5
)
)
return
arg_5

def Func(arg_0=None, arg_1='\.jpg', arg_2=True, arg_3=False):
    r"""Return a file list in a folder by given a path and regular expression.

    Parameters
    ----------
    path : str or None
        A folder path, if `None`, use the current directory.
    regx : str
        The regx of file name.
    printable : boolean
        Whether to print the files infomation.
    keep_prefix : boolean
        Whether to keep path in the file name.

    Examples
    ----------
    >>> file_list = tl.files.Func(path=None, regx='w1pre_[0-9]+\.(npz)')

    """
    if arg_0 is None:
        arg_0 = os.getcwd()
    arg_4 = os.listdir(arg_0)
    arg_5 = []
    for arg_6, arg_7 in enumerate(arg_4):
        if re.search(arg_1, arg_7):
            arg_5.append(arg_7)
    # return_list.sort()
    if arg_3:
        for arg_8, arg_7 in enumerate(arg_5):
            arg_5[arg_8] = os.path.join(arg_0, arg_7)

    if arg_2:
        logging.info('Match file list = %s' % arg_5)
        logging.info('Number of files = %d' % len(arg_5))
    return arg_5

r"""Return a file list in a folder by given a path and regular expression.

    Parameters
    ----------
    path : str or None
        A folder path, if `None`, use the current directory.
    regx : str
        The regx of file name.
    printable : boolean
        Whether to print the files infomation.
    keep_prefix : boolean
        Whether to keep path in the file name.

    Examples
    ----------
    >>> file_list = tl.files.load_file_list(path=None, regx='w1pre_[0-9]+\.(npz)')

r Return a file list in a folder by given a path and regular expression .


(tar_filename, files, config_dir, config_files)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
with
contextlib
.
closing
(
tarfile
.
open
(
arg_0
,
'w:gz'
,
dereference
=
True
)
)
as
tar
:
for
arg_4
in
arg_1
:
if
os
.
path
.
isfile
(
arg_4
)
:
tar
.
add
(
arg_4
,
arcname
=
os
.
path
.
basename
(
arg_4
)
)
else
:
raise
Exception
(
"%s is not an existing file"
%
arg_4
)
if
os
.
path
.
isdir
(
arg_2
)
:
tar
.
add
(
arg_2
,
arcname
=
get_heron_sandbox_conf_dir
(
)
)
else
:
raise
Exception
(
"%s is not an existing directory"
%
arg_2
)
for
arg_4
in
arg_3
:
if
os
.
path
.
isfile
(
arg_4
)
:
arg_5
=
os
.
path
.
join
(
get_heron_sandbox_conf_dir
(
)
,
os
.
path
.
basename
(
arg_4
)
)
tar
.
add
(
arg_4
,
arcname
=
arg_5
)
else
:
raise
Exception
(
"%s is not an existing file"
%
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3):
  '''
  Create a tar file with a given set of files
  '''
  with contextlib.closing(tarfile.open(arg_0, 'w:gz', dereference=True)) as tar:
    for arg_4 in arg_1:
      if os.path.isfile(arg_4):
        tar.add(arg_4, arcname=os.path.basename(arg_4))
      else:
        raise Exception("%s is not an existing file" % arg_4)

    if os.path.isdir(arg_2):
      tar.add(arg_2, arcname=get_heron_sandbox_conf_dir())
    else:
      raise Exception("%s is not an existing directory" % arg_2)

    for arg_4 in arg_3:
      if os.path.isfile(arg_4):
        arg_5 = os.path.join(get_heron_sandbox_conf_dir(), os.path.basename(arg_4))
        tar.add(arg_4, arcname=arg_5)
      else:
        raise Exception("%s is not an existing file" % arg_4)


def Func ( arg_0 ) : arg_1 = arg_0 . queue . get ( block = True ) if hasattr ( arg_0 . queue , 'task_done' ) : arg_0 . queue . task_done ( ) return arg_1

def Func(arg_0):
        """Gets data from queue"""
        arg_1 = arg_0.queue.get(block=True)
        if hasattr(arg_0.queue, 'task_done'):
            arg_0.queue.task_done()
        return arg_1


(command, nindent=0, env=None, fpointer=None, cols=60)

def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
,
arg_3
=
,
arg_4
=
60
)
:
arg_5
.
environ
[
"COLUMNS"
]
=
str
(
arg_4
)
arg_7
=
arg_0
if
arg_2
:
for
arg_8
,
arg_9
in
arg_2
.
items
(
)
:
arg_7
=
arg_7
.
replace
(
"${"
+
arg_8
+
"}"
,
arg_9
)
arg_10
=
arg_7
.
split
(
" "
)
if
(
platform
.
system
(
)
.
lower
(
)
==
"windows"
)
and
(
arg_10
[
0
]
.
endswith
(
".py"
)
)
:
arg_10
=
[
sys
.
executable
]
+
arg_10
arg_11
=
subprocess
.
Popen
(
arg_10
,
arg_12
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
arg_12
=
arg_11
.
communicate
(
)
[
0
]
if
sys
.
hexversion
>=
0x03000000
:
arg_12
=
arg_12
.
decode
(
"utf-8"
)
arg_12
=
arg_12
.
split
(
"\n"
)
arg_13
=
arg_1
*
" "
arg_3
(
"\n"
,
dedent
=
False
)
arg_3
(
"{0}.. code-block:: bash\n"
.
format
(
arg_13
)
,
dedent
=
False
)
arg_3
(
"\n"
,
dedent
=
False
)
arg_3
(
"{0}    $ {1}\n"
.
format
(
arg_13
,
arg_0
)
,
dedent
=
False
)
for
arg_14
in
arg_12
:
if
arg_14
.
strip
(
)
:
arg_3
(
arg_13
+
"    "
+
arg_14
.
replace
(
"\t"
,
"    "
)
+
"\n"
,
dedent
=
False
)
else
:
arg_3
(
"\n"
,
dedent
=
False
)
arg_3
(
"\n"
,
dedent
=
False
)

def Func(arg_0, arg_1=0, arg_2=None, arg_3=None, arg_4=60):
    """
    Print STDOUT resulting from a Bash shell command formatted in reStructuredText.

    :param command: Bash shell command
    :type  command: string

    :param nindent: Indentation level
    :type  nindent: integer

    :param env: Environment variable replacement dictionary. The Bash
                command is pre-processed and any environment variable
                represented in the full notation (:bash:`${...}`) is replaced.
                The dictionary key is the environment variable name and the
                dictionary value is the replacement value. For example, if
                **command** is :code:`'${PYTHON_CMD} -m "x=5"'` and **env**
                is :code:`{'PYTHON_CMD':'python3'}` the actual command issued
                is :code:`'python3 -m "x=5"'`
    :type  env: dictionary

    :param fpointer: Output function pointer. Normally is :code:`cog.out` but
                     :code:`print` or other functions can be used for
                     debugging
    :type  fpointer: function object

    :param cols: Number of columns of output
    :type  cols: integer
    """
    # pylint: disable=R0204
    # Set argparse width so that output does not need horizontal scroll
    # bar in narrow windows or displays
    arg_5.environ["COLUMNS"] = str(arg_4)
    arg_7 = arg_0
    if arg_2:
        for arg_8, arg_9 in arg_2.items():
            arg_7 = arg_7.replace("${" + arg_8 + "}", arg_9)
    arg_10 = arg_7.split(" ")
    # Add Python interpreter executable for Python scripts on Windows since
    # the shebang does not work
    if (platform.system().lower() == "windows") and (arg_10[0].endswith(".py")):
        arg_10 = [sys.executable] + arg_10
    arg_11 = subprocess.Popen(arg_10, arg_12=subprocess.PIPE, stderr=subprocess.STDOUT)
    arg_12 = arg_11.communicate()[0]
    if sys.hexversion >= 0x03000000:
        arg_12 = arg_12.decode("utf-8")
    arg_12 = arg_12.split("\n")
    arg_13 = arg_1 * " "
    arg_3("\n", dedent=False)
    arg_3("{0}.. code-block:: bash\n".format(arg_13), dedent=False)
    arg_3("\n", dedent=False)
    arg_3("{0}    $ {1}\n".format(arg_13, arg_0), dedent=False)
    for arg_14 in arg_12:
        if arg_14.strip():
            arg_3(arg_13 + "    " + arg_14.replace("\t", "    ") + "\n", dedent=False)
        else:
            arg_3("\n", dedent=False)
    arg_3("\n", dedent=False)

Print STDOUT resulting from a Bash shell command formatted in reStructuredText .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = re . findall ( arg_0 . re [ "link" ] , arg_1 ) for arg_4 in arg_3 : if arg_4 . find ( "{" ) >= 0 : arg_4 = re . sub ( "\{{1,3}[0-9]{0,2}\|" , "" , arg_4 ) arg_4 = arg_4 . replace ( "{" , "" ) arg_4 = arg_4 . replace ( "}" , "" ) arg_4 = arg_4 . split ( "|" ) arg_4 [ 0 ] = arg_4 [ 0 ] . split ( "#" ) arg_5 = arg_4 [ 0 ] [ 0 ] . strip ( ) if not arg_5 in arg_2 : arg_2 . append ( arg_5 ) arg_2 . sort ( ) return arg_2

def Func(arg_0, arg_1):

        """ Returns a list of internal Wikipedia links in the markup.

        # A Wikipedia link looks like:
        # [[List of operating systems#Embedded | List of embedded operating systems]]
        # It does not contain a colon, this indicates images, users, languages, etc.

        The return value is a list containing the first part of the link,
        without the anchor.

        """

        arg_2 = []
        arg_3 = re.findall(arg_0.re["link"], arg_1)
        for arg_4 in arg_3:
            # We don't like [[{{{1|Universe (disambiguation)}}}]]
            if arg_4.find("{") >= 0:
                arg_4 = re.sub("\{{1,3}[0-9]{0,2}\|", "", arg_4)
                arg_4 = arg_4.replace("{", "")
                arg_4 = arg_4.replace("}", "")
            arg_4 = arg_4.split("|")
            arg_4[0] = arg_4[0].split("#")
            arg_5 = arg_4[0][0].strip()
            #anchor = u""
            #display = u""
            #if len(link[0]) > 1:
            #    anchor = link[0][1].strip()
            #if len(link) > 1:
            #    display = link[1].strip()
            if not arg_5 in arg_2:
                arg_2.append(arg_5)
                #links[page] = WikipediaLink(page, anchor, display)

        arg_2.sort()
        return arg_2

Returns a list of internal Wikipedia links in the markup .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 is None and arg_2 is None : return True elif arg_1 is None or arg_2 is None : return False arg_3 = iter ( arg_1 ) arg_4 = iter ( arg_2 ) arg_5 = _get_stm_with_branches ( arg_3 ) arg_6 = _get_stm_with_branches ( arg_4 ) while arg_5 is not None or arg_6 is not None : if arg_5 is None or arg_6 is None or not arg_5 . _is_mergable ( arg_6 ) : return False arg_5 = _get_stm_with_branches ( arg_3 ) arg_6 = _get_stm_with_branches ( arg_4 ) return True

def Func(arg_0, arg_1, arg_2):
        """
        Walk statements and compare if they can be merged into one statement list
        """
        if arg_1 is None and arg_2 is None:
            return True

        elif arg_1 is None or arg_2 is None:
            return False

        arg_3 = iter(arg_1)
        arg_4 = iter(arg_2)

        arg_5 = _get_stm_with_branches(arg_3)
        arg_6 = _get_stm_with_branches(arg_4)
        while arg_5 is not None or arg_6 is not None:
            if arg_5 is None or arg_6 is None or not arg_5._is_mergable(arg_6):
                return False

            arg_5 = _get_stm_with_branches(arg_3)
            arg_6 = _get_stm_with_branches(arg_4)

        # lists are empty
        return True


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_1
.
check_if_exists
(
)
if
arg_1
.
satisfied_by
:
arg_3
=
'satisfied (use --upgrade to upgrade)'
if
arg_0
.
upgrade
:
arg_4
=
False
if
not
(
arg_0
.
force_reinstall
or
arg_1
.
link
)
:
try
:
arg_2
.
find_requirement
(
arg_1
,
arg_0
.
upgrade
)
except
BestVersionAlreadyInstalled
:
arg_3
=
'up-to-date'
arg_4
=
True
except
DistributionNotFound
:
pass
if
not
arg_4
:
if
not
(
arg_0
.
use_user_site
and
not
dist_in_usersite
(
arg_1
.
satisfied_by
)
)
:
arg_1
.
conflicts_with
=
arg_1
.
satisfied_by
arg_1
.
satisfied_by
=
return
arg_3
else
:
return

def Func(arg_0, arg_1, arg_2):
        """Check if req_to_install should be skipped.

        This will check if the req is installed, and whether we should upgrade
        or reinstall it, taking into account all the relevant user options.

        After calling this req_to_install will only have satisfied_by set to
        None if the req_to_install is to be upgraded/reinstalled etc. Any
        other value will be a dist recording the current thing installed that
        satisfies the requirement.

        Note that for vcs urls and the like we can't assess skipping in this
        routine - we simply identify that we need to pull the thing down,
        then later on it is pulled down and introspected to assess upgrade/
        reinstalls etc.

        :return: A text reason for why it was skipped, or None.
        """
        # Check whether to upgrade/reinstall this req or not.
        arg_1.check_if_exists()
        if arg_1.satisfied_by:
            arg_3 = 'satisfied (use --upgrade to upgrade)'
            if arg_0.upgrade:
                arg_4 = False
                # For link based requirements we have to pull the
                # tree down and inspect to assess the version #, so
                # its handled way down.
                if not (arg_0.force_reinstall or arg_1.link):
                    try:
                        arg_2.find_requirement(arg_1, arg_0.upgrade)
                    except BestVersionAlreadyInstalled:
                        arg_3 = 'up-to-date'
                        arg_4 = True
                    except DistributionNotFound:
                        # No distribution found, so we squash the
                        # error - it will be raised later when we
                        # re-try later to do the install.
                        # Why don't we just raise here?
                        pass

                if not arg_4:
                    # don't uninstall conflict if user install and
                    # conflict is not user install
                    if not (arg_0.use_user_site and not
                            dist_in_usersite(arg_1.satisfied_by)):
                        arg_1.conflicts_with = \
                            arg_1.satisfied_by
                    arg_1.satisfied_by = None
            return arg_3
        else:
            return None

Check if req_to_install should be skipped .


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

def Func(arg_0, arg_1):
        """
        Resumes 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().resume(name=arg_1).execute(num_retries=arg_0.num_retries)

Resumes an transfer operation in Google Storage Transfer Service .


(self, maximum_items=None, storage_status_mask=None,
               object_group_member=None, attributes=None)

def Func(arg_0, arg_1=None, arg_2=None,
               arg_3=None, arg_4=None):
        """
        Search for managed objects, depending on the attributes specified in
        the request.

        Args:
            maximum_items (integer): Maximum number of object identifiers the
                server MAY return.
            storage_status_mask (integer): A bit mask that indicates whether
                on-line or archived objects are to be searched.
            object_group_member (ObjectGroupMember): An enumeration that
                indicates the object group member type.
            attributes (list): Attributes the are REQUIRED to match those in a
                candidate object.

        Returns:
            list: The Unique Identifiers of the Funcd objects

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input arguments are invalid
        """
        # Check inputs
        if arg_1 is not None:
            if not isinstance(arg_1, six.integer_types):
                raise TypeError("maximum_items must be an integer")
        if arg_2 is not None:
            if not isinstance(arg_2, six.integer_types):
                raise TypeError("storage_status_mask must be an integer")
        if arg_3 is not None:
            if not isinstance(arg_3, enums.ObjectGroupMember):
                raise TypeError(
                    "object_group_member must be a ObjectGroupMember"
                    "enumeration")
        if arg_4 is not None:
            if not isinstance(arg_4, list) or \
                all(isinstance(arg_5, cobjects.Attribute)
                    for arg_5 in arg_4) is False:
                raise TypeError(
                    "attributes must be a list of attributes")

        # Search for managed objects and handle the results
        arg_6 = arg_0.proxy.Func(
                    arg_1, arg_2,
                    arg_3, arg_4)

        arg_7 = arg_6.result_status.value
        if arg_7 == enums.ResultStatus.SUCCESS:
            return arg_6.uuids
        else:
            arg_8 = arg_6.result_reason.value
            arg_9 = arg_6.result_message.value
            raise exceptions.KmipOperationFailure(arg_7, arg_8, arg_9)

Search for managed objects, depending on the attributes specified in
        the request.

        Args:
            maximum_items (integer): Maximum number of object identifiers the
                server MAY return.
            storage_status_mask (integer): A bit mask that indicates whether
                on-line or archived objects are to be searched.
            object_group_member (ObjectGroupMember): An enumeration that
                indicates the object group member type.
            attributes (list): Attributes the are REQUIRED to match those in a
                candidate object.

        Returns:
            list: The Unique Identifiers of the located objects

        Raises:
            ClientConnectionNotOpen: if the client connection is unusable
            KmipOperationFailure: if the operation result is a failure
            TypeError: if the input arguments are invalid

Search for managed objects depending on the attributes specified in the request .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { "invoice" : arg_1 , } send_Func ( [ arg_1 . user . Func ] , arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2):
        ''' Sends out an e-mail notifying the user about something to do
        with that invoice. '''

        arg_3 = {
            "invoice": arg_1,
        }

        send_Func([arg_1.user.Func], arg_2, arg_3=arg_3)

Sends out an e - mail notifying the user about something to do with that invoice .


def Func ( arg_0 ) : arg_1 = arg_0 . descendents_root ( ) try : arg_1 . remove ( arg_0 . graph . root ) except ValueError : pass arg_2 = [ n . data for n in arg_1 ] arg_2 . append ( arg_0 . data ) for arg_3 in arg_1 : arg_3 . delete ( ) for arg_4 in arg_0 . parents . all ( ) : arg_4 . children . remove ( arg_0 ) arg_0 . delete ( ) return arg_2

def Func(arg_0):
        """Removes the node and all descendents without looping back past the
        root.  Note this does not remove the associated data objects.

        :returns:
            list of :class:`BaseDataNode` subclassers associated with the
            removed ``Node`` objects.
        """
        arg_1 = arg_0.descendents_root()
        try:
            arg_1.remove(arg_0.graph.root)
        except ValueError:
            # root wasn't in the target list, no problem
            pass

        arg_2 = [n.data for n in arg_1]
        arg_2.append(arg_0.data)
        for arg_3 in arg_1:
            arg_3.delete()

        for arg_4 in arg_0.parents.all():
            arg_4.children.remove(arg_0)

        arg_0.delete()
        return arg_2

Removes the node and all descendents without looping back past the root . Note this does not remove the associated data objects .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
LOG
.
info
(
'Func %s for tenant %s'
%
(
arg_1
,
arg_0
.
tenant_id
)
)
arg_3
=
{
'address_type'
:
ip_types
.
SCALING
,
'_deallocated'
:
False
}
arg_4
=
db_api
.
floating_ip_find
(
arg_0
,
arg_1
=
arg_1
,
scope
=
db_api
.
ONE
,
**
arg_3
)
if
not
arg_4
:
raise
q_exc
.
ScalingIpNotFound
(
arg_1
=
arg_1
)
return
v
.
_make_scaling_ip_dict
(
arg_4
)

def Func(arg_0, arg_1, arg_2=None):
    """Retrieve a scaling IP.

    :param context: neutron api request context.
    :param id: The UUID of the scaling IP.
    :param fields: a list of strings that are valid keys in a
        scaling IP dictionary as listed in the RESOURCE_ATTRIBUTE_MAP
        object in neutron/api/v2/attributes.py. Only these fields
        will be returned.

    :returns: Dictionary containing details for the scaling IP.  If values
        are declared in the fields parameter, then only those keys will be
        present.
    """
    LOG.info('Func %s for tenant %s' % (arg_1, arg_0.tenant_id))
    arg_3 = {'address_type': ip_types.SCALING, '_deallocated': False}
    arg_4 = db_api.floating_ip_find(arg_0, arg_1=arg_1, scope=db_api.ONE,
                                         **arg_3)
    if not arg_4:
        raise q_exc.ScalingIpNotFound(arg_1=arg_1)
    return v._make_scaling_ip_dict(arg_4)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"$\\left.|%s\\right\\rangle$"
if
arg_1
==
"original"
:
arg_0
.
xlabel
=
[
'$x$'
,
''
]
arg_0
.
ylabel
=
[
'$y$'
,
''
]
arg_0
.
zlabel
=
[
'$\\left|0\\right>$'
,
'$\\left|1\\right>$'
]
elif
arg_1
==
"xyz"
:
arg_0
.
xlabel
=
[
'$x$'
,
''
]
arg_0
.
ylabel
=
[
'$y$'
,
''
]
arg_0
.
zlabel
=
[
'$z$'
,
''
]
elif
arg_1
==
"sx sy sz"
:
arg_0
.
xlabel
=
[
'$s_x$'
,
''
]
arg_0
.
ylabel
=
[
'$s_y$'
,
''
]
arg_0
.
zlabel
=
[
'$s_z$'
,
''
]
elif
arg_1
==
"01"
:
arg_0
.
xlabel
=
[
''
,
''
]
arg_0
.
ylabel
=
[
''
,
''
]
arg_0
.
zlabel
=
[
'$\\left|0\\right>$'
,
'$\\left|1\\right>$'
]
elif
arg_1
==
"polarization jones"
:
arg_0
.
xlabel
=
[
arg_2
%
"\\nearrow\\hspace{-1.46}\\swarrow"
,
arg_2
%
"\\nwarrow\\hspace{-1.46}\\searrow"
]
arg_0
.
ylabel
=
[
arg_2
%
"\\circlearrowleft"
,
arg_2
%
"\\circlearrowright"
]
arg_0
.
zlabel
=
[
arg_2
%
"\\leftrightarrow"
,
arg_2
%
"\\updownarrow"
]
elif
arg_1
==
"polarization jones letters"
:
arg_0
.
xlabel
=
[
arg_2
%
"D"
,
arg_2
%
"A"
]
arg_0
.
ylabel
=
[
arg_2
%
"L"
,
arg_2
%
"R"
]
arg_0
.
zlabel
=
[
arg_2
%
"H"
,
arg_2
%
"V"
]
elif
arg_1
==
"polarization stokes"
:
arg_0
.
ylabel
=
[
"$\\nearrow\\hspace{-1.46}\\swarrow$"
,
"$\\nwarrow\\hspace{-1.46}\\searrow$"
]
arg_0
.
zlabel
=
[
"$\\circlearrowleft$"
,
"$\\circlearrowright$"
]
arg_0
.
xlabel
=
[
"$\\leftrightarrow$"
,
"$\\updownarrow$"
]
else
:
raise
Exception
(
"No such convention."
)

def Func(arg_0, arg_1):
        """Set x, y and z labels according to one of conventions.

        Args:
            convention (str):
                One of the following:
                    - "original"
                    - "xyz"
                    - "sx sy sz"
                    - "01"
                    - "polarization jones"
                    - "polarization jones letters"
                    see also: http://en.wikipedia.org/wiki/Jones_calculus
                    - "polarization stokes"
                    see also: http://en.wikipedia.org/wiki/Stokes_parameters
        Raises:
            Exception: If convention is not valid.
        """
        arg_2 = "$\\left.|%s\\right\\rangle$"
        # \left.| is on purpose, so that every ket has the same size

        if arg_1 == "original":
            arg_0.xlabel = ['$x$', '']
            arg_0.ylabel = ['$y$', '']
            arg_0.zlabel = ['$\\left|0\\right>$', '$\\left|1\\right>$']
        elif arg_1 == "xyz":
            arg_0.xlabel = ['$x$', '']
            arg_0.ylabel = ['$y$', '']
            arg_0.zlabel = ['$z$', '']
        elif arg_1 == "sx sy sz":
            arg_0.xlabel = ['$s_x$', '']
            arg_0.ylabel = ['$s_y$', '']
            arg_0.zlabel = ['$s_z$', '']
        elif arg_1 == "01":
            arg_0.xlabel = ['', '']
            arg_0.ylabel = ['', '']
            arg_0.zlabel = ['$\\left|0\\right>$', '$\\left|1\\right>$']
        elif arg_1 == "polarization jones":
            arg_0.xlabel = [arg_2 % "\\nearrow\\hspace{-1.46}\\swarrow",
                           arg_2 % "\\nwarrow\\hspace{-1.46}\\searrow"]
            arg_0.ylabel = [arg_2 % "\\circlearrowleft", arg_2 %
                           "\\circlearrowright"]
            arg_0.zlabel = [arg_2 % "\\leftrightarrow", arg_2 % "\\updownarrow"]
        elif arg_1 == "polarization jones letters":
            arg_0.xlabel = [arg_2 % "D", arg_2 % "A"]
            arg_0.ylabel = [arg_2 % "L", arg_2 % "R"]
            arg_0.zlabel = [arg_2 % "H", arg_2 % "V"]
        elif arg_1 == "polarization stokes":
            arg_0.ylabel = ["$\\nearrow\\hspace{-1.46}\\swarrow$",
                           "$\\nwarrow\\hspace{-1.46}\\searrow$"]
            arg_0.zlabel = ["$\\circlearrowleft$", "$\\circlearrowright$"]
            arg_0.xlabel = ["$\\leftrightarrow$", "$\\updownarrow$"]
        else:
            raise Exception("No such convention.")

Set x y and z labels according to one of conventions .


def Func ( ) : arg_0 = os . path . join ( FLAGS . data_dir , DATA_SPRITES_DIR ) if not tf . io . gfile . exists ( arg_0 ) : if not tf . io . gfile . exists ( FLAGS . data_dir ) : tf . io . gfile . makedirs ( FLAGS . data_dir ) arg_1 = "{}.zip" . format ( arg_0 ) urllib . request . urlretrieve ( DATA_SPRITES_URL , arg_1 ) with zipfile . ZipFile ( arg_1 , "r" ) as zip_file : zip_file . extractall ( FLAGS . data_dir ) tf . io . gfile . remove ( arg_1 ) return arg_0

def Func():
  """Downloads the sprites data and returns the saved filepath."""
  arg_0 = os.path.join(FLAGS.data_dir, DATA_SPRITES_DIR)
  if not tf.io.gfile.exists(arg_0):
    if not tf.io.gfile.exists(FLAGS.data_dir):
      tf.io.gfile.makedirs(FLAGS.data_dir)
    arg_1 = "{}.zip".format(arg_0)
    urllib.request.urlretrieve(DATA_SPRITES_URL, arg_1)
    with zipfile.ZipFile(arg_1, "r") as zip_file:
      zip_file.extractall(FLAGS.data_dir)
    tf.io.gfile.remove(arg_1)
  return arg_0

Downloads the sprites data and returns the saved filepath .


(value_and_gradients_function,
                              position,
                              direction)

def Func(arg_0,
                              arg_1,
                              arg_2):
  """Restricts a function in n-dimensions to a given direction.

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

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

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

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

  Returns:
    restricted_value_and_gradients_func: A callable accepting a tensor of shape
      broadcastable to `[...]` and same dtype as `position` and returning a
      namedtuple of `Tensors`. The input tensor is the parameter along the
      direction labelled `t` above. The return value contains fields:
        x: A real `Tensor` of shape `[...]`. The input value `t` where the line
          function was evaluated, after any necessary broadcasting.
        f: A real `Tensor` of shape `[...]` containing the value of the
          function at the point `position + t * direction`.
        df: A real `Tensor` of shape `[...]` containing the derivative at
          `position + t * direction`.
        full_gradient: A real `Tensor` of shape `[..., n]`, the full gradient
          of the original `value_and_gradients_function`.
  """
  def _restricted_func(arg_3):
    arg_3 = _broadcast(arg_3, arg_1)
    arg_4 = arg_1 + tf.expand_dims(arg_3, axis=-1) * arg_2
    arg_5, arg_6 = arg_0(arg_4)
    return ValueAndGradient(
        x=arg_3,
        f=arg_5,
        df=tf.reduce_sum(input_tensor=arg_6 * arg_2, axis=-1),
        full_gradient=arg_6)

  return _restricted_func

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


def Func ( arg_0 , arg_1 ) : arg_2 = json . loads ( arg_1 ) print ( "{0},{1},{2},{3},{4}" . format ( 'timestamp' , 'metric' , 'aggregate' , 'source' , 'value' ) ) arg_3 = arg_0 . _metric_name for arg_4 in arg_2 [ 'result' ] [ 'aggregates' ] [ 'key' ] : arg_5 = arg_0 . _format_timestamp ( arg_4 [ 0 ] [ 0 ] ) for arg_6 in arg_4 [ 1 ] : print ( '{0},"{1}","{2}","{3}",{4}' . format ( arg_5 , arg_3 , arg_0 . aggregate , arg_6 [ 0 ] , arg_6 [ 1 ] ) )

def Func(arg_0, arg_1):
        """
        Output results in CSV format
        """
        arg_2 = json.loads(arg_1)
        # Print CSV header
        print("{0},{1},{2},{3},{4}".format('timestamp', 'metric', 'aggregate', 'source', 'value'))
        arg_3 = arg_0._metric_name
        # Loop through the aggregates one row per timestamp, and 1 or more source/value pairs
        for arg_4 in arg_2['result']['aggregates']['key']:
            arg_5 = arg_0._format_timestamp(arg_4[0][0])
            # timestamp = string.strip(timestamp, ' ')
            # timestamp = string.strip(timestamp, "'")
            for arg_6 in arg_4[1]:
                print('{0},"{1}","{2}","{3}",{4}'.format(arg_5, arg_3, arg_0.aggregate, arg_6[0], arg_6[1]))


def Func ( arg_0 ) : arg_0 = arg_0 . replace ( u'\u05BE' , '-' ) arg_0 = arg_0 . replace ( u'\u1806' , '-' ) arg_0 = arg_0 . replace ( u'\u2E3A' , '-' ) arg_0 = arg_0 . replace ( u'\u2E3B' , '-' ) arg_0 = unidecode ( arg_0 ) return re . sub ( r'--+' , '-' , arg_0 )

def Func(arg_0):
    """Fix bad Unicode special dashes in string."""
    arg_0 = arg_0.replace(u'\u05BE', '-')
    arg_0 = arg_0.replace(u'\u1806', '-')
    arg_0 = arg_0.replace(u'\u2E3A', '-')
    arg_0 = arg_0.replace(u'\u2E3B', '-')
    arg_0 = unidecode(arg_0)
    return re.sub(r'--+', '-', arg_0)

Fix bad Unicode special dashes in string .


def Func(arg_0, arg_1):
        '''
        Decode a SUBSCRIBE control packet.
        '''
        arg_0.encoded = arg_1
        arg_3 = 1
        while arg_1[arg_3] & 0x80:
            arg_3 += 1
        arg_4 = arg_1[arg_3+1:]
        arg_0.msgId   = Func16Int(arg_4[0:2])
        arg_0.topics = []
        arg_4 = arg_4[2:]
        while len(arg_4):
            arg_7, arg_4 = FuncString(arg_4)
            arg_8 =  int (arg_4[0]) & 0x03
            arg_0.topics.append((arg_7,arg_8))
            arg_4 = arg_4[1:]


return self.protocol.execute('createIngestPoint',
                                     privateStreamName=privateStreamName,
                                     publicStreamName=publicStreamName)

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . protocol . execute ( 'createIngestPoint' , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Creates an RTMP ingest point, which mandates that streams pushed into
        the EMS have a target stream name which matches one Ingest Point
        privateStreamName.

        :param privateStreamName: The name that RTMP Target Stream Names must
            match.
        :type privateStreamName: str

        :param publicStreamName: The name that is used to access the stream
            pushed to the privateStreamName. The publicStreamName becomes the
            streams localStreamName.
        :type publicStreamName: str

        :link: http://docs.evostream.com/ems_api_definition/createingestpoint
        """
        return arg_0.protocol.execute('createIngestPoint',
                                     arg_1=arg_1,
                                     arg_2=arg_2)

Creates an RTMP ingest point which mandates that streams pushed into the EMS have a target stream name which matches one Ingest Point privateStreamName .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _coroutine_queue . put ( arg_0 . _client . disconnect ( ) ) arg_3 = Exception ( arg_2 . get ( 'message' ) ) arg_0 . _exception = arg_2 . get ( 'exception' , arg_3 )

def Func(arg_0, arg_1, arg_2):
        """Handle exceptions from the asyncio loop."""
        # Start a graceful shutdown.
        arg_0._coroutine_queue.put(arg_0._client.disconnect())

        # Store the exception to be re-raised later. If the context doesn't
        # contain an exception, create one containing the error message.
        arg_3 = Exception(arg_2.get('message'))
        arg_0._exception = arg_2.get('exception', arg_3)

Handle exceptions from the asyncio loop .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . material . elements arg_2 = numpy . zeros ( len ( arg_1 ) ) for arg_3 in arg_0 . material . compounds : arg_2 += arg_0 . get_compound_mfr ( arg_3 ) * stoich . element_mass_fractions ( arg_3 , arg_1 ) return arg_2

def Func(arg_0, arg_1=None):
        """
        Determine the mass flow rates of elements in the stream.

        :returns: Array of element mass flow rates. [kg/h]
        """

        if arg_1 is None:
            arg_1 = arg_0.material.elements
        arg_2 = numpy.zeros(len(arg_1))
        for arg_3 in arg_0.material.compounds:
            arg_2 += arg_0.get_compound_mfr(arg_3) *\
                stoich.element_mass_fractions(arg_3, arg_1)
        return arg_2

Determine the mass flow rates of elements in the stream .


def Func ( arg_0 , arg_1 ) : arg_2 = QtWidgets . QMenu ( 'Styles' , arg_0 . menuEdit ) arg_3 = QtWidgets . QActionGroup ( arg_0 ) arg_0 . styles_group = arg_3 arg_5 = arg_1 . syntax_highlighter . color_scheme . name arg_3 . triggered . connect ( arg_0 . on_style_changed ) for arg_6 in sorted ( PYGMENTS_STYLES ) : arg_7 = QtWidgets . QAction ( arg_2 ) arg_7 . setText ( arg_6 ) arg_7 . setCheckable ( True ) if arg_6 == arg_5 : arg_7 . setChecked ( True ) arg_3 . addAction ( arg_7 ) arg_2 . addAction ( arg_7 ) arg_0 . menuEdit . addMenu ( arg_2 )

def Func(arg_0, arg_1):
        """ setup the style menu for an editor tab """
        arg_2 = QtWidgets.QMenu('Styles', arg_0.menuEdit)
        arg_3 = QtWidgets.QActionGroup(arg_0)
        arg_0.styles_group = arg_3
        arg_5 = arg_1.syntax_highlighter.color_scheme.name
        arg_3.triggered.connect(arg_0.on_style_changed)
        for arg_6 in sorted(PYGMENTS_STYLES):
            arg_7 = QtWidgets.QAction(arg_2)
            arg_7.setText(arg_6)
            arg_7.setCheckable(True)
            if arg_6 == arg_5:
                arg_7.setChecked(True)
            arg_3.addAction(arg_7)
            arg_2.addAction(arg_7)
        arg_0.menuEdit.addMenu(arg_2)


(self, node, traversable=lambda node, edge: True)

return proximity.depth_first_search(self,
            visit=lambda n: node == n,
            traversable=traversable
            )

def Func ( arg_0 , arg_1 , arg_2 = lambda arg_1 , arg_3 : True ) : if isinstance ( arg_1 , str ) : arg_1 = arg_0 . graph [ arg_1 ] for arg_4 in arg_0 . graph . nodes : arg_4 . _visited = False return proximity . depth_first_search ( arg_0 , visit = lambda arg_4 : arg_1 == arg_4 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=lambda arg_1, arg_3: True):

        """ Returns True if given node can be reached over traversable edges.
        To enforce edge direction, use a node==edge.node1 traversable.
        """

        if isinstance(arg_1, str):
            arg_1 = arg_0.graph[arg_1]
        for arg_4 in arg_0.graph.nodes:
            arg_4._visited = False
        return proximity.depth_first_search(arg_0,
            visit=lambda arg_4: arg_1 == arg_4,
            arg_2=arg_2
            )

Returns True if given node can be reached over traversable edges . To enforce edge direction use a node == edge . node1 traversable .


return (
        stmt
        and isinstance(stmt[0], astroid.ImportFrom)
        and stmt[0].modname == "__future__"
    )

def Func ( arg_0 : arg_1 . node_classes . NodeNG ) -> bool : arg_4 = "annotations" arg_5 = arg_0 . root ( ) arg_6 = arg_5 . locals . get ( arg_4 ) return ( arg_6 and isinstance ( arg_6 [ 0 ] , arg_1 . ImportFrom ) and arg_6 [ 0 ] . modname == "__future__" )

def Func(arg_0: arg_1.node_classes.NodeNG) -> bool:
    """Check if the postponed evaluation of annotations is enabled"""
    arg_4 = "annotations"
    arg_5 = arg_0.root()
    arg_6 = arg_5.locals.get(arg_4)
    return (
        arg_6
        and isinstance(arg_6[0], arg_1.ImportFrom)
        and arg_6[0].modname == "__future__"
    )


def Func ( arg_0 , arg_1 = None ) : arg_2 = _get_storage_service ( arg_1 ) arg_3 , arg_4 = arg_0 [ len ( 'gs://' ) : ] . split ( '/' , 1 ) arg_5 = arg_2 . objects ( ) . list ( bucket = arg_3 , arg_4 = arg_4 , maxResults = 1 ) arg_6 = arg_5 . execute ( ) return arg_6 . get ( 'items' , None )

def Func(arg_0, arg_1=None):
  """Check whether there is a GCS object whose name starts with the prefix.

  Since GCS doesn't actually have folders, this is how we check instead.

  Args:
    gcs_prefix: The path; should start with 'gs://'.
    credentials: Optional credential to be used to load the file from gcs.

  Returns:
    True if the prefix matches at least one object in GCS.

  Raises:
    errors.HttpError: if it can't talk to the server
  """
  arg_2 = _get_storage_service(arg_1)

  arg_3, arg_4 = arg_0[len('gs://'):].split('/', 1)
  # documentation in
  # https://cloud.google.com/storage/docs/json_api/v1/objects/list
  arg_5 = arg_2.objects().list(
      bucket=arg_3, arg_4=arg_4, maxResults=1)
  arg_6 = arg_5.execute()
  return arg_6.get('items', None)

Check whether there is a GCS object whose name starts with the prefix .


def Func ( arg_0 ) : try : arg_1 , arg_0 . request . view_args = arg_0 . url_adapter . match ( return_rule = True ) arg_0 . request . url_rule = arg_1 except HTTPException as e : arg_0 . request . routing_exception = e

def Func(arg_0):
        """Can be overridden by a subclass to hook into the matching
        of the request.
        """
        try:
            arg_1, arg_0.request.view_args = \
                arg_0.url_adapter.match(return_rule=True)
            arg_0.request.url_rule = arg_1
        except HTTPException as e:
            arg_0.request.routing_exception = e

Can be overridden by a subclass to hook into the matching of the request .


def Func(arg_0, arg_1):
        """
        Pokes for a mail attachment on the mail server.

        :param context: The context that is being provided when poking.
        :type context: dict
        :return: True if attachment with the given name is present and False if not.
        :rtype: bool
        """
        arg_0.log.info('Poking for %s', arg_0.attachment_name)

        with ImapHook(imap_conn_id=arg_0.conn_id) as imap_hook:
            return imap_hook.has_mail_attachment(
                name=arg_0.attachment_name,
                mail_folder=arg_0.mail_folder,
                check_regex=arg_0.check_regex
            )

Pokes for a mail attachment on the mail server .


def Func ( arg_0 ) : arg_1 = set ( arg_4 . path ) site . addsitedir ( arg_0 . site_path ) site . addsitedir ( arg_0 . bin_path ) arg_2 = set ( arg_4 . path ) - arg_1 for arg_3 in arg_2 : arg_4 . path . remove ( arg_3 ) arg_4 . path . insert ( 1 , arg_3 ) if not hasattr ( arg_4 , 'real_prefix' ) : arg_4 . real_prefix = arg_4 . prefix arg_4 . prefix = arg_0 . path

def Func(arg_0):
        '''
        Do some serious mangling to the current python environment...
        This is necessary to activate an environment via python.
        '''

        arg_1 = set(arg_4.path)
        site.addsitedir(arg_0.site_path)
        site.addsitedir(arg_0.bin_path)
        arg_2 = set(arg_4.path) - arg_1
        for arg_3 in arg_2:
            arg_4.path.remove(arg_3)
            arg_4.path.insert(1, arg_3)

        if not hasattr(arg_4, 'real_prefix'):
            arg_4.real_prefix = arg_4.prefix

        arg_4.prefix = arg_0.path

Do some serious mangling to the current python environment ... This is necessary to activate an environment via python .


def Func ( arg_0 , arg_1 , arg_2 ) : if type ( arg_1 ) == str : arg_0 . reproduce_asexually ( arg_1 , arg_2 ) else : arg_0 . reproduce_sexually ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Accept either strings or Gods as inputs."""
        if type(arg_1) == str:
            arg_0.reproduce_asexually(arg_1, arg_2)
        else:
            arg_0.reproduce_sexually(arg_1, arg_2)

Accept either strings or Gods as inputs .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_0
.
_apiClient
.
get
(
arg_0
.
_url
,
arg_1
)
if
arg_2
.
status_code
==
200
:
return
arg_2
.
json
(
)
else
:
raise
Exception
(
"HTTP %s %s"
%
(
arg_2
.
status_code
,
arg_2
.
text
)
)

def Func(arg_0, arg_1=None):
        """
        Retrieve bulk devices
        It accepts accepts a list of parameters
        In case of failure it throws Exception
        """
        arg_2 = arg_0._apiClient.get(arg_0._url, arg_1)
        if arg_2.status_code == 200:
            return arg_2.json()
        else:
            raise Exception("HTTP %s %s" % (arg_2.status_code, arg_2.text))


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . columns : arg_3 = arg_1 . filter_by ( ** { prop . key : arg_2 . get ( prop . key ) for prop in arg_0 . related_keys } ) . one ( ) else : arg_3 = arg_1 . get ( [ arg_2 . get ( prop . key ) for prop in arg_0 . related_keys ] ) if arg_3 is None : raise NoResultFound return arg_3

def Func(arg_0, arg_1, arg_2):
        """Retrieve the related object from an existing instance in the DB.

        :param query: A SQLAlchemy `Query <sqlalchemy.orm.query.Query>` object.
        :param value: The serialized value to mapto an existing instance.
        :raises NoResultFound: if there is no matching record.
        """
        if arg_0.columns:
            arg_3 = arg_1.filter_by(
                **{prop.key: arg_2.get(prop.key) for prop in arg_0.related_keys}
            ).one()
        else:
            # Use a faster path if the related key is the primary key.
            arg_3 = arg_1.get([arg_2.get(prop.key) for prop in arg_0.related_keys])
            if arg_3 is None:
                raise NoResultFound
        return arg_3

Retrieve the related object from an existing instance in the DB .


(num, columns, widths, column_colors=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
arg_4
=
'|'
arg_5
=
[
]
for
arg_6
,
arg_7
in
enumerate
(
arg_1
)
:
try
:
arg_8
=
arg_7
[
arg_0
]
arg_9
=
' '
*
(
arg_2
[
arg_6
]
len
(
arg_8
)
)
if
arg_3
is
not
and
arg_3
[
arg_6
]
is
not
:
arg_8
=
arg_3
[
arg_6
]
(
arg_8
)
arg_5
.
append
(
' %s%s '
%
(
arg_8
,
arg_9
)
)
except
IndexError
:
arg_5
.
append
(
' '
*
(
arg_2
[
arg_6
]
+
2
)
)
return
'|%s|'
%
'|'
.
join
(
arg_5
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Render the `num`th row of each column in `columns`.

    :param num: Which row to render.
    :type num: ``int``
    :param columns: The list of columns.
    :type columns: [[``str``]]
    :param widths: The widths of each column.
    :type widths: [``int``]
    :param column_colors: An optional list of coloring functions.
    :type column_colors: [``str`` -> ``str``] or ``NoneType``

    :return: The rendered row.
    :rtype: ``str``
    """
    arg_4 = '|'
    arg_5 = []
    for arg_6, arg_7 in enumerate(arg_1):
        try:
            arg_8 = arg_7[arg_0]
            # We choose the number of spaces before we color the string, so
            # that the coloring codes don't affect the length.
            arg_9 = ' ' * (arg_2[arg_6] - len(arg_8))
            if arg_3 is not None and arg_3[arg_6] is not None:
                arg_8 = arg_3[arg_6](arg_8)
            arg_5.append(' %s%s ' % (arg_8, arg_9))
        except IndexError:
            # If the index is out of range, just print an empty cell.
            arg_5.append(' ' * (arg_2[arg_6] + 2))
    return '|%s|' % '|'.join(arg_5)

Render the num th row of each column in columns .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if isinstance ( arg_2 , Observation ) : arg_0 . append ( ** arg_2 . _asdict ( ) ) else : arg_0 . append ( ** arg_2 )

def Func(arg_0, arg_1):
        '''Add observations from row-major storage.

        This is primarily useful for deserializing sparsely packed data.

        Parameters
        ----------
        records : iterable of dicts or Observations
            Each element of `records` corresponds to one observation.
        '''
        for arg_2 in arg_1:
            if isinstance(arg_2, Observation):
                arg_0.append(**arg_2._asdict())
            else:
                arg_0.append(**arg_2)

Add observations from row - major storage .


def Func ( arg_0 , arg_1 , arg_2 = False ) : with arg_0 . lock : arg_0 . peer_authenticated = True arg_0 . peer = arg_1 if arg_2 : arg_0 . _restart_stream ( ) arg_0 . event ( AuthenticatedEvent ( arg_0 . peer ) )

def Func(arg_0, arg_1, arg_2 = False):
        """Mark the other side of the stream authenticated as `peer`

        :Parameters:
            - `peer`: local JID just authenticated
            - `restart_stream`: `True` when stream should be restarted (needed
              after SASL authentication)
        :Types:
            - `peer`: `JID`
            - `restart_stream`: `bool`
        """
        with arg_0.lock:
            arg_0.peer_authenticated = True
            arg_0.peer = arg_1
            if arg_2:
                arg_0._restart_stream()
        arg_0.event(AuthenticatedEvent(arg_0.peer))

Mark the other side of the stream authenticated as peer


Return nodes from rhs which have ancestors in lhs.

return [node for node in rhs if _search(node)]

def Func ( arg_0 , arg_1 , arg_2 ) : def _search ( arg_3 ) : if arg_3 in arg_1 : return True if not arg_3 . parent : return False return _search ( arg_3 . parent ) return [ arg_3 for arg_3 in arg_2 if _search ( arg_3 ) ]

def Func(arg_0, arg_1, arg_2):
        """Return nodes from rhs which have Func in lhs."""

        def _search(arg_3):
            if arg_3 in arg_1:
                return True
            if not arg_3.parent:
                return False
            return _search(arg_3.parent)

        return [arg_3 for arg_3 in arg_2 if _search(arg_3)]

Return nodes from rhs which have ancestors in lhs .


def Func(arg_0, arg_1=None):
        """ Returns names of features. If features is None, returns all
        features. Otherwise assumes the user is trying to find the order of the
        features.  """
        if arg_1:
            return arg_0.feature_table.get_ordered_names(arg_1)
        else:
            return arg_0.feature_table.feature_names

Returns names of features . If features is None returns all features . Otherwise assumes the user is trying to find the order of the features .


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( arg_1 , arg_2 , * arg_3 , ** arg_4 ) : for arg_5 in chunkiter ( arg_1 , arg_2 ) : yield arg_0 ( arg_5 , * arg_3 , ** arg_4 ) return wrapper

def Func(arg_0):
    """take a function that taks an iterable as the first argument.
    return a wrapper that will break an iterable into chunks using
    chunkiter and run each chunk in function, yielding the value of each
    function call as an iterator.
    """

    @functools.wraps(arg_0)
    def wrapper(arg_1, arg_2, *arg_3, **arg_4):
        for arg_5 in chunkiter(arg_1, arg_2):
            yield arg_0(arg_5, *arg_3, **arg_4)

    return wrapper

take a function that taks an iterable as the first argument . return a wrapper that will break an iterable into chunks using chunkiter and run each chunk in function yielding the value of each function call as an iterator .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : return SegmentationMapOnImage ( arg_0 . arr_0to1 , shape = arg_0 . shape ) else : ia . do_assert ( arg_2 is not None ) ia . do_assert ( min ( arg_1 ) >= 0 ) ia . do_assert ( max ( arg_1 ) < arg_2 ) ia . do_assert ( len ( arg_1 ) == arg_0 . arr_0to1 . shape [ 2 ] ) arg_3 = arg_0 . arr_0to1 arg_4 = np . zeros ( ( arg_3 . shape [ 0 ] , arg_3 . shape [ 1 ] , arg_2 ) , dtype = np . float32 ) for arg_5 , arg_6 in enumerate ( arg_1 ) : arg_4 [ : , : , arg_6 ] = arg_3 [ : , : , arg_5 ] return SegmentationMapOnImage ( arg_4 , shape = arg_0 . shape )

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Convert heatmaps to segmentation map.

        Assumes that each class is represented as a single heatmap channel.

        Parameters
        ----------
        heatmaps : imgaug.HeatmapsOnImage
            Heatmaps to convert.

        class_indices : None or list of int, optional
            List of class indices represented by each heatmap channel. See also the
            secondary output of :func:`imgaug.SegmentationMapOnImage.to_heatmap`.
            If this is provided, it must have the same length as the number of heatmap channels.

        nb_classes : None or int, optional
            Number of classes. Must be provided if class_indices is set.

        Returns
        -------
        imgaug.SegmentationMapOnImage
            Segmentation map derived from heatmaps.

        """
        if arg_1 is None:
            return SegmentationMapOnImage(arg_0.arr_0to1, shape=arg_0.shape)
        else:
            ia.do_assert(arg_2 is not None)
            ia.do_assert(min(arg_1) >= 0)
            ia.do_assert(max(arg_1) < arg_2)
            ia.do_assert(len(arg_1) == arg_0.arr_0to1.shape[2])
            arg_3 = arg_0.arr_0to1
            arg_4 = np.zeros((arg_3.shape[0], arg_3.shape[1], arg_2), dtype=np.float32)
            for arg_5, arg_6 in enumerate(arg_1):
                arg_4[:, :, arg_6] = arg_3[:, :, arg_5]
            return SegmentationMapOnImage(arg_4, shape=arg_0.shape)


def Func(arg_0, arg_1, arg_2=''):
    """Modify the keys in adict to the ones in translations.
    Be careful, this will modify your input dictionary.
    The keys not present in translations will be left intact.

    Parameters
    ----------
    adict: a dictionary

    translations: iterable of 2-tuples
    Each 2-tuple must have the following format:
    (<adict existing key>, <desired key name for the existing key>)

    Returns
    -------
    Translated adict
    """
    for arg_3, arg_4 in arg_1:
        arg_0[arg_4] = arg_0.pop(arg_3, arg_2)
    return arg_0

Modify the keys in adict to the ones in translations . Be careful this will modify your input dictionary . The keys not present in translations will be left intact .


def Func ( arg_0 ) : if arg_0 . joined : arg_1 = MucPresence ( to_jid = arg_0 . room_jid , stanza_type = "unavailable" ) arg_0 . manager . stream . send ( arg_1 )

def Func(arg_0):
        """
        Send a Func request for the room.
        """
        if arg_0.joined:
            arg_1=MucPresence(to_jid=arg_0.room_jid,stanza_type="unavailable")
            arg_0.manager.stream.send(arg_1)


def Func ( arg_0 ) : arg_0 . secrets = read_client_secrets ( ) if arg_0 . secrets is not None : if "registry" in arg_0 . secrets : if "base" in arg_0 . secrets [ 'registry' ] : arg_0 . base = arg_0 . secrets [ 'registry' ] [ 'base' ] arg_0 . _update_base ( )

def Func(arg_0):
        '''update secrets will take a secrets credential file
        either located at .sregistry or the environment variable
        SREGISTRY_CLIENT_SECRETS and update the current client
        secrets as well as the associated API base.
        '''
        arg_0.secrets = read_client_secrets()
        if arg_0.secrets is not None:
            if "registry" in arg_0.secrets:
                if "base" in arg_0.secrets['registry']:
                    arg_0.base = arg_0.secrets['registry']['base']
                    arg_0._update_base()

update secrets will take a secrets credential file either located at . sregistry or the environment variable SREGISTRY_CLIENT_SECRETS and update the current client secrets as well as the associated API base .


def
Func
(
arg_0
)
:
arg_1
=
[
]
def
_fmt_err
(
arg_2
)
:
return
(
Path
(
arg_2
.
filename
)
,
"{}:{} -- {}: {}"
.
format
(
*
(
arg_2
[
1
:
]
)
)
)
arg_3
=
{
}
for
arg_4
in
arg_0
:
if
not
is_valid_identifier
(
arg_4
.
id
)
:
arg_5
=
(
arg_4
.
file
.
parent
,
"{} is not a valid identifier"
.
format
(
arg_4
.
id
)
,
)
logger
.
info
(
"{}: {}"
.
format
(
*
arg_5
)
)
arg_1
.
append
(
arg_5
)
arg_3
.
setdefault
(
type
(
arg_4
)
,
[
]
)
.
append
(
arg_4
)
for
arg_6
in
arg_3
:
arg_7
=
list
(
[
_fmt_err
(
arg_2
)
for
arg_2
in
validate_content
(
*
arg_3
[
arg_6
]
)
]
)
for
arg_5
in
arg_7
:
logger
.
info
(
"{}: {}"
.
format
(
*
arg_5
)
)
arg_1
.
extend
(
arg_7
)
return
arg_1

def Func(arg_0):
    """Validate the given litezip as `struct`.
    Returns a list of validation messages.

    """
    arg_1 = []

    def _fmt_err(arg_2):
        return (Path(arg_2.filename), "{}:{} -- {}: {}".format(*(arg_2[1:])))

    arg_3 = {}
    for arg_4 in arg_0:
        if not is_valid_identifier(arg_4.id):
            arg_5 = (arg_4.file.parent,
                   "{} is not a valid identifier".format(arg_4.id),)
            logger.info("{}: {}".format(*arg_5))
            arg_1.append(arg_5)
        arg_3.setdefault(type(arg_4), []).append(arg_4)

    for arg_6 in arg_3:
        arg_7 = list([_fmt_err(arg_2) for arg_2 in
                             validate_content(*arg_3[arg_6])])
        for arg_5 in arg_7:
            logger.info("{}: {}".format(*arg_5))
        arg_1.extend(arg_7)
    return arg_1

Validate the given litezip as struct . Returns a list of validation messages .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 'km' ) : return GeoValue ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3='km'):
    """
    Indicate that value is a Func region
    """
    return GeoValue(arg_0, arg_1, arg_2, arg_3)


def
Func
(
)
:
with
settings
(
hide
(
'running'
,
'stdout'
)
)
:
arg_0
=
(
run
(
'uname -s'
)
or
''
)
.
strip
(
)
.
lower
(
)
if
arg_0
==
LINUX
:
return
run
(
'lsb_release -r --short'
)
elif
arg_0
==
SUNOS
:
return
run
(
'uname -v'
)

def Func():
    """
    Get the release number of the distribution.

    Example::

        from burlap.system import distrib_id, Func

        if distrib_id() == 'CentOS' and Func() == '6.1':
            print(u"CentOS 6.2 has been released. Please upgrade.")

    """
    with settings(hide('running', 'stdout')):
        arg_0 = (run('uname -s') or '').strip().lower()
        if arg_0 == LINUX:
            return run('lsb_release -r --short')

        elif arg_0 == SUNOS:
            return run('uname -v')

Get the release number of the distribution.

    Example::

        from burlap.system import distrib_id, distrib_release

        if distrib_id() == 'CentOS' and distrib_release() == '6.1':
            print(u"CentOS 6.2 has been released. Please upgrade.")

Get the release number of the distribution .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Add a new note for a specific subscriber.

        The documentation lists only the note request body parameter so it is
        being documented and error-checked as if it were required based on the
        description of the method.

        :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`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "note": string*
        }
        """
        arg_2 = check_subscriber_hash(arg_2)
        arg_0.list_id = arg_1
        arg_0.subscriber_hash = arg_2
        if 'note' not in arg_3:
            raise KeyError('The list member note must have a note')
        arg_4 = arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'members', arg_2, 'notes'), arg_3=arg_3)
        if arg_4 is not None:
            arg_0.note_id = arg_4['id']
        else:
            arg_0.note_id = None
        return arg_4

Add a new note for a specific subscriber .


(self, layers=None, output='vector', in_global_mask=True)

return mask[self.global_mask] if in_global_mask else mask

def Func ( arg_0 , arg_1 = None , arg_2 = 'vector' , arg_3 = True ) : if arg_3 : arg_2 = 'vector' if arg_1 is None : arg_1 = arg_0 . layers . keys ( ) elif not isinstance ( arg_1 , list ) : arg_1 = [ arg_1 ] arg_1 = map ( lambda x : x if isinstance ( x , string_types ) else arg_0 . stack [ x ] , arg_1 ) arg_1 = [ arg_0 . layers [ l ] for l in arg_1 if l in arg_0 . layers ] arg_1 . append ( arg_0 . full ) arg_1 = np . vstack ( arg_1 ) . T . astype ( bool ) arg_4 = arg_1 . all ( axis = 1 ) arg_4 = arg_0 . get_image ( arg_4 , arg_2 ) return arg_4 [ arg_0 . global_mask ] if arg_3 else arg_4

def Func(arg_0, arg_1=None, arg_2='vector', arg_3=True):
        """ Set the current mask by taking the conjunction of all specified
        layers.

        Args:
            layers: Which layers to include. See documentation for add() for
                format.
            include_global_mask: Whether or not to automatically include the
                global mask (i.e., self.volume) in the conjunction.
        """
        if arg_3:
            arg_2 = 'vector'

        if arg_1 is None:
            arg_1 = arg_0.layers.keys()
        elif not isinstance(arg_1, list):
            arg_1 = [arg_1]

        arg_1 = map(lambda x: x if isinstance(x, string_types)
                     else arg_0.stack[x], arg_1)
        arg_1 = [arg_0.layers[l] for l in arg_1 if l in arg_0.layers]

        # Always include the original volume
        arg_1.append(arg_0.full)
        arg_1 = np.vstack(arg_1).T.astype(bool)
        arg_4 = arg_1.all(axis=1)
        arg_4 = arg_0.get_image(arg_4, arg_2)
        return arg_4[arg_0.global_mask] if arg_3 else arg_4

Set the current mask by taking the conjunction of all specified layers .


def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( quill_app , arg_1 ) arg_3 = template . loader . get_template ( arg_2 [ 'toolbar_template' ] ) return arg_3 . render ( arg_0 )

def Func(arg_0, arg_1):
    """Render the toolbar for the given config."""
    arg_2 = getattr(quill_app, arg_1)
    arg_3 = template.loader.get_template(arg_2['toolbar_template'])
    return arg_3.render(arg_0)

Render the toolbar for the given config .


def Func ( arg_0 , arg_1 = False , arg_2 = False ) : from imgaug . augmentables . heatmaps import HeatmapsOnImage if not arg_1 : return HeatmapsOnImage . from_0to1 ( arg_0 . arr , arg_0 . shape , min_value = 0.0 , max_value = 1.0 ) else : arg_3 = np . sum ( arg_0 . arr , axis = ( 0 , 1 ) ) > 0 + 1e-4 if np . sum ( arg_3 ) == 0 : if arg_2 : arg_3 [ 0 ] = True else : return None , [ ] arg_4 = np . arange ( arg_0 . arr . shape [ 2 ] ) [ arg_3 ] arg_5 = arg_0 . arr [ ... , arg_4 ] return HeatmapsOnImage ( arg_5 , arg_0 . shape , min_value = 0.0 , max_value = 1.0 ) , arg_4

def Func(arg_0, arg_1=False, arg_2=False):
        """
        Convert segmentation map to heatmaps object.

        Each segmentation map class will be represented as a single heatmap channel.

        Parameters
        ----------
        only_nonempty : bool, optional
            If True, then only heatmaps for classes that appear in the segmentation map will be
            generated. Additionally, a list of these class ids will be returned.

        not_none_if_no_nonempty : bool, optional
            If `only_nonempty` is True and for a segmentation map no channel was non-empty,
            this function usually returns None as the heatmaps object. If however this parameter
            is set to True, a heatmaps object with one channel (representing class 0)
            will be returned as a fallback in these cases.

        Returns
        -------
        imgaug.HeatmapsOnImage or None
            Segmentation map as a heatmaps object.
            If `only_nonempty` was set to True and no class appeared in the segmentation map,
            then this is None.

        class_indices : list of int
            Class ids (0 to C-1) of the classes that were actually added to the heatmaps.
            Only returned if `only_nonempty` was set to True.

        """
        # TODO get rid of this deferred import
        from imgaug.augmentables.heatmaps import HeatmapsOnImage

        if not arg_1:
            return HeatmapsOnImage.from_0to1(arg_0.arr, arg_0.shape, min_value=0.0, max_value=1.0)
        else:
            arg_3 = np.sum(arg_0.arr, axis=(0, 1)) > 0 + 1e-4
            if np.sum(arg_3) == 0:
                if arg_2:
                    arg_3[0] = True
                else:
                    return None, []

            arg_4 = np.arange(arg_0.arr.shape[2])[arg_3]
            arg_5 = arg_0.arr[..., arg_4]
            return HeatmapsOnImage(arg_5, arg_0.shape, min_value=0.0, max_value=1.0), arg_4

Convert segmentation map to heatmaps object .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
not
arg_2
:
arg_0
=
arg_0
.
lower
(
)
.
replace
(
" "
,
"_"
)
for
arg_3
,
arg_4
in
globals
(
)
.
items
(
)
:
if
arg_3
.
startswith
(
"_"
)
or
arg_3
==
'Ellipsoid'
:
continue
try
:
if
hasattr
(
arg_4
.
name
,
arg_1
)
:
arg_3
=
getattr
(
arg_4
.
name
,
arg_1
)
if
not
arg_2
:
arg_3
=
arg_3
.
lower
(
)
.
replace
(
" "
,
"_"
)
if
arg_0
==
arg_3
:
return
arg_4
except
:
pass
else
:
return

def Func(arg_0, arg_1, arg_2=False):
    """
    Search for a ellipsoid name located in this module.

    Arguments:

    - **ellipsname**: The ellipsoid name to search for.
    - **crstype**: Which CRS naming convention to search (different
        CRS formats have different names for the same ellipsoid).
    - **strict** (optional): If False, ignores minor name mismatches
        such as underscore or character casing, otherwise must be exact
        match (defaults to False).
    """
    if not arg_2:
        arg_0 = arg_0.lower().replace(" ","_")
    for arg_3,arg_4 in globals().items():
        if arg_3.startswith("_") or arg_3 == 'Ellipsoid':
            continue
        try:
            if hasattr(arg_4.name, arg_1):
                arg_3 = getattr(arg_4.name, arg_1)
                if not arg_2:
                    arg_3 = arg_3.lower().replace(" ","_")
                if arg_0 == arg_3:
                    return arg_4
        except:
            pass
    else:
        return None

Search for a ellipsoid name located in this module .


return (self._input_dim, self._output_dim, self._input_dim,
                self._output_dim)

def Func(arg_0):
        """Return the shape for bipartite matrix"""
        return (arg_0._input_dim, arg_0._output_dim, arg_0._input_dim,
                arg_0._output_dim)


(df, z_score=None, title='', figsize=(5,5), cmap='RdBu_r',
            xticklabels=True, yticklabels=True, ofname=None, **kwargs)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
''
,
arg_3
=
(
5
,
5
)
,
arg_4
=
'RdBu_r'
,
arg_5
=
True
,
arg_6
=
True
,
arg_7
=
,
**
arg_8
)
:
arg_0
=
zscore
(
arg_0
,
axis
=
arg_1
)
arg_0
=
arg_0
.
iloc
[
:
:
1
]
arg_9
,
arg_10
=
arg_0
.
shape
arg_11
=
np
.
arange
(
0
,
arg_10
,
1
)
+
.5
arg_12
=
np
.
arange
(
0
,
arg_9
,
1
)
+
.5
if
hasattr
(
sys
,
'ps1'
)
and
(
arg_7
is
)
:
arg_13
=
plt
.
figure
(
arg_3
=
arg_3
)
else
:
arg_13
=
Figure
(
arg_3
=
arg_3
)
arg_14
=
FigureCanvas
(
arg_13
)
arg_15
=
arg_13
.
add_subplot
(
111
)
arg_16
=
np
.
percentile
(
arg_0
.
min
(
)
,
2
)
arg_17
=
np
.
percentile
(
arg_0
.
max
(
)
,
98
)
arg_18
=
arg_15
.
pcolormesh
(
arg_0
.
values
,
arg_4
=
arg_4
,
arg_16
=
arg_16
,
arg_17
=
arg_17
)
arg_15
.
set_ylim
(
[
0
,
len
(
arg_0
)
]
)
arg_15
.
set
(
arg_11
=
arg_11
,
arg_12
=
arg_12
)
arg_15
.
set_xticklabels
(
arg_0
.
columns
.
values
if
arg_5
else
''
,
fontsize
=
14
,
rotation
=
90
)
arg_15
.
set_yticklabels
(
arg_0
.
index
.
values
if
arg_6
else
''
,
fontsize
=
14
)
arg_15
.
set_title
(
"%s\nHeatmap of the Analyzed Geneset"
%
arg_2
,
fontsize
=
20
)
arg_15
.
tick_params
(
axis
=
'both'
,
which
=
'both'
,
bottom
=
False
,
top
=
False
,
right
=
False
,
left
=
False
)
arg_19
=
colorbar
(
arg_18
)
arg_19
.
ax
.
tick_params
(
axis
=
'both'
,
which
=
'both'
,
bottom
=
False
,
top
=
False
,
right
=
False
,
left
=
False
)
for
arg_20
in
[
"top"
,
"right"
,
"left"
,
"bottom"
]
:
arg_15
.
spines
[
arg_20
]
.
set_visible
(
False
)
arg_19
.
ax
.
spines
[
arg_20
]
.
set_visible
(
False
)
if
arg_7
is
not
:
arg_13
.
savefig
(
arg_7
,
bbox_inches
=
'tight'
,
dpi
=
300
)
return

def Func(arg_0, arg_1=None, arg_2='', arg_3=(5,5), arg_4='RdBu_r',
            arg_5=True, arg_6=True, arg_7=None, **arg_8):
    """Visualize the dataframe.

    :param df: DataFrame from expression table.
    :param z_score: z_score axis{0, 1}. If None, don't normalize data.
    :param title: gene set name.
    :param outdir: path to save Func.
    :param figsize: Func figsize.
    :param cmap: matplotlib colormap.
    :param ofname: output file name. If None, don't save figure

    """
    arg_0 = zscore(arg_0, axis=arg_1)
    arg_0 = arg_0.iloc[::-1]
    # Get the positions and used label for the ticks
    arg_9, arg_10 = arg_0.shape
    arg_11 = np.arange(0, arg_10, 1) + .5
    arg_12 = np.arange(0, arg_9, 1) + .5

    # If working on commandline, don't show figure
    if hasattr(sys, 'ps1') and (arg_7 is None):
        arg_13 = plt.figure(arg_3=arg_3)
    else:
        arg_13 = Figure(arg_3=arg_3)
        arg_14 = FigureCanvas(arg_13)
    arg_15 = arg_13.add_subplot(111)
    arg_16 = np.percentile(arg_0.min(), 2)
    arg_17 =  np.percentile(arg_0.max(), 98)
    arg_18 = arg_15.pcolormesh(arg_0.values, arg_4=arg_4, arg_16=arg_16, arg_17=arg_17)
    arg_15.set_ylim([0,len(arg_0)])
    arg_15.set(arg_11=arg_11, arg_12=arg_12)
    arg_15.set_xticklabels(arg_0.columns.values if arg_5 else '', fontsize=14, rotation=90)
    arg_15.set_yticklabels(arg_0.index.values if arg_6 else '',  fontsize=14)
    arg_15.set_title("%s\nHeatmap of the Analyzed Geneset"%arg_2, fontsize=20)
    arg_15.tick_params(axis='both', which='both', bottom=False, top=False,
                   right=False, left=False)
    # cax=fig.add_axes([0.93,0.25,0.05,0.20])
    # cbar = fig.colorbar(matrix, cax=cax)
    arg_19 = colorbar(arg_18)
    arg_19.ax.tick_params(axis='both', which='both', bottom=False, top=False,
                        right=False, left=False)
    for arg_20 in ["top", "right", "left", "bottom"]:
        arg_15.spines[arg_20].set_visible(False)
        arg_19.ax.spines[arg_20].set_visible(False)
    # cbar.ax.set_title('',loc='left')

    if arg_7 is not None:
        # canvas.print_figure(ofname, bbox_inches='tight', dpi=300)
        arg_13.savefig(arg_7, bbox_inches='tight', dpi=300)
    return

Visualize the dataframe.

    :param df: DataFrame from expression table.
    :param z_score: z_score axis{0, 1}. If None, don't normalize data.
    :param title: gene set name.
    :param outdir: path to save heatmap.
    :param figsize: heatmap figsize.
    :param cmap: matplotlib colormap.
    :param ofname: output file name. If None, don't save figure


def Func ( arg_0 , arg_1 ) : arg_2 = [ os . path . join ( arg_0 . dirs . across , s . name + ".tmp.h5" ) for s in arg_1 ] arg_3 = [ h5py . File ( i ) for i in arg_2 ] arg_4 = [ i [ '/ichrom' ] for i in arg_3 ] arg_5 = [ da . from_array ( dset , chunks = ( 10000 , 3 ) ) for dset in arg_4 ] arg_6 = da . stack ( arg_5 , axis = 2 ) arg_7 = da . max ( arg_6 , axis = 2 ) [ : , 0 ] arg_8 = da . max ( arg_6 , axis = 2 ) [ : , 2 ] arg_9 = arg_6 == 0 arg_6 [ arg_9 ] = 9223372036854775807 arg_10 = da . min ( arg_6 , axis = 2 ) [ : , 1 ] arg_11 = da . stack ( [ arg_7 , arg_10 , arg_8 ] , axis = 1 ) arg_11 . to_hdf5 ( arg_0 . clust_database , "/chroms" ) arg_12 = [ i . close ( ) for i in arg_3 ]

def Func(arg_0, arg_1):
    """
    A dask relay function to fill chroms for all samples
    """

    ## example concatenating with dask
    arg_2 = [os.path.join(arg_0.dirs.across, s.name+".tmp.h5") for s in arg_1]
    arg_3 = [h5py.File(i) for i in arg_2]
    arg_4 = [i['/ichrom'] for i in arg_3]
    arg_5 = [da.from_array(dset, chunks=(10000, 3)) for dset in arg_4]
    arg_6 = da.stack(arg_5, axis=2)

    ## max chrom (should we check for variable hits? if so, things can get wonk)
    arg_7 = da.max(arg_6, axis=2)[:, 0]

    ## max pos
    arg_8 = da.max(arg_6, axis=2)[:, 2]

    ## min pos
    arg_9 = arg_6 == 0
    arg_6[arg_9] = 9223372036854775807  ## max int64 value
    arg_10 = da.min(arg_6, axis=2)[:, 1]
    arg_11 = da.stack([arg_7, arg_10, arg_8], axis=1)
    arg_11.to_hdf5(arg_0.clust_database, "/chroms")

    ## close the h5 handles
    arg_12 = [i.close() for i in arg_3]


def Func ( arg_0 , arg_1 ) : if arg_0 . inputs is None : return arg_2 = arg_0 . _sanitize_inputs ( ) for arg_3 , arg_4 in arg_2 . items ( ) : arg_5 = arg_1 . inputs . add ( ) arg_5 . stream . CopyFrom ( arg_0 . _get_stream_id ( arg_3 . component_id , arg_3 . stream_id ) ) if isinstance ( arg_4 , Grouping . FIELDS ) : arg_5 . gtype = arg_4 . gtype arg_5 . grouping_fields . CopyFrom ( arg_0 . _get_stream_schema ( arg_4 . fields ) ) elif isinstance ( arg_4 , Grouping . CUSTOM ) : arg_5 . gtype = arg_4 . gtype arg_5 . custom_grouping_object = arg_4 . python_serialized arg_5 . type = topology_pb2 . CustomGroupingObjectType . Value ( "PYTHON_OBJECT" ) else : arg_5 . gtype = arg_4

def Func(arg_0, arg_1):
    """Adds inputs to a given protobuf Bolt message"""
    if arg_0.inputs is None:
      return
    # sanitize inputs and get a map <GlobalStreamId -> Grouping>
    arg_2 = arg_0._sanitize_inputs()

    for arg_3, arg_4 in arg_2.items():
      arg_5 = arg_1.inputs.add()
      arg_5.stream.CopyFrom(arg_0._get_stream_id(arg_3.component_id,
                                                    arg_3.stream_id))
      if isinstance(arg_4, Grouping.FIELDS):
        # it's a field grouping
        arg_5.gtype = arg_4.gtype
        arg_5.grouping_fields.CopyFrom(arg_0._get_stream_schema(arg_4.fields))
      elif isinstance(arg_4, Grouping.CUSTOM):
        # it's a custom grouping
        arg_5.gtype = arg_4.gtype
        arg_5.custom_grouping_object = arg_4.python_serialized
        arg_5.type = topology_pb2.CustomGroupingObjectType.Value("PYTHON_OBJECT")
      else:
        arg_5.gtype = arg_4


return re.sub(_DEMUNGE_PATTERN, demunge_replacer, s).replace("_", "-")

def Func ( arg_0 : arg_1 ) -> arg_1 : def Func_replacer ( arg_2 : arg_3 ) -> arg_1 : arg_4 = arg_2 . group ( 0 ) arg_5 = _DEMUNGE_REPLACEMENTS . get ( arg_4 , None ) if arg_5 : return arg_5 return arg_4 return re . sub ( _DEMUNGE_PATTERN , Func_replacer , arg_0 ) . replace ( "_" , "-" )

def Func(arg_0: arg_1) -> arg_1:
    """Replace munged string components with their original
    representation."""

    def Func_replacer(arg_2: arg_3) -> arg_1:
        arg_4 = arg_2.group(0)
        arg_5 = _DEMUNGE_REPLACEMENTS.get(arg_4, None)
        if arg_5:
            return arg_5
        return arg_4

    return re.sub(_DEMUNGE_PATTERN, Func_replacer, arg_0).replace("_", "-")

Replace munged string components with their original representation .


def Func ( arg_0 , arg_1 ) : with tf . name_scope ( "Func" ) : arg_2 = arg_0 . shape [ : - 2 ] arg_3 = tf . shape ( input = arg_0 ) [ : - 2 ] arg_4 = None arg_5 = None def _set_event_shape ( arg_6 , arg_7 ) : if arg_4 is None : return arg_6 , arg_7 return ( tf . broadcast_static_shape ( arg_4 , arg_6 ) , tf . broadcast_dynamic_shape ( arg_5 , arg_7 ) ) for arg_8 in arg_1 : if arg_8 . shift is not None : arg_2 = tf . broadcast_static_shape ( arg_2 , arg_8 . shift . shape [ : - 1 ] ) arg_3 = tf . broadcast_dynamic_shape ( arg_3 , tf . shape ( input = arg_8 . shift ) [ : - 1 ] ) arg_4 , arg_5 = _set_event_shape ( arg_8 . shift . shape [ - 1 : ] , tf . shape ( input = arg_8 . shift ) [ - 1 : ] ) if arg_8 . scale is not None : arg_2 = tf . broadcast_static_shape ( arg_2 , arg_8 . scale . batch_shape ) arg_3 = tf . broadcast_dynamic_shape ( arg_3 , arg_8 . scale . batch_shape_tensor ( ) ) arg_4 , arg_5 = _set_event_shape ( tf . TensorShape ( [ arg_8 . scale . range_dimension ] ) , arg_8 . scale . range_dimension_tensor ( ) [ tf . newaxis ] ) return arg_2 , arg_3 , arg_4 , arg_5

def Func(arg_0, arg_1):
  """Helper to infer batch_shape and event_shape."""
  with tf.name_scope("Func"):
    # grid  # shape: [B, k, q]
    # endpoint_affine     # len=k, shape: [B, d, d]
    arg_2 = arg_0.shape[:-2]
    arg_3 = tf.shape(input=arg_0)[:-2]
    arg_4 = None
    arg_5 = None

    def _set_event_shape(arg_6, arg_7):
      if arg_4 is None:
        return arg_6, arg_7
      return (tf.broadcast_static_shape(arg_4, arg_6),
              tf.broadcast_dynamic_shape(arg_5, arg_7))

    for arg_8 in arg_1:
      if arg_8.shift is not None:
        arg_2 = tf.broadcast_static_shape(arg_2,
                                                arg_8.shift.shape[:-1])
        arg_3 = tf.broadcast_dynamic_shape(
            arg_3,
            tf.shape(input=arg_8.shift)[:-1])
        arg_4, arg_5 = _set_event_shape(
            arg_8.shift.shape[-1:],
            tf.shape(input=arg_8.shift)[-1:])

      if arg_8.scale is not None:
        arg_2 = tf.broadcast_static_shape(arg_2,
                                                arg_8.scale.batch_shape)
        arg_3 = tf.broadcast_dynamic_shape(
            arg_3, arg_8.scale.batch_shape_tensor())
        arg_4, arg_5 = _set_event_shape(
            tf.TensorShape([arg_8.scale.range_dimension]),
            arg_8.scale.range_dimension_tensor()[tf.newaxis])

    return arg_2, arg_3, arg_4, arg_5

Helper to infer batch_shape and event_shape .


def Func(arg_0, arg_1):
        """
        Stops a batch request from running. Since only one batch request is
        run at a time, this can be used to cancel a long running request. The
        results of any completed operations will not be available after this
        call.

        :param batch_id: The unique id for the batch operation.
        :type batch_id: :py:class:`str`
        """
        arg_0.batch_id = arg_1
        arg_0.operation_status = None
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1))

Stops a batch request from running . Since only one batch request is run at a time this can be used to cancel a long running request . The results of any completed operations will not be available after this call .


def Func(arg_0, arg_1, arg_2=False):
        """Parse multiple definitions and yield them."""
        while arg_0.current is not None:
            arg_0.log.debug(
                "parsing definition list, current token is %r (%s)",
                arg_0.current.kind,
                arg_0.current.value,
            )
            arg_0.log.debug("got_newline: %s", arg_0.stream.got_logical_newline)
            if arg_2 and arg_0.current.value == "__all__":
                arg_0.parse_all()
            elif (
                arg_0.current.kind == tk.OP
                and arg_0.current.value == "@"
                and arg_0.stream.got_logical_newline
            ):
                arg_0.consume(tk.OP)
                arg_0.parse_decorators()
            elif arg_0.current.value in ["def", "class"]:
                yield arg_0.parse_definition(arg_1._nest(arg_0.current.value))
            elif arg_0.current.kind == tk.INDENT:
                arg_0.consume(tk.INDENT)
                for arg_3 in arg_0.Func(arg_1):
                    yield arg_3
            elif arg_0.current.kind == tk.DEDENT:
                arg_0.consume(tk.DEDENT)
                return
            elif arg_0.current.value == "from":
                arg_0.parse_from_import_statement()
            else:
                arg_0.stream.move()

Parse multiple definitions and yield them .


def Func ( arg_0 ) : for arg_1 in arg_0 . __subclasses__ ( ) : yield arg_1 for arg_2 in Func ( arg_1 ) : yield arg_2

def Func(arg_0):
    """ Recursively generate of all the subclasses of class cls. """
    for arg_1 in arg_0.__subclasses__():
        yield arg_1
        for arg_2 in Func(arg_1):
            yield arg_2

Recursively generate of all the subclasses of class cls .


(
    port, address, ads_state, device_state, data, plc_data_type
)

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4, arg_5
):
    # type: (int, AmsAddr, int, int, Any, Type) -> None
    """Change the ADS state and the machine-state of the ADS-server.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr adr: local or remote AmsAddr
    :param int ads_state: new ADS-state, according to ADSTATE constants
    :param int device_state: new machine-state
    :param data: additional data
    :param int plc_data_type: plc datatype, according to PLCTYPE constants

    """
    arg_6 = _adsDLL.AdsSyncWriteControlReqEx

    arg_7 = ctypes.pointer(arg_1.amsAddrStruct())
    arg_8 = ctypes.c_ulong(arg_2)
    arg_9 = ctypes.c_ulong(arg_3)

    if arg_5 == PLCTYPE_STRING:
        arg_4 = ctypes.c_char_p(arg_4.encode("utf-8"))
        arg_10 = arg_4
        arg_11 = len(arg_10.value) + 1
    else:
        arg_4 = arg_5(arg_4)
        arg_10 = ctypes.pointer(arg_4)
        arg_11 = ctypes.sizeof(arg_4)

    arg_12 = arg_6(
        arg_0,
        arg_7,
        arg_8,
        arg_9,
        arg_11,
        arg_10,
    )

    if arg_12:
        raise ADSError(arg_12)

Change the ADS state and the machine - state of the ADS - server .


def Func(arg_0, arg_1=None, arg_2=None):
    """
    Converts multiple input images into a single image showing them in a grid.

    dtype support::

        * ``uint8``: yes; fully tested
        * ``uint16``: yes; fully tested
        * ``uint32``: yes; fully tested
        * ``uint64``: yes; fully tested
        * ``int8``: yes; fully tested
        * ``int16``: yes; fully tested
        * ``int32``: yes; fully tested
        * ``int64``: yes; fully tested
        * ``float16``: yes; fully tested
        * ``float32``: yes; fully tested
        * ``float64``: yes; fully tested
        * ``float128``: yes; fully tested
        * ``bool``: yes; fully tested

    Parameters
    ----------
    images : (N,H,W,3) ndarray or iterable of (H,W,3) array
        The input images to convert to a grid.

    rows : None or int, optional
        The number of rows to show in the grid.
        If None, it will be automatically derived.

    cols : None or int, optional
        The number of cols to show in the grid.
        If None, it will be automatically derived.

    Returns
    -------
    grid : (H',W',3) ndarray
        Image of the generated grid.

    """
    arg_3 = len(arg_0)
    do_assert(arg_3 > 0)

    if is_np_array(arg_0):
        do_assert(arg_0.ndim == 4)
    else:
        do_assert(is_iterable(arg_0) and is_np_array(arg_0[0]) and arg_0[0].ndim == 3)
        arg_4 = [arg_17.dtype.name for arg_17 in arg_0]
        arg_5 = len(set(arg_4))
        do_assert(arg_5 == 1, ("All images provided to Func() must have the same dtype, "
                                   + "found %d dtypes (%s)") % (arg_5, ", ".join(arg_4)))

    arg_6 = max([arg_17.shape[0] for arg_17 in arg_0])
    arg_7 = max([arg_17.shape[1] for arg_17 in arg_0])
    arg_8 = set([arg_17.shape[2] for arg_17 in arg_0])
    do_assert(
        len(arg_8) == 1,
        "All images are expected to have the same number of channels, "
        + "but got channel set %s with length %d instead." % (str(arg_8), len(arg_8))
    )
    arg_9 = list(arg_8)[0]
    if arg_1 is None and arg_2 is None:
        arg_1 = arg_2 = int(math.ceil(math.sqrt(arg_3)))
    elif arg_1 is not None:
        arg_2 = int(math.ceil(arg_3 / arg_1))
    elif arg_2 is not None:
        arg_1 = int(math.ceil(arg_3 / arg_2))
    do_assert(arg_1 * arg_2 >= arg_3)

    arg_10 = arg_7 * arg_2
    arg_11 = arg_6 * arg_1
    arg_12 = arg_0.dtype if is_np_array(arg_0) else arg_0[0].dtype
    arg_13 = np.zeros((arg_11, arg_10, arg_9), dtype=arg_12)
    arg_14 = 0
    for arg_15 in sm.xrange(arg_1):
        for arg_16 in sm.xrange(arg_2):
            if arg_14 < arg_3:
                arg_17 = arg_0[arg_14]
                arg_18 = arg_6 * arg_15
                arg_19 = arg_18 + arg_17.shape[0]
                arg_20 = arg_7 * arg_16
                arg_21 = arg_20 + arg_17.shape[1]
                arg_13[arg_18:arg_19, arg_20:arg_21, :] = arg_17
            arg_14 += 1

    return arg_13

Converts multiple input images into a single image showing them in a grid .


(population,
                      population_size,
                      mutants,
                      crossover_prob,
                      seed)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = [ tf . cast ( tf . size ( input = x ) , dtype = tf . float64 ) for x in arg_0 ] arg_6 = distributions . SeedStream ( arg_4 , salt = 'binary_crossover' ) arg_7 = distributions . Categorical ( arg_5 ) . sample ( [ arg_1 , 1 ] , arg_4 = arg_6 ( ) ) arg_8 = [ ] for arg_9 , arg_10 in enumerate ( arg_0 ) : arg_11 = tf . reshape ( arg_10 , [ arg_1 , - 1 ] ) arg_12 = tf . reshape ( arg_2 [ arg_9 ] , [ arg_1 , - 1 ] ) arg_13 = tf . size ( input = arg_10 ) // arg_1 arg_14 = tf . one_hot ( tf . random . uniform ( [ arg_1 ] , minval = 0 , maxval = arg_13 , dtype = tf . int32 , arg_4 = arg_6 ( ) ) , arg_13 , on_value = True , off_value = False , dtype = tf . bool ) arg_15 = tf . math . equal ( arg_7 , arg_9 ) arg_14 &= arg_15 arg_16 = tf . random . uniform ( [ arg_1 , arg_13 ] , dtype = arg_3 . dtype . base_dtype , arg_4 = arg_6 ( ) ) < arg_3 arg_16 |= arg_14 arg_17 = tf . where ( arg_16 , x = arg_12 , y = arg_11 ) arg_18 = tf . reshape ( arg_17 , tf . shape ( input = arg_10 ) ) arg_8 . append ( arg_18 ) return arg_8

def Func(arg_0,
                      arg_1,
                      arg_2,
                      arg_3,
                      arg_4):
  """Performs recombination by binary crossover for the current population.

  Let v_i denote the i'th component of the member v and m_i the corresponding
  component of the mutant vector corresponding to v. Then the crossed over
  vector w_i is determined by setting w_i =
  (m_i with probability=crossover_prob else v_i). In addition, DE requires that
  at least one of the components is crossed over (otherwise we end
  up with no change). This is done by choosing on index say k randomly where
  a force crossover is performed (i.e. w_k = m_k). This is the scheme
  implemented in this function.

  Args:
    population: A Python list of `Tensor`s where each `Tensor` in the list
      must be of rank at least 1 and all the elements must have a common
      first dimension. The base population to cross over.
    population_size: A scalar integer `Tensor`. The number of elements in the
      population (i.e. size of the first dimension of any member of
      `population`).
    mutants: A Python list of `Tensor`s with the same structure as `population`.
      The mutated population.
    crossover_prob: A postive real scalar `Tensor` bounded above by 1.0. The
      probability of a crossover being performed for each axis.
    seed: `int` or None. The random seed for this `Op`. If `None`, no seed is
      applied.

  Returns:
    A list of `Tensor`s of the same structure, dtype and shape as `population`.
    The recombined population.
  """
  arg_5 = [tf.cast(tf.size(input=x), dtype=tf.float64) for x in arg_0]
  arg_6 = distributions.SeedStream(arg_4, salt='binary_crossover')
  arg_7 = distributions.Categorical(arg_5).sample(
      [arg_1, 1], arg_4=arg_6())
  arg_8 = []
  for arg_9, arg_10 in enumerate(arg_0):
    arg_11 = tf.reshape(arg_10, [arg_1, -1])
    arg_12 = tf.reshape(arg_2[arg_9], [arg_1, -1])
    arg_13 = tf.size(input=arg_10) // arg_1
    arg_14 = tf.one_hot(
        tf.random.uniform([arg_1],
                          minval=0,
                          maxval=arg_13,
                          dtype=tf.int32,
                          arg_4=arg_6()),
        arg_13,
        on_value=True,
        off_value=False,
        dtype=tf.bool)  # Tensor of shape [population_size, size]
    arg_15 = tf.math.equal(arg_7, arg_9)
    arg_14 &= arg_15
    arg_16 = tf.random.uniform(
        [arg_1, arg_13],
        dtype=arg_3.dtype.base_dtype,
        arg_4=arg_6()) < arg_3
    arg_16 |= arg_14
    arg_17 = tf.where(
        arg_16,
        x=arg_12,
        y=arg_11)
    arg_18 = tf.reshape(arg_17, tf.shape(input=arg_10))
    arg_8.append(arg_18)
  return arg_8

Performs recombination by binary crossover for the current population .


def Func(arg_0):
    """
    This function removes any unnecessary bundles, apps, libs, and services that aren't needed by
    the activated_bundles.  It also expands inside specs.apps.depends.libs all libs that are needed
    indirectly by each app
    """
    _filter_active(constants.CONFIG_BUNDLES_KEY, arg_0)
    _filter_active('apps', arg_0)
    _expand_libs_in_apps(arg_0)
    _filter_active('libs', arg_0)
    _filter_active('services', arg_0)
    _add_active_assets(arg_0)

This function removes any unnecessary bundles apps libs and services that aren t needed by the activated_bundles . It also expands inside specs . apps . depends . libs all libs that are needed indirectly by each app


def Func ( arg_0 , arg_1 ) : arg_2 = { "cell_type" : "markdown" , "metadata" : { } , "source" : [ rst2md ( arg_1 ) ] } arg_0 . work_notebook [ "cells" ] . append ( arg_2 )

def Func(arg_0, arg_1):
        """Add a markdown cell to the notebook

        Parameters
        ----------
        code : str
            Cell content
        """
        arg_2 = {
            "cell_type": "markdown",
            "metadata": {},
            "source": [rst2md(arg_1)]
        }
        arg_0.work_notebook["cells"].append(arg_2)


return ifelse(self._training_flag, then_branch, else_branch, name="iftrain")

def Func ( arg_0 , arg_1 , arg_2 ) : return ifelse ( arg_0 . _training_flag , arg_1 , arg_2 , name = "Func" )

def Func(arg_0, arg_1, arg_2):
        """
        Execute `then_branch` when training.
        """
        return ifelse(arg_0._training_flag, arg_1, arg_2, name="Func")


def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] ) -> arg_2 [ arg_2 [ arg_3 ] ] : Func = process_text_constructor ( cleaner = arg_0 . cleaner , tokenizer = arg_0 . tokenizer , append_indicators = arg_0 . append_indicators , start_tok = arg_0 . start_tok , end_tok = arg_0 . end_tok ) return Func ( arg_1 )

def Func(arg_0, arg_1: arg_2[arg_3]) -> arg_2[arg_2[arg_3]]:
        """Combine the cleaner and tokenizer."""
        Func = process_text_constructor(cleaner=arg_0.cleaner,
                                                tokenizer=arg_0.tokenizer,
                                                append_indicators=arg_0.append_indicators,
                                                start_tok=arg_0.start_tok,
                                                end_tok=arg_0.end_tok)
        return Func(arg_1)


return count == len(task.downstream_task_ids)

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . task if not arg_2 . downstream_task_ids : return True arg_3 = arg_1 . query ( func . count ( TaskInstance . task_id ) ) . filter ( TaskInstance . dag_id == arg_0 . dag_id , TaskInstance . task_id . in_ ( arg_2 . downstream_task_ids ) , TaskInstance . execution_date == arg_0 . execution_date , TaskInstance . state == State . SUCCESS , ) arg_4 = arg_3 [ 0 ] [ 0 ] return arg_4 == len ( arg_2 . downstream_task_ids )

def Func(arg_0, arg_1=None):
        """
        Checks whether the dependents of this task instance have all succeeded.
        This is meant to be used by wait_for_downstream.

        This is useful when you do not want to start processing the next
        schedule of a task until the dependents are done. For instance,
        if the task DROPs and recreates a table.
        """
        arg_2 = arg_0.task

        if not arg_2.downstream_task_ids:
            return True

        arg_3 = arg_1.query(func.count(TaskInstance.task_id)).filter(
            TaskInstance.dag_id == arg_0.dag_id,
            TaskInstance.task_id.in_(arg_2.downstream_task_ids),
            TaskInstance.execution_date == arg_0.execution_date,
            TaskInstance.state == State.SUCCESS,
        )
        arg_4 = arg_3[0][0]
        return arg_4 == len(arg_2.downstream_task_ids)

Checks whether the dependents of this task instance have all succeeded . This is meant to be used by wait_for_downstream .


def Func ( arg_0 ) : if arg_0 . control_stream : arg_0 . control_stream . flush ( ) for arg_1 in arg_0 . shell_streams : arg_1 . flush ( zmq . POLLIN , 1 ) arg_1 . flush ( zmq . POLLOUT )

def Func(arg_0):
        """step eventloop just once"""
        if arg_0.control_stream:
            arg_0.control_stream.flush()
        for arg_1 in arg_0.shell_streams:
            # handle at most one request per iteration
            arg_1.flush(zmq.POLLIN, 1)
            arg_1.flush(zmq.POLLOUT)


def Func(arg_0,):
    """ Look through the jobs table and get the list of running jobs whose
    cancel field is true.

    Parameters:
    ----------------------------------------------------------------
    retval:      A (possibly empty) sequence of running job IDs with cancel field
                  set to true
    """
    with ConnectionFactory.get() as conn:
      arg_1 = 'SELECT job_id '\
              'FROM %s ' \
              'WHERE (status<>%%s AND cancel is TRUE)' \
              % (arg_0.jobsTableName,)
      conn.cursor.execute(arg_1, [arg_0.STATUS_COMPLETED])
      arg_2 = conn.cursor.fetchall()

    return tuple(arg_3[0] for arg_3 in arg_2)

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