return -0.5*isig*isig*np.dot(res.flat, res.flat) + nlogs

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : arg_3 = arg_0 . residuals else : arg_3 = arg_1 - arg_0 . _data [ arg_2 . slicer ] arg_4 , arg_5 = arg_0 . sigma , 1.0 / arg_0 . sigma arg_6 = - np . log ( np . sqrt ( 2 * np . pi ) * arg_4 ) * arg_3 . size return - 0.5 * arg_5 * arg_5 * np . dot ( arg_3 . flat , arg_3 . flat ) + arg_6

def Func(arg_0, arg_1=None, arg_2=None):
        """Allows for fast local updates of log-likelihood"""
        if arg_1 is None:
            arg_3 = arg_0.residuals
        else:
            arg_3 = arg_1 - arg_0._data[arg_2.slicer]

        arg_4, arg_5 = arg_0.sigma, 1.0/arg_0.sigma
        arg_6 = -np.log(np.sqrt(2*np.pi)*arg_4)*arg_3.size
        return -0.5*arg_5*arg_5*np.dot(arg_3.flat, arg_3.flat) + arg_6

Allows for fast local updates of log - likelihood


def Func(arg_0, arg_1, arg_2):
    """Converts an text representation of a protocol message into a message.

    Args:
      lines: Lines of a message's text representation.
      message: A protocol buffer message to merge into.

    Raises:
      ParseError: On text parsing problems.
    """
    arg_3 = _Tokenizer(arg_1)
    while not arg_3.AtEnd():
      arg_0._MergeField(arg_3, arg_2)

Converts an text representation of a protocol message into a message .


def Func(arg_0):
        """Remove any builtins which might have been added by add_builtins, or
        restore overwritten ones to their previous values."""
        arg_1 = arg_0.remove_builtin
        for arg_2, arg_3 in arg_0._orig_builtins.iteritems():
            arg_1(arg_2, arg_3)
        arg_0._orig_builtins.clear()
        arg_0._builtins_added = False

Remove any builtins which might have been added by add_builtins or restore overwritten ones to their previous values .


def Func(arg_0, arg_1):
        """Write a Credentials to the Django datastore.

        Args:
            credentials: Credentials, the credentials to store.
        """
        arg_2, arg_3 = arg_0.model_class.objects.get_or_create(
            **{arg_0.key_name: arg_0.key_value})

        setattr(arg_2, arg_0.property_name, arg_1)
        arg_2.save()

Write a Credentials to the Django datastore .


def Func(arg_0, arg_1, arg_2='\0'):
        r"""Return the Burrows-Wheeler transformed form of a word.

        Parameters
        ----------
        word : str
            The word to transform using BWT
        terminator : str
            A character added to signal the end of the string

        Returns
        -------
        str
            Word Funcd by BWT

        Raises
        ------
        ValueError
            Specified terminator absent from code.

        Examples
        --------
        >>> bwt = BWT()
        >>> bwt.Func('align')
        'n\x00ilag'
        >>> bwt.Func('banana')
        'annb\x00aa'
        >>> bwt.Func('banana', '@')
        'annb@aa'

        """
        if arg_1:
            if arg_2 in arg_1:
                raise ValueError(
                    'Specified terminator, {}, already in word.'.format(
                        arg_2 if arg_2 != '\0' else '\\0'
                    )
                )
            else:
                arg_1 += arg_2
                arg_3 = sorted(
                    arg_1[i:] + arg_1[:i] for i in range(len(arg_1))
                )
                return ''.join([arg_4[-1] for arg_4 in arg_3])
        else:
            return arg_2

