def Func ( arg_0 , arg_1 ) : arg_2 = False arg_3 = os . path . basename ( arg_1 ) arg_4 = os . path . splitext ( arg_3 ) [ 0 ] for arg_5 in arg_0 . module_postfixes : if arg_4 . endswith ( arg_5 ) : arg_2 = True break if not arg_2 : for arg_5 in arg_0 . module_prefixes : if arg_4 . startswith ( arg_5 ) : arg_2 = True break return arg_2

def Func(arg_0, arg_1):
        """Returns true if the passed in path is a test module path

        :param path: string, the path to check, will need to start or end with the
            module test prefixes or postfixes to be considered valid
        :returns: boolean, True if a test module path, False otherwise
        """
        arg_2 = False
        arg_3 = os.path.basename(arg_1)
        arg_4 = os.path.splitext(arg_3)[0]
        for arg_5 in arg_0.module_postfixes:
            if arg_4.endswith(arg_5):
                arg_2 = True
                break

        if not arg_2:
            for arg_5 in arg_0.module_prefixes:
                if arg_4.startswith(arg_5):
                    arg_2 = True
                    break
        return arg_2


def
Func
(
)
:
arg_0
=
_get_host_only_mac_address
(
)
arg_1
=
check_output_demoted
(
[
'ssh'
,
'-o'
,
'StrictHostKeyChecking=no'
,
'-o'
,
'UserKnownHostsFile=/dev/null'
,
'-i'
,
_vm_key_path
(
)
,
'-p'
,
_get_localhost_ssh_port
(
)
,
'docker@127.0.0.1'
,
'ip addr show'
]
)
return
_ip_for_mac_from_ip_addr_show
(
arg_1
,
arg_0
)

def Func():
    """Determine the host-only IP of the Dusty VM through Virtualbox and SSH
    directly, bypassing Docker Machine. We do this because Docker Machine is
    much slower, taking about 600ms total. We are basically doing the same
    flow Docker Machine does in its own code."""
    arg_0 = _get_host_only_mac_address()
    arg_1 = check_output_demoted(['ssh', '-o', 'StrictHostKeyChecking=no',
                                         '-o', 'UserKnownHostsFile=/dev/null',
                                         '-i', _vm_key_path(), '-p', _get_localhost_ssh_port(),
                                         'docker@127.0.0.1', 'ip addr show'])
    return _ip_for_mac_from_ip_addr_show(arg_1, arg_0)

Determine the host - only IP of the Dusty VM through Virtualbox and SSH directly bypassing Docker Machine . We do this because Docker Machine is much slower taking about 600ms total . We are basically doing the same flow Docker Machine does in its own code .


(input_locations, output_path, namespace_name, namespace_keyword, namespace_domain, author_name,
                     citation_name, namespace_description=None, namespace_species=None, namespace_version=None,
                     namespace_query_url=None, namespace_created=None, author_contact=None, author_copyright=None,
                     citation_description=None, citation_url=None, citation_version=None, citation_date=None,
                     case_sensitive=True, delimiter='|', cacheable=True, functions=None, value_prefix='',
                     sort_key=None, check_keywords=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                     arg_6, arg_7=None, arg_8=None, arg_9=None,
                     arg_10=None, arg_11=None, arg_12=None, arg_13=None,
                     arg_14=None, arg_15=None, arg_16=None, arg_17=None,
                     arg_18=True, arg_19='|', arg_20=True, arg_21=None, arg_22='',
                     arg_23=None, arg_24=True):
    """Merges namespaces from multiple locations to one.

    :param iter input_locations: An iterable of URLs or file paths pointing to BEL namespaces.
    :param str output_path: The path to the file to write the merged namespace
    :param str namespace_name: The namespace name
    :param str namespace_keyword: Preferred BEL Keyword, maximum length of 8
    :param str namespace_domain: One of: :data:`pybel.constants.NAMESPACE_DOMAIN_BIOPROCESS`,
                            :data:`pybel.constants.NAMESPACE_DOMAIN_CHEMICAL`,
                            :data:`pybel.constants.NAMESPACE_DOMAIN_GENE`, or
                            :data:`pybel.constants.NAMESPACE_DOMAIN_OTHER`
    :param str author_name: The namespace's authors
    :param str citation_name: The name of the citation
    :param str namespace_query_url: HTTP URL to query for details on namespace values (must be valid URL)
    :param str namespace_description: Namespace description
    :param str namespace_species: Comma-separated list of species taxonomy id's
    :param str namespace_version: Namespace version
    :param str namespace_created: Namespace public timestamp, ISO 8601 datetime
    :param str author_contact: Namespace author's contact info/email address
    :param str author_copyright: Namespace's copyright/license information
    :param str citation_description: Citation description
    :param str citation_url: URL to more citation information
    :param str citation_version: Citation version
    :param str citation_date: Citation publish timestamp, ISO 8601 Date
    :param bool case_sensitive: Should this config file be interpreted as case-sensitive?
    :param str delimiter: The delimiter between names and labels in this config file
    :param bool cacheable: Should this config file be cached?
    :param functions: The encoding for the elements in this namespace
    :type functions: iterable of characters
    :param str value_prefix: a prefix for each name
    :param sort_key: A function to sort the values with :func:`sorted`
    :param bool check_keywords: Should all the keywords be the same? Defaults to ``True``
    """
    arg_25 = get_merged_namespace_names(arg_0, arg_24=arg_24)

    with open(arg_1, 'w') as file:
        write_namespace(
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            values=arg_25,
            arg_8=arg_8,
            arg_7=arg_7,
            arg_10=arg_10,
            arg_9=arg_9,
            arg_11=arg_11,
            arg_12=arg_12,
            arg_13=arg_13,
            arg_14=arg_14,
            arg_15=arg_15,
            arg_16=arg_16,
            arg_17=arg_17,
            arg_18=arg_18,
            arg_19=arg_19,
            arg_20=arg_20,
            arg_21=arg_21,
            arg_22=arg_22,
            arg_23=arg_23,
            file=file
        )

Merges namespaces from multiple locations to one .


def Func ( arg_0 , arg_1 ) : arg_2 = get_mnist ( arg_0 , "train" , arg_1 . dataPath ) . map ( lambda rec_tuple : ( normalizer ( rec_tuple [ 0 ] , mnist . TRAIN_MEAN , mnist . TRAIN_STD ) , rec_tuple [ 1 ] ) ) . map ( lambda t : Sample . from_ndarray ( t [ 0 ] , t [ 1 ] ) ) arg_3 = get_mnist ( arg_0 , "test" , arg_1 . dataPath ) . map ( lambda rec_tuple : ( normalizer ( rec_tuple [ 0 ] , mnist . TEST_MEAN , mnist . TEST_STD ) , rec_tuple [ 1 ] ) ) . map ( lambda t : Sample . from_ndarray ( t [ 0 ] , t [ 1 ] ) ) return arg_2 , arg_3

def Func(arg_0, arg_1):
    """
    Preprocess mnist dataset.
    Normalize and transform into Sample of RDDs.
    """
    arg_2 = get_mnist(arg_0, "train", arg_1.dataPath)\
        .map(lambda rec_tuple: (normalizer(rec_tuple[0], mnist.TRAIN_MEAN, mnist.TRAIN_STD),
                                rec_tuple[1]))\
        .map(lambda t: Sample.from_ndarray(t[0], t[1]))
    arg_3 = get_mnist(arg_0, "test", arg_1.dataPath)\
        .map(lambda rec_tuple: (normalizer(rec_tuple[0], mnist.TEST_MEAN, mnist.TEST_STD),
                                rec_tuple[1]))\
        .map(lambda t: Sample.from_ndarray(t[0], t[1]))
    return arg_2, arg_3

Preprocess mnist dataset . Normalize and transform into Sample of RDDs .


(self, item_id, token=None, revision=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = dict ( ) arg_4 [ 'id' ] = arg_1 if arg_2 : arg_4 [ 'token' ] = arg_2 if arg_3 : arg_4 [ 'revision' ] = arg_3 arg_5 = arg_0 . request ( 'midas.item.getmetadata' , arg_4 ) return arg_5

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Get the metadata associated with an item.

        :param item_id: The id of the item for which metadata will be returned
        :type item_id: int | long
        :param token: (optional) A valid token for the user in question.
        :type token: None | string
        :param revision: (optional) Revision of the item. Defaults to latest
            revision.
        :type revision: int | long
        :returns: List of dictionaries containing item metadata.
        :rtype: list[dict]
        """
        arg_4 = dict()
        arg_4['id'] = arg_1
        if arg_2:
            arg_4['token'] = arg_2
        if arg_3:
            arg_4['revision'] = arg_3
        arg_5 = arg_0.request('midas.item.getmetadata', arg_4)
        return arg_5

Get the metadata associated with an item .


(self, url=None, code_url=None, ci_url=None,
                     readme_url=None, license_id=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                     arg_4=None, arg_5=None):
        """Create a JSON-LD representation of this LSST LaTeX document.

        Parameters
        ----------
        url : `str`, optional
            URL where this document is published to the web. Prefer
            the LSST the Docs URL if possible.
            Example: ``'https://ldm-151.lsst.io'``.
        code_url : `str`, optional
            Path the the document's repository, typically on GitHub.
            Example: ``'https://github.com/lsst/LDM-151'``.
        ci_url : `str`, optional
            Path to the continuous integration service dashboard for this
            document's repository.
            Example: ``'https://travis-ci.org/lsst/LDM-151'``.
        readme_url : `str`, optional
            URL to the document repository's README file. Example:
            ``https://raw.githubusercontent.com/lsst/LDM-151/master/README.rst``.
        license_id : `str`, optional
            License identifier, if known. The identifier should be from the
            listing at https://spdx.org/licenses/. Example: ``CC-BY-4.0``.

        Returns
        -------
        jsonld : `dict`
            JSON-LD-formatted dictionary.
        """
        arg_6 = {
            '@context': [
                "https://raw.githubusercontent.com/codemeta/codemeta/2.0-rc/"
                "codemeta.jsonld",
                "http://schema.org"],
            '@type': ['Report', 'SoftwareSourceCode'],
            'language': 'TeX',
            'reportNumber': arg_0.handle,
            'name': arg_0.plain_title,
            'description': arg_0.plain_abstract,
            'author': [{'@type': 'Person', 'name': author_name}
                       for author_name in arg_0.plain_authors],
            # This is a datetime.datetime; not a string. If writing to a file,
            # Need to convert this to a ISO 8601 string.
            'dateModified': arg_0.revision_datetime
        }

        try:
            arg_6['articleBody'] = arg_0.plain_content
            arg_6['fileFormat'] = 'text/plain'  # MIME type of articleBody
        except RuntimeError:
            # raised by pypandoc when it can't convert the tex document
            arg_0._logger.exception('Could not convert latex body to plain '
                                   'text for articleBody.')
            arg_0._logger.warning('Falling back to tex source for articleBody')
            arg_6['articleBody'] = arg_0._tex
            arg_6['fileFormat'] = 'text/plain'  # no mimetype for LaTeX?

        if arg_1 is not None:
            arg_6['@id'] = arg_1
            arg_6['url'] = arg_1
        else:
            # Fallback to using the document handle as the ID. This isn't
            # entirely ideal from a linked data perspective.
            arg_6['@id'] = arg_0.handle

        if arg_2 is not None:
            arg_6['codeRepository'] = arg_2

        if arg_3 is not None:
            arg_6['contIntegration'] = arg_3

        if arg_4 is not None:
            arg_6['readme'] = arg_4

        if arg_5 is not None:
            arg_6['license_id'] = None

        return arg_6

Create a JSON - LD representation of this LSST LaTeX document .


return Metric(self,
                  "# sequences each predicted => active cells appears in",
                  numSequencesForCell.values())

def Func(arg_0):
    """
    Metric for number of sequences each predicted => active cell appears in

    Note: This metric is flawed when it comes to high-order sequences.

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

    arg_1 = defaultdict(lambda: 0)

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

    return Metric(arg_0,
                  "# sequences each predicted => active cells appears in",
                  arg_1.values())

Metric for number of sequences each predicted = > active cell appears in


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
arg_4
=
True
,
**
arg_5
)
:
if
not
(
arg_2
)
:
arg_2
=
arg_0
.
_xmin
if
not
(
arg_3
)
:
arg_3
=
arg_0
.
_alpha
if
not
(
arg_1
)
:
arg_1
=
np
.
sort
(
arg_0
.
data
[
arg_0
.
data
>
arg_2
]
)
else
:
arg_1
=
np
.
sort
(
arg_1
[
arg_1
>
arg_2
]
)
arg_6
=
min
(
arg_1
)
arg_7
=
(
1.0
+
np
.
arange
(
len
(
arg_1
)
)
)
[
:
:
1
]
arg_8
=
arg_6
*
arg_7
**
(
1
/
(
1
arg_3
)
)
/
max
(
arg_7
)
**
(
1
/
(
1
arg_3
)
)
if
arg_4
:
pylab
.
loglog
(
arg_1
,
arg_8
,
'.'
,
**
arg_5
)
pylab
.
gca
(
)
.
set_xlim
(
min
(
arg_1
)
,
max
(
arg_1
)
)
pylab
.
gca
(
)
.
set_ylim
(
min
(
arg_1
)
,
max
(
arg_1
)
)
else
:
pylab
.
plot
(
arg_1
,
arg_8
,
'.'
,
**
arg_5
)
pylab
.
plot
(
[
min
(
arg_1
)
,
max
(
arg_1
)
]
,
[
min
(
arg_1
)
,
max
(
arg_1
)
]
,
'k--'
)
pylab
.
xlabel
(
"Real Value"
)
pylab
.
ylabel
(
"Power-Law Model Value"
)

