def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
dropbox_schema
.
deserialize
(
arg_1
.
POST
)
except
Exception
:
return
HTTPFound
(
location
=
arg_1
.
route_url
(
'dropbox_form'
)
)
arg_0
.
message
=
arg_2
.
get
(
'message'
)
if
'testing_secret'
in
arg_0
.
settings
:
arg_0
.
from_watchdog
=
is_equal
(
unicode
(
arg_0
.
settings
[
'test_submission_secret'
]
)
,
arg_2
.
pop
(
'testing_secret'
,
u''
)
)
if
arg_2
.
get
(
'upload'
)
is
not
:
arg_0
.
add_attachment
(
arg_2
[
'upload'
]
)
arg_0
.
submit
(
)
arg_5
=
arg_1
.
route_url
(
'dropbox_view'
,
drop_id
=
arg_0
.
drop_id
)
print
(
"Created dropbox %s"
%
arg_5
)
return
HTTPFound
(
location
=
arg_5
)

def Func(arg_0, arg_1):
    """ handles the form submission, redirects to the dropbox's status page."""
    try:
        arg_2 = dropbox_schema.deserialize(arg_1.POST)
    except Exception:
        return HTTPFound(location=arg_1.route_url('dropbox_form'))

    # set the message
    arg_0.message = arg_2.get('message')

    # recognize submission from watchdog
    if 'testing_secret' in arg_0.settings:
        arg_0.from_watchdog = is_equal(
            unicode(arg_0.settings['test_submission_secret']),
            arg_2.pop('testing_secret', u''))

    # a non-js client might have uploaded an attachment via the form's fileupload field:
    if arg_2.get('upload') is not None:
        arg_0.add_attachment(arg_2['upload'])

    # now we can call the process method
    arg_0.submit()
    arg_5 = arg_1.route_url('dropbox_view', drop_id=arg_0.drop_id)
    print("Created dropbox %s" % arg_5)
    return HTTPFound(location=arg_5)

handles the form submission redirects to the dropbox s status page .


def Func ( arg_0 ) : with open ( arg_0 . file_name , 'w' ) as fh : for arg_1 , arg_2 in arg_0 . args . iteritems ( ) : arg_3 = StringIO . StringIO ( ) arg_3 . write ( arg_1 ) arg_0 . _append_vals ( arg_3 , arg_2 ) fh . write ( arg_3 . getvalue ( ) + '\n' ) arg_3 . close ( )

def Func(arg_0):
      '''
      Write output file.
      '''
      with open( arg_0.file_name, 'w') as fh:
         for arg_1,arg_2 in arg_0.args.iteritems():
            arg_3 = StringIO.StringIO()
            arg_3.write(arg_1)
            arg_0._append_vals(arg_3,arg_2)
            fh.write(arg_3.getvalue() + '\n')
            arg_3.close()


def Func ( arg_0 , arg_1 ) : if arg_0 . model is not None : arg_0 . model . cleanup ( arg_0 ) arg_0 . model = arg_1 arg_1 . create ( arg_0 )

def Func(arg_0,arg_1):
        """
        Sets the model this actor should use when drawing.

        This method also automatically initializes the new model and removes the old, if any.
        """
        if arg_0.model is not None:
            arg_0.model.cleanup(arg_0)
        arg_0.model = arg_1
        arg_1.create(arg_0)

Sets the model this actor should use when drawing . This method also automatically initializes the new model and removes the old if any .


def Func ( arg_0 , arg_1 = "utf-8" ) : with codecs . open ( arg_0 , "r" , arg_1 ) as f : return f . read ( )

def Func(arg_0, arg_1="utf-8"):
    """
    Read helper method

    :type file_path: str|unicode
    :type encoding: str|unicode
    :rtype: str|unicode
    """
    with codecs.open(arg_0, "r", arg_1) as f:
        return f.read()


def Func(arg_0, **arg_1):
        """
        Discover TV shows by different types of data like average rating,
        number of votes, genres, the network they aired on and air dates.

        Args:
            page: (optional) Minimum 1, maximum 1000.
            language: (optional) ISO 639-1 code.
            sort_by: (optional) Available options are 'vote_average.desc',
                     'vote_average.asc', 'first_air_date.desc',
                     'first_air_date.asc', 'popularity.desc', 'popularity.asc'
            first_air_year: (optional) Filter the results release dates to
                            matches that include this value. Expected value
                            is a year.
            vote_count.gte or vote_count_gte: (optional) Only include TV shows
                            that are equal to,
                            or have vote count higher than this value. Expected
                            value is an integer.
            vote_average.gte or vote_average_gte: (optional) Only include TV
                              shows that are equal
                              to, or have a higher average rating than this
                              value.  Expected value is a float.
            with_genres: (optional) Only include TV shows with the specified
                         genres. Expected value is an integer (the id of a
                         genre).  Multiple valued can be specified. Comma
                         separated indicates an 'AND' query, while a
                         pipe (|) separated value indicates an 'OR'.
            with_networks: (optional) Filter TV shows to include a specific
                           network. Expected value is an integer (the id of a
                           network).  They can be comma separated to indicate an
                           'AND' query.
            first_air_date.gte or first_air_date_gte: (optional) The minimum
                                release to include.
                                Expected format is 'YYYY-MM-DD'.
            first_air_date.lte or first_air_date_lte: (optional) The maximum
                                release to include.
                                Expected format is 'YYYY-MM-DD'.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        # Periods are not allowed in keyword arguments but several API
        # arguments contain periods. See both usages in tests/test_discover.py.
        for arg_2 in arg_1:
            if '_lte' in arg_2:
                arg_1[arg_2.replace('_lte', '.lte')] = arg_1.pop(arg_2)
            if '_gte' in arg_2:
                arg_1[arg_2.replace('_gte', '.gte')] = arg_1.pop(arg_2)

        arg_4 = arg_0._get_path('Func')

        arg_5 = arg_0._GET(arg_4, arg_1)
        arg_0._set_attrs_to_values(arg_5)
        return arg_5

Discover TV shows by different types of data like average rating number of votes genres the network they aired on and air dates .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_0
==
'Operator'
:
return
arg_1
if
arg_0
==
'SuperOp'
:
return
np
.
kron
(
np
.
conj
(
arg_1
)
,
arg_1
)
if
arg_0
==
'Choi'
:
arg_4
=
np
.
ravel
(
arg_1
,
order
=
'F'
)
return
np
.
outer
(
arg_4
,
np
.
conj
(
arg_4
)
)
if
arg_0
==
'Kraus'
:
return
(
[
arg_1
]
,
)
if
arg_0
==
'Stinespring'
:
return
(
arg_1
,
)
if
arg_0
==
'Chi'
:
_check_nqubit_dim
(
arg_2
,
arg_3
)
arg_1
=
Func
(
'Choi'
,
arg_1
,
arg_2
,
arg_3
)
return
_choi_to_chi
(
arg_1
,
arg_2
,
arg_3
)
if
arg_0
==
'PTM'
:
_check_nqubit_dim
(
arg_2
,
arg_3
)
arg_1
=
Func
(
'SuperOp'
,
arg_1
,
arg_2
,
arg_3
)
return
_superop_to_ptm
(
arg_1
,
arg_2
,
arg_3
)
raise
QiskitError
(
'Invalid QuantumChannel {}'
.
format
(
arg_0
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Transform Operator representation to other representation."""
    if arg_0 == 'Operator':
        return arg_1
    if arg_0 == 'SuperOp':
        return np.kron(np.conj(arg_1), arg_1)
    if arg_0 == 'Choi':
        arg_4 = np.ravel(arg_1, order='F')
        return np.outer(arg_4, np.conj(arg_4))
    if arg_0 == 'Kraus':
        return ([arg_1], None)
    if arg_0 == 'Stinespring':
        return (arg_1, None)
    if arg_0 == 'Chi':
        _check_nqubit_dim(arg_2, arg_3)
        arg_1 = Func('Choi', arg_1, arg_2, arg_3)
        return _choi_to_chi(arg_1, arg_2, arg_3)
    if arg_0 == 'PTM':
        _check_nqubit_dim(arg_2, arg_3)
        arg_1 = Func('SuperOp', arg_1, arg_2, arg_3)
        return _superop_to_ptm(arg_1, arg_2, arg_3)
    raise QiskitError('Invalid QuantumChannel {}'.format(arg_0))

Transform Operator representation to other representation .


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

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

        Raises:
            ValueError: Raised if either the major or minor protocol versions
                are missing from the encoding.
        """
        super(ProtocolVersion, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.PROTOCOL_VERSION_MAJOR, arg_6):
            arg_0._major = primitives.Integer(
                tag=arg_3.Tags.PROTOCOL_VERSION_MAJOR
            )
            arg_0._major.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError(
                "Invalid encoding missing the major protocol version number."
            )

        if arg_0.is_tag_next(arg_3.Tags.PROTOCOL_VERSION_MINOR, arg_6):
            arg_0._minor = primitives.Integer(
                tag=arg_3.Tags.PROTOCOL_VERSION_MINOR
            )
            arg_0._minor.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError(
                "Invalid encoding missing the minor protocol version number."
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the ProtocolVersion struct and decode it into
        its constituent parts.

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

        Raises:
            ValueError: Raised if either the major or minor protocol versions
                are missing from the encoding.

Read the data encoding the ProtocolVersion struct and decode it into its constituent parts .


def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.Func` for more
        documentation. Uses the set values of `Tc`, `kappa`, and `a`.

        For use in `solve_T`, returns only `a_alpha` if full is False.

        .. math::
            a\alpha = a \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}}
            + 1\right) + 1\right)^{2}

            \frac{d a\alpha}{dT} = - \frac{1.0 a \kappa}{T^{0.5} Tc^{0.5}}
            \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}} + 1\right) + 1\right)

            \frac{d^2 a\alpha}{dT^2} = 0.5 a \kappa \left(- \frac{1}{T^{1.5}
            Tc^{0.5}} \left(\kappa \left(\frac{T^{0.5}}{Tc^{0.5}} - 1\right)
            - 1\right) + \frac{\kappa}{T^{1.0} Tc^{1.0}}\right)
        '''
        if not arg_2:
            return arg_0.a*(1 + arg_0.kappa*(1-(arg_1/arg_0.Tc)**0.5))**2
        else:
            if arg_3:
                arg_4, arg_5 = arg_0.Tc, arg_0.kappa
                arg_6 = arg_1**0.5
                arg_7 = arg_4**-0.5
                arg_8 = arg_5*(arg_6*arg_7 - 1.) - 1.
                arg_9 = arg_0.a*arg_5

                arg_10 = arg_0.a*arg_8*arg_8
                arg_11 = arg_7*arg_8*arg_9/arg_6
                arg_12 = arg_9*(-0.5*arg_1**-1.5*arg_7*arg_8 + 0.5/(arg_1*arg_4)*arg_5)
            else:
                arg_10 = arg_0.a*(1 + arg_0.kappa*(1-(arg_1/arg_0.Tc)**0.5))**2
                arg_11 = -arg_0.a*arg_0.kappa*sqrt(arg_1/arg_0.Tc)*(arg_0.kappa*(-sqrt(arg_1/arg_0.Tc) + 1.) + 1.)/arg_1
                arg_12 = arg_0.a*arg_0.kappa*(arg_0.kappa/arg_0.Tc - sqrt(arg_1/arg_0.Tc)*(arg_0.kappa*(sqrt(arg_1/arg_0.Tc) - 1.) - 1.)/arg_1)/(2.*arg_1)
            return arg_10, arg_11, arg_12

r'''Method to calculate `a_alpha` and its first and second
        derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
        `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
        documentation. Uses the set values of `Tc`, `kappa`, and `a`.

        For use in `solve_T`, returns only `a_alpha` if full is False.

        .. math::
            a\alpha = a \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}}
            + 1\right) + 1\right)^{2}

            \frac{d a\alpha}{dT} = - \frac{1.0 a \kappa}{T^{0.5} Tc^{0.5}}
            \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}} + 1\right) + 1\right)

            \frac{d^2 a\alpha}{dT^2} = 0.5 a \kappa \left(- \frac{1}{T^{1.5}
            Tc^{0.5}} \left(\kappa \left(\frac{T^{0.5}}{Tc^{0.5}} - 1\right)
            - 1\right) + \frac{\kappa}{T^{1.0} Tc^{1.0}}\right)

r Method to calculate a_alpha and its first and second derivatives for this EOS . Returns a_alpha da_alpha_dT and d2a_alpha_dT2 . See GCEOS . a_alpha_and_derivatives for more documentation . Uses the set values of Tc kappa and a . For use in solve_T returns only a_alpha if full is False .


(input_fluxes, input_elements, output_flux, output_elements)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = sum ( total_components_flux ( flux , components , consumption = True ) for flux , components in zip ( arg_0 , arg_1 ) ) arg_5 = total_components_flux ( arg_2 , arg_3 , consumption = False ) try : return arg_5 / arg_4 except ZeroDivisionError : return nan

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Compute total output per input unit.

    Units are typically mol carbon atoms or gram of source and product.

    Parameters
    ----------
    input_fluxes : list
        A list of input reaction fluxes in the same order as the
        ``input_components``.
    input_elements : list
        A list of reaction components which are in turn list of numbers.
    output_flux : float
        The output flux value.
    output_elements : list
        A list of stoichiometrically weighted output reaction components.

    Returns
    -------
    float
        The ratio between output (mol carbon atoms or grams of product) and
        input (mol carbon atoms or grams of source compounds).
    """

    arg_4 = sum(
        total_components_flux(flux, components, consumption=True)
        for flux, components in zip(arg_0, arg_1))
    arg_5 = total_components_flux(
        arg_2, arg_3, consumption=False)
    try:
        return arg_5 / arg_4
    except ZeroDivisionError:
        return nan