r"""Return the Burrows-Wheeler transformed form of a word.

        Parameters
        ----------
        word : str
            The word to transform using BWT
        terminator : str
            A character added to signal the end of the string

        Returns
        -------
        str
            Word encoded by BWT

        Raises
        ------
        ValueError
            Specified terminator absent from code.

        Examples
        --------
        >>> bwt = BWT()
        >>> bwt.encode('align')
        'n\x00ilag'
        >>> bwt.encode('banana')
        'annb\x00aa'
        >>> bwt.encode('banana', '@')
        'annb@aa'

r Return the Burrows - Wheeler transformed form of a word .


return np.array([self.x_max, self.y_max, self.z_max])

def Func ( arg_0 ) : return np . array ( [ arg_0 . x_max , arg_0 . y_max , arg_0 . z_max ] )

def Func(arg_0):
        """ Returns de maximum values of x, y, z as a numpy array
        """
        return np.array([arg_0.x_max, arg_0.y_max, arg_0.z_max])

Returns de maximum values of x y z as a numpy array


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = _connection_refs . get ( arg_0 ) if not arg_3 : arg_4 = _socket_refs . get ( arg_0 ) else : arg_4 = arg_3 . _socket if not arg_3 and not arg_4 : return 0 arg_5 = deref ( arg_2 ) arg_6 = bytes_from_buffer ( arg_1 , arg_5 ) if arg_3 and not arg_3 . _done_handshake : arg_3 . _client_hello += arg_6 arg_7 = None try : arg_8 = arg_4 . send ( arg_6 ) except ( socket_ . error ) as e : arg_7 = e . errno if arg_7 is not None and arg_7 != errno . EAGAIN : if arg_7 == errno . ECONNRESET or arg_7 == errno . EPIPE : return SecurityConst . errSSLClosedNoNotify return SecurityConst . errSSLClosedAbort if arg_8 != arg_5 : pointer_set ( arg_2 , arg_8 ) return SecurityConst . errSSLWouldBlock return 0 except ( KeyboardInterrupt ) as e : arg_3 . _exception = e return SecurityConst . errSSLPeerUserCancelled

def Func(arg_0, arg_1, arg_2):
    """
    Callback called by Secure Transport to actually write to the socket

    :param connection_id:
        An integer identifing the connection

    :param data_buffer:
        A char pointer FFI type containing the data to write

    :param data_length_pointer:
        A size_t pointer FFI type of the amount of data to write. Will be
        overwritten with the amount of data actually written on return.

    :return:
        An integer status code of the result - 0 for success
    """

    try:
        arg_3 = _connection_refs.get(arg_0)
        if not arg_3:
            arg_4 = _socket_refs.get(arg_0)
        else:
            arg_4 = arg_3._socket

        if not arg_3 and not arg_4:
            return 0

        arg_5 = deref(arg_2)
        arg_6 = bytes_from_buffer(arg_1, arg_5)

        if arg_3 and not arg_3._done_handshake:
            arg_3._client_hello += arg_6

        arg_7 = None
        try:
            arg_8 = arg_4.send(arg_6)
        except (socket_.error) as e:
            arg_7 = e.errno

        if arg_7 is not None and arg_7 != errno.EAGAIN:
            if arg_7 == errno.ECONNRESET or arg_7 == errno.EPIPE:
                return SecurityConst.errSSLClosedNoNotify
            return SecurityConst.errSSLClosedAbort

        if arg_8 != arg_5:
            pointer_set(arg_2, arg_8)
            return SecurityConst.errSSLWouldBlock

        return 0
    except (KeyboardInterrupt) as e:
        arg_3._exception = e
        return SecurityConst.errSSLPeerUserCancelled


def Func ( arg_0 ) : arg_0 . code_builder . add_line ( '{0}.extend([{1}])' , arg_0 . result_var , ',' . join ( arg_0 . buffered ) ) arg_0 . buffered = [ ]

def Func(arg_0):
        """flush all buffered string into code"""
        arg_0.code_builder.add_line('{0}.extend([{1}])',
                                   arg_0.result_var, ','.join(arg_0.buffered))
        arg_0.buffered = []


def Func ( ) : arg_0 = 'Cython.Distutils.build_ext' , 'Pyrex.Distutils.build_ext' for arg_1 in arg_0 : try : __import__ ( arg_1 , fromlist = [ 'build_ext' ] ) . build_ext return True except Exception : pass return False

def Func():
    """
    Return True if Cython or Pyrex can be imported.
    """
    arg_0 = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext'
    for arg_1 in arg_0:
        try:
            # from (pyrex_impl) import build_ext
            __import__(arg_1, fromlist=['build_ext']).build_ext
            return True
        except Exception:
            pass
    return False

Return True if Cython or Pyrex can be imported .


def
Func
(
arg_0
)
:
arg_1
=
re
.
compile
(
r'''Installed:\s+(?P<version>.*)'''
)
arg_2
=
'apt-cache policy %s'
%
arg_0
arg_3
=
shlex
.
split
(
arg_2
)
try
:
arg_4
=
subprocess
.
check_output
(
arg_3
)
if
not
arg_4
:
return
except
CalledProcessError
:
return
arg_5
=
arg_1
.
search
(
arg_4
)
if
arg_5
:
arg_6
=
arg_5
.
groupdict
(
)
[
'version'
]
if
arg_6
==
'(none)'
:
return
else
:
return
arg_6

def Func(arg_0):
    '''
        returns installed package version and None if package is not installed
    '''
    arg_1 = re.compile(r'''Installed:\s+(?P<version>.*)''')
    arg_2 = 'apt-cache policy %s' % arg_0
    arg_3 = shlex.split(arg_2)
    try:
        arg_4 = subprocess.check_output(arg_3)
        if not arg_4:
            return None
    except CalledProcessError:
        return None
    # check output
    arg_5 = arg_1.search(arg_4)
    if arg_5:
        arg_6 = arg_5.groupdict()['version']
        if arg_6 == '(none)':
            return None
        else:
            return arg_6


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
CONTEXT_TITLE
]
for
arg_3
,
arg_4
in
enumerate
(
arg_1
)
:
arg_5
=
linebreaksbr
(
pformat_django_context_html
(
arg_4
)
)
arg_6
=
pformat_dict_summary_html
(
arg_4
)
if
len
(
arg_4
)
<=
3
and
arg_5
.
count
(
'<br />'
)
>
20
:
(
arg_5
,
arg_6
)
=
(
arg_6
,
arg_5
)
arg_2
.
append
(
CONTEXT_BLOCK
.
format
(
style
=
PRE_STYLE
,
num
=
arg_3
,
arg_5
=
arg_5
,
arg_6
=
arg_6
)
)
return
u''
.
join
(
arg_2
)

def Func(arg_0, arg_1):
        """
        Print the entire template context
        """
        arg_2 = [CONTEXT_TITLE]
        for arg_3, arg_4 in enumerate(arg_1):
            arg_5 = linebreaksbr(pformat_django_context_html(arg_4))
            arg_6 = pformat_dict_summary_html(arg_4)

            # Collapse long objects by default (e.g. request, LANGUAGES and sql_queries)
            if len(arg_4) <= 3 and arg_5.count('<br />') > 20:
                (arg_5, arg_6) = (arg_6, arg_5)

            arg_2.append(CONTEXT_BLOCK.format(
                style=PRE_STYLE,
                num=arg_3,
                arg_5=arg_5,
                arg_6=arg_6
            ))
        return u''.join(arg_2)


def
Func
(
arg_0
,
arg_1
)
:
if
not
(
arg_0
.
exists
(
arg_1
)
)
:
raise
ValueError
(
"Workspace `%s` doesn't exists."
%
arg_1
)
arg_0
.
config
[
"workspaces"
]
.
pop
(
arg_1
,
0
)
arg_0
.
config
.
write
(
)

def Func(arg_0, arg_1):
        """Remove workspace from config file."""
        if not (arg_0.exists(arg_1)):
            raise ValueError("Workspace `%s` doesn't exists." % arg_1)

        arg_0.config["workspaces"].pop(arg_1, 0)
        arg_0.config.write()


def
Func
(
)
:
logging
.
basicConfig
(
level
=
logging
.
INFO
)
log
.
setLevel
(
logging
.
INFO
)
arg_0
=
get_bms_base
(
)
arg_1
=
get_neurommsig_base
(
)
arg_2
=
os
.
path
.
join
(
arg_1
,
'resources'
,
'excels'
,
'neurommsig'
)
arg_3
=
get_nift_values
(
)
log
.
info
(
'Starting Alzheimers'
)
arg_4
=
os
.
path
.
join
(
arg_2
,
'alzheimers'
,
'alzheimers.xlsx'
)
arg_5
=
preprocess
(
arg_4
)
with
open
(
os
.
path
.
join
(
arg_0
,
'aetionomy'
,
'alzheimers'
,
'neurommsigdb_ad.bel'
)
,
'w'
)
as
ad_file
:
write_neurommsig_bel
(
ad_file
,
arg_5
,
mesh_alzheimer
,
arg_3
)
log
.
info
(
'Starting Parkinsons'
)
arg_6
=
os
.
path
.
join
(
arg_2
,
'parkinsons'
,
'parkinsons.xlsx'
)
arg_7
=
preprocess
(
arg_6
)
with
open
(
os
.
path
.
join
(
arg_0
,
'aetionomy'
,
'parkinsons'
,
'neurommsigdb_pd.bel'
)
,
'w'
)
as
pd_file
:
write_neurommsig_bel
(
pd_file
,
arg_7
,
mesh_parkinson
,
arg_3
)

def Func():
    """Convert the Alzheimer's and Parkinson's disease NeuroMMSig excel sheets to BEL."""
    logging.basicConfig(level=logging.INFO)
    log.setLevel(logging.INFO)

    arg_0 = get_bms_base()
    arg_1 = get_neurommsig_base()
    arg_2 = os.path.join(arg_1, 'resources', 'excels', 'neurommsig')

    arg_3 = get_nift_values()

    log.info('Starting Alzheimers')

    arg_4 = os.path.join(arg_2, 'alzheimers', 'alzheimers.xlsx')
    arg_5 = preprocess(arg_4)
    with open(os.path.join(arg_0, 'aetionomy', 'alzheimers', 'neurommsigdb_ad.bel'), 'w') as ad_file:
        write_neurommsig_bel(ad_file, arg_5, mesh_alzheimer, arg_3)

    log.info('Starting Parkinsons')

    arg_6 = os.path.join(arg_2, 'parkinsons', 'parkinsons.xlsx')
    arg_7 = preprocess(arg_6)
    with open(os.path.join(arg_0, 'aetionomy', 'parkinsons', 'neurommsigdb_pd.bel'), 'w') as pd_file:
        write_neurommsig_bel(pd_file, arg_7, mesh_parkinson, arg_3)

Convert the Alzheimer s and Parkinson s disease NeuroMMSig excel sheets to BEL .


def Func(arg_0, arg_1, arg_2=None):
    """Number of `params` needed to create a `MixtureSameFamily` distribution.

    Arguments:
      num_components: Number of component distributions in the mixture
        distribution.
      component_Func: Number of parameters needed to create a single
        component distribution.
      name: The name to use for the op to compute the number of parameters
        (if such an op needs to be created).

    Returns:
     Func: The number of parameters needed to create the mixture
       distribution.
    """
    with tf.compat.v1.name_scope(arg_2, 'MixtureSameFamily_Func',
                                 [arg_0, arg_1]):
      arg_0 = tf.convert_to_tensor(
          value=arg_0, arg_2='num_components', dtype_hint=tf.int32)
      arg_1 = tf.convert_to_tensor(
          value=arg_1, arg_2='component_Func')

      arg_0 = dist_util.prefer_static_value(arg_0)
      arg_1 = dist_util.prefer_static_value(
          arg_1)

      return arg_0 + arg_0 * arg_1

Number of `params` needed to create a `MixtureSameFamily` distribution.

    Arguments:
      num_components: Number of component distributions in the mixture
        distribution.
      component_params_size: Number of parameters needed to create a single
        component distribution.
      name: The name to use for the op to compute the number of parameters
        (if such an op needs to be created).

    Returns:
     params_size: The number of parameters needed to create the mixture
       distribution.

Number of params needed to create a MixtureSameFamily distribution .


def Func(arg_0, arg_1):
        """
        Patch the Altair generated json to the newest Vega Lite spec
        """
        arg_1 = json.loads(arg_1)
        # add schema
        arg_1["$schema"] = "https://vega.github.io/schema/vega-lite/2.0.0-beta.15.json"
        # add top level width and height
        arg_1["width"] = arg_1["config"]["cell"]["width"]
        arg_1["height"] = arg_1["config"]["cell"]["height"]
        del(arg_1["config"]["cell"])
        return json.dumps(arg_1)


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in enumerate ( arg_0 . _covariances ) : for arg_4 , arg_5 in arg_3 . Func ( ) . items ( ) : arg_1 [ f"{self._name}[{i}].{varname}" ] = arg_5 return arg_1

def Func(arg_0):
        """
        Sum of covariance function derivatives.

        Returns
        -------
        dict
            ∂K₀ + ∂K₁ + ⋯
        """
        arg_1 = {}
        for arg_2, arg_3 in enumerate(arg_0._covariances):
            for arg_4, arg_5 in arg_3.Func().items():
                arg_1[f"{self._name}[{i}].{varname}"] = arg_5
        return arg_1

Sum of covariance function derivatives .


def Func ( arg_0 ) : arg_0 . activeCells = [ ] arg_0 . winnerCells = [ ] arg_0 . activeSegments = [ ] arg_0 . matchingSegments = [ ]

def Func(arg_0):
    """
    Indicates the start of a new sequence. Clears any predictions and makes sure
    synapses don't grow to the currently active cells in the next time step.
    """
    arg_0.activeCells = []
    arg_0.winnerCells = []
    arg_0.activeSegments = []
    arg_0.matchingSegments = []

Indicates the start of a new sequence . Clears any predictions and makes sure synapses don t grow to the currently active cells in the next time step .


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . _check_authorization ( arg_2 . properties , arg_1 ) : arg_3 = ElementTree . Element ( FAILURE_TAG ) ElementTree . SubElement ( arg_3 , SASL_QNP + "invalid-authzid" ) return True arg_4 = arg_2 . properties . get ( "authzid" ) if arg_4 : arg_5 = JID ( arg_2 . authzid ) elif "username" in arg_2 . properties : arg_5 = JID ( arg_2 . properties [ "username" ] , arg_1 . me . domain ) else : arg_5 = None arg_1 . set_peer_authenticated ( arg_5 , True )

def Func(arg_0, arg_1, arg_2):
        """Handle successful authentication.

        Send <success/> and mark the stream peer authenticated.

        [receiver only]
        """
        if not arg_0._check_authorization(arg_2.properties, arg_1):
            arg_3 = ElementTree.Element(FAILURE_TAG)
            ElementTree.SubElement(arg_3, SASL_QNP + "invalid-authzid")
            return True
        arg_4 = arg_2.properties.get("authzid")
        if arg_4:
            arg_5 = JID(arg_2.authzid)
        elif "username" in arg_2.properties:
            arg_5 = JID(arg_2.properties["username"], arg_1.me.domain)
        else:
            # anonymous
            arg_5 = None
        arg_1.set_peer_authenticated(arg_5, True)


give the user an ipython shell, optionally with an endpoint of choice.

def Func ( arg_0 ) : from sregistry . main import get_client arg_1 = get_client ( arg_0 . endpoint ) arg_1 . announce ( arg_0 . command ) from IPython import embed embed ( )

def Func(arg_0):
    '''give the user an Func shell, optionally with an endpoint of choice.
    '''

    # The client will announce itself (backend/database) unless it's get
    from sregistry.main import get_client
    arg_1 = get_client(arg_0.endpoint)
    arg_1.announce(arg_0.command)
    from IPython import embed
    embed()

give the user an ipython shell optionally with an endpoint of choice .


def
Func
(
arg_0
)
:
print
(
'Adding exploration of I and tau_ref'
)
arg_1
=
{
'neuron.I'
:
np
.
arange
(
0
,
1.01
,
0.01
)
.
tolist
(
)
,
'neuron.tau_ref'
:
[
5.0
,
7.5
,
10.0
]
}
arg_1
=
cartesian_product
(
arg_1
,
(
'neuron.tau_ref'
,
'neuron.I'
)
)
arg_0
.
f_explore
(
arg_1
)

def Func(arg_0):
    """Explores different values of `I` and `tau_ref`."""

    print('Adding exploration of I and tau_ref')

    arg_1 = {'neuron.I': np.arange(0, 1.01, 0.01).tolist(),
                    'neuron.tau_ref': [5.0, 7.5, 10.0]}

    arg_1 = cartesian_product(arg_1, ('neuron.tau_ref', 'neuron.I'))
    # The second argument, the tuple, specifies the order of the cartesian product,
    # The variable on the right most side changes fastest and defines the
    # 'inner for-loop' of the cartesian product

    arg_0.f_explore(arg_1)

Explores different values of I and tau_ref .


def Func(arg_0,arg_1):
    """Convert transfer function filter parameters to zero-pole-gain form

    Find the zeros, poles, and gains of this continuous-time system:

    .. warning:: b and a must have the same length.

    ::

        from spectrum import Func
        b = [2,3,0]
        a = [1, 0.4, 1]
        [z,p,k] = Func(b,a)          % Obtain zero-pole-gain form
        z =
            1.5
            0
        p =
           -0.2000 + 0.9798i
            -0.2000 - 0.9798i
        k =
           2

    :param b: numerator
    :param a: denominator
    :param fill: If True, check that the length of a and b are the same. If not, create a copy of the shortest element and append zeros to it.
    :return: z (zeros), p (poles), g (gain)

    Convert transfer function f(x)=sum(b*x^n)/sum(a*x^n) to
    zero-pole-gain form f(x)=g*prod(1-z*x)/prod(1-p*x)

    .. todo:: See if tf2ss followed by ss2zp gives better results.  These
        are available from the control system toolbox.  Note that
        the control systems toolbox doesn't bother, but instead uses

    .. seealso:: scipy.signal.Funck, which gives the same results but uses a different
        algorithm (z^-1 instead of z).
    """
    from numpy import roots
    assert len(arg_0) == len(arg_1), "length of the vectors a and b must be identical. fill with zeros if needed."

    arg_2 = arg_0[0] / arg_1[0]
    arg_3 = roots(arg_0)
    arg_4 = roots(arg_1)

    return arg_3, arg_4, arg_2

Convert transfer function filter parameters to zero-pole-gain form

    Find the zeros, poles, and gains of this continuous-time system:

    .. warning:: b and a must have the same length.

    ::

        from spectrum import tf2zp
        b = [2,3,0]
        a = [1, 0.4, 1]
        [z,p,k] = tf2zp(b,a)          % Obtain zero-pole-gain form
        z =
            1.5
            0
        p =
           -0.2000 + 0.9798i
            -0.2000 - 0.9798i
        k =
           2

    :param b: numerator
    :param a: denominator
    :param fill: If True, check that the length of a and b are the same. If not, create a copy of the shortest element and append zeros to it.
    :return: z (zeros), p (poles), g (gain)

    Convert transfer function f(x)=sum(b*x^n)/sum(a*x^n) to
    zero-pole-gain form f(x)=g*prod(1-z*x)/prod(1-p*x)

    .. todo:: See if tf2ss followed by ss2zp gives better results.  These
        are available from the control system toolbox.  Note that
        the control systems toolbox doesn't bother, but instead uses

    .. seealso:: scipy.signal.tf2zpk, which gives the same results but uses a different
        algorithm (z^-1 instead of z).

Convert transfer function filter parameters to zero - pole - gain form


def Func(arg_0, arg_1=None, arg_2=False):
        """Write the internal JSON data dictionary to a JSON data file.

        If no file path is provided, the stored data file path will be used.

        Args:
            filePath (Optional[str]): A relative or absolute path to a
                '.json' file. Defaults to None.
            updatePath (Optional[bool]): Specifies whether or not to update
                the stored data file path. Defaults to False.

        """
        if not arg_1:
            arg_1 = arg_0.filePath
        if not os.path.isfile(arg_1):
            print("Data file '%s' does not exist, will create new file." % (arg_1))
            if not os.path.exists(os.path.split(arg_1)[0]):
                os.makedirs(os.path.split(arg_1)[0])
        arg_3 = json.dumps(arg_0.data, indent=4, sort_keys=True)
        print("Writing to file '%s' ... " % (arg_1), end="", flush=True)
        with open(arg_1, "w") as fileout:
            fileout.write(arg_3)
        print("Wrote file!")
        if arg_2:
            arg_0.filePath = arg_1

Write the internal JSON data dictionary to a JSON data file .


return self.get_data(
            "load_balancers/%s/forwarding_rules/" % self.id,
            type=POST,
            params={"forwarding_rules": rules_dict}
        )

def Func ( arg_0 , arg_1 ) : arg_2 = [ rule . __dict__ for rule in arg_1 ] return arg_0 . get_data ( "load_balancers/%s/forwarding_rules/" % arg_0 . id , type = POST , params = { "forwarding_rules" : arg_2 } )

def Func(arg_0, arg_1):
        """
        Adds new forwarding rules to a LoadBalancer.

        Args:
            forwarding_rules (obj:`list`): A list of `ForwrdingRules` objects
        """
        arg_2 = [rule.__dict__ for rule in arg_1]

        return arg_0.get_data(
            "load_balancers/%s/forwarding_rules/" % arg_0.id,
            type=POST,
            params={"forwarding_rules": arg_2}
        )

Adds new forwarding rules to a LoadBalancer .


async
def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
bot
.
lavalink
.
players
.
get
(
arg_1
.
guild
.
id
)
try
:
await
arg_2
.
playFunc
(
)
except
lavalink
.
NoPreviousTrack
:
await
arg_1
.
send
(
'There is no previous song to play.'
)

async def Func(arg_0, arg_1):
        """ Plays the previous song. """
        arg_2 = arg_0.bot.lavalink.players.get(arg_1.guild.id)

        try:
            await arg_2.playFunc()
        except lavalink.NoPreviousTrack:
            await arg_1.send('There is no previous song to play.')


(cls, fp, selector_handler=None, strict=False, debug=False)

return cls._from_jsonlines(fp,
            selector_handler=selector_handler, strict=strict, debug=debug)

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=False):
        """
        Create a Parselet instance from a file containing
        the Parsley script as a JSON object

        >>> import parslepy
        >>> with open('parselet.json') as fp:
        ...     parslepy.Parselet.Func(fp)
        ...
        <parslepy.base.Parselet object at 0x2014e50>

        :param file fp: an open file-like pointer containing the Parsley script
        :rtype: :class:`.Parselet`

        Other arguments: same as for :class:`.Parselet` contructor
        """

        return arg_0._from_jsonlines(arg_1,
            arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Create a Parselet instance from a file containing
        the Parsley script as a JSON object

        >>> import parslepy
        >>> with open('parselet.json') as fp:
        ...     parslepy.Parselet.from_jsonfile(fp)
        ...
        <parslepy.base.Parselet object at 0x2014e50>

        :param file fp: an open file-like pointer containing the Parsley script
        :rtype: :class:`.Parselet`

        Other arguments: same as for :class:`.Parselet` contructor


def Func(arg_0):
    """Visualizes the MDR grid of a given fitted MDR instance. Only works for 2-way MDR models.

    This function is currently incomplete.

    Parameters
    ----------
    mdr_instance: object
        A fitted instance of the MDR type to visualize.

    Returns
    ----------
    fig: matplotlib.figure
        Figure object for the visualized MDR grid.

    """
    arg_1 = list(set([variables[0] for variables in arg_0.feature_map]))
    arg_2 = list(set([variables[1] for variables in arg_0.feature_map]))
    arg_3 = np.array(list(arg_0.class_count_matrix.values())).flatten().max()

    """
    TODO:
        - Add common axis labels
        - Make sure this scales for smaller and larger record sizes
        - Extend to 3-way+ models, e.g., http://4.bp.blogspot.com/-vgKCjEkWFUc/UPwPuHo6XvI/AAAAAAAAAE0/fORHqDcoikE/s1600/model.jpg
    """

    arg_4, arg_5 = plt.subplots(ncols=len(arg_1), nrows=len(arg_2), sharey=True, sharex=True)
    arg_4.set_figwidth(6)
    arg_4.set_figheight(6)

    for (arg_6, arg_7) in itertools.product(arg_1, arg_2):
        arg_8 = arg_0.class_count_matrix[(arg_6, arg_7)]
        arg_9 = arg_5[arg_2.index(arg_7)][arg_1.index(arg_6)]
        arg_9.set_yticks([])
        arg_9.set_xticks([])
        arg_9.set_ylim(0, arg_3 * 1.5)
        arg_9.set_xlim(-0.5, 1.5)

        if arg_2.index(arg_7) == 0:
            arg_9.set_title('X1 = {}'.format(arg_6), fontsize=12)
        if arg_1.index(arg_6) == 0:
            arg_9.set_ylabel('X2 = {}'.format(arg_7), fontsize=12)

        arg_10 = arg_9.bar(left=range(arg_8.shape[0]),
                         height=arg_8, width=0.5,
                         color='black', align='center')

        arg_11 = 'lightgrey' if arg_0.feature_map[(arg_6, arg_7)] == 0 else 'darkgrey'
        arg_9.set_axis_bgcolor(arg_11)
        for arg_12, arg_13 in enumerate(arg_10):
            arg_9.text(arg_12, arg_8[arg_12] + (arg_3 * 0.1), arg_8[arg_12], ha='center')

    arg_4.tight_layout()
    return arg_4

Visualizes the MDR grid of a given fitted MDR instance . Only works for 2 - way MDR models . This function is currently incomplete .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_2
is
:
arg_0
.
_Func
(
arg_1
,
)
else
:
arg_3
=
arg_0
.
_pin_mapping
.
get
(
arg_2
,
)
if
arg_3
:
arg_0
.
_Func
(
arg_1
,
arg_3
)
else
:
raise
KeyError
(
'Requested pin is not mapped: %s'
%
arg_2
)

def Func(arg_0, arg_1, arg_2=None):
        """Sets PWM frequency, if supported by hardware

        If the driver supports per pin frequency setting, set pin to the
        desired frequency. If not, passing None means set to all. If only per
        pin frequency is supported and pin is None, raise RuntimeError.

        If you're developing a driver, implement
        _Func(self, frequency, pin). Raise RuntimeError if pin
        was set but is not supported by the platform.

        @arg frequency pwm frequency to be set, in Hz
        @arg pin if the the driver supports it, the pin that will use
            `frequency` as pwm frequency. None for all/global.

        @throw RuntimeError if pin is None on a per pin only hardware, or if
            it's a valid pin on a global only hardware.
        @throw KeyError if pin isn't mapped.
        """
        if arg_2 is None:
            arg_0._Func(arg_1, None)
        else:
            arg_3 = arg_0._pin_mapping.get(arg_2, None)
            if arg_3:
                arg_0._Func(arg_1, arg_3)
            else:
                raise KeyError('Requested pin is not mapped: %s' % arg_2)

Sets PWM frequency, if supported by hardware

        If the driver supports per pin frequency setting, set pin to the
        desired frequency. If not, passing None means set to all. If only per
        pin frequency is supported and pin is None, raise RuntimeError.

        If you're developing a driver, implement
        _set_pwm_frequency(self, frequency, pin). Raise RuntimeError if pin
        was set but is not supported by the platform.

        @arg frequency pwm frequency to be set, in Hz
        @arg pin if the the driver supports it, the pin that will use
            `frequency` as pwm frequency. None for all/global.

        @throw RuntimeError if pin is None on a per pin only hardware, or if
            it's a valid pin on a global only hardware.
        @throw KeyError if pin isn't mapped.

Sets PWM frequency if supported by hardware


def Func ( arg_0 ) : if arg_0 . tests : arg_1 = sorted ( arg_0 . tests [ 0 ] . keys ( ) ) if isinstance ( arg_0 . tests , list ) : arg_2 = [ [ ( key , i [ key ] ) for key in arg_1 ] for i in arg_0 . tests ] arg_3 = [ dict ( i ) for i in arg_2 ] arg_4 = pd . DataFrame ( arg_3 ) return arg_4 else : return pd . DataFrame ( pd . Series ( arg_0 . tests ) ) . T else : return None

def Func(arg_0):
        """
        Returns the .tests list of taxa as a pandas dataframe.
        By auto-generating this table from tests it means that
        the table itself cannot be modified unless it is returned
        and saved.
        """
        if arg_0.tests:
            arg_1 = sorted(arg_0.tests[0].keys())
            if isinstance(arg_0.tests, list):
                arg_2 = [[(key, i[key]) for key in arg_1] for i in arg_0.tests]
                arg_3 = [dict(i) for i in arg_2]
                arg_4 = pd.DataFrame(arg_3)
                return arg_4
            else:
                return pd.DataFrame(pd.Series(arg_0.tests)).T
        else:
            return None

Returns the . tests list of taxa as a pandas dataframe . By auto - generating this table from tests it means that the table itself cannot be modified unless it is returned and saved .


def Func(arg_0, arg_1):
        """
        Get, cache, and return the curves supported by OpenSSL.

        :param lib: The OpenSSL library binding object.

        :return: A :py:type:`set` of ``cls`` instances giving the names of the
            elliptic curves the underlying library supports.
        """
        if arg_0._curves is None:
            arg_0._curves = arg_0._load_elliptic_curves(arg_1)
        return arg_0._curves

Get cache and return the curves supported by OpenSSL .


def Func(arg_0, arg_1, arg_2, arg_3=False):
		'''
			Func - Gets only certain fields from a list of  primary keys. For working on entire filter set, see allOnlyFields

			@param pks list<str> - Primary Keys

			@param fields list<str> - List of fields

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			return - List of partial objects with only fields applied
		'''
		if type(arg_1) == set:
			arg_1 = list(arg_1)

		if len(arg_1) == 1:
			return IRQueryableList([arg_0.getOnlyFields(arg_1[0], arg_2, arg_3=arg_3)], mdl=arg_0.mdl)

		arg_4 = arg_0._get_connection()
		arg_5 = arg_4.pipeline()

		for arg_6 in arg_1:
			arg_7 = arg_0._get_key_for_id(arg_6)
			arg_5.hmget(arg_7, arg_2)

		arg_8 = arg_5.execute()
		arg_9 = IRQueryableList(mdl=arg_0.mdl)
		arg_10 = len(arg_1)
		arg_11 = 0
		arg_12 = len(arg_2)
		while arg_11 < arg_10:
			arg_13 = {}
			arg_14 = False
			arg_15 = arg_8[arg_11]
			if arg_15 is None or type(arg_15) != list:
				arg_9.append(None)
				arg_11 += 1
				continue

			arg_16 = 0
			while arg_16 < arg_12:
				arg_13[arg_2[arg_16]] = arg_15[arg_16]
				if arg_15[arg_16] != None:
					arg_14 = True
				arg_16 += 1

			if arg_14 is False:
				arg_9.append(None)
				arg_11 += 1
				continue

			arg_13['_id'] = arg_1[arg_11]
			arg_17 = arg_0._redisResultToObj(arg_13)
			arg_9.append(arg_17)
			arg_11 += 1

		if arg_3 is True:
			for arg_17 in arg_9:
				arg_0._doCascadeFetch(arg_17)

		return arg_9

getMultipleOnlyFields - Gets only certain fields from a list of  primary keys. For working on entire filter set, see allOnlyFields

			@param pks list<str> - Primary Keys

			@param fields list<str> - List of fields

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			return - List of partial objects with only fields applied

getMultipleOnlyFields - Gets only certain fields from a list of primary keys . For working on entire filter set see allOnlyFields


def Func(arg_0, arg_1):
        """
        List all files in all locations.
        """
        for arg_2, arg_3 in arg_0.locations:
            arg_4 = arg_0.storages[arg_3]
            for arg_5 in utils.get_files(arg_4, arg_1):
                yield arg_5, arg_4


def Func(arg_0, arg_1, arg_2):
    '''Upload files to S3.
       This function can handle multiple file upload if source is a list.
       Also, it works for recursive mode which copy all files and keep the
       directory structure under the given source directory.
    '''
    arg_3 = ThreadPool(ThreadUtil, arg_0.opt)
    if not isinstance(arg_1, list):
      arg_1 = [arg_1]

    if arg_2[-1] == PATH_SEP:
      for arg_4 in arg_1:
        arg_0.put_single_file(arg_3, arg_4, os.path.join(arg_2, arg_0.get_basename(arg_4)))
    else:
      if len(arg_1) == 1:
        arg_0.put_single_file(arg_3, arg_1[0], arg_2)
      else:
        raise Failure('Target "%s" is not a directory (with a trailing slash).' % arg_2)

    arg_3.join()

Upload files to S3 . This function can handle multiple file upload if source is a list . Also it works for recursive mode which copy all files and keep the directory structure under the given source directory .


def Func ( arg_0 ) : if not arg_0 : return None arg_1 = { } for arg_2 , arg_3 in viewitems ( arg_0 ) : if arg_3 is None : continue if isinstance ( arg_3 , list ) : arg_3 = stringify_list ( arg_3 ) elif isinstance ( arg_3 , dict ) : if "__meta" in arg_3 and arg_3 [ "__meta" ] [ "schema_name" ] . endswith ( "KeyV3" ) : arg_3 = arg_3 [ "name" ] else : arg_3 = stringify_dict ( arg_3 ) else : arg_3 = str ( arg_3 ) arg_1 [ arg_2 ] = arg_3 return arg_1

def Func(arg_0):
        """
        Make a copy of the `data` object, preparing it to be sent to the server.

        The data will be sent via x-www-form-urlencoded or multipart/form-data mechanisms. Both of them work with
        plain lists of key/value pairs, so this method converts the data into such format.
        """
        if not arg_0: return None
        arg_1 = {}
        for arg_2, arg_3 in viewitems(arg_0):
            if arg_3 is None: continue  # don't send args set to None so backend defaults take precedence
            if isinstance(arg_3, list):
                arg_3 = stringify_list(arg_3)
            elif isinstance(arg_3, dict):
                if "__meta" in arg_3 and arg_3["__meta"]["schema_name"].endswith("KeyV3"):
                    arg_3 = arg_3["name"]
                else:
                    arg_3 = stringify_dict(arg_3)
            else:
                arg_3 = str(arg_3)
            arg_1[arg_2] = arg_3
        return arg_1

Make a copy of the data object preparing it to be sent to the server .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_1
[
0
]
[
0
]
[
1
]
for
arg_3
in
arg_2
:
arg_4
=
arg_3
[
0
]
arg_5
=
arg_4
[
0
]
for
arg_6
,
arg_7
in
enumerate
(
list
(
arg_5
)
)
:
if
isinstance
(
arg_7
,
nodes
.
Text
)
:
arg_8
=
unicode
(
arg_7
.
astext
(
)
)
arg_8
=
arg_8
.
replace
(
u" "
,
u"\u00a0"
)
arg_5
[
arg_6
]
=
nodes
.
Text
(
arg_8
)
except
IndexError
:
pass

def Func(arg_0, arg_1):
    """Make the first column of the table non-breaking."""
    try:
        arg_2 = arg_1[0][0][-1]
        for arg_3 in arg_2:
            arg_4 = arg_3[0]
            arg_5 = arg_4[0]
            for arg_6, arg_7 in enumerate(list(arg_5)):
                if isinstance(arg_7, nodes.Text):
                    arg_8 = unicode(arg_7.astext())
                    arg_8 = arg_8.replace(u" ", u"\u00a0")
                    arg_5[arg_6] = nodes.Text(arg_8)
    except IndexError:
        pass

Make the first column of the table non - breaking .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : if re . match ( r'^\S+:' , arg_2 ) : arg_3 = arg_2 [ 0 : arg_2 . find ( ':' ) ] if not any ( [ re . match ( r'^[^#]*\s' + re . escape ( arg_3 ) + '[\s,]?.*$' , arg_4 ) for arg_4 in arg_0 ] ) : arg_2 = '' arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """Strip all labels, which are never referenced."""
    arg_1 = []
    for arg_2 in arg_0:
        if re.match(r'^\S+:', arg_2):
            # Found label
            arg_3 = arg_2[0:arg_2.find(':')]
            # Search for references to current label
            if not any([re.match(r'^[^#]*\s' + re.escape(arg_3) + '[\s,]?.*$', arg_4) for arg_4 in arg_0]):
                # Skip labels without seen reference
                arg_2 = ''
        arg_1.append(arg_2)
    return arg_1

Strip all labels which are never referenced .


(self, entity_type, entity_id, metadata)

return self._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(entity_type, entity_id)) \
            .with_json_body(metadata) \
            .return_body() \
            .post()

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
not
is_valid_uuid
(
arg_2
)
:
raise
StorageArgumentException
(
'Invalid UUID for entity_id: {0}'
.
format
(
arg_2
)
)
if
not
isinstance
(
arg_3
,
dict
)
:
raise
StorageArgumentException
(
'The metadata was not provided as a '
'dictionary'
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'{}/{}/metadata/'
.
format
(
arg_1
,
arg_2
)
)
.
with_json_body
(
arg_3
)
.
return_body
(
)
.
post
(
)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''Set metadata for an entity.

        Args:
            entity_type (str): Type of the entity. Admitted values: ['project',
                'folder', 'file'].
            entity_id (str): The UUID of the entity to be modified.
            metadata (dict): A dictionary of key/value pairs to be written as
                metadata.

        Warning:
            It will replace all existing metadata with the provided dictionary.

        Returns:
            A dictionary of the updated metadata::

                {
                    u'bar': u'200',
                    u'foo': u'100'
                }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_2):
            raise StorageArgumentException(
                'Invalid UUID for entity_id: {0}'.format(arg_2))
        if not isinstance(arg_3, dict):
            raise StorageArgumentException('The metadata was not provided as a '
                                           'dictionary')

        return arg_0._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(arg_1, arg_2)) \
            .with_json_body(arg_3) \
            .return_body() \
            .post()


def Func ( arg_0 , arg_1 ) : print ( file = arg_0 . out ) TextWriter ( ) . format ( arg_1 , arg_0 . out )

def Func(arg_0, arg_1):
        """launch layouts display"""
        print(file=arg_0.out)
        TextWriter().format(arg_1, arg_0.out)


(self, path: str, resource, methods: tuple=tuple(), names: Mapping=None)

def Func(arg_0, arg_1: arg_2, arg_3, arg_4: arg_5=arg_5(), arg_6: arg_7=None):
        """Add routes by an resource instance's methods.

        :param path: route path. Should be started with slash (``'/'``).
        :param resource: A "resource" instance. May be an instance of a plain object.
        :param methods: Methods (strings) to register.
        :param names: Dictionary of ``name`` overrides.
        """
        arg_6 = arg_6 or {}
        if arg_4:
            arg_8 = arg_4
        else:
            arg_8 = arg_0.HTTP_METHOD_NAMES
        for arg_9 in arg_8:
            arg_10 = getattr(arg_3, arg_9, None)
            if arg_10:
                arg_11 = arg_6.get(arg_9, arg_0.get_default_handler_name(arg_3, arg_9))
                arg_0.add_route(arg_9.upper(), arg_1, arg_10, arg_11=arg_11)

Add routes by an resource instance s methods .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) if arg_3 . AXOrientation == "AXVerticalOrientation" : return 1 except : pass return 0

def Func(arg_0, arg_1, arg_2):
        """
        Verify scrollbar is vertical

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success.
        @rtype: integer
        """
        try:
            arg_3 = arg_0._get_object_handle(arg_1, arg_2)
            if arg_3.AXOrientation == "AXVerticalOrientation":
                return 1
        except:
            pass
        return 0


def Func ( ) : arg_0 = crontab . CronTab ( user = True ) arg_1 = len ( list ( arg_0 . find_comment ( KRONOS_BREADCRUMB ) ) ) arg_0 . remove_all ( comment = KRONOS_BREADCRUMB ) arg_0 . write ( ) return arg_1

def Func():
    """
    Uninstall tasks from cron.
    """
    arg_0 = crontab.CronTab(user=True)
    arg_1 = len(list(arg_0.find_comment(KRONOS_BREADCRUMB)))
    arg_0.remove_all(comment=KRONOS_BREADCRUMB)
    arg_0.write()
    return arg_1


(
        config_url, rosdistro_name, ci_build_name,
        os_name, os_code_name, arch,
        config=None, build_file=None,
        index=None, dist_file=None,
        jenkins=None, views=None,
        is_disabled=False,
        groovy_script=None,
        build_targets=None,
        dry_run=False,
        underlay_source_paths=None,
        trigger_timer=None)

def Func(
        arg_0, arg_1, arg_2,
        arg_3, arg_4, arg_5,
        arg_6=None, arg_7=None,
        arg_8=None, arg_9=None,
        arg_10=None, arg_11=None,
        arg_12=False,
        arg_13=None,
        arg_14=None,
        arg_15=False,
        arg_16=None,
        arg_17=None):
    """
    Configure a single Jenkins CI job.

    This includes the following steps:
    - clone the ros_buildfarm repository
    - write the distribution repository keys into files
    - invoke the ci/run_ci_job.py script
    """
    if arg_6 is None:
        arg_6 = get_config_index(arg_0)
    if arg_7 is None:
        arg_18 = get_ci_build_files(arg_6, arg_1)
        arg_7 = arg_18[arg_2]
    # Overwrite build_file.targets if build_targets is specified
    if arg_14 is not None:
        arg_7.targets = arg_14

    if arg_8 is None:
        arg_8 = get_index(arg_6.rosdistro_index_url)
    if arg_9 is None:
        arg_9 = get_distribution_file(arg_8, arg_1, arg_7)
        if not arg_9:
            raise JobValidationError(
                'No distribution file matches the build file')

    if arg_3 not in arg_7.targets.keys():
        raise JobValidationError(
            "Invalid OS name '%s' " % arg_3 +
            'choose one of the following: ' +
            ', '.join(sorted(arg_7.targets.keys())))
    if arg_4 not in arg_7.targets[arg_3].keys():
        raise JobValidationError(
            "Invalid OS code name '%s' " % arg_4 +
            'choose one of the following: ' +
            ', '.join(sorted(arg_7.targets[arg_3].keys())))
    if arg_5 not in arg_7.targets[arg_3][arg_4]:
        raise JobValidationError(
            "Invalid architecture '%s' " % arg_5 +
            'choose one of the following: %s' % ', '.join(sorted(
                arg_7.targets[arg_3][arg_4])))

    if len(arg_7.underlay_from_ci_jobs) > 1:
        raise JobValidationError(
            'Only a single underlay job is currently supported, but the ' +
            'build file lists %d.' % len(arg_7.underlay_from_ci_jobs))

    arg_20 = None
    if arg_7.underlay_from_ci_jobs:
        arg_20 = get_ci_job_name(
            arg_1, arg_3, arg_4, arg_5,
            arg_7.underlay_from_ci_jobs[0])
        arg_16 = (arg_16 or []) + \
            ['$UNDERLAY_JOB_SPACE']

    if arg_10 is None:
        from ros_buildfarm.jenkins import connect
        arg_10 = connect(arg_6.jenkins_url)
    if arg_11 is None:
        arg_21 = get_ci_view_name(arg_1)
        configure_ci_view(arg_10, arg_21, arg_15=arg_15)

    arg_22 = get_ci_job_name(
        arg_1, arg_3, arg_4, arg_5, arg_2)

    arg_23 = _get_ci_job_config(
        arg_8, arg_1, arg_7, arg_3,
        arg_4, arg_5,
        arg_7.repos_files,
        arg_20,
        arg_16,
        arg_17,
        arg_12=arg_12)
    # jenkinsapi.jenkins.Jenkins evaluates to false if job count is zero
    if isinstance(arg_10, object) and arg_10 is not False:
        from ros_buildfarm.jenkins import configure_job
        configure_job(arg_10, arg_22, arg_23, arg_15=arg_15)

    return arg_22, arg_23


return [
        feature
        for feature in chain.from_iterable([
            _read_vector_window(path, tile, validity_check=validity_check)
            for path in input_files
        ])
    ]

def Func ( arg_0 , arg_1 , arg_2 = True ) : if not isinstance ( arg_0 , list ) : arg_0 = [ arg_0 ] return [ arg_3 for arg_3 in chain . from_iterable ( [ _Func ( arg_4 , arg_1 , arg_2 = arg_2 ) for arg_4 in arg_0 ] ) ]

def Func(arg_0, arg_1, arg_2=True):
    """
    Read a window of an input vector dataset.

    Also clips geometry.

    Parameters:
    -----------
    input_file : string
        path to vector file
    tile : ``Tile``
        tile extent to read data from
    validity_check : bool
        checks if reprojected geometry is valid and throws ``RuntimeError`` if
        invalid (default: True)

    Returns
    -------
    features : list
      a list of reprojected GeoJSON-like features
    """
    if not isinstance(arg_0, list):
        arg_0 = [arg_0]
    return [
        arg_3
        for arg_3 in chain.from_iterable([
            _Func(arg_4, arg_1, arg_2=arg_2)
            for arg_4 in arg_0
        ])
    ]

Read a window of an input vector dataset .


def Func ( arg_0 ) : if 'type' in arg_0 : return __TYPE_MAP__ . get ( arg_0 [ 'type' ] , np . object_ ) elif 'enum' in arg_0 : return np . object_ elif 'oneOf' in arg_0 : arg_1 = [ Func ( v ) for v in arg_0 [ 'oneOf' ] ] if all ( [ arg_2 == arg_1 [ 0 ] for arg_2 in arg_1 ] ) : return arg_1 [ 0 ] return np . object_

def Func(arg_0):
    '''Get the dtype associated with a jsonschema type definition

    Parameters
    ----------
    typespec : dict
        The schema definition

    Returns
    -------
    dtype : numpy.dtype
        The associated dtype
    '''

    if 'type' in arg_0:
        return __TYPE_MAP__.get(arg_0['type'], np.object_)

    elif 'enum' in arg_0:
        # Enums map to objects
        return np.object_

    elif 'oneOf' in arg_0:
        # Recurse
        arg_1 = [Func(v) for v in arg_0['oneOf']]

        # If they're not all equal, return object
        if all([arg_2 == arg_1[0] for arg_2 in arg_1]):
            return arg_1[0]

    return np.object_


def Func ( arg_0 ) : arg_1 = { } if os . path . isfile ( arg_0 ) : with open ( arg_0 , 'r' ) as wfile : arg_2 = "" arg_3 = "" arg_4 = False while 1 : arg_5 = wfile . readline ( ) if not arg_5 : if arg_4 : add_to_dict ( arg_3 . strip ( ) , arg_2 , arg_1 ) break if "keyname" in arg_5 . lower ( ) : arg_6 = arg_5 . strip ( ) . split ( '=' ) if ( len ( arg_6 ) > 1 ) : if arg_4 : add_to_dict ( arg_3 . strip ( ) , arg_2 , arg_1 ) arg_3 = "" arg_2 = arg_6 [ 1 ] . strip ( ) arg_4 = False if ( len ( arg_5 ) > 1 ) and arg_4 : arg_3 += arg_5 if "ignoredmessage" in arg_5 . lower ( ) : arg_4 = True arg_7 = arg_5 . split ( '=' ) if ( len ( arg_7 ) > 1 ) : arg_3 = arg_7 [ 1 ] return arg_1

def Func(arg_0):
    """
    Read in a text file that java messages to be ignored and generate a dictionary structure out of
    it with key and value pairs.  The keys are test names and the values are lists of java message
    strings associated with that test name where we are either going to add to the existing java messages
    to ignore or remove them from g_ok_java_messages.

    Parameters
    ----------

    filename :  Str
       filename that contains ignored java messages.  The text file shall contain something like this:
        keyName = general
        Message = nfolds: nfolds cannot be larger than the number of rows (406).
        KeyName = pyunit_cv_cars_gbm.py
        Message = Caught exception: Illegal argument(s) for GBM model: GBM_model_python_1452503348770_2586.  \
            Details: ERRR on field: _nfolds: nfolds must be either 0 or >1.
        ...

    :return:
    message_dict : dict
        contains java message to be ignored with key as unit test name or "general" and values as list of ignored java
        messages.
    """
    arg_1 = {}

    if os.path.isfile(arg_0):
        # open file to read in new exclude messages if it exists
        with open(arg_0,'r') as wfile:

            arg_2 = ""
            arg_3 = ""
            arg_4 = False

            while 1:
                arg_5 = wfile.readline()

                if not arg_5:   # reached EOF
                    if arg_4:
                        add_to_dict(arg_3.strip(),arg_2,arg_1)
                    break

                # found a test name or general with values to follow
                if "keyname" in arg_5.lower():  # name of test file or the word "general"
                    arg_6 = arg_5.strip().split('=')

                    if (len(arg_6) > 1): # make sure the line is formatted sort of correctly
                        if arg_4:   # this is the start of a new key/value pair
                            add_to_dict(arg_3.strip(),arg_2,arg_1)
                            arg_3 = ""

                        arg_2 = arg_6[1].strip()
                        arg_4 = False

                if (len(arg_5) > 1) and arg_4:
                    arg_3 += arg_5

                if "ignoredmessage" in arg_5.lower():
                    arg_4 = True    # start of a Java message.
                    arg_7 = arg_5.split('=')

                    if (len(arg_7) > 1):
                        arg_3 = arg_7[1]

    return arg_1

Read in a text file that java messages to be ignored and generate a dictionary structure out of it with key and value pairs . The keys are test names and the values are lists of java message strings associated with that test name where we are either going to add to the existing java messages to ignore or remove them from g_ok_java_messages .


def Func ( arg_0 , * arg_1 ) : arg_1 = [ ( tuplify ( s ) , tuplify ( e ) ) for s , e in arg_1 ] arg_2 = arg_0 . kvl . scan_keys ( arg_0 . TABLE , * arg_1 ) return imap ( itemgetter ( 0 ) , arg_2 )

def Func(arg_0, *arg_1):
        '''Retrieve content ids in a range of ids.

        Returns a generator of ``content_id`` corresponding to the
        content identifier ranges given. `key_ranges` can be a possibly
        empty list of 2-tuples, where the first element of the tuple
        is the beginning of a range and the second element is the end
        of a range. To specify the beginning or end of the table, use
        an empty tuple `()`.

        If the list is empty, then this yields all content ids in
        the storage.

        :param key_ranges: as described in
                           :meth:`kvlayer._abstract_storage.AbstractStorage`
        :rtype: generator of ``content_id``
        '''
        # (id, id) -> ((id,), (id,))
        arg_1 = [(tuplify(s), tuplify(e)) for s, e in arg_1]
        arg_2 = arg_0.kvl.scan_keys(arg_0.TABLE, *arg_1)
        return imap(itemgetter(0), arg_2)

Retrieve content ids in a range of ids .


def Func ( arg_0 , arg_1 = "" ) : def decorator ( arg_2 ) : @ wraps ( arg_2 ) def wrapper ( * arg_3 , ** arg_4 ) : _Func ( arg_0 , arg_2 . __name__ , arg_1 ) arg_5 = arg_2 ( * arg_3 , ** arg_4 ) return arg_5 return wrapper return decorator

def Func(arg_0, arg_1=""):
    """
    Decorator to log a message before executing a function
    """
    def decorator(arg_2):
        @wraps(arg_2)
        def wrapper(*arg_3, **arg_4):
            _Func(arg_0, arg_2.__name__, arg_1)
            arg_5 = arg_2(*arg_3, **arg_4)
            return arg_5
        return wrapper
    return decorator


def Func ( arg_0 , arg_1 ) : arg_1 = normalize ( 'NFKD' , text_type ( arg_1 . lower ( ) ) ) arg_1 = '' . join ( c for c in arg_1 if c in { 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , } ) arg_1 = arg_1 . replace ( 'j' , 'i' ) . replace ( 'v' , 'u' ) if arg_1 [ - 3 : ] == 'que' : if arg_1 [ : - 3 ] in arg_0 . _keep_que or arg_1 == 'que' : return { 'n' : arg_1 , 'v' : arg_1 } else : arg_1 = arg_1 [ : - 3 ] arg_2 = arg_1 arg_3 = arg_1 for arg_4 in range ( 4 , 0 , - 1 ) : if arg_1 [ - arg_4 : ] in arg_0 . _n_endings [ arg_4 ] : if len ( arg_1 ) - 2 >= arg_4 : arg_2 = arg_1 [ : - arg_4 ] else : arg_2 = arg_1 break for arg_4 in range ( 6 , 0 , - 1 ) : if arg_1 [ - arg_4 : ] in arg_0 . _v_endings_strip [ arg_4 ] : if len ( arg_1 ) - 2 >= arg_4 : arg_3 = arg_1 [ : - arg_4 ] else : arg_3 = arg_1 break if arg_1 [ - arg_4 : ] in arg_0 . _v_endings_alter [ arg_4 ] : if arg_1 [ - arg_4 : ] in { 'iuntur' , 'erunt' , 'untur' , 'iunt' , 'unt' , } : arg_5 = arg_1 [ : - arg_4 ] + 'i' arg_6 = 1 elif arg_1 [ - arg_4 : ] in { 'beris' , 'bor' , 'bo' } : arg_5 = arg_1 [ : - arg_4 ] + 'bi' arg_6 = 2 else : arg_5 = arg_1 [ : - arg_4 ] + 'eri' arg_6 = 3 if len ( arg_5 ) >= 2 + arg_6 : arg_3 = arg_5 else : arg_3 = arg_1 break return { 'n' : arg_2 , 'v' : arg_3 }

def Func(arg_0, arg_1):
        """Return the Func of a word according to the Schinke Funcmer.

        Parameters
        ----------
        word : str
            The word to Func

        Returns
        -------
        str
            Word Func

        Examples
        --------
        >>> stmr = Schinke()
        >>> stmr.Func('atque')
        {'n': 'atque', 'v': 'atque'}
        >>> stmr.Func('census')
        {'n': 'cens', 'v': 'censu'}
        >>> stmr.Func('virum')
        {'n': 'uir', 'v': 'uiru'}
        >>> stmr.Func('populusque')
        {'n': 'popul', 'v': 'populu'}
        >>> stmr.Func('senatus')
        {'n': 'senat', 'v': 'senatu'}

        """
        arg_1 = normalize('NFKD', text_type(arg_1.lower()))
        arg_1 = ''.join(
            c
            for c in arg_1
            if c
            in {
                'a',
                'b',
                'c',
                'd',
                'e',
                'f',
                'g',
                'h',
                'i',
                'j',
                'k',
                'l',
                'm',
                'n',
                'o',
                'p',
                'q',
                'r',
                's',
                't',
                'u',
                'v',
                'w',
                'x',
                'y',
                'z',
            }
        )

        # Rule 2
        arg_1 = arg_1.replace('j', 'i').replace('v', 'u')

        # Rule 3
        if arg_1[-3:] == 'que':
            # This diverges from the paper by also returning 'que' itself
            #  unFuncmed
            if arg_1[:-3] in arg_0._keep_que or arg_1 == 'que':
                return {'n': arg_1, 'v': arg_1}
            else:
                arg_1 = arg_1[:-3]

        # Base case will mean returning the words as is
        arg_2 = arg_1
        arg_3 = arg_1

        # Rule 4
        for arg_4 in range(4, 0, -1):
            if arg_1[-arg_4:] in arg_0._n_endings[arg_4]:
                if len(arg_1) - 2 >= arg_4:
                    arg_2 = arg_1[:-arg_4]
                else:
                    arg_2 = arg_1
                break

        for arg_4 in range(6, 0, -1):
            if arg_1[-arg_4:] in arg_0._v_endings_strip[arg_4]:
                if len(arg_1) - 2 >= arg_4:
                    arg_3 = arg_1[:-arg_4]
                else:
                    arg_3 = arg_1
                break
            if arg_1[-arg_4:] in arg_0._v_endings_alter[arg_4]:
                if arg_1[-arg_4:] in {
                    'iuntur',
                    'erunt',
                    'untur',
                    'iunt',
                    'unt',
                }:
                    arg_5 = arg_1[:-arg_4] + 'i'
                    arg_6 = 1
                elif arg_1[-arg_4:] in {'beris', 'bor', 'bo'}:
                    arg_5 = arg_1[:-arg_4] + 'bi'
                    arg_6 = 2
                else:
                    arg_5 = arg_1[:-arg_4] + 'eri'
                    arg_6 = 3

                # Technically this diverges from the paper by considering the
                # length of the Func without the new suffix
                if len(arg_5) >= 2 + arg_6:
                    arg_3 = arg_5
                else:
                    arg_3 = arg_1
                break

        return {'n': arg_2, 'v': arg_3}

Return the stem of a word according to the Schinke stemmer.

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

        Returns
        -------
        str
            Word stem

        Examples
        --------
        >>> stmr = Schinke()
        >>> stmr.stem('atque')
        {'n': 'atque', 'v': 'atque'}
        >>> stmr.stem('census')
        {'n': 'cens', 'v': 'censu'}
        >>> stmr.stem('virum')
        {'n': 'uir', 'v': 'uiru'}
        >>> stmr.stem('populusque')
        {'n': 'popul', 'v': 'populu'}
        >>> stmr.stem('senatus')
        {'n': 'senat', 'v': 'senatu'}

Return the stem of a word according to the Schinke stemmer .


def
Func
(
arg_0
,
arg_1
:
arg_2
)
->
:
if
not
arg_0
.
is_populated
(
)
:
arg_0
.
populate
(
)
arg_3
=
arg_0
.
_get_namespace_name_to_encoding
(
desc
=
'writing names'
)
write_annotation
(
keyword
=
arg_0
.
_get_namespace_keyword
(
)
,
citation_name
=
arg_0
.
_get_namespace_name
(
)
,
description
=
''
,
arg_3
=
arg_3
,
arg_1
=
arg_1
,
)

def Func(arg_0, arg_1: arg_2) -> None:
        """Write as a BEL annotation file."""
        if not arg_0.is_populated():
            arg_0.populate()

        arg_3 = arg_0._get_namespace_name_to_encoding(desc='writing names')

        write_annotation(
            keyword=arg_0._get_namespace_keyword(),
            citation_name=arg_0._get_namespace_name(),
            description='',
            arg_3=arg_3,
            arg_1=arg_1,
        )


def Func(arg_0, **arg_1):
        """
        Generate a valid request token for user based authentication.

        A request token is required to ask the user for permission to
        access their account.

        After obtaining the request_token, either:
        (1) Direct your user to:
                https://www.themoviedb.org/authenticate/REQUEST_TOKEN
        or:
        (2) Call token_validate_with_login() below.

        Returns:
            A dict respresentation 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

