def Func(arg_0):
        """
        Installs the mod-security Apache module.

        https://www.modsecurity.org
        """
        arg_1 = arg_0.local_renderer
        if arg_1.env.modsecurity_enabled and not arg_0.last_manifest.modsecurity_enabled:

            arg_0.install_packages()

            # Write modsecurity.conf.
            arg_2 = arg_0.render_to_file('apache/apache_modsecurity.template.conf')
            arg_1.put(local_path=arg_2, remote_path='/etc/modsecurity/modsecurity.conf', use_sudo=True)

            # Write OWASP rules.
            arg_1.env.modsecurity_download_filename = '/tmp/owasp-modsecurity-crs.tar.gz'
            arg_1.sudo('cd /tmp; wget --output-document={apache_modsecurity_download_filename} {apache_modsecurity_download_url}')
            arg_1.env.modsecurity_download_top = arg_1.sudo(
                "cd /tmp; "
                "tar tzf %(apache_modsecurity_download_filename)s | sed -e 's@/.*@@' | uniq" % arg_0.genv)
            arg_1.sudo('cd /tmp; tar -zxvf %(apache_modsecurity_download_filename)s' % arg_0.genv)
            arg_1.sudo('cd /tmp; cp -R %(apache_modsecurity_download_top)s/* /etc/modsecurity/' % arg_0.genv)
            arg_1.sudo('mv /etc/modsecurity/modsecurity_crs_10_setup.conf.example  /etc/modsecurity/modsecurity_crs_10_setup.conf')

            arg_1.sudo('rm -f /etc/modsecurity/activated_rules/*')
            arg_1.sudo('cd /etc/modsecurity/base_rules; '
                'for f in * ; do ln -s /etc/modsecurity/base_rules/$f /etc/modsecurity/activated_rules/$f ; done')
            arg_1.sudo('cd /etc/modsecurity/optional_rules; '
                'for f in * ; do ln -s /etc/modsecurity/optional_rules/$f /etc/modsecurity/activated_rules/$f ; done')

            arg_1.env.httpd_conf_append.append('Include "/etc/modsecurity/activated_rules/*.conf"')

            arg_0.enable_mod('evasive')
            arg_0.enable_mod('headers')
        elif not arg_0.env.modsecurity_enabled and arg_0.last_manifest.modsecurity_enabled:
            arg_0.disable_mod('modsecurity')

Installs the mod - security Apache module .


def
Func
(
arg_0
=
,
**
arg_1
)
:
if
arg_0
is
not
:
if
isinstance
(
arg_0
,
six
.
string_types
)
:
if
'name'
in
arg_1
:
raise
ValueError
(
'name option duplicated'
)
arg_1
[
'name'
]
=
arg_0
else
:
return
Func
(
**
arg_1
)
(
arg_0
)
return
functools
.
partial
(
_Func
,
**
arg_1
)

def Func(arg_0=None, **arg_1):
    """Marks a method as RPC."""
    if arg_0 is not None:
        if isinstance(arg_0, six.string_types):
            if 'name' in arg_1:
                raise ValueError('name option duplicated')
            arg_1['name'] = arg_0
        else:
            return Func(**arg_1)(arg_0)
    return functools.partial(_Func, **arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
list
(
arg_0
.
graph
.
triples
(
(
arg_1
,
arg_0
.
spdx_namespace
[
'reviewer'
]
,
)
)
)
if
len
(
arg_2
)
!=
1
:
arg_0
.
error
=
True
arg_4
=
'Review must have exactly one reviewer'
arg_0
.
logger
.
log
(
arg_4
)
return
try
:
return
arg_0
.
builder
.
create_entity
(
arg_0
.
doc
,
six
.
text_type
(
arg_2
[
0
]
[
2
]
)
)
except
SPDXValueError
:
arg_0
.
value_error
(
'REVIEWER_VALUE'
,
arg_2
[
0
]
[
2
]
)

def Func(arg_0, arg_1):
        """Returns reviewer as creator object or None if failed.
        Reports errors on failure.
        """
        arg_2 = list(arg_0.graph.triples((arg_1, arg_0.spdx_namespace['reviewer'], None)))
        if len(arg_2) != 1:
            arg_0.error = True
            arg_4 = 'Review must have exactly one reviewer'
            arg_0.logger.log(arg_4)
            return
        try:
            return arg_0.builder.create_entity(arg_0.doc, six.text_type(arg_2[0][2]))
        except SPDXValueError:
            arg_0.value_error('REVIEWER_VALUE', arg_2[0][2])

Returns reviewer as creator object or None if failed . Reports errors on failure .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
"{}.lib"
,
"lib{}.lib"
,
"{}lib.lib"
]
arg_2
=
[
arg_5
.
format
(
arg_1
)
for
arg_5
in
arg_2
]
arg_3
=
arg_0
.
get_library_dirs
(
)
for
arg_4
in
arg_3
:
for
arg_5
in
arg_2
:
if
exists
(
join
(
arg_4
,
arg_5
)
)
:
return
arg_5
[
:
4
]
arg_6
=
"Could not find the {} library."
.
format
(
arg_1
)
raise
ValueError
(
arg_6
)

def Func(arg_0, arg_1):
        """Try to infer the correct library name."""
        arg_2 = ["{}.lib", "lib{}.lib", "{}lib.lib"]
        arg_2 = [arg_5.format(arg_1) for arg_5 in arg_2]
        arg_3 = arg_0.get_library_dirs()
        for arg_4 in arg_3:
            for arg_5 in arg_2:
                if exists(join(arg_4, arg_5)):
                    return arg_5[:-4]
        arg_6 = "Could not find the {} library.".format(arg_1)
        raise ValueError(arg_6)


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . graph . data_content_type . model_class ( ) arg_3 = Node . objects . create ( graph = arg_0 . graph ) arg_2 . objects . create ( arg_3 = arg_3 , ** arg_1 ) arg_3 . parents . add ( arg_0 ) arg_0 . children . add ( arg_3 ) return arg_3

def Func(arg_0, **arg_1):
        """Creates a new ``Node`` based on the extending class and adds it as
        a child to this ``Node``.

        :param kwargs:
            arguments for constructing the data object associated with this
            ``Node``
        :returns:
            extender of the ``Node`` class
        """
        arg_2 = arg_0.graph.data_content_type.model_class()
        arg_3 = Node.objects.create(graph=arg_0.graph)
        arg_2.objects.create(arg_3=arg_3, **arg_1)
        arg_3.parents.add(arg_0)
        arg_0.children.add(arg_3)
        return arg_3

Creates a new Node based on the extending class and adds it as a child to this Node .


(s, edges, alpha=1.0, weighted=False, directed=False)

def Func ( arg_0 , Func , arg_2 = 1.0 , arg_3 = False , arg_4 = False ) : arg_5 = arg_0 . _ctx . BezierPath ( ) if arg_4 and arg_0 . stroke : arg_6 = arg_0 . _ctx . BezierPath ( ) if arg_3 and arg_0 . fill : arg_7 = [ arg_0 . _ctx . BezierPath ( ) for i in range ( 11 ) ] if len ( Func ) == 0 : return for arg_8 in Func : try : arg_9 = arg_8 . node1 . graph . styles [ arg_8 . node1 . style ] except : arg_9 = arg_0 if arg_9 . edge : arg_9 . edge ( arg_9 , arg_5 , arg_8 , arg_2 ) if arg_4 and arg_0 . stroke : arg_9 . edge_arrow ( arg_9 , arg_6 , arg_8 , radius = 10 ) if arg_3 and arg_0 . fill : arg_9 . edge ( arg_9 , arg_7 [ int ( arg_8 . weight * 10 ) ] , arg_8 , arg_2 ) arg_0 . _ctx . autoclosepath ( False ) arg_0 . _ctx . nofill ( ) arg_0 . _ctx . nostroke ( ) if arg_3 and arg_0 . fill : Func0 = arg_8 . node1 . __class__ ( None ) . r arg_0 . _ctx . stroke ( arg_0 . fill . r , arg_0 . fill . g , arg_0 . fill . b , arg_0 . fill . a * 0.65 * arg_2 ) for Func1 in range ( 1 , len ( arg_7 ) ) : arg_0 . _ctx . strokewidth ( Func0 * Func1 * 0.1 ) arg_0 . _ctx . drawpath ( arg_7 [ Func1 ] . copy ( ) ) if arg_0 . stroke : arg_0 . _ctx . strokewidth ( arg_0 . strokewidth ) arg_0 . _ctx . stroke ( arg_0 . stroke . r , arg_0 . stroke . g , arg_0 . stroke . b , arg_0 . stroke . a * 0.65 * arg_2 ) arg_0 . _ctx . drawpath ( arg_5 . copy ( ) ) if arg_4 and arg_0 . stroke : Func2 = arg_0 . _ctx . color ( arg_0 . stroke . r , arg_0 . stroke . g , arg_0 . stroke . b , arg_0 . stroke . a * 0.65 * arg_2 ) Func2 . a *= 1.3 arg_0 . _ctx . stroke ( Func2 ) arg_0 . _ctx . drawpath ( arg_6 . copy ( ) ) for arg_8 in Func : try : arg_9 = self . styles [ arg_8 . node1 . style ] except : arg_9 = arg_0 if arg_9 . edge_label : arg_9 . edge_label ( arg_9 , arg_8 , arg_2 )

def Func(arg_0, Func, arg_2=1.0, arg_3=False, arg_4=False):

    """ Visualization of the edges in a network.
    """

    arg_5 = arg_0._ctx.BezierPath()

    if arg_4 and arg_0.stroke:
        arg_6 = arg_0._ctx.BezierPath()
    if arg_3 and arg_0.fill:
        arg_7 = [arg_0._ctx.BezierPath() for i in range(11)]

    # Draw the edges in a single BezierPath for speed.
    # Weighted edges are divided into ten BezierPaths,
    # depending on their weight rounded between 0 and 10.
    if len(Func) == 0: return
    for arg_8 in Func:
        try:  arg_9 = arg_8.node1.graph.styles[arg_8.node1.style]
        except: arg_9 = arg_0
        if arg_9.edge:
            arg_9.edge(arg_9, arg_5, arg_8, arg_2)
            if arg_4 and arg_0.stroke:
                arg_9.edge_arrow(arg_9, arg_6, arg_8, radius=10)
            if arg_3 and arg_0.fill:
                arg_9.edge(arg_9, arg_7[int(arg_8.weight*10)], arg_8, arg_2)

    arg_0._ctx.autoclosepath(False)
    arg_0._ctx.nofill()
    arg_0._ctx.nostroke()

    # All weighted edges use the default fill.
    if arg_3 and arg_0.fill:
        Func0 = arg_8.node1.__class__(None).r
        arg_0._ctx.stroke(
            arg_0.fill.r,
            arg_0.fill.g,
            arg_0.fill.b,
            arg_0.fill.a * 0.65 * arg_2
        )
        for Func1 in range(1, len(arg_7)):
            arg_0._ctx.strokewidth(Func0*Func1*0.1)
            arg_0._ctx.drawpath(arg_7[Func1].copy())

    # All edges use the default stroke.
    if arg_0.stroke:
        arg_0._ctx.strokewidth(arg_0.strokewidth)

        arg_0._ctx.stroke(
            arg_0.stroke.r,
            arg_0.stroke.g,
            arg_0.stroke.b,
            arg_0.stroke.a * 0.65 * arg_2
        )

    arg_0._ctx.drawpath(arg_5.copy())

    if arg_4 and arg_0.stroke:
        #clr = s._ctx.stroke().copy()
	Func2=arg_0._ctx.color(
            arg_0.stroke.r,
            arg_0.stroke.g,
            arg_0.stroke.b,
            arg_0.stroke.a * 0.65 * arg_2
        )

        Func2.a *= 1.3

	arg_0._ctx.stroke(Func2)

    	arg_0._ctx.drawpath(arg_6.copy())

    for arg_8 in Func:
        try:  arg_9 = self.styles[arg_8.node1.style]
        except: arg_9 = arg_0
        if arg_9.edge_label:
            arg_9.edge_label(arg_9, arg_8, arg_2)

Visualization of the edges in a network .


def
Func
(
arg_0
)
:
Func
(
"---[ START {} ]---"
.
format
(
arg_0
.
name
)
)
for
arg_1
,
arg_2
in
enumerate
(
arg_0
.
lines
)
:
Func
(
"{}: {}"
.
format
(
str
(
arg_1
)
.
zfill
(
3
)
,
arg_2
)
)
Func
(
"---[ END {} ]---"
.
format
(
arg_0
.
name
)
)