def Func(arg_0,arg_1=None,arg_2=None,arg_3=None,arg_4=True,**arg_5):
        """
        Plots the power-law-predicted value on the Y-axis against the real
        values along the X-axis.  Can be used as a diagnostic of the fit
        quality.
        """
        if not(arg_2): arg_2=arg_0._xmin
        if not(arg_3): arg_3=arg_0._alpha
        if not(arg_1): arg_1=np.sort(arg_0.data[arg_0.data>arg_2])
        else: arg_1=np.sort(arg_1[arg_1>arg_2])

        # N = M^(-alpha+1)
        # M = N^(1/(-alpha+1))

        arg_6 = min(arg_1)
        arg_7 = (1.0+np.arange(len(arg_1)))[::-1]
        arg_8 = arg_6 * arg_7**(1/(1-arg_3)) / max(arg_7)**(1/(1-arg_3))

        if arg_4:
            pylab.loglog(arg_1,arg_8,'.',**arg_5)
            pylab.gca().set_xlim(min(arg_1),max(arg_1))
            pylab.gca().set_ylim(min(arg_1),max(arg_1))
        else:
            pylab.plot(arg_1,arg_8,'.',**arg_5)
        pylab.plot([min(arg_1),max(arg_1)],[min(arg_1),max(arg_1)],'k--')
        pylab.xlabel("Real Value")
        pylab.ylabel("Power-Law Model Value")

Plots the power - law - predicted value on the Y - axis against the real values along the X - axis . Can be used as a diagnostic of the fit quality .


def
Func
(
arg_0
)
:
arg_0
=
collections
.
OrderedDict
(
freeze_dict
(
arg_0
or
{
}
)
)
arg_1
=
' '
.
join
(
'%s="{%d}"'
%
(
k
,
i
)
for
i
,
k
in
enumerate
(
arg_0
)
)
return
arg_1
,
list
(
arg_0
.
values
(
)
)

def Func(arg_0):
    """Joins the map structure into HTML attributes.

    The return value is a 2-tuple ``(template, ordered_values)``. It should be
    passed into :class:`markupsafe.Markup` to prevent XSS attacked.

    e.g.::

        >>> Func({'href': '/', 'data-active': 'true'})
        ('data-active="{0}" href="{1}"', ['true', '/'])
    """
    arg_0 = collections.OrderedDict(freeze_dict(arg_0 or {}))
    arg_1 = ' '.join('%s="{%d}"' % (k, i) for i, k in enumerate(arg_0))
    return arg_1, list(arg_0.values())

Joins the map structure into HTML attributes.

    The return value is a 2-tuple ``(template, ordered_values)``. It should be
    passed into :class:`markupsafe.Markup` to prevent XSS attacked.

    e.g.::

        >>> join_html_attrs({'href': '/', 'data-active': 'true'})
        ('data-active="{0}" href="{1}"', ['true', '/'])

Joins the map structure into HTML attributes .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
10
)
:
arg_3
=
socket
.
getaddrinfo
(
arg_0
,
arg_1
,
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
if
not
arg_3
:
raise
Exception
(
"Could not translate address '%s:%s'"
%
(
arg_0
,
str
(
arg_1
)
)
)
arg_4
=
socket
.
socket
(
arg_3
[
0
]
[
0
]
,
arg_3
[
0
]
[
1
]
,
arg_3
[
0
]
[
2
]
)
arg_4
.
setblocking
(
0
)
try
:
arg_4
.
bind
(
arg_3
[
0
]
[
4
]
)
arg_4
.
listen
(
arg_2
)
except
socket
.
error
as
e
:
if
e
.
errno
!=
errno
.
EINPROGRESS
:
raise
return
arg_4

def Func(arg_0, arg_1, arg_2=10):
    """Create a TCP listening socket for a server."""
    arg_3 = socket.getaddrinfo(arg_0, arg_1, socket.AF_INET, socket.SOCK_STREAM)
    if not arg_3:
        raise Exception("Could not translate address '%s:%s'"
                        % (arg_0, str(arg_1)))
    arg_4 = socket.socket(arg_3[0][0], arg_3[0][1], arg_3[0][2])
    arg_4.setblocking(0)  # 0=non-blocking
    try:
        arg_4.bind(arg_3[0][4])
        arg_4.listen(arg_2)
    except socket.error as e:
        if e.errno != errno.EINPROGRESS:
            raise
    return arg_4

Create a TCP listening socket for a server .


def Func(arg_0=None):
    """
    Get slabs info.
    """
    arg_1 = {}
    for arg_2 in mc_client.get_slabs():
        arg_3 = arg_2[0].split(' ')
        arg_4 = arg_3[0]
        if arg_0 and arg_0 == arg_4:
            return arg_2[1]
        arg_1[arg_4] = arg_2[1]
    return arg_1


def
Func
(
arg_0
)
:
if
arg_0
.
is_freezed
:
arg_1
=
type
(
arg_0
)
.
__name__
raise
InvalidOperationException
(
'obj {name} is freezed.'
.
format
(
arg_1
=
arg_1
)
)

def Func(arg_0):
        '''raise `InvalidOperationException` if is freezed.'''
        if arg_0.is_freezed:
            arg_1 = type(arg_0).__name__
            raise InvalidOperationException('obj {name} is freezed.'.format(arg_1=arg_1))

raise InvalidOperationException if is freezed .


def Func(arg_0, arg_1=None):
        """Parse the command line arguments."""
        arg_1 = sys.argv[1:] if arg_1 is None else arg_1

        if arg_1 and arg_1[0] == 'help':
            # turn `ipython help notebook` into `ipython notebook -h`
            arg_1 = arg_1[1:] + ['-h']

        if arg_0.subcommands and len(arg_1) > 0:
            # we have subcommands, and one may have been specified
            arg_2, arg_3 = arg_1[0], arg_1[1:]
            if re.match(r'^\w(\-?\w)*$', arg_2) and arg_2 in arg_0.subcommands:
                # it's a subcommand, and *not* a flag or class parameter
                return arg_0.initialize_subcommand(arg_2, arg_3)

        if '-h' in arg_1 or '--help' in arg_1 or '--help-all' in arg_1:
            arg_0.print_description()
            arg_0.print_help('--help-all' in arg_1)
            arg_0.print_examples()
            arg_0.exit(0)

        if '--version' in arg_1 or '-V' in arg_1:
            arg_0.print_version()
            arg_0.exit(0)

        # flatten flags&aliases, so cl-args get appropriate priority:
        arg_4,arg_5 = arg_0.flatten_flags()

        arg_6 = KVArgParseConfigLoader(arg_1=arg_1, arg_5=arg_5,
                                        arg_4=arg_4)
        arg_7 = arg_6.load_config()
        arg_0.update_config(arg_7)
        # store unparsed args in extra_args
        arg_0.extra_args = arg_6.extra_args


def Func ( ) : arg_0 = os . path . join ( os . path . dirname ( __file__ ) , _PROFILE_HTML ) with io . open ( arg_0 , 'rb' ) as res_file : arg_1 = res_file . read ( ) return arg_1 , 'text/html'

def Func():
        """Handles index.html requests."""
        arg_0 = os.path.join(
            os.path.dirname(__file__), _PROFILE_HTML)
        with io.open(arg_0, 'rb') as res_file:
            arg_1 = res_file.read()
        return arg_1, 'text/html'


(self, node, node_name, breaker_classes=())

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = ( ) ) : if not arg_0 . _tryfinallys : return arg_4 = arg_1 . parent arg_5 = arg_1 while arg_4 and not isinstance ( arg_4 , arg_3 ) : if hasattr ( arg_4 , "finalbody" ) and arg_5 in arg_4 . finalbody : arg_0 . add_message ( "lost-exception" , arg_1 = arg_1 , args = arg_2 ) return arg_5 = arg_4 arg_4 = arg_5 . parent

def Func(arg_0, arg_1, arg_2, arg_3=()):
        """check that a node is not inside a finally clause of a
        try...finally statement.
        If we found before a try...finally bloc a parent which its type is
        in breaker_classes, we skip the whole check."""
        # if self._tryfinallys is empty, we're not an in try...finally block
        if not arg_0._tryfinallys:
            return
        # the node could be a grand-grand...-children of the try...finally
        arg_4 = arg_1.parent
        arg_5 = arg_1
        while arg_4 and not isinstance(arg_4, arg_3):
            if hasattr(arg_4, "finalbody") and arg_5 in arg_4.finalbody:
                arg_0.add_message("lost-exception", arg_1=arg_1, args=arg_2)
                return
            arg_5 = arg_4
            arg_4 = arg_5.parent

check that a node is not inside a finally clause of a try ... finally statement . If we found before a try ... finally bloc a parent which its type is in breaker_classes we skip the whole check .


def Func(arg_0, arg_1):
    """ Returns the most common base at each site in order. """

    arg_2 = np.zeros((arg_0.shape[1], 4), dtype=np.uint8)
    arg_2[:, 1] = 46

    for arg_3 in xrange(arg_0.shape[1]):
        ## expand colums with ambigs and remove N-
        arg_4 = np.zeros(111, dtype=np.int64)
        arg_5 = np.bincount(arg_0[:, arg_3])#, minlength=90)
        arg_4[:arg_5.shape[0]] = arg_5
        ## set N and - to zero, wish numba supported minlen arg
        arg_4[78] = 0
        arg_4[45] = 0
        ## add ambig counts to true bases
        for arg_7 in xrange(arg_1.shape[0]):
            arg_8 = arg_4[arg_1[arg_7, 0]]
            for arg_9 in xrange(arg_8):
                arg_4[arg_1[arg_7, 1]] += 1
                arg_4[arg_1[arg_7, 2]] += 1
            arg_4[arg_1[arg_7, 0]] = 0

        ## now get counts from the modified counts arr
        arg_10 = np.argmax(arg_4)
        arg_2[arg_3, 0] = arg_10
        arg_4[arg_10] = 0

        ## if an alt allele fill over the "." placeholder
        arg_10 = np.argmax(arg_4)
        if arg_10:
            arg_2[arg_3, 1] = arg_10
            arg_4[arg_10] = 0

            ## if 3rd or 4th alleles observed then add to arr
            arg_10 = np.argmax(arg_4)
            arg_2[arg_3, 2] = arg_10
            arg_4[arg_10] = 0

            ## if 3rd or 4th alleles observed then add to arr
            arg_10 = np.argmax(arg_4)
            arg_2[arg_3, 3] = arg_10

    return arg_2

Returns the most common base at each site in order .


def Func ( arg_0 = 3 ) : arg_1 = [ ] arg_2 = sys . modules arg_3 = get_frame_locals ( arg_0 ) [ '__name__' ] arg_4 = arg_2 [ arg_3 ] for arg_5 , arg_6 in traverse_local_prefs ( arg_0 ) : arg_7 = arg_6 [ arg_5 ] if isinstance ( arg_7 , PrefProxy ) : arg_1 . append ( arg_5 ) arg_8 = type ( arg_3 , ( ModuleType , ModuleProxy ) , { } ) ( arg_3 ) arg_8 . bind ( arg_4 , arg_1 ) arg_2 [ arg_3 ] = arg_8

def Func(arg_0=3):
    """Replaces a settings module with a Module proxy to intercept
    an access to settings.

    :param int depth: Frame count to go backward.

    """
    arg_1 = []

    arg_2 = sys.modules
    arg_3 = get_frame_locals(arg_0)['__name__']

    arg_4 = arg_2[arg_3]

    for arg_5, arg_6 in traverse_local_prefs(arg_0):

        arg_7 = arg_6[arg_5]

        if isinstance(arg_7, PrefProxy):
            arg_1.append(arg_5)

    arg_8 = type(arg_3, (ModuleType, ModuleProxy), {})(arg_3)  # ModuleProxy
    arg_8.bind(arg_4, arg_1)

    arg_2[arg_3] = arg_8

Replaces a settings module with a Module proxy to intercept an access to settings .


def Func(arg_0, arg_1):
        """
        Load parameters for Ephemeral Diffie-Hellman

        :param dhfile: The file to load EDH parameters from (``bytes`` or
            ``unicode``).

        :return: None
        """
        arg_1 = _path_string(arg_1)

        arg_2 = _lib.BIO_new_file(arg_1, b"r")
        if arg_2 == _ffi.NULL:
            _raise_current_error()
        arg_2 = _ffi.gc(arg_2, _lib.BIO_free)

        arg_3 = _lib.PEM_read_bio_DHparams(arg_2, _ffi.NULL, _ffi.NULL, _ffi.NULL)
        arg_3 = _ffi.gc(arg_3, _lib.DH_free)
        _lib.SSL_CTX_set_tmp_dh(arg_0._context, arg_3)

