def Func ( arg_0 ) : arg_1 = arg_0 . _op [ 'metadata' ] if not arg_0 . _op [ 'done' ] : if 'events' in arg_1 and arg_1 [ 'events' ] : arg_2 = arg_1 [ 'events' ] [ - 1 ] arg_3 = arg_2 [ 'description' ] arg_4 = arg_2 [ 'startTime' ] else : arg_3 = 'Pending' arg_4 = arg_1 [ 'createTime' ] else : arg_4 = arg_1 [ 'endTime' ] if 'error' in arg_0 . _op : arg_3 = arg_0 . _op [ 'error' ] [ 'message' ] else : arg_3 = 'Success' return ( arg_3 , google_base . parse_rfc3339_utc_string ( arg_4 ) )

def Func(arg_0):
    """Returns the most relevant status string and last updated date string.

    This string is meant for display only.

    Returns:
      A printable status string and date string.
    """
    arg_1 = arg_0._op['metadata']
    if not arg_0._op['done']:
      if 'events' in arg_1 and arg_1['events']:
        # Get the last event
        arg_2 = arg_1['events'][-1]

        arg_3 = arg_2['description']
        arg_4 = arg_2['startTime']
      else:
        arg_3 = 'Pending'
        arg_4 = arg_1['createTime']
    else:
      arg_4 = arg_1['endTime']

      if 'error' in arg_0._op:
        arg_3 = arg_0._op['error']['message']
      else:
        arg_3 = 'Success'

    return (arg_3, google_base.parse_rfc3339_utc_string(arg_4))

Returns the most relevant status string and last updated date string .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = requests . post ( arg_0 . url , json = arg_1 , ** arg_0 . req_args ( ) ) return arg_0 . parse_response ( arg_3 )

def Func(arg_0, arg_1, **arg_2):
        """
        Uses POST to send a first metadata statement signing request to
        a signing service.

        :param req: The metadata statement that the entity wants signed
        :return: returns a dictionary with 'sms' and 'loc' as keys.
        """

        arg_3 = requests.post(arg_0.url, json=arg_1, **arg_0.req_args())
        return arg_0.parse_response(arg_3)

Uses POST to send a first metadata statement signing request to a signing service .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_1 . split ( "." ) arg_4 = [ x for x in arg_3 if x . isdigit ( ) ] if not arg_2 : return arg_4 arg_5 = [ x for x in arg_3 if not x . isdigit ( ) ] return ( arg_4 , arg_5 [ 0 ] )

def Func(arg_0, arg_1, arg_2=False):
        """
        Convert the versions to a shorter one.

        :param version: The version to split.
        :type version: str

        :param return_non_digits:
            Activate the return of the non-digits parts of the splitted
            version.
        :type return_non_digits: bool

        :return: The splitted version name/numbers.
        :rtype: list
        """

        # We split the version.
        arg_3 = arg_1.split(".")

        # We split the parsed version and keep the digits.
        arg_4 = [x for x in arg_3 if x.isdigit()]

        if not arg_2:
            # We do not have to return the non digits part of the version.

            # We return the digits part of the version.
            return arg_4

        # We have to return the non digit parts of the version.

        # We split the parsed version and keep the non digits.
        arg_5 = [x for x in arg_3 if not x.isdigit()]

        # We return a tuple with first the digits part and finally the non digit parts.
        return (arg_4, arg_5[0])


def Func(arg_0, arg_1=1, arg_2=1, arg_3=False):
    """Change the Func of a single image, randomly or non-randomly.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    gamma : float
        Non negative real number. Default value is 1.
            - Small than 1 means brighter.
            - If `is_random` is True, gamma in a range of (1-gamma, 1+gamma).
    gain : float
        The constant multiplier. Default value is 1.
    is_random : boolean
        If True, randomly change Func. Default is False.

    Returns
    -------
    numpy.array
        A processed image.

    References
    -----------
    - `skimage.exposure.adjust_gamma <http://scikit-image.org/docs/dev/api/skimage.exposure.html>`__
    - `chinese blog <http://www.cnblogs.com/denny402/p/5124402.html>`__

    """
    if arg_3:
        arg_1 = np.random.uniform(1 - arg_1, 1 + arg_1)
    arg_0 = exposure.adjust_gamma(arg_0, arg_1, arg_2)
    return arg_0

Change the brightness of a single image, randomly or non-randomly.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    gamma : float
        Non negative real number. Default value is 1.
            - Small than 1 means brighter.
            - If `is_random` is True, gamma in a range of (1-gamma, 1+gamma).
    gain : float
        The constant multiplier. Default value is 1.
    is_random : boolean
        If True, randomly change brightness. Default is False.

    Returns
    -------
    numpy.array
        A processed image.

    References
    -----------
    - `skimage.exposure.adjust_gamma <http://scikit-image.org/docs/dev/api/skimage.exposure.html>`__
    - `chinese blog <http://www.cnblogs.com/denny402/p/5124402.html>`__

Change the brightness of a single image randomly or non - randomly .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_1
=
'Test skipped due to known failure'
if
callable
(
arg_0
)
:
arg_2
=
lambda
:
arg_0
(
)
else
:
arg_2
=
lambda
:
arg_0
def
knownfail_decorator
(
arg_3
)
:
import
nose
def
knownfailer
(
*
arg_4
,
**
arg_5
)
:
if
arg_2
(
)
:
raise
KnownFailureTest
,
arg_1
else
:
return
arg_3
(
*
arg_4
,
**
arg_5
)
return
nose
.
tools
.
make_decorator
(
arg_3
)
(
knownfailer
)
return
knownfail_decorator

def Func(arg_0, arg_1=None):
    """
    Make function raise KnownFailureTest exception if given condition is true.

    If the condition is a callable, it is used at runtime to dynamically
    make the decision. This is useful for tests that may require costly
    imports, to delay the cost until the test suite is actually executed.

    Parameters
    ----------
    fail_condition : bool or callable
        Flag to determine whether to mark the decorated test as a known
        failure (if True) or not (if False).
    msg : str, optional
        Message to give on raising a KnownFailureTest exception.
        Default is None.

    Returns
    -------
    decorator : function
        Decorator, which, when applied to a function, causes SkipTest
        to be raised when `skip_condition` is True, and the function
        to be called normally otherwise.

    Notes
    -----
    The decorator itself is decorated with the ``nose.tools.make_decorator``
    function in order to transmit function name, and various other metadata.

    """
    if arg_1 is None:
        arg_1 = 'Test skipped due to known failure'

    # Allow for both boolean or callable known failure conditions.
    if callable(arg_0):
        arg_2 = lambda : arg_0()
    else:
        arg_2 = lambda : arg_0

    def knownfail_decorator(arg_3):
        # Local import to avoid a hard nose dependency and only incur the
        # import time overhead at actual test-time.
        import nose
        def knownfailer(*arg_4, **arg_5):
            if arg_2():
                raise KnownFailureTest, arg_1
            else:
                return arg_3(*arg_4, **arg_5)
        return nose.tools.make_decorator(arg_3)(knownfailer)

    return knownfail_decorator