def Func ( arg_0 = arg_1 . argv [ 1 : ] ) : arg_2 = SolveArgumentParser ( ) arg_3 = arg_2 . parse_solvebio_args ( arg_0 ) if arg_3 . api_host : arg_4 . api_host = arg_3 . api_host if arg_3 . api_key : arg_4 . api_key = arg_3 . api_key if not arg_4 . api_key : try : from . credentials import get_credentials arg_4 . api_key = get_credentials ( ) except : pass client . set_host ( ) client . set_token ( ) return arg_3 . func ( arg_3 )

def Func(arg_0=arg_1.argv[1:]):
    """ Main entry point for SolveBio CLI """
    arg_2 = SolveArgumentParser()
    arg_3 = arg_2.parse_solvebio_args(arg_0)

    if arg_3.api_host:
        arg_4.api_host = arg_3.api_host

    if arg_3.api_key:
        arg_4.api_key = arg_3.api_key

    if not arg_4.api_key:
        # If nothing is set (via command line or environment)
        # look in local credentials
        try:
            from .credentials import get_credentials
            arg_4.api_key = get_credentials()
        except:
            pass

    # Update the client host and token
    client.set_host()
    client.set_token()

    return arg_3.func(arg_3)


def Func ( arg_0 , arg_1 ) : if not arg_1 : return arg_0 if arg_0 [ - 1 ] not in ( '?' , '&' ) : arg_0 += '&' if ( '?' in arg_0 ) else '?' return arg_0 + urllib . urlencode ( arg_1 )

def Func(arg_0, arg_1):
    """Concatenate url and argument dictionary regardless of whether
    url has existing query parameters.

    >>> Func("http://example.com/foo?a=b", dict(c="d"))
    'http://example.com/foo?a=b&c=d'
    """
    if not arg_1: return arg_0
    if arg_0[-1] not in ('?', '&'):
        arg_0 += '&' if ('?' in arg_0) else '?'
    return arg_0 + urllib.urlencode(arg_1)

Concatenate url and argument dictionary regardless of whether
    url has existing query parameters.

    >>> url_concat("http://example.com/foo?a=b", dict(c="d"))
    'http://example.com/foo?a=b&c=d'

Concatenate url and argument dictionary regardless of whether url has existing query parameters .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
"selection"
:
{
"selectionType"
:
"thermostats"
,
"selectionMatch"
:
arg_0
.
thermostats
[
arg_1
]
[
'identifier'
]
}
,
"functions"
:
[
{
"type"
:
"deleteVacation"
,
"params"
:
{
"name"
:
arg_2
}
}
]
}
arg_4
=
"delete a vacation"
return
arg_0
.
make_request
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2):
        ''' Delete the vacation with name vacation '''
        arg_3 = {"selection": {
                    "selectionType": "thermostats",
                    "selectionMatch": arg_0.thermostats[arg_1]['identifier']},
                "functions": [{"type": "deleteVacation", "params": {
                    "name": arg_2
                }}]}

        arg_4 = "delete a vacation"
        return arg_0.make_request(arg_3, arg_4)


def Func ( arg_0 , arg_1 ) : with tf . compat . v2 . name_scope ( arg_0 . name or "AutoregressiveLayer_Func" ) : arg_1 = tf . convert_to_tensor ( value = arg_1 , dtype = arg_0 . dtype , name = "x" ) arg_2 = tf . shape ( input = arg_1 ) if tensorshape_util . rank ( arg_1 . shape ) == 1 : arg_1 = arg_1 [ tf . newaxis , ... ] return tf . reshape ( arg_0 . _network ( arg_1 ) , tf . concat ( [ arg_2 , [ arg_0 . _params ] ] , axis = 0 ) )

def Func(arg_0, arg_1):
    """See tfkl.Layer.Func."""
    with tf.compat.v2.name_scope(arg_0.name or "AutoregressiveLayer_Func"):
      arg_1 = tf.convert_to_tensor(value=arg_1, dtype=arg_0.dtype, name="x")
      arg_2 = tf.shape(input=arg_1)
      # TODO(b/67594795): Better support for dynamic shapes.
      if tensorshape_util.rank(arg_1.shape) == 1:
        arg_1 = arg_1[tf.newaxis, ...]
      return tf.reshape(arg_0._network(arg_1),
                        tf.concat([arg_2, [arg_0._params]], axis=0))


def
Func
(
arg_0
,
arg_1
)
:
if
not
(
isinstance
(
arg_1
,
GTR
)
or
isinstance
(
arg_1
,
GTR_site_specific
)
)
:
raise
TypeError
(
" GTR instance expected"
)
arg_0
.
_Func
=
arg_1

def Func(arg_0, arg_1):
        """
        Set a new GTR object

        Parameters
        -----------

         value : GTR
            the new GTR object
        """
        if not (isinstance(arg_1, GTR) or isinstance(arg_1, GTR_site_specific)):
            raise TypeError(" GTR instance expected")
        arg_0._Func = arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = np . zeros ( ( arg_1 , arg_0 , 3 ) , dtype = np . uint8 ) return arg_2 . view ( Canvas )

def Func(arg_0, arg_1):
        """Return a blank canvas to annotate.

        :param width: xdim (int)
        :param height: ydim (int)
        :returns: :class:`jicbioimage.illustrate.Canvas`
        """
        arg_2 = np.zeros((arg_1, arg_0, 3), dtype=np.uint8)
        return arg_2.view(Canvas)


def
Func
(
arg_0
)
:
logger
.
debug
(
"Clearing the diagram canvas!"
)
arg_1
=
arg_0
.
diagram_canvas
arg_2
=
Canvas
(
)
arg_2
.
copy_traits
(
arg_1
,
[
"bgcolor"
,
"draw_axes"
]
)
arg_0
.
diagram_canvas
=
arg_2
arg_0
.
viewport
.
component
=
arg_2
arg_0
.
viewport
.
request_redraw
(
)
return

def Func(arg_0):
        """ Removes all components from the canvas """

        logger.debug("Clearing the diagram canvas!")
        arg_1 = arg_0.diagram_canvas

#        logger.debug("Canvas components: %s" % canvas.components)
#        for component in canvas.components:
#            canvas.remove(component)
#        logger.debug("Canvas components: %s" % canvas.components)
#        for component in canvas.components:
#            canvas.remove(component)
#        logger.debug("Canvas components: %s" % canvas.components)
#        canvas.request_redraw()

        arg_2 = Canvas()
        arg_2.copy_traits(arg_1, ["bgcolor", "draw_axes"])
        arg_0.diagram_canvas = arg_2

        arg_0.viewport.component=arg_2
        arg_0.viewport.request_redraw()

        return


def
Func
(
)
:
import
glob
for
arg_0
in
glob
.
glob
(
'*.ipynb'
)
:
print
(
'Converting file:'
,
arg_0
)
with
open
(
arg_0
,
'r'
)
as
f
:
arg_1
=
read
(
f
,
u'json'
)
arg_2
=
new_metadata
(
)
if
u'name'
in
arg_1
:
arg_2
.
name
=
arg_1
.
name
del
arg_1
[
u'name'
]
arg_1
.
metadata
=
arg_2
with
open
(
arg_0
,
'w'
)
as
f
:
write
(
arg_1
,
f
,
u'json'
)

def Func():
    """Convert to a notebook having notebook metadata."""
    import glob
    for arg_0 in glob.glob('*.ipynb'):
        print('Converting file:',arg_0)
        with open(arg_0,'r') as f:
            arg_1 = read(f,u'json')
        arg_2 = new_metadata()
        if u'name' in arg_1:
            arg_2.name = arg_1.name
            del arg_1[u'name']
        arg_1.metadata = arg_2
        with open(arg_0,'w') as f:
            write(arg_1, f, u'json')

Convert to a notebook having notebook metadata .


def Func ( arg_0 ) : arg_1 = record_get_field_instances ( arg_0 . record , '500' ) for arg_2 in arg_1 : arg_3 = field_get_subfields ( arg_2 ) for arg_4 in arg_3 . get ( 'a' , [ ] ) : arg_4 = arg_4 . strip ( ) if arg_4 . startswith ( "*" ) and arg_4 . endswith ( "*" ) : record_delete_field ( arg_0 . record , tag = "500" , field_position_global = arg_2 [ 4 ] )

def Func(arg_0):
        """Remove INSPIRE specific notes."""
        arg_1 = record_get_field_instances(arg_0.record, '500')
        for arg_2 in arg_1:
            arg_3 = field_get_subfields(arg_2)
            for arg_4 in arg_3.get('a', []):
                arg_4 = arg_4.strip()  # remove any spaces before/after
                if arg_4.startswith("*") and arg_4.endswith("*"):
                    record_delete_field(arg_0.record, tag="500",
                                        field_position_global=arg_2[4])


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . reset_reviews ( ) if validations . validate_reviewer ( arg_2 ) : arg_1 . add_review ( review . Review ( arg_2 = arg_2 ) ) return True else : raise SPDXValueError ( 'Review::Reviewer' )

def Func(arg_0, arg_1, arg_2):
        """Adds a reviewer to the SPDX Document.
        Reviwer is an entity created by an EntityBuilder.
        Raises SPDXValueError if not a valid reviewer type.
        """
        # Each reviewer marks the start of a new review object.
        # FIXME: this state does not make sense
        arg_0.reset_reviews()
        if validations.validate_reviewer(arg_2):
            arg_1.add_review(review.Review(arg_2=arg_2))
            return True
        else:
            raise SPDXValueError('Review::Reviewer')

Adds a reviewer to the SPDX Document . Reviwer is an entity created by an EntityBuilder . Raises SPDXValueError if not a valid reviewer type .


def Func ( arg_0 ) : arg_1 = expanduser ( '~' ) Func = os . path . join ( arg_1 , '.jackal' ) return Func

def Func(arg_0):
        """
            Returns the configuration directory
        """
        arg_1 = expanduser('~')
        Func = os.path.join(arg_1, '.jackal')
        return Func


def Func(arg_0, arg_1, arg_2):
        """
        Count `data` for throttle

        :param data: bytes of data for count
        :type data: :py:class:`bytes`

        :param start: start of read/write time from
            :py:meth:`asyncio.BaseEventLoop.time`
        :type start: :py:class:`float`
        """
        if arg_0._limit is not None and arg_0._limit > 0:
            if arg_0._start is None:
                arg_0._start = arg_2
            if arg_2 - arg_0._start > arg_0.reset_rate:
                arg_0._sum -= round((arg_2 - arg_0._start) * arg_0._limit)
                arg_0._start = arg_2
            arg_0._sum += len(arg_1)


def Func ( arg_0 , * arg_1 ) : if not set ( arg_1 ) . issubset ( arg_0 . allowed_operations ) : raise http . exceptions . Forbidden ( )

def Func(arg_0, *arg_1):
        """Assets if the requested operations are allowed in this context."""
        if not set(arg_1).issubset(arg_0.allowed_operations):
            raise http.exceptions.Forbidden()

Assets if the requested operations are allowed in this context .