Load parameters for Ephemeral Diffie - Hellman


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = False arg_4 = arg_0 . _tc . GetStringSelection ( ) print "val" , arg_4 , arg_1 , arg_2 , arg_0 . startValue if arg_4 != arg_0 . startValue : arg_5 = True arg_3 . GetTable ( ) . SetValue ( arg_1 , arg_2 , arg_4 ) arg_0 . startValue = '' arg_0 . _tc . SetStringSelection ( '' ) return arg_5

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        "Complete the editing of the current cell. Returns True if changed"
        arg_5 = False
        arg_4 = arg_0._tc.GetStringSelection()
        print "val", arg_4, arg_1, arg_2, arg_0.startValue
        if arg_4 != arg_0.startValue:
            arg_5 = True
            arg_3.GetTable().SetValue(arg_1, arg_2, arg_4) # update the table
        arg_0.startValue = ''
        arg_0._tc.SetStringSelection('')
        return arg_5

Complete the editing of the current cell . Returns True if changed


def Func ( arg_0 , arg_1 , arg_2 = '' ) : if isinstance ( arg_1 , str ) : arg_1 = [ arg_1 ] arg_3 = [ getattr ( arg_0 , attr , arg_2 ) for attr in arg_1 ] if len ( arg_3 ) == 1 : return arg_3 [ 0 ] return tuple ( arg_3 )

def Func(arg_0, arg_1, arg_2=''):
        """Return the attributes values from this DicomFile

        Parameters
        ----------
        attributes: str or list of str
         DICOM field names

        default: str
         Default value if the attribute does not exist.

        Returns
        -------
        Value of the field or list of values.
        """
        if isinstance(arg_1, str):
            arg_1 = [arg_1]

        arg_3 = [getattr(arg_0, attr, arg_2) for attr in arg_1]

        if len(arg_3) == 1:
            return arg_3[0]

        return tuple(arg_3)


def Func ( arg_0 ) : arg_1 = len ( arg_0 ) arg_2 = np . zeros ( ( arg_1 , arg_1 ) ) arg_2 [ arg_3 ( arg_4 ( * ( arg_0 . items ( ) ) ) ) ] = 1 return arg_2

def Func(arg_0):
    """Converts a permutation into a permutation matrix.

    `matches` is a dictionary whose keys are vertices and whose values are
    partners. For each vertex ``u`` and ``v``, entry (``u``, ``v``) in the
    returned matrix will be a ``1`` if and only if ``matches[u] == v``.

    Pre-condition: `matches` must be a permutation on an initial subset of the
    natural numbers.

    Returns a permutation matrix as a square NumPy array.

    """
    arg_1 = len(arg_0)
    arg_2 = np.zeros((arg_1, arg_1))
    # This is a cleverer way of doing
    #
    #     for (u, v) in matches.items():
    #         P[u, v] = 1
    #
    arg_2[arg_3(arg_4(*(arg_0.items())))] = 1
    return arg_2

Converts a permutation into a permutation matrix .


def
Func
(
arg_0
)
:
arg_1
=
len
(
arg_0
)
if
arg_1
not
in
(
3
,
6
)
:
raise
ValueError
(
'Hex string #{} is too long'
.
format
(
arg_0
)
)
arg_2
=
r'[0-9a-f]{{{length}}}'
.
format
(
arg_1
=
arg_1
)
if
not
re
.
search
(
arg_2
,
arg_0
,
re
.
I
)
:
raise
ValueError
(
'Invalid Hex String: #{}'
.
format
(
arg_0
)
)

def Func(arg_0):
    """
    Check if the given hex value is a valid RGB color

    It should match the format: [0-9a-fA-F]
    and be of length 3 or 6.
    """
    arg_1 = len(arg_0)
    if arg_1 not in (3, 6):
        raise ValueError('Hex string #{} is too long'.format(arg_0))

    arg_2 = r'[0-9a-f]{{{length}}}'.format(arg_1=arg_1)
    if not re.search(arg_2, arg_0, re.I):
        raise ValueError('Invalid Hex String: #{}'.format(arg_0))


def Func(arg_0, arg_1):
  """Validates that job and task argument names do not overlap."""

  if not arg_1:
    return

  arg_2 = arg_1[0].task_params

  # The use case for specifying a label or env/input/output parameter on
  # the command-line and also including it in the --tasks file is not obvious.
  # Should the command-line override the --tasks file? Why?
  # Until this use is articulated, generate an error on overlapping names.

  # Check labels
  arg_3 = {label.name for label in arg_0['labels']}
  arg_4 = {label.name for label in arg_2['labels']}

  arg_5 = arg_3 & arg_4
  if arg_5:
    raise ValueError(
        'Names for labels on the command-line and in the --tasks file must not '
        'be repeated: {}'.format(','.join(arg_5)))

  # Check envs, inputs, and outputs, all of which must not overlap each other
  arg_3 = {
      item.name
      for item in arg_0['envs'] | arg_0['inputs']
      | arg_0['outputs']
  }
  arg_4 = {
      item.name
      for item in arg_2['envs'] | arg_2['inputs']
      | arg_2['outputs']
  }

  arg_5 = arg_3 & arg_4
  if arg_5:
    raise ValueError(
        'Names for envs, inputs, and outputs on the command-line and in the '
        '--tasks file must not be repeated: {}'.format(','.join(arg_5)))

Validates that job and task argument names do not overlap .


def Func ( arg_0 ) : if 'extraIncludes' in arg_0 . description : return [ os . path . normpath ( arg_1 ) for arg_1 in arg_0 . description [ 'extraIncludes' ] ] else : return [ ]

def Func(arg_0):
        ''' Some components must export whole directories full of headers into
            the search path. This is really really bad, and they shouldn't do
            it, but support is provided as a concession to compatibility.
        '''
        if 'extraIncludes' in arg_0.description:
            return [os.path.normpath(arg_1) for arg_1 in arg_0.description['extraIncludes']]
        else:
            return []

Some components must export whole directories full of headers into the search path . This is really really bad and they shouldn t do it but support is provided as a concession to compatibility .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_3 = arg_0 . get ( arg_1 = arg_1 , ** arg_2 ) arg_4 = arg_0 . endpoint + '%d/%s/' % ( arg_3 [ 'id' ] , 'update_inventory_sources' ) return client . post ( arg_4 , data = { } ) . json ( )

def Func(arg_0, arg_1=None, **arg_2):
        """Update all related inventory sources of the given inventory.

        Note global option --format is not available here, as the output would always be JSON-formatted.

        =====API DOCS=====
        Update all related inventory sources of the given inventory.

        :param pk: Primary key of the given inventory.
        :type pk: int
        :param `**kwargs`: Keyword arguments list of available fields used for searching resource objects.
        :returns: A JSON object of update status of the given inventory.
        :rtype: dict
        =====API DOCS=====
        """
        arg_3 = arg_0.get(arg_1=arg_1, **arg_2)
        arg_4 = arg_0.endpoint + '%d/%s/' % (arg_3['id'], 'update_inventory_sources')
        return client.post(arg_4, data={}).json()

Update all related inventory sources of the given inventory .


def Func(arg_0, arg_1):
        """Process IQ stanza received.

        :Parameters:
            - `stanza`: the stanza received
        :Types:
            - `stanza`: `Iq`

        If a matching handler is available pass the stanza to it.  Otherwise
        ignore it if it is "error" or "result" stanza or return
        "feature-not-implemented" error if it is "get" or "set"."""

        arg_2 = arg_1.stanza_type
        if arg_2 in ("result", "error"):
            return arg_0._Func_response(arg_1)
        if arg_2 not in ("get", "set"):
            raise BadRequestProtocolError("Bad <iq/> type")
        logger.debug("Handling <iq type='{0}'> stanza: {1!r}".format(
                                                            arg_1, arg_2))
        arg_3 = arg_1.get_payload(None)
        logger.debug("  payload: {0!r}".format(arg_3))
        if not arg_3:
            raise BadRequestProtocolError("<iq/> stanza with no child element")
        arg_4 = arg_0._get_iq_handler(arg_2, arg_3)
        if not arg_4:
            arg_3 = arg_1.get_payload(None, specialize = True)
            logger.debug("  specialized payload: {0!r}".format(arg_3))
            if not isinstance(arg_3, XMLPayload):
                arg_4 = arg_0._get_iq_handler(arg_2, arg_3)
        if arg_4:
            arg_5 = arg_4(arg_1)
            arg_0._process_handler_result(arg_5)
            return True
        else:
            raise ServiceUnavailableProtocolError("Not implemented")


def
Func
(
arg_0
)
:
arg_0
.
count
(
)
arg_0
.
verify_words
(
)
arg_0
.
verify_user
(
)
if
arg_0
.
review_requested
==
'yes'
:
arg_0
.
label_suspicious
(
'Review requested'
)

def Func(arg_0):
        """Execute the count and verify_words methods."""
        arg_0.count()
        arg_0.verify_words()
        arg_0.verify_user()

        if arg_0.review_requested == 'yes':
            arg_0.label_suspicious('Review requested')

Execute the count and verify_words methods .


def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or arg_0 . pid with db . session . begin_nested ( ) : before_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) arg_2 , arg_3 = arg_0 . fetch_published ( ) assert PIDStatus . REGISTERED == arg_2 . status assert arg_3 [ '_deposit' ] == arg_0 [ '_deposit' ] arg_0 . model . json = arg_0 . _prepare_Func ( arg_3 ) flag_modified ( arg_0 . model , 'json' ) db . session . merge ( arg_0 . model ) after_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) return arg_0 . __class__ ( arg_0 . model . json , arg_4 = arg_0 . model )

def Func(arg_0, arg_1=None):
        """Edit deposit.

        #. The signal :data:`invenio_records.signals.before_record_update`
           is sent before the Func execution.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['_deposit']['pid'] = record.revision_id
            deposit['_deposit']['status'] = 'draft'
            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the Func execution.

        #. The deposit index is updated.

        Status required: `published`.

        .. note:: the process fails if the pid has status
            :attr:`invenio_pidstore.models.PIDStatus.REGISTERED`.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.
        """
        arg_1 = arg_1 or arg_0.pid

        with db.session.begin_nested():
            before_record_update.send(
                current_app._get_current_object(), arg_3=arg_0)

            arg_2, arg_3 = arg_0.fetch_published()
            assert PIDStatus.REGISTERED == arg_2.status
            assert arg_3['_deposit'] == arg_0['_deposit']

            arg_0.model.json = arg_0._prepare_Func(arg_3)

            flag_modified(arg_0.model, 'json')
            db.session.merge(arg_0.model)

        after_record_update.send(
            current_app._get_current_object(), arg_3=arg_0)
        return arg_0.__class__(arg_0.model.json, arg_4=arg_0.model)

Edit deposit.

        #. The signal :data:`invenio_records.signals.before_record_update`
           is sent before the edit execution.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['_deposit']['pid'] = record.revision_id
            deposit['_deposit']['status'] = 'draft'
            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the edit execution.

        #. The deposit index is updated.

        Status required: `published`.

        .. note:: the process fails if the pid has status
            :attr:`invenio_pidstore.models.PIDStatus.REGISTERED`.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.


def Func(arg_0, arg_1=0):
        """Returns a color for the queue.

        Parameters
        ----------
        which : int (optional, default: ``0``)
            Specifies the type of color to return.

        Returns
        -------
        color : list
            Returns a RGBA color that is represented as a list with 4
            entries where each entry can be any floating point number
            between 0 and 1.

            * If ``which`` is 1 then it returns the color of the edge
              as if it were a self loop. This is specified in
              ``colors['edge_loop_color']``.
            * If ``which`` is 2 then it returns the color of the vertex
              pen color (defined as color/vertex_color in
              :meth:`.QueueNetworkDiGraph.graph_draw`). This is
              specified in ``colors['vertex_color']``.
            * If ``which`` is anything else, then it returns the a
              shade of the edge that is proportional to the number of
              agents in the system -- which includes those being
              servered and those waiting to be served. More agents
              correspond to darker edge colors. Uses
              ``colors['vertex_fill_color']`` if the queue sits on a
              loop, and ``colors['edge_color']`` otherwise.
        """
        if arg_1 == 1:
            arg_2 = arg_0.colors['edge_loop_color']

        elif arg_1 == 2:
            arg_2 = arg_0.colors['vertex_color']

        else:
            arg_3 = arg_0.coloring_sensitivity * arg_0.num_servers + 1.
            arg_4 = 1. - min(arg_0.num_system / arg_3, 1)

            if arg_0.edge[0] == arg_0.edge[1]:
                arg_2 = [i * arg_4 for i in arg_0.colors['vertex_fill_color']]
                arg_2[3] = 1.0
            else:
                arg_2 = [i * arg_4 for i in arg_0.colors['edge_color']]
                arg_2[3] = 1 / 2.

        return arg_2


def Func(arg_0):
        """Read both GPIO bus states and return a 16 bit value with their state.
        D0-D7 are the lower 8 bits and C0-C7 are the upper 8 bits.
        """
        # Send command to read low byte and high byte.
        arg_0._write('\x81\x83')
        # Wait for 2 byte response.
        arg_1 = arg_0._poll_read(2)
        # Assemble response into 16 bit value.
        arg_2 = ord(arg_1[0])
        arg_3 = ord(arg_1[1])
        logger.debug('Read MPSSE GPIO low byte = {0:02X} and high byte = {1:02X}'.format(arg_2, arg_3))
        return (arg_3 << 8) | arg_2