def Func(arg_0):
        """Print the shader lines"""
        Func("---[ START {} ]---".format(arg_0.name))

        for arg_1, arg_2 in enumerate(arg_0.lines):
            Func("{}: {}".format(str(arg_1).zfill(3), arg_2))

        Func("---[ END {} ]---".format(arg_0.name))


(s, non_ascii_only=False, brackets=True, substitute_bad_chars=False, fail_bad_chars=False)

def Func(arg_0, arg_1=False, arg_2=True, arg_3=False, arg_4=False):
    u"""
    Encode a UTF-8 string to a LaTeX snippet.

    If `non_ascii_only` is set to `True`, then usual (ascii) characters such as ``#``,
    ``{``, ``}`` etc. will not be escaped.  If set to `False` (the default), they are
    escaped to their respective LaTeX escape sequences.

    If `brackets` is set to `True` (the default), then LaTeX macros are enclosed in
    brackets.  For example, ``sant\N{LATIN SMALL LETTER E WITH ACUTE}`` is replaced by
    ``sant{\\'e}`` if `brackets=True` and by ``sant\\'e`` if `brackets=False`.

    .. warning::
        Using `brackets=False` might give you an invalid LaTeX string, so avoid
        it! (for instance, ``ma\N{LATIN SMALL LETTER I WITH CIRCUMFLEX}tre`` will be
        replaced incorrectly by ``ma\\^\\itre`` resulting in an unknown macro ``\\itre``).

    If `substitute_bad_chars=True`, then any non-ascii character for which no LaTeX escape
    sequence is known is replaced by a question mark in boldface. Otherwise (by default),
    the character is left as it is.

    If `fail_bad_chars=True`, then a `ValueError` is raised if we cannot find a
    character substitution for any non-ascii character.

    .. versionchanged:: 1.3

        Added `fail_bad_chars` switch
    """

    arg_0 = unicode(arg_0) # make sure s is unicode
    arg_0 = unicodedata.normalize('NFC', arg_0)

    if not arg_0:
        return ""

    arg_5 = u""
    for arg_6 in arg_0:
        #log.longdebug("Encoding char %r", ch)
        if (arg_1 and ord(arg_6) < 127):
            arg_5 += arg_6
        else:
            arg_7 = utf82latex.get(ord(arg_6), None)
            if (arg_7 is not None):
                # add brackets if needed, i.e. if we have a substituting macro.
                # note: in condition, beware, that lch might be of zero length.
                arg_5 += (  '{'+arg_7+'}' if arg_2 and arg_7[0:1] == '\\' else
                             arg_7  )
            elif ((ord(arg_6) >= 32 and ord(arg_6) <= 127) or
                  (arg_6 in "\n\r\t")):
                # ordinary printable ascii char, just add it
                arg_5 += arg_6
            else:
                # non-ascii char
                arg_8 = u"Character cannot be encoded into LaTeX: U+%04X - `%s'" % (ord(arg_6), arg_6)
                if arg_4:
                    raise ValueError(arg_8)

                log.warning(arg_8)
                if arg_3:
                    arg_5 += r'{\bfseries ?}'
                else:
                    # keep unescaped char
                    arg_5 += arg_6

    return arg_5

u Encode a UTF - 8 string to a LaTeX snippet .


def Func ( arg_0 ) : def _wrap ( arg_1 ) : @ functools . wraps ( arg_1 ) def wrapper ( * arg_2 , ** arg_3 ) : with arg_0 : return arg_1 ( * arg_2 , ** arg_3 ) return wrapper return _wrap

def Func(arg_0):
    '''
    wrap `with obj` out of func.

    example:

    ``` py
    @Func(Lock())
    def func(): pass
    ```
    '''

    def _wrap(arg_1):

        @functools.wraps(arg_1)
        def wrapper(*arg_2, **arg_3):
            with arg_0:
                return arg_1(*arg_2, **arg_3)

        return wrapper

    return _wrap

wrap `with obj` out of func.

    example:

    ``` py
    @with_it(Lock())
    def func(): pass
    ```


def Func ( arg_0 ) : if 'U' in getattr ( arg_0 , 'mode' , '' ) : for arg_1 in arg_0 : yield arg_1 else : for arg_1 in arg_0 : arg_1 = arg_1 . replace ( b'\r\n' , b'\n' ) . replace ( b'\r' , b'\n' ) for arg_2 in arg_1 . split ( b'\n' ) : yield arg_2

def Func(arg_0):
  """
    Wrap a file to convert newlines regardless of whether the file was opened
    with the "universal newlines" option or not.
  """
  # if file was opened with universal newline support we don't need to convert
  if 'U' in getattr(arg_0, 'mode', ''):
    for arg_1 in arg_0:
      yield arg_1
  else:
    for arg_1 in arg_0:
      arg_1 = arg_1.replace(b'\r\n', b'\n').replace(b'\r', b'\n')
      for arg_2 in arg_1.split(b'\n'):
        yield arg_2

Wrap a file to convert newlines regardless of whether the file was opened with the universal newlines option or not .


def Func ( ) : for arg_0 in operators : arg_1 , arg_2 = arg_0 [ 0 ] , arg_0 [ 1 : ] arg_3 = 'grappa.operators.{}' . format ( arg_1 ) arg_0 = __import__ ( arg_3 , None , None , arg_2 ) for arg_4 in arg_2 : Engine . register ( getattr ( arg_0 , arg_4 ) )

def Func():
    """
    Loads the built-in operators into the global test engine.
    """
    for arg_0 in operators:
        arg_1, arg_2 = arg_0[0], arg_0[1:]
        arg_3 = 'grappa.operators.{}'.format(arg_1)

        # Dynamically import modules
        arg_0 = __import__(arg_3, None, None, arg_2)

        # Register operators in the test engine
        for arg_4 in arg_2:
            Engine.register(getattr(arg_0, arg_4))

Loads the built - in operators into the global test engine .


(
    repository_info,
    pipeline_name,
    solid_subset,
    environment_dict,
    run_id,
    message_queue,
    reexecution_config,
    step_keys_to_execute,
)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , ) : arg_5 . put ( ProcessStartedSentinel ( os . getpid ( ) ) ) arg_8 = RunConfig ( arg_4 , event_callback = arg_5 . put , executor_config = InProcessExecutorConfig ( raise_on_error = False ) , arg_6 = arg_6 , arg_7 = arg_7 , ) arg_9 = RepositoryContainer ( arg_0 ) if arg_9 . repo_error : arg_5 . put ( MultiprocessingError ( serializable_error_info_from_exc_info ( arg_9 . repo_error ) ) ) return try : arg_10 = execute_pipeline ( arg_9 . repository . get_pipeline ( arg_1 ) . build_sub_pipeline ( arg_2 ) , arg_3 , arg_8 = arg_8 , ) return arg_10 except : arg_11 = serializable_error_info_from_exc_info ( sys . exc_info ( ) ) arg_5 . put ( MultiprocessingError ( arg_11 ) ) finally : arg_5 . put ( MultiprocessingDone ( ) ) arg_5 . close ( )

def Func(
    arg_0,
    arg_1,
    arg_2,
    arg_3,
    arg_4,
    arg_5,
    arg_6,
    arg_7,
):
    """
    Execute pipeline using message queue as a transport
    """

    arg_5.put(ProcessStartedSentinel(os.getpid()))

    arg_8 = RunConfig(
        arg_4,
        event_callback=arg_5.put,
        executor_config=InProcessExecutorConfig(raise_on_error=False),
        arg_6=arg_6,
        arg_7=arg_7,
    )

    arg_9 = RepositoryContainer(arg_0)
    if arg_9.repo_error:
        arg_5.put(
            MultiprocessingError(
                serializable_error_info_from_exc_info(arg_9.repo_error)
            )
        )
        return

    try:
        arg_10 = execute_pipeline(
            arg_9.repository.get_pipeline(arg_1).build_sub_pipeline(
                arg_2
            ),
            arg_3,
            arg_8=arg_8,
        )
        return arg_10
    except:  # pylint: disable=W0702
        arg_11 = serializable_error_info_from_exc_info(sys.exc_info())
        arg_5.put(MultiprocessingError(arg_11))
    finally:
        arg_5.put(MultiprocessingDone())
        arg_5.close()


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
def
list_methods
(
)
:
arg_3
=
[
]
if
arg_0
in
Staveley_data
.
index
:
arg_3
.
append
(
STAVELEY
)
if
Tm
(
arg_0
)
:
arg_3
.
append
(
MELTING
)
arg_3
.
append
(
)
return
arg_3
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
STAVELEY
:
Func
=
Staveley_data
.
at
[
arg_0
,
"Tt68"
]
elif
arg_2
==
MELTING
:
Func
=
Tm
(
arg_0
)
elif
arg_2
==
:
Func
=
else
:
raise
Exception
(
'Failure in in function'
)
return
Func

def Func(arg_0, arg_1=False, arg_2=None):
    r'''This function handles the retrieval of a chemical's triple temperature.
    Lookup is based on CASRNs. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Returns data from [1]_, or a chemical's melting point if available.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Tt : float
        Triple point temperature, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Tt with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Tt_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the Tt for the desired chemical, and will return methods
        instead of the Tt

    Notes
    -----
    Median difference between melting points and triple points is 0.02 K.
    Accordingly, this should be more than good enough for engineering
    applications.

    Temperatures are on the ITS-68 scale.

    Examples
    --------
    Ammonia

    >>> Tt('7664-41-7')
    195.47999999999999

    References
    ----------
    .. [1] Staveley, L. A. K., L. Q. Lobo, and J. C. G. Calado. "Triple-Points
       of Low Melting Substances and Their Use in Cryogenic Work." Cryogenics
       21, no. 3 (March 1981): 131-144. doi:10.1016/0011-2275(81)90264-2.
    '''
    def list_methods():
        arg_3 = []
        if arg_0 in Staveley_data.index:
            arg_3.append(STAVELEY)
        if Tm(arg_0):
            arg_3.append(MELTING)
        arg_3.append(NONE)
        return arg_3
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == STAVELEY:
        Func = Staveley_data.at[arg_0, "Tt68"]
    elif arg_2 == MELTING:
        Func = Tm(arg_0)
    elif arg_2 == NONE:
        Func = None
    else:
        raise Exception('Failure in in function')
    return Func