(self, source=None, hidden=False, interactive=False)

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False):
        """ Executes source or the input buffer, possibly prompting for more
        input.

        Parameters:
        -----------
        source : str, optional

            The source to Func. If not specified, the input buffer will be
            used. If specified and 'hidden' is False, the input buffer will be
            replaced with the source before execution.

        hidden : bool, optional (default False)

            If set, no output will be shown and the prompt will not be modified.
            In other words, it will be completely invisible to the user that
            an execution has occurred.

        interactive : bool, optional (default False)

            Whether the console is to treat the source as having been manually
            entered by the user. The effect of this parameter depends on the
            subclass implementation.

        Raises:
        -------
        RuntimeError
            If incomplete input is given and 'hidden' is True. In this case,
            it is not possible to prompt for more input.

        Returns:
        --------
        A boolean indicating whether the source was Funcd.
        """
        # WARNING: The order in which things happen here is very particular, in
        # large part because our syntax highlighting is fragile. If you change
        # something, test carefully!

        # Decide what to Func.
        if arg_1 is None:
            arg_1 = arg_0.input_buffer
            if not arg_2:
                # A newline is appended later, but it should be considered part
                # of the input buffer.
                arg_1 += '\n'
        elif not arg_2:
            arg_0.input_buffer = arg_1

        # Execute the source or show a continuation prompt if it is incomplete.
        arg_5 = arg_0._is_complete(arg_1, arg_3)
        if arg_2:
            if arg_5:
                arg_0._Func(arg_1, arg_2)
            else:
                arg_6 = 'Incomplete noninteractive input: "%s"'
                raise RuntimeError(arg_6 % arg_1)
        else:
            if arg_5:
                arg_0._append_plain_text('\n')
                arg_0._input_buffer_executing = arg_0.input_buffer
                arg_0._executing = True
                arg_0._prompt_finished()

                # The maximum block count is only in effect during execution.
                # This ensures that _prompt_pos does not become invalid due to
                # text truncation.
                arg_0._control.document().setMaximumBlockCount(arg_0.buffer_size)

                # Setting a positive maximum block count will automatically
                # disable the undo/redo history, but just to be safe:
                arg_0._control.setUndoRedoEnabled(False)

                # Perform actual execution.
                arg_0._Func(arg_1, arg_2)

            else:
                # Do this inside an edit block so continuation prompts are
                # removed seamlessly via undo/redo.
                arg_9 = arg_0._get_end_cursor()
                arg_9.beginEditBlock()
                arg_9.insertText('\n')
                arg_0._insert_continuation_prompt(arg_9)
                arg_9.endEditBlock()

                # Do not do this inside the edit block. It works as expected
                # when using a QPlainTextEdit control, but does not have an
                # effect when using a QTextEdit. I believe this is a Qt bug.
                arg_0._control.moveCursor(QtGui.QTextCursor.End)

        return arg_5

Executes source or the input buffer, possibly prompting for more
        input.

        Parameters:
        -----------
        source : str, optional

            The source to execute. If not specified, the input buffer will be
            used. If specified and 'hidden' is False, the input buffer will be
            replaced with the source before execution.

        hidden : bool, optional (default False)

            If set, no output will be shown and the prompt will not be modified.
            In other words, it will be completely invisible to the user that
            an execution has occurred.

        interactive : bool, optional (default False)

            Whether the console is to treat the source as having been manually
            entered by the user. The effect of this parameter depends on the
            subclass implementation.

        Raises:
        -------
        RuntimeError
            If incomplete input is given and 'hidden' is True. In this case,
            it is not possible to prompt for more input.

        Returns:
        --------
        A boolean indicating whether the source was executed.

Executes source or the input buffer possibly prompting for more input .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : super ( ) . Func ( arg_1 , arg_2 , arg_3 ) arg_4 = [ ] for arg_5 , arg_6 in enumerate ( arg_1 ) : try : arg_0 . container . Func ( arg_6 , arg_5 , arg_1 ) except ValidationError as err : arg_4 . append ( err . messages ) if arg_4 : raise ValidationError ( arg_4 ) return arg_1

def Func(arg_0, arg_1, arg_2, arg_3):
        """Validate if it's a list of valid item-field values.

        Check if each element in the list can be validated by the item-field
        passed during construction.
        """
        super().Func(arg_1, arg_2, arg_3)

        arg_4 = []
        for arg_5, arg_6 in enumerate(arg_1):
            try:
                arg_0.container.Func(arg_6, arg_5, arg_1)
            except ValidationError as err:
                arg_4.append(err.messages)

        if arg_4:
            raise ValidationError(arg_4)

        return arg_1

Validate if it s a list of valid item - field values .


(self,
               new_abspath=None,
               new_dirpath=None,
               new_dirname=None,
               new_basename=None,
               new_fname=None,
               new_ext=None,
               overwrite=False,
               makedirs=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = False , arg_8 = False ) : arg_0 . assert_exists ( ) arg_9 = arg_0 . change ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , ) if arg_9 . is_not_exist_or_allow_overwrite ( arg_7 = arg_7 ) : if arg_0 . abspath != arg_9 . abspath : try : shutil . copy ( arg_0 . abspath , arg_9 . abspath ) except IOError as e : if arg_8 : os . makedirs ( arg_9 . parent . abspath ) shutil . copy ( arg_0 . abspath , arg_9 . abspath ) else : raise e return arg_9

def Func(arg_0,
               arg_1=None,
               arg_2=None,
               arg_3=None,
               arg_4=None,
               arg_5=None,
               arg_6=None,
               arg_7=False,
               arg_8=False):
        """
        Copy this file to other place.
        """
        arg_0.assert_exists()

        arg_9 = arg_0.change(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
        )

        if arg_9.is_not_exist_or_allow_overwrite(arg_7=arg_7):
            # 如果两个路径不同, 才进行copy
            if arg_0.abspath != arg_9.abspath:
                try:
                    shutil.copy(arg_0.abspath, arg_9.abspath)
                except IOError as e:
                    if arg_8:
                        os.makedirs(arg_9.parent.abspath)
                        shutil.copy(arg_0.abspath, arg_9.abspath)
                    else:
                        raise e
        return arg_9


return (indep_vector, dep_vector_a, dep_vector_b)

def Func(arg_0, arg_1):
    """
    Generate combined independent variable vector.

    The combination is from two waveforms and the (possibly interpolated)
    dependent variable vectors of these two waveforms
    """
    arg_2 = _get_indep_vector(arg_0, arg_1)
    arg_3 = _interp_dep_vector(arg_0, arg_2)
    arg_4 = _interp_dep_vector(arg_1, arg_2)
    return (arg_2, arg_3, arg_4)

Generate combined independent variable vector .


(self, client_secrets_file, client_id, client_secret)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Loads oauth2 configuration in order of priority.

        Priority:
            1. Config passed to the constructor or init_app.
            2. Config passed via the GOOGLE_OAUTH2_CLIENT_SECRETS_FILE app
               config.
            3. Config passed via the GOOGLE_OAUTH2_CLIENT_ID and
               GOOGLE_OAUTH2_CLIENT_SECRET app config.

        Raises:
            ValueError if no config could be found.
        """
        if arg_2 and arg_3:
            arg_0.client_id, arg_0.client_secret = arg_2, arg_3
            return

        if arg_1:
            arg_0._load_client_secrets(arg_1)
            return

        if 'GOOGLE_OAUTH2_CLIENT_SECRETS_FILE' in arg_0.app.config:
            arg_0._load_client_secrets(
                arg_0.app.config['GOOGLE_OAUTH2_CLIENT_SECRETS_FILE'])
            return

        try:
            arg_0.client_id, arg_0.client_secret = (
                arg_0.app.config['GOOGLE_OAUTH2_CLIENT_ID'],
                arg_0.app.config['GOOGLE_OAUTH2_CLIENT_SECRET'])
        except KeyError:
            raise ValueError(
                'OAuth2 configuration could not be found. Either specify the '
                'client_secrets_file or client_id and client_secret or set '
                'the app configuration variables '
                'GOOGLE_OAUTH2_CLIENT_SECRETS_FILE or '
                'GOOGLE_OAUTH2_CLIENT_ID and GOOGLE_OAUTH2_CLIENT_SECRET.')

Loads oauth2 configuration in order of priority .


(value_and_gradients_function,
                   val_c_input,
                   active,
                   step_size_shrink_param)

return tf.while_loop(
      cond=_cond, body=_body, loop_vars=(0, val_c_input, to_fix))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = np . ceil ( - np . log2 ( _machine_eps ( arg_1 . x . dtype ) ) ) def _cond ( arg_5 , arg_6 , arg_7 ) : del arg_6 return ( arg_5 < arg_4 ) & tf . reduce_any ( input_tensor = arg_7 ) def _body ( arg_5 , arg_6 , arg_7 ) : arg_8 = tf . where ( arg_7 , arg_6 . x * arg_3 , arg_6 . x ) arg_9 = arg_0 ( arg_8 ) arg_10 = arg_7 & ~ hzl . is_finite ( arg_9 ) return ( arg_5 + 1 , arg_9 , arg_10 ) arg_7 = arg_2 & ~ hzl . is_finite ( arg_1 ) return tf . while_loop ( cond = _cond , body = _body , loop_vars = ( 0 , arg_1 , arg_7 ) )

def Func(arg_0,
                   arg_1,
                   arg_2,
                   arg_3):
  """Shrinks the input step size until the value and grad become finite."""
  # The maximum iterations permitted are determined as the number of halvings
  # it takes to reduce 1 to 0 in the given dtype.
  arg_4 = np.ceil(-np.log2(_machine_eps(arg_1.x.dtype)))

  def _cond(arg_5, arg_6, arg_7):
    del arg_6  # Unused.
    return (arg_5 < arg_4) & tf.reduce_any(input_tensor=arg_7)

  def _body(arg_5, arg_6, arg_7):
    arg_8 = tf.where(arg_7, arg_6.x * arg_3, arg_6.x)
    arg_9 = arg_0(arg_8)
    arg_10 = arg_7 & ~hzl.is_finite(arg_9)
    return (arg_5 + 1, arg_9, arg_10)

  arg_7 = arg_2 & ~hzl.is_finite(arg_1)
  return tf.while_loop(
      cond=_cond, body=_body, loop_vars=(0, arg_1, arg_7))

Shrinks the input step size until the value and grad become finite .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_1 = { env . name : env . value for env in arg_1 } arg_1 . update ( providers_util . get_file_environment_variables ( arg_2 ) ) arg_1 . update ( providers_util . get_file_environment_variables ( arg_3 ) ) arg_1 . update ( providers_util . get_file_environment_variables ( arg_4 ) ) return arg_1

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Returns a dictionary of for the user container environment."""
    arg_1 = {env.name: env.value for env in arg_1}
    arg_1.update(providers_util.get_file_environment_variables(arg_2))
    arg_1.update(providers_util.get_file_environment_variables(arg_3))
    arg_1.update(providers_util.get_file_environment_variables(arg_4))
    return arg_1

Returns a dictionary of for the user container environment .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_2
-=
1
arg_1
-=
1
arg_0
.
exec_command
(
"MoveCursor({0}, {1})"
.
format
(
arg_1
,
arg_2
)
.
encode
(
"ascii"
)
)

def Func(arg_0, arg_1, arg_2):
        """
            move the cursor to the given co-ordinates.  Co-ordinates are 1
            based, as listed in the status area of the terminal.
        """
        # the screen's co-ordinates are 1 based, but the command is 0 based
        arg_2 -= 1
        arg_1 -= 1
        arg_0.exec_command("MoveCursor({0}, {1})".format(arg_1, arg_2).encode("ascii"))

move the cursor to the given co - ordinates . Co - ordinates are 1 based as listed in the status area of the terminal .


def Func ( arg_0 , arg_1 = False ) : arg_2 = [ [ ] ] if isinstance ( arg_0 , bytes ) : arg_0 = arg_0 . decode ( "utf-8" ) arg_3 = shlex . shlex ( arg_0 , arg_1 = arg_1 ) arg_3 . whitespace_split = True arg_5 = list ( arg_3 ) for arg_6 in arg_5 : if ';;' == arg_6 : arg_2 . append ( [ ] ) else : arg_2 [ - 1 ] . append ( arg_6 ) pass pass return arg_2

def Func(arg_0, arg_1=False):
    """Split a command line's arguments in a shell-like manner returned
    as a list of lists. Use ';;' with white space to indicate separate
    commands.

    This is a modified version of the standard library's shlex.split()
    function, but with a default of posix=False for splitting, so that quotes
    in inputs are respected.
    """

    arg_2 = [[]]
    if isinstance(arg_0, bytes):
        arg_0 = arg_0.decode("utf-8")
    arg_3 = shlex.shlex(arg_0, arg_1=arg_1)

    arg_3.whitespace_split = True
    arg_5 = list(arg_3)
    for arg_6 in arg_5:
        if ';;' == arg_6:
            arg_2.append([])
        else:
            arg_2[-1].append(arg_6)
            pass
        pass
    return arg_2

