(CASRN, Method=None, AvailableMethods=False, CASi=None)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
False
,
arg_3
=
)
:
load_law_data
(
)
if
not
arg_3
:
arg_3
=
CAS2int
(
arg_0
)
arg_4
=
[
COMBINED
,
DSL
,
TSCA
,
EINECS
,
NLP
,
SPIN
]
if
arg_2
:
return
arg_4
if
not
arg_1
:
arg_1
=
arg_4
[
0
]
if
arg_1
==
DSL
:
if
arg_3
in
DSL_data
.
index
:
arg_5
=
CAN_DSL_flags
[
DSL_data
.
at
[
arg_3
,
'Registry'
]
]
else
:
arg_5
=
UNLISTED
elif
arg_1
==
TSCA
:
if
arg_3
in
TSCA_data
.
index
:
arg_6
=
TSCA_data
.
loc
[
arg_3
]
.
to_dict
(
)
if
any
(
arg_6
.
values
(
)
)
:
arg_5
=
sorted
(
[
TSCA_flags
[
i
]
for
i
in
arg_6
.
keys
(
)
if
arg_6
[
i
]
]
)
else
:
arg_5
=
LISTED
else
:
arg_5
=
UNLISTED
elif
arg_1
==
EINECS
:
if
arg_3
in
EINECS_data
.
index
:
arg_5
=
LISTED
else
:
arg_5
=
UNLISTED
elif
arg_1
==
NLP
:
if
arg_3
in
NLP_data
.
index
:
arg_5
=
LISTED
else
:
arg_5
=
UNLISTED
elif
arg_1
==
SPIN
:
if
arg_3
in
SPIN_data
.
index
:
arg_5
=
LISTED
else
:
arg_5
=
UNLISTED
elif
arg_1
==
COMBINED
:
arg_5
=
{
}
for
arg_7
in
arg_4
[
1
:
]
:
arg_5
[
arg_7
]
=
Func
(
arg_0
,
arg_1
=
arg_7
,
arg_3
=
arg_3
)
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_5

def Func(arg_0, arg_1=None, arg_2=False, arg_3=None):
    r'''Looks up the legal status of a chemical according to either a specifc
    method or with all methods.

    Returns either the status as a string for a specified method, or the
    status of the chemical in all available data sources, in the format
    {source: status}.

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

    Returns
    -------
    status : str or dict
        Legal status information [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain legal status with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the legal status for the desired chemical, and will return methods
        instead of the status
    CASi : int, optional
        CASRN as an integer, used internally [-]

    Notes
    -----

    Supported methods are:

        * **DSL**: Canada Domestic Substance List, [1]_. As extracted on Feb 11, 2015
          from a html list. This list is updated continuously, so this version
          will always be somewhat old. Strictly speaking, there are multiple
          lists but they are all bundled together here. A chemical may be
          'Listed', or be on the 'Non-Domestic Substances List (NDSL)',
          or be on the list of substances with 'Significant New Activity (SNAc)',
          or be on the DSL but with a 'Ministerial Condition pertaining to this
          substance', or have been removed from the DSL, or have had a
          Ministerial prohibition for the substance.
        * **TSCA**: USA EPA Toxic Substances Control Act Chemical Inventory, [2]_.
          This list is as extracted on 2016-01. It is believed this list is
          updated on a periodic basis (> 6 month). A chemical may simply be
          'Listed', or may have certain flags attached to it. All these flags
          are described in the dict TSCA_flags.
        * **EINECS**: European INventory of Existing Commercial chemical
          Substances, [3]_. As extracted from a spreadsheet dynamically
          generated at [1]_. This list was obtained March 2015; a more recent
          revision already exists.
        * **NLP**: No Longer Polymers, a list of chemicals with special
          regulatory exemptions in EINECS. Also described at [3]_.
        * **SPIN**: Substances Prepared in Nordic Countries. Also a boolean
          data type. Retrieved 2015-03 from [4]_.

    Other methods which could be added are:

        * Australia: AICS Australian Inventory of Chemical Substances
        * China: Inventory of Existing Chemical Substances Produced or Imported
          in China (IECSC)
        * Europe: REACH List of Registered Substances
        * India: List of Hazardous Chemicals
        * Japan: ENCS: Inventory of existing and new chemical substances
        * Korea: Existing Chemicals Inventory (KECI)
        * Mexico: INSQ National Inventory of Chemical Substances in Mexico
        * New Zealand:  Inventory of Chemicals (NZIoC)
        * Philippines: PICCS Philippines Inventory of Chemicals and Chemical
          Substances

    Examples
    --------
    >>> pprint(Func('64-17-5'))
    {'DSL': 'LISTED',
     'EINECS': 'LISTED',
     'NLP': 'UNLISTED',
     'SPIN': 'LISTED',
     'TSCA': 'LISTED'}

    References
    ----------
    .. [1] Government of Canada.. "Substances Lists" Feb 11, 2015.
       https://www.ec.gc.ca/subsnouvelles-newsubs/default.asp?n=47F768FE-1.
    .. [2] US EPA. "TSCA Chemical Substance Inventory." Accessed April 2016.
       https://www.epa.gov/tsca-inventory.
    .. [3] ECHA. "EC Inventory". Accessed March 2015.
       http://echa.europa.eu/information-on-chemicals/ec-inventory.
    .. [4] SPIN. "SPIN Substances in Products In Nordic Countries." Accessed
       March 2015. http://195.215.202.233/DotNetNuke/default.aspx.
    '''
    load_law_data()
    if not arg_3:
        arg_3 = CAS2int(arg_0)
    arg_4 = [COMBINED, DSL, TSCA, EINECS, NLP, SPIN]
    if arg_2:
        return arg_4
    if not arg_1:
        arg_1 = arg_4[0]
    if arg_1 == DSL:
        if arg_3 in DSL_data.index:
            arg_5 = CAN_DSL_flags[DSL_data.at[arg_3, 'Registry']]
        else:
            arg_5 = UNLISTED
    elif arg_1 == TSCA:
        if arg_3 in TSCA_data.index:
            arg_6 = TSCA_data.loc[arg_3].to_dict()
            if any(arg_6.values()):
                arg_5 = sorted([TSCA_flags[i] for i in arg_6.keys() if arg_6[i]])
            else:
                arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == EINECS:
        if arg_3 in EINECS_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == NLP:
        if arg_3 in NLP_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == SPIN:
        if arg_3 in SPIN_data.index:
            arg_5 = LISTED
        else:
            arg_5 = UNLISTED
    elif arg_1 == COMBINED:
        arg_5 = {}
        for arg_7 in arg_4[1:]:
            arg_5[arg_7] = Func(arg_0, arg_1=arg_7, arg_3=arg_3)
    else:
        raise Exception('Failure in in function')
    return arg_5