Generate a valid request token for user based authentication .


def Func ( ** arg_0 ) : arg_0 [ 'stdout' ] = False arg_1 = arg_0 . pop ( 'input' , [ ] ) arg_1 = [ cmd for cmd in arg_1 if cmd != 'q' ] arg_0 [ 'input' ] = arg_1 + [ '' , 'q' ] return gromacs . make_ndx ( ** arg_0 )

def Func(**arg_0):
    """make_ndx that captures all output

    Standard :func:`~gromacs.make_ndx` command with the input and
    output pre-set in such a way that it can be conveniently used for
    :func:`parse_ndxlist`.

    Example::
      ndx_groups = parse_ndxlist(Func(n=ndx)[0])

    Note that the convenient :func:`get_ndx_groups` function does exactly
    that and can probably used in most cases.

    :Arguments:
        keywords are passed on to :func:`~gromacs.make_ndx`
    :Returns:
        (*returncode*, *output*, ``None``)
    """
    arg_0['stdout']=False   # required for proper output as described in doc
    arg_1 = arg_0.pop('input',[])
    arg_1 = [cmd for cmd in arg_1 if cmd != 'q']  # filter any quit
    arg_0['input'] = arg_1 + ['', 'q']                # necessary commands
    return gromacs.make_ndx(**arg_0)