Split a command line s arguments in a shell - like manner returned as a list of lists . Use ;; with white space to indicate separate commands .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
list
(
arg_0
.
graph
.
triples
(
(
arg_1
,
RDFS
.
comment
,
)
)
)
if
len
(
arg_2
)
>
1
:
arg_0
.
more_than_one_error
(
'extracted license comment'
)
return
elif
len
(
arg_2
)
==
1
:
return
arg_2
[
0
]
[
2
]
else
:
return

def Func(arg_0, arg_1):
        """
        Return license comment or None.
        """
        arg_2 = list(arg_0.graph.triples(
            (arg_1, RDFS.comment, None)))
        if len(arg_2) > 1 :
            arg_0.more_than_one_error('extracted license comment')
            return
        elif len(arg_2) == 1:
            return arg_2[0][2]
        else:
            return


def Func ( arg_0 , arg_1 ) : if arg_1 is None : return None else : return encoding . smart_text ( base64 . b64encode ( jsonpickle . encode ( arg_1 ) . encode ( ) ) )

def Func(arg_0, arg_1):
        """Overrides ``models.Field`` method. This is used to convert
        the value from an instances of this class to bytes that can be
        inserted into the database.
        """
        if arg_1 is None:
            return None
        else:
            return encoding.smart_text(
                base64.b64encode(jsonpickle.encode(arg_1).encode()))

Overrides models . Field method . This is used to convert the value from an instances of this class to bytes that can be inserted into the database .


def Func ( arg_0 , arg_1 ) : arg_1 . endlexpos = arg_1 . lexpos + len ( arg_1 . value ) return arg_1

def Func(arg_0, arg_1):
        r"\."
        arg_1.endlexpos = arg_1.lexpos + len(arg_1.value)
        return arg_1


def
Func
(
arg_0
)
:
if
arg_0
[
0
:
2
]
!=
b'\xFE\xFE'
:
_LOGGER
.
error
(
"Houston, we got problem:"
)
print_hex
(
arg_0
)
raise
Exception
(
"Wrong header - got %X%X"
%
(
arg_0
[
0
]
,
arg_0
[
1
]
)
)
if
arg_0
[
2
:
]
!=
b'\xFE\x0D'
:
raise
Exception
(
"Wrong footer - got %X%X"
%
(
arg_0
[
2
]
,
arg_0
[
1
]
)
)
arg_1
=
arg_0
[
2
:
2
]
.
replace
(
b'\xFE\xF0'
,
b'\xFE'
)
arg_2
=
checksum
(
bytearray
(
arg_1
[
0
:
2
]
)
)
if
(
256
*
arg_1
[
2
:
1
]
[
0
]
+
arg_1
[
1
:
]
[
0
]
)
!=
arg_2
:
raise
Exception
(
"Wrong checksum - got %d expected %d"
%
(
(
256
*
arg_1
[
2
:
1
]
[
0
]
+
arg_1
[
1
:
]
[
0
]
)
,
arg_2
)
)
return
arg_1
[
0
:
2
]

def Func(arg_0):
    """Verify checksum and strip header and footer of received frame."""
    if arg_0[0:2] != b'\xFE\xFE':
        _LOGGER.error("Houston, we got problem:")
        print_hex(arg_0)
        raise Exception("Wrong header - got %X%X" % (arg_0[0], arg_0[1]))
    if arg_0[-2:] != b'\xFE\x0D':
        raise Exception("Wrong footer - got %X%X" % (arg_0[-2], arg_0[-1]))
    arg_1 = arg_0[2:-2].replace(b'\xFE\xF0', b'\xFE')

    arg_2 = checksum(bytearray(arg_1[0:-2]))

    if (256 * arg_1[-2:-1][0] + arg_1[-1:][0]) != arg_2:
        raise Exception("Wrong checksum - got %d expected %d" % (
            (256 * arg_1[-2:-1][0] + arg_1[-1:][0]), arg_2))

    return arg_1[0:-2]

Verify checksum and strip header and footer of received frame .


def Func ( arg_0 , arg_1 ) : try : return [ arg_2 . symbol for arg_2 in arg_0 . msgs_store . get_message_definitions ( arg_1 ) ] except UnknownMessageError : return arg_1

def Func(arg_0, arg_1):
        """Get the message symbol of the given message id

        Return the original message id if the message does not
        exist.
        """
        try:
            return [arg_2.symbol for arg_2 in arg_0.msgs_store.get_message_definitions(arg_1)]
        except UnknownMessageError:
            return arg_1


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . data . items ( ) : if arg_1 == 'ticks' : arg_0 [ 'chxtc' ] = '|' . join ( arg_2 ) else : arg_0 [ 'chx%s' % arg_1 [ 0 ] ] = '|' . join ( arg_2 ) return arg_0

def Func(arg_0):
        """Render the axes data into the dict data"""
        for arg_1,arg_2 in arg_0.data.items():
            if arg_1 == 'ticks':
                arg_0['chxtc'] = '|'.join(arg_2)
            else:
                arg_0['chx%s'%arg_1[0]] = '|'.join(arg_2)
        return arg_0


def Func ( arg_0 ) : arg_1 = set ( ) for arg_2 in arg_0 [ 'apps' ] . values ( ) : for arg_3 in arg_2 [ 'depends' ] [ 'services' ] : arg_1 . add ( arg_3 ) for arg_4 in arg_0 [ 'bundles' ] . values ( ) : for arg_3 in arg_4 [ 'services' ] : arg_1 . add ( arg_3 ) return arg_1

def Func(arg_0):
    """
    Returns all services that are referenced in specs.apps.depends.services,
    or in specs.bundles.services
    """
    arg_1 = set()
    for arg_2 in arg_0['apps'].values():
        for arg_3 in arg_2['depends']['services']:
            arg_1.add(arg_3)
    for arg_4 in arg_0['bundles'].values():
        for arg_3 in arg_4['services']:
            arg_1.add(arg_3)
    return arg_1

Returns all services that are referenced in specs . apps . depends . services or in specs . bundles . services


def Func ( arg_0 = arg_1 ) : arg_2 , arg_3 = swhlab . plot . IV ( arg_0 , .6 , .9 , True ) swhlab . plot . save ( arg_0 , tag = 'iv1' ) arg_4 = arg_0 . clampValues ( .6 ) arg_0 . saveThing ( [ arg_4 , arg_2 ] , 'iv' )

def Func(arg_0=arg_1):
    """fast sweeps, 1 step per sweep, for clean IV without fast currents."""
    arg_2,arg_3=swhlab.plot.IV(arg_0,.6,.9,True)
    swhlab.plot.save(arg_0,tag='iv1')
    arg_4=arg_0.clampValues(.6) #generate IV clamp values
    arg_0.saveThing([arg_4,arg_2],'iv')

fast sweeps 1 step per sweep for clean IV without fast currents .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 == 'OPTIONS' : return arg_3 = arg_0 . meta . authorization if not arg_3 . is_accessible ( arg_1 , arg_2 , arg_0 ) : arg_3 . unaccessible ( )

def Func(arg_0, arg_1, arg_2):
        """Ensure we are allowed to access this resource."""
        if arg_2 == 'OPTIONS':
            # Authorization should not be checked on an OPTIONS request.
            return

        arg_3 = arg_0.meta.authorization
        if not arg_3.is_accessible(arg_1, arg_2, arg_0):
            # User is not authorized; raise an appropriate message.
            arg_3.unaccessible()

Ensure we are allowed to access this resource .


def Func(arg_0, arg_1=False, arg_2=False):
    """Iterate reversal points in the series.

    A reversal point is a point in the series at which the first derivative
    changes sign. Reversal is undefined at the first (last) point because the
    derivative before (after) this point is undefined. The first and the last
    points may be treated as Func by setting the optional parameters
    `left` and `right` to True.

    Parameters
    ----------
    series : iterable sequence of numbers
    left: bool, optional
        If True, yield the first point in the series (treat it as a reversal).
    right: bool, optional
        If True, yield the last point in the series (treat it as a reversal).

    Yields
    ------
    float
        Reversal points.
    """
    arg_0 = iter(arg_0)

    arg_3, arg_4 = next(arg_0), next(arg_0)
    arg_5 = (arg_4 - arg_3)

    if arg_1:
        yield arg_3
    for arg_6 in arg_0:
        if arg_6 == arg_4:
            continue
        arg_7 = arg_6 - arg_4
        if arg_5 * arg_7 < 0:
            yield arg_4
        arg_3, arg_4 = arg_4, arg_6
        arg_5 = arg_7
    if arg_2:
        yield arg_6

Iterate reversal points in the series.

    A reversal point is a point in the series at which the first derivative
    changes sign. Reversal is undefined at the first (last) point because the
    derivative before (after) this point is undefined. The first and the last
    points may be treated as reversals by setting the optional parameters
    `left` and `right` to True.

    Parameters
    ----------
    series : iterable sequence of numbers
    left: bool, optional
        If True, yield the first point in the series (treat it as a reversal).
    right: bool, optional
        If True, yield the last point in the series (treat it as a reversal).

    Yields
    ------
    float
        Reversal points.


(tdelta, fmt='{D:02}d {H:02}h {M:02}m {S:02}s', input_type='timedelta')

def Func(arg_0, arg_1='{D:02}d {H:02}h {M:02}m {S:02}s', arg_2='timedelta'):
    """
    Convert a datetime.timedelta object or a regular number to a custom-formatted string.

    This function works like the strftime() method works for datetime.datetime
    objects.

    The fmt argument allows custom formatting to be specified.  Fields can
    include seconds, minutes, hours, days, and weeks.  Each field is optional.

    Arguments:
        tdelta (datetime.timedelta, int): time delta object containing the duration or an integer
            to go with the input_type.
        fmt (str): Expected format of the time delta. place holders can only be one of the following.
            1. D to extract days from time delta
            2. H to extract hours from time delta
            3. M to extract months from time delta
            4. S to extract seconds from timedelta
        input_type (str):  The input_type argument allows tdelta to be a regular number instead of the
            default, which is a datetime.timedelta object.
            Valid input_type strings:
                1. 's', 'seconds',
                2. 'm', 'minutes',
                3. 'h', 'hours',
                4. 'd', 'days',
                5. 'w', 'weeks'
    Returns:
        (str): timedelta object interpolated into a string following the given format.

    Examples:
        '{D:02}d {H:02}h {M:02}m {S:02}s' --> '05d 08h 04m 02s' (default)
        '{W}w {D}d {H}:{M:02}:{S:02}'     --> '4w 5d 8:04:02'
        '{D:2}d {H:2}:{M:02}:{S:02}'      --> ' 5d  8:04:02'
        '{H}h {S}s'                       --> '72h 800s'
    """
    # Convert tdelta to integer seconds.
    if arg_2 == 'timedelta':
        arg_3 = int(arg_0.total_seconds())
    elif arg_2 in ['s', 'seconds']:
        arg_3 = int(arg_0)
    elif arg_2 in ['m', 'minutes']:
        arg_3 = int(arg_0) * 60
    elif arg_2 in ['h', 'hours']:
        arg_3 = int(arg_0) * 3600
    elif arg_2 in ['d', 'days']:
        arg_3 = int(arg_0) * 86400
    elif arg_2 in ['w', 'weeks']:
        arg_3 = int(arg_0) * 604800
    else:
        raise ValueError(
            'input_type is not valid. Valid input_type strings are: "timedelta", "s", "m", "h", "d", "w"'
        )

    arg_4 = Formatter()
    arg_5 = [field_tuple[1] for field_tuple in arg_4.parse(arg_1)]
    arg_6 = ('W', 'D', 'H', 'M', 'S')
    arg_7 = {'W': 604800, 'D': 86400, 'H': 3600, 'M': 60, 'S': 1}
    arg_8 = {}

    for arg_9 in arg_6:
        if arg_9 in arg_5 and arg_9 in arg_7:
            arg_8[arg_9], arg_3 = divmod(arg_3, arg_7[arg_9])

    return arg_4.format(arg_1, **arg_8)

Convert a datetime . timedelta object or a regular number to a custom - formatted string .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_1
=
TIMEZONE
if
is_localized
(
arg_0
)
:
raise
ValueError
(
"Func expects a naive datetime, got %s"
%
arg_0
)
if
hasattr
(
arg_0
,
'fold'
)
:
arg_0
=
arg_0
.
replace
(
fold
=
1
)
if
hasattr
(
arg_1
,
'localize'
)
:
return
arg_1
.
localize
(
arg_0
)
elif
hasattr
(
arg_1
,
'convert'
)
:
return
arg_1
.
convert
(
arg_0
)
else
:
return
arg_0
.
replace
(
tzinfo
=
arg_1
)