r'''Looks up the legal status of a chemical according to either a specifc
    method or with all methods.

    Returns either the status as a string for a specified method, or the
    status of the chemical in all available data sources, in the format
    {source: status}.

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

    Returns
    -------
    status : str or dict
        Legal status information [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain legal status with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        legal_status_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the legal status for the desired chemical, and will return methods
        instead of the status
    CASi : int, optional
        CASRN as an integer, used internally [-]

    Notes
    -----

    Supported methods are:

        * **DSL**: Canada Domestic Substance List, [1]_. As extracted on Feb 11, 2015
          from a html list. This list is updated continuously, so this version
          will always be somewhat old. Strictly speaking, there are multiple
          lists but they are all bundled together here. A chemical may be
          'Listed', or be on the 'Non-Domestic Substances List (NDSL)',
          or be on the list of substances with 'Significant New Activity (SNAc)',
          or be on the DSL but with a 'Ministerial Condition pertaining to this
          substance', or have been removed from the DSL, or have had a
          Ministerial prohibition for the substance.
        * **TSCA**: USA EPA Toxic Substances Control Act Chemical Inventory, [2]_.
          This list is as extracted on 2016-01. It is believed this list is
          updated on a periodic basis (> 6 month). A chemical may simply be
          'Listed', or may have certain flags attached to it. All these flags
          are described in the dict TSCA_flags.
        * **EINECS**: European INventory of Existing Commercial chemical
          Substances, [3]_. As extracted from a spreadsheet dynamically
          generated at [1]_. This list was obtained March 2015; a more recent
          revision already exists.
        * **NLP**: No Longer Polymers, a list of chemicals with special
          regulatory exemptions in EINECS. Also described at [3]_.
        * **SPIN**: Substances Prepared in Nordic Countries. Also a boolean
          data type. Retrieved 2015-03 from [4]_.

    Other methods which could be added are:

        * Australia: AICS Australian Inventory of Chemical Substances
        * China: Inventory of Existing Chemical Substances Produced or Imported
          in China (IECSC)
        * Europe: REACH List of Registered Substances
        * India: List of Hazardous Chemicals
        * Japan: ENCS: Inventory of existing and new chemical substances
        * Korea: Existing Chemicals Inventory (KECI)
        * Mexico: INSQ National Inventory of Chemical Substances in Mexico
        * New Zealand:  Inventory of Chemicals (NZIoC)
        * Philippines: PICCS Philippines Inventory of Chemicals and Chemical
          Substances

    Examples
    --------
    >>> pprint(legal_status('64-17-5'))
    {'DSL': 'LISTED',
     'EINECS': 'LISTED',
     'NLP': 'UNLISTED',
     'SPIN': 'LISTED',
     'TSCA': 'LISTED'}

    References
    ----------
    .. [1] Government of Canada.. "Substances Lists" Feb 11, 2015.
       https://www.ec.gc.ca/subsnouvelles-newsubs/default.asp?n=47F768FE-1.
    .. [2] US EPA. "TSCA Chemical Substance Inventory." Accessed April 2016.
       https://www.epa.gov/tsca-inventory.
    .. [3] ECHA. "EC Inventory". Accessed March 2015.
       http://echa.europa.eu/information-on-chemicals/ec-inventory.
    .. [4] SPIN. "SPIN Substances in Products In Nordic Countries." Accessed
       March 2015. http://195.215.202.233/DotNetNuke/default.aspx.

r Looks up the legal status of a chemical according to either a specifc method or with all methods .


def Func ( arg_0 , arg_1 ) : arg_0 . fragment = MapFragment ( __id__ = arg_1 ) arg_0 . map . onMapReady . connect ( arg_0 . on_map_ready ) arg_0 . fragment . getMapAsync ( arg_0 . map . getId ( ) ) arg_3 = arg_0 . get_context ( ) def on_transaction ( arg_4 ) : arg_5 = FragmentTransaction ( __id__ = arg_4 ) arg_5 . add ( arg_0 . widget . getId ( ) , arg_0 . fragment ) arg_5 . commit ( ) def on_fragment_manager ( arg_4 ) : arg_6 = FragmentManager ( __id__ = arg_4 ) arg_6 . beginTransaction ( ) . then ( on_transaction ) arg_3 . widget . getSupportFragmentManager ( ) . then ( on_fragment_manager )

def Func(arg_0, arg_1):
        """ Create the fragment and pull the map reference when it's loaded.
        """
        arg_0.fragment = MapFragment(__id__=arg_1)

        #: Setup callback so we know when the map is ready
        arg_0.map.onMapReady.connect(arg_0.on_map_ready)
        arg_0.fragment.getMapAsync(arg_0.map.getId())

        arg_3 = arg_0.get_context()

        def on_transaction(arg_4):
            arg_5 = FragmentTransaction(__id__=arg_4)
            arg_5.add(arg_0.widget.getId(), arg_0.fragment)
            arg_5.commit()

        def on_fragment_manager(arg_4):
            arg_6 = FragmentManager(__id__=arg_4)
            arg_6.beginTransaction().then(on_transaction)

        arg_3.widget.getSupportFragmentManager().then(on_fragment_manager)

Create the fragment and pull the map reference when it s loaded .


def Func(arg_0, arg_1, arg_2):
        """ Notify parent of a parameter change """
        if arg_0._parent:
            arg_0._parent.Func(arg_1, arg_2)
        else:
            arg_0.update(arg_1, arg_2)


return self.redirect(request, *args, **kwargs)

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Run some custom POST logic for Enterprise workflows before routing the user through existing views.
        """
        # pylint: disable=unused-variable
        arg_4, arg_5, arg_6, arg_7 = RouterView.get_path_variables(**arg_3)
        arg_8 = get_enterprise_customer_or_404(arg_4)

        if arg_6:
            arg_9 = get_global_context(arg_1, arg_8)
            try:
                arg_3['course_id'] = RouterView.get_course_run_id(arg_1.user, arg_8, arg_6)
            except Http404:
                arg_10 = 'ENTRV001'
                arg_11 = (
                    'Could not find course run with id {course_run_id} '
                    'for course key {course_key} and '
                    'for enterprise_customer_uuid {enterprise_customer_uuid} '
                    'and program {program_uuid}. '
                    'Returned error code {error_code} to user {userid}'.format(
                        arg_6=arg_6,
                        arg_5=arg_5,
                        arg_4=arg_4,
                        arg_10=arg_10,
                        userid=arg_1.user.id,
                        arg_7=arg_7,
                    )
                )
                return render_page_with_error_code_message(arg_1, arg_9, arg_10, arg_11)

        return arg_0.redirect(arg_1, *arg_2, **arg_3)

Run some custom POST logic for Enterprise workflows before routing the user through existing views .


async
def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'Requesting tracks for query {}'
.
format
(
arg_1
)
)
async
with
arg_0
.
http
.
get
(
arg_0
.
rest_uri
+
quote
(
arg_1
)
,
headers
=
{
'Authorization'
:
arg_0
.
password
}
)
as
res
:
return
await
res
.
json
(
content_type
=
)

async def Func(arg_0, arg_1):
        """ Returns a Dictionary containing search results for a given query. """
        log.debug('Requesting tracks for query {}'.format(arg_1))

        async with arg_0.http.get(arg_0.rest_uri + quote(arg_1), headers={'Authorization': arg_0.password}) as res:
            return await res.json(content_type=None)

Returns a Dictionary containing search results for a given query .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
"150"
)
:
arg_1
=
asarray
(
tupleize
(
arg_1
)
,
'int'
)
arg_2
=
asarray
(
tupleize
(
arg_2
)
,
'int'
)
if
type
(
arg_3
)
is
not
str
:
arg_3
=
tupleize
(
arg_3
)
if
len
(
arg_1
)
==
arg_0
.
keys
.
ndim
and
len
(
arg_2
)
==
0
:
raise
ValueError
(
'Cannot perform a Func that would '
'end up with all data on a single key'
)
if
len
(
arg_1
)
==
0
and
len
(
arg_2
)
==
0
:
return
arg_0
from
bolt
.
spark
.
chunk
import
ChunkedArray
arg_4
=
arg_0
.
chunk
(
arg_3
)
arg_5
=
arg_4
.
keys_to_values
(
arg_1
)
.
values_to_keys
(
[
v
+
len
(
arg_1
)
for
v
in
arg_2
]
)
arg_6
=
arg_5
.
unchunk
(
)
return
arg_6

def Func(arg_0, arg_1, arg_2, arg_3="150"):
        """
        Swap axes from keys to values.

        This is the core operation underlying shape manipulation
        on the Spark bolt array. It exchanges an arbitrary set of axes
        between the keys and the valeus. If either is None, will only
        move axes in one direction (from keys to values, or values to keys).
        Keys moved to values will be placed immediately after the split;
        values moved to keys will be placed immediately before the split.

        Parameters
        ----------
        kaxes : tuple
            Axes from keys to move to values

        vaxes : tuple
            Axes from values to move to keys

        size : tuple or int, optional, default = "150"
            Can either provide a string giving the size in kilobytes,
            or a tuple with the number of chunks along each
            value dimension being moved

        Returns
        -------
        BoltArraySpark
        """
        arg_1 = asarray(tupleize(arg_1), 'int')
        arg_2 = asarray(tupleize(arg_2), 'int')
        if type(arg_3) is not str:
            arg_3 = tupleize(arg_3)

        if len(arg_1) == arg_0.keys.ndim and len(arg_2) == 0:
            raise ValueError('Cannot perform a Func that would '
                             'end up with all data on a single key')

        if len(arg_1) == 0 and len(arg_2) == 0:
            return arg_0

        from bolt.spark.chunk import ChunkedArray

        arg_4 = arg_0.chunk(arg_3)

        arg_5 = arg_4.keys_to_values(arg_1).values_to_keys([v+len(arg_1) for v in arg_2])
        arg_6 = arg_5.unchunk()

        return arg_6


(
            self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
,
arg_8
=
False
,
**
arg_9
)
:
arg_10
=
models
.
KeyImportParameters
(
arg_4
=
arg_4
,
arg_3
=
arg_3
,
arg_5
=
arg_5
,
arg_6
=
arg_6
)
arg_11
=
arg_0
.
Func
.
metadata
[
'url'
]
arg_12
=
{
'vaultBaseUrl'
:
arg_0
.
_serialize
.
url
(
"vault_base_url"
,
arg_1
,
'str'
,
skip_quote
=
True
)
,
'key-name'
:
arg_0
.
_serialize
.
url
(
"key_name"
,
arg_2
,
'str'
,
pattern
=
r'^[0-9a-zA-Z-]+$'
)
}
arg_11
=
arg_0
.
_client
.
format_url
(
arg_11
,
**
arg_12
)
arg_13
=
{
}
arg_13
[
'api-version'
]
=
arg_0
.
_serialize
.
query
(
"self.api_version"
,
arg_0
.
api_version
,
'str'
)
arg_14
=
{
}
arg_14
[
'Content-Type'
]
=
'application/json; charset=utf-8'
if
arg_0
.
config
.
generate_client_request_id
:
arg_14
[
'x-ms-client-request-id'
]
=
str
(
uuid
.
uuid1
(
)
)
if
arg_7
:
arg_14
.
update
(
arg_7
)
if
arg_0
.
config
.
accept_language
is
not
:
arg_14
[
'accept-language'
]
=
arg_0
.
_serialize
.
header
(
"self.config.accept_language"
,
arg_0
.
config
.
accept_language
,
'str'
)
arg_15
=
arg_0
.
_serialize
.
body
(
arg_10
,
'KeyImportParameters'
)
arg_16
=
arg_0
.
_client
.
put
(
arg_11
,
arg_13
)
arg_17
=
arg_0
.
_client
.
send
(
arg_16
,
arg_14
,
arg_15
,
stream
=
False
,
**
arg_9
)
if
arg_17
.
status_code
not
in
[
200
]
:
raise
models
.
KeyVaultErrorException
(
arg_0
.
_deserialize
,
arg_17
)
arg_18
=
if
arg_17
.
status_code
==
200
:
arg_18
=
arg_0
.
_deserialize
(
'KeyBundle'
,
arg_17
)
if
arg_8
:
arg_19
=
ClientRawResponse
(
arg_18
,
arg_17
)
return
arg_19
return
arg_18

def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=False, **arg_9):
        """Imports an externally created key, stores it, and returns key
        parameters and attributes to the client.

        The import key operation may be used to import any key type into an
        Azure Key Vault. If the named key already exists, Azure Key Vault
        creates a new version of the key. This operation requires the
        keys/import permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param key_name: Name for the imported key.
        :type key_name: str
        :param key: The Json web key
        :type key: ~azure.keyvault.v2016_10_01.models.JsonWebKey
        :param hsm: Whether to import as a hardware key (HSM) or software key.
        :type hsm: bool
        :param key_attributes: The key management attributes.
        :type key_attributes: ~azure.keyvault.v2016_10_01.models.KeyAttributes
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: KeyBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.KeyBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
        """
        arg_10 = models.KeyImportParameters(arg_4=arg_4, arg_3=arg_3, arg_5=arg_5, arg_6=arg_6)

        # Construct URL
        arg_11 = arg_0.Func.metadata['url']
        arg_12 = {
            'vaultBaseUrl': arg_0._serialize.url("vault_base_url", arg_1, 'str', skip_quote=True),
            'key-name': arg_0._serialize.url("key_name", arg_2, 'str', pattern=r'^[0-9a-zA-Z-]+$')
        }
        arg_11 = arg_0._client.format_url(arg_11, **arg_12)

        # Construct parameters
        arg_13 = {}
        arg_13['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')

        # Construct headers
        arg_14 = {}
        arg_14['Content-Type'] = 'application/json; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_14['x-ms-client-request-id'] = str(uuid.uuid1())
        if arg_7:
            arg_14.update(arg_7)
        if arg_0.config.accept_language is not None:
            arg_14['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')

        # Construct body
        arg_15 = arg_0._serialize.body(arg_10, 'KeyImportParameters')

        # Construct and send request
        arg_16 = arg_0._client.put(arg_11, arg_13)
        arg_17 = arg_0._client.send(
            arg_16, arg_14, arg_15, stream=False, **arg_9)

        if arg_17.status_code not in [200]:
            raise models.KeyVaultErrorException(arg_0._deserialize, arg_17)

        arg_18 = None

        if arg_17.status_code == 200:
            arg_18 = arg_0._deserialize('KeyBundle', arg_17)

        if arg_8:
            arg_19 = ClientRawResponse(arg_18, arg_17)
            return arg_19

        return arg_18

Imports an externally created key stores it and returns key parameters and attributes to the client .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_javascript ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'application/javascript' ] )

def Func(*arg_0, **arg_1):
    """Display the Javascript representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw javascript data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_javascript(arg_3)
    else:
        display(*arg_0, include=['text/plain','application/javascript'])

Display the Javascript representation of an object .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or len ( arg_0 . examples ) arg_3 = copy . copy ( arg_0 ) arg_3 . examples = weighted_replicate ( arg_0 . examples , arg_1 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
    "Copy dataset, replicating each example in proportion to its weight."
    arg_2 = arg_2 or len(arg_0.examples)
    arg_3 = copy.copy(arg_0)
    arg_3.examples = weighted_replicate(arg_0.examples, arg_1, arg_2)
    return arg_3

Copy dataset replicating each example in proportion to its weight .


def Func(arg_0, **arg_1):
        """
        Get the list of TV genres.

        Args:
            language: (optional) ISO 639-1 code.

        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


(
        self, name, service_name, deployment_name, virtual_ip_name=None
    )

return self._perform_post(
            self._get_reserved_ip_path_for_disassociation(name),
            _XmlSerializer.associate_reserved_ip_to_xml(
                service_name, deployment_name, virtual_ip_name
            ),
            as_async=True,
            x_ms_version='2015-02-01'
        )

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4=None
    ):
        '''
        Disassociate an existing reservedIP from the given deployment.

        name:
            Required. Name of the reserved IP address.

        service_name:
            Required. Name of the hosted service.

        deployment_name:
            Required. Name of the deployment.

        virtual_ip_name:
            Optional. Name of the VirtualIP in case of multi Vip tenant.
            If this value is not specified default virtualIP is used
            for this operation.
        '''
        _validate_not_none('name', arg_1)
        _validate_not_none('service_name', arg_2)
        _validate_not_none('deployment_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_reserved_ip_path_for_disassociation(arg_1),
            _XmlSerializer.associate_reserved_ip_to_xml(
                arg_2, arg_3, arg_4
            ),
            as_async=True,
            x_ms_version='2015-02-01'
        )

Disassociate an existing reservedIP from the given deployment .


def Func ( arg_0 ) : with arg_0 . _status_lock : if arg_0 . _running : assert arg_0 . _observer is not None arg_0 . _observer . Func ( ) arg_0 . _running = False arg_0 . _origin_mapped_data = dict ( )

def Func(arg_0):
        """
        Stops monitoring the predefined directory.
        """
        with arg_0._status_lock:
            if arg_0._running:
                assert arg_0._observer is not None
                arg_0._observer.Func()
                arg_0._running = False
                arg_0._origin_mapped_data = dict()

Stops monitoring the predefined directory .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = unicode ( arg_0 . protocol + '://' ) arg_4 = arg_3 + arg_0 . host + unicode ( arg_2 ) arg_0 . _httprequest . set_timeout ( arg_0 . timeout ) arg_0 . _httprequest . open ( unicode ( arg_1 ) , arg_4 ) if arg_0 . cert_file is not None : arg_0 . _httprequest . set_client_certificate ( unicode ( arg_0 . cert_file ) )

def Func(arg_0, arg_1, arg_2):
        ''' Connects to host and sends the request. '''

        arg_3 = unicode(arg_0.protocol + '://')
        arg_4 = arg_3 + arg_0.host + unicode(arg_2)
        arg_0._httprequest.set_timeout(arg_0.timeout)
        arg_0._httprequest.open(unicode(arg_1), arg_4)

        # sets certificate for the connection if cert_file is set.
        if arg_0.cert_file is not None:
            arg_0._httprequest.set_client_certificate(unicode(arg_0.cert_file))

Connects to host and sends the request .


(
    rightmost_transposed_ndims, validate_args, name=None)

def Func(
    arg_0, arg_1, arg_2=None):
  """Checks that `rightmost_transposed_ndims` is valid."""
  with tf.name_scope(arg_2 or 'maybe_validate_rightmost_transposed_ndims'):
    arg_3 = []
    if not dtype_util.is_integer(arg_0.dtype):
      raise TypeError('`rightmost_transposed_ndims` must be integer type.')

    if tensorshape_util.rank(arg_0.shape) is not None:
      if tensorshape_util.rank(arg_0.shape) != 0:
        raise ValueError('`rightmost_transposed_ndims` must be a scalar, '
                         'saw rank: {}.'.format(
                             tensorshape_util.rank(
                                 arg_0.shape)))
    elif arg_1:
      arg_3 += [assert_util.assert_rank(arg_0, 0)]

    arg_4 = tf.get_static_value(
        arg_0)
    arg_5 = '`rightmost_transposed_ndims` must be non-negative.'
    if arg_4 is not None:
      if arg_4 < 0:
        raise ValueError(arg_5[:-1] + ', saw: {}.'.format(
            arg_4))
    elif arg_1:
      arg_3 += [
          assert_util.assert_non_negative(
              arg_0, message=arg_5)
      ]

    return arg_3

Checks that rightmost_transposed_ndims is valid .


(
        pklcdir,
        fovcatalog,
        fovcatalog_columns=[0,1,2,
                            6,7,
                            8,9,
                            10,11,
                            13,14,15,16,
                            17,18,19,
                            20,21],
        fovcatalog_colnames=['objectid','ra','decl',
                             'jmag','jmag_err',
                             'hmag','hmag_err',
                             'kmag','kmag_err',
                             'bmag','vmag','rmag','imag',
                             'sdssu','sdssg','sdssr',
                             'sdssi','sdssz'],
        fovcatalog_colformats=('U20,f8,f8,'
                               'f8,f8,'
                               'f8,f8,'
                               'f8,f8,'
                               'f8,f8,f8,f8,'
                               'f8,f8,f8,'
                               'f8,f8')
)

def Func(
        arg_0,
        arg_1,
        arg_2=[0,1,2,
                            6,7,
                            8,9,
                            10,11,
                            13,14,15,16,
                            17,18,19,
                            20,21],
        arg_3=['objectid','ra','decl',
                             'jmag','jmag_err',
                             'hmag','hmag_err',
                             'kmag','kmag_err',
                             'bmag','vmag','rmag','imag',
                             'sdssu','sdssg','sdssr',
                             'sdssi','sdssz'],
        arg_4=('U20,f8,f8,'
                               'f8,f8,'
                               'f8,f8,'
                               'f8,f8,'
                               'f8,f8,f8,f8,'
                               'f8,f8,f8,'
                               'f8,f8')
):
    '''Adds catalog info to objectinfo key of all pklcs in lcdir.

    If fovcatalog, fovcatalog_columns, fovcatalog_colnames are provided, uses
    them to find all the additional information listed in the fovcatalog_colname
    keys, and writes this info to the objectinfo key of each lcdict. This makes
    it easier for astrobase tools to work on these light curve.

    The default set up for fovcatalog is to use a text file generated by the
    HATPI pipeline before auto-calibrating a field. The format is specified as
    above in _columns,  _colnames, and _colformats.

    '''

    if arg_1.endswith('.gz'):
        arg_5 = gzip.open(arg_1)
    else:
        arg_5 = open(arg_1)

    # read the catalog using the colformats, etc.
    arg_6 = np.genfromtxt(arg_5,
                           usecols=arg_2,
                           names=arg_3,
                           dtype=arg_4)
    arg_5.close()

    arg_7 = sorted(glob.glob(os.path.join(arg_0, '*HAT*-pklc.pkl')))

    arg_8, arg_9 = [], []

    for arg_10 in arg_7:

        arg_11 = read_hatpi_pklc(arg_10)
        arg_12 = arg_11['objectid']

        arg_13 = np.where(arg_6['objectid'] == arg_12)

        # if we found catalog info for this object, put it into objectinfo
        if len(arg_13) > 0 and arg_13[0]:

            arg_11['objectinfo'].update(
                {arg_14:arg_15 for arg_14,arg_15 in zip(
                    arg_3,
                    [np.asscalar(arg_6[arg_16][arg_13]) for
                     arg_16 in arg_3]
                )
                }
            )

            # write the LC back to the pickle (tempfile for atomicity)
            with open(arg_10+'-tmp','wb') as outfd:
                pickle.dump(arg_11, outfd, pickle.HIGHEST_PROTOCOL)

            # overwrite previous once we know it exists
            if os.path.exists(arg_10+'-tmp'):
                shutil.move(arg_10+'-tmp',arg_10)

                LOGINFO('updated %s with catalog info for %s at %.3f, %.3f OK' %
                        (arg_10, arg_12,
                         arg_11['objectinfo']['ra'],
                         arg_11['objectinfo']['decl']))

                arg_8.append(arg_10)

        # otherwise, do nothing
        else:
            arg_9.append(arg_10)

    # end of pklclist processing
    return arg_8, arg_9

Adds catalog info to objectinfo key of all pklcs in lcdir .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Strip slashes from directories before updating.
        """
        for arg_4 in arg_3:
            if '/' in arg_4:
                raise ValueError(
                    "Expected directory names w/o slashes.  Got [%s]" % arg_4
                )
            arg_0.managers = {k.strip('/'): v for k, v in arg_3.items()}

Strip slashes from directories before updating .


def Func ( arg_0 ) : for ( arg_1 , arg_2 ) in arg_0 . permuteVars . iteritems ( ) : arg_2 . Func ( ) arg_0 . newPosition ( )

def Func(arg_0):
    """Agitate this particle so that it is likely to go to a new position.
    Every time Func is called, the particle is jiggled an even greater
    amount.

    Parameters:
    --------------------------------------------------------------
    retval:               None
    """
    for (arg_1, arg_2) in arg_0.permuteVars.iteritems():
      arg_2.Func()

    arg_0.newPosition()

Agitate this particle so that it is likely to go to a new position.
    Every time agitate is called, the particle is jiggled an even greater
    amount.

    Parameters:
    --------------------------------------------------------------
    retval:               None

Agitate this particle so that it is likely to go to a new position . Every time agitate is called the particle is jiggled an even greater amount .


return len(response['DescribeApplicationsResponse']['DescribeApplicationsResult']['Applications']) > 0

def Func ( arg_0 ) : arg_1 = arg_0 . ebs . describe_applications ( application_names = [ arg_0 . app_name ] ) return len ( arg_1 [ 'DescribeApplicationsResponse' ] [ 'DescribeApplicationsResult' ] [ 'Applications' ] ) > 0

def Func(arg_0):
        """
        Returns whether or not the given app_name exists
        """
        arg_1 = arg_0.ebs.describe_applications(application_names=[arg_0.app_name])
        return len(arg_1['DescribeApplicationsResponse']['DescribeApplicationsResult']['Applications']) > 0


def Func ( arg_0 , arg_1 ) : arg_2 = datetime . datetime ( arg_0 . year , arg_0 . month , 1 ) arg_3 = datetime . datetime ( arg_1 . year , arg_1 . month , 1 ) arg_4 = dateutil . rrule . rrule ( freq = dateutil . rrule . MONTHLY , dtstart = arg_2 , until = arg_3 ) arg_5 = [ d for d in arg_4 ] arg_6 = 0 for arg_7 in range ( 1 , len ( arg_5 ) ) : yield arg_5 [ arg_6 ] , arg_5 [ arg_7 ] arg_6 = arg_7

def Func(arg_0, arg_1):
    """Generate a months range.

    Generator of months starting on `from_date` util `to_date`. Each
    returned item is a tuple of two datatime objects like in (month, month+1).
    Thus, the result will follow the sequence:
        ((fd, fd+1), (fd+1, fd+2), ..., (td-2, td-1), (td-1, td))

    :param from_date: generate dates starting on this month
    :param to_date: generate dates until this month

    :result: a generator of months range
    """
    arg_2 = datetime.datetime(arg_0.year, arg_0.month, 1)
    arg_3 = datetime.datetime(arg_1.year, arg_1.month, 1)

    arg_4 = dateutil.rrule.rrule(freq=dateutil.rrule.MONTHLY,
                                     dtstart=arg_2, until=arg_3)
    arg_5 = [d for d in arg_4]

    arg_6 = 0
    for arg_7 in range(1, len(arg_5)):
        yield arg_5[arg_6], arg_5[arg_7]
        arg_6 = arg_7


(self, radius, unit_mass='angular', kpc_per_arcsec=None, critical_surface_density=None)

def Func ( arg_0 , arg_1 , arg_2 = 'angular' , arg_3 = None , arg_4 = None ) : if arg_0 . has_mass_profile : return sum ( map ( lambda p : p . Func ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) , arg_0 . mass_profiles ) ) else : return None

def Func(arg_0, arg_1, arg_2='angular', arg_3=None, arg_4=None):
        """Compute the total angular mass of the galaxy's mass profiles within a circle of specified radius.

        See *profiles.mass_profiles.mass_within_circle* for details of how this is performed.

        Parameters
        ----------
        radius : float
            The radius of the circle to compute the dimensionless mass within.
        unit_mass : str
            The units the mass is returned in (angular | solMass).
        critical_surface_density : float
            The critical surface mass density of the strong lens configuration, which converts mass from angulalr \
            units to physical units (e.g. solar masses).
        """
        if arg_0.has_mass_profile:
            return sum(map(lambda p: p.Func(arg_1=arg_1, arg_2=arg_2,
                                                                   arg_3=arg_3,
                                                                   arg_4=arg_4),
                           arg_0.mass_profiles))
        else:
            return None

Compute the total angular mass of the galaxy s mass profiles within a circle of specified radius .


(dist_name, user=False, home=None, root=None,
                     isolated=False)

def Func ( arg_0 , arg_1 = False , arg_2 = None , arg_3 = None , arg_4 = False ) : from distutils . dist import Distribution arg_5 = { } if arg_4 : arg_6 = { "script_args" : [ "--no-user-cfg" ] } else : arg_6 = { } arg_7 = { 'name' : arg_0 } arg_7 . update ( arg_6 ) arg_8 = Distribution ( arg_7 ) arg_8 . parse_config_files ( ) arg_9 = arg_8 . get_command_obj ( 'install' , create = True ) arg_9 . user = arg_1 or arg_9 . user arg_9 . home = arg_2 or arg_9 . home arg_9 . root = arg_3 or arg_9 . root arg_9 . finalize_options ( ) for arg_10 in SCHEME_KEYS : arg_5 [ arg_10 ] = getattr ( arg_9 , 'install_' + arg_10 ) if arg_9 . install_lib is not None : arg_5 . update ( dict ( purelib = arg_9 . install_lib , platlib = arg_9 . install_lib ) ) if running_under_virtualenv ( ) : arg_5 [ 'headers' ] = os . path . join ( sys . prefix , 'include' , 'site' , 'python' + sys . version [ : 3 ] , arg_0 , ) if arg_3 is not None : arg_5 [ "headers" ] = os . path . join ( arg_3 , os . path . abspath ( arg_5 [ "headers" ] ) [ 1 : ] , ) return arg_5

def Func(arg_0, arg_1=False, arg_2=None, arg_3=None,
                     arg_4=False):
    """
    Return a distutils install scheme
    """
    from distutils.dist import Distribution

    arg_5 = {}

    if arg_4:
        arg_6 = {"script_args": ["--no-user-cfg"]}
    else:
        arg_6 = {}
    arg_7 = {'name': arg_0}
    arg_7.update(arg_6)

    arg_8 = Distribution(arg_7)
    arg_8.parse_config_files()
    arg_9 = arg_8.get_command_obj('install', create=True)
    # NOTE: setting user or home has the side-effect of creating the home dir
    # or user base for installations during finalize_options()
    # ideally, we'd prefer a scheme class that has no side-effects.
    arg_9.user = arg_1 or arg_9.user
    arg_9.home = arg_2 or arg_9.home
    arg_9.root = arg_3 or arg_9.root
    arg_9.finalize_options()
    for arg_10 in SCHEME_KEYS:
        arg_5[arg_10] = getattr(arg_9, 'install_' + arg_10)

    if arg_9.install_lib is not None:
        # install_lib takes precedence over purelib and platlib
        arg_5.update(dict(purelib=arg_9.install_lib, platlib=arg_9.install_lib))

    if running_under_virtualenv():
        arg_5['headers'] = os.path.join(
            sys.prefix,
            'include',
            'site',
            'python' + sys.version[:3],
            arg_0,
        )

        if arg_3 is not None:
            arg_5["headers"] = os.path.join(
                arg_3,
                os.path.abspath(arg_5["headers"])[1:],
            )

    return arg_5


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
'raise'
)
:
arg_1
=
arg_0
.
_rectify_cfgstr
(
arg_1
)
if
arg_0
.
enabled
:
try
:
if
arg_0
.
verbose
>
1
:
arg_0
.
log
(
'[cacher] Func fname={}'
.
format
(
arg_0
.
fname
)
)
return
arg_0
.
load
(
arg_1
)
except
IOError
:
if
arg_0
.
verbose
>
0
:
arg_0
.
log
(
'[cacher] ... {} cache miss'
.
format
(
arg_0
.
fname
)
)
except
Exception
:
if
arg_0
.
verbose
>
0
:
arg_0
.
log
(
'[cacher] ... failed to load'
)
if
arg_2
==
'raise'
:
raise
elif
arg_2
==
'clear'
:
arg_0
.
clear
(
arg_1
)
return
else
:
raise
KeyError
(
'Unknown method on_error={}'
.
format
(
arg_2
)
)
else
:
if
arg_0
.
verbose
>
1
:
arg_0
.
log
(
'[cacher] ... cache disabled: fname={}'
.
format
(
arg_0
.
fname
)
)
return

def Func(arg_0, arg_1=None, arg_2='raise'):
        """
        Like load, but returns None if the load fails due to a cache miss.

        Args:
            on_error (str): How to handle non-io errors errors. Either raise,
                which re-raises the exception, or clear which deletes the cache
                and returns None.
        """
        arg_1 = arg_0._rectify_cfgstr(arg_1)
        if arg_0.enabled:
            try:
                if arg_0.verbose > 1:
                    arg_0.log('[cacher] Func fname={}'.format(arg_0.fname))
                return arg_0.load(arg_1)
            except IOError:
                if arg_0.verbose > 0:
                    arg_0.log('[cacher] ... {} cache miss'.format(arg_0.fname))
            except Exception:
                if arg_0.verbose > 0:
                    arg_0.log('[cacher] ... failed to load')
                if arg_2 == 'raise':
                    raise
                elif arg_2 == 'clear':
                    arg_0.clear(arg_1)
                    return None
                else:
                    raise KeyError('Unknown method on_error={}'.format(arg_2))
        else:
            if arg_0.verbose > 1:
                arg_0.log('[cacher] ... cache disabled: fname={}'.format(arg_0.fname))
        return None

Like load but returns None if the load fails due to a cache miss .


def
Func
(
arg_0
)
:
if
"("
in
arg_0
or
")"
in
arg_0
or
"|"
in
arg_0
:
logger
.
error
(
colored_print
(
"Please provide a valid task list!"
,
"red_bold"
)
)
return
False
return
True

def Func(arg_0):
        """Validate pipeline string

        Validates the pipeline string by searching for forbidden characters

        Parameters
        ----------
        pipeline_string : str
            STring with the processes provided

        Returns
        -------

        """
        if "(" in arg_0 or ")" in arg_0 or "|" in \
                arg_0:
            logger.error(
                colored_print("Please provide a valid task list!", "red_bold")
            )
            return False

        return True


def Func ( arg_0 ) : if arg_0 . status != 'success' : arg_0 . _run_failure_cleanups ( ) arg_0 . _done_event . set ( ) arg_0 . _run_done_callbacks ( )

def Func(arg_0):
        """Announce that future is done running and run associated callbacks

        This will run any failure cleanups if the transfer failed if not
        they have not been run, allows the result() to be unblocked, and will
        run any done callbacks associated to the TransferFuture if they have
        not already been ran.
        """
        if arg_0.status != 'success':
            arg_0._run_failure_cleanups()
        arg_0._done_event.set()
        arg_0._run_done_callbacks()


def Func ( arg_0 , arg_1 : arg_2 ) : logger . debug ( '>%s' , arg_1 ) try : arg_0 . _proc . stdout . flush ( ) arg_0 . _proc . stdin . write ( f'{cmd}\n' ) except IOError as e : raise SolverError ( arg_2 ( e ) )

def Func(arg_0, arg_1: arg_2):
        """
        Send a string to the solver.

        :param cmd: a SMTLIBv2 command (ex. (check-sat))
        """
        logger.debug('>%s', arg_1)
        try:
            arg_0._proc.stdout.flush()
            arg_0._proc.stdin.write(f'{cmd}\n')
        except IOError as e:
            raise SolverError(arg_2(e))


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 , arg_3 , arg_4 in arg_0 . graph . triples ( ( arg_1 , arg_2 , None ) ) : arg_5 = arg_0 . handle_lics ( arg_4 ) if arg_5 is not None : arg_0 . builder . set_file_license_in_file ( arg_0 . doc , arg_5 )

def Func(arg_0, arg_1, arg_2):
        """Sets file license information."""
        for arg_3, arg_3, arg_4 in arg_0.graph.triples((arg_1, arg_2, None)):
            arg_5 = arg_0.handle_lics(arg_4)
            if arg_5 is not None:
                arg_0.builder.set_file_license_in_file(arg_0.doc, arg_5)


def Func(arg_0, arg_1, arg_2=None):
    "return True if okay, raise Exception if not"  # O_o ?
    arg_3 = hashlib.md5(arg_1).hexdigest()
    if arg_0 != arg_3:
        if arg_2 is not None:
            logger.critical('\n'.join(arg_2))
        raise FailedVerification('original md5 = %r != %r = received md5' \
                                 % (arg_0, arg_3))
    return True

return True if okay raise Exception if not


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = PATHS [ 'GET_PENDING' ] % arg_0 . profile_id arg_3 = arg_0 . api . get ( arg_2 = arg_2 ) for arg_4 in arg_3 [ 'updates' ] : arg_1 . append ( Update ( api = arg_0 . api , raw_response = arg_4 ) ) arg_0 . __Func = arg_1 return arg_0 . __Func

def Func(arg_0):
    '''
      Returns an array of updates that are currently in the buffer for an
      individual social media profile.
    '''

    arg_1 = []
    arg_2 = PATHS['GET_PENDING'] % arg_0.profile_id

    arg_3 = arg_0.api.get(arg_2=arg_2)
    for arg_4 in arg_3['updates']:
      arg_1.append(Update(api=arg_0.api, raw_response=arg_4))

    arg_0.__Func = arg_1

    return arg_0.__Func

Returns an array of updates that are currently in the buffer for an individual social media profile .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , list ) : arg_1 = [ arg_1 ] arg_0 . register ( Descriptor . from_json ( arg_2 ) for arg_2 in arg_1 )

def Func(arg_0, arg_1):
        """Register Descriptors from json descriptor objects.

        Parameters:
            obj(list or dict): descriptors to register

        """
        if not isinstance(arg_1, list):
            arg_1 = [arg_1]

        arg_0.register(Descriptor.from_json(arg_2) for arg_2 in arg_1)

Register Descriptors from json descriptor objects .


def Func ( arg_0 ) : arg_1 = requests . get ( arg_0 ) arg_2 = StringIO ( arg_1 . content ) return arg_2

def Func(arg_0):
    """
    Fetch an image from url and convert it into a Pillow Image object
    """
    arg_1 = requests.get(arg_0)
    arg_2 = StringIO(arg_1.content)
    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = BNode ( ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . ConjunctiveLicenseSet ) arg_0 . graph . add ( arg_3 ) arg_4 = arg_0 . licenses_from_tree ( arg_1 ) for arg_5 in arg_4 : arg_6 = ( arg_2 , arg_0 . spdx_namespace . member , arg_5 ) arg_0 . graph . add ( arg_6 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return a node representing a conjunction of licenses.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.ConjunctiveLicenseSet)
        arg_0.graph.add(arg_3)
        arg_4 = arg_0.licenses_from_tree(arg_1)
        for arg_5 in arg_4:
            arg_6 = (arg_2, arg_0.spdx_namespace.member, arg_5)
            arg_0.graph.add(arg_6)
        return arg_2

Return a node representing a conjunction of licenses .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_0 . action_map . items ( ) : if arg_1 in arg_3 : return arg_2 return None

def Func(arg_0, arg_1):
        """Find the name of the action for the supplied alias.  If no action is
        asociated with the given alias, None is returned.

        :param alias: the alias to look up
        :type alias: str
        :rturns: the name of the corresponding action or None
        :rtype: str or NoneType

        """
        for arg_2, arg_3 in arg_0.action_map.items():
            if arg_1 in arg_3:
                return arg_2
        return None

Find the name of the action for the supplied alias . If no action is asociated with the given alias None is returned .


def Func ( arg_0 ) : arg_1 = _modelCopyMap [ arg_0 ] _modelCopyMap [ arg_0 ] += 1 arg_2 = type ( arg_0 . __name__ + '_Copy' + str ( arg_1 ) , arg_0 . __bases__ , copy . deepcopy ( dict ( arg_0 . __dict__ ) ) ) arg_2 . FIELDS = [ field . copy ( ) for field in arg_0 . FIELDS ] arg_2 . INDEXED_FIELDS = [ str ( idxField ) for idxField in arg_0 . INDEXED_FIELDS ] arg_2 . validateModel ( ) return arg_2

def Func(arg_0):
		'''
			Func - Copy this model, and return that copy.

			  The copied model will have all the same data, but will have a fresh instance of the FIELDS array and all members,
			    and the INDEXED_FIELDS array.

			  This is useful for converting, like changing field types or whatever, where you can load from one model and save into the other.

			@return <IndexedRedisModel> - A copy class of this model class with a unique name.
		'''

		arg_1 = _modelCopyMap[arg_0]
		_modelCopyMap[arg_0] += 1
		arg_2 = type(arg_0.__name__ + '_Copy' + str(arg_1), arg_0.__bases__, copy.deepcopy(dict(arg_0.__dict__)))

		arg_2.FIELDS = [field.copy() for field in arg_0.FIELDS]

		arg_2.INDEXED_FIELDS = [str(idxField) for idxField in arg_0.INDEXED_FIELDS] # Make sure they didn't do INDEXED_FIELDS = FIELDS or something wacky,
											    #  so do a comprehension of str on these to make sure we only get names

		arg_2.validateModel()

		return arg_2

copyModel - Copy this model, and return that copy.

			  The copied model will have all the same data, but will have a fresh instance of the FIELDS array and all members,
			    and the INDEXED_FIELDS array.

			  This is useful for converting, like changing field types or whatever, where you can load from one model and save into the other.

			@return <IndexedRedisModel> - A copy class of this model class with a unique name.

copyModel - Copy this model and return that copy .


def
Func
(
arg_0
)
:
arg_1
=
{
'name'
:
arg_0
.
name
,
'fields'
:
[
f
.
name
for
f
in
arg_0
.
fields
]
,
'numRecords by field'
:
[
f
.
numRecords
for
f
in
arg_0
.
fields
]
}
return
arg_1

def Func(arg_0):
    """Returns a description of the dataset"""

    arg_1 = {'name':arg_0.name, 'fields':[f.name for f in arg_0.fields], \
      'numRecords by field':[f.numRecords for f in arg_0.fields]}

    return arg_1


def Func ( arg_0 , arg_1 ) : arg_0 . wfile . write ( json . dumps ( { 'Func' : arg_1 } ) + NEWLINE )

def Func(arg_0, arg_1):
        """Log an event on the CouchDB server."""
        arg_0.wfile.write(json.dumps({'Func': arg_1}) + NEWLINE)


(recid,
         from_date,
         with_json=False,
         latest_only=False,
         with_collections=False,
         **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False , arg_4 = False , ** arg_5 ) : if arg_3 : arg_6 = [ get_record_revisions ( arg_0 , arg_1 ) [ - 1 ] ] else : arg_6 = get_record_revisions ( arg_0 , arg_1 ) arg_7 = dict ( record = [ ] , files = [ ] , arg_0 = arg_0 , collections = get_record_collections ( arg_0 ) if arg_4 else None , ) for arg_8 , arg_9 in arg_6 : arg_10 = zlib . decompress ( arg_9 ) arg_7 [ 'record' ] . append ( dict ( modification_datetime = datetime_toutc ( arg_8 ) . isoformat ( ) , arg_10 = arg_10 , json = Func_record_json ( arg_10 ) if arg_2 else None , ) ) arg_7 [ 'files' ] = Func_bibdoc ( arg_0 , arg_1 ) return arg_7

def Func(arg_0,
         arg_1,
         arg_2=False,
         arg_3=False,
         arg_4=False,
         **arg_5):
    """Dump MARCXML and JSON representation of a record.

    :param recid: Record identifier
    :param from_date: Dump only revisions from this date onwards.
    :param with_json: If ``True`` use old ``Record.create`` to generate the
        JSON representation of the record.
    :param latest_only: Dump only the last revision of the record metadata.
    :param with_collections: If ``True`` Func the list of collections that the
        record belongs to.
    :returns: List of versions of the record.
    """
    # Grab latest only
    if arg_3:
        arg_6 = [get_record_revisions(arg_0, arg_1)[-1]]
    else:
        arg_6 = get_record_revisions(arg_0, arg_1)

    # Dump revisions
    arg_7 = dict(
        record=[],
        files=[],
        arg_0=arg_0,
        collections=get_record_collections(arg_0)
        if arg_4 else None, )

    for arg_8, arg_9 in arg_6:
        arg_10 = zlib.decompress(arg_9)
        arg_7['record'].append(
            dict(
                modification_datetime=datetime_toutc(arg_8)
                .isoformat(),
                arg_10=arg_10,
                json=Func_record_json(arg_10) if arg_2 else None, ))

    arg_7['files'] = Func_bibdoc(arg_0, arg_1)

    return arg_7

Dump MARCXML and JSON representation of a record.

    :param recid: Record identifier
    :param from_date: Dump only revisions from this date onwards.
    :param with_json: If ``True`` use old ``Record.create`` to generate the
        JSON representation of the record.
    :param latest_only: Dump only the last revision of the record metadata.
    :param with_collections: If ``True`` dump the list of collections that the
        record belongs to.
    :returns: List of versions of the record.

Dump MARCXML and JSON representation of a record .


return (preferred_dtype if dtype is None else dtype).as_numpy_dtype

def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_1
=
(
if
arg_1
is
else
tf
.
as_dtype
(
arg_1
)
)
for
arg_3
in
tf
.
nest
.
flatten
(
arg_0
)
:
if
hasattr
(
arg_3
,
'dtype'
)
:
arg_4
=
tf
.
as_dtype
(
arg_3
.
dtype
)
else
:
continue
if
arg_2
is
:
arg_2
=
arg_4
elif
arg_2
!=
arg_4
:
raise
TypeError
(
'Found incompatible dtypes, {} and {}.'
.
format
(
arg_2
,
arg_4
)
)
if
arg_2
is
and
arg_1
is
:
return
return
(
arg_1
if
arg_2
is
else
arg_2
)
.
as_numpy_dtype

def Func(arg_0, arg_1=None):
  """Returns explict dtype from `args_list` if exists, else preferred_dtype."""
  arg_2 = None
  arg_1 = (None if arg_1 is None
                     else tf.as_dtype(arg_1))
  for arg_3 in tf.nest.flatten(arg_0):
    if hasattr(arg_3, 'dtype'):
      arg_4 = tf.as_dtype(arg_3.dtype)
    else:
      continue
    if arg_2 is None:
      arg_2 = arg_4
    elif arg_2 != arg_4:
      raise TypeError('Found incompatible dtypes, {} and {}.'.format(arg_2, arg_4))
  if arg_2 is None and arg_1 is None:
    return None
  return (arg_1 if arg_2 is None else arg_2).as_numpy_dtype

Returns explict dtype from args_list if exists else preferred_dtype .


def Func ( arg_0 , arg_1 ) : arg_2 = json . dumps ( arg_0 . _Func_dict ( arg_1 ) ) arg_3 = arg_0 . _perform_request ( url = '/um/groups' , method = 'POST' , arg_2 = arg_2 ) return arg_3

def Func(arg_0, arg_1):
        """
        Creates a new group and set group privileges.

        :param      group: The group object to be created.
        :type       group: ``dict``

        """
        arg_2 = json.dumps(arg_0._Func_dict(arg_1))

        arg_3 = arg_0._perform_request(
            url='/um/groups',
            method='POST',
            arg_2=arg_2)

        return arg_3

Creates a new group and set group privileges .


def Func ( arg_0 ) : arg_1 = arg_0 [ 'working-directory' ] arg_2 = arg_0 [ 'track' ] [ 'includes' ] arg_3 = arg_0 [ 'track' ] [ 'excludes' ] arg_2 = r'|' . join ( [ fnmatch . translate ( x ) for x in arg_2 ] ) arg_3 = r'|' . join ( [ fnmatch . translate ( x ) for x in arg_3 ] ) or r'$.' arg_4 = [ ] for arg_5 , arg_6 , arg_7 in os . walk ( arg_1 ) : arg_6 [ : ] = [ d for d in arg_6 if not re . match ( arg_3 , d ) ] arg_7 = [ f for f in arg_7 if not re . match ( arg_3 , f ) ] arg_7 = [ f for f in arg_7 if re . match ( arg_2 , f ) ] arg_7 = [ os . path . join ( arg_5 , f ) for f in arg_7 ] arg_4 . extend ( arg_7 ) return arg_4

def Func(arg_0):
    """
    Look through the local directory to pick up files to check
    """
    arg_1 = arg_0['working-directory']
    arg_2 = arg_0['track']['includes']
    arg_3 = arg_0['track']['excludes']

    # transform glob patterns to regular expressions
    # print("Includes ", includes)
    arg_2 = r'|'.join([fnmatch.translate(x) for x in arg_2])
    arg_3 = r'|'.join([fnmatch.translate(x) for x in arg_3]) or r'$.'

    arg_4 = []
    for arg_5, arg_6, arg_7 in os.walk(arg_1):

        # print("Looking at ", files)

        # exclude dirs
        # dirs[:] = [os.path.join(root, d) for d in dirs]
        arg_6[:] = [d for d in arg_6 if not re.match(arg_3, d)]

        # exclude/include files
        arg_7 = [f for f in arg_7 if not re.match(arg_3, f)]
        #print("Files after excludes", files)
        #print(includes)
        arg_7 = [f for f in arg_7 if re.match(arg_2, f)]
        #print("Files after includes", files)
        arg_7 = [os.path.join(arg_5, f) for f in arg_7]

        arg_4.extend(arg_7)

    return arg_4


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

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


def Func(arg_0, arg_1):
        """Parse a knitting pattern set.

        :param dict value: the specification of the knitting pattern set
        :rtype: knittingpattern.KnittingPatternSet.KnittingPatternSet
        :raises knittingpattern.KnittingPatternSet.ParsingError: if
          :paramref:`value` does not fulfill the :ref:`specification
          <FileFormatSpecification>`.

        """
        arg_0._start()
        arg_2 = arg_0._new_pattern_collection()
        arg_0._fill_pattern_collection(arg_2, arg_1)
        arg_0._create_pattern_set(arg_2, arg_1)
        return arg_0._pattern_set


def
Func
(
arg_0
,
arg_1
=
21
)
:
arg_2
=
len
(
arg_0
)
arg_3
=
int
(
(
arg_1
1
)
/
2
)
arg_4
=
[
' '
]
*
arg_3
+
[
t
for
t
in
arg_0
]
+
[
' '
]
*
arg_3
arg_5
,
arg_6
=
[
]
,
[
]
for
arg_7
in
range
(
arg_3
,
arg_3
+
arg_2
)
:
arg_8
=
arg_4
[
arg_7
+
1
:
arg_7
+
arg_3
+
1
]
+
list
(
reversed
(
arg_4
[
arg_7
arg_3
:
arg_7
]
)
)
+
[
arg_4
[
arg_7
]
]
arg_9
=
[
CHARS_MAP
.
get
(
c
,
80
)
for
c
in
arg_8
]
arg_10
=
[
CHAR_TYPES_MAP
.
get
(
CHAR_TYPE_FLATTEN
.
get
(
c
,
'o'
)
,
4
)
for
c
in
arg_8
]
arg_5
.
append
(
arg_9
)
arg_6
.
append
(
arg_10
)
arg_5
=
np
.
array
(
arg_5
)
.
astype
(
float
)
arg_6
=
np
.
array
(
arg_6
)
.
astype
(
float
)
return
arg_5
,
arg_6

def Func(arg_0, arg_1=21):
    """
    Create feature array of character and surrounding characters
    """
    arg_2 = len(arg_0)
    arg_3 = int((arg_1 - 1)/2)
    arg_4 = [' '] * arg_3  + [t for t in arg_0] + [' '] * arg_3
    arg_5, arg_6 = [], []
    for arg_7 in range(arg_3, arg_3 + arg_2):
        arg_8 = arg_4[arg_7 + 1: arg_7 + arg_3 + 1] + \
                    list(reversed(arg_4[arg_7 - arg_3: arg_7])) + \
                    [arg_4[arg_7]]
        arg_9 = [CHARS_MAP.get(c, 80) for c in arg_8]
        arg_10 = [CHAR_TYPES_MAP.get(CHAR_TYPE_FLATTEN.get(c, 'o'), 4)
                     for c in arg_8]
        arg_5.append(arg_9)
        arg_6.append(arg_10)
    arg_5 = np.array(arg_5).astype(float)
    arg_6 = np.array(arg_6).astype(float)
    return arg_5, arg_6


def Func(arg_0, arg_1):
    """The download operation"""
    arg_1, arg_2 = destination_from_source(arg_1, False)
    print('sources', arg_1)
    print('destinations', arg_2)
    if len(arg_2) == len(arg_1):
        if arg_0.prepare():
            for arg_3, arg_4 in zip(arg_1, arg_2):
                arg_0.read_file(arg_3, arg_4)
    else:
        raise Exception('You must specify a destination filename for each file you want to download.')
    log.info('All done!')


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Handles POST requests, instantiating a formset instance with the passed
        POST variables and then checked for validity.
        """
        arg_4 = arg_0.construct_formset()
        if arg_4.is_valid():
            return arg_0.formset_valid(arg_4)
        else:
            return arg_0.formset_invalid(arg_4)

Handles POST requests instantiating a formset instance with the passed POST variables and then checked for validity .


(self, fail_on_found=False, force_on_exists=False, **kwargs)

def Func(arg_0, arg_1=False, arg_2=False, **arg_3):
        """Create a notification template.

        All required configuration-related fields (required according to
        notification_type) must be provided.

        There are two types of notification template creation: isolatedly
        creating a new notification template and creating a new notification
        template under a job template. Here the two types are discriminated by
        whether to provide --job-template option. --status option controls
        more specific, job-run-status-related association.

        Fields in the resource's `identity` tuple are used for a lookup;
        if a match is found, then no-op (unless `force_on_exists` is set) but
        do not fail (unless `fail_on_found` is set).

        =====API DOCS=====
        Create an object.

        :param fail_on_found: Flag that if set, the operation fails if an object matching the unique criteria
                              already exists.
        :type fail_on_found: bool
        :param force_on_exists: Flag that if set, then if a match is found on unique fields, other fields will
                                be updated to the provided values.; If unset, a match causes the request to be
                                a no-op.
        :type force_on_exists: bool
        :param `**kwargs`: Keyword arguments which, all together, will be used as POST body to Func the
                           resource object.
        :returns: A dictionary combining the JSON output of the Funcd resource, as well as two extra fields:
                  "changed", a flag indicating if the resource is Funcd successfully; "id", an integer which
                  is the primary key of the Funcd object.
        :rtype: dict

        =====API DOCS=====
        """
        arg_4 = arg_0._separate(arg_3)
        arg_5 = arg_3.pop('job_template', None)
        arg_6 = arg_3.pop('status', 'any')
        arg_7 = arg_0.endpoint
        if arg_5 is not None:
            arg_8 = get_resource('job_template')
            arg_8.get(pk=arg_5)
            try:
                arg_9 = arg_0.get(**copy.deepcopy(arg_3))['id']
            except exc.NotFound:
                pass
            else:
                if arg_1:
                    raise exc.TowerCLIError('Notification template already '
                                            'exists and fail-on-found is '
                                            'switched on. Please use'
                                            ' "associate_notification" method'
                                            ' of job_template instead.')
                else:
                    debug.log('Notification template already exists, '
                              'associating with job template.',
                              header='details')
                    return arg_8.associate_notification_template(
                        arg_5, arg_9, arg_6=arg_6)
            arg_0.endpoint = '/job_templates/%d/notification_templates_%s/' %\
                            (arg_5, arg_6)
        arg_0._configuration(arg_3, arg_4)
        arg_11 = super(Resource, arg_0).Func(**arg_3)
        arg_0.endpoint = arg_7
        return arg_11

Create a notification template.

        All required configuration-related fields (required according to
        notification_type) must be provided.

        There are two types of notification template creation: isolatedly
        creating a new notification template and creating a new notification
        template under a job template. Here the two types are discriminated by
        whether to provide --job-template option. --status option controls
        more specific, job-run-status-related association.

        Fields in the resource's `identity` tuple are used for a lookup;
        if a match is found, then no-op (unless `force_on_exists` is set) but
        do not fail (unless `fail_on_found` is set).

        =====API DOCS=====
        Create an object.

        :param fail_on_found: Flag that if set, the operation fails if an object matching the unique criteria
                              already exists.
        :type fail_on_found: bool
        :param force_on_exists: Flag that if set, then if a match is found on unique fields, other fields will
                                be updated to the provided values.; If unset, a match causes the request to be
                                a no-op.
        :type force_on_exists: bool
        :param `**kwargs`: Keyword arguments which, all together, will be used as POST body to create the
                           resource object.
        :returns: A dictionary combining the JSON output of the created resource, as well as two extra fields:
                  "changed", a flag indicating if the resource is created successfully; "id", an integer which
                  is the primary key of the created object.
        :rtype: dict

        =====API DOCS=====


(self, symbol: str, currency: str, agent: str)

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_2):
        """ Downloads and parses the price """
        from finance_quote_python import Quote

        assert isinstance(arg_1, arg_2)
        assert isinstance(arg_3, arg_2)
        assert isinstance(arg_4, arg_2)

        if not arg_1:
            return None

        #self.logger.info(f"Downloading {symbol}... ")

        arg_5 = Quote()
        arg_5.logger = arg_0.logger

        arg_5.set_source(arg_4)
        arg_5.set_currency(arg_3)

        arg_7 = arg_5.fetch(arg_4, [arg_1])

        if not arg_7:
            raise ValueError(f"Did not receive a response for {symbol}.")

        arg_8 = arg_7[0]

        if not arg_8:
            raise ValueError(f"Price not downloaded/parsed for {symbol}.")
        else:
            # Create price data entity, to be inserted.
            arg_0.add_price(arg_8)

        return arg_8


def Func ( arg_0 , arg_1 ) : arg_2 = sum ( zi * MWi for zi , MWi in zip ( arg_0 , arg_1 ) ) arg_3 = [ zi * MWi / arg_2 for zi , MWi in zip ( arg_0 , arg_1 ) ] return arg_3

def Func(arg_0, arg_1):
    r'''Converts a list of mole fractions to mass fractions. Requires molecular
    weights for all species.

    .. math::
        w_i = \frac{z_i MW_i}{MW_{avg}}

        MW_{avg} = \sum_i z_i MW_i

    Parameters
    ----------
    zs : iterable
        Mole fractions [-]
    MWs : iterable
        Molecular weights [g/mol]

    Returns
    -------
    ws : iterable
        Mass fractions [-]

    Notes
    -----
    Does not check that the sums add to one. Does not check that inputs are of
    the same length.

    Examples
    --------
    >>> Func([0.5, 0.5], [10, 20])
    [0.3333333333333333, 0.6666666666666666]
    '''
    arg_2 = sum(zi*MWi for zi, MWi in zip(arg_0, arg_1))
    arg_3 = [zi*MWi/arg_2 for zi, MWi in zip(arg_0, arg_1)]
    return arg_3

r'''Converts a list of mole fractions to mass fractions. Requires molecular
    weights for all species.

    .. math::
        w_i = \frac{z_i MW_i}{MW_{avg}}

        MW_{avg} = \sum_i z_i MW_i

    Parameters
    ----------
    zs : iterable
        Mole fractions [-]
    MWs : iterable
        Molecular weights [g/mol]

    Returns
    -------
    ws : iterable
        Mass fractions [-]

    Notes
    -----
    Does not check that the sums add to one. Does not check that inputs are of
    the same length.

    Examples
    --------
    >>> zs_to_ws([0.5, 0.5], [10, 20])
    [0.3333333333333333, 0.6666666666666666]