Read both GPIO bus states and return a 16 bit value with their state . D0 - D7 are the lower 8 bits and C0 - C7 are the upper 8 bits .


(
            self, set_group_link_sharing_enabled_request
    )

async def Func(
            arg_0, arg_1
    ):
        """Set whether group link sharing is enabled for a conversation."""
        arg_2 = hangouts_pb2.SetGroupLinkSharingEnabledResponse()
        await arg_0._pb_request('conversations/setgrouplinksharingenabled',
                               arg_1,
                               arg_2)
        return arg_2

Set whether group link sharing is enabled for a conversation .


def Func ( arg_0 , arg_1 = False ) : if not len ( arg_0 . commentTimes ) : return for arg_2 in range ( len ( arg_0 . commentTimes ) ) : arg_3 , arg_4 = arg_0 . commentTimes [ arg_2 ] , arg_0 . commentTags [ arg_2 ] if arg_1 : arg_3 = arg_3 / 60 pylab . axvline ( arg_3 , lw = 1 , color = 'r' , ls = "--" , alpha = .5 ) arg_5 , arg_6 , arg_7 , arg_8 = pylab . axis ( ) arg_8 = arg_8 - abs ( arg_8 - arg_7 ) * .02 pylab . text ( arg_3 , arg_8 , arg_4 , size = 8 , color = 'r' , rotation = 'vertical' , ha = 'right' , va = 'top' , weight = 'bold' , alpha = .5 ) if arg_1 : pylab . xlabel ( "minutes" ) else : pylab . xlabel ( "seconds" )

def Func(arg_0,arg_1=False):
    """draw vertical lines at comment points. Defaults to seconds."""
    if not len(arg_0.commentTimes):
        return
    for arg_2 in range(len(arg_0.commentTimes)):
        arg_3,arg_4 = arg_0.commentTimes[arg_2],arg_0.commentTags[arg_2]
        if arg_1:
            arg_3=arg_3/60
        pylab.axvline(arg_3,lw=1,color='r',ls="--",alpha=.5)
        arg_5,arg_6,arg_7,arg_8=pylab.axis()
        arg_8=arg_8-abs(arg_8-arg_7)*.02
        pylab.text(arg_3,arg_8,arg_4,size=8,color='r',rotation='vertical',
                   ha='right',va='top',weight='bold',alpha=.5)
        if arg_1:
            pylab.xlabel("minutes")
        else:
            pylab.xlabel("seconds")

draw vertical lines at comment points . Defaults to seconds .


(self, job, expected_statuses=(GcpTransferOperationStatus.SUCCESS,), timeout=60)

def Func(arg_0, arg_1, arg_2=(arg_3.SUCCESS,), arg_5=60):
        """
        Waits until the job reaches the expected state.

        :param job: Transfer job
            See:
            https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferJobs#TransferJob
        :type job: dict
        :param expected_statuses: State that is expected
            See:
            https://cloud.google.com/storage-transfer/docs/reference/rest/v1/transferOperations#Status
        :type expected_statuses: set[str]
        :param timeout:
        :type timeout: time in which the operation must end in seconds
        :rtype: None
        """
        while arg_5 > 0:
            arg_6 = arg_0.list_transfer_operations(
                filter={FILTER_PROJECT_ID: arg_1[PROJECT_ID], FILTER_JOB_NAMES: [arg_1[NAME]]}
            )

            if GCPTransferServiceHook.operations_contain_expected_statuses(arg_6, arg_2):
                return
            time.sleep(TIME_TO_SLEEP_IN_SECONDS)
            arg_5 -= TIME_TO_SLEEP_IN_SECONDS
        raise AirflowException("Timeout. The operation could not be completed within the allotted time.")

Waits until the job reaches the expected state .


def Func ( arg_0 , ** arg_1 ) : arg_2 = list ( arg_0 ) arg_1 [ '_return_info' ] = True arg_3 = [ repr2 ( item , ** arg_1 ) for item in arg_2 ] arg_4 = [ t [ 0 ] for t in arg_3 ] arg_5 = max ( [ t [ 1 ] [ 'max_height' ] for t in arg_3 ] ) if arg_3 else 0 arg_6 = { 'max_height' : arg_5 + 1 , } arg_7 = arg_1 . get ( 'sort' , None ) if arg_7 is None : arg_7 = isinstance ( arg_0 , ( set , frozenset ) ) if arg_7 : arg_4 = _sort_itemstrs ( arg_2 , arg_4 ) return arg_4 , arg_6

def Func(arg_0, **arg_1):
    """
    Create a string representation for each item in a list.
    """
    arg_2 = list(arg_0)
    arg_1['_return_info'] = True
    arg_3 = [repr2(item, **arg_1) for item in arg_2]
    arg_4 = [t[0] for t in arg_3]
    arg_5 = max([t[1]['max_height'] for t in arg_3]) if arg_3 else 0
    arg_6 = {
        'max_height': arg_5 + 1,
    }

    arg_7 = arg_1.get('sort', None)
    if arg_7 is None:
        # Force orderings on sets.
        arg_7 = isinstance(arg_0, (set, frozenset))
    if arg_7:
        arg_4 = _sort_itemstrs(arg_2, arg_4)
    return arg_4, arg_6

Create a string representation for each item in a list .


(self, data_view_id, num_candidates, effort, target=None, constraints=[], sampler="Default")

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=[], arg_6="Default"):
        """
        Submits a new experimental design run.

        :param data_view_id: The ID number of the data view to which the
            run belongs, as a string
        :type data_view_id: str
        :param num_candidates: The number of candidates to return
        :type num_candidates: int
        :param target: An :class:``Target`` instance representing
            the design run optimization target
        :type target: :class:``Target``
        :param constraints: An array of design constraints (instances of
            objects which extend :class:``BaseConstraint``)
        :type constraints: list of :class:``BaseConstraint``
        :param sampler: The name of the sampler to use during the design run:
            either "Default" or "This view"
        :type sampler: str
        :return: A :class:`DesignRun` instance containing the UID of the
            new run
        """
        if arg_3 > 30:
            raise CitrinationClientError("Parameter effort must be less than 30 to trigger a design run")

        if arg_4 is not None:
            arg_4 = arg_4.to_dict()

        arg_7 = [c.to_dict() for c in arg_5]

        arg_8 = {
            "num_candidates": arg_2,
            "target": arg_4,
            "effort": arg_3,
            "constraints": arg_7,
            "sampler": arg_6
        }

        arg_9 = routes.submit_data_view_design(arg_1)

        arg_10 = arg_0._post_json(arg_9, arg_8).json()

        return DesignRun(arg_10["data"]["design_run"]["uid"])


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 . temp_path , 'empty.csv' ) try : arg_2 = open ( arg_1 , 'w' ) arg_2 . write ( ',' ) arg_2 . close ( ) except IOError as e : raise PODocsError ( e ) arg_0 . _upload_file_to_gdoc ( arg_1 , content_type = 'text/csv' ) os . remove ( arg_1 )

def Func(arg_0):
        """
        Clear GDoc Spreadsheet by sending empty csv file.
        """
        arg_1 = os.path.join(arg_0.temp_path, 'empty.csv')
        try:
            arg_2 = open(arg_1, 'w')
            arg_2.write(',')
            arg_2.close()
        except IOError as e:
            raise PODocsError(e)

        arg_0._upload_file_to_gdoc(arg_1, content_type='text/csv')

        os.remove(arg_1)

Clear GDoc Spreadsheet by sending empty csv file .


def Func(arg_0, arg_1):
        """
        Create the specified cgroup.

        :param path: The path of the cgroup to create.
        E.g. cpu/mygroup/mysubgroup
        :return: the Node associated with the created cgroup.
        :rtype: cgroupspy.nodes.Node
        """
        arg_2 = trees.Tree().root
        arg_3 = arg_1.split(os.sep)
        for arg_4 in arg_3:
            arg_5 = {x.name: x for x in arg_2.children}
            if arg_4 not in arg_5:
                arg_0.log.debug("Creating cgroup %s in %s", arg_4, arg_2.path)
                arg_2 = arg_2.create_cgroup(arg_4)
            else:
                arg_0.log.debug(
                    "Not creating cgroup %s in %s since it already exists",
                    arg_4, arg_2.path
                )
                arg_2 = arg_5[arg_4]
        return arg_2


def
Func
(
arg_0
:
arg_1
)
:
arg_0
=
op
.
abspath
(
op
.
expanduser
(
arg_0
)
)
if
not
op
.
isfile
(
arg_0
)
:
raise
IOError
(
"Could not find file in {}."
.
format
(
arg_0
)
)
return
arg_0
,
_use_openpyxl_or_xlrf
(
arg_0
)

def Func(arg_0: arg_1):
    """ Return the expanded absolute path of `xl_path` if
    if exists and 'xlrd' or 'openpyxl' depending on
    which module should be used for the Excel file in `xl_path`.

    Parameters
    ----------
    xl_path: str
        Path to an Excel file

    Returns
    -------
    xl_path: str
        User expanded and absolute path to `xl_path`

    module: str
        The name of the module you should use to process the
        Excel file.
        Choices: 'xlrd', 'pyopenxl'

    Raises
    ------
    IOError
        If the file does not exist

    RuntimError
        If a suitable reader for xl_path is not found
    """
    arg_0 = op.abspath(op.expanduser(arg_0))

    if not op.isfile(arg_0):
        raise IOError("Could not find file in {}.".format(arg_0))

    return arg_0, _use_openpyxl_or_xlrf(arg_0)

Return the expanded absolute path of xl_path if if exists and xlrd or openpyxl depending on which module should be used for the Excel file in xl_path .


def Func(arg_0):
        """
        Create perm-vm if not exist and insert into FAB security model for all-dags.
        """
        # create perm for global logical dag
        for arg_1 in arg_0.DAG_VMS:
            for arg_2 in arg_0.DAG_PERMS:
                arg_0._merge_perm(permission_name=arg_2,
                                 view_menu_name=arg_1)

Create perm - vm if not exist and insert into FAB security model for all - dags .


def Func ( arg_0 ) : if arg_0 == 1 : return ones ( 1 ) arg_1 = arange ( 0 , arg_0 ) arg_2 = sin ( pi * arg_1 / ( arg_0 - 1. ) ) return arg_2