make_ndx that captures all output

    Standard :func:`~gromacs.make_ndx` command with the input and
    output pre-set in such a way that it can be conveniently used for
    :func:`parse_ndxlist`.

    Example::
      ndx_groups = parse_ndxlist(make_ndx_captured(n=ndx)[0])

    Note that the convenient :func:`get_ndx_groups` function does exactly
    that and can probably used in most cases.

    :Arguments:
        keywords are passed on to :func:`~gromacs.make_ndx`
    :Returns:
        (*returncode*, *output*, ``None``)


def Func ( arg_0 , arg_1 ) : if str ( arg_1 ) not in arg_0 . store : raise KeyNotFound return arg_0 . store . Func ( str ( arg_1 ) )

def Func(arg_0, arg_1):
        """ Obtain the private key for a given public key

            :param str pub: Public Key
        """
        if str(arg_1) not in arg_0.store:
            raise KeyNotFound
        return arg_0.store.Func(str(arg_1))


def Func(arg_0):
        """
        yield the segment number and when it will be available
        There are two cases for segment number generation, static and dynamic.

        In the case of static stream, the segment number starts at the startNumber and counts
        up to the number of segments that are represented by the periods duration.

        In the case of dynamic streams, the segments should appear at the specified time
        in the simplest case the segment number is based on the time since the availabilityStartTime
        :return:
        """
        log.debug("Generating segment numbers for {0} playlist (id={1})".format(arg_0.root.type, arg_0.parent.id))
        if arg_0.root.type == u"static":
            arg_1 = repeat(epoch_start)
            arg_2 = arg_0.period.duration.seconds or arg_0.root.mediaPresentationDuration.seconds
            if arg_2:
                arg_3 = range(arg_0.startNumber, int(arg_2 / arg_0.duration_seconds) + 1)
            else:
                arg_3 = count(arg_0.startNumber)
        else:
            arg_4 = datetime.datetime.now(utc)
            if arg_0.presentationTimeOffset:
                arg_5 = (arg_4 - arg_0.presentationTimeOffset) - arg_0.root.availabilityStartTime
                arg_6 = arg_0.root.availabilityStartTime + arg_0.presentationTimeOffset + arg_5
                arg_7 = arg_6
            else:
                arg_5 = arg_4 - arg_0.root.availabilityStartTime
                arg_7 = arg_4

            # if there is no delay, use a delay of 3 seconds
            arg_8 = datetime.timedelta(seconds=(arg_0.root.suggestedPresentationDelay.total_seconds()
                                                          if arg_0.root.suggestedPresentationDelay
                                                          else 3))

            # the number of the segment that is available at NOW - SUGGESTED_DELAY - BUFFER_TIME
            arg_3 = count(arg_0.startNumber +
                                int((arg_5 - arg_8 - arg_0.root.minBufferTime).total_seconds() /
                                    arg_0.duration_seconds))

            # the time the segment number is available at NOW
            arg_1 = count_dt(arg_7,
                                      step=datetime.timedelta(seconds=arg_0.duration_seconds))

        for arg_9, arg_10 in izip(arg_3, arg_1):
            yield arg_9, arg_10