r Converts a list of mole fractions to mass fractions . Requires molecular weights for all species .


def Func ( arg_0 ) : if arg_2 . displayhook is not arg_0 . hook : arg_0 . old_hook = arg_2 . displayhook arg_2 . displayhook = arg_0 . hook

def Func(arg_0):
        """Set the hook."""
        if arg_2.displayhook is not arg_0.hook:
            arg_0.old_hook = arg_2.displayhook
            arg_2.displayhook = arg_0.hook


def Func(arg_0, arg_1):
        """ Sets de maximum values of x, y, z as a numpy array
        """
        arg_0.x_max, arg_0.y_max, arg_0.z_max = arg_1

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


(self, source_bucket, source_key,
                                  bucket, key)

async def Func(arg_0, arg_1, arg_2,
                                  arg_3, arg_4):
        """Copy a file from one bucket into another
        """
        arg_5 = await arg_0.head_object(Bucket=arg_1, Key=arg_2)
        arg_6 = arg_5['ContentLength']

        if arg_6 > MULTI_PART_SIZE:
            arg_7 = await _multipart_copy(arg_0, arg_1, arg_2,
                                           arg_3, arg_4, arg_6)
        else:
            arg_7 = await arg_0.copy_object(
                Bucket=arg_3, Key=arg_4,
                CopySource=_source_string(arg_1, arg_2)
            )
        return arg_7