r This function handles the retrieval of a chemical s triple temperature . Lookup is based on CASRNs . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func ( arg_0 ) : @ wraps ( arg_0 ) def inner ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . token_expired ( ) : arg_1 . connect ( ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return inner

def Func(arg_0):
        """
        Use this method decorator to ensure the JWT token is refreshed when needed.
        """
        @wraps(arg_0)
        def inner(arg_1, *arg_2, **arg_3):
            """
            Before calling the wrapped function, we check if the JWT token is expired, and if so, re-connect.
            """
            if arg_1.token_expired():
                arg_1.connect()
            return arg_0(arg_1, *arg_2, **arg_3)
        return inner

Use this method decorator to ensure the JWT token is refreshed when needed .


"/*    PostScript glyph names.                                              */\n"

"""\  /*   *  This table is a compressed version of the Adobe Glyph List (AGL),   *  optimized for efficient searching.  It has been generated by the   *  `glnames.py' python script located in the `src/tools' directory.   *   *  The lookup function to get the Unicode value for a given string   *  is defined below the table.   */#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST"""

"""\  /*   *  This function searches the compressed table efficiently.   */  static unsigned long  ft_get_adobe_glyph_index( const char*  name,                            const char*  limit )  {    int                   c = 0;    int                   count, min, max;    const unsigned char*  p = ft_adobe_glyph_list;    if ( name == 0 || name >= limit )      goto NotFound;    c     = *name++;    count = p[1];    p    += 2;    min = 0;    max = count;    while ( min < max )    {      int                   mid = ( min + max ) >> 1;      const unsigned char*  q   = p + mid * 2;      int                   c2;      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );      c2 = q[0] & 127;      if ( c2 == c )      {        p = q;        goto Found;      }      if ( c2 < c )        min = mid + 1;      else        max = mid;    }    goto NotFound;  Found:    for (;;)    {      /* assert (*p & 127) == c */      if ( name >= limit )      {        if ( (p[0] & 128) == 0 &&             (p[1] & 128) != 0 )          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );        goto NotFound;      }      c = *name++;      if ( p[0] & 128 )      {        p++;        if ( c != (p[0] & 127) )          goto NotFound;        continue;      }      p++;      count = p[0] & 127;      if ( p[0] & 128 )        p += 2;      p++;      for ( ; count > 0; count--, p += 2 )      {        int                   offset = ( (int)p[0] << 8 ) | p[1];        const unsigned char*  q      = ft_adobe_glyph_list + offset;        if ( c == ( q[0] & 127 ) )        {          p = q;          goto NextIter;        }      }      goto NotFound;    NextIter:      ;    }  NotFound:    return 0;  }#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */"""

"""#include <stdlib.h>#include <stdio.h>  int  Func( void )  {    int                   result = 0;    const char* const*    names  = the_names;    const unsigned long*  values = the_values;    for ( ; *names; names++, values++ )    {      const char*    name      = *names;      unsigned long  reference = *values;      unsigned long  value;      value = ft_get_adobe_glyph_index( name, name + strlen( name ) );      if ( value != reference )      {        result = 1;        fprintf( stderr, "name '%s' => %04x instead of %04x\\n",                         name, value, reference );      }    }    return result;  }"""

def Func():
  """Func program body"""

  if len( sys.argv ) != 2:
    print __doc__ % sys.argv[0]
    sys.exit( 1 )

  arg_0  = open( sys.argv[1], "w\n" )
  arg_1 = arg_0.write

  arg_2 = len( sid_standard_names )

  # `mac_extras' contains the list of glyph names in the Macintosh standard
  # encoding which are not in the SID Standard Names.
  #
  arg_3 = filter_glyph_names( mac_standard_names, sid_standard_names )

  # `base_list' contains the names of our final glyph names table.
  # It consists of the `mac_extras' glyph names, followed by the SID
  # standard names.
  #
  arg_4 = len( arg_3 )
  arg_5        = arg_3 + sid_standard_names

  arg_1( "/***************************************************************************/\n" )
  arg_1( "/*                                                                         */\n" )

  arg_1( "/*  %-71s*/\n" % os.path.basename( sys.argv[1] ) )

  arg_1( "/*                                                                         */\n" )
  arg_1( "/*    PostScript glyph names.                                              */\n" )
  arg_1( "/*                                                                         */\n" )
  arg_1( "/*  Copyright 2005, 2008, 2011 by                                          */\n" )
  arg_1( "/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n" )
  arg_1( "/*                                                                         */\n" )
  arg_1( "/*  This file is part of the FreeType project, and may only be used,       */\n" )
  arg_1( "/*  modified, and distributed under the terms of the FreeType project      */\n" )
  arg_1( "/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n" )
  arg_1( "/*  this file you indicate that you have read the license and              */\n" )
  arg_1( "/*  understand and accept it fully.                                        */\n" )
  arg_1( "/*                                                                         */\n" )
  arg_1( "/***************************************************************************/\n" )
  arg_1( "\n" )
  arg_1( "\n" )
  arg_1( "  /* This file has been generated automatically -- do not edit! */\n" )
  arg_1( "\n" )
  arg_1( "\n" )

  # dump final glyph list (mac extras + sid standard names)
  #
  arg_6 = StringTable( arg_5, "ft_standard_glyph_names" )

  arg_6.dump( arg_0 )
  arg_6.dump_sublist( arg_0, "ft_mac_names",
                   "FT_NUM_MAC_NAMES", mac_standard_names )
  arg_6.dump_sublist( arg_0, "ft_sid_names",
                   "FT_NUM_SID_NAMES", sid_standard_names )

  dump_encoding( arg_0, "t1_standard_encoding", t1_standard_encoding )
  dump_encoding( arg_0, "t1_expert_encoding", t1_expert_encoding )

  # dump the AGL in its compressed form
  #
  arg_7, arg_8 = adobe_glyph_values()
  arg_9 = StringNode( "", 0 )

  for arg_10 in range( len( arg_7 ) ):
    arg_9.add( arg_7[arg_10], eval( "0x" + arg_8[arg_10] ) )

  arg_9       = arg_9.optimize()
  arg_11   = arg_9.locate( 0 )
  arg_12 = arg_9.store( "" )

  arg_1( """\
  /*
   *  This table is a compressed version of the Adobe Glyph List (AGL),
   *  optimized for efficient searching.  It has been generated by the
   *  `glnames.py' python script located in the `src/tools' directory.
   *
   *  The lookup function to get the Unicode value for a given string
   *  is defined below the table.
   */

#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST

""" )

  dump_array( arg_12, arg_1, "ft_adobe_glyph_list" )

  # write the lookup routine now
  #
  arg_1( """\
  /*
   *  This function searches the compressed table efficiently.
   */
  static unsigned long
  ft_get_adobe_glyph_index( const char*  name,
                            const char*  limit )
  {
    int                   c = 0;
    int                   count, min, max;
    const unsigned char*  p = ft_adobe_glyph_list;

    if ( name == 0 || name >= limit )
      goto NotFound;

    c     = *name++;
    count = p[1];
    p    += 2;

    min = 0;
    max = count;

    while ( min < max )
    {
      int                   mid = ( min + max ) >> 1;
      const unsigned char*  q   = p + mid * 2;
      int                   c2;

      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );

      c2 = q[0] & 127;
      if ( c2 == c )
      {
        p = q;
        goto Found;
      }
      if ( c2 < c )
        min = mid + 1;
      else
        max = mid;
    }
    goto NotFound;

  Found:
    for (;;)
    {
      /* assert (*p & 127) == c */

      if ( name >= limit )
      {
        if ( (p[0] & 128) == 0 &&
             (p[1] & 128) != 0 )
          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );

        goto NotFound;
      }
      c = *name++;
      if ( p[0] & 128 )
      {
        p++;
        if ( c != (p[0] & 127) )
          goto NotFound;

        continue;
      }

      p++;
      count = p[0] & 127;
      if ( p[0] & 128 )
        p += 2;

      p++;

      for ( ; count > 0; count--, p += 2 )
      {
        int                   offset = ( (int)p[0] << 8 ) | p[1];
        const unsigned char*  q      = ft_adobe_glyph_list + offset;

        if ( c == ( q[0] & 127 ) )
        {
          p = q;
          goto NextIter;
        }
      }
      goto NotFound;

    NextIter:
      ;
    }

  NotFound:
    return 0;
  }

#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */

""" )

  if 0:  # generate unit test, or don't
    #
    # now write the unit test to check that everything works OK
    #
    arg_1( "#ifdef TEST\n\n" )

    arg_1( "static const char* const  the_names[] = {\n" )
    for arg_13 in arg_7:
      arg_1( '  "' + arg_13 + '",\n' )
    arg_1( "  0\n};\n" )

    arg_1( "static const unsigned long  the_values[] = {\n" )
    for arg_14 in arg_8:
      arg_1( '  0x' + arg_14 + ',\n' )
    arg_1( "  0\n};\n" )

    arg_1( """
#include <stdlib.h>
#include <stdio.h>

  int
  Func( void )
  {
    int                   result = 0;
    const char* const*    names  = the_names;
    const unsigned long*  values = the_values;

    for ( ; *names; names++, values++ )
    {
      const char*    name      = *names;
      unsigned long  reference = *values;
      unsigned long  value;

      value = ft_get_adobe_glyph_index( name, name + strlen( name ) );
      if ( value != reference )
      {
        result = 1;
        fprintf( stderr, "name '%s' => %04x instead of %04x\\n",
                         name, value, reference );
      }
    }

    return result;
  }
""" )

    arg_1( "#endif /* TEST */\n" )

  arg_1("\n/* END */\n")


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = [ ] for arg_5 , arg_6 in arg_1 . items ( ) : if arg_5 in arg_3 : arg_4 . append ( '"' + arg_3 . get ( arg_5 ) + '"' ) else : arg_4 . append ( '""' ) arg_2 . append ( ',' . join ( arg_4 ) ) return arg_2

def Func(arg_0, arg_1):
    """Create the lines to include in a Clinvar submission csv file from a list of submission objects and a custom document header

        Args:
            submission_objs(list): a list of objects (variants or casedata) to include in a csv file
            submission_header(dict) : as in constants CLINVAR_HEADER and CASEDATA_HEADER, but with required fields only

        Returns:
            submission_lines(list) a list of strings, each string represents a line of the clinvar csv file to be doenloaded
    """
    arg_2 = []
    for arg_3 in arg_0: # Loop over the submission objects. Each of these is a line
        arg_4 = []
        for arg_5, arg_6 in arg_1.items(): # header_keys are the same keys as in submission_objs
            if arg_5 in arg_3: # The field is filled in for this variant/casedata object
                arg_4.append('"'+arg_3.get(arg_5)+'"')
            else: # Empty field for this this variant/casedata object
                arg_4.append('""')

        arg_2.append(','.join(arg_4))

    return arg_2


def Func ( arg_0 ) : from numpy . linalg import svd if arg_0 . _cache [ "eig" ] is not None : return arg_0 . _cache [ "eig" ] arg_1 , arg_2 = svd ( arg_0 . L ) [ : 2 ] arg_2 *= arg_2 arg_2 += arg_0 . _epsilon arg_0 . _cache [ "eig" ] = arg_2 , arg_1 return arg_0 . _cache [ "eig" ]

def Func(arg_0):
        """
        Eigen decomposition of K.

        Returns
        -------
        S : ndarray
            The eigenvalues in ascending order, each repeated according to its
            multiplicity.
        U : ndarray
            Normalized eigenvectors.
        """
        from numpy.linalg import svd

        if arg_0._cache["eig"] is not None:
            return arg_0._cache["eig"]

        arg_1, arg_2 = svd(arg_0.L)[:2]
        arg_2 *= arg_2
        arg_2 += arg_0._epsilon
        arg_0._cache["eig"] = arg_2, arg_1

        return arg_0._cache["eig"]


(store, institute_id, case_name, variant_id=None, variant_obj=None, add_case=True,
               get_overlapping=True)

return {
        'institute': institute_obj,
        'case': case_obj,
        'variant': variant_obj,
        'overlapping_snvs': overlapping_snvs,
        'manual_rank_options': MANUAL_RANK_OPTIONS,
        'dismiss_variant_options': DISMISS_VARIANT_OPTIONS
    }

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
,
arg_5
=
True
,
arg_6
=
True
)
:
arg_7
,
arg_8
=
institute_and_case
(
arg_0
,
arg_1
,
arg_2
)
if
not
arg_4
:
arg_4
=
arg_0
.
variant
(
arg_3
)
if
arg_5
:
variant_case
(
arg_0
,
arg_8
,
arg_4
)
arg_4
[
'frequencies'
]
=
[
(
'1000G'
,
arg_4
.
get
(
'thousand_genomes_frequency'
)
)
,
(
'1000G (left)'
,
arg_4
.
get
(
'thousand_genomes_frequency_left'
)
)
,
(
'1000G (right)'
,
arg_4
.
get
(
'thousand_genomes_frequency_right'
)
)
,
(
'ClinGen CGH (benign)'
,
arg_4
.
get
(
'clingen_cgh_benign'
)
)
,
(
'ClinGen CGH (pathogenic)'
,
arg_4
.
get
(
'clingen_cgh_pathogenic'
)
)
,
(
'ClinGen NGI'
,
arg_4
.
get
(
'clingen_ngi'
)
)
,
(
'SweGen'
,
arg_4
.
get
(
'swegen'
)
)
,
(
'Decipher'
,
arg_4
.
get
(
'decipher'
)
)
,
]
arg_4
[
'callers'
]
=
callers
(
arg_4
,
category
=
'sv'
)
arg_9
=
[
]
if
arg_6
:
arg_9
=
(
parse_variant
(
arg_0
,
arg_7
,
arg_8
,
variant
)
for
variant
in
arg_0
.
overlapping
(
arg_4
)
)
for
arg_10
in
arg_4
[
'genes'
]
:
if
arg_10
.
get
(
'common'
)
:
arg_11
=
arg_10
[
'common'
]
[
'ensembl_id'
]
try
:
arg_12
=
int
(
arg_10
[
'common'
]
.
get
(
'build'
,
'37'
)
)
except
Exception
:
arg_12
=
37
arg_10
[
'ensembl_link'
]
=
ensembl
(
arg_11
,
arg_12
=
arg_12
)
arg_4
[
'comments'
]
=
arg_0
.
events
(
arg_7
,
case
=
arg_8
,
arg_3
=
arg_4
[
'variant_id'
]
,
comments
=
True
)
arg_13
=
arg_0
.
case_to_clinVars
(
arg_8
.
get
(
'display_name'
)
)
if
arg_3
in
arg_13
:
arg_4
[
'clinvar_clinsig'
]
=
arg_13
.
get
(
arg_3
)
[
'clinsig'
]
if
not
'end_chrom'
in
arg_4
:
arg_4
[
'end_chrom'
]
=
arg_4
[
'chromosome'
]
return
{
'institute'
:
arg_7
,
'case'
:
arg_8
,
'variant'
:
arg_4
,
'overlapping_snvs'
:
arg_9
,
'manual_rank_options'
:
MANUAL_RANK_OPTIONS
,
'dismiss_variant_options'
:
DISMISS_VARIANT_OPTIONS
}

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=True,
               arg_6=True):
    """Pre-process an SV variant entry for detail page.

    Adds information to display variant

    Args:
        store(scout.adapter.MongoAdapter)
        institute_id(str)
        case_name(str)
        variant_id(str)
        variant_obj(dcit)
        add_case(bool): If information about case files should be added

    Returns:
        detailed_information(dict): {
            'institute': <institute_obj>,
            'case': <case_obj>,
            'variant': <variant_obj>,
            'overlapping_snvs': <overlapping_snvs>,
            'manual_rank_options': MANUAL_RANK_OPTIONS,
            'dismiss_variant_options': DISMISS_VARIANT_OPTIONS
        }
    """
    arg_7, arg_8 = institute_and_case(arg_0, arg_1, arg_2)

    if not arg_4:
        arg_4 = arg_0.variant(arg_3)

    if arg_5:
        # fill in information for pilup view
        variant_case(arg_0, arg_8, arg_4)

    # frequencies
    arg_4['frequencies'] = [
        ('1000G', arg_4.get('thousand_genomes_frequency')),
        ('1000G (left)', arg_4.get('thousand_genomes_frequency_left')),
        ('1000G (right)', arg_4.get('thousand_genomes_frequency_right')),
        ('ClinGen CGH (benign)', arg_4.get('clingen_cgh_benign')),
        ('ClinGen CGH (pathogenic)', arg_4.get('clingen_cgh_pathogenic')),
        ('ClinGen NGI', arg_4.get('clingen_ngi')),
        ('SweGen', arg_4.get('swegen')),
        ('Decipher', arg_4.get('decipher')),
    ]

    arg_4['callers'] = callers(arg_4, category='sv')

    arg_9 = []
    if arg_6:
        arg_9 = (parse_variant(arg_0, arg_7, arg_8, variant) for variant in
                            arg_0.overlapping(arg_4))

    # parse_gene function is not called for SVs, but a link to ensembl gene is required
    for arg_10 in arg_4['genes']:
        if arg_10.get('common'):
            arg_11 = arg_10['common']['ensembl_id']
            try:
                arg_12 = int(arg_10['common'].get('build','37'))
            except Exception:
                arg_12 = 37
            arg_10['ensembl_link'] = ensembl(arg_11, arg_12=arg_12)

    arg_4['comments'] = arg_0.events(arg_7, case=arg_8,
                                           arg_3=arg_4['variant_id'], comments=True)

    arg_13 = arg_0.case_to_clinVars(arg_8.get('display_name'))
    if arg_3 in arg_13:
        arg_4['clinvar_clinsig'] = arg_13.get(arg_3)['clinsig']

    if not 'end_chrom' in arg_4:
        arg_4['end_chrom'] = arg_4['chromosome']

    return {
        'institute': arg_7,
        'case': arg_8,
        'variant': arg_4,
        'overlapping_snvs': arg_9,
        'manual_rank_options': MANUAL_RANK_OPTIONS,
        'dismiss_variant_options': DISMISS_VARIANT_OPTIONS
    }