def Func(arg_0, arg_1=None):
    """
    Make a naive datetime.datetime in a given time zone aware.

    :param value: datetime
    :param timezone: timezone
    :return: localized datetime in settings.TIMEZONE or timezone

    """
    if arg_1 is None:
        arg_1 = TIMEZONE

    # Check that we won't overwrite the timezone of an aware datetime.
    if is_localized(arg_0):
        raise ValueError(
            "Func expects a naive datetime, got %s" % arg_0)
    if hasattr(arg_0, 'fold'):
        # In case of python 3.6 we want to do the same that pendulum does for python3.5
        # i.e in case we move clock back we want to schedule the run at the time of the second
        # instance of the same clock time rather than the first one.
        # Fold parameter has no impact in other cases so we can safely set it to 1 here
        arg_0 = arg_0.replace(fold=1)
    if hasattr(arg_1, 'localize'):
        # This method is available for pytz time zones.
        return arg_1.localize(arg_0)
    elif hasattr(arg_1, 'convert'):
        # For pendulum
        return arg_1.convert(arg_0)
    else:
        # This may be wrong around DST changes!
        return arg_0.replace(tzinfo=arg_1)

Make a naive datetime . datetime in a given time zone aware .


return [{'timestamp': track['timestamp'], **f(track)} for track in data['items']]

async def Func ( arg_0 ) -> List [ Dict [ str , Union [ Track , Context , str ] ] ] : arg_1 = await arg_0 . http . Func ( ) arg_2 = lambda arg_1 : { 'context' : Context ( arg_1 . get ( 'context' ) ) , 'track' : Track ( arg_0 . __client , arg_1 . get ( 'track' ) ) } return [ { 'timestamp' : arg_3 [ 'timestamp' ] , ** arg_2 ( arg_3 ) } for arg_3 in arg_1 [ 'items' ] ]

async def Func(arg_0) -> List[Dict[str, Union[Track, Context, str]]]:
        """Get tracks from the current users recently played tracks.

        Returns
        -------
        playlist_history : List[Dict[str, Union[Track, Context, str]]]
            A list of playlist history object.
            Each object is a dict with a timestamp, track and context field.
        """
        arg_1 = await arg_0.http.Func()
        arg_2 = lambda arg_1: {'context': Context(arg_1.get('context')), 'track': Track(arg_0.__client, arg_1.get('track'))}
        # List[T] where T: {'track': Track, 'content': Context: 'timestamp': ISO8601}
        return [{'timestamp': arg_3['timestamp'], **arg_2(arg_3)} for arg_3 in arg_1['items']]

Get tracks from the current users recently played tracks .


def Func ( arg_0 , arg_1 , arg_2 ) : if not is_li ( arg_0 , arg_1 ) : return False arg_3 = get_namespace ( arg_0 , 'w' ) arg_4 = arg_0 while True : if arg_4 is None : return True arg_4 = arg_4 . getnext ( ) if not is_li ( arg_4 , arg_1 ) : continue arg_5 = get_numId ( arg_4 , arg_3 ) if arg_2 != arg_5 : return True return False

def Func(arg_0, arg_1, arg_2):
    """
    Determine if ``li`` is the last list item for a given list
    """
    if not is_li(arg_0, arg_1):
        return False
    arg_3 = get_namespace(arg_0, 'w')
    arg_4 = arg_0
    while True:
        # If we run out of element this must be the last list item
        if arg_4 is None:
            return True

        arg_4 = arg_4.getnext()
        # Ignore elements that are not a list item
        if not is_li(arg_4, arg_1):
            continue

        arg_5 = get_numId(arg_4, arg_3)
        if arg_2 != arg_5:
            return True
        # If we have gotten here then we have found another list item in the
        # current list, so ``li`` is not the last li in the list.
        return False

Determine if li is the last list item for a given list


(self, tabs, current_tab, group_current_tab)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Process and prepare tabs.

        This includes steps like updating references to the current tab,
        filtering out hidden tabs, sorting tabs etc...

        Args:
            tabs:
                The list of tabs to process.
            current_tab:
                The reference to the currently loaded tab.
            group_current_tab:
                The reference to the active tab in the current tab group. For
                parent tabs, this is different than for the current tab group.

        Returns:
            Processed list of tabs. Note that the method may have side effects.

        """
        # Update references to the current tab
        for arg_4 in arg_1:
            arg_4.current_tab = arg_2
            arg_4.group_current_tab = arg_3

        # Filter out hidden tabs
        arg_1 = list(filter(lambda arg_4: arg_4.tab_visible, arg_1))

        # Sort remaining tabs in-place
        arg_1.sort(key=lambda arg_4: arg_4.weight)

        return arg_1


def Func ( arg_0 ) : from zipimport import _zip_directory_cache as zdc _uncache ( arg_0 , zdc ) _uncache ( arg_0 , sys . path_importer_cache )

def Func(arg_0):
    """Ensure that the importer caches dont have stale info for `path`"""
    from zipimport import _zip_directory_cache as zdc
    _uncache(arg_0, zdc)
    _uncache(arg_0, sys.path_importer_cache)

Ensure that the importer caches dont have stale info for path


def Func ( arg_0 ) : arg_1 = loadtxt ( arg_0 , delimiter = '=' , dtype = scipy . string0 ) arg_2 = dict ( arg_1 ) for arg_3 in arg_2 . keys ( ) : arg_2 [ arg_3 ] = arg_2 [ arg_3 ] . strip ( ) arg_2 [ arg_3 . strip ( ) ] = arg_2 [ arg_3 ] del arg_2 [ arg_3 ] return arg_2

def Func(arg_0):
        """Loads a text file to a python dictionary using '=' as the delimiter

        :param file_name: the name and path of the text file
        """
        arg_1 = loadtxt(arg_0, delimiter='=', dtype=scipy.string0)
        arg_2 = dict(arg_1)
        for arg_3 in arg_2.keys():
            arg_2[arg_3] = arg_2[arg_3].strip()
            arg_2[arg_3.strip()] = arg_2[arg_3]
            del arg_2[arg_3]

        return arg_2

Loads a text file to a python dictionary using = as the delimiter


def Func(arg_0, arg_1):
        """Upload to Kibiter the title for the dashboard.

        The title is shown on top of the dashboard menu, and is Usually
        the name of the project being dashboarded.
        This is done only for Kibiter 6.x.

        :param kibiter_major: major version of kibiter
        """

        if arg_1 == "6":
            arg_2 = ".kibana/doc/projectname"
            arg_3 = {"projectname": {"name": arg_0.project_name}}
            arg_4 = ".kibana/_mapping/doc"
            arg_5 = {"dynamic": "true"}

            arg_6 = urijoin(arg_0.conf['es_enrichment']['url'], arg_2)
            arg_7 = urijoin(arg_0.conf['es_enrichment']['url'],
                                  arg_4)

            logger.debug("Adding mapping for dashboard title")
            arg_8 = arg_0.grimoire_con.put(arg_7, arg_3=json.dumps(arg_5),
                                        headers=ES6_HEADER)
            try:
                arg_8.raise_for_status()
            except requests.exceptions.HTTPError:
                logger.error("Couldn't create mapping for dashboard title.")
                logger.error(arg_8.json())

            logger.debug("Uploading dashboard title")
            arg_8 = arg_0.grimoire_con.post(arg_6, arg_3=json.dumps(arg_3),
                                         headers=ES6_HEADER)
            try:
                arg_8.raise_for_status()
            except requests.exceptions.HTTPError:
                logger.error("Couldn't create dashboard title.")
                logger.error(arg_8.json())

Upload to Kibiter the title for the dashboard .


(app, typ, rawtext, text, lineno, inliner, options={}, content=[])

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
{
}
,
arg_7
=
[
]
)
:
arg_3
=
utils
.
unescape
(
arg_3
)
try
:
arg_8
=
get_template_field
(
arg_0
.
env
,
arg_3
)
except
RoleException
as
e
:
arg_9
=
arg_5
.
reporter
.
error
(
"invalid class name %s \n%s"
%
(
arg_3
,
e
,
)
,
line
=
arg_4
)
arg_10
=
arg_5
.
problematic
(
arg_2
,
arg_2
,
arg_9
)
return
[
arg_10
]
,
[
arg_9
]
arg_11
=
nodes
.
inline
(
arg_2
=
arg_2
)
for
arg_12
,
arg_13
in
enumerate
(
arg_8
)
:
if
arg_12
!=
0
:
arg_11
+=
nodes
.
Text
(
", "
)
arg_11
+=
nodes
.
literal
(
arg_13
,
""
,
nodes
.
Text
(
arg_13
)
)
return
[
arg_11
]
,
[
]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6={}, arg_7=[]):
    """
    A role that allows you to include a list of template fields in the middle of the text. This is especially
    useful when writing guides describing how to use the operator.
    The result is a list of fields where each field is shorted in the literal block.

    Sample usage::

    :template-fields:`airflow.contrib.operators.gcp_natural_language_operator.CloudLanguageAnalyzeSentimentOperator`

    For further information look at:

    * [http://docutils.sourceforge.net/docs/howto/rst-roles.html](Creating reStructuredText Interpreted
      Text Roles)
    """
    arg_3 = utils.unescape(arg_3)

    try:
        arg_8 = get_template_field(arg_0.env, arg_3)
    except RoleException as e:
        arg_9 = arg_5.reporter.error("invalid class name %s \n%s" % (arg_3, e, ), line=arg_4)
        arg_10 = arg_5.problematic(arg_2, arg_2, arg_9)
        return [arg_10], [arg_9]

    arg_11 = nodes.inline(arg_2=arg_2)
    for arg_12, arg_13 in enumerate(arg_8):
        if arg_12 != 0:
            arg_11 += nodes.Text(", ")
        arg_11 += nodes.literal(arg_13, "", nodes.Text(arg_13))

    return [arg_11], []

A role that allows you to include a list of template fields in the middle of the text . This is especially useful when writing guides describing how to use the operator . The result is a list of fields where each field is shorted in the literal block .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
namedtuple
(
"ret"
,
[
"Hour"
,
"Min"
,
"Tariff"
,
"Period"
,
"Schedule"
]
)
arg_4
=
arg_0
.
m_schd_1_to_4
if
Schedules
.
Schedule_5
<=
arg_1
<=
Schedules
.
Schedule_6
:
arg_4
=
arg_0
.
m_schd_5_to_6
arg_2
+=
1
arg_1
+=
1
arg_3
.
Period
=
str
(
arg_2
)
arg_3
.
Schedule
=
str
(
arg_1
)
if
(
arg_1
<
1
)
or
(
arg_1
>
Extents
.
Schedules
)
or
(
arg_2
<
0
)
or
(
arg_2
>
Extents
.
Periods
)
:
ekm_log
(
"Out of bounds: tariff "
+
str
(
arg_2
)
+
" for schedule "
+
str
(
arg_1
)
)
arg_3
.
Hour
=
arg_3
.
Min
=
arg_3
.
Tariff
=
str
(
0
)
return
arg_3
arg_8
=
"Schedule_"
+
str
(
arg_1
)
+
"_Period_"
+
str
(
arg_2
)
+
"_Hour"
arg_9
=
"Schedule_"
+
str
(
arg_1
)
+
"_Period_"
+
str
(
arg_2
)
+
"_Min"
arg_10
=
"Schedule_"
+
str
(
arg_1
)
+
"_Period_"
+
str
(
arg_2
)
+
"_Tariff"
if
arg_8
not
in
arg_4
:
ekm_log
(
"Incorrect index: "
+
arg_8
)
arg_3
.
Hour
=
arg_3
.
Min
=
arg_3
.
Tariff
=
str
(
0
)
return
arg_3
if
arg_9
not
in
arg_4
:
ekm_log
(
"Incorrect index: "
+
arg_9
)
arg_3
.
Hour
=
arg_3
.
Min
=
arg_3
.
Tariff
=
str
(
0
)
return
arg_3
if
arg_10
not
in
arg_4
:
ekm_log
(
"Incorrect index: "
+
arg_10
)
arg_3
.
Hour
=
arg_3
.
Min
=
arg_3
.
Tariff
=
str
(
0
)
return
arg_3
arg_3
.
Hour
=
arg_4
[
arg_8
]
[
MeterData
.
StringValue
]
arg_3
.
Min
=
arg_4
[
arg_9
]
[
MeterData
.
StringValue
]
.
zfill
(
2
)
arg_3
.
Tariff
=
arg_4
[
arg_10
]
[
MeterData
.
StringValue
]
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """ Read a single schedule tariff from meter object buffer.

        Args:
            schedule (int): A :class:`~ekmmeters.Schedules` value or in range(Extent.Schedules).
            tariff (int): A :class:`~ekmmeters.Tariffs` value or in range(Extent.Tariffs).

        Returns:
            bool: True on completion.
        """
        arg_3 = namedtuple("ret", ["Hour", "Min", "Tariff", "Period", "Schedule"])
        arg_4 = arg_0.m_schd_1_to_4
        if Schedules.Schedule_5 <= arg_1 <= Schedules.Schedule_6:
            arg_4 = arg_0.m_schd_5_to_6
        arg_2 += 1
        arg_1 += 1
        arg_3.Period = str(arg_2)
        arg_3.Schedule = str(arg_1)
        if (arg_1 < 1) or (arg_1 > Extents.Schedules) or (arg_2 < 0) or (arg_2 > Extents.Periods):
            ekm_log("Out of bounds: tariff " + str(arg_2) + " for schedule " + str(arg_1))
            arg_3.Hour = arg_3.Min = arg_3.Tariff = str(0)
            return arg_3

        arg_8 = "Schedule_" + str(arg_1) + "_Period_" + str(arg_2) + "_Hour"
        arg_9 = "Schedule_" + str(arg_1) + "_Period_" + str(arg_2) + "_Min"
        arg_10 = "Schedule_" + str(arg_1) + "_Period_" + str(arg_2) + "_Tariff"

        if arg_8 not in arg_4:
            ekm_log("Incorrect index: " + arg_8)
            arg_3.Hour = arg_3.Min = arg_3.Tariff = str(0)
            return arg_3

        if arg_9 not in arg_4:
            ekm_log("Incorrect index: " + arg_9)
            arg_3.Hour = arg_3.Min = arg_3.Tariff = str(0)
            return arg_3

        if arg_10 not in arg_4:
            ekm_log("Incorrect index: " + arg_10)
            arg_3.Hour = arg_3.Min = arg_3.Tariff = str(0)
            return arg_3

        arg_3.Hour = arg_4[arg_8][MeterData.StringValue]
        arg_3.Min = arg_4[arg_9][MeterData.StringValue].zfill(2)
        arg_3.Tariff = arg_4[arg_10][MeterData.StringValue]
        return arg_3

Read a single schedule tariff from meter object buffer .


return (os.path.exists(name)
            or os.path.dirname(name)
            or name.endswith('.py')
            or not ident_re.match(os.path.splitext(name)[0]))

def Func ( arg_0 ) : return ( os . path . exists ( arg_0 ) or os . path . dirname ( arg_0 ) or arg_0 . endswith ( '.py' ) or not ident_re . match ( os . path . splitext ( arg_0 ) [ 0 ] ) )

def Func(arg_0):
    """A name is file-like if it is a path that exists, or it has a
    directory part, or it ends in .py, or it isn't a legal python
    identifier.
    """
    return (os.path.exists(arg_0)
            or os.path.dirname(arg_0)
            or arg_0.endswith('.py')
            or not ident_re.match(os.path.splitext(arg_0)[0]))

A name is file - like if it is a path that exists or it has a directory part or it ends in . py or it isn t a legal python identifier .


Return a new Streamlet containing only the elements that satisfy filter_function

def Func ( arg_0 , arg_1 ) : from heronpy . streamlet . impl . Funcbolt import FilterStreamlet arg_2 = FilterStreamlet ( arg_1 , arg_0 ) arg_0 . _add_child ( arg_2 ) return arg_2

def Func(arg_0, arg_1):
    """Return a new Streamlet containing only the elements that satisfy Func_function
    """
    from heronpy.streamlet.impl.Funcbolt import FilterStreamlet
    arg_2 = FilterStreamlet(arg_1, arg_0)
    arg_0._add_child(arg_2)
    return arg_2


def Func(arg_0):
        """Only display unpublished content to authenticated users, filter by
        query parameter if present."""

        # Get base queryset from DispatchPublishableMixin
        arg_1 = arg_0.get_publishable_queryset()

        arg_1 = arg_1.order_by('-updated_at')

        # Optionally filter by a query parameter
        arg_2 = arg_0.request.query_params.get('q')

        if arg_2:
            arg_1 = arg_1.filter(title__icontains=arg_2)

        return arg_1

Only display unpublished content to authenticated users filter by query parameter if present .


def Func(arg_0, **arg_1):
        """
        Get the list of Func movies on The Movie Database. This list
        refreshes every day.

        Args:
            page: (optional) Minimum value of 1.  Expected value is an integer.
            language: (optional) ISO 639-1 code.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the list of popular movies on The Movie Database. This list
        refreshes every day.

        Args:
            page: (optional) Minimum value of 1.  Expected value is an integer.
            language: (optional) ISO 639-1 code.

        Returns:
            A dict representation of the JSON returned from the API.