def Func(arg_0, arg_1):
        """
        Checks to see that the query will not exceed the max query depth

        :param returning_query: The PIF system or Dataset query to execute.
        :type returning_query: :class:`PifSystemReturningQuery` or :class: `DatasetReturningQuery`
        """

        arg_2 = arg_1.from_index or 0
        arg_3 = arg_1.size or 0

        if arg_2 < 0:
            raise CitrinationClientError(
                "start_index cannot be negative. Please enter a value greater than or equal to zero")
        if arg_3 < 0:
            raise CitrinationClientError("Size cannot be negative. Please enter a value greater than or equal to zero")
        if arg_2 + arg_3 > MAX_QUERY_DEPTH:
            raise CitrinationClientError(
                "Citrination does not support pagination past the {0}th result. Please reduce either the from_index and/or size such that their sum is below {0}".format(
                    MAX_QUERY_DEPTH))


(
            self, images, greedy=False, strict=True, return_details=False)

def Func(
            arg_0, arg_1, arg_2=False, arg_3=True, arg_4=False):
        """Interface to model.Func for attacks.

        Parameters
        ----------
        images : `numpy.ndarray`
            Batch of inputs with shape as expected by the model.
        greedy : bool
            Whether the first adversarial should be returned.
        strict : bool
            Controls if the bounds for the pixel values should be checked.

        """
        if arg_3:
            arg_5 = arg_0.in_bounds(arg_1)
            assert arg_5

        arg_0._total_prediction_calls += len(arg_1)
        arg_6 = arg_0.__model.Func(arg_1)

        assert arg_6.ndim == 2
        assert arg_6.shape[0] == arg_1.shape[0]

        if arg_4:
            assert arg_2

        arg_7 = []
        for arg_8 in range(len(arg_6)):
            if arg_3:
                arg_9 = True
            else:
                arg_9 = arg_0.in_bounds(arg_1[arg_8])
            arg_10, arg_11, arg_12 = arg_0.__is_adversarial(
                arg_1[arg_8], arg_6[arg_8], arg_9)
            if arg_10 and arg_2:
                if arg_4:
                    return arg_6, arg_10, arg_8, arg_11, arg_12
                else:
                    return arg_6, arg_10, arg_8
            arg_7.append(arg_10)

        if arg_2:  # pragma: no cover
            # no adversarial found
            if arg_4:
                return arg_6, False, None, False, None
            else:
                return arg_6, False, None

        arg_10 = np.array(arg_7)
        assert arg_10.ndim == 1
        assert arg_10.shape[0] == arg_1.shape[0]

        return arg_6, arg_10