def Func(arg_0):
    r"""Cosine tapering window also known as sine window.

    :param N: window length

    .. math:: w(n) = \cos\left(\frac{\pi n}{N-1} - \frac{\pi}{2}\right) = \sin \left(\frac{\pi n}{N-1}\right)

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import window_visu
        window_visu(64, 'cosine')

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    if arg_0 ==1:
        return ones(1)
    arg_1 = arange(0, arg_0)
    arg_2 = sin(pi*arg_1/(arg_0-1.))
    return arg_2

r Cosine tapering window also known as sine window .


def Func(arg_0):
    """Since Flask 0.8 we're monkeypatching the files object in case a
    request is detected that does not use multipart form data but the files
    object is accessed.
    """
    arg_1 = arg_0.files.__class__
    class arg_4(arg_1):
        def __getitem__(arg_2, arg_3):
            try:
                return arg_1.__getitem__(arg_2, arg_3)
            except KeyError as e:
                if arg_3 not in arg_0.form:
                    raise
                raise DebugFilesKeyError(arg_0, arg_3)
    arg_4.__name__ = arg_1.__name__
    arg_4.__module__ = arg_1.__module__
    arg_0.files.__class__ = arg_4

Since Flask 0 . 8 we re monkeypatching the files object in case a request is detected that does not use multipart form data but the files object is accessed .


def Func():
    """Open your web browser and display the generated html documentation.
    """
    import webbrowser

    # copy from paver
    arg_0 = options
    arg_1 = path(arg_0.get('docroot', 'docs'))
    if not arg_1.exists():
        raise BuildFailure("Sphinx documentation root (%s) does not exist."
                           % arg_1)
    arg_2 = arg_1 / arg_0.get("builddir", ".build")
    # end of copy

    arg_2=arg_2 / 'html'
    if not arg_2.exists():
        raise BuildFailure("Sphinx build directory (%s) does not exist."
                           % arg_2)

    webbrowser.open(arg_2 / 'index.html')

Open your web browser and display the generated html documentation .


(users, level, message_text, extra_tags='', date=None, url=None, fail_silently=False)

def Func(arg_0, arg_1, arg_2, arg_3='', arg_4=None, arg_5=None, arg_6=False):
    """
    Send a message to a list of users without passing through `django.contrib.messages`

    :param users: an iterable containing the recipients of the messages
    :param level: message level
    :param message_text: the string containing the message
    :param extra_tags: like the Django api, a string containing extra tags for the message
    :param date: a date, different than the default timezone.now
    :param url: an optional url
    :param fail_silently: not used at the moment
    """
    arg_7 = stored_messages_settings.STORAGE_BACKEND
    arg_8 = arg_7()
    arg_9 = arg_8.create_message(arg_1, arg_2, arg_3, arg_4, arg_5)
    arg_8.archive_store(arg_0, arg_9)
    arg_8.inbox_store(arg_0, arg_9)

Send a message to a list of users without passing through django . contrib . messages


def Func ( arg_0 ) : arg_0 . hook = CassandraHook ( cassandra_conn_id = arg_0 . cassandra_conn_id ) arg_2 = arg_0 . hook . get_conn ( ) arg_3 = arg_2 . execute ( arg_0 . cql ) return arg_3

def Func(arg_0):
        """
        Queries cassandra and returns a cursor to the results.
        """
        arg_0.hook = CassandraHook(cassandra_conn_id=arg_0.cassandra_conn_id)
        arg_2 = arg_0.hook.get_conn()
        arg_3 = arg_2.execute(arg_0.cql)
        return arg_3

Queries cassandra and returns a cursor to the results .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _rdd . Func ( arg_1 ) return arg_0 . _constructor ( arg_2 , ordered = False ) . __finalize__ ( arg_0 )

def Func(arg_0, arg_1):
        """
        Repartitions the underlying RDD

        Parameters
        ----------
        npartitions : int
            Number of partitions to repartion the underlying RDD to
        """

        arg_2 = arg_0._rdd.Func(arg_1)
        return arg_0._constructor(arg_2, ordered=False).__finalize__(arg_0)


def Func ( arg_0 ) : def get_link_display ( arg_1 ) : arg_2 = unquote ( arg_1 . split ( '%2F' ) [ - 1 ] ) if sys . version_info . major == 2 : from django . utils . encoding import force_unicode arg_2 = force_unicode ( arg_2 ) return escape ( arg_2 ) def get_template_substitution_values ( arg_3 , arg_4 ) : arg_5 = super ( arg_0 , arg_3 ) . get_template_substitution_values ( arg_4 ) arg_5 [ 'initial' ] = get_link_display ( arg_4 . url ) return arg_5 setattr ( arg_0 , 'get_template_substitution_values' , get_template_substitution_values ) def get_context ( arg_3 , arg_6 , arg_4 , arg_7 ) : arg_8 = super ( arg_0 , arg_3 ) . get_context ( arg_6 , arg_4 , arg_7 ) if arg_4 and hasattr ( arg_4 , 'url' ) : arg_8 [ 'widget' ] [ 'display' ] = get_link_display ( arg_4 . url ) return arg_8 setattr ( arg_0 , 'get_context' , get_context ) return arg_0

def Func(arg_0):
    """Edit the download-link inner text."""

    def get_link_display(arg_1):
        arg_2 = unquote(arg_1.split('%2F')[-1])
        if sys.version_info.major == 2:  # python 2
            from django.utils.encoding import force_unicode
            arg_2 = force_unicode(arg_2)
        return escape(arg_2)

    def get_template_substitution_values(arg_3, arg_4):
        # Used by Django < 1.11
        arg_5 = super(arg_0, arg_3).get_template_substitution_values(arg_4)
        arg_5['initial'] = get_link_display(arg_4.url)
        return arg_5
    setattr(arg_0,
            'get_template_substitution_values',
            get_template_substitution_values)

    def get_context(arg_3, arg_6, arg_4, arg_7):
        arg_8 = super(arg_0, arg_3).get_context(arg_6, arg_4, arg_7)
        if arg_4 and hasattr(arg_4, 'url'):
            arg_8['widget']['display'] = get_link_display(arg_4.url)
        return arg_8
    setattr(arg_0, 'get_context', get_context)

    return arg_0


def Func(arg_0=None, arg_1=None):
    """Sort separate line segments in obj format into a continuous polyline or polylines.
    NOT FINISHED; DO NOT USE

    Also measures the length of each polyline

    Return polyline and polylineMeta (lengths)

    """
    arg_2 = os.path.splitext(arg_0)[1][1:].strip().lower()
    if arg_2 != 'obj':
        print('Input file must be obj. Exiting ...')
        sys.exit(1)
    arg_3 = open(arg_0, 'r')
    arg_4 = True
    arg_5 = []
    arg_6 = []
    for arg_7 in arg_3:
        arg_8, arg_9, arg_10, arg_11 = arg_7.split()
        if arg_8 == 'v':
            arg_5.append(
                [util.to_float(arg_9), util.to_float(arg_10), util.to_float(arg_11)])
        elif arg_8 == 'l':
            arg_12 = arg_9
            arg_13 = arg_10
            arg_6.append([int(arg_12), int(arg_13)])

    arg_3.close()
    if arg_1 is not None:
        arg_14 = open(arg_1, 'a')
        #log_file.write('***Axis Aligned Bounding Results for file "%s":\n' % fbasename)
        """log_file.write('min = %s\n' % aabb['min'])
        log_file.write('max = %s\n' % aabb['max'])
        log_file.write('center = %s\n' % aabb['center'])
        log_file.write('size = %s\n' % aabb['size'])
        log_file.write('diagonal = %s\n' % aabb['diagonal'])"""
        arg_14.close()
    # print(aabb)
    return None

Sort separate line segments in obj format into a continuous polyline or polylines . NOT FINISHED ; DO NOT USE


(self, image, alpha=0.75, cmap="jet", resize="heatmaps")

def Func ( arg_0 , arg_1 , arg_2 = 0.75 , arg_3 = "jet" , arg_4 = "heatmaps" ) : ia . do_assert ( arg_1 . ndim == 3 ) ia . do_assert ( arg_1 . shape [ 2 ] == 3 ) ia . do_assert ( arg_1 . dtype . type == np . uint8 ) ia . do_assert ( 0 - 1e-8 <= arg_2 <= 1.0 + 1e-8 ) ia . do_assert ( arg_4 in [ "heatmaps" , "image" ] ) if arg_4 == "image" : arg_1 = ia . imresize_single_image ( arg_1 , arg_0 . arr_0to1 . shape [ 0 : 2 ] , interpolation = "cubic" ) arg_5 = arg_0 . draw ( size = arg_1 . shape [ 0 : 2 ] if arg_4 == "heatmaps" else None , arg_3 = arg_3 ) arg_6 = [ np . clip ( ( 1 - arg_2 ) * arg_1 + arg_2 * heatmap_i , 0 , 255 ) . astype ( np . uint8 ) for heatmap_i in arg_5 ] return arg_6

def Func(arg_0, arg_1, arg_2=0.75, arg_3="jet", arg_4="heatmaps"):
        """
        Draw the heatmaps as overlays over an image.

        Parameters
        ----------
        image : (H,W,3) ndarray
            Image onto which to draw the heatmaps. Expected to be of dtype uint8.

        alpha : float, optional
            Alpha/opacity value to use for the mixing of image and heatmaps.
            Higher values mean that the heatmaps will be more visible and the image less visible.

        cmap : str or None, optional
            Color map to use. See :func:`imgaug.HeatmapsOnImage.draw` for details.

        resize : {'heatmaps', 'image'}, optional
            In case of size differences between the image and heatmaps, either the image or
            the heatmaps can be resized. This parameter controls which of the two will be resized
            to the other's size.

        Returns
        -------
        mix : list of (H,W,3) ndarray
            Rendered overlays. One per heatmap array channel. Dtype is uint8.

        """
        # assert RGB image
        ia.do_assert(arg_1.ndim == 3)
        ia.do_assert(arg_1.shape[2] == 3)
        ia.do_assert(arg_1.dtype.type == np.uint8)

        ia.do_assert(0 - 1e-8 <= arg_2 <= 1.0 + 1e-8)
        ia.do_assert(arg_4 in ["heatmaps", "image"])

        if arg_4 == "image":
            arg_1 = ia.imresize_single_image(arg_1, arg_0.arr_0to1.shape[0:2], interpolation="cubic")

        arg_5 = arg_0.draw(
            size=arg_1.shape[0:2] if arg_4 == "heatmaps" else None,
            arg_3=arg_3
        )

        arg_6 = [
            np.clip((1-arg_2) * arg_1 + arg_2 * heatmap_i, 0, 255).astype(np.uint8)
            for heatmap_i
            in arg_5
        ]

        return arg_6

Draw the heatmaps as overlays over an image .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
os
.
path
.
join
(
arg_0
.
dirs
.
fastqs
,
"{}_R1_.fastq.gz"
.
format
(
arg_1
)
)
arg_5
=
io
.
BufferedWriter
(
gzip
.
open
(
arg_4
,
'w'
)
)
arg_6
=
[
'cat'
]
for
arg_7
in
arg_2
:
arg_6
+=
[
arg_7
]
arg_8
=
sps
.
Popen
(
[
'which'
,
'pigz'
]
,
stderr
=
sps
.
PIPE
,
stdout
=
sps
.
PIPE
)
.
communicate
(
)
if
arg_8
[
0
]
.
strip
(
)
:
arg_9
=
[
"pigz"
]
else
:
arg_9
=
[
"gzip"
]
arg_10
=
sps
.
Popen
(
arg_6
,
stderr
=
sps
.
PIPE
,
stdout
=
sps
.
PIPE
)
arg_11
=
sps
.
Popen
(
arg_9
,
stdin
=
arg_10
.
stdout
,
stderr
=
sps
.
PIPE
,
stdout
=
arg_5
)
arg_12
=
arg_11
.
communicate
(
)
if
arg_11
.
returncode
:
raise
IPyradWarningExit
(
"error in Func R1 %s"
,
arg_12
)
arg_10
.
stdout
.
close
(
)
arg_5
.
close
(
)
for
arg_7
in
arg_2
:
os
.
remove
(
arg_7
)
if
'pair'
in
arg_0
.
paramsdict
[
"datatype"
]
:
arg_13
=
os
.
path
.
join
(
arg_0
.
dirs
.
fastqs
,
"{}_R2_.fastq.gz"
.
format
(
arg_1
)
)
arg_5
=
io
.
BufferedWriter
(
gzip
.
open
(
arg_13
,
'w'
)
)
arg_6
=
[
'cat'
]
for
arg_7
in
arg_3
:
arg_6
+=
[
arg_7
]
arg_10
=
sps
.
Popen
(
arg_6
,
stderr
=
sps
.
PIPE
,
stdout
=
sps
.
PIPE
)
arg_11
=
sps
.
Popen
(
arg_9
,
stdin
=
arg_10
.
stdout
,
stderr
=
sps
.
PIPE
,
stdout
=
arg_5
)
arg_12
=
arg_11
.
communicate
(
)
if
arg_11
.
returncode
:
raise
IPyradWarningExit
(
"error in Func R2 %s"
,
arg_12
)
arg_10
.
stdout
.
close
(
)
arg_5
.
close
(
)
for
arg_7
in
arg_3
:
os
.
remove
(
arg_7
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Collate temp fastq files in tmp-dir into 1 gzipped sample.
    """
    ## out handle
    arg_4 = os.path.join(arg_0.dirs.fastqs, "{}_R1_.fastq.gz".format(arg_1))
    arg_5 = io.BufferedWriter(gzip.open(arg_4, 'w'))

    ## build cmd
    arg_6 = ['cat']
    for arg_7 in arg_2:
        arg_6 += [arg_7]

    ## compression function
    arg_8 = sps.Popen(['which', 'pigz'], stderr=sps.PIPE, stdout=sps.PIPE).communicate()
    if arg_8[0].strip():
        arg_9 = ["pigz"]
    else:
        arg_9 = ["gzip"]

    ## call cmd
    arg_10 = sps.Popen(arg_6, stderr=sps.PIPE, stdout=sps.PIPE)
    arg_11 = sps.Popen(arg_9, stdin=arg_10.stdout, stderr=sps.PIPE, stdout=arg_5)
    arg_12 = arg_11.communicate()
    if arg_11.returncode:
        raise IPyradWarningExit("error in Func R1 %s", arg_12)
    arg_10.stdout.close()
    arg_5.close()

    ## then cleanup
    for arg_7 in arg_2:
        os.remove(arg_7)

    if 'pair' in arg_0.paramsdict["datatype"]:
        ## out handle
        arg_13 = os.path.join(arg_0.dirs.fastqs, "{}_R2_.fastq.gz".format(arg_1))
        arg_5 = io.BufferedWriter(gzip.open(arg_13, 'w'))

        ## build cmd
        arg_6 = ['cat']
        for arg_7 in arg_3:
            arg_6 += [arg_7]

        ## call cmd
        arg_10 = sps.Popen(arg_6, stderr=sps.PIPE, stdout=sps.PIPE)
        arg_11 = sps.Popen(arg_9, stdin=arg_10.stdout, stderr=sps.PIPE, stdout=arg_5)
        arg_12 = arg_11.communicate()
        if arg_11.returncode:
            raise IPyradWarningExit("error in Func R2 %s", arg_12)
        arg_10.stdout.close()
        arg_5.close()

        ## then cleanup
        for arg_7 in arg_3:
            os.remove(arg_7)

Collate temp fastq files in tmp - dir into 1 gzipped sample .