Pre - process an SV variant entry for detail page .


return self._mc_client._put(url=self._build_path(campaign_id, 'content'), data=data)

def Func(arg_0, arg_1, arg_2):
        """
        Set the content for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        """
        arg_0.campaign_id = arg_1
        return arg_0._mc_client._put(url=arg_0._build_path(arg_1, 'content'), arg_2=arg_2)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_0 . blockchain . wallet . unlock ( * arg_1 , ** arg_2 ) return arg_0

def Func(arg_0, *arg_1, **arg_2):
        """ Unlock the library internal wallet
        """
        arg_0.blockchain.wallet.unlock(*arg_1, **arg_2)
        return arg_0


def Func ( arg_0 , arg_1 = 0.1 ) : arg_2 = arg_0 . km . stdin_channel . get_msg ( arg_1 = arg_1 ) arg_0 . handle_iopub ( ) if arg_0 . session_id == arg_2 [ "parent_header" ] . get ( "session" ) : arg_3 = signal . getsignal ( signal . SIGINT ) def double_int ( arg_4 , arg_5 ) : arg_3 ( arg_4 , arg_5 ) raise KeyboardInterrupt signal . signal ( signal . SIGINT , double_int ) try : arg_6 = raw_input ( arg_2 [ "content" ] [ "prompt" ] ) except EOFError : arg_6 = '\x04' except KeyboardInterrupt : sys . stdout . write ( '\n' ) return finally : signal . signal ( signal . SIGINT , arg_3 ) if not ( arg_0 . km . stdin_channel . msg_ready ( ) or arg_0 . km . shell_channel . msg_ready ( ) ) : arg_0 . km . stdin_channel . input ( arg_6 )

def Func(arg_0, arg_1=0.1):
        """ Method to capture raw_input
        """
        arg_2 = arg_0.km.stdin_channel.get_msg(arg_1=arg_1)
        # in case any iopub came while we were waiting:
        arg_0.handle_iopub()
        if arg_0.session_id == arg_2["parent_header"].get("session"):
            # wrap SIGINT handler
            arg_3 = signal.getsignal(signal.SIGINT)
            def double_int(arg_4,arg_5):
                # call real handler (forwards sigint to kernel),
                # then raise local interrupt, stopping local raw_input
                arg_3(arg_4,arg_5)
                raise KeyboardInterrupt
            signal.signal(signal.SIGINT, double_int)

            try:
                arg_6 = raw_input(arg_2["content"]["prompt"])
            except EOFError:
                # turn EOFError into EOF character
                arg_6 = '\x04'
            except KeyboardInterrupt:
                sys.stdout.write('\n')
                return
            finally:
                # restore SIGINT handler
                signal.signal(signal.SIGINT, arg_3)

            # only send stdin reply if there *was not* another request
            # or execution finished while we were reading.
            if not (arg_0.km.stdin_channel.msg_ready() or arg_0.km.shell_channel.msg_ready()):
                arg_0.km.stdin_channel.input(arg_6)