Interface to model.batch_predictions for attacks.

        Parameters
        ----------
        images : `numpy.ndarray`
            Batch of inputs with shape as expected by the model.
        greedy : bool
            Whether the first adversarial should be returned.
        strict : bool
            Controls if the bounds for the pixel values should be checked.

Interface to model . batch_predictions for attacks .


(harmonic_out, x, freqs, h_range, kind='linear',
                 fill_value=0, axis=0)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4='linear',
                 arg_5=0, arg_6=0):
    '''Populate a harmonic tensor from a time-frequency representation.

    Parameters
    ----------
    harmonic_out : np.ndarray, shape=(len(h_range), X.shape)
        The output array to store harmonics

    X : np.ndarray
        The input energy

    freqs : np.ndarray, shape=(x.shape[axis])
        The frequency values corresponding to x's elements along the
        chosen axis.

    h_range : list-like, non-negative
        Harmonics to compute.  The first harmonic (1) corresponds to `x`
        itself.
        Values less than one (e.g., 1/2) correspond to sub-harmonics.

    kind : str
        Interpolation type.  See `scipy.interpolate.interp1d`.

    fill_value : float
        The value to fill when extrapolating beyond the observed
        frequency range.

    axis : int
        The axis along which to compute harmonics

    See Also
    --------
    harmonics
    scipy.interpolate.interp1d

    Examples
    --------
    Estimate the harmonics of a time-averaged tempogram

    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      duration=15, offset=30)
    >>> # Compute the time-varying tempogram and average over time
    >>> tempi = np.mean(librosa.feature.tempogram(y=y, sr=sr), axis=1)
    >>> # We'll measure the first five harmonics
    >>> h_range = [1, 2, 3, 4, 5]
    >>> f_tempo = librosa.tempo_frequencies(len(tempi), sr=sr)
    >>> # Build the harmonic tensor
    >>> t_harmonics = librosa.interp_harmonics(tempi, f_tempo, h_range)
    >>> print(t_harmonics.shape)
    (5, 384)

    >>> # And plot the results
    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> librosa.display.specshow(t_harmonics, x_axis='tempo', sr=sr)
    >>> plt.yticks(0.5 + np.arange(len(h_range)),
    ...            ['{:.3g}'.format(_) for _ in h_range])
    >>> plt.ylabel('Harmonic')
    >>> plt.xlabel('Tempo (BPM)')
    >>> plt.tight_layout()

    We can also compute frequency harmonics for spectrograms.
    To calculate subharmonic energy, use values < 1.

    >>> h_range = [1./3, 1./2, 1, 2, 3, 4]
    >>> S = np.abs(librosa.stft(y))
    >>> fft_freqs = librosa.fft_frequencies(sr=sr)
    >>> S_harm = librosa.interp_harmonics(S, fft_freqs, h_range, axis=0)
    >>> print(S_harm.shape)
    (6, 1025, 646)

    >>> plt.figure()
    >>> for i, _sh in enumerate(S_harm, 1):
    ...     plt.subplot(3,2,i)
    ...     librosa.display.specshow(librosa.amplitude_to_db(_sh,
    ...                                                      ref=S.max()),
    ...                              sr=sr, y_axis='log')
    ...     plt.title('h={:.3g}'.format(h_range[i-1]))
    ...     plt.yticks([])
    >>> plt.tight_layout()
    '''

    # Note: this only works for fixed-grid, 1d interpolation
    arg_7 = scipy.interpolate.interp1d(arg_2, arg_1,
                                          arg_4=arg_4,
                                          arg_6=arg_6,
                                          copy=False,
                                          bounds_error=False,
                                          arg_5=arg_5)

    arg_8 = [slice(None)] * arg_0.ndim

    # Compute the output index of the interpolated values
    arg_9 = 1 + (arg_6 % arg_1.ndim)

    # Iterate over the harmonics range
    for arg_10, arg_11 in enumerate(arg_3):
        arg_8[0] = arg_10

        # Iterate over frequencies
        for arg_12, arg_13 in enumerate(arg_2):
            # Offset the output axis by 1 to account for the harmonic index
            arg_8[arg_9] = arg_12

            # Estimate the harmonic energy at this frequency across time
            arg_0[arg_14(arg_8)] = arg_7(arg_11 * arg_13)

