return annotations, local_endpoint, kind, timestamp, duration

def Func ( arg_0 , arg_1 ) : arg_2 = None arg_3 = Kind . LOCAL arg_4 = { } arg_5 = None arg_6 = None for arg_7 in arg_1 : arg_4 [ arg_7 . value ] = arg_7 . timestamp if arg_7 . host : arg_2 = arg_0 . _convert_from_thrift_endpoint ( arg_7 . host , ) if 'cs' in arg_4 and 'sr' not in arg_4 : arg_3 = Kind . CLIENT arg_5 = arg_4 [ 'cs' ] arg_6 = arg_4 [ 'cr' ] - arg_4 [ 'cs' ] elif 'cs' not in arg_4 and 'sr' in arg_4 : arg_3 = Kind . SERVER arg_5 = arg_4 [ 'sr' ] arg_6 = arg_4 [ 'ss' ] - arg_4 [ 'sr' ] arg_9 = { name : arg_0 . seconds ( ts ) for name , ts in arg_4 . items ( ) if name not in _DROP_ANNOTATIONS } return arg_9 , arg_2 , arg_3 , arg_5 , arg_6

def Func(arg_0, arg_1):
        """Accepts a thrift annotation and converts it to a v1 annotation.

        :param thrift_annotations: list of thrift annotations.
        :type thrift_annotations: list of zipkin_core.Span.Annotation
        :returns: (annotations, local_endpoint, kind)
        """
        arg_2 = None
        arg_3 = Kind.LOCAL
        arg_4 = {}
        arg_5 = None
        arg_6 = None

        for arg_7 in arg_1:
            arg_4[arg_7.value] = arg_7.timestamp
            if arg_7.host:
                arg_2 = arg_0._convert_from_thrift_endpoint(
                    arg_7.host,
                )

        if 'cs' in arg_4 and 'sr' not in arg_4:
            arg_3 = Kind.CLIENT
            arg_5 = arg_4['cs']
            arg_6 = arg_4['cr'] - arg_4['cs']
        elif 'cs' not in arg_4 and 'sr' in arg_4:
            arg_3 = Kind.SERVER
            arg_5 = arg_4['sr']
            arg_6 = arg_4['ss'] - arg_4['sr']

        arg_9 = {
            name: arg_0.seconds(ts) for name, ts in arg_4.items()
            if name not in _DROP_ANNOTATIONS
        }

        return arg_9, arg_2, arg_3, arg_5, arg_6

Accepts a thrift annotation and converts it to a v1 annotation .


def Func(arg_0, arg_1):
        """Asserts that val is an existing path to a file and that file is named filename."""
        arg_0.is_file()
        if not isinstance(arg_1, str_types):
            raise TypeError('given filename arg must be a path')
        arg_2 = os.path.basename(os.path.abspath(arg_0.val))
        if arg_2 != arg_1:
            arg_0._err('Expected filename <%s> to be equal to <%s>, but was not.' % (arg_2, arg_1))
        return arg_0

Asserts that val is an existing path to a file and that file is named filename .


def Func(arg_0, **arg_1):
        """
        Calculate the enthalpy at the specified temperature and composition
        using equation 9 in Merrick1983b.

        :param T: [K] temperature
        :param y_C: Carbon mass fraction
        :param y_H: Hydrogen mass fraction
        :param y_O: Oxygen mass fraction
        :param y_N: Nitrogen mass fraction
        :param y_S: Sulphur mass fraction

        :returns: [J/kg] enthalpy

        The **state parameter contains the keyword argument(s) specified above
        that are used to describe the state of the material.
        """

        arg_2 = arg_1['T']
        arg_3 = arg_1['y_C']
        arg_4 = arg_1['y_H']
        arg_5 = arg_1['y_O']
        arg_6 = arg_1['y_N']
        arg_7 = arg_1['y_S']

        arg_8 = arg_0._calc_a(arg_3, arg_4, arg_5, arg_6, arg_7) / 1000  # kg/mol
        arg_9 = (R/arg_8) * (380*arg_0._calc_g0(380/arg_2) + 3600*arg_0._calc_g0(1800/arg_2))
        return arg_9

Calculate the enthalpy at the specified temperature and composition using equation 9 in Merrick1983b .


(
    offset,
    G,
    heritability=0.5,
    causal_variants=None,
    causal_variance=0,
    random_state=None,
)

def Func(
    arg_0,
    arg_1,
    arg_2=0.5,
    arg_3=None,
    arg_4=0,
    arg_5=None,
):
    """Poisson likelihood sampling.

    Parameters
    ----------
    random_state : random_state
        Set the initial random state.

    Example
    -------

    .. doctest::

        >>> from glimix_core.random import Func
        >>> from numpy.random import RandomState
        >>> offset = -0.5
        >>> G = [[0.5, -1], [2, 1]]
        >>> Func(offset, G, random_state=RandomState(0))
        array([0, 6])
    """
    arg_6, arg_7 = _mean_cov(
        arg_0, arg_1, arg_2, arg_3, arg_4, arg_5
    )
    arg_8 = LogLink()
    arg_9 = PoissonProdLik(arg_8)
    arg_10 = GGPSampler(arg_9, arg_6, arg_7)

    return arg_10.sample(arg_5)