def Func(arg_0, arg_1, arg_2=False):
    """Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be Funcged and the name (within the module) of the object
    with the docstring with tests to be Funcged.
    """
    arg_0 = _normalize_module(arg_0)
    arg_3 = testsource(arg_0, arg_1)
    Func_script(arg_3, arg_2, arg_0.__dict__)

Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
if
arg_0
.
endswith
(
'.csv'
)
:
arg_2
=
'csv'
elif
arg_0
.
endswith
(
'.jsons'
)
:
arg_2
=
'jsons'
else
:
with
open
(
arg_0
)
as
opened
:
arg_3
=
opened
.
readline
(
)
if
arg_3
[
0
]
not
in
'{['
and
not
arg_0
.
endswith
(
'.json'
)
:
arg_2
=
'csv'
else
:
if
(
arg_3
.
count
(
'{'
)
==
arg_3
.
count
(
'}'
)
and
arg_3
.
count
(
'['
)
==
arg_3
.
count
(
']'
)
)
:
arg_4
=
' '
while
arg_4
.
isspace
(
)
:
arg_4
=
opened
.
read
(
)
if
arg_4
==
''
:
arg_2
=
'json'
break
if
arg_2
is
:
arg_2
=
'jsons'
else
:
arg_2
=
'json'
if
arg_2
==
'json'
:
arg_5
=
json
.
load
(
open
(
arg_0
)
,
encoding
=
'utf-8'
)
elif
arg_2
==
'csv'
:
arg_5
=
open_csv_somehow
(
arg_0
)
else
:
arg_5
=
stream_json_lines
(
arg_0
)
return
_normalize_data
(
arg_5
,
arg_1
=
arg_1
)

def Func(arg_0, arg_1=None):
    """
    Deduce the format of a file, within reason.

    - If the filename ends with .csv or .txt, it's csv.
    - If the filename ends with .jsons, it's a JSON stream (conveniently the
      format we want to output).
    - If the filename ends with .json, it could be a legitimate JSON file, or
      it could be a JSON stream, following a nonstandard convention that many
      people including us are guilty of. In that case:
      - If the first line is a complete JSON document, and there is more in the
        file besides the first line, then it is a JSON stream.
      - Otherwise, it is probably really JSON.
    - If the filename does not end with .json, .jsons, or .csv, we have to guess
      whether it's still CSV or tab-separated values or something like that.
      If it's JSON, the first character would almost certainly have to be a
      bracket or a brace. If it isn't, assume it's CSV or similar.
    """
    arg_2 = None
    if arg_0.endswith('.csv'):
        arg_2 = 'csv'
    elif arg_0.endswith('.jsons'):
        arg_2 = 'jsons'
    else:
        with open(arg_0) as opened:
            arg_3 = opened.readline()
            if arg_3[0] not in '{[' and not arg_0.endswith('.json'):
                arg_2 = 'csv'
            else:
                if (arg_3.count('{') == arg_3.count('}') and
                    arg_3.count('[') == arg_3.count(']')):
                    # This line contains a complete JSON document. This probably
                    # means it's in linewise JSON ('.jsons') format, unless the
                    # whole file is on one line.
                    arg_4 = ' '
                    while arg_4.isspace():
                        arg_4 = opened.read()
                        if arg_4 == '':
                            arg_2 = 'json'
                            break
                    if arg_2 is None:
                        arg_2 = 'jsons'
                else:
                    arg_2 = 'json'

    if arg_2 == 'json':
        arg_5 = json.load(open(arg_0), encoding='utf-8')
    elif arg_2 == 'csv':
        arg_5 = open_csv_somehow(arg_0)
    else:
        arg_5 = stream_json_lines(arg_0)

    return _normalize_data(arg_5, arg_1=arg_1)

Deduce the format of a file within reason .


def Func ( arg_0 ) : arg_1 = make_response ( ) arg_2 = authomatic . Func ( WerkzeugAdapter ( request , arg_1 ) , arg_0 ) if arg_2 : if arg_2 . user : arg_2 . user . update ( ) return render_template ( 'Func.html' , arg_2 = arg_2 ) return arg_1

def Func(arg_0):
    """
    Login handler, must accept both GET and POST to be able to use OpenID.
    """

    # We need response object for the WerkzeugAdapter.
    arg_1 = make_response()

    # Log the user in, pass it the adapter and the provider name.
    arg_2 = authomatic.Func(
        WerkzeugAdapter(
            request,
            arg_1),
        arg_0)

    # If there is no LoginResult object, the Func procedure is still pending.
    if arg_2:
        if arg_2.user:
            # We need to update the user to get more info.
            arg_2.user.update()

        # The rest happens inside the template.
        return render_template('Func.html', arg_2=arg_2)

    # Don't forget to return the response.
    return arg_1

Login handler must accept both GET and POST to be able to use OpenID .


def Func(arg_0):
        """
        Get the multiple sequence alignment, including reconstructed sequences for
        the internal nodes.

        Returns
        -------
        new_aln : MultipleSeqAlignment
           Alignment including sequences of all internal nodes

        """
        from Bio.Align import MultipleSeqAlignment
        from Bio.Seq import Seq
        from Bio.SeqRecord import SeqRecord
        arg_0.logger("TreeAnc.Func ...",2)
        if not hasattr(arg_0.tree.root, 'sequence'):
            arg_0.logger("TreeAnc.reconstructed_alignment... reconstruction not yet done",3)
            arg_0.reconstruct_anc('probabilistic')

        arg_1 = MultipleSeqAlignment([SeqRecord(id=n.name, seq=Seq("".join(n.sequence)), description="")
                                        for n in arg_0.tree.find_clades()])

        return arg_1

Get the multiple sequence alignment including reconstructed sequences for the internal nodes .


return self._format_tree(
            call_tree['children'][0], call_tree['sampleCount'])

def Func ( arg_0 ) : Func = { 'stack' : 'base' , 'sampleCount' : 0 , 'children' : [ ] } for arg_2 , arg_3 in arg_0 . _stats . items ( ) : arg_0 . _insert_stack ( reversed ( arg_2 ) , arg_3 , Func ) arg_0 . _fill_sample_count ( Func ) if not Func [ 'children' ] : return { } return arg_0 . _format_tree ( Func [ 'children' ] [ 0 ] , Func [ 'sampleCount' ] )

def Func(arg_0):
        """Returns call tree."""
        Func = {'stack': 'base', 'sampleCount': 0, 'children': []}
        for arg_2, arg_3 in arg_0._stats.items():
            arg_0._insert_stack(reversed(arg_2), arg_3, Func)
        arg_0._fill_sample_count(Func)
        if not Func['children']:
            return {}
        return arg_0._format_tree(
            Func['children'][0], Func['sampleCount'])


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . re_extends . match ( arg_1 ) if arg_2 : arg_3 = arg_0 . re_extends . sub ( '' , arg_1 , count = 1 ) arg_4 = arg_0 . get_blocks ( arg_3 ) arg_5 = os . path . join ( arg_0 . base_dir , arg_2 . group ( 'path' ) ) with open ( arg_5 , encoding = 'utf-8' ) as fp : return arg_0 . replace_blocks_in_extends ( fp . read ( ) , arg_4 ) else : return None

def Func(arg_0, arg_1):
        """replace all blocks in extends with current blocks"""
        arg_2 = arg_0.re_extends.match(arg_1)
        if arg_2:
            arg_3 = arg_0.re_extends.sub('', arg_1, count=1)
            arg_4 = arg_0.get_blocks(arg_3)
            arg_5 = os.path.join(arg_0.base_dir, arg_2.group('path'))
            with open(arg_5, encoding='utf-8') as fp:
                return arg_0.replace_blocks_in_extends(fp.read(), arg_4)
        else:
            return None


def Func(arg_0, arg_1):
    '''Handler for cp command'''

    arg_0.validate('cmd|s3|s3', arg_1)
    arg_2 = arg_1[1]
    arg_3 = arg_1[2]
    arg_0.s3handler().cp_files(arg_2, arg_3)