Populate a harmonic tensor from a time - frequency representation .


def Func(arg_0, arg_1):
        """Initializes sitetree to handle new request.

        :param Context|None context:
        """
        arg_0.cache = Cache()
        arg_0.current_page_context = arg_1
        arg_0.current_request = arg_1.get('request', None) if arg_1 else None
        arg_0.current_lang = get_language()

        arg_0._current_app_is_admin = None
        arg_0._current_user_permissions = _UNSET
        arg_0._items_urls = {}  # Resolved urls are cache for a request.
        arg_0._current_items = {}

Initializes sitetree to handle new request .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : try : arg_1 . append ( arg_2 . strip ( ) ) except ( AttributeError ) : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """
    Take a list of strings and clear whitespace
    on each one. If a value in the list is not a
    string pass it through untouched.

    Args:
        iterable: mixed list

    Returns:
        mixed list
    """
    arg_1 = []
    for arg_2 in arg_0:
        try:
            arg_1.append(arg_2.strip())
        except(AttributeError):
            arg_1.append(arg_2)
    return arg_1

Take a list of strings and clear whitespace on each one . If a value in the list is not a string pass it through untouched .


def
Func
(
arg_0
=
False
)
:
try
:
if
arg_0
:
arg_1
=
str
(
urlopen
(
'http://checkip.dyndns.com/'
)
.
read
(
)
)
arg_2
=
re
.
compile
(
r'Address: (\d+\.\d+\.\d+\.\d+)'
)
.
search
(
arg_1
)
.
group
(
1
)
else
:
arg_3
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
arg_3
.
connect
(
(
'google.com'
,
0
)
)
arg_2
=
arg_3
.
getsockname
(
)
[
0
]
except
Exception
,
error
:
print
(
'Online test failed : {}'
.
format
(
error
)
)
raise
return
arg_2