Get the list of popular movies on The Movie Database . This list refreshes every day .


def Func ( arg_0 , arg_1 = arg_2 ( ) , arg_3 = None ) : arg_4 = toRtl ( arg_0 , arg_1 = arg_1 , saveTo = arg_3 , serializer = SimModelSerializer ) if arg_3 is not None : arg_5 = os . path . join ( os . getcwd ( ) , arg_3 ) arg_6 = arg_5 in sys . path if not arg_6 : sys . path . insert ( 0 , arg_5 ) if arg_0 . _name in sys . modules : del sys . modules [ arg_0 . _name ] arg_7 = importlib . import_module ( arg_0 . _name ) if not arg_6 : sys . path . remove ( arg_5 ) else : arg_7 = ModuleType ( 'simModule' ) exec ( arg_4 , arg_7 . __dict__ ) return arg_7 . __dict__ [ arg_0 . _name ]

def Func(arg_0, arg_1=arg_2(), arg_3=None):
    """
    Create a simulation model for unit

    :param unit: interface level unit which you wont prepare for simulation
    :param targetPlatform: target platform for this synthes
    :param dumpModelIn: folder to where put sim model files
        (otherwise sim model will be constructed only in memory)
    """
    arg_4 = toRtl(arg_0,
                     arg_1=arg_1,
                     saveTo=arg_3,
                     serializer=SimModelSerializer)
    if arg_3 is not None:
        arg_5 = os.path.join(os.getcwd(), arg_3)
        arg_6 = arg_5 in sys.path
        if not arg_6:
            sys.path.insert(0, arg_5)
        if arg_0._name in sys.modules:
            del sys.modules[arg_0._name]
        arg_7 = importlib.import_module(arg_0._name)

        if not arg_6:
            sys.path.remove(arg_5)
    else:
        arg_7 = ModuleType('simModule')
        # python supports only ~100 opened brackets
        # it exceded it throws MemoryError: s_push: parser stack overflow
        exec(arg_4, arg_7.__dict__)

    return arg_7.__dict__[arg_0._name]


def Func(arg_0, arg_1):
        """Runs HTTP GET request to retrieve the list of datasets."""
        arg_2 = arg_0.DATASOURCES_URI_FMT.format(arg_1)
        return arg_0._send_get_req(arg_2)

Runs HTTP GET request to retrieve the list of datasets .