def Func():
    """
    Find examples dir .. a little bit ugly..
    """
    # Replace %s with directory to check for shoebot menus.
    arg_0 = textwrap.dedent("""
    from pkg_resources import resource_filename, Requirement, DistributionNotFound
    try:
        print(resource_filename(Requirement.parse('shoebot'), '%s'))
    except DistributionNotFound:
        pass

    """)

    # Needs to run in same python env as shoebot (may be different to gedits)
    arg_1 = arg_0 % 'share/shoebot/examples'
    arg_2 = ["python", "-c", arg_1]
    arg_3 = subprocess.Popen(arg_2, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    arg_4, arg_5 = arg_3.communicate()
    if arg_5:
        print('Shoebot experienced errors searching for install and examples.')
        print('Errors:\n{0}'.format(arg_5.decode('utf-8')))
        return None
    else:
        arg_6 = arg_4.decode('utf-8').strip()
        if os.path.isdir(arg_6):
            return arg_6

        # If user is running 'setup.py develop' then examples could be right here
        #code = "from pkg_resources import resource_filename, Requirement; print resource_filename(Requirement.parse('shoebot'), 'examples/')"
        arg_1 = arg_0 % 'examples/'
        arg_2 = ["python", "-c", arg_1]
        arg_3 = subprocess.Popen(arg_2, stdout=subprocess.PIPE)
        arg_4, arg_5 = arg_3.communicate()
        arg_6 = arg_4.decode('utf-8').strip()
        if os.path.isdir(arg_6):
            return arg_6

        if arg_6:
            print('Shoebot could not find examples at: {0}'.format(arg_6))
        else:
            print('Shoebot could not find install dir and examples.')

Find examples dir .. a little bit ugly ..


def Func(arg_0, arg_1=False):
    """
    Roughly the complement and some far analogs.
    """
    def _wrap(arg_2, arg_3, arg_4, arg_5):
        if arg_2 - arg_3 < arg_4:
            return arg_2 + arg_5
        else:
            return arg_2 - arg_3

    arg_6 = 1
    if arg_1: arg_6 = -1

    arg_0 = color(arg_0)
    arg_7 = colorlist(arg_0)

    arg_8 = arg_0.rotate_ryb(30 * arg_6)
    arg_8.brightness = _wrap(arg_0.brightness, 0.25, 0.6, 0.25)
    arg_7.append(arg_8)

    arg_8 = arg_0.rotate_ryb(30 * arg_6)
    arg_8.saturation = _wrap(arg_0.saturation, 0.4, 0.1, 0.4)
    arg_8.brightness = _wrap(arg_0.brightness, 0.4, 0.2, 0.4)
    arg_7.append(arg_8)

    arg_8 = arg_0.rotate_ryb(160 * arg_6)
    arg_8.saturation = _wrap(arg_0.saturation, 0.25, 0.1, 0.25)
    arg_8.brightness = max(0.2, arg_0.brightness)
    arg_7.append(arg_8)

    arg_8 = arg_0.rotate_ryb(150 * arg_6)
    arg_8.saturation = _wrap(arg_0.saturation, 0.1, 0.8, 0.1)
    arg_8.brightness = _wrap(arg_0.brightness, 0.3, 0.6, 0.3)
    arg_7.append(arg_8)

    arg_8 = arg_0.rotate_ryb(150 * arg_6)
    arg_8.saturation = _wrap(arg_0.saturation, 0.1, 0.8, 0.1)
    arg_8.brightness = _wrap(arg_0.brightness, 0.4, 0.2, 0.4)
    # colors.append(c)

    return arg_7

Roughly the complement and some far analogs .


return self.executor.submit(self._docker, method, *args, **kwargs)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : return arg_0 . executor . submit ( arg_0 . _Func , arg_1 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Call a Func method in a background thread

        returns a Future
        """
        return arg_0.executor.submit(arg_0._Func, arg_1, *arg_2, **arg_3)

Call a docker method in a background thread

        returns a Future


def Func(arg_0, arg_1=None, arg_2=True):
    """Calculates the interaction energy between AMPAL objects.

    Parameters
    ----------
    ampal_objs: [AMPAL Object]
        A list of any AMPAL objects with `get_atoms` methods.
    ff: BuffForceField, optional
        The force field to be used for scoring. If no force field is
        provided then the most current version of the BUDE force field
        will be used.
    assign_ff: bool, optional
        If true, then force field assignment on the AMPAL object will be
        will be updated.

    Returns
    -------
    BUFF_score: BUFFScore
        A BUFFScore object with information about each of the interactions and
        the atoms involved.
    """
    if arg_1 is None:
        arg_1 = FORCE_FIELDS['bude_2016v1']
    if arg_2:
        for arg_3 in arg_0:
            assign_force_field(arg_3, arg_1)
    arg_4 = find_inter_ampal(arg_0, arg_1.distance_cutoff)
    arg_5 = score_interactions(arg_4, arg_1)
    return arg_5

Calculates the interaction energy between AMPAL objects .


def Func ( arg_0 ) : arg_1 = GodotDataParser ( ) arg_2 = arg_1 . Func ( arg_0 ) del arg_1 return arg_2

def Func(arg_0):
    """ Parses a DOT file and returns a Godot graph.
    """
    arg_1 = GodotDataParser()
    arg_2  = arg_1.Func(arg_0)
    del arg_1

    return arg_2

Parses a DOT file and returns a Godot graph .


def Func ( arg_0 = "nietzsche.txt" , arg_1 = None ) : if arg_1 is None : arg_1 = [ '\n' , '<eos>' ] with tf . gfile . GFile ( arg_0 , "r" ) as f : try : arg_2 = f . read ( ) . replace ( * arg_1 ) . split ( ) except Exception : f . seek ( 0 ) arg_1 = [ x . encode ( 'utf-8' ) for x in arg_1 ] arg_2 = f . read ( ) . replace ( * arg_1 ) . split ( ) return arg_2

def Func(arg_0="nietzsche.txt", arg_1=None):
    """Read list format context from a file.

    For customized Func method, see ``tutorial_generate_text.py``.

    Parameters
    ----------
    filename : str
        a file path.
    replace : list of str
        replace original string by target string.

    Returns
    -------
    list of str
        The context in a list (split using space).
    """
    if arg_1 is None:
        arg_1 = ['\n', '<eos>']

    with tf.gfile.GFile(arg_0, "r") as f:
        try:  # python 3.4 or older
            arg_2 = f.read().replace(*arg_1).split()
        except Exception:  # python 3.5
            f.seek(0)
            arg_1 = [x.encode('utf-8') for x in arg_1]
            arg_2 = f.read().replace(*arg_1).split()
        return arg_2

Read list format context from a file.

    For customized read_words method, see ``tutorial_generate_text.py``.

    Parameters
    ----------
    filename : str
        a file path.
    replace : list of str
        replace original string by target string.

    Returns
    -------
    list of str
        The context in a list (split using space).


(jams_file, output_prefix, csv=False, comment_char='#', namespaces=None)

def Func(arg_0, arg_1, arg_2=False, arg_3='#', arg_4=None):
    '''Convert jams to labs.

    Parameters
    ----------
    jams_file : str
        The path on disk to the jams file in question

    output_prefix : str
        The file path prefix of the outputs

    csv : bool
        Whether to output in csv (True) or lab (False) format

    comment_char : str
        The character used to denote comments

    namespaces : list-like
        The set of namespace patterns to match for output
    '''

    if arg_4 is None:
        raise ValueError('No namespaces provided. Try ".*" for all namespaces.')

    arg_5 = jams.load(arg_0)

    # Get all the annotations
    # Filter down to the unique ones
    # For each annotation
    #     generate the comment string
    #     generate the output filename
    #     dump to csv

    # Make a counter object for each namespace type
    arg_6 = collections.Counter()

    arg_7 = []

    for arg_8 in arg_4:
        arg_7.extend(arg_5.search(namespace=arg_8))

    if arg_2:
        arg_9 = 'csv'
        arg_10 = ','
    else:
        arg_9 = 'lab'
        arg_10 = '\t'

    for arg_11 in arg_7:
        arg_12 = arg_6[arg_11.namespace]
        arg_6[arg_11.namespace] += 1
        arg_13 = os.path.extsep.join([get_output_name(arg_1,
                                                        arg_11.namespace,
                                                        arg_12),
                                        arg_9])

        arg_14 = get_comments(arg_5, arg_11)

        # Dump to disk
        lab_dump(arg_11, arg_14, arg_13, arg_10, arg_3)


def Func(arg_0, arg_1):
        """
        Set the time against which the certificates are verified.

        Normally the current time is used.

        .. note::

          For example, you can determine if a certificate was valid at a given
          time.

        .. versionadded:: 17.0.0

        :param datetime vfy_time: The verification time to set on this store.
        :return: ``None`` if the verification time was successfully set.
        """
        arg_2 = _lib.X509_VERIFY_PARAM_new()
        arg_2 = _ffi.gc(arg_2, _lib.X509_VERIFY_PARAM_free)

        _lib.X509_VERIFY_PARAM_Func(arg_2, int(arg_1.strftime('%s')))
        _openssl_assert(_lib.X509_STORE_set1_param(arg_0._store, arg_2) != 0)

Set the time against which the certificates are verified .


(
    target_log_prob_fn,
    independent_chain_ndims,
    step_sizes,
    current_momentum_parts,
    current_state_parts,
    current_target_log_prob,
    current_target_log_prob_grad_parts,
    state_gradients_are_stopped=False,
    name=None)

def Func(
    arg_0,
    arg_1,
    arg_2,
    arg_3,
    arg_4,
    arg_5,
    arg_6,
    arg_7=False,
    arg_8=None):
  """Applies `num_leapfrog_steps` of the leapfrog integrator.

  Assumes a simple quadratic kinetic energy function: `0.5 ||momentum||**2`.

  #### Examples:

  ##### Simple quadratic potential.

  ```python
  import matplotlib.pyplot as plt
  %matplotlib inline
  import numpy as np
  import tensorflow as tf
  from tensorflow_probability.python.mcmc.hmc import Func  # pylint: disable=line-too-long
  tfd = tfp.distributions

  dims = 10
  num_iter = int(1e3)
  dtype = np.float32

  position = tf.placeholder(np.float32)
  momentum = tf.placeholder(np.float32)

  target_log_prob_fn = tfd.MultivariateNormalDiag(
      loc=tf.zeros(dims, dtype)).log_prob

  def _leapfrog_one_step(*args):
    # Closure representing computation done during each leapfrog step.
    return Func(
        target_log_prob_fn=target_log_prob_fn,
        independent_chain_ndims=0,
        step_sizes=[0.1],
        current_momentum_parts=args[0],
        current_state_parts=args[1],
        current_target_log_prob=args[2],
        current_target_log_prob_grad_parts=args[3])

  # Do leapfrog integration.
  [
      [next_momentum],
      [next_position],
      next_target_log_prob,
      next_target_log_prob_grad_parts,
  ] = tf.while_loop(
      cond=lambda *args: True,
      body=_leapfrog_one_step,
      loop_vars=[
        [momentum],
        [position],
        target_log_prob_fn(position),
        tf.gradients(target_log_prob_fn(position), position),
      ],
      maximum_iterations=3)

  momentum_ = np.random.randn(dims).astype(dtype)
  position_ = np.random.randn(dims).astype(dtype)
  positions = np.zeros([num_iter, dims], dtype)

  with tf.Session() as sess:
    for i in xrange(num_iter):
      position_, momentum_ = sess.run(
          [next_momentum, next_position],
          feed_dict={position: position_, momentum: momentum_})
      positions[i] = position_

  plt.plot(positions[:, 0]);  # Sinusoidal.
  ```

  Args:
    target_log_prob_fn: Python callable which takes an argument like
      `*current_state_parts` and returns its (possibly unnormalized) log-density
      under the target distribution.
    independent_chain_ndims: Scalar `int` `Tensor` representing the number of
      leftmost `Tensor` dimensions which index independent chains.
    step_sizes: Python `list` of `Tensor`s representing the step size for the
      leapfrog integrator. Must broadcast with the shape of
      `current_state_parts`.  Larger step sizes lead to faster progress, but
      too-large step sizes make rejection exponentially more likely. When
      possible, it's often helpful to match per-variable step sizes to the
      standard deviations of the target distribution in each variable.
    current_momentum_parts: Tensor containing the value(s) of the momentum
      variable(s) to update.
    current_state_parts: Python `list` of `Tensor`s representing the current
      state(s) of the Markov chain(s). The first `independent_chain_ndims` of
      the `Tensor`(s) index different chains.
    current_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn(*current_state_parts)`. The only reason to specify
      this argument is to reduce TF graph size.
    current_target_log_prob_grad_parts: Python list of `Tensor`s representing
      gradient of `target_log_prob_fn(*current_state_parts`) wrt
      `current_state_parts`. Must have same shape as `current_state_parts`. The
      only reason to specify this argument is to reduce TF graph size.
    state_gradients_are_stopped: Python `bool` indicating that the proposed new
      state be run through `tf.stop_gradient`. This is particularly useful when
      combining optimization over samples from the HMC chain.
      Default value: `False` (i.e., do not apply `stop_gradient`).
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'hmc_leapfrog_integrator').

  Returns:
    proposed_momentum_parts: Updated value of the momentum.
    proposed_state_parts: Tensor or Python list of `Tensor`s representing the
      state(s) of the Markov chain(s) at each result step. Has same shape as
      input `current_state_parts`.
    proposed_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn` at `next_state`.
    proposed_target_log_prob_grad_parts: Gradient of `proposed_target_log_prob`
      wrt `next_state`.

  Raises:
    ValueError: if `len(momentum_parts) != len(state_parts)`.
    ValueError: if `len(state_parts) != len(step_sizes)`.
    ValueError: if `len(state_parts) != len(grads_target_log_prob)`.
    TypeError: if `not target_log_prob.dtype.is_floating`.
  """
  # Note on per-variable step sizes:
  #
  # Using per-variable step sizes is equivalent to using the same step
  # size for all variables and adding a diagonal mass matrix in the
  # kinetic energy term of the Hamiltonian being integrated. This is
  # hinted at by Neal (2011) but not derived in detail there.
  #
  # Let x and v be position and momentum variables respectively.
  # Let g(x) be the gradient of `target_log_prob_fn(x)`.
  # Let S be a diagonal matrix of per-variable step sizes.
  # Let the Hamiltonian H(x, v) = -target_log_prob_fn(x) + 0.5 * ||v||**2.
  #
  # Using per-variable step sizes gives the updates
  # v'  = v  + 0.5 * matmul(S, g(x))
  # x'' = x  + matmul(S, v')
  # v'' = v' + 0.5 * matmul(S, g(x''))
  #
  # Let u = matmul(inv(S), v).
  # Multiplying v by inv(S) in the updates above gives the transformed dynamics
  # u'  = matmul(inv(S), v')  = matmul(inv(S), v) + 0.5 * g(x)
  #                           = u + 0.5 * g(x)
  # x'' = x + matmul(S, v') = x + matmul(S**2, u')
  # u'' = matmul(inv(S), v'') = matmul(inv(S), v') + 0.5 * g(x'')
  #                           = u' + 0.5 * g(x'')
  #
  # These are exactly the leapfrog updates for the Hamiltonian
  # H'(x, u) = -target_log_prob_fn(x) + 0.5 * u^T S**2 u
  #          = -target_log_prob_fn(x) + 0.5 * ||v||**2 = H(x, v).
  #
  # To summarize:
  #
  # * Using per-variable step sizes implicitly simulates the dynamics
  #   of the Hamiltonian H' (which are energy-conserving in H'). We
  #   keep track of v instead of u, but the underlying dynamics are
  #   the same if we transform back.
  # * The value of the Hamiltonian H'(x, u) is the same as the value
  #   of the original Hamiltonian H(x, v) after we transform back from
  #   u to v.
  # * Sampling v ~ N(0, I) is equivalent to sampling u ~ N(0, S**-2).
  #
  # So using per-variable step sizes in HMC will give results that are
  # exactly identical to explicitly using a diagonal mass matrix.

  with tf.compat.v1.name_scope(arg_8, 'hmcFunc', [
      arg_1, arg_2, arg_3,
      arg_4, arg_5,
      arg_6
  ]):

    # Step 1: Update momentum.
    arg_9 = [
        v + 0.5 * tf.cast(eps, v.dtype) * arg_13
        for v, eps, arg_13
        in zip(arg_3,
               arg_2,
               arg_6)]

    # Step 2: Update state.
    arg_10 = [
        x + tf.cast(eps, v.dtype) * v
        for x, eps, v
        in zip(arg_4,
               arg_2,
               arg_9)]

    if arg_7:
      arg_10 = [tf.stop_gradient(x) for x in arg_10]

    # Step 3a: Re-evaluate target-log-prob (and grad) at proposed state.
    [
        arg_11,
        arg_12,
    ] = mcmc_util.maybe_call_fn_and_grads(
        arg_0,
        arg_10)

    if not arg_11.dtype.is_floating:
      raise TypeError('`target_log_prob_fn` must produce a `Tensor` '
                      'with `float` `dtype`.')

    if any(arg_13 is None for arg_13 in arg_12):
      raise ValueError(
          'Encountered `None` gradient. Does your target `target_log_prob_fn` '
          'access all `tf.Variable`s via `tf.get_variable`?\n'
          '  current_state_parts: {}\n'
          '  proposed_state_parts: {}\n'
          '  proposed_target_log_prob_grad_parts: {}'.format(
              arg_4,
              arg_10,
              arg_12))

    # Step 3b: Update momentum (again).
    arg_9 = [
        v + 0.5 * tf.cast(eps, v.dtype) * arg_13
        for v, eps, arg_13
        in zip(arg_9,
               arg_2,
               arg_12)]

    return [
        arg_9,
        arg_10,
        arg_11,
        arg_12,
    ]

Applies `num_leapfrog_steps` of the leapfrog integrator.

  Assumes a simple quadratic kinetic energy function: `0.5 ||momentum||**2`.

  #### Examples:

  ##### Simple quadratic potential.

  ```python
  import matplotlib.pyplot as plt
  %matplotlib inline
  import numpy as np
  import tensorflow as tf
  from tensorflow_probability.python.mcmc.hmc import _leapfrog_integrator_one_step  # pylint: disable=line-too-long
  tfd = tfp.distributions

  dims = 10
  num_iter = int(1e3)
  dtype = np.float32

  position = tf.placeholder(np.float32)
  momentum = tf.placeholder(np.float32)

  target_log_prob_fn = tfd.MultivariateNormalDiag(
      loc=tf.zeros(dims, dtype)).log_prob

  def _leapfrog_one_step(*args):
    # Closure representing computation done during each leapfrog step.
    return _leapfrog_integrator_one_step(
        target_log_prob_fn=target_log_prob_fn,
        independent_chain_ndims=0,
        step_sizes=[0.1],
        current_momentum_parts=args[0],
        current_state_parts=args[1],
        current_target_log_prob=args[2],
        current_target_log_prob_grad_parts=args[3])

  # Do leapfrog integration.
  [
      [next_momentum],
      [next_position],
      next_target_log_prob,
      next_target_log_prob_grad_parts,
  ] = tf.while_loop(
      cond=lambda *args: True,
      body=_leapfrog_one_step,
      loop_vars=[
        [momentum],
        [position],
        target_log_prob_fn(position),
        tf.gradients(target_log_prob_fn(position), position),
      ],
      maximum_iterations=3)

  momentum_ = np.random.randn(dims).astype(dtype)
  position_ = np.random.randn(dims).astype(dtype)
  positions = np.zeros([num_iter, dims], dtype)

  with tf.Session() as sess:
    for i in xrange(num_iter):
      position_, momentum_ = sess.run(
          [next_momentum, next_position],
          feed_dict={position: position_, momentum: momentum_})
      positions[i] = position_

  plt.plot(positions[:, 0]);  # Sinusoidal.
  ```

  Args:
    target_log_prob_fn: Python callable which takes an argument like
      `*current_state_parts` and returns its (possibly unnormalized) log-density
      under the target distribution.
    independent_chain_ndims: Scalar `int` `Tensor` representing the number of
      leftmost `Tensor` dimensions which index independent chains.
    step_sizes: Python `list` of `Tensor`s representing the step size for the
      leapfrog integrator. Must broadcast with the shape of
      `current_state_parts`.  Larger step sizes lead to faster progress, but
      too-large step sizes make rejection exponentially more likely. When
      possible, it's often helpful to match per-variable step sizes to the
      standard deviations of the target distribution in each variable.
    current_momentum_parts: Tensor containing the value(s) of the momentum
      variable(s) to update.
    current_state_parts: Python `list` of `Tensor`s representing the current
      state(s) of the Markov chain(s). The first `independent_chain_ndims` of
      the `Tensor`(s) index different chains.
    current_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn(*current_state_parts)`. The only reason to specify
      this argument is to reduce TF graph size.
    current_target_log_prob_grad_parts: Python list of `Tensor`s representing
      gradient of `target_log_prob_fn(*current_state_parts`) wrt
      `current_state_parts`. Must have same shape as `current_state_parts`. The
      only reason to specify this argument is to reduce TF graph size.
    state_gradients_are_stopped: Python `bool` indicating that the proposed new
      state be run through `tf.stop_gradient`. This is particularly useful when
      combining optimization over samples from the HMC chain.
      Default value: `False` (i.e., do not apply `stop_gradient`).
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'hmc_leapfrog_integrator').

  Returns:
    proposed_momentum_parts: Updated value of the momentum.
    proposed_state_parts: Tensor or Python list of `Tensor`s representing the
      state(s) of the Markov chain(s) at each result step. Has same shape as
      input `current_state_parts`.
    proposed_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn` at `next_state`.
    proposed_target_log_prob_grad_parts: Gradient of `proposed_target_log_prob`
      wrt `next_state`.

  Raises:
    ValueError: if `len(momentum_parts) != len(state_parts)`.
    ValueError: if `len(state_parts) != len(step_sizes)`.
    ValueError: if `len(state_parts) != len(grads_target_log_prob)`.
    TypeError: if `not target_log_prob.dtype.is_floating`.

Applies num_leapfrog_steps of the leapfrog integrator .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the GetAttributes response payload and decode
        it into its constituent parts.

        Args:
            input_buffer (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(GetAttributesResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_7 = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_7.Func(arg_6, arg_2=arg_2)
            arg_0.unique_identifier = arg_7.value
        else:
            raise exceptions.InvalidKmipEncoding(
                "The GetAttributes response payload encoding is missing the "
                "unique identifier."
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            arg_0._attributes = list()
            while arg_0.is_tag_next(arg_3.Tags.ATTRIBUTE, arg_6):
                arg_9 = objects.Attribute()
                arg_9.Func(arg_6, arg_2=arg_2)
                arg_0._attributes.append(arg_9)
        else:
            if arg_0.is_tag_next(arg_3.Tags.ATTRIBUTES, arg_6):
                arg_10 = objects.Attributes()
                arg_10.Func(arg_6, arg_2=arg_2)
                # TODO (ph) Add a new utility to avoid using TemplateAttributes
                arg_11 = objects.convert_attributes_to_template_attribute(
                    arg_10
                )
                arg_0._attributes = arg_11.attributes
            else:
                raise exceptions.InvalidKmipEncoding(
                    "The GetAttributes response payload encoding is missing "
                    "the attributes structure."
                )

        arg_0.is_oversized(arg_6)

Read the data encoding the GetAttributes response payload and decode
        it into its constituent parts.

        Args:
            input_buffer (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

Read the data encoding the GetAttributes response payload and decode it into its constituent parts .


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 : return arg_0 ( x509 . Certificate . load ( arg_1 ) , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """
    Constructs an asn1crypto.x509.Certificate object and calls the export
    callback

    :param callback:
        The callback to call

    :param der_cert:
        A byte string of the DER-encoded certificate

    :param reason:
        None if cert is being exported, or a unicode string of the reason it
        is not being exported
    """

    if not arg_0:
        return
    arg_0(x509.Certificate.load(arg_1), arg_2)

Constructs an asn1crypto . x509 . Certificate object and calls the export callback


def Func(arg_0, arg_1, arg_2):
        '''GUI callback for mouse moved'''
        arg_0._namespace['MOUSEX'] = arg_1
        arg_0._namespace['MOUSEY'] = arg_2


def Func ( arg_0 : arg_1 ) -> arg_1 : arg_0 = arg_0 . strip ( ) arg_2 = _URI_RE . match ( arg_0 ) if arg_2 is None : arg_2 = _OPEN_RE . match ( arg_0 ) if arg_2 is None : return arg_0 else : return arg_2 . group ( 2 ) else : return arg_2 . group ( 1 )

def Func(arg_0: arg_1) -> arg_1:
    """Get a spotify ID from a URI or open.spotify URL.

    Paramters
    ---------
    string : str
        The string to operate on.

    Returns
    -------
    id : str
        The Spotify ID from the string.
    """
    arg_0 = arg_0.strip()

    arg_2 = _URI_RE.match(arg_0)

    if arg_2 is None:
        arg_2 = _OPEN_RE.match(arg_0)

        if arg_2 is None:
            return arg_0
        else:
            return arg_2.group(2)
    else:
        return arg_2.group(1)

Get a spotify ID from a URI or open . spotify URL .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
not
arg_0
:
return
True
if
not
arg_2
:
print_message
(
'== Step 3. Run post-bootstrap hook =='
)
arg_3
=
not
run_cmd
(
prepare_args
(
arg_0
,
arg_1
)
,
echo
=
not
arg_2
,
fail_silently
=
True
,
shell
=
True
)
if
not
arg_2
:
print_message
(
)
return
arg_3

def Func(arg_0, arg_1, arg_2=False):
    """Run post-bootstrap hook if any.

    :param hook: Hook to run.
    :param config: Configuration dict.
    :param quiet: Do not output messages to STDOUT/STDERR. By default: False
    """
    if not arg_0:
        return True

    if not arg_2:
        print_message('== Step 3. Run post-bootstrap hook ==')

    arg_3 = not run_cmd(prepare_args(arg_0, arg_1),
                         echo=not arg_2,
                         fail_silently=True,
                         shell=True)

    if not arg_2:
        print_message()

    return arg_3


def
Func
(
arg_0
,
arg_1
)
:
print
"Downloading page %s .."
%
arg_1
try
:
arg_2
=
requests
.
get
(
arg_1
,
timeout
=
50
)
except
requests
.
exceptions
.
SSLError
:
try
:
arg_2
=
requests
.
get
(
arg_1
,
verify
=
False
,
timeout
=
50
)
except
requests
.
exceptions
.
RequestException
as
e
:
print
e
quit
(
)
except
requests
.
exceptions
.
RequestException
as
e
:
print
e
quit
(
)
return
arg_2
.
content

def Func(arg_0,arg_1):
		'''It will download the html page specified by url and return the html response '''
		print "Downloading page %s .."%arg_1
		try:
			arg_2=requests.get(arg_1,timeout=50)
		except requests.exceptions.SSLError:
			try:
				arg_2=requests.get(arg_1,verify=False,timeout=50)
			except requests.exceptions.RequestException as e:
				print e
				quit()
		except requests.exceptions.RequestException as e:
			print e
			quit()

		return arg_2.content


def Func ( arg_0 , arg_1 ) : def tp ( arg_2 = '' ) : return _str_to_path ( arg_2 , arg_1 ) if os . name != 'nt' : return tp ( os . sep ) arg_3 = sampled_from ( [ os . sep , os . altsep or os . sep ] ) . map ( tp ) arg_4 = _filename ( arg_1 ) arg_5 = characters ( min_codepoint = ord ( "A" ) , max_codepoint = ord ( "z" ) ) . map ( lambda c : tp ( str ( c ) ) ) arg_6 = arg_3 arg_7 = builds ( lambda * x : tp ( ) . join ( x ) , arg_5 , just ( tp ( ':' ) ) , arg_3 ) arg_8 = builds ( lambda * x : tp ( ) . join ( x ) , arg_3 , arg_3 , just ( tp ( '?' ) ) , arg_3 , arg_7 ) arg_9 = one_of ( [ builds ( lambda * x : tp ( ) . join ( x ) , arg_3 , arg_3 , arg_4 , arg_3 , arg_4 , arg_3 ) , builds ( lambda * x : tp ( ) . join ( x ) , arg_3 , arg_3 , just ( tp ( '?' ) ) , arg_3 , arg_4 , arg_3 , arg_4 , arg_3 ) , builds ( lambda * x : tp ( ) . join ( x ) , arg_3 , arg_3 , just ( tp ( '?' ) ) , arg_3 , just ( tp ( 'UNC' ) ) , arg_3 , arg_4 , arg_3 , arg_4 , arg_3 ) , builds ( lambda * x : tp ( ) . join ( x ) , arg_3 , arg_3 , just ( tp ( '.' ) ) , arg_3 , arg_4 , arg_3 ) , ] ) arg_10 = one_of ( arg_6 , arg_7 , arg_8 , arg_9 ) return arg_0 ( arg_10 )

def Func(arg_0, arg_1):
    """Generates a root component for a path."""

    # Based on https://en.wikipedia.org/wiki/Path_(computing)

    def tp(arg_2=''):
        return _str_to_path(arg_2, arg_1)

    if os.name != 'nt':
        return tp(os.sep)

    arg_3 = sampled_from([os.sep, os.altsep or os.sep]).map(tp)
    arg_4 = _filename(arg_1)
    arg_5 = characters(min_codepoint=ord("A"), max_codepoint=ord("z")).map(
        lambda c: tp(str(c)))

    arg_6 = arg_3
    # [drive_letter]:\
    arg_7 = builds(lambda *x: tp().join(x), arg_5, just(tp(':')), arg_3)
    # \\?\[drive_spec]:\
    arg_8 = builds(
        lambda *x: tp().join(x), arg_3, arg_3, just(tp('?')), arg_3, arg_7)

    arg_9 = one_of([
        # \\[server]\[sharename]\
        builds(lambda *x: tp().join(x), arg_3, arg_3, arg_4, arg_3, arg_4, arg_3),
        # \\?\[server]\[sharename]\
        builds(lambda *x: tp().join(x),
               arg_3, arg_3, just(tp('?')), arg_3, arg_4, arg_3, arg_4, arg_3),
        # \\?\UNC\[server]\[sharename]\
        builds(lambda *x: tp().join(x),
               arg_3, arg_3, just(tp('?')), arg_3, just(tp('UNC')), arg_3, arg_4, arg_3,
               arg_4, arg_3),
        # \\.\[physical_device]\
        builds(lambda *x: tp().join(x),
               arg_3, arg_3, just(tp('.')), arg_3, arg_4, arg_3),
    ])

    arg_10 = one_of(arg_6, arg_7, arg_8, arg_9)

    return arg_0(arg_10)


(mask, unmasked_sparse_grid_pixel_centres,
                                                          total_sparse_pixels)

def Func(arg_0, arg_1,
                                                          arg_2):
    """Determine the mapping between every pixelization-grid pixel and masked pixelization-grid pixel. This is
    performed by checking whether each pixelization-grid pixel is within the regular-masks, and mapping the indexes.

    Pixelization pixels are paired with the next masked pixel index. This may mean that a pixel is not paired with a
    pixel near it, if the next pixel is on the next row of the grid. This is not a problem, as it is only
    unmasked pixels that are referened when computing image_to_pix, which is what this array is used for.

    Parameters
    -----------
    total_sparse_pixels : int
        The total number of pixels in the pixelization grid which fall within the regular-masks.
    mask : ccd.masks.Mask
        The regular-masks within which pixelization pixels must be inside
    unmasked_sparse_grid_pixel_centres : ndarray
        The centres of the unmasked pixelization grid pixels.
    """

    arg_3 = arg_1.shape[0]

    arg_4 = np.zeros(arg_3)
    arg_5 = 0

    for arg_6 in range(arg_3):

        arg_7 = arg_1[arg_6, 0]
        arg_8 = arg_1[arg_6, 1]

        arg_4[arg_6] = arg_5

        if not arg_0[arg_7, arg_8]:
            if arg_5 < arg_2 - 1:
                arg_5 += 1

    return arg_4

Determine the mapping between every pixelization - grid pixel and masked pixelization - grid pixel . This is performed by checking whether each pixelization - grid pixel is within the regular - masks and mapping the indexes .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
rate_limit_header
in
arg_1
.
headers
:
arg_0
.
rate_limit
=
int
(
arg_1
.
headers
[
arg_0
.
rate_limit_header
]
)
logger
.
debug
(
"Rate limit: %s"
,
arg_0
.
rate_limit
)
else
:
arg_0
.
rate_limit
=
if
arg_0
.
rate_limit_reset_header
in
arg_1
.
headers
:
arg_0
.
rate_limit_reset_ts
=
int
(
arg_1
.
headers
[
arg_0
.
rate_limit_reset_header
]
)
logger
.
debug
(
"Rate limit reset: %s"
,
arg_0
.
calculate_time_to_reset
(
)
)
else
:
arg_0
.
rate_limit_reset_ts
=

def Func(arg_0, arg_1):
        """Update the rate limit and the time to reset
        from the response headers.

        :param: response: the response object
        """
        if arg_0.rate_limit_header in arg_1.headers:
            arg_0.rate_limit = int(arg_1.headers[arg_0.rate_limit_header])
            logger.debug("Rate limit: %s", arg_0.rate_limit)
        else:
            arg_0.rate_limit = None

        if arg_0.rate_limit_reset_header in arg_1.headers:
            arg_0.rate_limit_reset_ts = int(arg_1.headers[arg_0.rate_limit_reset_header])
            logger.debug("Rate limit reset: %s", arg_0.calculate_time_to_reset())
        else:
            arg_0.rate_limit_reset_ts = None

Update the rate limit and the time to reset from the response headers .


return [os.path.join(dp, f)
                for dp, _, fn in os.walk(self.dir)
                for f in fn]

def Func ( arg_0 ) : return [ os . path . join ( arg_1 , arg_4 ) for arg_1 , arg_2 , arg_3 in os . walk ( arg_0 . dir ) for arg_4 in arg_3 ]

def Func(arg_0):
        """Get the current directory state"""
        return [os.path.join(arg_1, arg_4)
                for arg_1, arg_2, arg_3 in os.walk(arg_0.dir)
                for arg_4 in arg_3]


(self, method, url, headers=None, _session=None,
                       *args, **kwargs)

return StreamResponse(
            method=method,
            url=url,
            client=self,
            headers=headers,
            session=_session,
            proxy=self.proxy,
            **kwargs
        )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , * arg_5 , ** arg_6 ) : return StreamResponse ( arg_1 = arg_1 , arg_2 = arg_2 , client = arg_0 , arg_3 = arg_3 , session = arg_4 , proxy = arg_0 . proxy , ** arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
                       *arg_5, **arg_6):
        """
            Make requests to the Streaming API

        Parameters
        ----------
        method : str
            Method to be used by the request
        url : str
            URL of the resource
        headers : dict
            Custom headers (doesn't overwrite `Authorization` headers)
        _session : aiohttp.ClientSession, optional
            The session to use for this specific request, the session
            given as argument of :meth:`__init__` is used by default

        Returns
        -------
        .stream.StreamResponse
            Stream context for the request
        """
        return StreamResponse(
            arg_1=arg_1,
            arg_2=arg_2,
            client=arg_0,
            arg_3=arg_3,
            session=arg_4,
            proxy=arg_0.proxy,
            **arg_6
        )


def
Func
(
arg_0
)
:
LOG
.
info
(
"Running scout view Func"
)
arg_1
=
arg_0
.
obj
[
'adapter'
]
for
arg_2
in
arg_1
.
Func
(
)
:
click
.
echo
(
arg_2
)

def Func(arg_0):
    """Show all Func in the database"""
    LOG.info("Running scout view Func")

    arg_1 = arg_0.obj['adapter']

    for arg_2 in arg_1.Func():
        click.echo(arg_2)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = list ( arg_1 ) if arg_2 : arg_3 += [ Filter ( ** arg_2 ) ] return arg_0 . _clone ( arg_1 = arg_3 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Returns this Query instance with the query args combined with
        existing set with AND.

        kwargs are simply passed to a new Filter object and combined to any
        other Funcs with AND.

        By default, everything is combined using AND. If you provide
        multiple Funcs in a single Func call, those are ANDed
        together. If you provide multiple Funcs in multiple Func
        calls, those are ANDed together.

        If you want something different, use the F class which supports
        ``&`` (and), ``|`` (or) and ``~`` (not) operators. Then call
        Func once with the resulting Filter instance.
        """
        arg_3 = list(arg_1)

        if arg_2:
            arg_3 += [Filter(**arg_2)]

        return arg_0._clone(arg_1=arg_3)

Returns this Query instance with the query args combined with
        existing set with AND.

        kwargs are simply passed to a new Filter object and combined to any
        other filters with AND.

        By default, everything is combined using AND. If you provide
        multiple filters in a single filter call, those are ANDed
        together. If you provide multiple filters in multiple filter
        calls, those are ANDed together.

        If you want something different, use the F class which supports
        ``&`` (and), ``|`` (or) and ``~`` (not) operators. Then call
        filter once with the resulting Filter instance.

Returns this Query instance with the query args combined with existing set with AND .


def
Func
(
arg_0
=
,
arg_1
=
True
,
arg_2
=
True
)
:
if
arg_2
:
cij
.
emph
(
"cij.util.Func: shell: %r, cmd: %r"
%
(
arg_1
,
arg_0
)
)
arg_3
=
1
arg_4
,
arg_5
=
(
""
,
""
)
if
arg_0
:
if
arg_1
:
arg_0
=
" "
.
join
(
arg_0
)
arg_6
=
Popen
(
arg_0
,
arg_4
=
PIPE
,
arg_5
=
PIPE
,
arg_1
=
arg_1
,
close_fds
=
True
)
arg_4
,
arg_5
=
arg_6
.
communicate
(
)
arg_3
=
arg_6
.
returncode
if
arg_3
and
arg_2
:
cij
.
warn
(
"cij.util.Func: stdout: %s"
%
arg_4
)
cij
.
err
(
"cij.util.Func: stderr: %s"
%
arg_5
)
cij
.
err
(
"cij.util.Func: rcode: %s"
%
arg_3
)
return
arg_3
,
arg_4
,
arg_5

def Func(arg_0=None, arg_1=True, arg_2=True):
    """
    Execute the given 'cmd'

    @returns (rcode, stdout, stderr)
    """
    if arg_2:
        cij.emph("cij.util.Func: shell: %r, cmd: %r" % (arg_1, arg_0))

    arg_3 = 1
    arg_4, arg_5 = ("", "")

    if arg_0:
        if arg_1:
            arg_0 = " ".join(arg_0)

        arg_6 = Popen(arg_0, arg_4=PIPE, arg_5=PIPE, arg_1=arg_1, close_fds=True)
        arg_4, arg_5 = arg_6.communicate()
        arg_3 = arg_6.returncode

    if arg_3 and arg_2:
        cij.warn("cij.util.Func: stdout: %s" % arg_4)
        cij.err("cij.util.Func: stderr: %s" % arg_5)
        cij.err("cij.util.Func: rcode: %s" % arg_3)

    return arg_3, arg_4, arg_5


def Func(arg_0, arg_1):
    """Return true if dims correspond to an n-qubit channel."""
    if arg_0 != arg_1:
        raise QiskitError(
            'Not an n-qubit channel: input_dim' +
            ' ({}) != output_dim ({})'.format(arg_0, arg_1))
    arg_2 = int(np.log2(arg_0))
    if 2**arg_2 != arg_0:
        raise QiskitError('Not an n-qubit channel: input_dim != 2 ** n')

Return true if dims correspond to an n - qubit channel .


def Func(arg_0, arg_1):
        """Fetch the merge requests"""

        arg_2 = arg_0.client.merges(arg_1=arg_1)

        for arg_3 in arg_2:
            arg_4 = json.loads(arg_3)
            for arg_5 in arg_4:
                arg_6 = arg_5['iid']

                if arg_0.blacklist_ids and arg_6 in arg_0.blacklist_ids:
                    logger.warning("Skipping blacklisted merge request %s", arg_6)
                    continue

                # The single merge_request API call returns a more
                # complete merge request, thus we inflate it with
                # other data (e.g., notes, emojis, versions)
                arg_7 = arg_0.client.merge(arg_6)
                arg_8 = json.loads(arg_7)

                arg_0.__init_merge_extra_fields(arg_8)

                arg_8['notes_data'] = arg_0.__get_merge_notes(arg_6)
                arg_8['award_emoji_data'] = arg_0.__get_award_emoji(GitLabClient.MERGES, arg_6)
                arg_8['versions_data'] = arg_0.__get_merge_versions(arg_6)

                yield arg_8


def Func ( arg_0 , arg_1 ) : if arg_0 . atBlockStart ( ) : return True arg_2 = arg_0 . columnNumber ( ) arg_3 = len ( arg_1 ) - len ( arg_1 . lstrip ( ) ) return arg_2 <= arg_3

def Func(arg_0, arg_1):
        """
        Improve QTextCursor.atBlockStart to ignore spaces
        """
        if arg_0.atBlockStart():
            return True
        arg_2 = arg_0.columnNumber()
        arg_3 = len(arg_1) - len(arg_1.lstrip())
        return arg_2 <= arg_3

Improve QTextCursor . atBlockStart to ignore spaces


(graph: BELGraph, u: BaseEntity, v: BaseEntity)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_3 ) -> Optional [ str ] : arg_5 = { data [ RELATION ] for data in arg_0 [ arg_2 ] [ arg_4 ] . values ( ) } if 1 != len ( arg_5 ) : return return list ( arg_5 ) [ 0 ]

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_3) -> Optional[str]:
    """Return if the edges between the given nodes are consistent, meaning they all have the same relation.

    :return: If the edges aren't consistent, return false, otherwise return the relation type
    """
    arg_5 = {data[RELATION] for data in arg_0[arg_2][arg_4].values()}

    if 1 != len(arg_5):
        return

    return list(arg_5)[0]

Return if the edges between the given nodes are consistent meaning they all have the same relation .


def
Func
(
arg_0
)
:
logger
.
debug
(
'In state: Func'
)
arg_0
.
current_state
=
STATE_Func
if
arg_0
.
script
is
not
:
arg_0
.
script
.
script_init
(
arg_0
.
client
.
lease
,
arg_0
.
current_state
)
arg_0
.
script
.
script_go
(
)
else
:
set_net
(
arg_0
.
client
.
lease
)

def Func(arg_0):
        """Func state."""
        logger.debug('In state: Func')
        arg_0.current_state = STATE_Func
        if arg_0.script is not None:
            arg_0.script.script_init(arg_0.client.lease, arg_0.current_state)
            arg_0.script.script_go()
        else:
            set_net(arg_0.client.lease)


(self, dataset_id, glob=".", is_dir=False)

return self._get_success_json(self._post_json(routes.list_files(dataset_id), data, failure_message="Failed to list files for dataset {}".format(dataset_id)))['files']

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"."
,
arg_3
=
False
)
:
arg_4
=
{
"list"
:
{
"glob"
:
arg_2
,
"isDir"
:
arg_3
}
}
return
arg_0
.
_get_success_json
(
arg_0
.
_post_json
(
routes
.
Func
(
arg_1
)
,
arg_4
,
failure_message
=
"Failed to list files for dataset {}"
.
format
(
arg_1
)
)
)
[
'files'
]

def Func(arg_0, arg_1, arg_2=".", arg_3=False):
        """
        List matched filenames in a dataset on Citrination.

        :param dataset_id: The ID of the dataset to search for files.
        :type dataset_id: int
        :param glob: A pattern which will be matched against files in the dataset.
        :type glob: str
        :param is_dir: A boolean indicating whether or not the pattern should match against the beginning of paths in the dataset.
        :type is_dir: bool
        :return: A list of filepaths in the dataset matching the provided glob.
        :rtype: list of strings
        """
        arg_4 = {
            "list": {
                "glob": arg_2,
                "isDir": arg_3
            }
        }
        return arg_0._get_success_json(arg_0._post_json(routes.Func(arg_1), arg_4, failure_message="Failed to list files for dataset {}".format(arg_1)))['files']

List matched filenames in a dataset on Citrination .


def Func ( arg_0 ) : if isinstance ( arg_0 , _ast . Str ) : return repr ( arg_0 . s ) elif isinstance ( arg_0 , _ast . Num ) : return arg_0 . n elif isinstance ( arg_0 , _ast . Name ) : arg_1 = arg_0 . id if arg_1 == 'True' : return True elif arg_1 == 'False' : return False elif arg_1 == 'None' : return None return arg_1 else : return Unparseable ( )

def Func(arg_0):
    """
    Return `arg` appropriately parsed or mapped to a usable value.

    """
    # Grab the easy to parse values
    if isinstance(arg_0, _ast.Str):
        return repr(arg_0.s)
    elif isinstance(arg_0, _ast.Num):
        return arg_0.n
    elif isinstance(arg_0, _ast.Name):
        arg_1 = arg_0.id
        if arg_1 == 'True':
            return True
        elif arg_1 == 'False':
            return False
        elif arg_1 == 'None':
            return None
        return arg_1
    else:
        # Everything else we don't bother with
        return Unparseable()

Return arg appropriately parsed or mapped to a usable value .


def Func ( arg_0 , arg_1 = False , arg_2 = False ) : try : if "array" in arg_0 . json : return arg_0 . fuzz_elements ( dict ( arg_0 . json ) ) [ "array" ] else : return arg_0 . fuzz_elements ( dict ( arg_0 . json ) ) except Exception as e : raise PJFBaseException ( e . message if hasattr ( e , "message" ) else str ( e ) )

def Func(arg_0, arg_1=False, arg_2=False):
        """
        Return the fuzzed object
        """
        try:
            if "array" in arg_0.json:
                return arg_0.fuzz_elements(dict(arg_0.json))["array"]
            else:
                return arg_0.fuzz_elements(dict(arg_0.json))
        except Exception as e:
            raise PJFBaseException(e.message if hasattr(e, "message") else str(e))


def Func(arg_0, arg_1, arg_2, *arg_3):
    """
    Spawns a tree of jobs to avoid overloading the number of jobs spawned by a single parent.
    This function is appropriate to use when batching samples greater than 1,000.

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param function func: Function to spawn dynamically, passes one sample as first argument
    :param list inputs: Array of samples to be batched
    :param list args: any arguments to be passed to the function
    """
    # num_partitions isn't exposed as an argument in order to be transparent to the user.
    # The value for num_partitions is a tested value
    arg_4 = 100
    arg_5 = len(arg_2) / arg_4
    if arg_5 > 1:
        for arg_6 in partitions(arg_2, arg_5):
            arg_0.addChildJobFn(Func, arg_1, arg_6, *arg_3)
    else:
        for arg_7 in arg_2:
            arg_0.addChildJobFn(arg_1, arg_7, *arg_3)

Spawns a tree of jobs to avoid overloading the number of jobs spawned by a single parent . This function is appropriate to use when batching samples greater than 1 000 .


def Func ( arg_0 ) : arg_1 = [ "" ] * len ( arg_0 [ 0 ] ) arg_1 [ 0 ] = "Total" arg_2 , arg_3 = get_download_total ( arg_0 ) arg_1 [ arg_3 ] = str ( arg_2 ) arg_0 . append ( arg_1 ) return arg_0

def Func(arg_0):
    """Add a final row to rows showing the total downloads"""
    arg_1 = [""] * len(arg_0[0])
    arg_1[0] = "Total"
    arg_2, arg_3 = get_download_total(arg_0)
    arg_1[arg_3] = str(arg_2)
    arg_0.append(arg_1)

    return arg_0


def Func(arg_0, arg_1):
        """ This method is strictly only for in memory keys that are
            passed to Wallet with the ``keys`` argument
        """
        log.debug("Force setting of private keys. Not using the wallet database!")
        if isinstance(arg_1, dict):
            arg_1 = list(arg_1.values())
        elif not isinstance(arg_1, (list, set)):
            arg_1 = [arg_1]
        for arg_2 in arg_1:
            arg_3 = arg_0.publickey_from_wif(arg_2)
            arg_0.store.add(str(arg_2), arg_3)

This method is strictly only for in memory keys that are passed to Wallet with the keys argument


def Func ( ) : arg_0 = GodotApplication ( id = "godot" , plugins = [ CorePlugin ( ) , PuddlePlugin ( ) , WorkbenchPlugin ( ) , ResourcePlugin ( ) , GodotPlugin ( ) ] ) arg_0 . run ( )

def Func():
    """ Runs Godot.
    """
    arg_0 = GodotApplication( id="godot",
        plugins=[CorePlugin(),
                 PuddlePlugin(),
                 WorkbenchPlugin(),
                 ResourcePlugin(),
                 GodotPlugin()] )

    arg_0.run()


def Func ( arg_0 , * arg_1 , ** arg_2 ) : @ action ( Seq ( * arg_1 ) , loc = arg_2 . get ( "loc" , None ) ) def rule ( arg_3 , * arg_4 ) : return arg_4 [ arg_0 ] return rule

def Func(arg_0, *arg_1, **arg_2):
    """
    A rule that accepts a sequence of tokens satisfying ``rules`` and returns
    the value returned by rule number ``n``, or None if the first rule was not satisfied.
    """
    @action(Seq(*arg_1), loc=arg_2.get("loc", None))
    def rule(arg_3, *arg_4):
        return arg_4[arg_0]
    return rule

A rule that accepts a sequence of tokens satisfying rules and returns the value returned by rule number n or None if the first rule was not satisfied .


(self, outdir, froot='gen', relative_to=None)

def Func(arg_0, arg_1, arg_2='gen', arg_3=None):
        """Make a reST API index file from written files

        Parameters
        ----------
        path : string
            Filename to write index to
        outdir : string
            Directory to which to write generated index file
        froot : string, optional
            root (filename without extension) of filename to write to
            Defaults to 'gen'.  We add ``self.rst_extension``.
        relative_to : string
            path to which written filenames are relative.  This
            component of the written file path will be removed from
            outdir, in the generated index.  Default is None, meaning,
            leave path as it is.
        """
        if arg_0.written_modules is None:
            raise ValueError('No modules written')
        # Get full filename path
        arg_4 = os.path.join(arg_1, arg_2+arg_0.rst_extension)
        # Path written into index is relative to rootpath
        if arg_3 is not None:
            arg_5 = arg_1.replace(arg_3 + os.path.sep, '')
        else:
            arg_5 = arg_1
        arg_6 = open(arg_4,'wt')
        arg_7 = arg_6.write
        arg_7('.. AUTO-GENERATED FILE -- DO NOT EDIT!\n\n')
        arg_7('.. toctree::\n\n')
        for arg_8 in arg_0.written_modules:
            arg_7('   %s\n' % os.path.join(arg_5,arg_8))
        arg_6.close()


def Func ( arg_0 ) : try : arg_1 = _regex . match ( arg_0 ) arg_2 = Tag ( int ( arg_1 . group ( 'major' ) ) , int ( arg_1 . group ( 'minor' ) ) , int ( arg_1 . group ( 'patch' ) ) ) return arg_2 if arg_1 . group ( 'label' ) is None else arg_2 . with_revision ( arg_1 . group ( 'label' ) , int ( arg_1 . group ( 'number' ) ) ) except AttributeError : return None

def Func(arg_0):
        """
        Parses a string into a Tag
        """
        try:
            arg_1 = _regex.match(arg_0)
            arg_2 = Tag(int(arg_1.group('major')),
                    int(arg_1.group('minor')),
                    int(arg_1.group('patch')))
            return arg_2 \
                    if arg_1.group('label') is None \
                    else arg_2.with_revision(arg_1.group('label'), int(arg_1.group('number')))
        except AttributeError:
            return None


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting padding...'
)
if
arg_0
[
'mode'
]
==
'constant'
:
if
arg_0
[
'value'
]
!=
0.0
:
raise
AssertionError
(
'Cannot convert non-zero padding'
)
if
arg_6
:
arg_7
=
'PADD'
+
random_string
(
4
)
else
:
arg_7
=
arg_1
+
str
(
random
.
random
(
)
)
arg_8
=
arg_7
arg_9
=
keras
.
layers
.
ZeroPadding2D
(
padding
=
(
(
arg_0
[
'pads'
]
[
2
]
,
arg_0
[
'pads'
]
[
6
]
)
,
(
arg_0
[
'pads'
]
[
3
]
,
arg_0
[
'pads'
]
[
7
]
)
)
,
name
=
arg_8
)
arg_4
[
arg_2
]
=
arg_9
(
arg_4
[
arg_3
[
0
]
]
)
elif
arg_0
[
'mode'
]
==
'reflect'
:
def
target_layer
(
arg_10
,
arg_11
=
arg_0
[
'pads'
]
)
:
arg_12
=
tf
.
pad
(
arg_10
,
[
[
0
,
0
]
,
[
0
,
0
]
,
[
arg_11
[
2
]
,
arg_11
[
6
]
]
,
[
arg_11
[
3
]
,
arg_11
[
7
]
]
]
,
'REFLECT'
)
return
arg_12
arg_13
=
keras
.
layers
.
Lambda
(
target_layer
)
arg_4
[
arg_2
]
=
arg_13
(
arg_4
[
arg_3
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert padding layer.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting padding...')

    if arg_0['mode'] == 'constant':
        # raise AssertionError('Cannot convert non-constant padding')

        if arg_0['value'] != 0.0:
            raise AssertionError('Cannot convert non-zero padding')

        if arg_6:
            arg_7 = 'PADD' + random_string(4)
        else:
            arg_7 = arg_1 + str(random.random())

        # Magic ordering
        arg_8 = arg_7
        arg_9 = keras.layers.ZeroPadding2D(
            padding=((arg_0['pads'][2], arg_0['pads'][6]), (arg_0['pads'][3], arg_0['pads'][7])),
            name=arg_8
        )

        arg_4[arg_2] = arg_9(arg_4[arg_3[0]])
    elif arg_0['mode'] == 'reflect':

        def target_layer(arg_10, arg_11=arg_0['pads']):
            # x = tf.transpose(x, [0, 2, 3, 1])
            arg_12 = tf.pad(arg_10, [[0, 0], [0, 0], [arg_11[2], arg_11[6]], [arg_11[3], arg_11[7]]], 'REFLECT')
            # layer = tf.transpose(layer, [0, 3, 1, 2])
            return arg_12

        arg_13 = keras.layers.Lambda(target_layer)
        arg_4[arg_2] = arg_13(arg_4[arg_3[0]])


def Func ( ) : return HeronTuple ( id = TupleHelper . TICK_TUPLE_ID , component = TupleHelper . TICK_SOURCE_COMPONENT , stream = TupleHelper . TICK_TUPLE_ID , task = None , values = None , creation_time = time . time ( ) , roots = None )

def Func():
    """Creates a TickTuple"""
    return HeronTuple(id=TupleHelper.TICK_TUPLE_ID, component=TupleHelper.TICK_SOURCE_COMPONENT,
                      stream=TupleHelper.TICK_TUPLE_ID, task=None, values=None,
                      creation_time=time.time(), roots=None)


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = BytearrayStream ( ) arg_0 . certificate_type . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . certificate_value . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( Certificate , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_6 . buffer )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Certificate object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a Func method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        arg_6 = BytearrayStream()

        arg_0.certificate_type.Func(arg_6, arg_2=arg_2)
        arg_0.certificate_value.Func(arg_6, arg_2=arg_2)

        arg_0.length = arg_6.length()
        super(Certificate, arg_0).Func(arg_1, arg_2=arg_2)
        arg_1.Func(arg_6.buffer)

Write the data encoding the Certificate object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

Write the data encoding the Certificate object to a stream .


def Func(arg_0, arg_1=True):
    """Requests the logging manager to configure logging.

    :param extract:

        If naming data should be extracted from the trajectory

    """
    try:
        arg_2 = arg_0['logging_manager']
        if arg_1:
            arg_2.extract_replacements(arg_0['traj'])
        arg_2.make_logging_handlers_and_tools(multiproc=True)
    except Exception as exc:
        sys.stderr.write('Could not configure logging system because of: %s' % repr(exc))
        traceback.print_exc()

Requests the logging manager to configure logging .


def Func ( arg_0 , arg_1 ) : arg_0 . targets . insert ( 0 , arg_1 ) arg_0 . loads . insert ( 0 , 0 ) arg_0 . completed [ arg_1 ] = set ( ) arg_0 . failed [ arg_1 ] = set ( ) arg_0 . pending [ arg_1 ] = { } arg_0 . update_graph ( None )

def Func(arg_0, arg_1):
        """New engine with ident `uid` became available."""
        # head of the line:
        arg_0.targets.insert(0,arg_1)
        arg_0.loads.insert(0,0)

        # initialize sets
        arg_0.completed[arg_1] = set()
        arg_0.failed[arg_1] = set()
        arg_0.pending[arg_1] = {}

        # rescan the graph:
        arg_0.update_graph(None)

New engine with ident uid became available .