yield the segment number and when it will be available There are two cases for segment number generation static and dynamic .


def Func(arg_0, arg_1, arg_2):
    '''Activate an environment'''

    if not arg_0:
        arg_3 = click.get_current_context()
        if cpenv.get_active_env():
            arg_3.invoke(info)
            return

        click.echo(arg_3.get_help())
        arg_4 = (
            '\nExamples: \n'
            '    cpenv Func my_env\n'
            '    cpenv Func ./relative/path/to/my_env\n'
            '    cpenv Func my_env my_module\n'
        )
        click.echo(arg_4)
        return

    if arg_1:
        cpenv.module_resolvers.remove(cpenv.resolver.module_resolver)
        cpenv.module_resolvers.remove(cpenv.resolver.active_env_module_resolver)

    if arg_2:
        cpenv.module_resolvers.remove(cpenv.resolver.modules_path_resolver)

    try:
        arg_5 = cpenv.resolve(*arg_0)
    except cpenv.ResolveError as e:
        click.echo('\n' + str(e))
        return

    arg_6 = set(arg_5.resolved)
    arg_7 = set()
    arg_8 = cpenv.get_active_env()
    if arg_8:
        arg_7.add(arg_8)
    arg_7.update(cpenv.get_active_modules())

    arg_9 = arg_6 - arg_7
    arg_10 = arg_7 & arg_6

    if arg_10 and not arg_9:
        click.echo(
            '\nModules already active: '
            + bold(' '.join([arg_11.name for arg_11 in arg_10]))
        )
        return

    if arg_8 and contains_env(arg_9):
        click.echo('\nUse bold(exit) to leave your active environment first.')
        return

    click.echo('\nResolved the following modules...')
    click.echo(format_objects(arg_5.resolved))
    arg_5.Func()
    click.echo(blue('\nLaunching subshell...'))

    arg_12 = sorted(arg_6 | arg_7, key=_type_and_name)
    arg_13 = ':'.join([arg_11.name for arg_11 in arg_12])
    shell.launch(arg_13)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split ( '.' ) arg_3 = '.' . join ( c [ 0 ] for c in arg_2 [ : - 1 ] ) return f'{prefix}.{components[-1]}'