Poisson likelihood sampling.

    Parameters
    ----------
    random_state : random_state
        Set the initial random state.

    Example
    -------

    .. doctest::

        >>> from glimix_core.random import poisson_sample
        >>> from numpy.random import RandomState
        >>> offset = -0.5
        >>> G = [[0.5, -1], [2, 1]]
        >>> poisson_sample(offset, G, random_state=RandomState(0))
        array([0, 6])


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . requests . append ( ( WRITE , arg_2 , arg_3 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        on writeReqRecieved in monitor mode
        """
        arg_0.requests.append((WRITE, arg_2, arg_3))


def  Func( arg_0, arg_1 ):
        """ convert words of a paragraph into tagged HTML text, handle xrefs """
        arg_2 = ""
        if arg_1:
            arg_2 = arg_0.make_html_word( arg_1[0] )
            for arg_3 in arg_1[1:]:
                arg_2 = arg_2 + " " + arg_0.make_html_word( arg_3 )
            # convert `...' quotations into real left and right single quotes
            arg_2 = re.sub( r"(^|\W)`(.*?)'(\W|$)",  \
                           r'\1‘\2’\3', \
                           arg_2 )
            # convert tilde into non-breakable space
            arg_2 = string.replace( arg_2, "~", " " )

        return para_header + arg_2 + para_footer

convert words of a paragraph into tagged HTML text handle xrefs


return np.mean([apk(a,p,k) for a,p in zip(actual, predicted)])

def Func ( arg_0 , arg_1 , arg_2 = 10 ) : return np . mean ( [ apk ( arg_3 , arg_4 , arg_2 ) for arg_3 , arg_4 in zip ( arg_0 , arg_1 ) ] )

def Func(arg_0, arg_1, arg_2=10):
    """
    Computes the mean average precision at k.

    This function computes the mean average prescision at k between two lists
    of lists of items.

    Parameters
    ----------
    actual : list
             A list of lists of elements that are to be predicted
             (order doesn't matter in the lists)
    predicted : list
                A list of lists of predicted elements
                (order matters in the lists)
    k : int, optional
        The maximum number of predicted elements

    Returns
    -------
    score : double
            The mean average precision at k over the input lists

    """
    return np.mean([apk(arg_3,arg_4,arg_2) for arg_3,arg_4 in zip(arg_0, arg_1)])

Computes the mean average precision at k .


def Func ( arg_0 ) : try : arg_1 = ipaddress . ip_address ( u'' + arg_0 ) return arg_1 . is_loopback except ValueError as e : return None

def Func(arg_0):
    """ Check if IP is local """

    try:
        arg_1 = ipaddress.ip_address(u'' + arg_0)
        return arg_1.is_loopback
    except ValueError as e:
        return None


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
__class__
.
MAX_TOL
if
arg_1
<
0
:
raise
QiskitError
(
"Invalid rtol: must be non-negative."
)
if
arg_1
>
arg_2
:
raise
QiskitError
(
"Invalid rtol: must be less than {}."
.
format
(
arg_2
)
)
arg_0
.
__class__
.
RTOL
=
arg_1

def Func(arg_0, arg_1):
        """Set the relative tolerence parameter for float comparisons."""
        # NOTE: that this overrides the class value so applies to all
        # instances of the class.
        arg_2 = arg_0.__class__.MAX_TOL
        if arg_1 < 0:
            raise QiskitError("Invalid rtol: must be non-negative.")
        if arg_1 > arg_2:
            raise QiskitError(
                "Invalid rtol: must be less than {}.".format(arg_2))
        arg_0.__class__.RTOL = arg_1

Set the relative tolerence parameter for float comparisons .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None : arg_0 = arg_0 . translate ( string . maketrans ( arg_1 [ : 2 ] , '+/' ) ) try : return binascii . a2b_base64 ( arg_0 ) except binascii . Error , msg : raise TypeError ( msg )

def Func(arg_0, arg_1=None):
    """Decode a Base64 encoded string.

    s is the string to decode.  Optional altchars must be a string of at least
    length 2 (additional characters are ignored) which specifies the
    alternative alphabet used instead of the '+' and '/' characters.

    The decoded string is returned.  A TypeError is raised if s is
    incorrectly padded.  Characters that are neither in the normal base-64
    alphabet nor the alternative alphabet are discarded prior to the padding
    check.
    """
    if arg_1 is not None:
        arg_0 = arg_0.translate(string.maketrans(arg_1[:2], '+/'))
    try:
        return binascii.a2b_base64(arg_0)
    except binascii.Error, msg:
        # Transform this exception for consistency
        raise TypeError(msg)


def Func ( arg_0 , arg_1 ) : arg_2 = set ( arg_0 . list_resource_commands ( ) ) arg_2 . union ( set ( arg_0 . list_misc_commands ( ) ) ) return sorted ( arg_2 )

def Func(arg_0, arg_1):
        """Return a list of commands present in the commands and resources
        folders, but not subcommands.
        """
        arg_2 = set(arg_0.list_resource_commands())
        arg_2.union(set(arg_0.list_misc_commands()))
        return sorted(arg_2)

Return a list of commands present in the commands and resources folders but not subcommands .


def Func ( arg_0 , arg_1 ) : if arg_1 == arg_0 [ "quote" ] [ "symbol" ] : return arg_0 . copy ( ) elif arg_1 == arg_0 [ "base" ] [ "symbol" ] : return arg_0 . copy ( ) . invert ( ) else : raise InvalidAssetException

def Func(arg_0, arg_1):
        """ Returns the price instance so that the quote asset is ``quote``.

            Note: This makes a copy of the object!
        """
        if arg_1 == arg_0["quote"]["symbol"]:
            return arg_0.copy()
        elif arg_1 == arg_0["base"]["symbol"]:
            return arg_0.copy().invert()
        else:
            raise InvalidAssetException

Returns the price instance so that the quote asset is quote .


def Func(arg_0):
    """
    Args for the init command
    """
    arg_0.add_argument('-e', '--environment',  help='Environment name', required=False, nargs='+')
    arg_0.add_argument('-w', '--dont-wait', help='Skip waiting for the app to be deleted', action='store_true')


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = g . user if arg_1 . is_anonymous : arg_2 = appbuilder . config . get ( 'AUTH_ROLE_PUBLIC' ) return [ appbuilder . security_manager . find_role ( arg_2 ) ] if arg_2 else [ ] return arg_1 . roles

def Func(arg_0, arg_1=None):
        """
        Get all the roles associated with the user.

        :param user: the ab_user in FAB model.
        :return: a list of roles associated with the user.
        """
        if arg_1 is None:
            arg_1 = g.user
        if arg_1.is_anonymous:
            arg_2 = appbuilder.config.get('AUTH_ROLE_PUBLIC')
            return [appbuilder.security_manager.find_role(arg_2)] \
                if arg_2 else []
        return arg_1.roles

Get all the roles associated with the user .


def
Func
(
arg_0
)
:
arg_0
.
log
.
info
(
"IPython cluster: Funced"
)
arg_0
.
log
.
info
(
'Starting engines with [daemon=%r]'
%
arg_0
.
daemonize
)
if
arg_0
.
daemonize
:
if
os
.
name
==
'posix'
:
daemonize
(
)
arg_1
=
ioloop
.
DelayedCallback
(
arg_0
.
Func_engines
,
0
,
arg_0
.
loop
)
arg_1
.
Func
(
)
try
:
arg_0
.
loop
.
Func
(
)
except
KeyboardInterrupt
:
pass
except
zmq
.
ZMQError
as
e
:
if
e
.
errno
==
errno
.
EINTR
:
pass
else
:
raise

def Func(arg_0):
        """Start the app for the engines subcommand."""
        arg_0.log.info("IPython cluster: Funced")
        # First see if the cluster is already running

        # Now log and daemonize
        arg_0.log.info(
            'Starting engines with [daemon=%r]' % arg_0.daemonize
        )
        # TODO: Get daemonize working on Windows or as a Windows Server.
        if arg_0.daemonize:
            if os.name=='posix':
                daemonize()

        arg_1 = ioloop.DelayedCallback(arg_0.Func_engines, 0, arg_0.loop)
        arg_1.Func()
        # Now write the new pid file AFTER our new forked pid is active.
        # self.write_pid_file()
        try:
            arg_0.loop.Func()
        except KeyboardInterrupt:
            pass
        except zmq.ZMQError as e:
            if e.errno == errno.EINTR:
                pass
            else:
                raise

Start the app for the engines subcommand .


def Func ( arg_0 ) : if isinstance ( arg_0 , dict ) : return dict ( ( Func ( arg_1 ) , Func ( arg_2 ) ) for ( arg_1 , arg_2 ) in arg_0 . iteritems ( ) ) elif isinstance ( arg_0 , list ) : return list ( Func ( arg_3 ) for arg_3 in arg_0 ) elif isinstance ( arg_0 , tuple ) : return tuple ( Func ( arg_3 ) for arg_3 in arg_0 ) elif isinstance ( arg_0 , bytes ) : return to_unicode ( arg_0 ) else : return arg_0

def Func(arg_0):
    """Walks a simple data structure, converting byte strings to unicode.

    Supports lists, tuples, and dictionaries.
    """
    if isinstance(arg_0, dict):
        return dict((Func(arg_1), Func(arg_2)) for (arg_1,arg_2) in arg_0.iteritems())
    elif isinstance(arg_0, list):
        return list(Func(arg_3) for arg_3 in arg_0)
    elif isinstance(arg_0, tuple):
        return tuple(Func(arg_3) for arg_3 in arg_0)
    elif isinstance(arg_0, bytes):
        return to_unicode(arg_0)
    else:
        return arg_0

Walks a simple data structure converting byte strings to unicode .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 ( token = arg_1 , id = arg_2 ) arg_3 . load ( ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
            Class method that will return a SSHKey object by ID.
        """
        arg_3 = arg_0(token=arg_1, id=arg_2)
        arg_3.load()
        return arg_3

Class method that will return a SSHKey object by ID .


return [parse_node(ss.strip(), **kw) for ss in s.split(';') if ss.strip()]

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_2 [ 'strip_comments' ] = arg_1 return [ parse_node ( arg_3 . strip ( ) , ** arg_2 ) for arg_3 in arg_0 . split ( ';' ) if arg_3 . strip ( ) ]

def Func(arg_0, arg_1=False, **arg_2):
    """
    Load a list of trees from a Newick formatted string.

    :param s: Newick formatted string.
    :param strip_comments: Flag signaling whether to strip comments enclosed in square \
    brackets.
    :param kw: Keyword arguments are passed through to `Node.create`.
    :return: List of Node objects.
    """
    arg_2['strip_comments'] = arg_1
    return [parse_node(arg_3.strip(), **arg_2) for arg_3 in arg_0.split(';') if arg_3.strip()]

Load a list of trees from a Newick formatted string .


(cplist,
                                    xmatchpkl,
                                    xmatchradiusarcsec=2.0,
                                    updateexisting=True,
                                    resultstodir=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
2.0
,
arg_3
=
True
,
arg_4
=
)
:
with
open
(
arg_1
,
'rb'
)
as
infd
:
arg_5
=
pickle
.
load
(
infd
)
arg_6
=
{
}
for
arg_7
in
arg_0
:
arg_8
=
_read_checkplot_picklefile
(
arg_7
)
try
:
xmatch_external_catalogs
(
arg_8
,
arg_5
,
arg_2
=
arg_2
,
updatexmatch
=
arg_3
)
for
arg_9
in
arg_8
[
'xmatch'
]
:
if
arg_8
[
'xmatch'
]
[
arg_9
]
[
'found'
]
:
LOGINFO
(
'checkplot %s: %s matched to %s, '
'match dist: %s arcsec'
%
(
os
.
path
.
basename
(
arg_7
)
,
arg_8
[
'objectid'
]
,
arg_8
[
'xmatch'
]
[
arg_9
]
[
'name'
]
,
arg_8
[
'xmatch'
]
[
arg_9
]
[
'distarcsec'
]
)
)
if
not
arg_4
:
arg_10
=
_write_checkplot_picklefile
(
arg_8
,
outfile
=
arg_7
)
else
:
arg_11
=
os
.
path
.
join
(
arg_4
,
os
.
path
.
basename
(
arg_7
)
)
arg_10
=
_write_checkplot_picklefile
(
arg_8
,
outfile
=
arg_11
)
arg_6
[
arg_7
]
=
arg_10
except
Exception
as
e
:
LOGEXCEPTION
(
'failed to match objects for %s'
%
arg_7
)
arg_6
[
arg_7
]
=
return
arg_6

def Func(arg_0,
                                    arg_1,
                                    arg_2=2.0,
                                    arg_3=True,
                                    arg_4=None):
    '''This xmatches external catalogs to a collection of checkplots.

    Parameters
    ----------

    cplist : list of str
        This is the list of checkplot pickle files to process.

    xmatchpkl : str
        The filename of a pickle prepared beforehand with the
        `checkplot.pkl_xmatch.load_xmatch_external_catalogs` function,
        containing collected external catalogs to cross-match the objects in the
        input `cplist` against.

    xmatchradiusarcsec : float
        The match radius to use for the cross-match in arcseconds.

    updateexisting : bool
        If this is True, will only update the `xmatch` dict in each checkplot
        pickle with any new cross-matches to the external catalogs. If False,
        will overwrite the `xmatch` dict with results from the current run.

    resultstodir : str or None
        If this is provided, then it must be a directory to write the resulting
        checkplots to after xmatch is done. This can be used to keep the
        original checkplots in pristine condition for some reason.

    Returns
    -------

    dict
        Returns a dict with keys = input checkplot pickle filenames and vals =
        xmatch status dict for each checkplot pickle.

    '''

    # load the external catalog
    with open(arg_1,'rb') as infd:
        arg_5 = pickle.load(infd)

    # match each object. this is fairly fast, so this is not parallelized at the
    # moment

    arg_6 = {}

    for arg_7 in arg_0:

        arg_8 = _read_checkplot_picklefile(arg_7)

        try:

            # match in place
            xmatch_external_catalogs(arg_8, arg_5,
                                     arg_2=arg_2,
                                     updatexmatch=arg_3)

            for arg_9 in arg_8['xmatch']:

                if arg_8['xmatch'][arg_9]['found']:
                    LOGINFO('checkplot %s: %s matched to %s, '
                            'match dist: %s arcsec' %
                            (os.path.basename(arg_7),
                             arg_8['objectid'],
                             arg_8['xmatch'][arg_9]['name'],
                             arg_8['xmatch'][arg_9]['distarcsec']))

                if not arg_4:
                    arg_10 = _write_checkplot_picklefile(arg_8,
                                                         outfile=arg_7)
                else:
                    arg_11 = os.path.join(arg_4, os.path.basename(arg_7))
                    arg_10 = _write_checkplot_picklefile(arg_8,
                                                         outfile=arg_11)

            arg_6[arg_7] = arg_10

        except Exception as e:

            LOGEXCEPTION('failed to match objects for %s' % arg_7)
            arg_6[arg_7] = None

    return arg_6

This xmatches external catalogs to a collection of checkplots .


(self, expressions_list=None, dimensions=None, exclude=None, **kwargs)

return vaex.legacy.Subspaces([self(*expressions, **kwargs) for expressions in expressions_list])

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, **arg_4):
        """Generate a Subspaces object, based on a custom list of expressions or all possible combinations based on
        dimension

        :param expressions_list: list of list of expressions, where the inner list defines the subspace
        :param dimensions: if given, generates a subspace with all possible combinations for that dimension
        :param exclude: list of
        """
        if arg_2 is not None:
            arg_1 = list(itertools.combinations(arg_0.get_column_names(), arg_2))
            if arg_3 is not None:
                import six

                def excluded(arg_5):
                    if callable(arg_3):
                        return arg_3(arg_5)
                    elif isinstance(arg_3, six.string_types):
                        return arg_3 in arg_5
                    elif isinstance(arg_3, (list, tuple)):
                        # $#expressions = set(expressions)
                        for arg_6 in arg_3:
                            if isinstance(arg_6, six.string_types):
                                if arg_6 in arg_5:
                                    return True
                            elif isinstance(arg_6, (list, tuple)):
                                if set(arg_6).issubset(arg_5):
                                    return True
                            else:
                                raise ValueError("elements of exclude should contain a string or a sequence of strings")
                    else:
                        raise ValueError("exclude should contain a string, a sequence of strings, or should be a callable")
                    return False
                # test if any of the elements of exclude are a subset of the expression
                arg_1 = [expr for expr in arg_1 if not excluded(expr)]
            logger.debug("expression list generated: %r", arg_1)
        import vaex.legacy
        return vaex.legacy.Subspaces([arg_0(*arg_5, **arg_4) for arg_5 in arg_1])

Generate a Subspaces object based on a custom list of expressions or all possible combinations based on dimension


(shape, scale=None, dtype=tf.float32, seed=None, name=None)

def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 . float32 , arg_5 = None , arg_6 = None ) : with arg_3 . compat . v1 . name_scope ( arg_6 , 'Func' , [ arg_0 , arg_1 , arg_5 ] ) : if arg_1 is not None : arg_1 = arg_3 . convert_to_tensor ( value = arg_1 , arg_2 = arg_2 , arg_6 = 'scale' ) arg_0 = arg_3 . broadcast_dynamic_shape ( arg_0 , arg_3 . shape ( input = arg_1 ) ) arg_7 = arg_3 . sqrt ( - 2. * arg_3 . math . log ( arg_3 . random . uniform ( arg_0 , minval = 0 , maxval = 1 , arg_2 = arg_2 , arg_5 = arg_5 ) ) ) if arg_1 is None : return arg_7 return arg_7 * arg_1

def Func(arg_0, arg_1=None, arg_2=arg_3.float32, arg_5=None, arg_6=None):
  """Generates `Tensor` of positive reals drawn from a Rayleigh distributions.

  The probability density function of a Rayleigh distribution with `scale`
  parameter is given by:

  ```none
  f(x) = x scale**-2 exp(-x**2 0.5 scale**-2)
  ```

  For more details, see [Rayleigh distribution](
  https://en.wikipedia.org/wiki/Rayleigh_distribution)

  Args:
    shape: Vector-shaped, `int` `Tensor` representing shape of output.
    scale: (Optional) Positive `float` `Tensor` representing `Rayleigh` scale.
      Default value: `None` (i.e., `scale = 1.`).
    dtype: (Optional) TF `dtype` representing `dtype` of output.
      Default value: `tf.float32`.
    seed: (Optional) Python integer to seed the random number generator.
      Default value: `None` (i.e., no seed).
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'Func').

  Returns:
    rayleigh: `Tensor` with specified `shape` and `dtype` consisting of positive
      real values drawn from a Rayleigh distribution with specified `scale`.
  """
  with arg_3.compat.v1.name_scope(arg_6, 'Func', [arg_0, arg_1, arg_5]):
    if arg_1 is not None:
      # Its important to expand the shape to match scale's, otherwise we won't
      # have independent draws.
      arg_1 = arg_3.convert_to_tensor(value=arg_1, arg_2=arg_2, arg_6='scale')
      arg_0 = arg_3.broadcast_dynamic_shape(arg_0, arg_3.shape(input=arg_1))
    arg_7 = arg_3.sqrt(-2. * arg_3.math.log(
        arg_3.random.uniform(arg_0, minval=0, maxval=1, arg_2=arg_2, arg_5=arg_5)))
    if arg_1 is None:
      return arg_7
    return arg_7 * arg_1

Generates `Tensor` of positive reals drawn from a Rayleigh distributions.

  The probability density function of a Rayleigh distribution with `scale`
  parameter is given by:

  ```none
  f(x) = x scale**-2 exp(-x**2 0.5 scale**-2)
  ```

  For more details, see [Rayleigh distribution](
  https://en.wikipedia.org/wiki/Rayleigh_distribution)

  Args:
    shape: Vector-shaped, `int` `Tensor` representing shape of output.
    scale: (Optional) Positive `float` `Tensor` representing `Rayleigh` scale.
      Default value: `None` (i.e., `scale = 1.`).
    dtype: (Optional) TF `dtype` representing `dtype` of output.
      Default value: `tf.float32`.
    seed: (Optional) Python integer to seed the random number generator.
      Default value: `None` (i.e., no seed).
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'random_rayleigh').

  Returns:
    rayleigh: `Tensor` with specified `shape` and `dtype` consisting of positive
      real values drawn from a Rayleigh distribution with specified `scale`.

Generates Tensor of positive reals drawn from a Rayleigh distributions .


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

    arg_1 = arg_0.add_parser("replot", help="Reproduce GSEA desktop output figures.")

    arg_2 = arg_1.add_argument_group("Input arguments")

    arg_2.add_argument("-i", "--indir", action="store", dest="indir", required=True, metavar='GSEA_dir',
                              help="The GSEA desktop results directroy that you want to reproduce the figure ")
    add_output_option(arg_2)
    #add_output_group( argparser_plot )
    arg_2.add_argument("-w", "--weight", action='store', dest='weight', default=1.0, type=float, metavar='float',
                              help='Weighted_score of rank_metrics. Please Use the same value in GSEA. Choose from (0, 1, 1.5, 2),default: 1',)

    return


def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 , arg_2 , * arg_3 , ** arg_4 ) : if not isinstance ( arg_2 , TransformedGrid ) : return arg_0 ( arg_1 , arg_1 . Func_to_reference_frame ( arg_2 ) , * arg_3 , ** arg_4 ) else : return arg_0 ( arg_1 , arg_2 , * arg_3 , ** arg_4 ) return wrapper