(mol, impropers, scale, banned_lines=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Scale improper dihedrals"""
        if arg_3 is None:
                arg_3 = []
        arg_4 = []
        for arg_5 in arg_0.impropers:
                arg_6 = (arg_5.atom1.get_atomtype(), arg_5.atom2.get_atomtype(),
                          arg_5.atom3.get_atomtype(), arg_5.atom4.get_atomtype())
                arg_6 = [a.replace("_", "").replace("=", "") for a in arg_6]

                # special-case: this is a [ dihedral ] override in molecule block, continue and don't match
                if arg_5.gromacs['param'] != []:
                    for arg_7 in arg_5.gromacs['param']:
                        arg_7['kpsi'] *= arg_2
                    arg_4.append(arg_5)
                    continue

                for arg_8 in range(32):
                        if  (arg_8%2==0):
                                arg_9=arg_6[0]; arg_10=arg_6[1]; arg_11=arg_6[2]; arg_12=arg_6[3];
                        else:
                                arg_9=arg_6[3]; arg_10=arg_6[2]; arg_11=arg_6[1]; arg_12=arg_6[0];
                        if((arg_8//2)%2==1): arg_9="X";
                        if((arg_8//4)%2==1): arg_10="X";
                        if((arg_8//8)%2==1): arg_11="X";
                        if((arg_8//16)%2==1): arg_12="X";
                        arg_13 = "{0}-{1}-{2}-{3}-{4}".format(arg_9, arg_10, arg_11, arg_12, arg_5.gromacs['func'])
                        if (arg_13 in arg_1):
                                for arg_14, arg_15 in enumerate(arg_1[arg_13]):
                                        arg_16 = copy.deepcopy(arg_5)
                                        arg_17 = copy.deepcopy(arg_15.gromacs['param'])
                                        # Only check the first dihedral in a list
                                        if not arg_1[arg_13][0].line in arg_3:
                                                for arg_7 in arg_17: arg_7['kpsi'] *= arg_2
                                        arg_16.gromacs['param'] = arg_17
                                        if arg_14 == 0:
                                                arg_16.comment = "; banned lines {0} found={1}\n ; parameters for types {2}-{3}-{4}-{5}-9 at LINE({6})\n".format(
                                                        " ".join(map(str, arg_3)),
                                                        1 if arg_15.line in arg_3 else 0,
                                                        arg_15.atype1, arg_15.atype2, arg_15.atype3, arg_15.atype4, arg_15.line)
                                        arg_4.append(arg_16)
                                break
        #assert(len(mol.impropers) == new_impropers)
        arg_0.impropers = arg_4
        return arg_0


def Func ( arg_0 , * arg_1 ) : for arg_2 in arg_1 : if isinstance ( arg_2 , string_types ) : arg_0 . _Func_entries ( database . parse_string ( arg_2 , bib_format = 'bibtex' ) ) else : arg_0 . _Func_entries ( arg_2 )

def Func(arg_0, *arg_1):
        """
        Add a source, either specified by glottolog reference id, or as bibtex record.
        """
        for arg_2 in arg_1:
            if isinstance(arg_2, string_types):
                arg_0._Func_entries(database.parse_string(arg_2, bib_format='bibtex'))
            else:
                arg_0._Func_entries(arg_2)

Add a source either specified by glottolog reference id or as bibtex record .


def Func(arg_0, arg_1, arg_2):
        ''' Adds an error to the given product's field '''

        ''' if product in field_names:
            field = field_names[product]
        elif isinstance(product, inventory.Product):
            return
        else:
            field = None '''

        arg_0.add_error(arg_0.field_name(arg_1), arg_2)

Adds an error to the given product s field


def
Func
(
arg_0
)
:
arg_0
=
nptdms
.
TdmsFile
(
arg_0
)
arg_1
=
[
]
arg_2
=
[
]
for
arg_3
in
arg_0
.
objects
.
values
(
)
:
if
arg_3
.
data
is
not
and
len
(
arg_3
.
data
)
:
arg_4
=
arg_3
.
path
.
split
(
'/'
)
[
1
]
.
strip
(
"'"
)
if
"unit_string"
in
arg_3
.
properties
:
arg_5
=
arg_3
.
properties
[
"unit_string"
]
arg_1
.
append
(
"{} [{}]"
.
format
(
arg_4
,
arg_5
)
)
else
:
arg_1
.
append
(
arg_4
)
arg_2
.
append
(
arg_3
.
data
)
return
arg_1
,
arg_2

def Func(arg_0):
    """Read tdms file and return channel names and data"""
    arg_0 = nptdms.TdmsFile(arg_0)
    arg_1 = []
    arg_2 = []

    for arg_3 in arg_0.objects.values():
        if arg_3.data is not None and len(arg_3.data):
            arg_4 = arg_3.path.split('/')[-1].strip("'")
            if "unit_string" in arg_3.properties:
                arg_5 = arg_3.properties["unit_string"]
                arg_1.append("{} [{}]".format(arg_4, arg_5))
            else:
                arg_1.append(arg_4)

            arg_2.append(arg_3.data)

    return arg_1, arg_2


return articleno, headers, "".join(body)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = None if arg_1 is not None : arg_3 = utils . unparse_msgid_Func ( arg_1 ) arg_4 , arg_5 = arg_0 . command ( "ARTICLE" , arg_3 ) if arg_4 != 220 : raise NNTPReplyError ( arg_4 , arg_5 ) arg_6 = arg_5 . split ( None , 1 ) try : arg_7 = int ( arg_6 [ 0 ] ) except ValueError : raise NNTPProtocolError ( arg_5 ) arg_8 = utils . parse_headers ( arg_0 . info_gen ( arg_4 , arg_5 ) ) arg_2 = "yEnc" in arg_8 . get ( "subject" , "" ) arg_9 = 0 arg_10 = 0 arg_11 = [ ] for arg_12 in arg_0 . info_gen ( arg_4 , arg_5 ) : if arg_2 : if arg_12 . startswith ( "=y" ) : continue arg_12 , arg_9 , arg_10 = yenc . decode ( arg_12 , arg_9 , arg_10 ) arg_11 . append ( arg_12 ) return arg_7 , arg_8 , "" . join ( arg_11 )

def Func(arg_0, arg_1=None, arg_2=None):
        """ARTICLE command.
        """
        arg_3 = None
        if arg_1 is not None:
            arg_3 = utils.unparse_msgid_Func(arg_1)

        arg_4, arg_5 = arg_0.command("ARTICLE", arg_3)
        if arg_4 != 220:
            raise NNTPReplyError(arg_4, arg_5)

        arg_6 = arg_5.split(None, 1)

        try:
            arg_7 = int(arg_6[0])
        except ValueError:
            raise NNTPProtocolError(arg_5)

        # headers
        arg_8 = utils.parse_headers(arg_0.info_gen(arg_4, arg_5))

        # decoding setup
        arg_2 = "yEnc" in arg_8.get("subject", "")
        arg_9 = 0
        arg_10 = 0

        # body
        arg_11 = []
        for arg_12 in arg_0.info_gen(arg_4, arg_5):

            # decode body if required
            if arg_2:
                if arg_12.startswith("=y"):
                    continue
                arg_12, arg_9, arg_10 = yenc.decode(arg_12, arg_9, arg_10)

            arg_11.append(arg_12)

        return arg_7, arg_8, "".join(arg_11)


def Func ( arg_0 , arg_1 ) : def check_oauth ( arg_2 , * arg_3 , ** arg_4 ) : if arg_0 . _in_error : arg_0 . _display_error_message ( arg_2 ) return arg_5 = users . get_current_user ( ) if not arg_5 : arg_2 . redirect ( users . create_login_url ( arg_2 . request . uri ) ) return arg_0 . _create_flow ( arg_2 ) arg_0 . flow . params [ 'state' ] = _build_state_value ( arg_2 , arg_5 ) arg_0 . credentials = arg_0 . _storage_class ( arg_0 . _credentials_class , None , arg_0 . _credentials_property_name , arg_5 = arg_5 ) . get ( ) if not arg_0 . has_credentials ( ) : return arg_2 . redirect ( arg_0 . authorize_url ( ) ) try : arg_9 = arg_1 ( arg_2 , * arg_3 , ** arg_4 ) except client . AccessTokenRefreshError : return arg_2 . redirect ( arg_0 . authorize_url ( ) ) finally : arg_0 . credentials = None return arg_9 return check_oauth

def Func(arg_0, arg_1):
        """Decorator that starts the OAuth 2.0 dance.

        Starts the OAuth dance for the logged in user if they haven't already
        granted access for this application.

        Args:
            method: callable, to be decorated method of a webapp.RequestHandler
                    instance.
        """

        def check_oauth(arg_2, *arg_3, **arg_4):
            if arg_0._in_error:
                arg_0._display_error_message(arg_2)
                return

            arg_5 = users.get_current_user()
            # Don't use @login_decorator as this could be used in a
            # POST request.
            if not arg_5:
                arg_2.redirect(users.create_login_url(
                    arg_2.request.uri))
                return

            arg_0._create_flow(arg_2)

            # Store the request URI in 'state' so we can use it later
            arg_0.flow.params['state'] = _build_state_value(
                arg_2, arg_5)
            arg_0.credentials = arg_0._storage_class(
                arg_0._credentials_class, None,
                arg_0._credentials_property_name, arg_5=arg_5).get()

            if not arg_0.has_credentials():
                return arg_2.redirect(arg_0.authorize_url())
            try:
                arg_9 = arg_1(arg_2, *arg_3, **arg_4)
            except client.AccessTokenRefreshError:
                return arg_2.redirect(arg_0.authorize_url())
            finally:
                arg_0.credentials = None
            return arg_9

        return check_oauth

Decorator that starts the OAuth 2 . 0 dance .


def Func(arg_0):
    """Tries to escape the values that are passed to filter as correctly as possible.

    No standard way is followed, but at least it is simple.
    """
    if arg_0 is None:
        return u'NULL'
    if isinstance(arg_0, int):
        return str(arg_0)
    if not isinstance(arg_0, six.string_types):
        raise ValueError('Filters take only None, int or a string type')
    if not arg_0:
        # Empty string
        return u"''"
    # Now enforce unicode
    arg_0 = unicode_process(arg_0)
    if u'"' not in arg_0:
        # Simple case, just put the quote that does not exist in the string
        return u'"' + arg_0 + u'"'
    elif u"'" not in arg_0:
        # Simple case, just put the quote that does not exist in the string
        return u"'" + arg_0 + u"'"
    else:
        # Both are there, so start guessing
        # Empty strings are sorted out, so the string must contain something.
        # String with length == 1 are sorted out because if they have a quote, they would be quoted
        # with the another quote in preceeding branch. Therefore the string is at least 2 chars long
        # here which allows us to NOT check the length here.
        arg_1 = arg_0[0]
        arg_2 = arg_0[-1]
        if arg_1 in QUOTES and arg_2 in QUOTES:
            # The first and last chars definitely are quotes
            if arg_1 == arg_2:
                # Simple, just put another ones around them
                arg_3 = give_another_quote(arg_1)
                return arg_3 + arg_0 + arg_3
            else:
                # I don't like this but the nature of the escape is like that ...
                # Since now it uses both of the quotes, just pick the simple ones and surround it
                return u"'" + arg_0 + u"'"
        elif arg_1 not in QUOTES and arg_2 not in QUOTES:
            # First and last chars are not quotes, so a simple solution
            return u"'" + arg_0 + u"'"
        else:
            # One of the first or last chars is not a quote
            if arg_1 in QUOTES:
                arg_3 = give_another_quote(arg_1)
            else:
                # last_char
                arg_3 = give_another_quote(arg_2)
            return arg_3 + arg_0 + arg_3

Tries to escape the values that are passed to filter as correctly as possible .


return (
            ('!register-success (?P<cmd_channel>.+)', self.require_boss(self.register_success)),
            ('!worker-execute (?:\((?P<workers>.+?)\) )?(?P<task_id>\d+):(?P<command>.+)', self.require_boss(self.worker_execute)),
            ('!worker-ping', self.require_boss(self.worker_ping_handler)),
            ('!worker-stop', self.require_boss(self.worker_stop)),
        )

def Func(arg_0):
        """\
        Actual messages listened for by the worker bot - note that worker-execute
        actually dispatches again by adding the command to the task queue,
        from which it is pulled then matched against self.task_patterns
        """
        return (
            ('!register-success (?P<cmd_channel>.+)', arg_0.require_boss(arg_0.register_success)),
            ('!worker-execute (?:\((?P<workers>.+?)\) )?(?P<task_id>\d+):(?P<command>.+)', arg_0.require_boss(arg_0.worker_execute)),
            ('!worker-ping', arg_0.require_boss(arg_0.worker_ping_handler)),
            ('!worker-stop', arg_0.require_boss(arg_0.worker_stop)),
        )

\ Actual messages listened for by the worker bot - note that worker - execute actually dispatches again by adding the command to the task queue from which it is pulled then matched against self . task_patterns


def Func(arg_0, arg_1, arg_2=None):
    """Main executor of the assembly_report template.

    Parameters
    ----------
    sample_id : str
        Sample Identification string.
    assembly_file : str
        Path to assembly file in Fasta format.

    """

    logger.info("Starting assembly report")
    arg_3 = Assembly(arg_1, arg_0)

    logger.info("Retrieving summary statistics for assembly")
    arg_3.get_summary_stats("{}_assembly_report.csv".format(arg_0))

    arg_4 = [len(x) for x in arg_3.contigs.values()]
    arg_5 = {
        "tableRow": [{
            "sample": arg_0,
            "data": [
                {"header": "Contigs",
                 "value": arg_3.summary_info["ncontigs"],
                 "table": "assembly",
                 "columnBar": True},
                {"header": "Assembled BP",
                 "value": arg_3.summary_info["total_len"],
                 "table": "assembly",
                 "columnBar": True},
            ]
        }],
        "plotData": [{
            "sample": arg_0,
            "data": {
                "size_dist": arg_4
            }
        }]
    }

    if arg_2:
        try:
            arg_6 = 2000
            arg_7 = arg_3.get_gc_sliding(arg_6=arg_6)
            arg_8 = \
                arg_3.get_coverage_sliding(arg_2,
                                                  arg_6=arg_6)

            # Get total basepairs based on the individual coverage of each
            # contig bpx
            arg_9 = sum(
                [sum(x) for x in arg_3.contig_coverage.values()]
            )

            # Add data to json report
            arg_5["plotData"][0]["data"]["genomeSliding"] = {
                "gcData": arg_7,
                "covData": arg_8,
                "window": arg_6,
                "xbars": arg_3._get_window_labels(arg_6),
                "assemblyFile": os.path.basename(arg_1)
            }
            arg_5["plotData"][0]["data"]["sparkline"] = arg_9

        except:
            logger.error("Unexpected error creating sliding window data:\\n"
                         "{}".format(traceback.format_exc()))

    # Write json report
    with open(".report.json", "w") as json_report:

        json_report.write(json.dumps(arg_5, separators=(",", ":")))

    with open(".status", "w") as status_fh:
        status_fh.write("pass")

Main executor of the assembly_report template .


def Func(arg_0, arg_1):
        """
        Transmit content metadata deletion to integrated channel.
        """
        for arg_2 in chunks(arg_1, arg_0.enterprise_configuration.transmission_chunk_size):
            arg_3 = arg_0._serialize_items(list(arg_2.values()))
            try:
                arg_0.client.delete_content_metadata(arg_3)
            except ClientError as exc:
                LOGGER.error(
                    'Failed to delete [%s] content metadata items for integrated channel [%s] [%s]',
                    len(arg_2),
                    arg_0.enterprise_configuration.enterprise_customer.name,
                    arg_0.enterprise_configuration.channel_code,
                )
                LOGGER.error(exc)
            else:
                arg_0._delete_transmissions(arg_2.keys())

Transmit content metadata deletion to integrated channel .


return (not end or end > now) and \
           (not enrollment_start or enrollment_start < now) and \
           (not enrollment_end or enrollment_end > now)

def Func ( arg_0 ) : arg_1 = datetime . datetime . now ( pytz . UTC ) arg_2 = parse_datetime_handle_invalid ( arg_0 . get ( 'end' ) ) arg_3 = parse_datetime_handle_invalid ( arg_0 . get ( 'enrollment_start' ) ) arg_4 = parse_datetime_handle_invalid ( arg_0 . get ( 'enrollment_end' ) ) return ( not arg_2 or arg_2 > arg_1 ) and ( not arg_3 or arg_3 < arg_1 ) and ( not arg_4 or arg_4 > arg_1 )

def Func(arg_0):
    """
    Return true if the course run is enrollable, false otherwise.

    We look for the following criteria:
    - end is greater than now OR null
    - enrollment_start is less than now OR null
    - enrollment_end is greater than now OR null
    """
    arg_1 = datetime.datetime.now(pytz.UTC)
    arg_2 = parse_datetime_handle_invalid(arg_0.get('end'))
    arg_3 = parse_datetime_handle_invalid(arg_0.get('enrollment_start'))
    arg_4 = parse_datetime_handle_invalid(arg_0.get('enrollment_end'))
    return (not arg_2 or arg_2 > arg_1) and \
           (not arg_3 or arg_3 < arg_1) and \
           (not arg_4 or arg_4 > arg_1)

Return true if the course run is enrollable false otherwise .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
logger
.
debug
(
'Retrieving recipe by id: '
+
arg_1
)
arg_2
=
'%(base_url)s/recipe/%(recipe_id)s'
%
{
'base_url'
:
arg_0
.
base_url
,
'recipe_id'
:
arg_1
}
arg_3
=
arg_0
.
gbdx_connection
.
Func
(
arg_2
)
arg_3
.
raise_for_status
(
)
return
arg_3
.
json
(
)

def Func(arg_0, arg_1):
        '''
        Retrieves an AnswerFactory Recipe by id

        Args:
            recipe_id The id of the recipe

        Returns:
            A JSON representation of the recipe
        '''
        arg_0.logger.debug('Retrieving recipe by id: ' + arg_1)
        arg_2 = '%(base_url)s/recipe/%(recipe_id)s' % {
            'base_url': arg_0.base_url, 'recipe_id': arg_1
        }
        arg_3 = arg_0.gbdx_connection.Func(arg_2)
        arg_3.raise_for_status()
        return arg_3.json()


return jsonify_good_event(line.split('\t'), known_fields, add_geolocation_data)

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = True ) : return jsonify_good_event ( arg_0 . split ( '\t' ) , arg_1 , arg_3 )

def Func(arg_0, arg_1=arg_2, arg_3=True):
    """
    Convert a Snowplow enriched event TSV into a JSON
    """
    return jsonify_good_event(arg_0.split('\t'), arg_1, arg_3)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
arg_0
.
storage
.
listdir
(
arg_1
)
for
arg_4
in
arg_3
:
arg_5
=
os
.
path
.
join
(
arg_1
,
arg_4
)
if
arg_0
.
dry_run
:
arg_0
.
log
(
"Pretending to delete '%s'"
%
smart_text
(
arg_5
)
,
level
=
1
)
else
:
arg_0
.
log
(
"Deleting '%s'"
%
smart_text
(
arg_5
)
,
level
=
1
)
arg_0
.
storage
.
delete
(
arg_5
)
for
arg_6
in
arg_2
:
arg_0
.
Func
(
os
.
path
.
join
(
arg_1
,
arg_6
)
)

def Func(arg_0, arg_1):
        """
        Deletes the given relative path using the destination storage backend.
        """
        arg_2, arg_3 = arg_0.storage.listdir(arg_1)
        for arg_4 in arg_3:
            arg_5 = os.path.join(arg_1, arg_4)
            if arg_0.dry_run:
                arg_0.log("Pretending to delete '%s'" %
                         smart_text(arg_5), level=1)
            else:
                arg_0.log("Deleting '%s'" % smart_text(arg_5), level=1)
                arg_0.storage.delete(arg_5)
        for arg_6 in arg_2:
            arg_0.Func(os.path.join(arg_1, arg_6))

Deletes the given relative path using the destination storage backend .


def
Func
(
arg_0
)
:
arg_1
=
[
(
0x00
,
0x08
)
,
(
0x0B
,
0x1F
)
,
(
0x7F
,
0x84
)
,
(
0x86
,
0x9F
)
]
arg_2
=
[
'%s-%s'
%
(
chr
(
low
)
,
chr
(
high
)
)
for
(
low
,
high
)
in
arg_1
if
low
<
sys
.
maxunicode
]
arg_3
=
re
.
compile
(
'[%s]'
%
''
.
join
(
arg_2
)
)
arg_4
=
''
for
arg_5
in
arg_0
:
if
arg_3
.
search
(
arg_5
)
is
not
:
arg_5
=
' '
arg_4
+=
arg_5
return
arg_4

def Func(arg_0):
    """Remove control and invalid characters from an xml stream.

    Looks for invalid characters and subtitutes them with whitespaces.
    This solution is based on these two posts: Olemis Lang's reponse
    on StackOverflow (http://stackoverflow.com/questions/1707890) and
    lawlesst's on GitHub Gist (https://gist.github.com/lawlesst/4110923),
    that is based on the previous answer.

    :param xml: XML stream

    :returns: a purged XML stream
    """
    arg_1 = [(0x00, 0x08), (0x0B, 0x1F),
                       (0x7F, 0x84), (0x86, 0x9F)]

    arg_2 = ['%s-%s' % (chr(low), chr(high))
                      for (low, high) in arg_1
                      if low < sys.maxunicode]

    arg_3 = re.compile('[%s]' % ''.join(arg_2))

    arg_4 = ''

    for arg_5 in arg_0:
        if arg_3.search(arg_5) is not None:
            arg_5 = ' '
        arg_4 += arg_5

    return arg_4

Remove control and invalid characters from an xml stream .


def Func ( arg_0 , arg_1 = None ) : from graphviz import Graph , Digraph arg_2 = arg_0 . _graph ( ) arg_1 = arg_1 or Digraph ( comment = arg_0 . expression ) def walk ( arg_2 ) : if isinstance ( arg_2 , six . string_types ) : arg_1 . node ( arg_2 , arg_2 ) return arg_2 , arg_2 else : arg_3 , arg_4 , arg_5 , arg_6 = arg_2 arg_7 = arg_3 arg_1 . node ( arg_7 , arg_3 ) for arg_8 in arg_6 : arg_9 , arg_8 = walk ( arg_8 ) arg_1 . edge ( arg_7 , arg_9 ) return arg_7 , arg_2 walk ( arg_2 ) return arg_1

def Func(arg_0, arg_1=None):
        """Return a graphviz.Digraph object with a graph of the expression"""
        from graphviz import Graph, Digraph
        arg_2 = arg_0._graph()
        arg_1 = arg_1 or Digraph(comment=arg_0.expression)
        def walk(arg_2):
            if isinstance(arg_2, six.string_types):
                arg_1.node(arg_2, arg_2)
                return arg_2, arg_2
            else:
                arg_3, arg_4, arg_5, arg_6 = arg_2
                arg_7 = arg_3
                arg_1.node(arg_7, arg_3)
                for arg_8 in arg_6:
                    arg_9, arg_8 = walk(arg_8)
                    arg_1.edge(arg_7, arg_9)
                return arg_7, arg_2
        walk(arg_2)
        return arg_1

Return a graphviz . Digraph object with a graph of the expression


def Func ( arg_0 , arg_1 ) : while arg_1 < len ( arg_0 ) : if arg_0 [ arg_1 ] . strip ( ) . endswith ( '*/' ) : return arg_1 arg_1 += 1 return len ( arg_0 )

def Func(arg_0, arg_1):
  """We are inside a comment, find the end marker."""
  while arg_1 < len(arg_0):
    if arg_0[arg_1].strip().endswith('*/'):
      return arg_1
    arg_1 += 1
  return len(arg_0)

We are inside a comment find the end marker .


def Func ( arg_0 , arg_1 = '' ) : arg_2 = [ ] if arg_0 . encoders is not None : for ( arg_3 , arg_4 , arg_5 ) in arg_0 . encoders : arg_6 = arg_4 . Func ( arg_1 = arg_3 ) if arg_1 != '' : arg_6 = [ '%s.%s' % ( arg_1 , arg_3 ) for arg_3 in arg_6 ] arg_2 . extend ( arg_6 ) else : if arg_1 != '' : arg_2 . append ( arg_1 ) else : arg_2 . append ( arg_0 . name ) return arg_2

def Func(arg_0, arg_1=''):
    """
    Return the field names for each of the scalar values returned by
    getScalars.

    :param parentFieldName: The name of the encoder which is our parent. This
        name is prefixed to each of the field names within this encoder to
        form the keys of the dict() in the retval.

    :return: array of field names
    """
    arg_2 = []

    if arg_0.encoders is not None:
      for (arg_3, arg_4, arg_5) in arg_0.encoders:
        arg_6 = arg_4.Func(arg_1=arg_3)
        if arg_1 != '':
          arg_6 = ['%s.%s' % (arg_1, arg_3) for arg_3 in arg_6]
        arg_2.extend(arg_6)
    else:
      if arg_1 != '':
        arg_2.append(arg_1)
      else:
        arg_2.append(arg_0.name)

    return arg_2

Return the field names for each of the scalar values returned by getScalars .


def Func ( arg_0 , arg_1 = None ) : arg_2 = list ( ) arg_3 = import_module ( arg_0 ) if inspect . ismodule ( arg_3 ) : [ arg_2 . append ( arg_4 ) for arg_4 in _Func ( arg_3 , arg_1 ) ] return arg_2

def Func(arg_0, arg_1=None):
    """
    Attempts to list all of the classes within a specified module. This
    function works for modules located in the default path as well as
    extended paths via the sys.meta_path hooks.

    If a class filter is set, it will be called with each class as its
    parameter. This filter's return value must be interpretable as a
    boolean. Results that evaluate as True will include the type in the
    list of returned classes. Results that evaluate as False will exclude
    the type in the list of returned classes.

    :param mname: of the module to descend into
    :param cls_filter: a function to call to determine what classes should be
                included.
    """
    arg_2 = list()
    arg_3 = import_module(arg_0)
    if inspect.ismodule(arg_3):
        [arg_2.append(arg_4) for arg_4 in _Func(arg_3, arg_1)]
    return arg_2

Attempts to list all of the classes within a specified module . This function works for modules located in the default path as well as extended paths via the sys . meta_path hooks .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = utils . BytearrayStream ( ) if arg_0 . _unique_identifier is not None : arg_0 . _unique_identifier . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _key_format_type is not None : arg_0 . _key_format_type . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _key_compression_type is not None : arg_0 . _key_compression_type . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _key_wrapping_specification is not None : arg_0 . _key_wrapping_specification . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( GetRequestPayload , 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 Get 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.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._unique_identifier is not None:
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._key_format_type is not None:
            arg_0._key_format_type.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._key_compression_type is not None:
            arg_0._key_compression_type.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._key_wrapping_specification is not None:
            arg_0._key_wrapping_specification.Func(
                arg_6,
                arg_2=arg_2
            )

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

Write the data encoding the Get 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.

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


return [self.stats[cache_level]['MISS_count']/self.first_dim_factor
                for cache_level in range(len(self.machine['memory hierarchy']))]

def
Func
(
arg_0
)
:
return
[
arg_0
.
stats
[
arg_1
]
[
'MISS_count'
]
/
arg_0
.
first_dim_factor
for
arg_1
in
range
(
len
(
arg_0
.
machine
[
'memory hierarchy'
]
)
)
]

def Func(arg_0):
        """Return a list with number of missed cache lines per memory hierarchy level."""
        return [arg_0.stats[arg_1]['MISS_count']/arg_0.first_dim_factor
                for arg_1 in range(len(arg_0.machine['memory hierarchy']))]

Return a list with number of missed cache lines per memory hierarchy level .


def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = arg_2 . get ( "include" , [ ] ) if "students" not in arg_3 : arg_3 . append ( "students" ) arg_2 [ "include" ] = arg_3 return arg_0 . get_sections_in_course ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        Return list of sections including students for the passed course ID.
        """
        arg_3 = arg_2.get("include", [])
        if "students" not in arg_3:
            arg_3.append("students")
        arg_2["include"] = arg_3

        return arg_0.get_sections_in_course(arg_1, arg_2)

Return list of sections including students for the passed course ID .


def
Func
(
arg_0
)
:
@
functools
.
wraps
(
arg_0
)
def
new_func
(
*
arg_1
,
**
arg_2
)
:
warnings
.
warn
(
"Call to Func function {}."
.
format
(
arg_0
.
__name__
)
,
category
=
DeprecationWarning
,
stacklevel
=
2
)
return
arg_0
(
*
arg_1
,
**
arg_2
)
return
new_func

def Func(arg_0):
    """
    Deprecator decorator.
    """
    @functools.wraps(arg_0)
    def new_func(*arg_1, **arg_2):
        warnings.warn("Call to Func function {}.".format(arg_0.__name__), category=DeprecationWarning, stacklevel=2)
        return arg_0(*arg_1, **arg_2)

    return new_func


def Func(*arg_0):
    """
    Swift annotation for adding function to process Func notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification
    """
    check_event_type(Openstack.Keystone, *arg_0)
    arg_1 = arg_0[0]

    def decorator(arg_2):
        if arg_1.find("*") != -1:
            arg_3 = pre_compile(arg_1)
            arg_4[arg_3] = arg_2
        else:
            arg_5[arg_1] = arg_2
        log.info("add function {0} to process event_type:{1}".format(arg_2.__name__, arg_1))

        @functools.wraps(arg_2)
        def wrapper(*arg_6, **arg_7):
            arg_2(*arg_6, **arg_7)

        return wrapper

    return decorator

Swift annotation for adding function to process keystone notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification

Swift annotation for adding function to process keystone notification .


def Func(arg_0, arg_1, arg_2):
        """
        Retrieves a single volume by ID.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      volume_id: The unique ID of the volume.
        :type       volume_id: ``str``

        """
        arg_3 = arg_0._perform_request(
            '/datacenters/%s/volumes/%s' % (arg_1, arg_2))

        return arg_3


return self._allow(record) and not self._deny(record)

def Func ( arg_0 , arg_1 ) : if not arg_0 : return True return arg_0 . _Func ( arg_1 ) and not arg_0 . _deny ( arg_1 )

def Func(arg_0, arg_1):
        """returns whether this record should be printed"""
        if not arg_0:
            # nothing to filter
            return True
        return arg_0._Func(arg_1) and not arg_0._deny(arg_1)