def Func(arg_0, arg_1):
        """
        Produce a summarized record name
          i.e. manticore.core.executor -> m.c.executor
        """
        arg_2 = arg_1.split('.')
        arg_3 = '.'.join(c[0] for c in arg_2[:-1])
        return f'{prefix}.{components[-1]}'

Produce a summarized record name i . e . manticore . core . executor - > m . c . executor


def Func(arg_0, arg_1):
        """Handle successful response to the roster request.
        """
        arg_2 = arg_1.get_payload(RosterPayload)
        if arg_2 is None:
            if "versioning" in arg_0.server_features and arg_0.roster:
                logger.debug("Server will send roster delta in pushes")
            else:
                logger.warning("Bad roster response (no payload)")
                arg_0._event_queue.put(RosterNotReceivedEvent(arg_0, arg_1))
                return
        else:
            arg_3 = list(arg_2)
            for arg_4 in arg_3:
                arg_4.verify_roster_result(True)
            arg_0.roster = Roster(arg_3, arg_2.version)
        arg_0._event_queue.put(RosterReceivedEvent(arg_0, arg_0.roster))

Handle successful response to the roster request .


def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 ) : arg_0 . queue . append ( AudioTrack ( ) . build ( arg_3 , arg_1 ) )

def Func(arg_0, arg_1: arg_2, arg_3: arg_4):
        """ Adds a track to the queue. """
        arg_0.queue.append(AudioTrack().build(arg_3, arg_1))


def Func(arg_0, arg_1, arg_2=False):
        """
        Get output raw data.

        This function won't work with multiprocessing, as it uses the
        ``threading.Lock()`` class.

        Parameters
        ----------
        tile : tuple, Tile or BufferedTile
            If a tile index is given, a tile from the output pyramid will be
            assumed. Tile cannot be bigger than process tile!

        Returns
        -------
        data : NumPy array or features
            process output
        """
        if not isinstance(arg_1, (BufferedTile, tuple)):
            raise TypeError("'tile' must be a tuple or BufferedTile")
        if isinstance(arg_1, tuple):
            arg_1 = arg_0.config.output_pyramid.tile(*arg_1)
        if arg_2:
            arg_1 = arg_0.config.baselevels["tile_pyramid"].tile(*arg_1.id)

        # Return empty data if zoom level is outside of process zoom levels.
        if arg_1.zoom not in arg_0.config.zoom_levels:
            return arg_0.config.output.empty(arg_1)

        # TODO implement reprojection
        if arg_1.crs != arg_0.config.process_pyramid.crs:
            raise NotImplementedError(
                "reprojection between processes not yet implemented"
            )

        if arg_0.config.mode == "memory":
            # Determine affected process Tile and check whether it is already
            # cached.
            arg_3 = arg_0.config.process_pyramid.intersecting(arg_1)[0]
            return arg_0._extract(
                in_tile=arg_3,
                in_data=arg_0._execute_using_cache(arg_3),
                out_tile=arg_1
            )

        # TODO: cases where tile intersects with multiple process tiles
        arg_3 = arg_0.config.process_pyramid.intersecting(arg_1)[0]

        # get output_tiles that intersect with current tile
        if arg_1.pixelbuffer > arg_0.config.output.pixelbuffer:
            arg_4 = list(arg_0.config.output_pyramid.tiles_from_bounds(
                arg_1.bounds, arg_1.zoom
            ))
        else:
            arg_4 = arg_0.config.output_pyramid.intersecting(arg_1)

        if arg_0.config.mode == "readonly" or arg_2:
            if arg_0.config.output.tiles_exist(arg_3):
                return arg_0._read_existing_output(arg_1, arg_4)
            else:
                return arg_0.config.output.empty(arg_1)
        elif arg_0.config.mode == "continue" and not arg_2:
            if arg_0.config.output.tiles_exist(arg_3):
                return arg_0._read_existing_output(arg_1, arg_4)
            else:
                return arg_0._process_and_overwrite_output(arg_1, arg_3)
        elif arg_0.config.mode == "overwrite" and not arg_2:
            return arg_0._process_and_overwrite_output(arg_1, arg_3)


def Func ( arg_0 ) : arg_1 = arg_0 ( ) for arg_2 , arg_3 in arg_1 . fields . items ( ) : if isinstance ( arg_3 , ModelTypeValidator ) : arg_4 = arg_3 . __class__ . check_type arg_3 . _deserialize = MethodType ( arg_4 , arg_3 ) return arg_1

def Func(arg_0):
        """Create a patched Schema for validating models.

        Model validation is not part of Marshmallow. Schemas have a ``validate``
        method but this delegates execution on ``load`` and discards the result.
        Similarly, ``load`` will call ``_deserialize`` on every field in the
        schema.

        This function patches the ``_deserialize`` instance method of each
        field to make it call a custom defined method ``check_type``
        provided by Qiskit in the different fields at
        ``qiskit.validation.fields``.

        Returns:
            BaseSchema: a copy of the original Schema, overriding the
                ``_deserialize()`` call of its fields.
        """
        arg_1 = arg_0()
        for arg_2, arg_3 in arg_1.fields.items():
            if isinstance(arg_3, ModelTypeValidator):
                arg_4 = arg_3.__class__.check_type
                arg_3._deserialize = MethodType(arg_4, arg_3)

        return arg_1

Create a patched Schema for validating models .


(
        sess=None, mode_name='model.ckpt', save_dir='checkpoint', var_list=None, global_step=None, printable=False
)