def Func(arg_0):
    """Wrap the function in a function that checks whether the coordinates have been transformed. If they have not \
    been transformed then they are transformed.

    Parameters
    ----------
    func : (profiles, *args, **kwargs) -> Object
        A function that requires transformed coordinates

    Returns
    -------
        A function that can except cartesian or transformed coordinates
    """

    @wraps(arg_0)
    def wrapper(arg_1, arg_2, *arg_3, **arg_4):
        """

        Parameters
        ----------
        profile : GeometryProfile
            The profiles that owns the function
        grid : ndarray
            PlaneCoordinates in either cartesian or profiles coordinate system
        args
        kwargs

        Returns
        -------
            A value or coordinate in the same coordinate system as those passed in.
        """
        if not isinstance(arg_2, TransformedGrid):
            return arg_0(arg_1, arg_1.Func_to_reference_frame(arg_2), *arg_3, **arg_4)
        else:
            return arg_0(arg_1, arg_2, *arg_3, **arg_4)

    return wrapper

Wrap the function in a function that checks whether the coordinates have been transformed . If they have not \ been transformed then they are transformed .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
try
:
arg_0
.
connection
=
pg
.
connect
(
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_1
=
arg_1
,
arg_4
=
arg_4
)
LOGINFO
(
'postgres connection successfully '
'created, using DB %s, user %s'
%
(
arg_1
,
arg_2
)
)
arg_0
.
database
=
arg_1
arg_0
.
user
=
arg_2
except
Exception
as
e
:
LOGEXCEPTION
(
'postgres connection failed, '
'using DB %s, user %s'
%
(
arg_1
,
arg_2
)
)
arg_0
.
database
=
arg_0
.
user
=

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''This Funcs a new database connection.

        Parameters
        ----------

        database : str
            Name of the database to connect to.

        user : str
            User name of the database server user.

        password : str
            Password for the database server user.

        host : str
            Database hostname or IP address to connect to.

        '''

        try:

            arg_0.connection = pg.connect(arg_2=arg_2,
                                         arg_3=arg_3,
                                         arg_1=arg_1,
                                         arg_4=arg_4)

            LOGINFO('postgres connection successfully '
                    'created, using DB %s, user %s' % (arg_1,
                                                       arg_2))

            arg_0.database = arg_1
            arg_0.user = arg_2

        except Exception as e:

            LOGEXCEPTION('postgres connection failed, '
                         'using DB %s, user %s' % (arg_1,
                                                   arg_2))

            arg_0.database = None
            arg_0.user = None

This opens a new database connection.

        Parameters
        ----------

        database : str
            Name of the database to connect to.

        user : str
            User name of the database server user.

        password : str
            Password for the database server user.

        host : str
            Database hostname or IP address to connect to.


(lcc_server,
                dataset_id,
                strformat=False,
                page=1)

def Func(arg_0,
                arg_1,
                arg_2=False,
                arg_3=1):
    '''This downloads a JSON form of a dataset from the specified lcc_server.

    If the dataset contains more than 1000 rows, it will be paginated, so you
    must use the `page` kwarg to get the page you want. The dataset JSON will
    contain the keys 'npages', 'currpage', and 'rows_per_page' to help with
    this. The 'rows' key contains the actual data rows as a list of tuples.

    The JSON contains metadata about the query that produced the dataset,
    information about the data table's columns, and links to download the
    dataset's products including the light curve ZIP and the dataset CSV.

    Parameters
    ----------

    lcc_server : str
        This is the base URL of the LCC-Server to talk to.

    dataset_id : str
        This is the unique setid of the dataset you want to get. In the results
        from the `*_search` functions above, this is the value of the
        `infodict['result']['setid']` key in the first item (the infodict) in
        the returned tuple.

    strformat : bool
        This sets if you want the returned data rows to be formatted in their
        string representations already. This can be useful if you're piping the
        returned JSON straight into some sort of UI and you don't want to deal
        with formatting floats, etc. To do this manually when strformat is set
        to False, look at the `coldesc` item in the returned dict, which gives
        the Python and Numpy string format specifiers for each column in the
        data table.

    page : int
        This sets which page of the dataset should be retrieved.

    Returns
    -------

    dict
        This returns the dataset JSON loaded into a dict.

    '''

    arg_4 = {'strformat':1 if arg_2 else 0,
                 'page':arg_3,
                 'json':1}
    arg_5 = urlencode(arg_4)

    arg_6 = '%s/set/%s?%s' % (arg_0, arg_1, arg_5)

    LOGINFO('retrieving dataset %s from %s, using URL: %s ...' % (arg_0,
                                                                  arg_1,
                                                                  arg_6))

    try:

        # check if we have an API key already
        arg_7, arg_8, arg_9 = check_existing_apikey(arg_0)

        # if not, get a new one
        if not arg_7:
            arg_8, arg_9 = get_new_apikey(arg_0)

        # if apikey is not None, add it in as an Authorization: Bearer [apikey]
        # header
        if arg_8:
            arg_10 = {'Authorization':'Bearer: %s' % arg_8}
        else:
            arg_10 = {}

        # hit the server
        arg_11 = Request(arg_6, data=None, arg_10=arg_10)
        arg_12 = urlopen(arg_11)
        arg_13 = json.loads(arg_12.read())
        return arg_13

    except Exception as e:

        LOGEXCEPTION('could not retrieve the dataset JSON!')
        return None

This downloads a JSON form of a dataset from the specified lcc_server .


def Func ( arg_0 , arg_1 ) : arg_2 = db . get_session ( ) arg_2 . query ( db . RecordedEvent ) . filter ( db . RecordedEvent . start == arg_0 . start ) . update ( { 'status' : arg_1 } ) arg_0 . status = arg_1 arg_2 . commit ( )

def Func(arg_0, arg_1):
    '''Update the status of a particular event in the database.
    '''
    arg_2 = db.get_session()
    arg_2.query(db.RecordedEvent).filter(db.RecordedEvent.start == arg_0.start)\
                               .update({'status': arg_1})
    arg_0.status = arg_1
    arg_2.commit()

Update the status of a particular event in the database .


(array, format='%f', includeIndices=False, includeZeros=True)

def
Func
(
arg_0
,
arg_1
=
'%f'
,
arg_2
=
False
,
arg_3
=
True
)
:
arg_4
=
arg_0
.
shape
assert
(
len
(
arg_4
)
<=
2
)
arg_5
=
[
'['
]
if
len
(
arg_4
)
==
1
:
if
arg_2
:
arg_1
=
'%d:'
+
arg_1
if
arg_3
:
arg_6
=
[
arg_1
%
(
c
,
x
)
for
(
c
,
x
)
in
enumerate
(
arg_0
)
]
else
:
arg_6
=
[
arg_1
%
(
c
,
x
)
for
(
c
,
x
)
in
enumerate
(
arg_0
)
if
x
!=
0
]
else
:
arg_6
=
[
arg_1
%
(
x
)
for
x
in
arg_0
]
arg_5
.
extend
(
arg_6
)
else
:
(
arg_7
,
arg_8
)
=
arg_4
if
arg_2
:
arg_1
=
'%d,%d:'
+
arg_1
for
arg_9
in
xrange
(
arg_7
)
:
if
arg_2
:
arg_6
=
[
arg_1
%
(
arg_9
,
c
,
x
)
for
c
,
x
in
enumerate
(
arg_0
[
arg_9
]
)
]
else
:
arg_6
=
[
arg_1
%
(
x
)
for
x
in
arg_0
[
arg_9
]
]
if
arg_9
>
0
:
arg_5
.
append
(
''
)
arg_5
.
append
(
'['
)
arg_5
.
extend
(
arg_6
)
if
arg_9
<
arg_7
1
:
arg_5
.
append
(
']\n'
)
else
:
arg_5
.
append
(
']'
)
arg_5
.
append
(
']'
)
return
' '
.
join
(
arg_5
)

def Func(arg_0, arg_1='%f', arg_2=False, arg_3=True):
  """ Pretty print a numpy matrix using the given format string for each
  value. Return the string representation

  Parameters:
  ------------------------------------------------------------
  array:    The numpy array to print. This can be either a 1D vector or 2D matrix
  format:   The format string to use for each value
  includeIndices: If true, include [row,col] label for each value
  includeZeros:   Can only be set to False if includeIndices is on.
                  If True, include 0 values in the print-out
                  If False, exclude 0 values from the print-out.

  """

  arg_4 = arg_0.shape
  assert (len(arg_4) <= 2)
  arg_5 = ['[']
  if len(arg_4) == 1:
    if arg_2:
      arg_1 = '%d:' + arg_1
      if arg_3:
        arg_6 = [arg_1 % (c,x) for (c,x) in enumerate(arg_0)]
      else:
        arg_6 = [arg_1 % (c,x) for (c,x) in enumerate(arg_0) if x != 0]
    else:
      arg_6 = [arg_1 % (x) for x in arg_0]
    arg_5.extend(arg_6)

  else:
    (arg_7, arg_8) = arg_4
    if arg_2:
      arg_1 = '%d,%d:' + arg_1

    for arg_9 in xrange(arg_7):
      if arg_2:
        arg_6 = [arg_1 % (arg_9,c,x) for c,x in enumerate(arg_0[arg_9])]
      else:
        arg_6 = [arg_1 % (x) for x in arg_0[arg_9]]
      if arg_9 > 0:
        arg_5.append('')

      arg_5.append('[')
      arg_5.extend(arg_6)
      if arg_9 < arg_7-1:
        arg_5.append(']\n')
      else:
        arg_5.append(']')

  arg_5.append(']')
  return ' '.join(arg_5)

Pretty print a numpy matrix using the given format string for each value . Return the string representation


return response.headers.type == content_type

def Func ( arg_0 , arg_1 ) : try : arg_2 = urllib2 . urlopen ( arg_0 ) except : return False return arg_2 . headers . type == arg_1

def Func(arg_0, arg_1):
    '''
    Compare the content type header of url param with content_type param and returns boolean
    @param url -> string e.g. http://127.0.0.1/index
    @param content_type -> string e.g. text/html
    '''
    try:
        arg_2 = urllib2.urlopen(arg_0)
    except:
        return False

    return arg_2.headers.type == arg_1


def Func ( arg_0 , arg_1 = 10 ) : arg_0 = arg_0 . copy ( ) arg_2 = ep . cum_returns ( arg_0 , 1.0 ) arg_3 = np . maximum . accumulate ( arg_2 ) arg_4 = arg_2 / arg_3 - 1 arg_5 = [ ] for arg_6 in range ( arg_1 ) : arg_7 , arg_8 , arg_9 = get_max_drawdown_underwater ( arg_4 ) if not pd . isnull ( arg_9 ) : arg_4 . drop ( arg_4 [ arg_7 : arg_9 ] . index [ 1 : - 1 ] , inplace = True ) else : arg_4 = arg_4 . loc [ : arg_7 ] arg_5 . append ( ( arg_7 , arg_8 , arg_9 ) ) if ( len ( arg_0 ) == 0 ) or ( len ( arg_4 ) == 0 ) : break return arg_5

def Func(arg_0, arg_1=10):
    """
    Finds top drawdowns, sorted by drawdown amount.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    top : int, optional
        The amount of top drawdowns to find (default 10).

    Returns
    -------
    drawdowns : list
        List of drawdown peaks, valleys, and recoveries. See get_max_drawdown.
    """

    arg_0 = arg_0.copy()
    arg_2 = ep.cum_returns(arg_0, 1.0)
    arg_3 = np.maximum.accumulate(arg_2)
    arg_4 = arg_2 / arg_3 - 1

    arg_5 = []
    for arg_6 in range(arg_1):
        arg_7, arg_8, arg_9 = get_max_drawdown_underwater(arg_4)
        # Slice out draw-down period
        if not pd.isnull(arg_9):
            arg_4.drop(arg_4[arg_7: arg_9].index[1:-1],
                            inplace=True)
        else:
            # drawdown has not ended yet
            arg_4 = arg_4.loc[:arg_7]

        arg_5.append((arg_7, arg_8, arg_9))
        if (len(arg_0) == 0) or (len(arg_4) == 0):
            break

    return arg_5

Finds top drawdowns sorted by drawdown amount .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = { 'git_refs' : arg_3 } arg_5 = uritemplate . expand ( urljoin ( arg_0 , '/products/{p}/builds/' ) , p = arg_2 ) arg_6 = requests . post ( arg_5 , auth = ( arg_1 , '' ) , json = arg_4 ) if arg_6 . status_code != 201 : raise KeeperError ( arg_6 . json ( ) ) arg_7 = arg_6 . json ( ) return arg_7

def Func(arg_0, arg_1, arg_2, arg_3):
    """Register a new build for a product on LSST the Docs.

    Wraps ``POST /products/{product}/builds/``.

    Parameters
    ----------
    host : `str`
        Hostname of LTD Keeper API server.
    keeper_token : `str`
        Auth token (`ltdconveyor.keeper.get_keeper_token`).
    product : `str`
        Name of the product in the LTD Keeper service.
    git_refs : `list` of `str`
        List of Git refs that correspond to the version of the build. Git refs
        can be tags or branches.

    Returns
    -------
    build_info : `dict`
        LTD Keeper build resource.

    Raises
    ------
    ltdconveyor.keeper.KeeperError
        Raised if there is an error communicating with the LTD Keeper API.
    """
    arg_4 = {
        'git_refs': arg_3
    }

    arg_5 = uritemplate.expand(
        urljoin(arg_0, '/products/{p}/builds/'),
        p=arg_2)

    arg_6 = requests.post(
        arg_5,
        auth=(arg_1, ''),
        json=arg_4)

    if arg_6.status_code != 201:
        raise KeeperError(arg_6.json())
    arg_7 = arg_6.json()
    return arg_7

Register a new build for a product on LSST the Docs .


def
Func
(
arg_0
,
arg_1
=
'/'
,
arg_2
=
arg_3
.
Dataset
)
:
if
isinstance
(
arg_0
,
str
)
:
arg_5
=
get_h5file
(
arg_0
,
mode
=
'r'
)
else
:
arg_5
=
arg_0
if
not
arg_1
.
startswith
(
'/'
)
:
arg_1
=
'/'
+
arg_1
arg_6
=
[
]
try
:
arg_7
=
arg_5
.
require_group
(
arg_1
)
for
arg_8
in
_hdf5_walk
(
arg_7
,
arg_2
=
arg_2
)
:
arg_6
.
append
(
arg_8
.
name
)
except
:
raise
RuntimeError
(
'Error getting node names from {}/{}.'
.
format
(
arg_5
.
filename
,
arg_1
)
)
finally
:
if
isinstance
(
arg_0
,
str
)
:
arg_5
.
close
(
)
return
arg_6

def Func(arg_0, arg_1='/', arg_2=arg_3.Dataset):
    """Return the node of type node_type names within h5path of h5file.

    Parameters
    ----------
    h5file: h5py.File
        HDF5 file object

    h5path: str
        HDF5 group path to get the group names from

    node_type: h5py object type
        HDF5 object type

    Returns
    -------
    names: list of str
        List of names
    """
    if isinstance(arg_0, str):
        arg_5 = get_h5file(arg_0, mode='r')
    else:
        arg_5 = arg_0

    if not arg_1.startswith('/'):
        arg_1 = '/' + arg_1

    arg_6 = []
    try:
        arg_7 = arg_5.require_group(arg_1)

        for arg_8 in _hdf5_walk(arg_7, arg_2=arg_2):
            arg_6.append(arg_8.name)
    except:
        raise RuntimeError('Error getting node names from {}/{}.'.format(arg_5.filename, arg_1))
    finally:
        if isinstance(arg_0, str):
            arg_5.close()

    return arg_6

Return the node of type node_type names within h5path of h5file .


def Func ( arg_0 ) : arg_1 = 7.28897050 arg_2 = lambda parent , daugther : - parent + daugther + arg_1 return arg_0 . derived ( 'Func' , ( - 1 , 0 ) , arg_2 )

def Func(arg_0):
        """Return 1 proton separation energy"""
        arg_1 = 7.28897050         # proton mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + arg_1
        return arg_0.derived('Func', (-1, 0), arg_2)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] if arg_2 == 0 : return arg_3 arg_4 = arg_0 . client . issue_comment_reactions ( arg_1 ) for arg_5 in arg_4 : for arg_6 in json . loads ( arg_5 ) : arg_6 [ 'user_data' ] = arg_0 . __get_user ( arg_6 [ 'user' ] [ 'login' ] ) arg_3 . append ( arg_6 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Get reactions on issue comments"""

        arg_3 = []

        if arg_2 == 0:
            return arg_3

        arg_4 = arg_0.client.issue_comment_reactions(arg_1)

        for arg_5 in arg_4:

            for arg_6 in json.loads(arg_5):
                arg_6['user_data'] = arg_0.__get_user(arg_6['user']['login'])
                arg_3.append(arg_6)

        return arg_3


def
Func
(
arg_0
)
:
arg_1
=
get_terminal_size
(
)
.
columns
arg_2
=
arg_1
terminal_width
(
arg_0
)
if
is_win32
:
arg_2
-=
1
sys
.
stderr
.
write
(
"\r{0}"
.
format
(
arg_0
)
)
sys
.
stderr
.
write
(
" "
*
max
(
0
,
arg_2
)
)
sys
.
stderr
.
flush
(
)

def Func(arg_0):
    """Clears out the previous line and prints a new one."""
    arg_1 = get_terminal_size().columns
    arg_2 = arg_1 - terminal_width(arg_0)

    # On windows we need one less space or we overflow the line for some reason.
    if is_win32:
        arg_2 -= 1

    sys.stderr.write("\r{0}".format(arg_0))
    sys.stderr.write(" " * max(0, arg_2))
    sys.stderr.flush()

Clears out the previous line and prints a new one .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
application_exists
(
)
:
arg_0
.
create_application
(
get
(
arg_1
,
'app.description'
)
)
else
:
out
(
"Application "
+
get
(
arg_1
,
'app.app_name'
)
+
" exists"
)
arg_3
=
[
]
arg_4
=
[
]
for
arg_5
,
arg_6
in
list
(
get
(
arg_1
,
'app.environments'
)
.
items
(
)
)
:
arg_3
.
append
(
arg_5
)
arg_6
=
parse_env_config
(
arg_1
,
arg_5
)
if
not
arg_0
.
environment_exists
(
arg_5
)
:
arg_7
=
parse_option_settings
(
arg_6
.
get
(
'option_settings'
,
{
}
)
)
arg_0
.
create_environment
(
arg_5
,
solution_stack_name
=
arg_6
.
get
(
'solution_stack_name'
)
,
cname_prefix
=
arg_6
.
get
(
'cname_prefix'
,
)
,
description
=
arg_6
.
get
(
'description'
,
)
,
arg_7
=
arg_7
,
tier_name
=
arg_6
.
get
(
'tier_name'
)
,
tier_type
=
arg_6
.
get
(
'tier_type'
)
,
tier_version
=
arg_6
.
get
(
'tier_version'
)
,
version_label
=
arg_2
.
version_label
)
arg_4
.
append
(
arg_5
)
else
:
out
(
"Environment "
+
arg_5
)
arg_8
=
[
]
if
arg_2
.
delete
:
arg_9
=
arg_0
.
get_environments
(
)
for
arg_10
in
arg_9
:
if
arg_10
[
'EnvironmentName'
]
not
in
arg_3
:
if
arg_10
[
'Status'
]
!=
'Ready'
:
out
(
"Unable to delete "
+
arg_10
[
'EnvironmentName'
]
+
" because it's not in status Ready ("
+
arg_10
[
'Status'
]
+
")"
)
else
:
out
(
"Deleting environment: "
+
arg_10
[
'EnvironmentName'
]
)
arg_0
.
delete_environment
(
arg_10
[
'EnvironmentName'
]
)
arg_8
.
append
(
arg_10
[
'EnvironmentName'
]
)
if
not
arg_2
.
dont_wait
and
len
(
arg_4
)
>
0
:
arg_0
.
wait_for_environments
(
arg_4
,
status
=
'Ready'
,
include_deleted
=
False
)
if
not
arg_2
.
dont_wait
and
len
(
arg_8
)
>
0
:
arg_0
.
wait_for_environments
(
arg_8
,
status
=
'Terminated'
,
include_deleted
=
False
)
out
(
"Application initialized"
)
return
0

def Func(arg_0, arg_1, arg_2):
    """
    The init command
    """

    # check to see if the application exists
    if not arg_0.application_exists():
        arg_0.create_application(get(arg_1, 'app.description'))
    else:
        out("Application "+get(arg_1, 'app.app_name')+" exists")

    # create environments
    arg_3 = []
    arg_4 = []
    for arg_5, arg_6 in list(get(arg_1, 'app.environments').items()):
        arg_3.append(arg_5)
        arg_6 = parse_env_config(arg_1, arg_5)
        if not arg_0.environment_exists(arg_5):
            arg_7 = parse_option_settings(arg_6.get('option_settings', {}))
            arg_0.create_environment(arg_5,
                solution_stack_name=arg_6.get('solution_stack_name'),
                cname_prefix=arg_6.get('cname_prefix', None),
                description=arg_6.get('description', None),
                arg_7=arg_7,
                tier_name=arg_6.get('tier_name'),
                tier_type=arg_6.get('tier_type'),
                tier_version=arg_6.get('tier_version'),
                version_label=arg_2.version_label)
            arg_4.append(arg_5)
        else:
            out("Environment "+arg_5)

    # get the environments
    arg_8 = []
    if arg_2.delete:
        arg_9 = arg_0.get_environments()
        for arg_10 in arg_9:
            if arg_10['EnvironmentName'] not in arg_3:
                if arg_10['Status'] != 'Ready':
                    out("Unable to delete "+arg_10['EnvironmentName']+" because it's not in status Ready ("+arg_10['Status']+")")
                else:
                    out("Deleting environment: "+arg_10['EnvironmentName'])
                    arg_0.delete_environment(arg_10['EnvironmentName'])
                    arg_8.append(arg_10['EnvironmentName'])

    # wait
    if not arg_2.dont_wait and len(arg_4)>0:
        arg_0.wait_for_environments(arg_4, status='Ready', include_deleted=False)
    if not arg_2.dont_wait and len(arg_8)>0:
        arg_0.wait_for_environments(arg_8, status='Terminated', include_deleted=False)

    out("Application initialized")
    return 0


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
for
arg_3
in
arg_0
.
panels_menu
:
if
arg_3
[
'source'
]
not
in
arg_0
.
data_sources
:
continue
arg_4
=
{
'name'
:
arg_3
[
'name'
]
,
'title'
:
arg_3
[
'name'
]
,
'description'
:
""
,
'type'
:
"menu"
,
'dashboards'
:
[
]
}
for
arg_5
in
arg_3
[
'menu'
]
:
try
:
arg_6
=
get_dashboard_name
(
arg_5
[
'panel'
]
)
except
FileNotFoundError
:
logging
.
error
(
"Can't open dashboard file %s"
,
arg_5
[
'panel'
]
)
continue
arg_7
=
{
"name"
:
arg_5
[
'name'
]
,
"title"
:
arg_5
[
'name'
]
,
"description"
:
""
,
"type"
:
"entry"
,
"panel_id"
:
arg_6
}
arg_4
[
'dashboards'
]
.
append
(
arg_7
)
arg_2
.
append
(
arg_4
)
return
arg_2

def Func(arg_0, arg_1):
        """ Get the menu entries from the panel definition """
        arg_2 = []
        for arg_3 in arg_0.panels_menu:
            if arg_3['source'] not in arg_0.data_sources:
                continue
            arg_4 = {
                'name': arg_3['name'],
                'title': arg_3['name'],
                'description': "",
                'type': "menu",
                'dashboards': []
            }
            for arg_5 in arg_3['menu']:
                try:
                    arg_6 = get_dashboard_name(arg_5['panel'])
                except FileNotFoundError:
                    logging.error("Can't open dashboard file %s", arg_5['panel'])
                    continue
                # The name for the entry is in self.panels_menu
                arg_7 = {
                    "name": arg_5['name'],
                    "title": arg_5['name'],
                    "description": "",
                    "type": "entry",
                    "panel_id": arg_6
                }
                arg_4['dashboards'].append(arg_7)
            arg_2.append(arg_4)

        return arg_2


Echo a command before running it.  Defaults to repo as cwd

def
Func
(
arg_0
,
**
arg_1
)
:
log
.
info
(
'> '
+
list2cmdline
(
arg_0
)
)
arg_1
.
setdefault
(
'cwd'
,
HERE
)
arg_1
.
setdefault
(
'shell'
,
os
.
name
==
'nt'
)
if
not
isinstance
(
arg_0
,
(
list
,
tuple
)
)
and
os
.
name
!=
'nt'
:
arg_0
=
shlex
.
split
(
arg_0
)
arg_0
[
0
]
=
which
(
arg_0
[
0
]
)
return
subprocess
.
check_call
(
arg_0
,
**
arg_1
)

def Func(arg_0, **arg_1):
    """Echo a command before Funcning it.  Defaults to repo as cwd"""
    log.info('> ' + list2cmdline(arg_0))
    arg_1.setdefault('cwd', HERE)
    arg_1.setdefault('shell', os.name == 'nt')
    if not isinstance(arg_0, (list, tuple)) and os.name != 'nt':
        arg_0 = shlex.split(arg_0)
    arg_0[0] = which(arg_0[0])
    return subprocess.check_call(arg_0, **arg_1)

Echo a command before running it . Defaults to repo as cwd


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = { } for arg_4 , arg_5 in arg_2 . items ( ) : arg_3 [ arg_0 . _underscore_to_camelcase ( arg_4 ) ] = arg_5 arg_7 = arg_0 . _perform_request ( url = '/images/' + arg_1 , method = 'PATCH' , arg_3 = json . dumps ( arg_3 ) ) return arg_7

def Func(arg_0, arg_1, **arg_2):
        """
        Replace all properties of an image.

        """
        arg_3 = {}

        for arg_4, arg_5 in arg_2.items():
            arg_3[arg_0._underscore_to_camelcase(arg_4)] = arg_5

        arg_7 = arg_0._perform_request(url='/images/' + arg_1,
                                         method='PATCH',
                                         arg_3=json.dumps(arg_3))
        return arg_7


def Func ( arg_0 , arg_1 ) : arg_2 = np . ones ( len ( arg_1 ) / 2 ) arg_0 = np . concatenate ( ( arg_2 * arg_0 [ 0 ] , arg_0 , arg_2 * arg_0 [ - 1 ] ) ) arg_0 = np . Func ( arg_0 , arg_1 , mode = 'same' ) arg_0 = arg_0 [ len ( arg_2 ) : - len ( arg_2 ) ] return arg_0

def Func(arg_0,arg_1):
    """
    This applies a kernel to a signal through convolution and returns the result.

    Some magic is done at the edges so the result doesn't apprach zero:
        1. extend the signal's edges with len(kernel)/2 duplicated values
        2. perform the convolution ('same' mode)
        3. slice-off the ends we added
        4. return the same number of points as the original
    """
    arg_2=np.ones(len(arg_1)/2)
    arg_0=np.concatenate((arg_2*arg_0[0],arg_0,arg_2*arg_0[-1]))
    arg_0=np.Func(arg_0,arg_1,mode='same')
    arg_0=arg_0[len(arg_2):-len(arg_2)]
    return arg_0

This applies a kernel to a signal through convolution and returns the result .


def
Func
(
arg_0
,
arg_1
=
"eng"
)
:
arg_2
=
" "
.
join
(
arg_0
.
strip
(
"%"
)
.
split
(
"|"
)
)
return
arg_2
.
capitalize
(
)

def Func(arg_0, arg_1="eng"):
    """ Take a string of form %citation_type|passage% and format it for human

    :param string: String of formation %citation_type|passage%
    :param lang: Language to translate to
    :return: Human Readable string

    .. note :: To Do : Use i18n tools and provide real i18n
    """
    arg_2 = " ".join(arg_0.strip("%").split("|"))
    return arg_2.capitalize()


def Func ( arg_0 ) : if arg_0 is None : return '' else : arg_1 = str ( arg_0 [ 0 ] ) arg_2 = str ( arg_0 [ 1 ] ) return ( '_inv_psf_' + arg_1 + 'x' + arg_2 )

def Func(arg_0):
    """Generate an inversion psf shape tag, to customize phase names based on size of the inversion PSF that the \
    original PSF is trimmed to for faster run times.

    This changes the phase name 'phase_name' as follows:

    inversion_psf_shape = 1 -> phase_name
    inversion_psf_shape = 2 -> phase_name_inversion_psf_shape_2
    inversion_psf_shape = 2 -> phase_name_inversion_psf_shape_2
    """
    if arg_0 is None:
        return ''
    else:
        arg_1 = str(arg_0[0])
        arg_2 = str(arg_0[1])
        return ('_inv_psf_' + arg_1 + 'x' + arg_2)

Generate an inversion psf shape tag to customize phase names based on size of the inversion PSF that the \ original PSF is trimmed to for faster run times .


def Func ( arg_0 ) : if arg_0 . _model : arg_1 , arg_2 = parse_gpr ( arg_0 . gene_reaction_rule ) return eval_gpr ( arg_1 , { arg_3 . id for arg_3 in arg_0 . genes if not arg_3 . Func } ) return True

def Func(arg_0):
        """All required enzymes for reaction are Func.

        Returns
        -------
        bool
            True if the gene-protein-reaction (GPR) rule is fulfilled for
            this reaction, or if reaction is not associated to a model,
            otherwise False.
        """
        if arg_0._model:
            arg_1, arg_2 = parse_gpr(arg_0.gene_reaction_rule)
            return eval_gpr(arg_1, {arg_3.id for arg_3 in arg_0.genes if
                                   not arg_3.Func})
        return True

All required enzymes for reaction are functional.

        Returns
        -------
        bool
            True if the gene-protein-reaction (GPR) rule is fulfilled for
            this reaction, or if reaction is not associated to a model,
            otherwise False.

All required enzymes for reaction are functional .


return encode(self.secret, payload, self.alg, self.header)

def Func ( arg_0 ) -> str : arg_1 = { } arg_1 . update ( arg_0 . registered_claims ) arg_1 . update ( arg_0 . payload ) return Func ( arg_0 . secret , arg_1 , arg_0 . alg , arg_0 . header )

def Func(arg_0) -> str:
        """
        Create a token based on the data held in the class.

        :return: A new token
        :rtype: str
        """
        arg_1 = {}
        arg_1.update(arg_0.registered_claims)
        arg_1.update(arg_0.payload)
        return Func(arg_0.secret, arg_1, arg_0.alg, arg_0.header)

Create a token based on the data held in the class .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . n += 1 if not arg_0 . Ts : arg_0 . Ts = [ arg_1 , arg_2 ] arg_0 . coeff_sets = [ arg_3 ] else : for arg_6 , arg_7 in enumerate ( arg_0 . Ts ) : if arg_1 < arg_7 : arg_0 . Ts . insert ( arg_6 , arg_1 ) arg_0 . coeff_sets . insert ( arg_6 , arg_3 ) return arg_0 . Ts . append ( arg_2 ) arg_0 . coeff_sets . append ( arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        '''Called internally during the parsing of the Zabransky database, to
        add coefficients as they are read one per line'''
        arg_0.n += 1
        if not arg_0.Ts:
            arg_0.Ts = [arg_1, arg_2]
            arg_0.coeff_sets = [arg_3]
        else:
            for arg_6, arg_7 in enumerate(arg_0.Ts):
                if arg_1 < arg_7:
                    # Under an existing coefficient set - assume Tmax will come from another set
                    arg_0.Ts.insert(arg_6, arg_1)
                    arg_0.coeff_sets.insert(arg_6, arg_3)
                    return
            # Must be appended to end instead
            arg_0.Ts.append(arg_2)
            arg_0.coeff_sets.append(arg_3)

Called internally during the parsing of the Zabransky database to add coefficients as they are read one per line


(self, network=None, model_name='model', **kwargs)

def Func(arg_0, arg_1=None, arg_2='model', **arg_3):
        """Save model architecture and parameters into database, timestamp will be added automatically.

        Parameters
        ----------
        network : TensorLayer layer
            TensorLayer layer instance.
        model_name : str
            The name/key of model.
        kwargs : other events
            Other events, such as name, accuracy, loss, step number and etc (optinal).

        Examples
        ---------
        Save model architecture and parameters into database.
        >>> db.Func(net, accuracy=0.8, loss=2.3, name='second_model')

        Load one model with parameters from database (run this in other script)
        >>> net = db.find_top_model(sess=sess, accuracy=0.8, loss=2.3)

        Find and load the latest model.
        >>> net = db.find_top_model(sess=sess, sort=[("time", pymongo.DESCENDING)])
        >>> net = db.find_top_model(sess=sess, sort=[("time", -1)])

        Find and load the oldest model.
        >>> net = db.find_top_model(sess=sess, sort=[("time", pymongo.ASCENDING)])
        >>> net = db.find_top_model(sess=sess, sort=[("time", 1)])

        Get model information
        >>> net._accuracy
        ... 0.8

        Returns
        ---------
        boolean : True for success, False for fail.
        """
        arg_3.update({'model_name': arg_2})
        arg_0._fill_project_info(arg_3)  # put project_name into kwargs

        arg_4 = arg_1.get_all_params()

        arg_5 = time.time()

        arg_3.update({'architecture': arg_1.all_graphs, 'time': datetime.utcnow()})

        try:
            arg_6 = arg_0.model_fs.put(arg_0._serialization(arg_4))
            arg_3.update({'params_id': arg_6, 'time': datetime.utcnow()})
            arg_0.db.Model.insert_one(arg_3)
            print("[Database] Save model: SUCCESS, took: {}s".format(round(time.time() - arg_5, 2)))
            return True
        except Exception as e:
            arg_7, arg_8, arg_9 = sys.exc_info()
            arg_10 = os.path.split(arg_9.tb_frame.f_code.co_filename)[1]
            logging.info("{}  {}  {}  {}  {}".format(arg_7, arg_8, arg_10, arg_9.tb_lineno, e))
            print("[Database] Save model: FAIL")
            return False

Save model architecture and parameters into database, timestamp will be added automatically.

        Parameters
        ----------
        network : TensorLayer layer
            TensorLayer layer instance.
        model_name : str
            The name/key of model.
        kwargs : other events
            Other events, such as name, accuracy, loss, step number and etc (optinal).

        Examples
        ---------
        Save model architecture and parameters into database.
        >>> db.save_model(net, accuracy=0.8, loss=2.3, name='second_model')

        Load one model with parameters from database (run this in other script)
        >>> net = db.find_top_model(sess=sess, accuracy=0.8, loss=2.3)

        Find and load the latest model.
        >>> net = db.find_top_model(sess=sess, sort=[("time", pymongo.DESCENDING)])
        >>> net = db.find_top_model(sess=sess, sort=[("time", -1)])

        Find and load the oldest model.
        >>> net = db.find_top_model(sess=sess, sort=[("time", pymongo.ASCENDING)])
        >>> net = db.find_top_model(sess=sess, sort=[("time", 1)])

        Get model information
        >>> net._accuracy
        ... 0.8

        Returns
        ---------
        boolean : True for success, False for fail.

Save model architecture and parameters into database timestamp will be added automatically .


A context manager that appends ``note`` to every diagnostic processed by
        this engine.

def Func ( arg_0 , * arg_1 ) : arg_0 . _appended_notes += arg_1 yield del arg_0 . _appended_notes [ - len ( arg_1 ) : ]

def Func(arg_0, *arg_1):
        """
        A Func manager that appends ``note`` to every diagnostic processed by
        this engine.
        """
        arg_0._appended_notes += arg_1
        yield
        del arg_0._appended_notes[-len(arg_1):]

A context manager that appends note to every diagnostic processed by this engine .


def Func ( arg_0 ) : arg_0 . components = { } arg_0 . info = { } arg_0 . params = { } arg_0 . switches = { } arg_0 . keys = { } arg_0 . index = { } arg_0 . sets = { } arg_0 . maxset = - 1 arg_0 . n = 0 for arg_10 in arg_0 . analytes : arg_0 . switches [ arg_10 ] = { } return

def Func(arg_0):
        """
        Clear all filters.
        """
        arg_0.components = {}
        arg_0.info = {}
        arg_0.params = {}
        arg_0.switches = {}
        arg_0.keys = {}
        arg_0.index = {}
        arg_0.sets = {}
        arg_0.maxset = -1
        arg_0.n = 0
        for arg_10 in arg_0.analytes:
            arg_0.switches[arg_10] = {}
        return


def Func(arg_0):
        '''Release all resources associated with the sound.'''
        if arg_0._handle != -1:
            lib.UnloadSound(arg_0._handle)
            arg_0._handle = -1

Release all resources associated with the sound .


def Func ( arg_0 , arg_1 ) : arg_2 = tf . compat . v1 . get_variable ( "topics_words_logits" , shape = [ arg_0 , arg_1 ] , initializer = tf . compat . v1 . glorot_normal_initializer ( ) ) arg_3 = tf . nn . softmax ( arg_2 , axis = - 1 ) def decoder ( arg_4 ) : arg_5 = tf . matmul ( arg_4 , arg_3 ) return tfd . OneHotCategorical ( probs = arg_5 , name = "bag_of_words" ) return decoder , arg_3

def Func(arg_0, arg_1):
  """Create the decoder function.

  Args:
    num_topics: The number of topics.
    num_words: The number of words.

  Returns:
    decoder: A `callable` mapping a `Tensor` of encodings to a
      `tfd.Distribution` instance over words.
  """
  arg_2 = tf.compat.v1.get_variable(
      "topics_words_logits",
      shape=[arg_0, arg_1],
      initializer=tf.compat.v1.glorot_normal_initializer())
  arg_3 = tf.nn.softmax(arg_2, axis=-1)

  def decoder(arg_4):
    arg_5 = tf.matmul(arg_4, arg_3)
    # The observations are bag of words and therefore not one-hot. However,
    # log_prob of OneHotCategorical computes the probability correctly in
    # this case.
    return tfd.OneHotCategorical(probs=arg_5,
                                 name="bag_of_words")

  return decoder, arg_3


(self, template_id, version=None, timeout=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """ API call to get a specific template """
        if (arg_2):
            return arg_0._api_request(
                arg_0.TEMPLATES_VERSION_ENDPOINT % (arg_1, arg_2),
                arg_0.HTTP_GET,
                arg_3=arg_3
            )
        else:
            return arg_0._api_request(
                arg_0.TEMPLATES_SPECIFIC_ENDPOINT % arg_1,
                arg_0.HTTP_GET,
                arg_3=arg_3
            )


(filename, number=float, f_replace=F_REPLACE,
                    set_missing_bounds=False, **kwargs)

def Func(arg_0, arg_1=arg_2, arg_3=arg_4,
                    arg_5=False, **arg_6):
    """Reads SBML model from given filename.

    If the given filename ends with the suffix ''.gz'' (for example,
    ''myfile.xml.gz'),' the file is assumed to be compressed in gzip
    format and will be automatically decompressed upon reading. Similarly,
    if the given filename ends with ''.zip'' or ''.bz2',' the file is
    assumed to be compressed in zip or bzip2 format (respectively).  Files
    whose names lack these suffixes will be read uncompressed.  Note that
    if the file is in zip format but the archive contains more than one
    file, only the first file in the archive will be read and the rest
    ignored.

    To read a gzip/zip file, libSBML needs to be configured and linked
    with the zlib library at compile time.  It also needs to be linked
    with the bzip2 library to read files in bzip2 format.  (Both of these
    are the default configurations for libSBML.)

    This function supports SBML with FBC-v1 and FBC-v2. FBC-v1 models
    are converted to FBC-v2 models before reading.

    The parser tries to fall back to information in notes dictionaries
    if information is not available in the FBC packages, e.g.,
    CHARGE, FORMULA on species, or GENE_ASSOCIATION, SUBSYSTEM on reactions.

    Parameters
    ----------
    filename : path to SBML file, or SBML string, or SBML file handle
        SBML which is read into cobra model
    number: data type of stoichiometry: {float, int}
        In which data type should the stoichiometry be parsed.
    f_replace : dict of replacement functions for id replacement
        Dictionary of replacement functions for gene, specie, and reaction.
        By default the following id changes are performed on import:
        clip G_ from genes, clip M_ from species, clip R_ from reactions
        If no replacements should be performed, set f_replace={}, None
    set_missing_bounds : boolean flag to set missing bounds
        Missing bounds are set to default bounds in configuration.

    Returns
    -------
    cobra.core.Model

    Notes
    -----
    Provided file handles cannot be opened in binary mode, i.e., use
        with open(path, "r" as f):
            Func(f)
    File handles to compressed files are not supported yet.
    """
    try:
        arg_7 = _get_doc_from_filename(arg_0)
        return _sbml_to_model(arg_7,
                              arg_1=arg_1,
                              arg_3=arg_3,
                              arg_5=arg_5,
                              **arg_6)
    except IOError as e:
        raise e

    except Exception:
        LOGGER.error(traceback.print_exc())
        raise CobraSBMLError(
            "Something went wrong reading the SBML model. Most likely the SBML"
            " model is not valid. Please check that your model is valid using "
            "the `cobra.io.sbml.validate_sbml_model` function or via the "
            "online validator at http://sbml.org/validator .\n"
            "\t`(model, errors) = validate_sbml_model(filename)`"
            "\nIf the model is valid and cannot be read please open an issue "
            "at https://github.com/opencobra/cobrapy/issues .")

Reads SBML model from given filename.

    If the given filename ends with the suffix ''.gz'' (for example,
    ''myfile.xml.gz'),' the file is assumed to be compressed in gzip
    format and will be automatically decompressed upon reading. Similarly,
    if the given filename ends with ''.zip'' or ''.bz2',' the file is
    assumed to be compressed in zip or bzip2 format (respectively).  Files
    whose names lack these suffixes will be read uncompressed.  Note that
    if the file is in zip format but the archive contains more than one
    file, only the first file in the archive will be read and the rest
    ignored.

    To read a gzip/zip file, libSBML needs to be configured and linked
    with the zlib library at compile time.  It also needs to be linked
    with the bzip2 library to read files in bzip2 format.  (Both of these
    are the default configurations for libSBML.)

    This function supports SBML with FBC-v1 and FBC-v2. FBC-v1 models
    are converted to FBC-v2 models before reading.

    The parser tries to fall back to information in notes dictionaries
    if information is not available in the FBC packages, e.g.,
    CHARGE, FORMULA on species, or GENE_ASSOCIATION, SUBSYSTEM on reactions.

    Parameters
    ----------
    filename : path to SBML file, or SBML string, or SBML file handle
        SBML which is read into cobra model
    number: data type of stoichiometry: {float, int}
        In which data type should the stoichiometry be parsed.
    f_replace : dict of replacement functions for id replacement
        Dictionary of replacement functions for gene, specie, and reaction.
        By default the following id changes are performed on import:
        clip G_ from genes, clip M_ from species, clip R_ from reactions
        If no replacements should be performed, set f_replace={}, None
    set_missing_bounds : boolean flag to set missing bounds
        Missing bounds are set to default bounds in configuration.

    Returns
    -------
    cobra.core.Model

    Notes
    -----
    Provided file handles cannot be opened in binary mode, i.e., use
        with open(path, "r" as f):
            read_sbml_model(f)
    File handles to compressed files are not supported yet.


async
def
Func
(
arg_0
)
:
with
async_timeout
.
timeout
(
arg_0
.
timeout
)
:
arg_0
.
response
=
await
arg_0
.
_Func
(
)
if
arg_0
.
response
.
status
in
range
(
200
,
300
)
:
arg_0
.
_error_timeout
=
0
arg_0
.
state
=
NORMAL
elif
arg_0
.
response
.
status
==
500
:
arg_0
.
state
=
DISCONNECTION
elif
arg_0
.
response
.
status
in
range
(
501
,
600
)
:
arg_0
.
state
=
RECONNECTION
elif
arg_0
.
response
.
status
in
(
420
,
429
)
:
arg_0
.
state
=
ENHANCE_YOUR_CALM
else
:
logger
.
debug
(
"raising error during stream Funcion"
)
raise
await
exceptions
.
throw
(
arg_0
.
response
,
loads
=
arg_0
.
client
.
_loads
,
url
=
arg_0
.
kwargs
[
'url'
]
)
logger
.
debug
(
"stream state: %d"
%
arg_0
.
state
)

async def Func(arg_0):
        """
            Create the Funcion

        Returns
        -------
        self

        Raises
        ------
        exception.PeonyException
            On a response status in 4xx that are not status 420 or 429
            Also on statuses in 1xx or 3xx since this should not be the status
            received here
        """
        with async_timeout.timeout(arg_0.timeout):
            arg_0.response = await arg_0._Func()

        if arg_0.response.status in range(200, 300):
            arg_0._error_timeout = 0
            arg_0.state = NORMAL
        elif arg_0.response.status == 500:
            arg_0.state = DISCONNECTION
        elif arg_0.response.status in range(501, 600):
            arg_0.state = RECONNECTION
        elif arg_0.response.status in (420, 429):
            arg_0.state = ENHANCE_YOUR_CALM
        else:
            logger.debug("raising error during stream Funcion")
            raise await exceptions.throw(arg_0.response,
                                         loads=arg_0.client._loads,
                                         url=arg_0.kwargs['url'])

        logger.debug("stream state: %d" % arg_0.state)

Create the connection

        Returns
        -------
        self

        Raises
        ------
        exception.PeonyException
            On a response status in 4xx that are not status 420 or 429
            Also on statuses in 1xx or 3xx since this should not be the status
            received here


return math.sqrt((error.df ** 2).mean())

def Func ( arg_0 , arg_1 = 'AME2003' ) : arg_2 = arg_0 . error ( arg_1 = arg_1 ) return math . sqrt ( ( arg_2 . df ** 2 ) . mean ( ) )


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : super ( ) . Func ( arg_1 , arg_2 , arg_3 , 0 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        A generic way to insert a set of tuples into a table.

        :param table: Name of the target table
        :type table: str
        :param rows: The rows to insert into the table
        :type rows: iterable of tuples
        :param target_fields: The names of the columns to fill in the table
        :type target_fields: iterable of strings
        """
        super().Func(arg_1, arg_2, arg_3, 0)

A generic way to insert a set of tuples into a table .


def Func(arg_0, arg_1, arg_2):
    """Instantiates a _HyperSearchJob instance from info saved in file

    Parameters:
    ----------------------------------------------------------------------
    permWorkDir: Directory path for saved jobID file
    outputLabel: Label string for incorporating into file name for saved jobID
    retval:      _HyperSearchJob instance; raises exception if not found
    """
    arg_3 = arg_0.__loadHyperSearchJobID(arg_1=arg_1,
                                       arg_2=arg_2)

    arg_4 = _HyperSearchJob(nupicJobID=arg_3)
    return arg_4


def Func ( arg_0 = None ) : arg_1 = [ ] if not arg_0 : arg_0 = sys . argv [ 1 : ] for arg_2 in arg_0 : if string . find ( arg_2 , '*' ) >= 0 : arg_3 = glob . glob ( arg_2 ) arg_3 . sort ( ) else : arg_3 = [ arg_2 ] arg_1 . extend ( arg_3 ) if len ( arg_1 ) == 0 : arg_1 = None else : arg_1 = filter ( file_exists , arg_1 ) return arg_1

def  Func( arg_0 = None ):
    """builds a list of input files from command-line arguments"""
    arg_1 = []
    # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' )

    if not arg_0:
        arg_0 = sys.argv[1 :]

    for arg_2 in arg_0:
        if string.find( arg_2, '*' ) >= 0:
            arg_3 = glob.glob( arg_2 )
            arg_3.sort()  # sort files -- this is important because
                            # of the order of files
        else:
            arg_3 = [arg_2]

        arg_1.extend( arg_3 )

    if len( arg_1 ) == 0:
        arg_1 = None
    else:
        # now filter the file list to remove non-existing ones
        arg_1 = filter( file_exists, arg_1 )

    return arg_1

builds a list of input files from command - line arguments


def Func(arg_0, arg_1, arg_2):
    """Create response class for Flask."""
    arg_3 = Response(arg_1 or '')
    for arg_4, arg_5 in arg_0.items():
        arg_3.headers[arg_6(arg_4)] = arg_5

    arg_3.status_code = arg_2
    return arg_3


(directory, split_name, num_words, shuffle_and_repeat)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = np . load ( download ( arg_0 , FILE_TEMPLATE . format ( split = arg_1 ) ) ) arg_4 = arg_4 [ : - 1 ] arg_5 = arg_4 . shape [ 0 ] arg_6 = np . array ( [ ( row_idx , column_idx ) for row_idx , row in enumerate ( arg_4 ) for column_idx in row ] ) arg_7 = scipy . sparse . coo_matrix ( ( np . ones ( arg_6 . shape [ 0 ] ) , ( arg_6 [ : , 0 ] , arg_6 [ : , 1 ] ) ) , shape = ( arg_5 , arg_2 ) , dtype = np . float32 ) arg_7 = arg_7 . tocsr ( ) arg_8 = tf . data . Dataset . range ( arg_5 ) if arg_3 : arg_8 = arg_8 . shuffle ( arg_5 ) . repeat ( ) def get_row_py_func ( arg_9 ) : def get_row_python ( arg_10 ) : return np . squeeze ( np . array ( arg_7 [ arg_10 ] . todense ( ) ) , axis = 0 ) arg_11 = tf . compat . v1 . py_func ( get_row_python , [ arg_9 ] , tf . float32 , stateful = False ) arg_11 . set_shape ( ( arg_2 , ) ) return arg_11 arg_8 = arg_8 . map ( get_row_py_func ) return arg_8

def Func(arg_0, arg_1, arg_2, arg_3):
  """20 newsgroups as a tf.data.Dataset."""
  arg_4 = np.load(download(arg_0, FILE_TEMPLATE.format(split=arg_1)))
  # The last row is empty in both train and test.
  arg_4 = arg_4[:-1]

  # Each row is a list of word ids in the document. We first convert this to
  # sparse COO matrix (which automatically sums the repeating words). Then,
  # we convert this COO matrix to CSR format which allows for fast querying of
  # documents.
  arg_5 = arg_4.shape[0]
  arg_6 = np.array([(row_idx, column_idx)
                      for row_idx, row in enumerate(arg_4)
                      for column_idx in row])
  arg_7 = scipy.sparse.coo_matrix(
      (np.ones(arg_6.shape[0]), (arg_6[:, 0], arg_6[:, 1])),
      shape=(arg_5, arg_2),
      dtype=np.float32)
  arg_7 = arg_7.tocsr()

  arg_8 = tf.data.Dataset.range(arg_5)

  # For training, we shuffle each epoch and repeat the epochs.
  if arg_3:
    arg_8 = arg_8.shuffle(arg_5).repeat()

  # Returns a single document as a dense TensorFlow tensor. The dataset is
  # stored as a sparse matrix outside of the graph.
  def get_row_py_func(arg_9):
    def get_row_python(arg_10):
      return np.squeeze(np.array(arg_7[arg_10].todense()), axis=0)

    arg_11 = tf.compat.v1.py_func(
        get_row_python, [arg_9], tf.float32, stateful=False)
    arg_11.set_shape((arg_2,))
    return arg_11

  arg_8 = arg_8.map(get_row_py_func)
  return arg_8

20 newsgroups as a tf . data . Dataset .


def
Func
(
arg_0
)
:
arg_1
=
re
.
compile
(
r"^amqp://([a-zA-Z0-9.]+)(:([\d]+))?$"
)
arg_2
=
arg_1
.
match
(
arg_0
)
if
not
arg_2
:
raise
Exception
(
"Bad address syntax: %s"
%
arg_0
)
arg_3
=
arg_2
.
groups
(
)
arg_4
=
arg_3
[
0
]
arg_5
=
int
(
arg_3
[
2
]
)
if
arg_3
[
2
]
else
return
arg_4
,
arg_5

def Func(arg_0):
    """Parse the hostname and port out of the server_address."""
    arg_1 = re.compile(r"^amqp://([a-zA-Z0-9.]+)(:([\d]+))?$")
    arg_2 = arg_1.match(arg_0)
    if not arg_2:
        raise Exception("Bad address syntax: %s" % arg_0)
    arg_3 = arg_2.groups()
    arg_4 = arg_3[0]
    arg_5 = int(arg_3[2]) if arg_3[2] else None
    return arg_4, arg_5

Parse the hostname and port out of the server_address .


(self, window_name, object_name, iterations)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
not
arg_0
.
verifyscrollbarvertical
(
arg_1
,
arg_2
)
:
raise
LdtpServerException
(
'Object not vertical scrollbar'
)
arg_4
=
arg_0
.
_get_object_handle
(
arg_1
,
arg_2
)
arg_5
=
0
arg_6
=
1.0
/
8
arg_7
=
False
while
arg_5
<
arg_3
:
if
arg_4
.
AXValue
<=
0
:
raise
LdtpServerException
(
'Minimum limit reached'
)
arg_4
.
AXValue
-=
arg_6
time
.
sleep
(
1.0
/
100
)
arg_7
=
True
arg_5
+=
1
if
arg_7
:
return
1
else
:
raise
LdtpServerException
(
'Unable to decrease scrollbar'
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Press scrollbar up with number of iterations

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string
        @param interations: iterations to perform on slider increase
        @type iterations: integer

        @return: 1 on success.
        @rtype: integer
        """
        if not arg_0.verifyscrollbarvertical(arg_1, arg_2):
            raise LdtpServerException('Object not vertical scrollbar')
        arg_4 = arg_0._get_object_handle(arg_1, arg_2)
        arg_5 = 0
        arg_6 = 1.0 / 8
        arg_7 = False
        while arg_5 < arg_3:
            if arg_4.AXValue <= 0:
                raise LdtpServerException('Minimum limit reached')
            arg_4.AXValue -= arg_6
            time.sleep(1.0 / 100)
            arg_7 = True
            arg_5 += 1
        if arg_7:
            return 1
        else:
            raise LdtpServerException('Unable to decrease scrollbar')


return FunctionType(code, globals_, closure=closure)

def Func(arg_0, arg_1=None, **arg_2):
    """Replace local variables with free variables

    Warnings:
        This function does not work.
    """

    if arg_1 is None:
        arg_1 = arg_0.__globals__

    arg_3 = tuple(arg_2.keys())
    arg_4 = arg_0.__code__.co_names
    arg_5 = tuple(name for name in arg_4 if name not in arg_3)

    arg_6 = _alter_code(arg_0.__code__,
                       co_freevars=arg_3,
                       co_names=arg_5,
                       co_flags=arg_0.__code__.co_flags | inspect.CO_NESTED)
    arg_7 = _create_closure(*arg_2.values())

    return FunctionType(arg_6, arg_1, arg_7=arg_7)


def Func(arg_0, arg_1, arg_2):
        """Transport the file from the input source to the executor.

        This function returns a DataFuture.

        Args:
            - self
            - file (File) : file to stage in
            - executor (str) : an executor the file is going to be staged in to.
                                If the executor argument is not specified for a file
                                with 'globus' scheme, the file will be staged in to
                                the first executor with the "globus" key in a config.
        """

        if arg_1.scheme == 'ftp':
            arg_3 = arg_0.dfk.executors[arg_2].working_dir
            arg_4 = arg_0._ftp_Func_app(arg_2=arg_2)
            arg_5 = arg_4(arg_3, outputs=[arg_1])
            return arg_5._outputs[0]
        elif arg_1.scheme == 'http' or arg_1.scheme == 'https':
            arg_3 = arg_0.dfk.executors[arg_2].working_dir
            arg_4 = arg_0._http_Func_app(arg_2=arg_2)
            arg_5 = arg_4(arg_3, outputs=[arg_1])
            return arg_5._outputs[0]
        elif arg_1.scheme == 'globus':
            arg_6 = arg_0._get_globus_endpoint(arg_2)
            arg_4 = arg_0._globus_Func_app()
            arg_5 = arg_4(arg_6, outputs=[arg_1])
            return arg_5._outputs[0]
        else:
            raise Exception('Staging in with unknown file scheme {} is not supported'.format(arg_1.scheme))

Transport the file from the input source to the executor .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
from
wsgiref
.
simple_Funcr
import
make_Funcr
arg_1
=
lambda
app
:
make_Funcr
(
''
,
8000
,
app
)
.
Func_forever
(
)
print
(
'Listening on 0.0.0.0:8000'
)
try
:
arg_1
(
arg_0
)
finally
:
arg_1
.
socket
.
close
(
)

def Func(arg_0, arg_1=None):
        """Serve app using wsgiref or provided Funcr.

        Args:
        - Funcr (callable): An callable
        """
        if arg_1 is None:
            from wsgiref.simple_Funcr import make_Funcr
            arg_1 = lambda app: make_Funcr('', 8000, app).Func_forever()
            print('Listening on 0.0.0.0:8000')
        try:
            arg_1(arg_0)
        finally:
            arg_1.socket.close()

Serve app using wsgiref or provided server.

        Args:
        - server (callable): An callable

Serve app using wsgiref or provided server .


def Func(arg_0):
    '''
    Cast an arbitrary object or sequence to a string type
    '''
    if isinstance(arg_0, LiteralWrapper):
        arg_1 = arg_0.obj
    elif isinstance(arg_0, Iterable) and not isinstance(arg_0, str):
        arg_1 = next(arg_0, None)
    else:
        arg_1 = arg_0
    if arg_1 is None:
        yield ''
    elif isinstance(arg_1, str):
        yield arg_1
    elif isinstance(arg_1, node):
        yield strval(arg_1)
    elif isinstance(arg_1, int) or isinstance(arg_1, float):
        yield str(arg_1)
    elif isinstance(item, bool):
        yield 'true' if item else 'false'
    else:
        raise RuntimeError('Unknown type for string conversion: {}'.format(arg_1))


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_3 ) : if not os . path . isfile ( arg_2 ) : with arg_3 ( arg_2 , 'w' ) : pass with arg_3 ( arg_2 , 'r+' ) as f : with closing ( arg_0 . get_conn ( ) ) as conn : with closing ( conn . cursor ( ) ) as cur : cur . Func ( arg_1 , f ) f . truncate ( f . tell ( ) ) conn . commit ( )

def Func(arg_0, arg_1, arg_2, arg_3=arg_3):
        """
        Executes SQL using psycopg2 Func method.
        Necessary to execute COPY command without access to a superuser.

        Note: if this method is called with a "COPY FROM" statement and
        the specified input file does not exist, it creates an empty
        file and no data is loaded, but the operation succeeds.
        So if users want to be aware when the input file does not exist,
        they have to check its existence by themselves.
        """
        if not os.path.isfile(arg_2):
            with arg_3(arg_2, 'w'):
                pass

        with arg_3(arg_2, 'r+') as f:
            with closing(arg_0.get_conn()) as conn:
                with closing(conn.cursor()) as cur:
                    cur.Func(arg_1, f)
                    f.truncate(f.tell())
                    conn.commit()

Executes SQL using psycopg2 copy_expert method.
        Necessary to execute COPY command without access to a superuser.

        Note: if this method is called with a "COPY FROM" statement and
        the specified input file does not exist, it creates an empty
        file and no data is loaded, but the operation succeeds.
        So if users want to be aware when the input file does not exist,
        they have to check its existence by themselves.

Executes SQL using psycopg2 copy_expert method . Necessary to execute COPY command without access to a superuser .


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
int
)
:
if
arg_1
<
0
or
arg_1
>=
arg_0
.
size
:
raise
QiskitIndexError
(
"register index out of range"
)
elif
isinstance
(
arg_1
,
slice
)
:
if
arg_1
.
start
<
0
or
arg_1
.
stop
>=
arg_0
.
size
or
(
arg_1
.
step
is
not
and
arg_1
.
step
<=
0
)
:
raise
QiskitIndexError
(
"register index slice out of range"
)

def Func(arg_0, arg_1):
        """Check that j is a valid index into self."""
        if isinstance(arg_1, int):
            if arg_1 < 0 or arg_1 >= arg_0.size:
                raise QiskitIndexError("register index out of range")
            elif isinstance(arg_1, slice):
                if arg_1.start < 0 or arg_1.stop >= arg_0.size or (arg_1.step is not None and
                                                          arg_1.step <= 0):
                    raise QiskitIndexError("register index slice out of range")

Check that j is a valid index into self .


return super(WindowsPath2, cls)._from_parts(args, init)

def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_1 : arg_1 = list ( arg_1 ) if isinstance ( arg_1 [ 0 ] , WindowsPath2 ) : arg_1 [ 0 ] = arg_1 [ 0 ] . path elif arg_1 [ 0 ] . startswith ( "\\\\?\\" ) : arg_1 [ 0 ] = arg_1 [ 0 ] [ 4 : ] arg_1 = tuple ( arg_1 ) return super ( WindowsPath2 , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=True):
        """
        Strip \\?\ prefix in init phase
        """
        if arg_1:
            arg_1 = list(arg_1)
            if isinstance(arg_1[0], WindowsPath2):
                arg_1[0] = arg_1[0].path
            elif arg_1[0].startswith("\\\\?\\"):
                arg_1[0] = arg_1[0][4:]
            arg_1 = tuple(arg_1)
        return super(WindowsPath2, arg_0).Func(arg_1, arg_2)


def Func(arg_0):
        """
        Establish a connection to druid broker.
        """
        arg_1 = arg_0.Funcection(arg_0.druid_broker_conn_id)
        arg_2 = connect(
            host=arg_1.host,
            port=arg_1.port,
            path=arg_1.extra_dejson.get('endpoint', '/druid/v2/sql'),
            scheme=arg_1.extra_dejson.get('schema', 'http')
        )
        arg_0.log.info('Get the connection to druid broker on %s', arg_1.host)
        return arg_2

Establish a connection to druid broker .


def Func ( arg_0 , arg_1 ) : arg_2 = super ( SharedResult , arg_0 ) . Func ( arg_1 ) arg_2 = arg_2 or type ( arg_1 ) in SharedResult . SUPPORTED_DATA return arg_2

def Func(arg_0, arg_1):
        """Checks if outer data structure is supported."""
        arg_2 = super(SharedResult, arg_0).Func(arg_1)
        arg_2 = arg_2 or type(arg_1) in SharedResult.SUPPORTED_DATA
        return arg_2

Checks if outer data structure is supported .


(value_and_gradients_function,
            search_interval,
            f_lim,
            max_iterations,
            expansion_param=5.0)

return _bisect(value_and_gradients_function, bisect_args, f_lim)

def Func(arg_0,
            arg_1,
            arg_2,
            arg_3,
            arg_4=5.0):
  """Brackets the minimum given an initial starting point.

  Applies the Hager Zhang Funcing algorithm to find an interval containing
  a region with points satisfying Wolfe conditions. Uses the supplied initial
  step size 'c', the right end point of the provided search interval, to find
  such an interval. The only condition on 'c' is that it should be positive.
  For more details see steps B0-B3 in [Hager and Zhang (2006)][2].

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns a namedtuple containing the value filed `f` of the
      function and its derivative value field `df` at that point.
      Alternatively, the function may representthe batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and return a tuple of two tensors of shape [n], the
      function values and the corresponding derivatives at the input points.
    search_interval: A namedtuple describing the current search interval,
      must include the fields:
      - converged: Boolean `Tensor` of shape [n], indicating batch members
          where search has already converged. Interval for these batch members
          wont be modified.
      - failed: Boolean `Tensor` of shape [n], indicating batch members
          where search has already failed. Interval for these batch members
          wont be modified.
      - iterations: Scalar int32 `Tensor`. Number of line search iterations
          so far.
      - func_evals: Scalar int32 `Tensor`. Number of function evaluations
          so far.
      - left: A namedtuple, as returned by value_and_gradients_function
          evaluated at 0, the left end point of the current interval.
      - right: A namedtuple, as returned by value_and_gradients_function,
          of the right end point of the current interval (labelled 'c' above).
    f_lim: real `Tensor` of shape [n]. The function value threshold for
      the approximate Wolfe conditions to be checked for each batch member.
    max_iterations: Int32 scalar `Tensor`. The maximum number of iterations
      permitted. The limit applies equally to all batch members.
    expansion_param: Scalar positive `Tensor` of real dtype. Must be greater
      than `1.`. Used to expand the initial interval in case it does not Func
      a minimum.

  Returns:
    A namedtuple with the following fields.
      iteration: An int32 scalar `Tensor`. The number of iterations performed.
        Bounded above by `max_iterations` parameter.
      stopped: A boolean `Tensor` of shape [n]. True for those batch members
        where the algorithm terminated before reaching `max_iterations`.
      failed: A boolean `Tensor` of shape [n]. True for those batch members
        where an error was encountered during Funcing.
      num_evals: An int32 scalar `Tensor`. The number of times the objective
        function was evaluated.
      left: Return value of value_and_gradients_function at the updated left
        end point of the interval found.
      right: Return value of value_and_gradients_function at the updated right
        end point of the interval found.
  """
  arg_5 = arg_1.failed | arg_1.converged

  # If the slope at right end point is positive, step B1 in [2], then the given
  # initial points already Func a minimum.
  arg_6 = arg_1.right.df >= 0

  # Bisection is needed, step B2, if right end point almost works as a new left
  # end point but the objective value is too high.
  arg_7 = (
      arg_1.right.df < 0) & (arg_1.right.f > arg_2)

  # In these three cases Funcing is already `stopped` and there is no need
  # to perform further evaluations. Otherwise the Funcing loop is needed to
  # expand the interval, step B3, until the conditions are met.
  arg_8 = _IntermediateResult(
      iteration=arg_1.iterations,
      arg_15=arg_5 | arg_6 | arg_7,
      arg_13=arg_1.failed,
      num_evals=arg_1.func_evals,
      arg_11=arg_1.left,
      arg_12=arg_1.right)

  def _loop_cond(arg_9):
    return (arg_9.iteration <
            arg_3) & ~tf.reduce_all(input_tensor=arg_9.stopped)

  def _loop_body(arg_9):
    """Main body of Funcing loop."""
    # The loop maintains the invariant that curr.stopped is true if we have
    # either: failed, successfully Funced, or not yet Funced but needs
    # bisect. On the only remaining case, step B3 in [2]. case we need to
    # expand and update the left/right values appropriately.
    arg_10 = arg_0(arg_4 * arg_9.right.x)
    arg_11 = val_where(arg_9.stopped, arg_9.left, arg_9.right)
    arg_12 = val_where(arg_9.stopped, arg_9.right, arg_10)

    # Updated the failed, Funced, and needs_bisect conditions.
    arg_13 = arg_9.failed | ~is_finite(arg_12)
    arg_6 = arg_12.df >= 0
    arg_7 = (arg_12.df < 0) & (arg_12.f > arg_2)
    return [_IntermediateResult(
        iteration=arg_9.iteration + 1,
        arg_15=arg_9.stopped | arg_13 | arg_6 | arg_7,
        arg_13=arg_13,
        num_evals=arg_9.num_evals + 1,
        arg_11=arg_11,
        arg_12=arg_12)]

  arg_14 = tf.while_loop(
      cond=_loop_cond, body=_loop_body, loop_vars=[arg_8])[0]

  # For entries where bisect is still needed, mark them as not yet stopped,
  # reset the left end point, and run `_bisect` on them.
  arg_7 = (
      (arg_14.right.df < 0) & (arg_14.right.f > arg_2))
  arg_15 = arg_5 | arg_14.failed | ~arg_7
  arg_11 = val_where(arg_15, arg_14.left, arg_1.left)
  arg_16 = arg_14._replace(arg_15=arg_15, arg_11=arg_11)
  return _bisect(arg_0, arg_16, arg_2)

Brackets the minimum given an initial starting point.

  Applies the Hager Zhang bracketing algorithm to find an interval containing
  a region with points satisfying Wolfe conditions. Uses the supplied initial
  step size 'c', the right end point of the provided search interval, to find
  such an interval. The only condition on 'c' is that it should be positive.
  For more details see steps B0-B3 in [Hager and Zhang (2006)][2].

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns a namedtuple containing the value filed `f` of the
      function and its derivative value field `df` at that point.
      Alternatively, the function may representthe batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and return a tuple of two tensors of shape [n], the
      function values and the corresponding derivatives at the input points.
    search_interval: A namedtuple describing the current search interval,
      must include the fields:
      - converged: Boolean `Tensor` of shape [n], indicating batch members
          where search has already converged. Interval for these batch members
          wont be modified.
      - failed: Boolean `Tensor` of shape [n], indicating batch members
          where search has already failed. Interval for these batch members
          wont be modified.
      - iterations: Scalar int32 `Tensor`. Number of line search iterations
          so far.
      - func_evals: Scalar int32 `Tensor`. Number of function evaluations
          so far.
      - left: A namedtuple, as returned by value_and_gradients_function
          evaluated at 0, the left end point of the current interval.
      - right: A namedtuple, as returned by value_and_gradients_function,
          of the right end point of the current interval (labelled 'c' above).
    f_lim: real `Tensor` of shape [n]. The function value threshold for
      the approximate Wolfe conditions to be checked for each batch member.
    max_iterations: Int32 scalar `Tensor`. The maximum number of iterations
      permitted. The limit applies equally to all batch members.
    expansion_param: Scalar positive `Tensor` of real dtype. Must be greater
      than `1.`. Used to expand the initial interval in case it does not bracket
      a minimum.

  Returns:
    A namedtuple with the following fields.
      iteration: An int32 scalar `Tensor`. The number of iterations performed.
        Bounded above by `max_iterations` parameter.
      stopped: A boolean `Tensor` of shape [n]. True for those batch members
        where the algorithm terminated before reaching `max_iterations`.
      failed: A boolean `Tensor` of shape [n]. True for those batch members
        where an error was encountered during bracketing.
      num_evals: An int32 scalar `Tensor`. The number of times the objective
        function was evaluated.
      left: Return value of value_and_gradients_function at the updated left
        end point of the interval found.
      right: Return value of value_and_gradients_function at the updated right
        end point of the interval found.

Brackets the minimum given an initial starting point .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
Connection
(
conn_id
=
arg_0
.
db_conn_id
)
arg_3
=
arg_0
.
_generate_connection_uri
(
)
arg_0
.
log
.
info
(
"Creating connection %s"
,
arg_0
.
db_conn_id
)
arg_2
.
parse_from_uri
(
arg_3
)
arg_1
.
add
(
arg_2
)
arg_1
.
commit
(
)

def Func(arg_0, arg_1=None):
        """
        Create connection in the Connection table, according to whether it uses
        proxy, TCP, UNIX sockets, SSL. Connection ID will be randomly generated.

        :param session: Session of the SQL Alchemy ORM (automatically generated with
                        decorator).
        """
        arg_2 = Connection(conn_id=arg_0.db_conn_id)
        arg_3 = arg_0._generate_connection_uri()
        arg_0.log.info("Creating connection %s", arg_0.db_conn_id)
        arg_2.parse_from_uri(arg_3)
        arg_1.add(arg_2)
        arg_1.commit()

Create connection in the Connection table according to whether it uses proxy TCP UNIX sockets SSL . Connection ID will be randomly generated .


def Func ( arg_0 , arg_1 ) : arg_2 = BNode ( ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . PackageVerificationCode ) arg_0 . graph . add ( arg_3 ) arg_4 = ( arg_2 , arg_0 . spdx_namespace . packageVerificationCodeValue , Literal ( arg_1 . verif_code ) ) arg_0 . graph . add ( arg_4 ) arg_5 = map ( lambda excl : Literal ( excl ) , arg_1 . verif_exc_files ) arg_6 = arg_0 . spdx_namespace . packageVerificationCodeExcludedFile arg_7 = [ ( arg_2 , arg_6 , xcl_file ) for xcl_file in arg_5 ] for arg_8 in arg_7 : arg_0 . graph . add ( arg_8 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return a node representing package verification code.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.PackageVerificationCode)
        arg_0.graph.add(arg_3)
        arg_4 = (arg_2, arg_0.spdx_namespace.packageVerificationCodeValue, Literal(arg_1.verif_code))
        arg_0.graph.add(arg_4)
        arg_5 = map(
            lambda excl: Literal(excl), arg_1.verif_exc_files)
        arg_6 = arg_0.spdx_namespace.packageVerificationCodeExcludedFile
        arg_7 = [(arg_2, arg_6, xcl_file) for xcl_file in arg_5]
        for arg_8 in arg_7:
            arg_0.graph.add(arg_8)
        return arg_2

Return a node representing package verification code .


def Func ( arg_0 ) : arg_1 = arg_0 . context . get ( 'request' ) if arg_1 : arg_2 = arg_1 . query_params . get ( 'exclude' , None ) if arg_2 is None : return arg_3 = arg_2 . split ( ',' ) for arg_4 in arg_3 : arg_0 . fields . pop ( arg_4 )

def Func(arg_0):
        """Excludes fields that are included in the queryparameters"""
        arg_1 = arg_0.context.get('request')
        if arg_1:
            arg_2 = arg_1.query_params.get('exclude', None)
            if arg_2 is None: return

            arg_3 = arg_2.split(',')
            for arg_4 in arg_3:
                arg_0.fields.pop(arg_4)