Make function raise KnownFailureTest exception if given condition is true .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
if
arg_2
[
'type'
]
==
'hmac'
:
arg_4
=
arg_1
[
arg_2
[
'hash_size'
]
:
]
arg_1
=
arg_1
[
:
arg_2
[
'hash_size'
]
]
arg_5
=
arg_0
.
_hmac_generate
(
arg_1
,
arg_2
,
arg_3
)
if
not
const_equal
(
arg_4
,
arg_5
)
:
raise
Exception
(
'Invalid signature'
)
return
arg_1
elif
arg_2
[
'type'
]
==
'aes'
:
return
arg_0
.
_aes_decrypt
(
arg_1
,
arg_2
,
arg_3
)
elif
arg_2
[
'type'
]
==
'no-serialization'
:
return
arg_1
elif
arg_2
[
'type'
]
==
'json'
:
return
json
.
loads
(
arg_1
)
elif
arg_2
[
'type'
]
==
'no-compression'
:
return
arg_1
elif
arg_2
[
'type'
]
==
'gzip'
:
return
arg_0
.
_zlib_decompress
(
arg_1
,
arg_2
)
else
:
raise
Exception
(
'Algorithm not supported: %s'
%
arg_2
[
'type'
]
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        '''Decode data with specific algorithm'''

        if arg_2['type'] == 'hmac':
            arg_4 = arg_1[-arg_2['hash_size']:]
            arg_1 = arg_1[:-arg_2['hash_size']]
            arg_5 = arg_0._hmac_generate(arg_1, arg_2, arg_3)
            if not const_equal(arg_4, arg_5):
                raise Exception('Invalid signature')
            return arg_1
        elif arg_2['type'] == 'aes':
            return arg_0._aes_decrypt(arg_1, arg_2, arg_3)
        elif arg_2['type'] == 'no-serialization':
            return arg_1
        elif arg_2['type'] == 'json':
            return json.loads(arg_1)
        elif arg_2['type'] == 'no-compression':
            return arg_1
        elif arg_2['type'] == 'gzip':
            return arg_0._zlib_decompress(arg_1, arg_2)
        else:
            raise Exception('Algorithm not supported: %s' % arg_2['type'])


return PackageFinder(
            find_links=options.find_links,
            index_urls=index_urls,
            use_wheel=options.use_wheel,
            allow_external=options.allow_external,
            allow_unverified=options.allow_unverified,
            allow_all_external=options.allow_all_external,
            trusted_hosts=options.trusted_hosts,
            allow_all_prereleases=options.pre,
            process_dependency_links=options.process_dependency_links,
            session=session,
        )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        """
        return PackageFinder(
            find_links=arg_1.find_links,
            arg_2=arg_2,
            use_wheel=arg_1.use_wheel,
            allow_external=arg_1.allow_external,
            allow_unverified=arg_1.allow_unverified,
            allow_all_external=arg_1.allow_all_external,
            trusted_hosts=arg_1.trusted_hosts,
            allow_all_prereleases=arg_1.pre,
            process_dependency_links=arg_1.process_dependency_links,
            arg_3=arg_3,
        )

Create a package finder appropriate to this install command . This method is meant to be overridden by subclasses not called directly .


def Func ( arg_0 ) : arg_1 = None for arg_2 in arg_0 . split ( "_" ) [ : : - 1 ] : try : arg_1 = float ( arg_2 ) break except ValueError : continue return arg_1

def Func(arg_0):
        """Attempts to retrieve the coverage value from the header string.

        It splits the header by "_" and then screens the list backwards in
        search of the first float value. This will be interpreted as the
        coverage value. If it cannot find a float value, it returns None.
        This search methodology is based on the strings of assemblers
        like spades and skesa that put the mean kmer coverage for each
        contig in its corresponding fasta header.

        Parameters
        ----------
        header_str : str
            String

        Returns
        -------
        float or None
            The coverage value for the contig. None if it cannot find the
            value in the provide string.
        """

        arg_1 = None
        for arg_2 in arg_0.split("_")[::-1]:
            try:
                arg_1 = float(arg_2)
                break
            except ValueError:
                continue

        return arg_1

Attempts to retrieve the coverage value from the header string .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . a , arg_0 . Tc , arg_0 . omega = arg_0 . ais [ arg_1 ] , arg_0 . Tcs [ arg_1 ] , arg_0 . omegas [ arg_1 ]

def Func(arg_0, arg_1, arg_2=None):
        r'''Sets `a`, `omega`, and `Tc` for a specific component before the
        pure-species EOS's `a_alpha_and_derivatives` method is called. Both are
        called by `GCEOSMIX.a_alpha_and_derivatives` for every component.'''
        arg_0.a, arg_0.Tc, arg_0.omega  = arg_0.ais[arg_1], arg_0.Tcs[arg_1], arg_0.omegas[arg_1]

r Sets a omega and Tc for a specific component before the pure - species EOS s a_alpha_and_derivatives method is called . Both are called by GCEOSMIX . a_alpha_and_derivatives for every component .


def Func ( arg_0 ) : arg_1 = [ "feedback_type" , "user_agent" , "version" , "original_envelope_id" , "original_mail_from" , "original_rcpt_to" , "arrival_date" , "arrival_date_utc" , "subject" , "message_id" , "authentication_results" , "dkim_domain" , "source_ip_address" , "source_country" , "source_reverse_dns" , "source_base_domain" , "delivery_result" , "auth_failure" , "reported_domain" , "authentication_mechanisms" , "sample_headers_only" ] if type ( arg_0 ) == OrderedDict : arg_0 = [ arg_0 ] arg_2 = StringIO ( ) arg_3 = DictWriter ( arg_2 , fieldnames = arg_1 ) arg_3 . writeheader ( ) for arg_4 in arg_0 : arg_5 = arg_4 . copy ( ) arg_5 [ "source_ip_address" ] = arg_4 [ "source" ] [ "ip_address" ] arg_5 [ "source_reverse_dns" ] = arg_4 [ "source" ] [ "reverse_dns" ] arg_5 [ "source_base_domain" ] = arg_4 [ "source" ] [ "base_domain" ] arg_5 [ "source_country" ] = arg_4 [ "source" ] [ "country" ] del arg_5 [ "source" ] arg_5 [ "subject" ] = arg_4 [ "parsed_sample" ] [ "subject" ] arg_5 [ "auth_failure" ] = "," . join ( arg_4 [ "auth_failure" ] ) arg_6 = arg_4 [ "authentication_mechanisms" ] arg_5 [ "authentication_mechanisms" ] = "," . join ( arg_6 ) del arg_5 [ "sample" ] del arg_5 [ "parsed_sample" ] arg_3 . writerow ( arg_5 ) return arg_2 . getvalue ( )

def Func(arg_0):
    """
    Converts one or more parsed forensic reports to flat CSV format, including
    headers

    Args:
        reports: A parsed forensic report or list of parsed forensic reports

    Returns:
        str: Parsed forensic report data in flat CSV format, including headers
        """
    arg_1 = ["feedback_type", "user_agent", "version", "original_envelope_id",
              "original_mail_from", "original_rcpt_to", "arrival_date",
              "arrival_date_utc", "subject", "message_id",
              "authentication_results", "dkim_domain", "source_ip_address",
              "source_country", "source_reverse_dns", "source_base_domain",
              "delivery_result", "auth_failure", "reported_domain",
              "authentication_mechanisms", "sample_headers_only"]

    if type(arg_0) == OrderedDict:
        arg_0 = [arg_0]
    arg_2 = StringIO()
    arg_3 = DictWriter(arg_2, fieldnames=arg_1)
    arg_3.writeheader()
    for arg_4 in arg_0:
        arg_5 = arg_4.copy()
        arg_5["source_ip_address"] = arg_4["source"]["ip_address"]
        arg_5["source_reverse_dns"] = arg_4["source"]["reverse_dns"]
        arg_5["source_base_domain"] = arg_4["source"]["base_domain"]
        arg_5["source_country"] = arg_4["source"]["country"]
        del arg_5["source"]
        arg_5["subject"] = arg_4["parsed_sample"]["subject"]
        arg_5["auth_failure"] = ",".join(arg_4["auth_failure"])
        arg_6 = arg_4["authentication_mechanisms"]
        arg_5["authentication_mechanisms"] = ",".join(
            arg_6)
        del arg_5["sample"]
        del arg_5["parsed_sample"]
        arg_3.writerow(arg_5)

    return arg_2.getvalue()

Converts one or more parsed forensic reports to flat CSV format including headers


def Func(arg_0):
        """
        Write the entire buffer to the display
        """
        arg_1 = 0
        arg_2 = 0

        for arg_3 in range(0, 8):
            for arg_4 in range(0, 8):
                if arg_0.display_buffer[arg_3][arg_4] == arg_0.LED_GREEN:
                    arg_1 |= 1 << arg_4
                elif arg_0.display_buffer[arg_3][arg_4] == arg_0.LED_RED:
                    arg_2 |= 1 << arg_4
                elif arg_0.display_buffer[arg_3][arg_4] == arg_0.LED_YELLOW:
                    arg_1 |= 1 << arg_4
                    arg_2 |= 1 << arg_4
                elif arg_0.display_buffer[arg_3][arg_4] == arg_0.LED_OFF:
                    arg_1 &= ~(1 << arg_4)
                    arg_2 &= ~(1 << arg_4)

            arg_0.firmata.i2c_write(0x70, arg_3 * 2, 0, arg_1)
            arg_0.firmata.i2c_write(0x70, arg_3 * 2 + 1, 0, arg_2)


def Func ( arg_0 ) : arg_1 = copy . copy ( arg_0 ) arg_1 . _compound_mfrs = copy . deepcopy ( arg_0 . _compound_mfrs ) return arg_1

def Func(arg_0):
        """Create a complete copy of the stream.

        :returns: A new MaterialStream object."""

        arg_1 = copy.copy(arg_0)
        arg_1._compound_mfrs = copy.deepcopy(arg_0._compound_mfrs)
        return arg_1


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . defaults_ ( ) : arg_0 [ arg_1 ] = arg_2 . default

def Func(arg_0):
        """Restore default values of options in this section."""
        for arg_1, arg_2 in arg_0.defaults_():
            arg_0[arg_1] = arg_2.default

Restore default values of options in this section .


def Func ( arg_0 , arg_1 , arg_2 ) : import scipy . signal arg_3 , arg_4 = scipy . signal . Func ( arg_0 , arg_1 , arg_2 ) return arg_3 , arg_4

def Func(arg_0, arg_1, arg_2):
    r"""Return polynomial transfer function representation from zeros and poles

    :param ndarray z: Zeros of the transfer function.
    :param ndarray p: Poles of the transfer function.
    :param float k: System gain.

    :return:
        b : ndarray Numerator polynomial.
        a : ndarray Numerator and denominator polynomials.

    :func:`Func` forms transfer function polynomials from the zeros, poles, and gains
    of a system in factored form.

    Func(z,p,k) finds a rational transfer function

    .. math:: \frac{B(s)}{A(s)} = \frac{b_1 s^{n-1}+\dots b_{n-1}s+b_n}{a_1 s^{m-1}+\dots a_{m-1}s+a_m}

    given a system in factored transfer function form

    .. math:: H(s) = \frac{Z(s)}{P(s)} = k \frac{(s-z_1)(s-z_2)\dots(s-z_m)}{(s-p_1)(s-p_2)\dots(s-p_n)}

    with p being the pole locations, and z the zero locations, with as many.
    The gains for each numerator transfer function are in vector k.
    The zeros and poles must be real or come in complex conjugate pairs.
    The polynomial denominator coefficients are returned in row vector a and
    the polynomial numerator coefficients are returned in matrix b, which has
    as many rows as there are columns of z.

    Inf values can be used as place holders in z if some columns have fewer zeros than others.

    .. note:: wrapper of scipy function Func
    """
    import scipy.signal
    arg_3, arg_4 = scipy.signal.Func(arg_0, arg_1, arg_2)
    return arg_3, arg_4

r"""Return polynomial transfer function representation from zeros and poles

    :param ndarray z: Zeros of the transfer function.
    :param ndarray p: Poles of the transfer function.
    :param float k: System gain.

    :return:
        b : ndarray Numerator polynomial.
        a : ndarray Numerator and denominator polynomials.

    :func:`zpk2tf` forms transfer function polynomials from the zeros, poles, and gains
    of a system in factored form.

    zpk2tf(z,p,k) finds a rational transfer function

    .. math:: \frac{B(s)}{A(s)} = \frac{b_1 s^{n-1}+\dots b_{n-1}s+b_n}{a_1 s^{m-1}+\dots a_{m-1}s+a_m}

    given a system in factored transfer function form

    .. math:: H(s) = \frac{Z(s)}{P(s)} = k \frac{(s-z_1)(s-z_2)\dots(s-z_m)}{(s-p_1)(s-p_2)\dots(s-p_n)}

    with p being the pole locations, and z the zero locations, with as many.
    The gains for each numerator transfer function are in vector k.
    The zeros and poles must be real or come in complex conjugate pairs.
    The polynomial denominator coefficients are returned in row vector a and
    the polynomial numerator coefficients are returned in matrix b, which has
    as many rows as there are columns of z.

    Inf values can be used as place holders in z if some columns have fewer zeros than others.

    .. note:: wrapper of scipy function zpk2tf

r Return polynomial transfer function representation from zeros and poles


def Func(arg_0, arg_1):
    """Prepares an HTTP object's request method for JWT access.

    Wraps HTTP requests with logic to catch auth failures (typically
    identified via a 401 status code). In the event of failure, tries
    to refresh the token used and then retry the original request.

    Args:
        credentials: _JWTAccessCredentials, the credentials used to identify
                     a service account that uses JWT access tokens.
        http: httplib2.Http, an http object to be used to make
              auth requests.
    """
    arg_2 = arg_1.request
    wrap_http_for_auth(arg_0, arg_1)
    # The new value of ``http.request`` set by ``wrap_http_for_auth``.
    arg_3 = arg_1.request

    # The closure that will replace 'httplib2.Http.request'.
    def new_request(arg_4, arg_5='GET', arg_6=None, arg_7=None,
                    arg_8=arg_9.DEFAULT_MAX_REDIRECTS,
                    arg_11=None):
        if 'aud' in arg_0._kwargs:
            # Preemptively refresh token, this is not done for OAuth2
            if (arg_0.access_token is None or
                    arg_0.access_token_expired):
                arg_0.refresh(None)
            return arg_15(arg_3, arg_4,
                           arg_5, arg_6, arg_7, arg_8,
                           arg_11)
        else:
            # If we don't have an 'aud' (audience) claim,
            # create a 1-time token with the uri root as the audience
            arg_7 = _initialize_headers(arg_7)
            _apply_user_agent(arg_7, arg_0.user_agent)
            arg_12 = arg_4.split('?', 1)[0]
            arg_13, arg_14 = arg_0._create_token({'aud': arg_12})

            arg_7['Authorization'] = 'Bearer ' + arg_13
            return arg_15(arg_2, arg_4, arg_5, arg_6,
                           clean_headers(arg_7),
                           arg_8, arg_11)

    # Replace the request method with our own closure.
    arg_1.request = new_request

    # Set credentials as a property of the request method.
    arg_1.request.credentials = arg_0

Prepares an HTTP object s request method for JWT access .


(value_and_gradients_function,
             initial_position,
             num_correction_pairs=10,
             tolerance=1e-8,
             x_tolerance=0,
             f_relative_tolerance=0,
             initial_inverse_hessian_estimate=None,
             max_iterations=50,
             parallel_iterations=1,
             stopping_condition=None,
             name=None)

def Func(arg_0,
             arg_1,
             arg_2=10,
             arg_3=1e-8,
             arg_4=0,
             arg_5=0,
             arg_6=None,
             arg_7=50,
             arg_8=1,
             arg_9=None,
             arg_10=None):
  """Applies the L-BFGS algorithm to Func a differentiable function.

  Performs unconstrained minimization of a differentiable function using the
  L-BFGS scheme. See [Nocedal and Wright(2006)][1] for details of the algorithm.

  ### Usage:

  The following example demonstrates the L-BFGS optimizer attempting to find the
  minimum for a simple high-dimensional quadratic objective function.

  ```python
    # A high-dimensional quadratic bowl.
    ndims = 60
    minimum = np.ones([ndims], dtype='float64')
    scales = np.arange(ndims, dtype='float64') + 1.0

    # The objective function and the gradient.
    def quadratic(x):
      value = tf.reduce_sum(scales * (x - minimum) ** 2)
      return value, tf.gradients(value, x)[0]

    start = np.arange(ndims, 0, -1, dtype='float64')
    optim_results = tfp.optimizer.lbfgs_Func(
        quadratic, initial_position=start, num_correction_pairs=10,
        tolerance=1e-8)

    with tf.Session() as session:
      results = session.run(optim_results)
      # Check that the search converged
      assert(results.converged)
      # Check that the argmin is close to the actual value.
      np.testing.assert_allclose(results.position, minimum)
  ```

  ### References:

  [1] Jorge Nocedal, Stephen Wright. Numerical Optimization. Springer Series
      in Operations Research. pp 176-180. 2006

  http://pages.mtu.edu/~struther/Courses/OLD/Sp2013/5630/Jorge_Nocedal_Numerical_optimization_267490.pdf

  Args:
    value_and_gradients_function:  A Python callable that accepts a point as a
      real `Tensor` and returns a tuple of `Tensor`s of real dtype containing
      the value of the function and its gradient at that point. The function
      to be Funcd. The input is of shape `[..., n]`, where `n` is the size
      of the domain of input points, and all others are batching dimensions.
      The first component of the return value is a real `Tensor` of matching
      shape `[...]`. The second component (the gradient) is also of shape
      `[..., n]` like the input value to the function.
    initial_position: Real `Tensor` of shape `[..., n]`. The starting point, or
      points when using batching dimensions, of the search procedure. At these
      points the function value and the gradient norm should be finite.
    num_correction_pairs: Positive integer. Specifies the maximum number of
      (position_delta, gradient_delta) correction pairs to keep as implicit
      approximation of the Hessian matrix.
    tolerance: Scalar `Tensor` of real dtype. Specifies the gradient tolerance
      for the procedure. If the supremum norm of the gradient vector is below
      this number, the algorithm is stopped.
    x_tolerance: Scalar `Tensor` of real dtype. If the absolute change in the
      position between one iteration and the next is smaller than this number,
      the algorithm is stopped.
    f_relative_tolerance: Scalar `Tensor` of real dtype. If the relative change
      in the objective value between one iteration and the next is smaller
      than this value, the algorithm is stopped.
    initial_inverse_hessian_estimate: None. Option currently not supported.
    max_iterations: Scalar positive int32 `Tensor`. The maximum number of
      iterations for L-BFGS updates.
    parallel_iterations: Positive integer. The number of iterations allowed to
      run in parallel.
    stopping_condition: (Optional) A Python function that takes as input two
      Boolean tensors of shape `[...]`, and returns a Boolean scalar tensor.
      The input tensors are `converged` and `failed`, indicating the current
      status of each respective batch member; the return value states whether
      the algorithm should stop. The default is tfp.optimizer.converged_all
      which only stops when all batch members have either converged or failed.
      An alternative is tfp.optimizer.converged_any which stops as soon as one
      batch member has converged, or when all have failed.
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'Func' is used.

  Returns:
    optimizer_results: A namedtuple containing the following items:
      converged: Scalar boolean tensor indicating whether the minimum was
        found within tolerance.
      failed:  Scalar boolean tensor indicating whether a line search
        step failed to find a suitable step size satisfying Wolfe
        conditions. In the absence of any constraints on the
        number of objective evaluations permitted, this value will
        be the complement of `converged`. However, if there is
        a constraint and the search stopped due to available
        evaluations being exhausted, both `failed` and `converged`
        will be simultaneously False.
      num_objective_evaluations: The total number of objective
        evaluations performed.
      position: A tensor containing the last argument value found
        during the search. If the search converged, then
        this value is the argmin of the objective function.
      objective_value: A tensor containing the value of the objective
        function at the `position`. If the search converged, then this is
        the (local) minimum of the objective function.
      objective_gradient: A tensor containing the gradient of the objective
        function at the `position`. If the search converged the
        max-norm of this tensor should be below the tolerance.
      position_deltas: A tensor encoding information about the latest
        changes in `position` during the algorithm execution.
      gradient_deltas: A tensor encoding information about the latest
        changes in `objective_gradient` during the algorithm execution.
  """
  if arg_6 is not None:
    raise NotImplementedError(
        'Support of initial_inverse_hessian_estimate arg not yet implemented')

  if arg_9 is None:
    arg_9 = bfgs_utils.converged_all

  with tf.compat.v1.name_scope(arg_10, 'Func', [arg_1, arg_3]):
    arg_1 = tf.convert_to_tensor(
        value=arg_1, arg_10='initial_position')
    arg_11 = arg_1.dtype.base_dtype
    arg_3 = tf.convert_to_tensor(
        value=arg_3, arg_11=arg_11, arg_10='grad_tolerance')
    arg_5 = tf.convert_to_tensor(
        value=arg_5, arg_11=arg_11, arg_10='f_relative_tolerance')
    arg_4 = tf.convert_to_tensor(
        value=arg_4, arg_11=arg_11, arg_10='x_tolerance')
    arg_7 = tf.convert_to_tensor(
        value=arg_7, arg_10='max_iterations')

    # The `state` here is a `LBfgsOptimizerResults` tuple with values for the
    # current state of the algorithm computation.
    def _cond(arg_12):
      """Continue if iterations remain and stopping condition is not met."""
      return ((arg_12.num_iterations < arg_7) &
              tf.logical_not(arg_9(arg_12.converged, arg_12.failed)))

    def _body(arg_13):
      """Main optimization loop."""
      arg_14 = _get_search_direction(arg_13)

      # TODO(b/120134934): Check if the derivative at the start point is not
      # negative, if so then reset position/gradient deltas and recompute
      # search direction.

      arg_15 = bfgs_utils.line_search_step(
          arg_13,
          arg_0, arg_14,
          arg_3, arg_5, arg_4, arg_9)

      # If not failed or converged, update the Hessian estimate.
      arg_16 = ~(arg_15.converged | arg_15.failed)
      arg_17 = bfgs_utils.update_fields(
          arg_15,
          position_deltas=_queue_push(
              arg_13.position_deltas, arg_16,
              arg_15.position - arg_13.position),
          gradient_deltas=_queue_push(
              arg_13.gradient_deltas, arg_16,
              arg_15.objective_gradient - arg_13.objective_gradient))
      return [arg_17]

    arg_18 = _get_initial_state(arg_0,
                                       arg_1,
                                       arg_2,
                                       arg_3)
    return tf.while_loop(
        cond=_cond,
        body=_body,
        loop_vars=[arg_18],
        arg_8=arg_8)[0]

Applies the L-BFGS algorithm to minimize a differentiable function.

  Performs unconstrained minimization of a differentiable function using the
  L-BFGS scheme. See [Nocedal and Wright(2006)][1] for details of the algorithm.

  ### Usage:

  The following example demonstrates the L-BFGS optimizer attempting to find the
  minimum for a simple high-dimensional quadratic objective function.

  ```python
    # A high-dimensional quadratic bowl.
    ndims = 60
    minimum = np.ones([ndims], dtype='float64')
    scales = np.arange(ndims, dtype='float64') + 1.0

    # The objective function and the gradient.
    def quadratic(x):
      value = tf.reduce_sum(scales * (x - minimum) ** 2)
      return value, tf.gradients(value, x)[0]

    start = np.arange(ndims, 0, -1, dtype='float64')
    optim_results = tfp.optimizer.lbfgs_minimize(
        quadratic, initial_position=start, num_correction_pairs=10,
        tolerance=1e-8)

    with tf.Session() as session:
      results = session.run(optim_results)
      # Check that the search converged
      assert(results.converged)
      # Check that the argmin is close to the actual value.
      np.testing.assert_allclose(results.position, minimum)
  ```

  ### References:

  [1] Jorge Nocedal, Stephen Wright. Numerical Optimization. Springer Series
      in Operations Research. pp 176-180. 2006

  http://pages.mtu.edu/~struther/Courses/OLD/Sp2013/5630/Jorge_Nocedal_Numerical_optimization_267490.pdf

  Args:
    value_and_gradients_function:  A Python callable that accepts a point as a
      real `Tensor` and returns a tuple of `Tensor`s of real dtype containing
      the value of the function and its gradient at that point. The function
      to be minimized. The input is of shape `[..., n]`, where `n` is the size
      of the domain of input points, and all others are batching dimensions.
      The first component of the return value is a real `Tensor` of matching
      shape `[...]`. The second component (the gradient) is also of shape
      `[..., n]` like the input value to the function.
    initial_position: Real `Tensor` of shape `[..., n]`. The starting point, or
      points when using batching dimensions, of the search procedure. At these
      points the function value and the gradient norm should be finite.
    num_correction_pairs: Positive integer. Specifies the maximum number of
      (position_delta, gradient_delta) correction pairs to keep as implicit
      approximation of the Hessian matrix.
    tolerance: Scalar `Tensor` of real dtype. Specifies the gradient tolerance
      for the procedure. If the supremum norm of the gradient vector is below
      this number, the algorithm is stopped.
    x_tolerance: Scalar `Tensor` of real dtype. If the absolute change in the
      position between one iteration and the next is smaller than this number,
      the algorithm is stopped.
    f_relative_tolerance: Scalar `Tensor` of real dtype. If the relative change
      in the objective value between one iteration and the next is smaller
      than this value, the algorithm is stopped.
    initial_inverse_hessian_estimate: None. Option currently not supported.
    max_iterations: Scalar positive int32 `Tensor`. The maximum number of
      iterations for L-BFGS updates.
    parallel_iterations: Positive integer. The number of iterations allowed to
      run in parallel.
    stopping_condition: (Optional) A Python function that takes as input two
      Boolean tensors of shape `[...]`, and returns a Boolean scalar tensor.
      The input tensors are `converged` and `failed`, indicating the current
      status of each respective batch member; the return value states whether
      the algorithm should stop. The default is tfp.optimizer.converged_all
      which only stops when all batch members have either converged or failed.
      An alternative is tfp.optimizer.converged_any which stops as soon as one
      batch member has converged, or when all have failed.
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'minimize' is used.

  Returns:
    optimizer_results: A namedtuple containing the following items:
      converged: Scalar boolean tensor indicating whether the minimum was
        found within tolerance.
      failed:  Scalar boolean tensor indicating whether a line search
        step failed to find a suitable step size satisfying Wolfe
        conditions. In the absence of any constraints on the
        number of objective evaluations permitted, this value will
        be the complement of `converged`. However, if there is
        a constraint and the search stopped due to available
        evaluations being exhausted, both `failed` and `converged`
        will be simultaneously False.
      num_objective_evaluations: The total number of objective
        evaluations performed.
      position: A tensor containing the last argument value found
        during the search. If the search converged, then
        this value is the argmin of the objective function.
      objective_value: A tensor containing the value of the objective
        function at the `position`. If the search converged, then this is
        the (local) minimum of the objective function.
      objective_gradient: A tensor containing the gradient of the objective
        function at the `position`. If the search converged the
        max-norm of this tensor should be below the tolerance.
      position_deltas: A tensor encoding information about the latest
        changes in `position` during the algorithm execution.
      gradient_deltas: A tensor encoding information about the latest
        changes in `objective_gradient` during the algorithm execution.

Applies the L - BFGS algorithm to minimize a differentiable function .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = [ ] if arg_1 . isVowel == False : arg_5 . append ( arg_1 . chr ) if arg_1 . isConsonant and ( ( arg_3 is not None and arg_3 . isConsonant ) or arg_3 is None ) : arg_5 . append ( DevanagariCharacter . _VIRAMA ) else : if arg_2 is None or arg_2 . isConsonant == False : arg_5 . append ( arg_1 . chr ) else : if arg_1 . _dependentVowel is not None : arg_5 . append ( arg_1 . _dependentVowel ) return arg_5

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Transliterate a Latin character equivalent to Devanagari.

        Add VIRAMA for ligatures.
        Convert standalone to dependent vowels.

        """
        arg_5 = []
        if arg_1.isVowel == False:
            arg_5.append(arg_1.chr)
            if arg_1.isConsonant \
            and ((arg_3 is not None and arg_3.isConsonant) \
            or arg_3 is None):
                arg_5.append(DevanagariCharacter._VIRAMA)
        else:
            if arg_2 is None or arg_2.isConsonant == False:
                arg_5.append(arg_1.chr)
            else:
                if arg_1._dependentVowel is not None:
                    arg_5.append(arg_1._dependentVowel)
        return arg_5

Transliterate a Latin character equivalent to Devanagari . Add VIRAMA for ligatures . Convert standalone to dependent vowels .


(self, node_id, port_name, data_type_id)

return IntermediateDataset(self.workspace, self, node_id, port_name, data_type_id)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return IntermediateDataset ( arg_0 . workspace , arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Get an intermediate dataset.

        Parameters
        ----------
        node_id : str
            Module node id from the experiment graph.
        port_name : str
            Output port of the module.
        data_type_id : str
            Serialization format of the raw data.
            See the azureml.DataTypeIds class for constants.

        Returns
        -------
        IntermediateDataset
            Dataset object.
            Use open(), read_as_binary(), read_as_text() or to_dataframe() on
            the dataset object to get its contents as a stream, bytes, str or
            pandas DataFrame.
        """
        return IntermediateDataset(arg_0.workspace, arg_0, arg_1, arg_2, arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . ones_like ( arg_1 - arg_0 ) arg_4 = tf . equal ( arg_0 , arg_1 ) arg_5 = tf . where ( arg_4 , arg_3 , arg_1 - arg_0 ) arg_6 = tf . math . betainc ( a = arg_5 , b = arg_0 + 1 , x = 1 - arg_2 ) return tf . where ( arg_4 , arg_3 , arg_6 )

def Func(arg_0, arg_1, arg_2):
  """The binomial cumulative distribution function.

  Args:
    k: floating point `Tensor`.
    n: floating point `Tensor`.
    p: floating point `Tensor`.

  Returns:
    `sum_{j=0}^k p^j (1 - p)^(n - j)`.
  """
  # Trick for getting safe backprop/gradients into n, k when
  #   betainc(a = 0, ..) = nan
  # Write:
  #   where(unsafe, safe_output, betainc(where(unsafe, safe_input, input)))
  arg_3 = tf.ones_like(arg_1 - arg_0)
  arg_4 = tf.equal(arg_0, arg_1)
  arg_5 = tf.where(arg_4, arg_3, arg_1 - arg_0)
  arg_6 = tf.math.betainc(a=arg_5, b=arg_0 + 1, x=1 - arg_2)
  return tf.where(arg_4, arg_3, arg_6)

The binomial cumulative distribution function .


def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . create_checklist ( dict ( arg_1 = arg_1 , arg_2 = arg_2 ) )

def Func(arg_0, arg_1, arg_2=None):
        '''
        Get a checklist

        Returns:
            Checklist: The checklist with the given `id`
        '''
        return arg_0.create_checklist(dict(arg_1=arg_1, arg_2=arg_2))


return (
        (
            parsed_url.scheme.lower() == 'http'
            or parsed_url.scheme.lower() == 'https'
        )
        and parsed_url.netloc
    )

def Func ( arg_0 ) : assert isinstance ( arg_0 , basestring ) arg_1 = urllib . parse . urlparse ( arg_0 ) return ( ( arg_1 . scheme . lower ( ) == 'http' or arg_1 . scheme . lower ( ) == 'https' ) and arg_1 . netloc )

def Func(arg_0):
    """Check to see if string is an validly-formatted web url."""
    assert isinstance(arg_0, basestring)
    arg_1 = urllib.parse.urlparse(arg_0)
    return (
        (
            arg_1.scheme.lower() == 'http'
            or arg_1.scheme.lower() == 'https'
        )
        and arg_1.netloc
    )

Check to see if string is an validly - formatted web url .


def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . factory . remote . callRemote ( arg_1 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Shorthand for ``callRemote``.

        This uses the factory's connection to the AMP peer.

        """
        return arg_0.factory.remote.callRemote(arg_1, **arg_2)


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : if arg_2 in arg_0 : if not isinstance ( arg_3 , dict ) : continue Func ( arg_0 [ arg_2 ] , arg_3 ) else : arg_0 [ arg_2 ] = arg_3 return arg_0

def Func(arg_0, arg_1):
    """Recusively merge the 2 dicts.

    Destructive on argument 'a'.
    """
    for arg_2, arg_3 in arg_1.items():
        if arg_2 in arg_0:
            if not isinstance(arg_3, dict):
                continue
            Func(arg_0[arg_2], arg_3)
        else:
            arg_0[arg_2] = arg_3
    return arg_0


def
Func
(
arg_0
=
arg_1
)
:
swhlab
.
ap
.
detect
(
arg_0
)
standard_groupingForInj
(
arg_0
,
200
)
for
arg_2
in
[
'freq'
,
'downslope'
]
:
swhlab
.
ap
.
plot_values
(
arg_0
,
arg_2
,
continuous
=
False
)
swhlab
.
plot
.
save
(
arg_0
,
tag
=
'A_'
+
arg_2
)
arg_3
=
swhlab
.
ap
.
getAvgBySweep
(
arg_0
,
'freq'
,
,
1
)
arg_4
=
swhlab
.
ap
.
getAvgBySweep
(
arg_0
,
'freq'
,
1
,
)
arg_3
=
np
.
nan_to_num
(
arg_3
)
arg_4
=
np
.
nan_to_num
(
arg_4
)
arg_5
=
arg_0
.
clampValues
(
arg_0
.
dataX
[
int
(
arg_0
.
protoSeqX
[
1
]
+
.01
)
]
)
swhlab
.
plot
.
new
(
arg_0
,
title
=
"gain function"
,
xlabel
=
"command current (pA)"
,
ylabel
=
"average inst. freq. (Hz)"
)
pylab
.
plot
(
arg_5
,
arg_3
,
'.-'
,
ms
=
20
,
alpha
=
.5
,
label
=
"step 1"
,
color
=
'b'
)
pylab
.
plot
(
arg_5
,
arg_4
,
'.-'
,
ms
=
20
,
alpha
=
.5
,
label
=
"step 2"
,
color
=
'r'
)
pylab
.
legend
(
loc
=
'upper left'
)
pylab
.
axis
(
[
arg_5
[
0
]
,
arg_5
[
1
]
,
,
]
)
swhlab
.
plot
.
save
(
arg_0
,
tag
=
'gain'
)

def Func(arg_0=arg_1):
    """IC steps. See how hyperpol. step affects things."""
    swhlab.ap.detect(arg_0)
    standard_groupingForInj(arg_0,200)

    for arg_2 in ['freq','downslope']:
        swhlab.ap.plot_values(arg_0,arg_2,continuous=False) #plot AP info
        swhlab.plot.save(arg_0,tag='A_'+arg_2)

    arg_3=swhlab.ap.getAvgBySweep(arg_0,'freq',None,1)
    arg_4=swhlab.ap.getAvgBySweep(arg_0,'freq',1,None)
    arg_3=np.nan_to_num(arg_3)
    arg_4=np.nan_to_num(arg_4)
    arg_5=arg_0.clampValues(arg_0.dataX[int(arg_0.protoSeqX[1]+.01)])
    swhlab.plot.new(arg_0,title="gain function",xlabel="command current (pA)",
                    ylabel="average inst. freq. (Hz)")
    pylab.plot(arg_5,arg_3,'.-',ms=20,alpha=.5,label="step 1",color='b')
    pylab.plot(arg_5,arg_4,'.-',ms=20,alpha=.5,label="step 2",color='r')
    pylab.legend(loc='upper left')
    pylab.axis([arg_5[0],arg_5[-1],None,None])
    swhlab.plot.save(arg_0,tag='gain')

IC steps . See how hyperpol . step affects things .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
if
arg_0
.
_hsObj
.
_speculativeParticles
:
arg_3
=
arg_0
.
genIdx
else
:
arg_3
=
arg_0
.
genIdx
1
if
arg_3
>=
0
:
(
arg_4
,
arg_5
)
=
arg_0
.
_resultsDB
.
bestModelIdAndErrScore
(
arg_0
.
swarmId
,
arg_3
)
if
arg_4
is
not
:
(
arg_6
,
arg_5
,
arg_5
,
arg_5
,
arg_5
)
=
arg_0
.
_resultsDB
.
getParticleInfo
(
arg_4
)
arg_2
=
Particle
.
getPositionFromState
(
arg_6
)
for
(
arg_7
,
arg_8
)
in
arg_0
.
permuteVars
.
iteritems
(
)
:
if
arg_1
is
not
and
arg_7
not
in
arg_1
:
continue
if
arg_2
is
:
arg_8
.
Func
(
,
arg_0
.
_rng
)
else
:
arg_8
.
Func
(
arg_2
[
arg_7
]
,
arg_0
.
_rng
)
arg_9
=
arg_0
.
getPosition
(
)
if
arg_0
.
logger
.
getEffectiveLevel
(
)
<=
logging
.
DEBUG
:
arg_10
=
StringIO
.
StringIO
(
)
print
>>
arg_10
,
"New particle position: \n%s"
%
(
pprint
.
pformat
(
arg_9
,
indent
=
4
)
)
print
>>
arg_10
,
"Particle variables:"
for
(
arg_7
,
arg_8
)
in
arg_0
.
permuteVars
.
iteritems
(
)
:
print
>>
arg_10
,
"  %s: %s"
%
(
arg_7
,
str
(
arg_8
)
)
arg_0
.
logger
.
debug
(
arg_10
.
getvalue
(
)
)
arg_10
.
close
(
)
return
arg_9

def Func(arg_0, arg_1=None):
    # TODO: incorporate data from choice variables....
    # TODO: make sure we're calling this when appropriate.
    """Choose a new position based on results obtained so far from all other
    particles.

    Parameters:
    --------------------------------------------------------------
    whichVars:       If not None, only move these variables
    retval:               new position
    """
    # Get the global best position for this swarm generation
    arg_2 = None
    # If speculative particles are enabled, use the global best considering
    #  even particles in the current generation. This gives better results
    #  but does not provide repeatable results because it depends on
    #  worker timing
    if arg_0._hsObj._speculativeParticles:
      arg_3 = arg_0.genIdx
    else:
      arg_3 = arg_0.genIdx - 1

    if arg_3 >= 0:
      (arg_4, arg_5) = arg_0._resultsDB.bestModelIdAndErrScore(arg_0.swarmId,
                                                                arg_3)
      if arg_4 is not None:
        (arg_6, arg_5, arg_5, arg_5, arg_5) = arg_0._resultsDB.getParticleInfo(
          arg_4)
        arg_2 = Particle.getPositionFromState(arg_6)

    # Update each variable
    for (arg_7, arg_8) in arg_0.permuteVars.iteritems():
      if arg_1 is not None and arg_7 not in arg_1:
        continue
      if arg_2 is None:
        arg_8.Func(None, arg_0._rng)
      else:
        arg_8.Func(arg_2[arg_7], arg_0._rng)

    # get the new position
    arg_9 = arg_0.getPosition()

    # Log the new position
    if arg_0.logger.getEffectiveLevel() <= logging.DEBUG:
      arg_10 = StringIO.StringIO()
      print >> arg_10, "New particle position: \n%s" % (pprint.pformat(arg_9,
                                                                    indent=4))
      print >> arg_10, "Particle variables:"
      for (arg_7, arg_8) in arg_0.permuteVars.iteritems():
        print >> arg_10, "  %s: %s" % (arg_7, str(arg_8))
      arg_0.logger.debug(arg_10.getvalue())
      arg_10.close()

    return arg_9

Choose a new position based on results obtained so far from all other particles .


def
Func
(
arg_0
)
:
(
arg_1
,
arg_2
)
=
mimetypes
.
guess_type
(
arg_0
)
if
not
arg_1
:
arg_3
=
os
.
path
.
splitext
(
arg_0
)
[
1
]
arg_1
=
_MIME_TYPES
.
get
(
arg_3
)
_logger
.
debug
(
"mimetype({}): {}"
.
format
(
arg_0
,
arg_1
)
)
if
not
arg_1
:
arg_1
=
"application/octet-stream"
return
arg_1

def Func(arg_0):
    """Use the mimetypes module to lookup the type for an extension.

    This function also adds some extensions required for HTML5
    """
    (arg_1, arg_2) = mimetypes.guess_type(arg_0)
    if not arg_1:
        arg_3 = os.path.splitext(arg_0)[1]
        arg_1 = _MIME_TYPES.get(arg_3)
        _logger.debug("mimetype({}): {}".format(arg_0, arg_1))
    if not arg_1:
        arg_1 = "application/octet-stream"
    return arg_1

Use the mimetypes module to lookup the type for an extension .


def Func(arg_0):
        """
        Returns a list of sites.

        http://dev.wheniwork.com/#listing-sites
        """
        arg_1 = "/2/sites"

        arg_2 = arg_0._get_resource(arg_1)
        arg_3 = []
        for arg_4 in arg_2['sites']:
            arg_3.append(arg_0.site_from_json(arg_4))

        return arg_3


def Func(arg_0):
        """ Create blueprint and register rules

        :return: Blueprint of the current nemo app
        :rtype: flask.Blueprint
        """
        arg_0.register_plugins()

        arg_0.blueprint = Blueprint(
            arg_0.name,
            "nemo",
            url_prefix=arg_0.prefix,
            template_folder=arg_0.template_folder,
            static_folder=arg_0.static_folder,
            static_url_path=arg_0.static_url_path
        )

        for arg_2, arg_3, arg_4, arg_5 in arg_0._urls:
            arg_0.blueprint.add_url_rule(
                arg_2,
                view_func=arg_0.view_maker(arg_3, arg_5),
                endpoint=_plugin_endpoint_rename(arg_3, arg_5),
                arg_4=arg_4
            )

        for arg_2, arg_3, arg_4, arg_5 in arg_0._semantic_url:
            arg_0.blueprint.add_url_rule(
                arg_2,
                view_func=arg_0.view_maker(arg_3, arg_5),
                endpoint=_plugin_endpoint_rename(arg_3, arg_5)+"_semantic",
                arg_4=arg_4
            )

        arg_0.register_assets()
        arg_0.register_filters()

        # We extend the loading list by the instance value
        arg_0.__templates_namespaces__.extend(arg_0.__instance_templates__)
        # We generate a template loader
        for arg_6, arg_7 in arg_0.__templates_namespaces__[::-1]:
            if arg_6 not in arg_0.__template_loader__:
                arg_0.__template_loader__[arg_6] = []
            arg_0.__template_loader__[arg_6].append(
                jinja2.FileSystemLoader(op.abspath(arg_7))
            )
        arg_0.blueprint.jinja_loader = jinja2.PrefixLoader(
            {arg_6: jinja2.ChoiceLoader(paths) for arg_6, paths in arg_0.__template_loader__.items()},
            "::"
        )

        if arg_0.cache is not None:
            for arg_10, arg_5 in arg_0.cached:
                setattr(arg_5, arg_10.__name__, arg_0.cache.memoize()(arg_10))

        return arg_0.blueprint


def Func(arg_0, arg_1='1'):
        """workhorse for the self.do_run_xx methods."""
        for arg_2 in range(len(arg_0.particle_groups)):
            arg_3 = arg_0.particle_groups[arg_2]
            arg_4 = LMParticles(arg_0.state, arg_3, **arg_0._kwargs)
            if arg_1 == 'internal':
                arg_4.J, arg_4.JTJ, arg_4._dif_tile = arg_0._load_j_diftile(arg_2)

            if arg_1 == '1':
                arg_4.do_run_1()
            if arg_1 == '2':
                arg_4.do_run_2()
            if arg_1 == 'internal':
                arg_4.do_internal_run()

            arg_0.stats.append(arg_4.get_termination_stats(get_cos=arg_0.get_cos))
            if arg_0.save_J and (arg_1 != 'internal'):
                arg_0._dump_j_diftile(arg_2, arg_4.J, arg_4._dif_tile)
                arg_0._has_saved_J[arg_2] = True

workhorse for the self . do_run_xx methods .


def Func ( arg_0 , arg_1 ) : if ( arg_1 . is_leaf ( ) or arg_1 . is_root ( ) ) : return 0 else : if len ( arg_1 . children ) > 2 : arg_2 = arg_1 . children [ 0 ] arg_3 = arg_1 . children [ 1 ] for arg_4 in arg_1 . children [ 2 : ] : arg_3 += arg_4 else : arg_2 , arg_3 = arg_1 . children arg_5 = sum ( 1 for i in arg_2 . iter_leaves ( ) ) arg_6 = sum ( 1 for i in arg_3 . iter_leaves ( ) ) arg_7 = arg_1 . get_sisters ( ) [ 0 ] arg_8 = sum ( 1 for i in arg_7 . iter_leaves ( ) ) arg_9 = arg_0 - ( arg_5 + arg_6 + arg_8 ) return arg_5 * arg_6 * arg_8 * arg_9

def Func(arg_0, arg_1):
    """ get total number of quartets possible for a split"""
    if (arg_1.is_leaf() or arg_1.is_root()):
        return 0
    else:
        ## Get counts on down edges.
        ## How to treat polytomies here?
        if len(arg_1.children) > 2:
            arg_2 = arg_1.children[0]
            arg_3 = arg_1.children[1]
            for arg_4 in arg_1.children[2:]:
                arg_3 += arg_4
        else:
            arg_2, arg_3 = arg_1.children
        arg_5 = sum(1 for i in arg_2.iter_leaves())
        arg_6 = sum(1 for i in arg_3.iter_leaves())

        ## get count on up edge sister
        arg_7 = arg_1.get_sisters()[0]
        arg_8 = sum(1 for i in arg_7.iter_leaves())

        ## everyone else
        arg_9 = arg_0 - (arg_5 + arg_6 + arg_8)

        ## return product
        return arg_5 * arg_6 * arg_8 * arg_9


def Func ( arg_0 ) : arg_1 = itertools . groupby ( arg_0 , operator . itemgetter ( 0 ) ) for arg_2 , arg_3 in arg_1 : yield arg_2 , max ( arg_4 [ 1 ] for arg_4 in arg_3 ) + 1

def Func(arg_0):
    """Get the number and size of unique registers from bit_labels list.

    Args:
        bit_labels (list): this list is of the form::

            [['reg1', 0], ['reg1', 1], ['reg2', 0]]

            which indicates a register named "reg1" of size 2
            and a register named "reg2" of size 1. This is the
            format of classic and quantum bit labels in qobj
            header.

    Yields:
        tuple: iterator of register_name:size pairs.
    """
    arg_1 = itertools.groupby(arg_0, operator.itemgetter(0))
    for arg_2, arg_3 in arg_1:
        yield arg_2, max(arg_4[1] for arg_4 in arg_3) + 1

Get the number and size of unique registers from bit_labels list .


def Func(arg_0, arg_1):
        """
        Set throttle Func

        :param value: bytes per second
        :type value: :py:class:`int` or :py:class:`None`
        """
        arg_0._Func = arg_1
        arg_0._start = None
        arg_0._sum = 0

Set throttle limit

        :param value: bytes per second
        :type value: :py:class:`int` or :py:class:`None`


def Func ( arg_0 ) : arg_1 = 1 if 'start' in arg_0 : arg_1 = int ( arg_0 [ 'start' ] ) def generator ( ) : arg_2 = arg_1 while ( True ) : yield arg_2 arg_2 = arg_2 * 2 return generator ( )

def Func(arg_0):
    """ Returns generators that double with each value returned
        Config includes optional start value """
    arg_1 = 1
    if 'start' in arg_0:
        arg_1 = int(arg_0['start'])

    # We cannot simply use start as the variable, because of scoping
    # limitations
    def generator():
        arg_2 = arg_1
        while(True):
            yield arg_2
            arg_2 = arg_2 * 2
    return generator()


def Func(arg_0, arg_1, arg_2):
        """This function is called whenever there is a message received from the server"""
        arg_2 = json.loads(arg_2)
        logging.debug("ConnectorDB:WS: Msg '%s'", arg_2["stream"])

        # Build the subcription key
        arg_3 = arg_2["stream"] + ":"
        if "transform" in arg_2:
            arg_3 += arg_2["transform"]

        arg_0.subscription_lock.acquire()
        if arg_3 in arg_0.subscriptions:
            arg_4 = arg_0.subscriptions[arg_3]
            arg_0.subscription_lock.release()

            arg_5 = arg_4(arg_2["stream"], arg_2["data"])

            if arg_5 is True:
                # This is a special result - if the subscription function of a downlink returns True,
                # then the datapoint is acknowledged automatically (ie, reinserted in non-downlink stream)
                arg_5 = arg_2["data"]

            if arg_5 is not False and arg_5 is not None and arg_2["stream"].endswith(
                    "/downlink") and arg_2["stream"].count("/") == 3:
                # If the above conditions are true, it means that the datapoints were from a downlink,
                # and the subscriber function chooses to acknowledge them, so we reinsert them.
                arg_0.insert(arg_2["stream"][:-9], arg_5)
        else:
            arg_0.subscription_lock.release()
            logging.warn(
                "ConnectorDB:WS: Msg '%s' not subscribed! Subscriptions: %s",
                arg_2["stream"], list(arg_0.subscriptions.keys()))


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = 0.5 * ( arg_1 + arg_2 ) if arg_0 . method : if arg_0 . test_method_validity ( arg_3 , arg_0 . method ) : try : return arg_0 . calculate_integral ( arg_1 , arg_2 , arg_0 . method ) except : pass arg_4 = arg_0 . select_valid_methods ( arg_3 ) for arg_5 in arg_4 : try : return arg_0 . calculate_integral ( arg_1 , arg_2 , arg_5 ) except : pass return None

def Func(arg_0, arg_1, arg_2):
        r'''Method to calculate the integral of a property with respect to
        temperature, using a specified method. Methods found valid by
        `select_valid_methods` are attempted until a method succeeds. If no
        methods are valid and succeed, None is returned.

        Calls `calculate_integral` internally to perform the actual
        calculation.

        .. math::
            \text{integral} = \int_{T_1}^{T_2} \text{property} \; dT

        Parameters
        ----------
        T1 : float
            Lower limit of integration, [K]
        T2 : float
            Upper limit of integration, [K]
        method : str
            Method for which to find the integral

        Returns
        -------
        integral : float
            Calculated integral of the property over the given range,
            [`units*K`]
        '''
        arg_3 = 0.5*(arg_1+arg_2)
        if arg_0.method:
            # retest within range
            if arg_0.test_method_validity(arg_3, arg_0.method):
                try:
                    return arg_0.calculate_integral(arg_1, arg_2, arg_0.method)
                except:  # pragma: no cover
                    pass

        arg_4 = arg_0.select_valid_methods(arg_3)
        for arg_5 in arg_4:
            try:
                return arg_0.calculate_integral(arg_1, arg_2, arg_5)
            except:
                pass
        return None

r Method to calculate the integral of a property with respect to temperature using a specified method . Methods found valid by select_valid_methods are attempted until a method succeeds . If no methods are valid and succeed None is returned . Calls calculate_integral internally to perform the actual calculation .


(self, sql_string, database_name=None, collection_name=None, partition_key=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
if
arg_1
is
:
raise
AirflowBadRequest
(
"SQL query string cannot be None"
)
arg_5
=
{
'query'
:
arg_1
}
try
:
arg_6
=
arg_0
.
get_conn
(
)
.
QueryItems
(
get_collection_link
(
arg_0
.
__get_database_name
(
arg_2
)
,
arg_0
.
__get_collection_name
(
arg_3
)
)
,
arg_5
,
arg_4
)
return
list
(
arg_6
)
except
HTTPFailure
:
return

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Get a list of documents from an existing collection in the CosmosDB database via SQL query.
        """
        if arg_1 is None:
            raise AirflowBadRequest("SQL query string cannot be None")

        # Query them in SQL
        arg_5 = {'query': arg_1}

        try:
            arg_6 = arg_0.get_conn().QueryItems(
                get_collection_link(
                    arg_0.__get_database_name(arg_2),
                    arg_0.__get_collection_name(arg_3)),
                arg_5,
                arg_4)

            return list(arg_6)
        except HTTPFailure:
            return None

Get a list of documents from an existing collection in the CosmosDB database via SQL query .


def Func ( arg_0 ) : if arg_0 . _engine : arg_0 . _engine . repl . terminate ( ) arg_1 = arg_0 . _executable if arg_1 : arg_2 . environ [ 'OCTAVE_EXECUTABLE' ] = arg_1 if 'OCTAVE_EXECUTABLE' not in arg_2 . environ and 'OCTAVE' in arg_2 . environ : arg_2 . environ [ 'OCTAVE_EXECUTABLE' ] = arg_2 . environ [ 'OCTAVE' ] arg_0 . _engine = OctaveEngine ( stdin_handler = arg_0 . _handle_stdin , logger = arg_0 . logger ) arg_0 . _engine . eval ( 'addpath("%s");' % HERE . replace ( osp . sep , '/' ) )

def Func(arg_0):
        """Restart an Octave session in a clean state
        """
        if arg_0._engine:
            arg_0._engine.repl.terminate()

        arg_1 = arg_0._executable
        if arg_1:
            arg_2.environ['OCTAVE_EXECUTABLE'] = arg_1
        if 'OCTAVE_EXECUTABLE' not in arg_2.environ and 'OCTAVE' in arg_2.environ:
            arg_2.environ['OCTAVE_EXECUTABLE'] = arg_2.environ['OCTAVE']

        arg_0._engine = OctaveEngine(stdin_handler=arg_0._handle_stdin,
                                    logger=arg_0.logger)

        # Add local Octave scripts.
        arg_0._engine.eval('addpath("%s");' % HERE.replace(osp.sep, '/'))


def Func ( arg_0 ) : arg_1 = json . JSONDecoder ( object_pairs_hook = _decode_object_pairs ) return arg_1 . decode ( arg_0 )

def Func(arg_0):
    """Decode a JSON-LD dataset, including decoding datetime
    strings into `datetime.datetime` objects.

    Parameters
    ----------
    encoded_dataset : `str`
        The JSON-LD dataset encoded as a string.

    Returns
    -------
    jsonld_dataset : `dict`
        A JSON-LD dataset.

    Examples
    --------

    >>> doc = '{"dt": "2018-01-01T12:00:00Z"}'
    >>> Func(doc)
    {'dt': datetime.datetime(2018, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)}
    """
    arg_1 = json.JSONDecoder(object_pairs_hook=_decode_object_pairs)
    return arg_1.decode(arg_0)

Decode a JSON-LD dataset, including decoding datetime
    strings into `datetime.datetime` objects.

    Parameters
    ----------
    encoded_dataset : `str`
        The JSON-LD dataset encoded as a string.

    Returns
    -------
    jsonld_dataset : `dict`
        A JSON-LD dataset.

    Examples
    --------

    >>> doc = '{"dt": "2018-01-01T12:00:00Z"}'
    >>> decode_jsonld(doc)
    {'dt': datetime.datetime(2018, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)}

Decode a JSON - LD dataset including decoding datetime strings into datetime . datetime objects .


def Func(arg_0, arg_1, arg_2):
        """Workaround to get timeout in the ATMT.timeout class method."""
        arg_1 = STATES2NAMES[arg_1]
        for arg_3 in arg_0.timeout[arg_1]:
            # access the function name
            if arg_3[1] is not None and \
               arg_3[1].atmt_condname == arg_2.atmt_condname:
                logger.debug('Timeout for state %s, function %s, is %s',
                             arg_1, arg_2.atmt_condname, arg_3[0])
                return arg_3[0]
        return None

Workaround to get timeout in the ATMT . timeout class method .


def Func ( arg_0 , arg_1 ) : if ( len ( arg_1 ) > 1 and arg_1 [ - 1 ] == arg_1 [ - 2 ] and arg_1 [ - 1 ] in { 'd' , 'k' , 't' } ) : return arg_1 [ : - 1 ] return arg_1

def Func(arg_0, arg_1):
        """Undouble endings -kk, -dd, and -tt.

        Parameters
        ----------
        word : str
          The word to stem

        Returns
        -------
        str
            The word with doubled endings undoubled

        """
        if (
            len(arg_1) > 1
            and arg_1[-1] == arg_1[-2]
            and arg_1[-1] in {'d', 'k', 't'}
        ):
            return arg_1[:-1]
        return arg_1


def Func ( arg_0 , arg_1 = 0.1 ) : try : arg_2 = arg_0 . exc_queue . get ( True , arg_1 ) [ 1 ] except Queue . Empty : return arg_3 , arg_4 , arg_5 = arg_2 raise arg_3 , arg_4 , arg_5

def Func(arg_0, arg_1 = 0.1):
        """Wait up to `timeout` seconds, raise any exception from the
        threads.
        """
        try:
            arg_2 = arg_0.exc_queue.get(True, arg_1)[1]
        except Queue.Empty:
            return
        arg_3, arg_4, arg_5 = arg_2
        raise arg_3, arg_4, arg_5

Wait up to timeout seconds raise any exception from the threads .


def Func ( arg_0 ) : for arg_1 in range ( len ( arg_0 . stack ) , 0 , - 1 ) : arg_2 = arg_0 . stack [ arg_1 - 1 ] if isinstance ( arg_2 , _ClassInfo ) : return arg_2 return None

def Func(arg_0):
    """Get class info on the top of the stack.

    Returns:
      A _ClassInfo object if we are inside a class, or None otherwise.
    """
    for arg_1 in range(len(arg_0.stack), 0, -1):
      arg_2 = arg_0.stack[arg_1 - 1]
      if isinstance(arg_2, _ClassInfo):
        return arg_2
    return None

Get class info on the top of the stack .


def Func ( arg_0 , arg_1 ) : global g_before_java_file global g_java_filenames global g_build_id_text global arg_6 global g_output_filename global g_output_pickle_filename if g_build_id_text in arg_0 : [ arg_2 , arg_3 , arg_4 ] = arg_0 . partition ( g_build_id_text ) arg_5 [ "2.build_id" ] = arg_4 . strip ( ) arg_1 . remove ( Func ) arg_6 = os . path . join ( 'http://' , arg_6 , 'view' , g_view_name , 'job' , arg_5 [ "1.jobName" ] , arg_5 [ "2.build_id" ] , 'artifact' ) return True

def Func(arg_0,arg_1):
    """
    Find the build id of a jenkins job.  It will save this
    information in g_failed_test_info_dict.  In addition, it will delete this particular
    function handle off the temp_func_list as we do not need to perform this action again.

    Parameters
    ----------

    each_line :  str
        contains a line read in from jenkins console
    temp_func_list :  list of Python function handles
        contains a list of functions that we want to invoke to extract information from
        the Jenkins console text.

    :return: bool to determine if text mining should continue on the jenkins console text
    """
    global g_before_java_file
    global g_java_filenames
    global g_build_id_text
    global arg_6
    global g_output_filename
    global g_output_pickle_filename

    if g_build_id_text in arg_0:
        [arg_2,arg_3,arg_4] = arg_0.partition(g_build_id_text)
        arg_5["2.build_id"] = arg_4.strip()

        arg_1.remove(Func)
        arg_6 = os.path.join('http://',arg_6,'view',g_view_name,'job',arg_5["1.jobName"],arg_5["2.build_id"],'artifact')

    return True

Find the build id of a jenkins job . It will save this information in g_failed_test_info_dict . In addition it will delete this particular function handle off the temp_func_list as we do not need to perform this action again .


def Func ( arg_0 ) : arg_1 = arg_0 . _instruction . get ( GRID_LAYOUT ) if arg_1 is not None : arg_2 = arg_1 . get ( WIDTH ) if arg_2 is not None : return arg_2 return arg_0 . _instruction . number_of_consumed_meshes

def Func(arg_0):
        """For ``self.width``."""
        arg_1 = arg_0._instruction.get(GRID_LAYOUT)
        if arg_1 is not None:
            arg_2 = arg_1.get(WIDTH)
            if arg_2 is not None:
                return arg_2
        return arg_0._instruction.number_of_consumed_meshes


return ndims_fn() if ndims_ is None else ndims_

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_2 = ( arg_0 ( ) if callable ( arg_0 ) else arg_0 ) if ( hasattr ( arg_2 , 'shape' ) and hasattr ( arg_2 . shape , 'num_elements' ) ) : arg_3 = tensorshape_util . num_elements ( arg_2 . shape ) else : arg_3 = len ( arg_2 ) arg_4 = lambda : tf . size ( input = arg_2 ) else : arg_3 = tensorshape_util . rank ( arg_1 ) arg_4 = lambda : tf . size ( input = arg_0 ( ) if callable ( arg_0 ) else arg_0 ) return arg_4 ( ) if arg_3 is None else arg_3

def Func(arg_0, arg_1=None):
  """Computes `rank` given a `Tensor`'s `shape`."""

  if arg_1 is None:
    arg_2 = (arg_0() if callable(arg_0)
                    else arg_0)
    if (hasattr(arg_2, 'shape') and
        hasattr(arg_2.shape, 'num_elements')):
      arg_3 = tensorshape_util.num_elements(arg_2.shape)
    else:
      arg_3 = len(arg_2)
    arg_4 = lambda: tf.size(input=arg_2)
  else:
    arg_3 = tensorshape_util.rank(arg_1)
    arg_4 = lambda: tf.size(input=arg_0()  # pylint: disable=g-long-lambda
                               if callable(arg_0)
                               else arg_0)
  return arg_4() if arg_3 is None else arg_3


(self, base=None, crt=None, csr=None, key=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Confirms the key, CSR, and certificate files all match.
        """
        from burlap.common import get_verbose, print_fail, print_success

        arg_5 = arg_0.local_renderer

        if arg_1:
            arg_2 = arg_1 + '.crt'
            arg_3 = arg_1 + '.csr'
            arg_4 = arg_1 + '.key'
        else:
            assert arg_2 and arg_3 and arg_4, 'If base not provided, crt and csr and key must be given.'

        assert os.path.isfile(arg_2)
        assert os.path.isfile(arg_3)
        assert os.path.isfile(arg_4)

        arg_6 = arg_5.local('openssl req -noout -modulus -in %s | openssl md5' % arg_3, capture=True)
        arg_7 = arg_5.local('openssl rsa -noout -modulus -in %s | openssl md5' % arg_4, capture=True)
        arg_8 = arg_5.local('openssl x509 -noout -modulus -in %s | openssl md5' % arg_2, capture=True)

        arg_9 = arg_8 == arg_6 == arg_7

        if arg_0.verbose or not arg_9:
            print('crt:', arg_8)
            print('csr:', arg_6)
            print('key:', arg_7)

        if arg_9:
            print_success('Files look good!')
        else:
            print_fail('Files no not match!')
            raise Exception('Files no not match!')

Confirms the key CSR and certificate files all match .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = _get_argspec ( arg_0 ) if arg_3 : return arg_1 . copy ( ) else : arg_4 = dict ( ( k , arg_1 [ k ] ) for k in arg_2 if k in arg_1 ) return arg_4

def Func(arg_0, arg_1):
    """Takes a function and keyword arguments and returns the ones that can be passed."""
    arg_2, arg_3 = _get_argspec(arg_0)
    if arg_3:
        return arg_1.copy()
    else:
        arg_4 = dict((k, arg_1[k]) for k in arg_2 if k in arg_1)
        return arg_4

Takes a function and keyword arguments and returns the ones that can be passed .


def Func(arg_0):
    '''Parse arguments from the command line'''
    arg_1 = argparse.ArgumentParser(description='Convert JAMS to .lab files')

    arg_1.add_argument('-c',
                        '--comma-separated',
                        dest='csv',
                        action='store_true',
                        default=False,
                        help='Output in .csv instead of .lab')

    arg_1.add_argument('--comment', dest='comment_char', type=str, default='#',
                        help='Comment character')

    arg_1.add_argument('-n',
                        '--namespace',
                        dest='namespaces',
                        nargs='+',
                        default=['.*'],
                        help='One or more namespaces to output.  Default is all.')

    arg_1.add_argument('jams_file',
                        help='Path to the input jams file')

    arg_1.add_argument('output_prefix', help='Prefix for output files')

    return vars(arg_1.parse_args(arg_0))


def
Func
(
arg_0
)
:
arg_1
=
h2o
.
api
(
"GET /3/Jobs"
)
arg_2
=
[
[
"type"
]
,
[
"dest"
]
,
[
"description"
]
,
[
"status"
]
]
for
arg_3
in
arg_1
[
"jobs"
]
:
arg_4
=
arg_3
[
"dest"
]
arg_2
[
0
]
.
append
(
arg_0
.
_translate_job_type
(
arg_4
[
"type"
]
)
)
arg_2
[
1
]
.
append
(
arg_4
[
"name"
]
)
arg_2
[
2
]
.
append
(
arg_3
[
"description"
]
)
arg_2
[
3
]
.
append
(
arg_3
[
"status"
]
)
return
arg_2

def Func(arg_0):
        """List all jobs performed by the cluster."""
        arg_1 = h2o.api("GET /3/Jobs")
        arg_2 = [["type"], ["dest"], ["description"], ["status"]]
        for arg_3 in arg_1["jobs"]:
            arg_4 = arg_3["dest"]
            arg_2[0].append(arg_0._translate_job_type(arg_4["type"]))
            arg_2[1].append(arg_4["name"])
            arg_2[2].append(arg_3["description"])
            arg_2[3].append(arg_3["status"])
        return arg_2

List all jobs performed by the cluster .


def Func ( arg_0 ) : ClientStream . Func ( arg_0 ) if not arg_0 . initiator : arg_0 . unset_iq_get_handler ( "query" , "jabber:iq:auth" ) arg_0 . unset_iq_set_handler ( "query" , "jabber:iq:auth" )

def Func(arg_0):
        """Unregister legacy authentication handlers after successfull
        authentication."""
        ClientStream.Func(arg_0)
        if not arg_0.initiator:
            arg_0.unset_iq_get_handler("query","jabber:iq:auth")
            arg_0.unset_iq_set_handler("query","jabber:iq:auth")

Unregister legacy authentication handlers after successfull authentication .


def Func ( arg_0 , ** arg_1 ) : arg_2 = regularizers . from_kwargs ( arg_0 , ** arg_1 ) arg_3 , Func = arg_0 . build_graph ( arg_2 ) return Func

def Func(arg_0, **arg_1):
        '''Return expressions to run as updates during network training.

        Returns
        -------
        updates : list of (parameter, expression) pairs
            A list of named parameter update expressions for this network.
        '''
        arg_2 = regularizers.from_kwargs(arg_0, **arg_1)
        arg_3, Func = arg_0.build_graph(arg_2)
        return Func

Return expressions to run as updates during network training .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = utils . BytearrayStream ( ) if arg_0 . _asynchronous_correlation_value : arg_0 . _asynchronous_correlation_value . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( CancelRequestPayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_6 . buffer )

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

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

        Raises:
            ValueError: Raised if the data attribute is not defined.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._asynchronous_correlation_value:
            arg_0._asynchronous_correlation_value.Func(
                arg_6,
                arg_2=arg_2
            )

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

Write the data encoding the Cancel request payload to a stream.

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

        Raises:
            ValueError: Raised if the data attribute is not defined.

Write the data encoding the Cancel request payload to a stream .


def Func ( ) : arg_0 = [ ] arg_1 = os . environ . get ( "HOME" , "" ) if arg_1 : arg_2 = os . path . join ( arg_1 , RCFILE ) try : arg_0 = open ( arg_2 ) . read ( ) . split ( ) except IOError : pass return arg_0

def Func():
    """
    Read config file and return list of options
    """
    arg_0 = []
    arg_1 = os.environ.get("HOME", "")
    if arg_1:
        arg_2 = os.path.join(arg_1, RCFILE)
        try:
            arg_0 = open(arg_2).read().split()
        except IOError:
            pass  # ignore if no config file found
    return arg_0


return ListReport("Sales and Payments Summary", headings, data)

def Func():
    ''' Summarises paid items and payments. '''

    def value_or_zero(arg_0, arg_1):
        return arg_0[arg_1] or 0

    def sum_amount(arg_2):
        arg_3 = arg_2.values("amount").aggregate(total=Sum("amount"))
        return value_or_zero(arg_3, "total")

    arg_4 = ["Category", "Total"]
    arg_5 = []

    # Summarise all sales made (= income.)
    arg_6 = commerce.LineItem.objects.filter(
        invoice__status=commerce.Invoice.STATUS_PAID,
    ).values(
        "price", "quantity"
    ).aggregate(
        total=Sum(F("price") * F("quantity"), output_field=CURRENCY()),
    )
    arg_6 = value_or_zero(arg_6, "total")

    arg_7 = sum_amount(commerce.PaymentBase.objects.all())

    # Manual payments
    # Credit notes generated (total)
    # Payments made by credit note
    # Claimed credit notes

    arg_8 = 0 - sum_amount(commerce.CreditNote.objects.all())
    arg_9 = 0 - sum_amount(commerce.CreditNote.unclaimed())
    arg_10 = sum_amount(
        commerce.CreditNoteApplication.objects.all()
    )
    arg_11 = 0 - sum_amount(commerce.CreditNote.refunded())

    arg_5.append(["Items on paid invoices", arg_6])
    arg_5.append(["All payments", arg_7])
    arg_5.append(["Sales - Payments ", arg_6 - arg_7])
    arg_5.append(["All credit notes", arg_8])
    arg_5.append(["Credit notes paid on invoices", arg_10])
    arg_5.append(["Credit notes refunded", arg_11])
    arg_5.append(["Unclaimed credit notes", arg_9])
    arg_5.append([
        "Credit notes - (claimed credit notes + unclaimed credit notes)",
        arg_8 - arg_10 -
        arg_11 - arg_9
        ])

    return ListReport("Sales and Payments Summary", arg_4, arg_5)


def Func ( ) : with closing ( _apns_create_socket_to_feedback ( ) ) as socket : arg_0 = [ ] for arg_1 , arg_2 in _apns_receive_feedback ( socket ) : arg_0 . append ( codecs . encode ( arg_2 , 'hex_codec' ) ) return arg_0

def Func():
    """
    Queries the APNS server for id's that are no longer active since
    the last fetch
    """
    with closing(_apns_create_socket_to_feedback()) as socket:
        arg_0 = []

        for arg_1, arg_2 in _apns_receive_feedback(socket):
            arg_0.append(codecs.encode(arg_2, 'hex_codec'))

        return arg_0

Queries the APNS server for id s that are no longer active since the last fetch


def
Func
(
arg_0
,
arg_1
)
:
Func
=
if
arg_1
in
arg_0
.
_users
:
return
arg_0
.
_users
[
arg_1
]
arg_3
=
arg_0
.
__get_url
(
"~"
+
arg_1
)
logger
.
info
(
"Getting info for %s"
%
(
arg_3
)
)
try
:
arg_4
=
arg_0
.
__send_request
(
arg_3
)
Func
=
arg_4
except
requests
.
exceptions
.
HTTPError
as
e
:
if
e
.
response
.
status_code
in
[
404
,
410
]
:
logger
.
warning
(
"Data is not available - %s"
,
arg_3
)
Func
=
'{}'
else
:
raise
e
arg_0
.
_users
[
arg_1
]
=
Func
return
Func

def Func(arg_0, arg_1):
        """Get the user data by URL"""

        Func = None

        if arg_1 in arg_0._users:
            return arg_0._users[arg_1]

        arg_3 = arg_0.__get_url("~" + arg_1)

        logger.info("Getting info for %s" % (arg_3))

        try:
            arg_4 = arg_0.__send_request(arg_3)
            Func = arg_4
        except requests.exceptions.HTTPError as e:
            if e.response.status_code in [404, 410]:
                logger.warning("Data is not available - %s", arg_3)
                Func = '{}'
            else:
                raise e

        arg_0._users[arg_1] = Func

        return Func


def Func ( arg_0 = 'cloudaux' ) : arg_1 = '0.0.1' try : import pkg_resources arg_1 = pkg_resources . get_distribution ( arg_0 ) . version except pkg_resources . DistributionNotFound : pass except ImportError : pass return 'cloudaux/%s' % ( arg_1 )

def Func(arg_0='cloudaux'):
    """
    Get default User Agent String.

    Try to import pkg_name to get an accurate version number.

    return: string
    """
    arg_1 = '0.0.1'
    try:
        import pkg_resources
        arg_1 = pkg_resources.get_distribution(arg_0).version
    except pkg_resources.DistributionNotFound:
        pass
    except ImportError:
        pass

    return 'cloudaux/%s' % (arg_1)


def Func ( arg_0 ) : arg_1 = arg_0 . status ( ) if arg_1 [ 'power' ] : arg_0 . _send ( arg_0 . CMD_POWERSAVE + arg_0 . CMD_OFF )

def Func(arg_0):
        """Power the device off."""
        arg_1 = arg_0.status()
        if arg_1['power']:  # Setting power off when it is already off can cause hangs
            arg_0._send(arg_0.CMD_POWERSAVE + arg_0.CMD_OFF)


(value, parser=Text, delimiter=u',', encoding=None)

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = u',' , arg_4 = None ) : arg_0 = arg_2 ( arg_0 , arg_4 ) if arg_0 is None or arg_0 == u'' : return [ ] return map ( arg_1 , arg_0 . split ( arg_3 ) )

def Func(arg_0, arg_1=arg_2, arg_3=u',', arg_4=None):
    """
    Parse a value as a delimited list.

    :type  value: `unicode` or `bytes`
    :param value: Text value to parse.

    :type  parser: `callable` taking a `unicode` parameter
    :param parser: Callable to map over the delimited text values.

    :type  delimiter: `unicode`
    :param delimiter: Delimiter text.

    :type  encoding: `bytes`
    :param encoding: Encoding to treat `bytes` values as, defaults to
        ``utf-8``.

    :rtype: `list`
    :return: List of parsed values.
    """
    arg_0 = arg_2(arg_0, arg_4)
    if arg_0 is None or arg_0 == u'':
        return []
    return map(arg_1, arg_0.split(arg_3))


(T=298.15, Hvapm=None, Vml=None,
                         CASRN='', AvailableMethods=False, Method=None)

def
Func
(
arg_0
=
298.15
,
arg_1
=
,
arg_2
=
,
arg_3
=
''
,
arg_4
=
False
,
arg_5
=
)
:
def
list_methods
(
)
:
arg_6
=
[
]
if
arg_0
and
arg_1
and
arg_2
:
arg_6
.
append
(
DEFINITION
)
arg_6
.
append
(
)
return
arg_6
if
arg_4
:
return
list_methods
(
)
if
not
arg_5
:
arg_5
=
list_methods
(
)
[
0
]
if
arg_5
==
DEFINITION
:
if
(
not
arg_1
)
or
(
not
arg_0
)
or
(
not
arg_2
)
:
arg_7
=
else
:
if
arg_1
<
R
*
arg_0
or
arg_2
<
0
:
arg_7
=
else
:
arg_7
=
(
(
arg_1
R
*
arg_0
)
/
arg_2
)
**
0.5
elif
arg_5
==
:
arg_7
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_7

def Func(arg_0=298.15, arg_1=None, arg_2=None,
                         arg_3='', arg_4=False, arg_5=None):
    r'''This function handles the calculation of a chemical's solubility
    parameter. Calculation is a function of temperature, but is not always
    presented as such. No lookup values are available; either `Hvapm`, `Vml`,
    and `T` are provided or the calculation cannot be performed.

    .. math::
        \delta = \sqrt{\frac{\Delta H_{vap} - RT}{V_m}}

    Parameters
    ----------
    T : float
        Temperature of the fluid [k]
    Hvapm : float
        Heat of vaporization [J/mol/K]
    Vml : float
        Specific volume of the liquid [m^3/mol]
    CASRN : str, optional
        CASRN of the fluid, not currently used [-]

    Returns
    -------
    delta : float
        Solubility parameter, [Pa^0.5]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain the solubility parameter
        with the given inputs

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

    Notes
    -----
    Undefined past the critical point. For convenience, if Hvap is not defined,
    an error is not raised; None is returned instead. Also for convenience,
    if Hvapm is less than RT, None is returned to avoid taking the root of a
    negative number.

    This parameter is often given in units of cal/ml, which is 2045.48 times
    smaller than the value returned here.

    Examples
    --------
    Pentane at STP

    >>> Func(T=298.2, Hvapm=26403.3, Vml=0.000116055)
    14357.681538173534

    References
    ----------
    .. [1] Barton, Allan F. M. CRC Handbook of Solubility Parameters and Other
       Cohesion Parameters, Second Edition. CRC Press, 1991.
    '''
    def list_methods():
        arg_6 = []
        if arg_0 and arg_1 and arg_2:
            arg_6.append(DEFINITION)
        arg_6.append(NONE)
        return arg_6
    if arg_4:
        return list_methods()
    if not arg_5:
        arg_5 = list_methods()[0]

    if arg_5 == DEFINITION:
        if (not arg_1) or (not arg_0) or (not arg_2):
            arg_7 = None
        else:
            if arg_1 < R*arg_0 or arg_2 < 0:  # Prevent taking the root of a negative number
                arg_7 = None
            else:
                arg_7 = ((arg_1 - R*arg_0)/arg_2)**0.5
    elif arg_5 == NONE:
        arg_7 = None
    else:
        raise Exception('Failure in in function')
    return arg_7

r'''This function handles the calculation of a chemical's solubility
    parameter. Calculation is a function of temperature, but is not always
    presented as such. No lookup values are available; either `Hvapm`, `Vml`,
    and `T` are provided or the calculation cannot be performed.

    .. math::
        \delta = \sqrt{\frac{\Delta H_{vap} - RT}{V_m}}

    Parameters
    ----------
    T : float
        Temperature of the fluid [k]
    Hvapm : float
        Heat of vaporization [J/mol/K]
    Vml : float
        Specific volume of the liquid [m^3/mol]
    CASRN : str, optional
        CASRN of the fluid, not currently used [-]

    Returns
    -------
    delta : float
        Solubility parameter, [Pa^0.5]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain the solubility parameter
        with the given inputs

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

    Notes
    -----
    Undefined past the critical point. For convenience, if Hvap is not defined,
    an error is not raised; None is returned instead. Also for convenience,
    if Hvapm is less than RT, None is returned to avoid taking the root of a
    negative number.

    This parameter is often given in units of cal/ml, which is 2045.48 times
    smaller than the value returned here.

    Examples
    --------
    Pentane at STP

    >>> solubility_parameter(T=298.2, Hvapm=26403.3, Vml=0.000116055)
    14357.681538173534

    References
    ----------
    .. [1] Barton, Allan F. M. CRC Handbook of Solubility Parameters and Other
       Cohesion Parameters, Second Edition. CRC Press, 1991.

r This function handles the calculation of a chemical s solubility parameter . Calculation is a function of temperature but is not always presented as such . No lookup values are available ; either Hvapm Vml and T are provided or the calculation cannot be performed .


def Func ( arg_0 ) : arg_1 = os . path . split ( arg_0 ) [ 1 ] if arg_1 [ 0 ] == '.' : return False if not arg_0 . endswith ( g_defaultCheckpointExtension ) : return False if not os . path . isdir ( arg_0 ) : return False return True

def Func(arg_0):
  """Return true iff checkpointDir appears to be a checkpoint directory."""
  arg_1 = os.path.split(arg_0)[1]
  if arg_1[0] == '.':
    return False

  if not arg_0.endswith(g_defaultCheckpointExtension):
    return False

  if not os.path.isdir(arg_0):
    return False

  return True

Return true iff checkpointDir appears to be a checkpoint directory .


def Func ( arg_0 ) : if arg_0 not in arg_1 : arg_1 [ arg_0 ] = Timer ( ) return 0 else : return arg_1 [ arg_0 ] . since_last_check ( )

def Func(arg_0):
    """Add check points in a single line.

    This method is suitable for running a task on a list of items. A timer will
    be registered when the method is called for the first time.

    :Example:

    >>> import time
    >>> import mmcv
    >>> for i in range(1, 6):
    >>>     # simulate a code block
    >>>     time.sleep(i)
    >>>     mmcv.Func('task1')
    2.000
    3.000
    4.000
    5.000

    Args:
        timer_id (str): Timer identifier.
    """
    if arg_0 not in arg_1:
        arg_1[arg_0] = Timer()
        return 0
    else:
        return arg_1[arg_0].since_last_check()

Add check points in a single line.

    This method is suitable for running a task on a list of items. A timer will
    be registered when the method is called for the first time.

    :Example:

    >>> import time
    >>> import mmcv
    >>> for i in range(1, 6):
    >>>     # simulate a code block
    >>>     time.sleep(i)
    >>>     mmcv.check_time('task1')
    2.000
    3.000
    4.000
    5.000

    Args:
        timer_id (str): Timer identifier.


(x, sample_axis=0, keepdims=False, name=None)

def Func ( arg_0 , arg_1 = 0 , arg_2 = False , arg_3 = None ) : with tf . compat . v1 . name_scope ( arg_3 , 'Func' , values = [ arg_0 , arg_1 ] ) : arg_1 = tf . convert_to_tensor ( value = arg_1 , dtype = tf . int32 ) arg_4 = covariance ( arg_0 , arg_1 = arg_1 , event_axis = - 1 , arg_2 = arg_2 ) return tf . linalg . cholesky ( arg_4 )

def Func(arg_0, arg_1=0, arg_2=False, arg_3=None):
  """Cholesky factor of the covariance matrix of vector-variate random samples.

  This function can be use to fit a multivariate normal to data.

  ```python
  tf.enable_eager_execution()
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  # Assume data.shape = (1000, 2).  1000 samples of a random variable in R^2.
  observed_data = read_data_samples(...)

  # The mean is easy
  mu = tf.reduce_mean(observed_data, axis=0)

  # Get the scale matrix
  L = tfp.stats.Func(observed_data)

  # Make the best fit multivariate normal (under maximum likelihood condition).
  mvn = tfd.MultivariateNormalTriL(loc=mu, scale_tril=L)

  # Plot contours of the pdf.
  xs, ys = tf.meshgrid(
      tf.linspace(-5., 5., 50), tf.linspace(-5., 5., 50), indexing='ij')
  xy = tf.stack((tf.reshape(xs, [-1]), tf.reshape(ys, [-1])), axis=-1)
  pdf = tf.reshape(mvn.prob(xy), (50, 50))
  CS = plt.contour(xs, ys, pdf, 10)
  plt.clabel(CS, inline=1, fontsize=10)
  ```

  Why does this work?
  Given vector-variate random variables `X = (X1, ..., Xd)`, one may obtain the
  sample covariance matrix in `R^{d x d}` (see `tfp.stats.covariance`).

  The [Cholesky factor](https://en.wikipedia.org/wiki/Cholesky_decomposition)
  of this matrix is analogous to standard deviation for scalar random variables:
  Suppose `X` has covariance matrix `C`, with Cholesky factorization `C = L L^T`
  Then multiplying a vector of iid random variables which have unit variance by
  `L` produces a vector with covariance `L L^T`, which is the same as `X`.

  ```python
  observed_data = read_data_samples(...)
  L = tfp.stats.Func(observed_data, sample_axis=0)

  # Make fake_data with the same covariance as observed_data.
  uncorrelated_normal = tf.random_normal(shape=(500, 10))
  fake_data = tf.linalg.matvec(L, uncorrelated_normal)
  ```

  Args:
    x:  Numeric `Tensor`.  The rightmost dimension of `x` indexes events. E.g.
      dimensions of a random vector.
    sample_axis: Scalar or vector `Tensor` designating axis holding samples.
      Default value: `0` (leftmost dimension). Cannot be the rightmost dimension
        (since this indexes events).
    keepdims:  Boolean.  Whether to keep the sample axis as singletons.
    name: Python `str` name prefixed to Ops created by this function.
          Default value: `None` (i.e., `'covariance'`).

  Returns:
    chol:  `Tensor` of same `dtype` as `x`.  The last two dimensions hold
      lower triangular matrices (the Cholesky factors).
  """
  with tf.compat.v1.name_scope(
      arg_3, 'Func', values=[arg_0, arg_1]):
    arg_1 = tf.convert_to_tensor(value=arg_1, dtype=tf.int32)
    arg_4 = covariance(
        arg_0, arg_1=arg_1, event_axis=-1, arg_2=arg_2)
    return tf.linalg.cholesky(arg_4)

Cholesky factor of the covariance matrix of vector-variate random samples.

  This function can be use to fit a multivariate normal to data.

  ```python
  tf.enable_eager_execution()
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  # Assume data.shape = (1000, 2).  1000 samples of a random variable in R^2.
  observed_data = read_data_samples(...)

  # The mean is easy
  mu = tf.reduce_mean(observed_data, axis=0)

  # Get the scale matrix
  L = tfp.stats.cholesky_covariance(observed_data)

  # Make the best fit multivariate normal (under maximum likelihood condition).
  mvn = tfd.MultivariateNormalTriL(loc=mu, scale_tril=L)

  # Plot contours of the pdf.
  xs, ys = tf.meshgrid(
      tf.linspace(-5., 5., 50), tf.linspace(-5., 5., 50), indexing='ij')
  xy = tf.stack((tf.reshape(xs, [-1]), tf.reshape(ys, [-1])), axis=-1)
  pdf = tf.reshape(mvn.prob(xy), (50, 50))
  CS = plt.contour(xs, ys, pdf, 10)
  plt.clabel(CS, inline=1, fontsize=10)
  ```

  Why does this work?
  Given vector-variate random variables `X = (X1, ..., Xd)`, one may obtain the
  sample covariance matrix in `R^{d x d}` (see `tfp.stats.covariance`).

  The [Cholesky factor](https://en.wikipedia.org/wiki/Cholesky_decomposition)
  of this matrix is analogous to standard deviation for scalar random variables:
  Suppose `X` has covariance matrix `C`, with Cholesky factorization `C = L L^T`
  Then multiplying a vector of iid random variables which have unit variance by
  `L` produces a vector with covariance `L L^T`, which is the same as `X`.

  ```python
  observed_data = read_data_samples(...)
  L = tfp.stats.cholesky_covariance(observed_data, sample_axis=0)

  # Make fake_data with the same covariance as observed_data.
  uncorrelated_normal = tf.random_normal(shape=(500, 10))
  fake_data = tf.linalg.matvec(L, uncorrelated_normal)
  ```

  Args:
    x:  Numeric `Tensor`.  The rightmost dimension of `x` indexes events. E.g.
      dimensions of a random vector.
    sample_axis: Scalar or vector `Tensor` designating axis holding samples.
      Default value: `0` (leftmost dimension). Cannot be the rightmost dimension
        (since this indexes events).
    keepdims:  Boolean.  Whether to keep the sample axis as singletons.
    name: Python `str` name prefixed to Ops created by this function.
          Default value: `None` (i.e., `'covariance'`).

  Returns:
    chol:  `Tensor` of same `dtype` as `x`.  The last two dimensions hold
      lower triangular matrices (the Cholesky factors).

Cholesky factor of the covariance matrix of vector - variate random samples .


def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 . data : arg_3 = { } for arg_4 in arg_0 . data [ arg_2 ] : arg_3 [ arg_0 . translation_keys [ arg_4 ] ] = arg_0 . data [ arg_2 ] [ arg_4 ] arg_1 [ arg_2 ] = arg_3 return arg_1

def Func(arg_0):
        """
        Translate the data with the translation table
        """
        arg_1 = {}
        for arg_2 in arg_0.data:
            arg_3 = {}
            for arg_4 in arg_0.data[arg_2]:
                arg_3[arg_0.translation_keys[arg_4]] = arg_0.data[arg_2][arg_4]
            arg_1[arg_2] = arg_3
        return arg_1


return self._post(
            request='list',
            uri=ApiUri.TAGS.value,
        ).get('tags')

def Func ( arg_0 ) : return arg_0 . _post ( request = 'Func' , uri = ApiUri . TAGS . value , ) . get ( 'tags' )

def Func(arg_0):
        """
        Get all current labels

        :return: The Logentries API response
        :rtype: Func of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        return arg_0._post(
            request='Func',
            uri=ApiUri.TAGS.value,
        ).get('tags')

Get all current labels

        :return: The Logentries API response
        :rtype: list of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = arg_0 . GET . get ( arg_1 , arg_2 ) if isinstance ( arg_3 , str ) or isinstance ( arg_3 , unicode ) : arg_3 = True if arg_3 [ 0 ] == 't' else False return arg_3

def Func(arg_0, arg_1, arg_2=True):
    """
    Tries to extract a boolean variable from the specified request.
    """

    arg_3 = arg_0.GET.get(arg_1, arg_2)
    if isinstance(arg_3, str) or isinstance(arg_3, unicode):
        arg_3 = True if arg_3[0] == 't' else False

    return arg_3

Tries to extract a boolean variable from the specified request .


def Func(arg_0, arg_1=True, arg_2=4):
    """
    Configure environment for retro games, using config similar to DeepMind-style Atari in wrap_deepmind
    """
    arg_0 = WarpFrame(arg_0)
    arg_0 = ClipRewardEnv(arg_0)
    if arg_2 > 1:
        arg_0 = FrameStack(arg_0, arg_2)
    if arg_1:
        arg_0 = ScaledFloatFrame(arg_0)
    return arg_0

Configure environment for retro games using config similar to DeepMind - style Atari in wrap_deepmind


def Func(arg_0, arg_1, arg_2=True):
        """
        Retrieve key from Cache.

        :param key: key to look up in cache.
        :type key: ``object``

        :param delete_if_expired: remove value from cache if it is expired.
                                  Default is True.
        :type delete_if_expired: ``bool``

        :returns: value from cache or None
        :rtype: varies or None
        """
        arg_0._update_cache_stats(arg_1, None)

        if arg_1 in arg_0._CACHE:
            (arg_3, arg_4) = arg_0._CACHE[arg_1]
            if arg_3 > arg_0._now():
                arg_0._update_cache_stats(arg_1, 'hit')
                return arg_4
            else:
                if arg_2:
                    arg_0.delete(arg_1)
                    arg_0._update_cache_stats(arg_1, 'expired')
                    return None

        arg_0._update_cache_stats(arg_1, 'miss')
        return None


return self._stream[self._stream.index:stop] == text

def Func(arg_0, arg_1: arg_2) -> bool:
        """Same as readText but doesn't consume the stream."""
        arg_3 = arg_0._stream.index
        arg_4 = arg_3 + len(arg_1)
        if arg_4 > arg_0._stream.eos_index:
            return False
        return arg_0._stream[arg_0._stream.index:arg_4] == arg_1

Same as readText but doesn t consume the stream .


def Func ( arg_0 , arg_1 ) : if arg_0 . config . file_header : if sys . version_info [ 0 ] < 3 : arg_2 = re . compile ( '\A' + arg_0 . config . file_header , re . LOCALE | re . MULTILINE ) else : arg_2 = re . compile ( '\A' + arg_0 . config . file_header , re . MULTILINE ) arg_3 = None with arg_1 . stream ( ) as stream : arg_3 = stream . read ( ) . decode ( 'utf-8' ) arg_4 = arg_2 . findall ( arg_3 ) if len ( arg_4 ) != 1 : arg_0 . add_message ( 'invalid-file-header' , 1 , args = arg_0 . config . file_header )

def Func(arg_0, arg_1):
        """Process the astroid node stream."""
        if arg_0.config.file_header:
            if sys.version_info[0] < 3:
                arg_2 = re.compile(
                    '\A' + arg_0.config.file_header, re.LOCALE | re.MULTILINE)
            else:
                # The use of re.LOCALE is discouraged in python 3
                arg_2 = re.compile(
                    '\A' + arg_0.config.file_header, re.MULTILINE)

            arg_3 = None
            with arg_1.stream() as stream:
                # Explicit decoding required by python 3
                arg_3 = stream.read().decode('utf-8')

            arg_4 = arg_2.findall(arg_3)

            if len(arg_4) != 1:
                arg_0.add_message('invalid-file-header', 1,
                                 args=arg_0.config.file_header)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . mraa_gpio . Gpio . dir ( arg_0 . mraa_gpio . Gpio ( arg_1 ) , arg_0 . _dir_mapping [ arg_2 ] )

def Func(arg_0,arg_1,arg_2):
        """Set the input or output mode for a specified pin.  Mode should be
        either DIR_IN or DIR_OUT.
        """
        arg_0.mraa_gpio.Gpio.dir(arg_0.mraa_gpio.Gpio(arg_1),arg_0._dir_mapping[arg_2])

Set the input or output mode for a specified pin . Mode should be either DIR_IN or DIR_OUT .