def
Func
(
arg_0
=
,
arg_1
=
'model.ckpt'
,
arg_2
=
'checkpoint'
,
arg_3
=
,
arg_4
=
,
arg_5
=
False
)
:
if
arg_0
is
:
raise
ValueError
(
"session is None."
)
if
arg_3
is
:
arg_3
=
[
]
arg_6
=
os
.
path
.
join
(
arg_2
,
arg_1
)
if
arg_3
==
[
]
:
arg_3
=
tf
.
global_variables
(
)
logging
.
info
(
"[*] save %s n_params: %d"
%
(
arg_6
,
len
(
arg_3
)
)
)
if
arg_5
:
for
arg_7
,
arg_8
in
enumerate
(
arg_3
)
:
logging
.
info
(
"  param {:3}: {:15}   {}"
.
format
(
arg_7
,
arg_8
.
name
,
str
(
arg_8
.
get_shape
(
)
)
)
)
arg_9
=
tf
.
train
.
Saver
(
arg_3
)
arg_9
.
save
(
arg_0
,
arg_6
,
arg_4
=
arg_4
)

def Func(
        arg_0=None, arg_1='model.ckpt', arg_2='checkpoint', arg_3=None, arg_4=None, arg_5=False
):
    """Save parameters into `ckpt` file.

    Parameters
    ------------
    sess : Session
        TensorFlow Session.
    mode_name : str
        The name of the model, default is ``model.ckpt``.
    save_dir : str
        The path / file directory to the `ckpt`, default is ``checkpoint``.
    var_list : list of tensor
        The parameters / variables (tensor) to be saved. If empty, save all global variables (default).
    global_step : int or None
        Step number.
    printable : boolean
        Whether to print all parameters information.

    See Also
    --------
    load_ckpt

    """
    if arg_0 is None:
        raise ValueError("session is None.")
    if arg_3 is None:
        arg_3 = []

    arg_6 = os.path.join(arg_2, arg_1)
    if arg_3 == []:
        arg_3 = tf.global_variables()

    logging.info("[*] save %s n_params: %d" % (arg_6, len(arg_3)))

    if arg_5:
        for arg_7, arg_8 in enumerate(arg_3):
            logging.info("  param {:3}: {:15}   {}".format(arg_7, arg_8.name, str(arg_8.get_shape())))

    arg_9 = tf.train.Saver(arg_3)
    arg_9.save(arg_0, arg_6, arg_4=arg_4)


def Func ( arg_0 , arg_1 ) : return XMLElement ( lib . lsl_Func ( arg_0 . e , arg_1 . e ) )

def Func(arg_0, arg_1):
        """Prepend a copy of the specified element as a child."""
        return XMLElement(lib.lsl_Func(arg_0.e, arg_1.e))

Prepend a copy of the specified element as a child .


def Func(arg_0,arg_1):
    """
    Cascade frequency response

    Mark Wickert October 2016
    """
    arg_2,arg_3 = arg_0.shape
    arg_1,arg_4 = signal.freqz(arg_0[0,:3],arg_0[0,3:],arg_1)
    for arg_5 in range(1,arg_2):
        arg_1,arg_6 = signal.freqz(arg_0[arg_5,:3],arg_0[arg_5,3:],arg_1)
        arg_4 *= arg_6
    return arg_1, arg_4


def Func(arg_0=None, arg_1=True):
    """
    Decorator to mark a method as an API endpoint for later registration.

    Args:
        path_or_func: either the function to be decorated or its API path.
        decorate (bool): Apply API_ENDPOINT_DECORATORS if True (default).

    Returns:
        Callable: Decorated function (with optionally applied decorators).

    Examples:

        >>> from dddp.api import APIMixin, Func
        >>> class Counter(APIMixin):
        ...     value = 0
        ...
        ...     # default API path matches function name 'increment'.
        ...     @Func
        ...     def increment(self, amount):
        ...         '''Increment counter value by `amount`.'''
        ...         self.value += amount
        ...         return self.value
        ...
        ...     # excplicitly set API path to 'Decrement'.
        ...     @Func('Decrement')
        ...     def decrement(self, amount):
        ...         '''Decrement counter value by `amount`.'''
        ...         self.value -= amount
        ...         return self.value

    """
    def maybe_decorated(arg_2):
        """Apply API_ENDPOINT_DECORATORS to func."""
        if arg_1:
            for arg_3 in API_ENDPOINT_DECORATORS:
                arg_2 = arg_3()(arg_2)
        return arg_2
    if callable(arg_0):
        arg_0.api_path = arg_0.__name__
        return maybe_decorated(arg_0)
    else:
        def _Func(arg_2):
            """Decorator inner."""
            if arg_0 is None:
                arg_2.api_path = arg_2.__name__
            else:
                arg_2.api_path = arg_0
            return maybe_decorated(arg_2)
        return _Func

Decorator to mark a method as an API endpoint for later registration.

    Args:
        path_or_func: either the function to be decorated or its API path.
        decorate (bool): Apply API_ENDPOINT_DECORATORS if True (default).

    Returns:
        Callable: Decorated function (with optionally applied decorators).

    Examples:

        >>> from dddp.api import APIMixin, api_endpoint
        >>> class Counter(APIMixin):
        ...     value = 0
        ...
        ...     # default API path matches function name 'increment'.
        ...     @api_endpoint
        ...     def increment(self, amount):
        ...         '''Increment counter value by `amount`.'''
        ...         self.value += amount
        ...         return self.value
        ...
        ...     # excplicitly set API path to 'Decrement'.
        ...     @api_endpoint('Decrement')
        ...     def decrement(self, amount):
        ...         '''Decrement counter value by `amount`.'''
        ...         self.value -= amount
        ...         return self.value

Decorator to mark a method as an API endpoint for later registration .


return self.x1 >= 0 and self.x2 < width and self.y1 >= 0 and self.y2 < height

def Func(arg_0, arg_1):
        """
        Estimate whether the bounding box is fully inside the image area.

        Parameters
        ----------
        image : (H,W,...) ndarray or tuple of int
            Image dimensions to use.
            If an ndarray, its shape will be used.
            If a tuple, it is assumed to represent the image shape
            and must contain at least two integers.

        Returns
        -------
        bool
            True if the bounding box is fully inside the image area. False otherwise.

        """
        arg_2 = normalize_shape(arg_1)
        arg_3, arg_4 = arg_2[0:2]
        return arg_0.x1 >= 0 and arg_0.x2 < arg_4 and arg_0.y1 >= 0 and arg_0.y2 < arg_3

Estimate whether the bounding box is fully inside the image area .


def Func ( arg_0 , arg_1 = "Func" ) : with arg_0 . _name_scope ( arg_1 ) : with tf . control_dependencies ( arg_0 . _assertions ) : arg_2 = [ d . entropy ( ) for d in arg_0 . components ] arg_3 = arg_0 . _cat_probs ( log_probs = False ) arg_4 = [ c_p * m for ( c_p , m ) in zip ( arg_3 , arg_2 ) ] return tf . add_n ( arg_4 )

def Func(arg_0, arg_1="Func"):
    r"""A lower bound on the entropy of this mixture model.

    The bound below is not always very tight, and its usefulness depends
    on the mixture probabilities and the components in use.

    A lower bound is useful for ELBO when the `Mixture` is the variational
    distribution:

    \\(
    \log p(x) >= ELBO = \int q(z) \log p(x, z) dz + H[q]
    \\)

    where \\( p \\) is the prior distribution, \\( q \\) is the variational,
    and \\( H[q] \\) is the entropy of \\( q \\). If there is a lower bound
    \\( G[q] \\) such that \\( H[q] \geq G[q] \\) then it can be used in
    place of \\( H[q] \\).

    For a mixture of distributions \\( q(Z) = \sum_i c_i q_i(Z) \\) with
    \\( \sum_i c_i = 1 \\), by the concavity of \\( f(x) = -x \log x \\), a
    simple lower bound is:

    \\(
    \begin{align}
    H[q] & = - \int q(z) \log q(z) dz \\\
       & = - \int (\sum_i c_i q_i(z)) \log(\sum_i c_i q_i(z)) dz \\\
       & \geq - \sum_i c_i \int q_i(z) \log q_i(z) dz \\\
       & = \sum_i c_i H[q_i]
    \end{align}
    \\)

    This is the term we calculate below for \\( G[q] \\).

    Args:
      name: A name for this operation (optional).

    Returns:
      A lower bound on the Mixture's entropy.
    """
    with arg_0._name_scope(arg_1):
      with tf.control_dependencies(arg_0._assertions):
        arg_2 = [d.entropy() for d in arg_0.components]
        arg_3 = arg_0._cat_probs(log_probs=False)
        arg_4 = [
            c_p * m for (c_p, m) in zip(arg_3, arg_2)
        ]
        # These are all the same shape by virtue of matching batch_shape
        return tf.add_n(arg_4)

r A lower bound on the entropy of this mixture model .


def Func ( arg_0 , arg_1 ) -> None : arg_0 . _events . push ( arg_0 . now , PRIORITY_NORMAL , arg_1 )

def Func(arg_0, arg_1) -> None:
        """
        Add process to events with default priority on current time
        """
        arg_0._events.push(arg_0.now, PRIORITY_NORMAL, arg_1)


(returns, transactions, positions,
                  legend_loc='best', ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
'best'
,
arg_4
=
,
**
arg_5
)
:
if
arg_4
is
:
arg_4
=
plt
.
gca
(
)
arg_6
=
FuncFormatter
(
utils
.
two_dec_places
)
arg_4
.
yaxis
.
set_major_formatter
(
FuncFormatter
(
arg_6
)
)
arg_7
=
txn
.
get_turnover
(
arg_2
,
arg_1
)
arg_8
=
arg_7
.
resample
(
"M"
)
.
mean
(
)
arg_7
.
plot
(
color
=
'steelblue'
,
alpha
=
1.0
,
lw
=
0.5
,
arg_4
=
arg_4
,
**
arg_5
)
arg_8
.
plot
(
color
=
'orangered'
,
alpha
=
0.5
,
lw
=
2
,
arg_4
=
arg_4
,
**
arg_5
)
arg_4
.
axhline
(
arg_7
.
mean
(
)
,
color
=
'steelblue'
,
linestyle
=
'--'
,
lw
=
3
,
alpha
=
1.0
)
arg_4
.
legend
(
[
'Daily turnover'
,
'Average daily turnover, by month'
,
'Average daily turnover, net'
]
,
loc
=
arg_3
,
frameon
=
True
,
framealpha
=
0.5
)
arg_4
.
set_title
(
'Daily turnover'
)
arg_4
.
set_xlim
(
(
arg_0
.
index
[
0
]
,
arg_0
.
index
[
1
]
)
)
arg_4
.
set_ylim
(
(
0
,
2
)
)
arg_4
.
set_ylabel
(
'Turnover'
)
arg_4
.
set_xlabel
(
''
)
return
arg_4