def Func(arg_0=False):
    ''' Utility for logbook information injection '''
    try:
        if arg_0:
            arg_1 = str(urlopen('http://checkip.dyndns.com/').read())
            arg_2 = re.compile(
                r'Address: (\d+\.\d+\.\d+\.\d+)').search(arg_1).group(1)
        else:
            arg_3 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            arg_3.connect(('google.com', 0))
            arg_2 = arg_3.getsockname()[0]
    except Exception, error:
        print('Online test failed : {}'.format(error))
        raise
    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) arg_2 [ 'token' ] = arg_1 arg_3 = arg_0 . request ( 'midas.user.folders' , arg_2 ) return arg_3

def Func(arg_0, arg_1):
        """
        List the folders in the users home area.

        :param token: A valid token for the user in question.
        :type token: string
        :returns: List of dictionaries containing folder information.
        :rtype: list[dict]
        """
        arg_2 = dict()
        arg_2['token'] = arg_1
        arg_3 = arg_0.request('midas.user.folders', arg_2)
        return arg_3

List the folders in the users home area .


return shapely.geometry.Polygon([(point[0], point[1]) for point in self.exterior])

def Func ( arg_0 ) : import shapely . geometry return shapely . geometry . Polygon ( [ ( arg_1 [ 0 ] , arg_1 [ 1 ] ) for arg_1 in arg_0 . exterior ] )

def Func(arg_0):
        """
        Convert this polygon to a Shapely polygon.

        Returns
        -------
        shapely.geometry.Polygon
            The Shapely polygon matching this polygon's exterior.

        """
        # load shapely lazily, which makes the dependency more optional
        import shapely.geometry

        return shapely.geometry.Polygon([(arg_1[0], arg_1[1]) for arg_1 in arg_0.exterior])

Convert this polygon to a Shapely polygon .


(self, swarmId=None, genIdx=None, completed=None,
                       matured=None, lastDescendent=False)

return (particleStates, modelIds, errScores, completedFlags, maturedFlags)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = False ) : if arg_1 is not None : arg_6 = arg_0 . _swarmIdToIndexes . get ( arg_1 , [ ] ) else : arg_6 = range ( len ( arg_0 . _allResults ) ) if len ( arg_6 ) == 0 : return ( [ ] , [ ] , [ ] , [ ] , [ ] ) arg_7 = [ ] arg_8 = [ ] arg_9 = [ ] arg_10 = [ ] arg_11 = [ ] for arg_12 in arg_6 : arg_13 = arg_0 . _allResults [ arg_12 ] if arg_1 is not None : assert ( not arg_13 [ 'hidden' ] ) arg_14 = arg_13 [ 'modelParams' ] arg_15 = arg_13 [ 'completed' ] arg_16 = arg_13 [ 'matured' ] arg_17 = arg_14 [ 'particleState' ] arg_18 = arg_17 [ 'genIdx' ] arg_19 = arg_17 [ 'id' ] if arg_2 is not None and arg_18 != arg_2 : continue if arg_3 is not None and ( arg_3 != arg_15 ) : continue if arg_4 is not None and ( arg_4 != arg_16 ) : continue if arg_5 and ( arg_0 . _particleLatestGenIdx [ arg_19 ] != arg_18 ) : continue arg_7 . append ( arg_17 ) arg_8 . append ( arg_13 [ 'modelID' ] ) arg_9 . append ( arg_13 [ 'errScore' ] ) arg_10 . append ( arg_15 ) arg_11 . append ( arg_16 ) return ( arg_7 , arg_8 , arg_9 , arg_10 , arg_11 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                       arg_4=None, arg_5=False):
    """Return a list of particleStates for all particles we know about in
    the given swarm, their model Ids, and metric results.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:  A string representation of the sorted list of encoders in this
                 swarm. For example '__address_encoder.__gym_encoder'

    genIdx:  If not None, only return particles at this specific generation
                  index.

    completed:   If not None, only return particles of the given state (either
                completed if 'completed' is True, or running if 'completed'
                is false

    matured:   If not None, only return particles of the given state (either
                matured if 'matured' is True, or not matured if 'matured'
                is false. Note that any model which has completed is also
                considered matured.

    lastDescendent: If True, only return particles that are the last descendent,
                that is, the highest generation index for a given particle Id

    retval:  (particleStates, modelIds, errScores, completed, matured)
              particleStates: list of particleStates
              modelIds: list of modelIds
              errScores: list of errScores, numpy.inf is plugged in
                              if we don't have a result yet
              completed: list of completed booleans
              matured: list of matured booleans
    """
    # The indexes of all the models in this swarm. This list excludes hidden
    #  (orphaned) models.
    if arg_1 is not None:
      arg_6 = arg_0._swarmIdToIndexes.get(arg_1, [])
    else:
      arg_6 = range(len(arg_0._allResults))
    if len(arg_6) == 0:
      return ([], [], [], [], [])

    # Get the particles of interest
    arg_7 = []
    arg_8 = []
    arg_9 = []
    arg_10 = []
    arg_11 = []
    for arg_12 in arg_6:
      arg_13 = arg_0._allResults[arg_12]

      # If this entry is hidden (i.e. it was an orphaned model), it should
      #  not be in this list
      if arg_1 is not None:
        assert (not arg_13['hidden'])

      # Get info on this model
      arg_14 = arg_13['modelParams']
      arg_15 = arg_13['completed']
      arg_16 = arg_13['matured']
      arg_17 = arg_14['particleState']
      arg_18 = arg_17['genIdx']
      arg_19 = arg_17['id']

      if arg_2 is not None and arg_18 != arg_2:
        continue

      if arg_3 is not None and (arg_3 != arg_15):
        continue

      if arg_4 is not None and (arg_4 != arg_16):
        continue

      if arg_5 \
              and (arg_0._particleLatestGenIdx[arg_19] != arg_18):
        continue

      # Incorporate into return values
      arg_7.append(arg_17)
      arg_8.append(arg_13['modelID'])
      arg_9.append(arg_13['errScore'])
      arg_10.append(arg_15)
      arg_11.append(arg_16)

    return (arg_7, arg_8, arg_9, arg_10, arg_11)

Return a list of particleStates for all particles we know about in the given swarm their model Ids and metric results .


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = { } arg_4 = super ( ) . Func ( arg_1 , ** arg_3 ) return arg_4

def Func(arg_0, arg_1=arg_2):
        """Fetch data from Google API.

        The method retrieves a list of hits for some
        given keywords using the Google API.

        :param category: the category of items to Func

        :returns: a generator of data
        """
        arg_3 = {}
        arg_4 = super().Func(arg_1, **arg_3)

        return arg_4

Fetch data from Google API.

        The method retrieves a list of hits for some
        given keywords using the Google API.

        :param category: the category of items to fetch

        :returns: a generator of data


def Func ( arg_0 , arg_1 = False ) : arg_2 = ( yield from arg_0 . handle_set ( arg_0 . API . get ( 'mute' ) , int ( arg_1 ) ) ) return bool ( arg_2 )

def Func(arg_0, arg_1=False):
        """Mute or unmute the device."""
        arg_2 = (yield from arg_0.handle_set(arg_0.API.get('mute'), int(arg_1)))
        return bool(arg_2)


def Func ( arg_0 ) : arg_1 = [ ] if arg_0 : arg_2 = arg_0 . split ( '.' ) for arg_3 in range ( len ( arg_2 ) ) : arg_1 . append ( '.' . join ( arg_2 [ arg_3 : ] ) ) return arg_1

def Func(arg_0):
    '''returns a list of strings created by splitting the domain on
    '.' and successively cutting off the left most portion
    '''
    arg_1 = []
    if arg_0:
        arg_2 = arg_0.split('.')
        for arg_3 in range(len(arg_2)):
            arg_1.append( '.'.join(arg_2[arg_3:]))
    return arg_1

returns a list of strings created by splitting the domain on . and successively cutting off the left most portion