(self, param, allowed_values=None, optional=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
)
:
arg_4
=
arg_0
.
_request_params
(
)
if
arg_1
in
arg_4
:
arg_5
=
arg_4
[
arg_1
]
.
lower
(
)
if
arg_2
is
not
:
if
arg_5
in
arg_2
:
arg_0
.
params
[
arg_1
]
=
arg_5
else
:
raise
OWSInvalidParameterValue
(
"%s %s is not supported"
%
(
arg_1
,
arg_5
)
,
arg_5
=
arg_1
)
elif
arg_3
:
arg_0
.
params
[
arg_1
]
=
else
:
raise
OWSMissingParameterValue
(
'Parameter "%s" is missing'
%
arg_1
,
arg_5
=
arg_1
)
return
arg_0
.
params
[
arg_1
]

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """Get parameter in GET request."""
        arg_4 = arg_0._request_params()
        if arg_1 in arg_4:
            arg_5 = arg_4[arg_1].lower()
            if arg_2 is not None:
                if arg_5 in arg_2:
                    arg_0.params[arg_1] = arg_5
                else:
                    raise OWSInvalidParameterValue("%s %s is not supported" % (arg_1, arg_5), arg_5=arg_1)
        elif arg_3:
            arg_0.params[arg_1] = None
        else:
            raise OWSMissingParameterValue('Parameter "%s" is missing' % arg_1, arg_5=arg_1)
        return arg_0.params[arg_1]


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( 'rerank' , True ) if arg_3 : if not arg_0 . id : arg_0 . _process_new_rank_obj ( ) elif arg_0 . rank == arg_0 . _rank_at_load : pass else : arg_0 . _process_moved_rank_obj ( ) super ( RankedModel , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Overridden method that handles that re-ranking of objects and the
        integrity of the ``rank`` field.

        :param rerank:
            Added parameter, if True will rerank other objects based on the
            change in this Func.  Defaults to True.
        """
        arg_3 = arg_2.pop('rerank', True)
        if arg_3:
            if not arg_0.id:
                arg_0._process_new_rank_obj()
            elif arg_0.rank == arg_0._rank_at_load:
                # nothing changed
                pass
            else:
                arg_0._process_moved_rank_obj()

        super(RankedModel, arg_0).Func(*arg_1, **arg_2)

Overridden method that handles that re-ranking of objects and the
        integrity of the ``rank`` field.

        :param rerank:
            Added parameter, if True will rerank other objects based on the
            change in this save.  Defaults to True.

Overridden method that handles that re - ranking of objects and the integrity of the rank field .


def Func ( arg_0 , arg_1 = '' ) : if arg_0 . _Funced : arg_0 . axes . clear ( ) arg_0 . _Funced = True if not arg_0 . _ext_fig : arg_0 . fig = plt . figure ( figsize = arg_0 . figsize ) if not arg_0 . _ext_axes : arg_0 . axes = Axes3D ( arg_0 . fig , azim = arg_0 . view [ 0 ] , elev = arg_0 . view [ 1 ] ) if arg_0 . background : arg_0 . axes . clear ( ) arg_0 . axes . set_xlim3d ( - 1.3 , 1.3 ) arg_0 . axes . set_ylim3d ( - 1.3 , 1.3 ) arg_0 . axes . set_zlim3d ( - 1.3 , 1.3 ) else : arg_0 . plot_axes ( ) arg_0 . axes . set_axis_off ( ) arg_0 . axes . set_xlim3d ( - 0.7 , 0.7 ) arg_0 . axes . set_ylim3d ( - 0.7 , 0.7 ) arg_0 . axes . set_zlim3d ( - 0.7 , 0.7 ) arg_0 . axes . grid ( False ) arg_0 . plot_back ( ) arg_0 . plot_points ( ) arg_0 . plot_vectors ( ) arg_0 . plot_front ( ) arg_0 . plot_axes_labels ( ) arg_0 . plot_annotations ( ) arg_0 . axes . set_title ( arg_1 , fontsize = arg_0 . font_size , y = 1.08 )

def Func(arg_0, arg_1=''):
        """
        Render the Bloch sphere and its data sets in on given figure and axes.
        """
        if arg_0._Funced:
            arg_0.axes.clear()

        arg_0._Funced = True

        # Figure instance for Bloch sphere plot
        if not arg_0._ext_fig:
            arg_0.fig = plt.figure(figsize=arg_0.figsize)

        if not arg_0._ext_axes:
            arg_0.axes = Axes3D(arg_0.fig, azim=arg_0.view[0], elev=arg_0.view[1])

        if arg_0.background:
            arg_0.axes.clear()
            arg_0.axes.set_xlim3d(-1.3, 1.3)
            arg_0.axes.set_ylim3d(-1.3, 1.3)
            arg_0.axes.set_zlim3d(-1.3, 1.3)
        else:
            arg_0.plot_axes()
            arg_0.axes.set_axis_off()
            arg_0.axes.set_xlim3d(-0.7, 0.7)
            arg_0.axes.set_ylim3d(-0.7, 0.7)
            arg_0.axes.set_zlim3d(-0.7, 0.7)

        arg_0.axes.grid(False)
        arg_0.plot_back()
        arg_0.plot_points()
        arg_0.plot_vectors()
        arg_0.plot_front()
        arg_0.plot_axes_labels()
        arg_0.plot_annotations()
        arg_0.axes.set_title(arg_1, fontsize=arg_0.font_size, y=1.08)

Render the Bloch sphere and its data sets in on given figure and axes .


def
Func
(
arg_0
)
:
arg_1
=
translation_table
(
arg_0
)
for
arg_2
,
arg_3
in
sorted
(
arg_1
.
items
(
)
,
key
=
operator
.
itemgetter
(
0
)
)
:
print
(
u'{language:<8} {name:\u3000<20}'
.
format
(
arg_3
=
arg_3
,
arg_0
=
arg_2
)
)
return

def Func(arg_0):
    '''
    Generates a formatted table of language codes
    '''
    arg_1 = translation_table(arg_0)

    for arg_2, arg_3 in sorted(arg_1.items(), key=operator.itemgetter(0)):
        print(u'{language:<8} {name:\u3000<20}'.format(
            arg_3=arg_3, arg_0=arg_2
        ))

    return None


def Func(arg_0, arg_1):  # pylint: disable=unused-argument
    """
    Check that if request user has implicit access to `ENTERPRISE_DASHBOARD_ADMIN_ROLE` feature role.

    Returns:
        boolean: whether the request user has access or not
    """
    arg_2 = get_request_or_stub()
    arg_3 = get_decoded_jwt_from_request(arg_2)
    return request_user_has_implicit_access_via_jwt(arg_3, ENTERPRISE_DASHBOARD_ADMIN_ROLE)

Check that if request user has implicit access to ENTERPRISE_DASHBOARD_ADMIN_ROLE feature role .


(data, headers, table_format=None, preserve_whitespace=False,
            **kwargs)

return iter(tabulate.tabulate(data, headers, **tkwargs).split('\n'))

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , ** arg_4 ) : arg_5 = ( 'floatfmt' , 'numalign' , 'stralign' , 'showindex' , 'disable_numparse' ) arg_6 = { 'tablefmt' : arg_2 } arg_6 . update ( filter_dict_by_key ( arg_4 , arg_5 ) ) if arg_2 in supported_markup_formats : arg_6 . update ( numalign = None , stralign = None ) arg_7 . PRESERVE_WHITESPACE = arg_3 return iter ( arg_7 . tabulate ( arg_0 , arg_1 , ** arg_6 ) . split ( '\n' ) )

def Func(arg_0, arg_1, arg_2=None, arg_3=False,
            **arg_4):
    """Wrap tabulate inside a function for TabularOutputFormatter."""
    arg_5 = ('floatfmt', 'numalign', 'stralign', 'showindex', 'disable_numparse')
    arg_6 = {'tablefmt': arg_2}
    arg_6.update(filter_dict_by_key(arg_4, arg_5))

    if arg_2 in supported_markup_formats:
        arg_6.update(numalign=None, stralign=None)

    arg_7.PRESERVE_WHITESPACE = arg_3

    return iter(arg_7.tabulate(arg_0, arg_1, **arg_6).split('\n'))

Wrap tabulate inside a function for TabularOutputFormatter .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . copy ( ) arg_3 = { } arg_1 = np . array ( arg_1 ) for arg_4 in arg_2 : arg_5 = arg_2 . columns . get ( arg_4 ) if arg_5 is not None : if isinstance ( arg_5 , ColumnIndexed ) : if arg_7 ( arg_5 . indices ) not in arg_3 : arg_6 = arg_5 . indices [ arg_1 ] arg_3 [ arg_7 ( arg_5 . indices ) ] = arg_6 else : arg_6 = arg_3 [ arg_7 ( arg_5 . indices ) ] arg_2 . columns [ arg_4 ] = ColumnIndexed ( arg_5 . df , arg_6 , arg_5 . name ) else : arg_2 . columns [ arg_4 ] = ColumnIndexed ( arg_0 , arg_1 , arg_4 ) arg_2 . _length_original = len ( arg_1 ) arg_2 . _length_unfiltered = arg_2 . _length_original arg_2 . set_selection ( None , arg_4 = FILTER_SELECTION_NAME ) return arg_2

def Func(arg_0, arg_1):
        '''Returns a DataFrame containing only rows indexed by indices

        {note_copy}

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df.Func([0,2])
         #  s      x
         0  a      1
         1  c      3

        :param indices: sequence (list or numpy array) with row numbers
        :return: DataFrame which is a shallow copy of the original data.
        :rtype: DataFrame
        '''
        arg_2 = arg_0.copy()
        # if the columns in ds already have a ColumnIndex
        # we could do, direct_indices = df.column['bla'].indices[indices]
        # which should be shared among multiple ColumnIndex'es, so we store
        # them in this dict
        arg_3 = {}
        arg_1 = np.array(arg_1)
        for arg_4 in arg_2:
            arg_5 = arg_2.columns.get(arg_4)
            if arg_5 is not None:
                # we optimize this somewhere, so we don't do multiple
                # levels of indirection
                if isinstance(arg_5, ColumnIndexed):
                    # TODO: think about what happpens when the indices are masked.. ?
                    if arg_7(arg_5.indices) not in arg_3:
                        arg_6 = arg_5.indices[arg_1]
                        arg_3[arg_7(arg_5.indices)] = arg_6
                    else:
                        arg_6 = arg_3[arg_7(arg_5.indices)]
                    arg_2.columns[arg_4] = ColumnIndexed(arg_5.df, arg_6, arg_5.name)
                else:
                    arg_2.columns[arg_4] = ColumnIndexed(arg_0, arg_1, arg_4)
        arg_2._length_original = len(arg_1)
        arg_2._length_unfiltered = arg_2._length_original
        arg_2.set_selection(None, arg_4=FILTER_SELECTION_NAME)
        return arg_2

Returns a DataFrame containing only rows indexed by indices

        {note_copy}

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df.take([0,2])
         #  s      x
         0  a      1
         1  c      3

        :param indices: sequence (list or numpy array) with row numbers
        :return: DataFrame which is a shallow copy of the original data.
        :rtype: DataFrame


def Func ( arg_0 , arg_1 = '' ) : return imageio . imread ( os . path . join ( arg_1 , arg_0 ) )

def Func(arg_0, arg_1=''):
    """Read one image.

    Parameters
    -----------
    image : str
        The image file name.
    path : str
        The image folder path.

    Returns
    -------
    numpy.array
        The image.

    """
    return imageio.imread(os.path.join(arg_1, arg_0))


async def Func(arg_0):
        """Sync conversation state and events that could have been missed."""
        logger.info('Syncing events since {}'.format(arg_0.Func_timestamp))
        try:
            arg_1 = await arg_0._client.sync_all_new_events(
                hangouts_pb2.SyncAllNewEventsRequest(
                    request_header=arg_0._client.get_request_header(),
                    lastFunc_timestamp=parsers.to_timestamp(
                        arg_0.Func_timestamp
                    ),
                    max_response_size_bytes=1048576,  # 1 MB
                )
            )
        except exceptions.NetworkError as e:
            logger.warning('Failed to sync events, some events may be lost: {}'
                           .format(e))
        else:
            for arg_2 in arg_1.conversation_state:
                arg_3 = arg_2.conversation_id.id
                arg_4 = arg_0._conv_dict.get(arg_3, None)
                if arg_4 is not None:
                    arg_4.update_conversation(arg_2.conversation)
                    for arg_5 in arg_2.event:
                        arg_6 = parsers.from_timestamp(arg_5.timestamp)
                        if arg_6 > arg_0.Func_timestamp:
                            # This updates the sync_timestamp for us, as well
                            # as triggering events.
                            await arg_0._on_event(arg_5)
                else:
                    arg_0._add_conversation(
                        arg_2.conversation,
                        arg_2.event,
                        arg_2.event_continuation_token
                    )

Sync conversation state and events that could have been missed .


def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . ZF == False , 1 , 0 ) )

def Func(arg_0, arg_1):
        """
        Sets byte if not zero.

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_1.write(Operators.ITEBV(arg_1.size, arg_0.ZF == False, 1, 0))


def Func ( arg_0 , arg_1 = 2 ) : import warnings warnings . warn ( arg_0 , category = DeprecationWarning , arg_1 = arg_1 )

def Func(arg_0, arg_1=2):
    """Generate a non-silent deprecation warning with stacktrace.

    The used warning is ``imgaug.imgaug.DeprecationWarning``.

    Parameters
    ----------
    msg : str
        The message of the warning.

    stacklevel : int, optional
        How many steps above this function to "jump" in the stacktrace for
        the displayed file and line number of the error message.
        Usually 2.

    """
    import warnings
    warnings.warn(arg_0,
                  category=DeprecationWarning,
                  arg_1=arg_1)

Generate a non - silent deprecation warning with stacktrace .


def Func(arg_0, arg_1):
        """
        Notify observers of a new value.

        value -- new value
        """
        if arg_1 is not None and arg_1 != arg_0.last_value:
            arg_0.last_value = arg_1
            arg_0.emit('update', arg_1)


def Func ( arg_0 , arg_1 , arg_2 = 0 ) : arg_0 . chain . append ( ( arg_2 , arg_1 ) ) arg_0 . chain . sort ( key = lambda x : x [ 0 ] )

def Func(arg_0, arg_1, arg_2=0):
        """ Add a func to the cmd chain with given priority """
        arg_0.chain.append((arg_2, arg_1))
        arg_0.chain.sort(key=lambda x: x[0])


def Func(arg_0, arg_1, arg_2=0.5):
        """
        Returns a mix of two colors.
        """
        arg_3 = arg_0.r * (1 - arg_2) + arg_1.r * arg_2
        arg_4 = arg_0.g * (1 - arg_2) + arg_1.g * arg_2
        arg_5 = arg_0.b * (1 - arg_2) + arg_1.b * arg_2
        arg_6 = arg_0.a * (1 - arg_2) + arg_1.a * arg_2
        return Color(arg_3, arg_4, arg_5, arg_6, mode="rgb")


def Func(arg_0, arg_1=0, **arg_2):
        """
        Executes a query. Additional query parameters can be passed
        as keyword arguments.

        Returns: The request parameters and the raw query response.
        """
        arg_3 = arg_0._build_query(**arg_2)
        arg_0._page_offset = arg_1

        arg_3.update(
            arg_1=arg_0._page_offset,
            limit=min(arg_0._page_size, arg_0._limit)
        )

        logger.debug('executing query. from/limit: %6d/%d' %
                     (arg_3['offset'], arg_3['limit']))

        # If the request results in a SolveError (ie bad filter) set the error.
        try:
            arg_0._response = arg_0._client.post(arg_0._data_url, arg_3)
        except SolveError as e:
            arg_0._error = e
            raise

        logger.debug('query response took: %(took)d ms, total: %(total)d'
                     % arg_0._response)
        return arg_3, arg_0._response

Executes a query . Additional query parameters can be passed as keyword arguments .


def Func ( arg_0 ) : import errno try : return arg_0 . read ( ) except IOError , err : if err . errno != errno . EINTR : raise

def Func(arg_0):
    """Read from a pipe ignoring EINTR errors.

    This is necessary because when reading from pipes with GUI event loops
    running in the background, often interrupts are raised that stop the
    command from completing."""
    import errno

    try:
        return arg_0.read()
    except IOError, err:
        if err.errno != errno.EINTR:
            raise

Read from a pipe ignoring EINTR errors .


def Func ( arg_0 , arg_1 ) : if arg_0 . print_progress : print ( 'Beginning' , arg_0 . __class__ . __name__ ) arg_0 . _conn = arg_1 arg_0 . create_table ( arg_1 ) if arg_0 . mode in ( 'all' , 'import' ) and arg_0 . fname and arg_0 . exists ( ) and arg_0 . table not in ignore_tables : arg_0 . insert_data ( arg_1 ) if arg_0 . mode in ( 'all' , 'index' ) and hasattr ( arg_0 , 'index' ) : arg_0 . create_index ( arg_1 ) if arg_0 . mode in ( 'all' , 'import' ) and hasattr ( arg_0 , 'post_import' ) : arg_0 . run_post_import ( arg_1 ) arg_1 . commit ( )

def Func(arg_0, arg_1):
        """Do the actual import. Copy data and store in connection object.

        This function:
        - Creates the tables
        - Imports data (using self.gen_rows)
        - Run any post_import hooks.
        - Creates any indexs
        - Does *not* run self.make_views - those must be done
          after all tables are loaded.
        """
        if arg_0.print_progress:
            print('Beginning', arg_0.__class__.__name__)
        # what is this mystical self._conn ?
        arg_0._conn = arg_1

        arg_0.create_table(arg_1)
        # This does insertions
        if arg_0.mode in ('all', 'import') and arg_0.fname and arg_0.exists() and arg_0.table not in ignore_tables:
            arg_0.insert_data(arg_1)
        # This makes indexes in the DB.
        if arg_0.mode in ('all', 'index') and hasattr(arg_0, 'index'):
            arg_0.create_index(arg_1)
        # Any post-processing to be done after the full import.
        if arg_0.mode in ('all', 'import') and hasattr(arg_0, 'post_import'):
            arg_0.run_post_import(arg_1)
        # Commit it all
        arg_1.commit()

Do the actual import . Copy data and store in connection object .


def Func(arg_0: arg_1, arg_2: arg_1) -> arg_1:
    """
    Extended euclidean algorithm to find modular inverses for integers
    """
    if arg_0 == 0:
        return 0
    arg_3, arg_4 = 1, 0
    arg_5, arg_6 = arg_0 % arg_2, arg_2
    while arg_5 > 1:
        arg_7 = arg_6 // arg_5
        arg_8, arg_9 = arg_4 - arg_3 * arg_7, arg_6 - arg_5 * arg_7
        arg_3, arg_5, arg_4, arg_6 = arg_8, arg_9, arg_3, arg_5
    return arg_3 % arg_2


def Func ( arg_0 , arg_1 ) : if arg_0 . current_logging_level not in ( 'error' , 'exception' ) : return for arg_2 in arg_1 . keywords : if arg_2 . arg == 'exc_info' : if arg_0 . current_logging_level == 'error' : arg_3 = ERROR_EXC_INFO_VIOLATION else : arg_3 = REDUNDANT_EXC_INFO_VIOLATION arg_0 . violations . append ( ( arg_1 , arg_3 ) )

def Func(arg_0, arg_1):
        """
        Reports a violation if exc_info keyword is used with logging.error or logging.exception.

        """
        if arg_0.current_logging_level not in ('error', 'exception'):
            return

        for arg_2 in arg_1.keywords:
            if arg_2.arg == 'exc_info':
                if arg_0.current_logging_level == 'error':
                    arg_3 = ERROR_EXC_INFO_VIOLATION
                else:
                    arg_3 = REDUNDANT_EXC_INFO_VIOLATION
                arg_0.violations.append((arg_1, arg_3))

Reports a violation if exc_info keyword is used with logging . error or logging . exception .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
arg_3
,
**
arg_4
)
:
log
.
debug
(
'Save bearer token %r'
,
arg_1
)
arg_0
.
_tokensetter
(
arg_1
,
arg_2
,
*
arg_3
,
**
arg_4
)
return
arg_2
.
client
.
default_redirect_uri

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Persist the Bearer token."""
        log.debug('Save bearer token %r', arg_1)
        arg_0._tokensetter(arg_1, arg_2, *arg_3, **arg_4)
        return arg_2.client.default_redirect_uri


return self._read(channel + 0x04, gain, data_rate, ADS1x15_CONFIG_MODE_SINGLE)

def Func(arg_0, arg_1, arg_2=1, arg_3=None):
        """Read a single ADC channel and return the ADC value as a signed integer
        result.  Channel must be a value within 0-3.
        """
        assert 0 <= arg_1 <= 3, 'Channel must be a value within 0-3!'
        # Perform a single shot read and set the mux value to the channel plus
        # the highest bit (bit 3) set.
        return arg_0._read(arg_1 + 0x04, arg_2, arg_3, ADS1x15_CONFIG_MODE_SINGLE)

Read a single ADC channel and return the ADC value as a signed integer result . Channel must be a value within 0 - 3 .


Dont use this method from inside bytecode to call other bytecode.

def Func ( arg_0 , arg_1 , arg_2 = ( ) ) : if arg_0 . is_native : arg_3 = SpaceTuple ( arg_2 ) arg_3 . space = arg_0 . space return arg_0 . code ( arg_1 , arg_3 ) else : return arg_0 . space . exe . _Func ( arg_0 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=()):
        ''' Dont use this method from inside bytecode to Func other bytecode. '''
        if arg_0.is_native:
            arg_3 = SpaceTuple(
                arg_2
            )  # we have to do that unfortunately to pass all the necessary info to the funcs
            arg_3.space = arg_0.space
            return arg_0.code(
                arg_1, arg_3
            )  # must return valid js object - undefined, null, float, unicode, bool, or PyJs
        else:
            return arg_0.space.exe._Func(arg_0, arg_1,
                                        arg_2)

Dont use this method from inside bytecode to call other bytecode .


def Func ( arg_0 ) : arg_1 = ( arg_0 . GetAuthorityCode ( 'PROJCS' ) or arg_0 . GetAuthorityCode ( 'GEOGCS' ) ) try : return int ( arg_1 ) except TypeError : return

def Func(arg_0):
        """Returns the EPSG ID as int if it exists."""
        arg_1 = (arg_0.GetAuthorityCode('PROJCS') or
                   arg_0.GetAuthorityCode('GEOGCS'))
        try:
            return int(arg_1)
        except TypeError:
            return

Returns the EPSG ID as int if it exists .


def Func(arg_0, *arg_1, **arg_2):
        """Asserts that val is a dict and contains the given entry or entries."""
        arg_0._check_dict_like(arg_0.val, check_values=False)
        arg_3 = list(arg_1) + [{arg_6:v} for arg_6,v in arg_2.items()]
        if len(arg_3) == 0:
            raise ValueError('one or more entry args must be given')
        arg_4 = []
        for arg_5 in arg_3:
            if type(arg_5) is not dict:
                raise TypeError('given entry arg must be a dict')
            if len(arg_5) != 1:
                raise ValueError('given entry args must contain exactly one key-value pair')
            arg_6 = next(iter(arg_5))
            if arg_6 not in arg_0.val:
                arg_4.append(arg_5) # bad key
            elif arg_0.val[arg_6] != arg_5[arg_6]:
                arg_4.append(arg_5) # bad val
        if arg_4:
            arg_0._err('Expected <%s> to contain entries %s, but did not contain %s.' % (arg_0.val, arg_0._fmt_items(arg_3), arg_0._fmt_items(arg_4)))
        return arg_0

Asserts that val is a dict and contains the given entry or entries .


def Func ( arg_0 ) : arg_1 = sorted ( arg_0 . get_intervals ( True ) ) if arg_0 . tier_type == 'IntervalTier' : if not arg_1 : arg_1 . append ( ( arg_0 . xmin , arg_0 . xmax , '' ) ) else : if arg_1 [ 0 ] [ 0 ] > arg_0 . xmin : arg_1 . insert ( 0 , ( arg_0 . xmin , arg_1 [ 0 ] [ 0 ] , '' ) ) if arg_1 [ - 1 ] [ 1 ] < arg_0 . xmax : arg_1 . append ( ( arg_1 [ - 1 ] [ 1 ] , arg_0 . xmax , '' ) ) arg_2 = arg_1 [ - 1 ] for arg_3 , arg_4 in reversed ( list ( enumerate ( arg_1 [ : - 1 ] , 1 ) ) ) : if arg_2 [ 0 ] - arg_4 [ 1 ] != 0 : arg_1 . insert ( arg_3 , ( arg_4 [ 1 ] , arg_2 [ 0 ] , '' ) ) arg_2 = arg_4 return arg_1

def Func(arg_0):
        """Returns the true list of intervals including the empty intervals."""
        arg_1 = sorted(arg_0.get_intervals(True))
        if arg_0.tier_type == 'IntervalTier':
            if not arg_1:
                arg_1.append((arg_0.xmin, arg_0.xmax, ''))
            else:
                if arg_1[0][0] > arg_0.xmin:
                    arg_1.insert(0, (arg_0.xmin, arg_1[0][0], ''))
                if arg_1[-1][1] < arg_0.xmax:
                    arg_1.append((arg_1[-1][1], arg_0.xmax, ''))
                arg_2 = arg_1[-1]
                for arg_3, arg_4 in reversed(list(enumerate(arg_1[:-1], 1))):
                    if arg_2[0] - arg_4[1] != 0:
                        arg_1.insert(arg_3, (arg_4[1], arg_2[0], ''))
                    arg_2 = arg_4
        return arg_1

Returns the true list of intervals including the empty intervals .


def Func ( arg_0 , arg_1 , arg_2 ) : Func = Limit ( arg_1 , arg_2 ) if arg_0 . _groups : arg_0 . _groups [ - 1 ] . limit = Func else : arg_0 . _limit = Func return arg_0

def Func(arg_0, arg_1, arg_2):
        """
        Sets the limit for the most recent group or query.

        If no group has been defined yet (via `group_by()`) then this sets
        the limit for the initial pool of results from the query. Otherwise,
        this limits the number of items operated on from the previous group.

        Setting a limit on the initial search results may be useful when
        attempting to execute an aggregation on a sample of a large data set.

        ### Parameters

        - **offset**: Result offset from which to begin paging
        - **num**: Number of results to return

        Example of sorting the initial results:

        ```
        AggregateRequest('@sale_amount:[10000, inf]')\
            .limit(0, 10)\
            .group_by('@state', r.count())
        ```

        Will only group by the states found in the first 10 results of the
        query `@sale_amount:[10000, inf]`. On the other hand,

        ```
        AggregateRequest('@sale_amount:[10000, inf]')\
            .limit(0, 1000)\
            .group_by('@state', r.count()\
            .limit(0, 10)
        ```

        Will group all the results matching the query, but only return the
        first 10 groups.

        If you only wish to return a *top-N* style query, consider using
        `sort_by()` instead.

        """
        Func = Limit(arg_1, arg_2)
        if arg_0._groups:
            arg_0._groups[-1].limit = Func
        else:
            arg_0._limit = Func
        return arg_0

Sets the limit for the most recent group or query .


(engine,
                        old_crypto_factory,
                        new_crypto_factory,
                        logger)

def Func(arg_0,
                        arg_1,
                        arg_2,
                        arg_3):
    """
    Re-encrypt data for all users.

    This function is idempotent, meaning that it should be possible to apply
    the same re-encryption process multiple times without having any effect on
    the database.  Idempotency is achieved by first attempting to decrypt with
    the old crypto and falling back to the new crypto on failure.

    An important consequence of this strategy is that **decrypting** a database
    is not supported with this function, because ``NoEncryption.decrypt``
    always succeeds.  To decrypt an already-encrypted database, use
    ``unencrypt_all_users`` instead.

    It is, however, possible to perform an initial encryption of a database by
    passing a function returning a ``NoEncryption`` as ``old_crypto_factory``.

    Parameters
    ----------
    engine : SQLAlchemy.engine
        Engine encapsulating database connections.
    old_crypto_factory : function[str -> Any]
        A function from user_id to an object providing the interface required
        by PostgresContentsManager.crypto.  Results of this will be used for
        decryption of existing database content.
    new_crypto_factory : function[str -> Any]
        A function from user_id to an object providing the interface required
        by PostgresContentsManager.crypto.  Results of this will be used for
        re-encryption of database content.

        This **must not** return instances of ``NoEncryption``. Use
        ``unencrypt_all_users`` if you want to unencrypt a database.
    logger : logging.Logger, optional
        A logger to user during re-encryption.

    See Also
    --------
    reencrypt_user
    unencrypt_all_users
    """
    arg_3.info("Beginning re-encryption for all users.")
    for arg_4 in all_user_ids(arg_0):
        reencrypt_single_user(
            arg_0,
            arg_4,
            old_crypto=arg_1(arg_4),
            new_crypto=arg_2(arg_4),
            arg_3=arg_3,
        )
    arg_3.info("Finished re-encryption for all users.")


def Func ( arg_0 ) : arg_1 = np . abs ( read_img ( arg_0 ) . get_data ( ) ) return arg_1 . astype ( int )

def Func(arg_0):
    """ Return an image with the binarised version of the data of `img`."""
    arg_1 = np.abs(read_img(arg_0).get_data())
    return arg_1.astype(int)

Return an image with the binarised version of the data of img .


def Func(arg_0, arg_1):
        """Add a TimeoutHandler to the pool.
        """
        arg_0.timeout_handlers.append(arg_1)
        if arg_0.event_thread is None:
            return
        arg_0._run_timeout_threads(arg_1)


def Func(arg_0, arg_1, arg_2, arg_3):
    """ Encode a message with a shared secret between Alice and Bob

        :param PrivateKey priv: Private Key (of Alice)
        :param PublicKey pub: Public Key (of Bob)
        :param int nonce: Random nonce
        :param str message: Memo message
        :return: Encrypted message
        :rtype: hex

    """
    arg_4 = get_shared_secret(arg_0, arg_1)
    arg_5 = init_aes(arg_4, arg_2)
    " Checksum "
    arg_6 = bytes(arg_3, "utf8")
    arg_7 = hashlib.sha256(arg_6).digest()
    arg_6 = arg_7[0:4] + arg_6
    " Padding "
    arg_6 = _pad(arg_6, 16)
    " Encryption "
    return hexlify(arg_5.encrypt(arg_6)).decode("ascii")


def Func ( arg_0 , arg_1 ) : if ( arg_1 . account_id is None or arg_1 . type is None or arg_1 . report_id is None ) : raise ReportFailureException ( arg_1 ) arg_2 = ACCOUNTS_API . format ( arg_1 . account_id ) + "/reports/{}/{}" . format ( arg_1 . type , arg_1 . report_id ) arg_3 = arg_0 . _get_resource ( arg_2 ) arg_3 [ "account_id" ] = arg_1 . account_id return Report ( arg_3 = arg_3 )

def Func(arg_0, arg_1):
        """
        Returns the status of a report.

        https://canvas.instructure.com/doc/api/account_reports.html#method.account_reports.show
        """
        if (arg_1.account_id is None or arg_1.type is None or
                arg_1.report_id is None):
            raise ReportFailureException(arg_1)

        arg_2 = ACCOUNTS_API.format(arg_1.account_id) + "/reports/{}/{}".format(
            arg_1.type, arg_1.report_id)

        arg_3 = arg_0._get_resource(arg_2)
        arg_3["account_id"] = arg_1.account_id
        return Report(arg_3=arg_3)


def Func(arg_0, arg_1=0):
    """Convergent rounding.

    Round to neareas even, similar to Python3's round() method.
    """
    if sys.version_info[0] < 3:
        if arg_0 < 0.0:
            return -Func(-arg_0)

        arg_2 = 0.0000001
        arg_3, arg_4 = divmod(arg_0, 1)

        if abs(arg_0 - (arg_3 + 0.5)) < arg_2:
            if arg_3 % 2.0 < arg_2:
                return arg_3
            else:
                arg_5 = arg_3 + 0.5
                return math.ceil(arg_5)
    return round(arg_0, arg_1)