def Func(arg_0, arg_1, arg_2,
                  arg_3='best', arg_4=None, **arg_5):
    """
    Plots turnover vs. date.

    Turnover is the number of shares traded for a period as a fraction
    of total shares.

    Displays daily total, daily average per month, and all-time daily
    average.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in tears.create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in tears.create_full_tear_sheet.
    legend_loc : matplotlib.loc, optional
        The location of the legend on the plot.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_4 is None:
        arg_4 = plt.gca()

    arg_6 = FuncFormatter(utils.two_dec_places)
    arg_4.yaxis.set_major_formatter(FuncFormatter(arg_6))

    arg_7 = txn.get_turnover(arg_2, arg_1)
    arg_8 = arg_7.resample("M").mean()
    arg_7.plot(color='steelblue', alpha=1.0, lw=0.5, arg_4=arg_4, **arg_5)
    arg_8.plot(
        color='orangered',
        alpha=0.5,
        lw=2,
        arg_4=arg_4,
        **arg_5)
    arg_4.axhline(
        arg_7.mean(), color='steelblue', linestyle='--', lw=3, alpha=1.0)
    arg_4.legend(['Daily turnover',
               'Average daily turnover, by month',
               'Average daily turnover, net'],
              loc=arg_3, frameon=True, framealpha=0.5)
    arg_4.set_title('Daily turnover')
    arg_4.set_xlim((arg_0.index[0], arg_0.index[-1]))
    arg_4.set_ylim((0, 2))
    arg_4.set_ylabel('Turnover')
    arg_4.set_xlabel('')
    return arg_4


(self, id, radius=8, style=style.DEFAULT, category="", label=None, root=False,
                 properties={})

def Func ( arg_0 , arg_1 , arg_2 = 8 , arg_3 = arg_3 . DEFAULT , arg_5 = "" , arg_6 = None , arg_7 = False , arg_8 = { } ) : if arg_0 . has_key ( arg_1 ) : return arg_0 [ arg_1 ] if not isinstance ( arg_3 , str ) and arg_3 . __dict__ . has_key [ "name" ] : arg_3 = arg_3 . name arg_9 = node ( arg_0 , arg_1 , arg_2 , arg_3 , arg_5 , arg_6 , arg_8 ) arg_0 [ arg_9 . id ] = arg_9 arg_0 . nodes . append ( arg_9 ) if arg_7 : arg_0 . root = arg_9 return arg_9

def Func(arg_0, arg_1, arg_2=8, arg_3=arg_3.DEFAULT, arg_5="", arg_6=None, arg_7=False,
                 arg_8={}):

        """ Add node from id and return the node object.
        """

        if arg_0.has_key(arg_1):
            return arg_0[arg_1]

        if not isinstance(arg_3, str) and arg_3.__dict__.has_key["name"]:
            arg_3 = arg_3.name

        arg_9 = node(arg_0, arg_1, arg_2, arg_3, arg_5, arg_6, arg_8)
        arg_0[arg_9.id] = arg_9
        arg_0.nodes.append(arg_9)
        if arg_7: arg_0.root = arg_9

        return arg_9

Add node from id and return the node object .


def Func ( arg_0 , arg_1 ) : arg_2 = { } if not arg_1 : return arg_2 arg_3 = arg_0 . client . user ( arg_1 ) arg_2 = json . loads ( arg_3 ) arg_4 = arg_0 . client . user_orgs ( arg_1 ) arg_2 [ 'organizations' ] = json . loads ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
        """Get user and org data for the login"""

        arg_2 = {}

        if not arg_1:
            return arg_2

        arg_3 = arg_0.client.user(arg_1)
        arg_2 = json.loads(arg_3)
        arg_4 = \
            arg_0.client.user_orgs(arg_1)
        arg_2['organizations'] = json.loads(arg_4)

        return arg_2


def Func(arg_0, arg_1, arg_2):
        """Redirect uri for this request token."""
        log.debug('Get redirect uri of %r', arg_1)
        arg_3 = arg_2.request_token or arg_0._grantgetter(arg_1=arg_1)
        return arg_3.redirect_uri


(cls, project, zones, min_cores, min_ram, disk_size,
                     boot_disk_size, preemptible, accelerator_type,
                     accelerator_count, image, script_name, envs, inputs,
                     outputs, pipeline_name)

return {
        'ephemeralPipeline': {
            'projectId': project,
            'name': pipeline_name,

            # Define the resources needed for this pipeline.
            'resources': {
                'minimumCpuCores': min_cores,
                'minimumRamGb': min_ram,
                'bootDiskSizeGb': boot_disk_size,
                'preemptible': preemptible,
                'zones': google_base.get_zones(zones),
                'acceleratorType': accelerator_type,
                'acceleratorCount': accelerator_count,

                # Create a data disk that is attached to the VM and destroyed
                # when the pipeline terminates.
                'disks': [{
                    'name': 'datadisk',
                    'autoDelete': True,
                    'sizeGb': disk_size,
                    'mountPoint': providers_util.DATA_MOUNT_POINT,
                }],
            },

            'inputParameters': input_envs + input_files,
            'outputParameters': output_files,

            'docker': {
                'imageName': image,
                'cmd': docker_command,
            }
        }
    }

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 , arg_11 , arg_12 , arg_13 , arg_14 , arg_15 ) : if arg_3 is None : arg_3 = job_model . DEFAULT_MIN_CORES if arg_4 is None : arg_4 = job_model . DEFAULT_MIN_RAM if arg_5 is None : arg_5 = job_model . DEFAULT_DISK_SIZE if arg_6 is None : arg_6 = job_model . DEFAULT_BOOT_DISK_SIZE if arg_7 is None : arg_7 = job_model . DEFAULT_PREEMPTIBLE arg_16 = arg_0 . _Func_docker_command ( arg_11 , arg_13 , arg_14 , arg_12 ) arg_17 = [ { 'name' : SCRIPT_VARNAME } ] + [ { 'name' : env . name } for env in arg_12 if env . value ] arg_18 = [ arg_0 . _Func_input_file_param ( var . name , var . docker_path ) for var in arg_13 if not var . recursive and var . value ] arg_19 = [ arg_0 . _Func_file_param ( var . name , var . docker_path ) for var in arg_14 if not var . recursive and var . value ] return { 'ephemeralPipeline' : { 'projectId' : arg_1 , 'name' : arg_15 , 'resources' : { 'minimumCpuCores' : arg_3 , 'minimumRamGb' : arg_4 , 'bootDiskSizeGb' : arg_6 , 'preemptible' : arg_7 , 'zones' : google_base . get_zones ( arg_2 ) , 'acceleratorType' : arg_8 , 'acceleratorCount' : arg_9 , 'disks' : [ { 'name' : 'datadisk' , 'autoDelete' : True , 'sizeGb' : arg_5 , 'mountPoint' : providers_util . DATA_MOUNT_POINT , } ] , } , 'inputParameters' : arg_17 + arg_18 , 'outputParameters' : arg_19 , 'docker' : { 'imageName' : arg_10 , 'cmd' : arg_16 , } } }

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                     arg_6, arg_7, arg_8,
                     arg_9, arg_10, arg_11, arg_12, arg_13,
                     arg_14, arg_15):
    """Builds a pipeline configuration for execution.

    Args:
      project: string name of project.
      zones: list of zone names for jobs to be run at.
      min_cores: int number of CPU cores required per job.
      min_ram: int GB of RAM required per job.
      disk_size: int GB of disk to attach under /mnt/data.
      boot_disk_size: int GB of disk for boot.
      preemptible: use a preemptible VM for the job
      accelerator_type: string GCE defined accelerator type.
      accelerator_count: int number of accelerators of the specified type to
        attach.
      image: string Docker image name in which to run.
      script_name: file name of the script to run.
      envs: list of EnvParam objects specifying environment variables to set
        within each job.
      inputs: list of FileParam objects specifying input variables to set
        within each job.
      outputs: list of FileParam objects specifying output variables to set
        within each job.
      pipeline_name: string name of pipeline.

    Returns:
      A nested dictionary with one entry under the key ephemeralPipeline
      containing the pipeline configuration.
    """
    if arg_3 is None:
      arg_3 = job_model.DEFAULT_MIN_CORES
    if arg_4 is None:
      arg_4 = job_model.DEFAULT_MIN_RAM
    if arg_5 is None:
      arg_5 = job_model.DEFAULT_DISK_SIZE
    if arg_6 is None:
      arg_6 = job_model.DEFAULT_BOOT_DISK_SIZE
    if arg_7 is None:
      arg_7 = job_model.DEFAULT_PREEMPTIBLE

    # Format the docker command
    arg_16 = arg_0._Func_docker_command(arg_11, arg_13,
                                                        arg_14, arg_12)

    # Pipelines inputParameters can be both simple name/value pairs which get
    # set as environment variables, as well as input file paths which the
    # Pipelines controller will automatically localize to the Pipeline VM.

    # In the ephemeralPipeline object, the inputParameters are only defined;
    # the values are passed in the pipelineArgs.

    # Pipelines outputParameters are only output file paths, which the
    # Pipelines controller can automatically de-localize after the docker
    # command completes.

    # The Pipelines API does not support recursive copy of file parameters,
    # so it is implemented within the dsub-generated pipeline.
    # Any inputs or outputs marked as "recursive" are completely omitted here;
    # their environment variables will be set in the docker command, and
    # recursive copy code will be generated there as well.

    # The Pipelines API does not accept empty environment variables. Set them to
    # empty in DOCKER_COMMAND instead.
    arg_17 = [{
        'name': SCRIPT_VARNAME
    }] + [{
        'name': env.name
    } for env in arg_12 if env.value]

    arg_18 = [
        arg_0._Func_input_file_param(var.name, var.docker_path)
        for var in arg_13
        if not var.recursive and var.value
    ]

    # Outputs are an array of file parameters
    arg_19 = [
        arg_0._Func_file_param(var.name, var.docker_path)
        for var in arg_14
        if not var.recursive and var.value
    ]

    # The ephemeralPipeline provides the template for the pipeline.
    # pyformat: disable
    return {
        'ephemeralPipeline': {
            'projectId': arg_1,
            'name': arg_15,

            # Define the resources needed for this pipeline.
            'resources': {
                'minimumCpuCores': arg_3,
                'minimumRamGb': arg_4,
                'bootDiskSizeGb': arg_6,
                'preemptible': arg_7,
                'zones': google_base.get_zones(arg_2),
                'acceleratorType': arg_8,
                'acceleratorCount': arg_9,

                # Create a data disk that is attached to the VM and destroyed
                # when the pipeline terminates.
                'disks': [{
                    'name': 'datadisk',
                    'autoDelete': True,
                    'sizeGb': arg_5,
                    'mountPoint': providers_util.DATA_MOUNT_POINT,
                }],
            },

            'inputParameters': arg_17 + arg_18,
            'outputParameters': arg_19,

            'docker': {
                'imageName': arg_10,
                'cmd': arg_16,
            }
        }
    }

Builds a pipeline configuration for execution .


def Func ( arg_0 ) : try : arg_1 = arg_0 . tzinfo return arg_1 . localize ( arg_0 . replace ( tzinfo = None ) ) except AttributeError : return arg_0

def Func(arg_0):
        """
        Rely on pytz.localize to ensure new result honors DST.
        """
        try:
            arg_1 = arg_0.tzinfo
            return arg_1.localize(arg_0.replace(tzinfo=None))
        except AttributeError:
            return arg_0

Rely on pytz . localize to ensure new result honors DST .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = [ ] for arg_4 in arg_1 . endpoints : assert isinstance ( arg_4 , Operator ) and arg_4 . operator == AllOps . INDEX , arg_4 arg_5 , arg_6 = arg_4 . operands assert arg_5 is arg_1 arg_7 = arg_1 . ctx . sig ( arg_1 . name , dtype = arg_4 . result . _dtype ) arg_3 . append ( arg_7 ) arg_7 . hidden = False arg_9 = [ ( toHVal ( i ) , [ arg_7 ( v ) , ] ) for i , v in enumerate ( arg_1 . defVal . val ) ] arg_10 = [ SwitchContainer ( arg_6 , arg_9 ) , ] for ( arg_11 , ( arg_12 , ) ) in arg_9 : arg_12 . parentStm = arg_10 [ 0 ] arg_14 = HWProcess ( arg_1 . name , arg_10 , { arg_6 , } , { arg_6 , } , { arg_7 , } ) arg_2 . append ( arg_14 ) def replaceOrigRomIndexExpr ( arg_15 ) : if arg_15 is arg_4 . result : return arg_7 else : return arg_15 for arg_16 in arg_4 . result . endpoints : arg_16 . operands = tuple ( map ( replaceOrigRomIndexExpr , arg_16 . operands ) ) arg_4 . result = arg_7 return arg_2 , arg_3

def Func(arg_0, arg_1):
        """
        Due to verilog restrictions it is not posible to use array constants
        and rom memories has to be hardcoded as process
        """
        arg_2 = []
        arg_3 = []
        for arg_4 in arg_1.endpoints:
            assert isinstance(arg_4, Operator) and arg_4.operator == AllOps.INDEX, arg_4
            arg_5, arg_6 = arg_4.operands
            assert arg_5 is arg_1

            # construct output of the rom
            arg_7 = arg_1.ctx.sig(arg_1.name, dtype=arg_4.result._dtype)
            arg_3.append(arg_7)
            arg_7.hidden = False

            # construct process which will represent content of the rom
            arg_9 = [(toHVal(i), [arg_7(v), ])
                     for i, v in enumerate(arg_1.defVal.val)]
            arg_10 = [SwitchContainer(arg_6, arg_9), ]

            for (arg_11, (arg_12, )) in arg_9:
                arg_12.parentStm = arg_10[0]

            arg_14 = HWProcess(arg_1.name, arg_10, {arg_6, },
                          {arg_6, }, {arg_7, })
            arg_2.append(arg_14)

            # override usage of original index operator on rom
            # to use signal generated from this process
            def replaceOrigRomIndexExpr(arg_15):
                if arg_15 is arg_4.result:
                    return arg_7
                else:
                    return arg_15
            for arg_16 in arg_4.result.endpoints:
                arg_16.operands = tuple(map(replaceOrigRomIndexExpr, arg_16.operands))
                arg_4.result = arg_7

        return arg_2, arg_3