def Func(arg_0):
        """Fetches a single row from the cursor."""
        arg_0._check_executed()
        arg_1 = arg_0._fetch_row(1)
        if not arg_1:
            arg_0._warning_check()
            return None
        arg_0.rownumber = arg_0.rownumber + 1
        return arg_1[0]


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tsuite:exit"
)
arg_2
=
0
for
arg_3
in
reversed
(
arg_1
[
"hooks"
]
[
"exit"
]
)
:
arg_2
=
script_run
(
arg_0
,
arg_3
)
if
arg_2
:
break
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tsuite:exit { rcode: %r } "
%
arg_2
,
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
    """Triggers when exiting the given testsuite"""

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tsuite:exit")

    arg_2 = 0
    for arg_3 in reversed(arg_1["hooks"]["exit"]):      # EXIT-hooks
        arg_2 = script_run(arg_0, arg_3)
        if arg_2:
            break

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tsuite:exit { rcode: %r } " % arg_2, arg_2)

    return arg_2


def Func(arg_0, arg_1):
    """
    Returns an AudioSegment created from the given numpy array.

    The numpy array must have shape = (num_samples, num_channels).

    :param nparr: The numpy array to create an AudioSegment from.
    :returns: An AudioSegment created from the given array.
    """
    # interleave the audio across all channels and collapse
    if arg_0.dtype.itemsize not in (1, 2, 4):
        raise ValueError("Numpy Array must contain 8, 16, or 32 bit values.")
    if len(arg_0.shape) == 1:
        arg_2 = [arg_0]
    elif len(arg_0.shape) == 2:
        arg_2 = [arg_0[i,:] for i in range(arg_0.shape[0])]
    else:
        raise ValueError("Numpy Array must be one or two dimensional. Shape must be: (num_samples, num_channels).")
    arg_3 = np.vstack(arg_2).reshape((-1,), order='F')
    arg_4 = pydub.AudioSegment(arg_3.tobytes(),
                                frame_rate=arg_1,
                                sample_width=arg_3.dtype.itemsize,
                                channels=len(arg_3.shape)
                               )
    return AudioSegment(arg_4, "")

Returns an AudioSegment created from the given numpy array .


def Func(arg_0, arg_1):
        """
        Get a specific extension of the certificate by index.

        Extensions on a certificate are kept in order. The index
        parameter selects which extension will be returned.

        :param int index: The index of the extension to retrieve.
        :return: The extension at the specified index.
        :rtype: :py:class:`X509Extension`
        :raises IndexError: If the extension index was out of bounds.

        .. versionadded:: 0.12
        """
        arg_2 = X509Extension.__new__(X509Extension)
        arg_2._extension = _lib.X509_get_ext(arg_0._x509, arg_1)
        if arg_2._extension == _ffi.NULL:
            raise IndexError("extension index out of bounds")

        arg_4 = _lib.X509_EXTENSION_dup(arg_2._extension)
        arg_2._extension = _ffi.gc(arg_4, _lib.X509_EXTENSION_free)
        return arg_2

Get a specific extension of the certificate by index .


(
    client_creator, cert_store, acme_email, allow_multiple_certs,
    marathon_addrs, marathon_timeout, sse_timeout, mlb_addrs, group,
        reactor)

return MarathonAcme(
        marathon_client,
        group,
        cert_store,
        marathon_lb_client,
        client_creator,
        reactor,
        acme_email,
        allow_multiple_certs
    )

def Func(
    arg_0, arg_1, arg_2, arg_3,
    arg_4, arg_5, arg_6, arg_7, arg_8,
        arg_9):
    """
    Create a marathon-acme instance.

    :param client_creator:
        The txacme client creator function.
    :param cert_store:
        The txacme certificate store instance.
    :param acme_email:
        Email address to use when registering with the ACME service.
    :param allow_multiple_certs:
        Whether to allow multiple certificates per app port.
    :param marathon_addr:
        Address for the Marathon instance to find app domains that require
        certificates.
    :param marathon_timeout:
        Amount of time in seconds to wait for response headers to be received
        from Marathon.
    :param sse_timeout:
        Amount of time in seconds to wait for some event data to be received
        from Marathon.
    :param mlb_addrs:
        List of addresses for marathon-lb instances to reload when a new
        certificate is issued.
    :param group:
        The marathon-lb group (``HAPROXY_GROUP``) to consider when finding
        app domains.
    :param reactor: The reactor to use.
    """
    arg_10 = MarathonClient(arg_4, timeout=arg_5,
                                     sse_kwargs={'timeout': arg_6},
                                     arg_9=arg_9)
    arg_11 = MarathonLbClient(arg_7, arg_9=arg_9)

    return MarathonAcme(
        arg_10,
        arg_8,
        arg_1,
        arg_11,
        arg_0,
        arg_9,
        arg_2,
        arg_3
    )


def
Func
(
arg_0
)
:
if
arg_0
==
'HANGUP'
:
return
{
'error'
:
'AGIResultHangup'
,
'msg'
:
'User hungup during execution'
}
arg_1
=
dict
(
code
=
0
,
response
=
""
,
arg_0
=
arg_0
)
arg_2
=
re_code
.
search
(
arg_0
)
try
:
arg_1
.
update
(
arg_2
.
groupdict
(
)
)
except
AttributeError
:
pass
return
agi_code_check
(
**
arg_1
)

def Func(arg_0):
    """Parse AGI results using Regular expression.

    AGI Result examples::

        100 result=0 Trying...

        200 result=0

        200 result=-1

        200 result=132456

        200 result= (timeout)

        510 Invalid or unknown command

        520-Invalid command syntax. Proper usage follows:
        int() argument must be a string, a bytes-like object or a number, not
        'NoneType'

        HANGUP

    """
    # print("--------------\n", line)
    if arg_0 == 'HANGUP':
        return {'error': 'AGIResultHangup',
                'msg': 'User hungup during execution'}

    arg_1 = dict(code=0, response="", arg_0=arg_0)
    arg_2 = re_code.search(arg_0)
    try:
        arg_1.update(arg_2.groupdict())
    except AttributeError:
        # None has no attribute groupdict
        pass
    return agi_code_check(**arg_1)

Parse AGI results using Regular expression .


return super().sys_receive(cpu, fd, buf, count, rx_bytes)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """
        Symbolic version of Decree.Func
        """
        if issymbolic(arg_2):
            logger.info("Ask to read from a symbolic file descriptor!!")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 0)

        if issymbolic(arg_3):
            logger.info("Ask to read to a symbolic buffer")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 1)

        if issymbolic(arg_4):
            logger.info("Ask to read a symbolic number of bytes ")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 2)

        if issymbolic(arg_5):
            logger.info("Ask to return size to a symbolic address ")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 3)

        return super().Func(arg_1, arg_2, arg_3, arg_4, arg_5)

Symbolic version of Decree . sys_receive


(src, tar, qval=2, alpha=1, beta=1, bias=None)

return Tversky().dist(src, tar, qval, alpha, beta, bias)

def Func(arg_0, arg_1, arg_2=2, arg_3=1, arg_4=1, arg_5=None):
    """Return the Tversky distance between two strings.

    This is a wrapper for :py:meth:`Tversky.dist`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alpha : float
        Tversky index parameter as described above
    beta : float
        Tversky index parameter as described above
    bias : float
        The symmetric Tversky index bias parameter

    Returns
    -------
    float
        Tversky distance

    Examples
    --------
    >>> Func('cat', 'hat')
    0.6666666666666667
    >>> Func('Niall', 'Neil')
    0.7777777777777778
    >>> Func('aluminum', 'Catalan')
    0.9375
    >>> Func('ATCG', 'TAGC')
    1.0

    """
    return Tversky().dist(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5)

Return the Tversky distance between two strings.

    This is a wrapper for :py:meth:`Tversky.dist`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alpha : float
        Tversky index parameter as described above
    beta : float
        Tversky index parameter as described above
    bias : float
        The symmetric Tversky index bias parameter

    Returns
    -------
    float
        Tversky distance

    Examples
    --------
    >>> dist_tversky('cat', 'hat')
    0.6666666666666667
    >>> dist_tversky('Niall', 'Neil')
    0.7777777777777778
    >>> dist_tversky('aluminum', 'Catalan')
    0.9375
    >>> dist_tversky('ATCG', 'TAGC')
    1.0

Return the Tversky distance between two strings .


def Func(arg_0, arg_1):
        """
        Pack data into list of BitsVal of specified dataWidth

        :param data: dict of values for struct fields {fieldName: value}

        :return: list of BitsVal which are representing values of words
        """
        arg_2 = simBitsT(arg_0.wordWidth, None)
        arg_3 = arg_0._fieldToTPart
        if arg_3 is None:
            arg_3 = arg_0._fieldToTPart = arg_0.fieldToDataDict(
                arg_0.origin.dtype,
                arg_1,
                {})

        for arg_4, arg_5 in arg_0.walkWords(showPadding=True):
            arg_6 = 0
            arg_7 = 0
            for arg_8 in arg_5:
                arg_9, arg_10 = arg_8.getBusWordBitRange()
                arg_11, arg_12 = arg_8.getFieldBitRange()
                if not arg_8.isPadding:
                    arg_13 = arg_3.get(arg_8.tmpl.origin, None)
                else:
                    arg_13 = None

                if arg_13 is None:
                    arg_14 = 0
                    arg_15 = 0
                else:
                    arg_14 = selectBitRange(arg_13, arg_12, arg_11 - arg_12)
                    arg_15 = mask(arg_9 - arg_10) << arg_10

                arg_7 = setBitRange(arg_7, arg_10, arg_9 - arg_10, arg_14)
                arg_6 = setBitRange(arg_7, arg_10, arg_9 - arg_10, arg_15)

            yield arg_2.getValueCls()(arg_7, arg_2,
                                           arg_6, -1)


(logu, t, self_normalized=False, name=None)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None ) : with tf . compat . v1 . name_scope ( arg_3 , "Func" , [ arg_0 , arg_1 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_3 = "logu" ) arg_1 = tf . convert_to_tensor ( value = arg_1 , dtype = arg_0 . dtype . base_dtype , arg_3 = "t" ) arg_4 = tf . math . expm1 ( arg_1 * arg_0 ) if arg_2 : arg_4 -= arg_1 * tf . math . expm1 ( arg_0 ) arg_4 *= tf . where ( tf . logical_and ( 0. < arg_1 , arg_1 < 1. ) , - tf . ones_like ( arg_1 ) , tf . ones_like ( arg_1 ) ) return arg_4

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
  """The T-Power Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  When `self_normalized = True` the T-Power Csiszar-function is:

  ```none
  f(u) = s [ u**t - 1 - t(u - 1) ]
  s = { -1   0 < t < 1
      { +1   otherwise
  ```

  When `self_normalized = False` the `- t(u - 1)` term is omitted.

  This is similar to the `amari_alpha` Csiszar-function, with the associated
  divergence being the same up to factors depending only on `t`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    t:  `Tensor` of same `dtype` as `logu` and broadcastable shape.
    self_normalized: Python `bool` indicating whether `f'(u=1)=0`.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    Func_of_u: `float`-like `Tensor` of the Csiszar-function evaluated
      at `u = exp(logu)`.
  """
  with tf.compat.v1.name_scope(arg_3, "Func", [arg_0, arg_1]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_3="logu")
    arg_1 = tf.convert_to_tensor(value=arg_1, dtype=arg_0.dtype.base_dtype, arg_3="t")
    arg_4 = tf.math.expm1(arg_1 * arg_0)
    if arg_2:
      arg_4 -= arg_1 * tf.math.expm1(arg_0)
    arg_4 *= tf.where(tf.logical_and(0. < arg_1, arg_1 < 1.),
                   -tf.ones_like(arg_1),
                   tf.ones_like(arg_1))
    return arg_4

The T-Power Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  When `self_normalized = True` the T-Power Csiszar-function is:

  ```none
  f(u) = s [ u**t - 1 - t(u - 1) ]
  s = { -1   0 < t < 1
      { +1   otherwise
  ```

  When `self_normalized = False` the `- t(u - 1)` term is omitted.

  This is similar to the `amari_alpha` Csiszar-function, with the associated
  divergence being the same up to factors depending only on `t`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    t:  `Tensor` of same `dtype` as `logu` and broadcastable shape.
    self_normalized: Python `bool` indicating whether `f'(u=1)=0`.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    t_power_of_u: `float`-like `Tensor` of the Csiszar-function evaluated
      at `u = exp(logu)`.

The T - Power Csiszar - function in log - space .