def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
registry
.
settings
if
asbool
(
arg_1
.
get
(
'twitcher.rpcinterface'
,
True
)
)
:
LOGGER
.
debug
(
'Twitcher XML-RPC Interface enabled.'
)
arg_0
.
include
(
'twitcher.config'
)
arg_0
.
include
(
'twitcher.basicauth'
)
arg_0
.
include
(
'pyramid_rpc.xmlrpc'
)
arg_0
.
include
(
'twitcher.db'
)
arg_0
.
add_xmlrpc_endpoint
(
'api'
,
'/RPC2'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'generate_token'
,
endpoint
=
'api'
,
method
=
'generate_token'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'revoke_token'
,
endpoint
=
'api'
,
method
=
'revoke_token'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'revoke_all_tokens'
,
endpoint
=
'api'
,
method
=
'revoke_all_tokens'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'register_service'
,
endpoint
=
'api'
,
method
=
'register_service'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'unregister_service'
,
endpoint
=
'api'
,
method
=
'unregister_service'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'get_service_by_name'
,
endpoint
=
'api'
,
method
=
'get_service_by_name'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'get_service_by_url'
,
endpoint
=
'api'
,
method
=
'get_service_by_url'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'clear_services'
,
endpoint
=
'api'
,
method
=
'clear_services'
)
arg_0
.
add_xmlrpc_method
(
RPCInterface
,
attr
=
'list_services'
,
endpoint
=
'api'
,
method
=
'list_services'
)

def Func(arg_0):
    """ The callable makes it possible to include rpcinterface
    in a Pyramid application.

    Calling ``config.include(twitcher.rpcinterface)`` will result in this
    callable being called.

    Arguments:

    * ``config``: the ``pyramid.config.Configurator`` object.
    """
    arg_1 = arg_0.registry.settings

    if asbool(arg_1.get('twitcher.rpcinterface', True)):
        LOGGER.debug('Twitcher XML-RPC Interface enabled.')

        # include twitcher config
        arg_0.include('twitcher.config')

        # using basic auth
        arg_0.include('twitcher.basicauth')

        # pyramid xml-rpc
        # http://docs.pylonsproject.org/projects/pyramid-rpc/en/latest/xmlrpc.html
        arg_0.include('pyramid_rpc.xmlrpc')
        arg_0.include('twitcher.db')
        arg_0.add_xmlrpc_endpoint('api', '/RPC2')

        # register xmlrpc methods
        arg_0.add_xmlrpc_method(RPCInterface, attr='generate_token', endpoint='api', method='generate_token')
        arg_0.add_xmlrpc_method(RPCInterface, attr='revoke_token', endpoint='api', method='revoke_token')
        arg_0.add_xmlrpc_method(RPCInterface, attr='revoke_all_tokens', endpoint='api', method='revoke_all_tokens')
        arg_0.add_xmlrpc_method(RPCInterface, attr='register_service', endpoint='api', method='register_service')
        arg_0.add_xmlrpc_method(RPCInterface, attr='unregister_service', endpoint='api', method='unregister_service')
        arg_0.add_xmlrpc_method(RPCInterface, attr='get_service_by_name', endpoint='api', method='get_service_by_name')
        arg_0.add_xmlrpc_method(RPCInterface, attr='get_service_by_url', endpoint='api', method='get_service_by_url')
        arg_0.add_xmlrpc_method(RPCInterface, attr='clear_services', endpoint='api', method='clear_services')
        arg_0.add_xmlrpc_method(RPCInterface, attr='list_services', endpoint='api', method='list_services')

The callable makes it possible to include rpcinterface in a Pyramid application .


(group_name, users=True, client=None, **kwargs)

def Func ( arg_0 , arg_1 = True , arg_2 = None , ** arg_3 ) : arg_4 = arg_2 . Func ( GroupName = arg_0 , ** arg_3 ) if arg_1 : if arg_4 . get ( 'IsTruncated' ) : arg_5 = { 'GroupName' : arg_0 } arg_5 . update ( arg_3 ) arg_6 = arg_4 [ 'Users' ] arg_5 [ 'Marker' ] = arg_4 [ 'Marker' ] arg_4 [ 'Users' ] = arg_6 + _get_users_for_group ( arg_2 , ** arg_5 ) else : arg_4 . pop ( 'Users' , None ) arg_4 . pop ( 'IsTruncated' , None ) arg_4 . pop ( 'Marker' , None ) return arg_4

def Func(arg_0, arg_1=True, arg_2=None, **arg_3):
    """Get's the IAM Group details.

    :param group_name:
    :param users: Optional -- will return the IAM users that the group is attached to if desired (paginated).
    :param client:
    :param kwargs:
    :return:
    """
    # First, make the initial call to get the details for the group:
    arg_4 = arg_2.Func(GroupName=arg_0, **arg_3)

    # If we care about the user details, then fetch them:
    if arg_1:
        if arg_4.get('IsTruncated'):
            arg_5 = {'GroupName': arg_0}
            arg_5.update(arg_3)

            arg_6 = arg_4['Users']
            arg_5['Marker'] = arg_4['Marker']

            arg_4['Users'] = arg_6 + _get_users_for_group(arg_2, **arg_5)

    else:
        arg_4.pop('Users', None)
        arg_4.pop('IsTruncated', None)
        arg_4.pop('Marker', None)

    return arg_4


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
==
SIMPLE
:
arg_6
=
[
i
(
arg_1
)
for
i
in
arg_0
.
HeatCapacityGases
]
return
mixing_simple
(
arg_3
,
arg_6
)
else
:
raise
Exception
(
'Method not valid'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func heat capacity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        P : float
            Pressure at which to Func the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        Cpgm : float
            Molar heat capacity of the gas mixture at the given conditions,
            [J/mol]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1) for i in arg_0.HeatCapacityGases]
            return mixing_simple(arg_3, arg_6)
        else:
            raise Exception('Method not valid')

r'''Method to calculate heat capacity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        Cpgm : float
            Molar heat capacity of the gas mixture at the given conditions,
            [J/mol]

r Method to calculate heat capacity of a gas mixture at temperature T pressure P mole fractions zs and weight fractions ws with a given method .


def Func ( arg_0 , arg_1 ) : if hasattr ( arg_0 , 'feature_table' ) : arg_0 . feature_table . _sdf_to_csr ( ) pickle . dump ( arg_0 , open ( arg_1 , 'wb' ) , - 1 ) if hasattr ( arg_0 , 'feature_table' ) : arg_0 . feature_table . _csr_to_sdf ( )

def Func(arg_0, arg_1):
        """ Pickle the Dataset instance to the provided file.
        """
        if hasattr(arg_0, 'feature_table'):
            arg_0.feature_table._sdf_to_csr()

        pickle.dump(arg_0, open(arg_1, 'wb'), -1)

        if hasattr(arg_0, 'feature_table'):
            arg_0.feature_table._csr_to_sdf()

Pickle the Dataset instance to the provided file .


the client will announce itself given that a command is not in a
           particular predefined list.

def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None : if arg_1 not in [ 'get' ] and arg_0 . quiet is False : arg_0 . speak ( )

def Func(arg_0, arg_1=None):
        '''the client will Func itself given that a command is not in a
           particular predefined list.
        '''
        if arg_1 is not None:
            if arg_1 not in ['get'] and arg_0.quiet is False:
                arg_0.speak()

the client will announce itself given that a command is not in a particular predefined list .


return {'http': nginx_http_config, 'stream': nginx_stream_config}

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = "" , "" for arg_4 in arg_0 [ 'nginx' ] : if arg_4 [ 'type' ] == 'http' : arg_2 += _nginx_http_spec ( arg_4 , arg_1 ) elif arg_4 [ 'type' ] == 'stream' : arg_3 += _nginx_stream_spec ( arg_4 , arg_1 ) return { 'http' : arg_2 , 'stream' : arg_3 }

def Func(arg_0, arg_1):
    """This function will take in a port spec as specified by the port_spec compiler and
    will output an nginx web proxy config string. This string can then be written to a file
    and used running nginx """
    arg_2, arg_3 = "", ""
    for arg_4 in arg_0['nginx']:
        if arg_4['type'] == 'http':
            arg_2 += _nginx_http_spec(arg_4, arg_1)
        elif arg_4['type'] == 'stream':
            arg_3 += _nginx_stream_spec(arg_4, arg_1)
    return {'http': arg_2, 'stream': arg_3}

This function will take in a port spec as specified by the port_spec compiler and will output an nginx web proxy config string . This string can then be written to a file and used running nginx


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_1
if
range
is
not
:
arg_3
+=
" "
+
utils
.
unparse_msgid_range
(
arg_2
)
arg_4
,
arg_5
=
arg_0
.
command
(
"XHDR"
,
arg_3
)
if
arg_4
!=
221
:
raise
NNTPReplyError
(
arg_4
,
arg_5
)
return
arg_0
.
info
(
arg_4
,
arg_5
)

def Func(arg_0, arg_1, arg_2=None):
        """XHDR command.
        """
        arg_3 = arg_1
        if range is not None:
            arg_3 += " " + utils.unparse_msgid_range(arg_2)

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

        return arg_0.info(arg_4, arg_5)


def Func(arg_0, arg_1, arg_2=None):
        """
        Computes the resulting metadata statement from a compounded metadata
        statement.
        If something goes wrong during the evaluation an exception is raised

        :param metadata: The compounded metadata statement as a dictionary
        :return: A list of :py:class:`fedoidc.operator.LessOrEqual`
            instances, one per FO.
        """

        # start from the innermost metadata statement and work outwards

        arg_3 = dict([(k, v) for k, v in arg_1.items() if k not in IgnoreKeys])

        arg_4 = []

        if 'metadata_statements' in arg_1:
            for arg_5, arg_6 in arg_1['metadata_statements'].items():
                if isinstance(arg_6, str):
                    arg_6 = json.loads(arg_6)
                for arg_7 in arg_0.Func(arg_6):
                    if isinstance(arg_6, Message):
                        arg_8 = LessOrEqual(sup=arg_7, **arg_6.to_dict())
                    else:  # Must be a dict
                        arg_8 = LessOrEqual(sup=arg_7, **arg_6)

                    if arg_8.is_expired():
                        logger.error(
                            'This metadata statement has expired: {}'.format(arg_6)
                        )
                        logger.info('My time: {}'.format(utc_time_sans_frac()))
                        continue
                    arg_8.eval(arg_3)
                    arg_4.append(arg_8)
            return arg_4
        else:  # this is the innermost
            try:
                arg_9 = arg_1['iss']
            except:
                arg_8 = LessOrEqual()
                arg_8.eval(arg_3)
            else:
                arg_8 = LessOrEqual(iss=arg_9, exp=arg_1['exp'])
                arg_8.eval(arg_3)
            arg_4.append(arg_8)
            return arg_4

Computes the resulting metadata statement from a compounded metadata statement . If something goes wrong during the evaluation an exception is raised


def Func ( arg_0 , arg_1 ) : StreamBase . Func ( arg_0 , arg_1 ) if arg_0 . initiator : if arg_1 . from_jid : arg_1 . from_jid = None else : if not arg_1 . from_jid : arg_1 . from_jid = arg_0 . me

def Func(arg_0, arg_1):
        """Fix outgoing stanza.

        On a client clear the sender JID. On a server set the sender
        address to the own JID if the address is not set yet."""
        StreamBase.Func(arg_0, arg_1)
        if arg_0.initiator:
            if arg_1.from_jid:
                arg_1.from_jid = None
        else:
            if not arg_1.from_jid:
                arg_1.from_jid = arg_0.me


def Func(arg_0, **arg_1):
        """
        Get the cast & crew Func for a TV season by season number.

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

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

Get the cast & crew credits for a TV season by season number.

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

Get the cast & crew credits for a TV season by season number .


return build('ml', 'v1', http=authed_http, cache_discovery=False)

def Func ( arg_0 ) : arg_1 = arg_0 . _authorize ( ) return build ( 'ml' , 'v1' , http = arg_1 , cache_discovery = False )

def Func(arg_0):
        """
        Returns a Google MLEngine service object.
        """
        arg_1 = arg_0._authorize()
        return build('ml', 'v1', http=arg_1, cache_discovery=False)

Returns a Google MLEngine service object .


return [list(_.values()) for _ in six.itervalues(patterns)]

def Func ( arg_0 ) : arg_1 = defaultdict ( lambda : defaultdict ( list ) ) for arg_2 , arg_3 in zip ( * arg_0 . to_event_values ( ) ) : arg_4 = arg_3 [ 'pattern_id' ] arg_5 = arg_3 [ 'occurrence_id' ] arg_6 = ( arg_2 , arg_3 [ 'midi_pitch' ] ) arg_1 [ arg_4 ] [ arg_5 ] . append ( arg_6 ) return [ list ( arg_7 . values ( ) ) for arg_7 in six . itervalues ( arg_1 ) ]

def Func(arg_0):
    '''Convert a pattern_jku annotation object to mir_eval format.

    Parameters
    ----------
    ann : jams.Annotation
        Must have `namespace='pattern_jku'`

    Returns
    -------
    patterns : list of list of tuples
        - `patterns[x]` is a list containing all occurrences of pattern x

        - `patterns[x][y]` is a list containing all notes for
           occurrence y of pattern x

        - `patterns[x][y][z]` contains a time-note tuple
          `(time, midi note)`
    '''

    # It's easier to work with dictionaries, since we can't assume
    # sequential pattern or occurrence identifiers

    arg_1 = defaultdict(lambda: defaultdict(list))

    # Iterate over the data in interval-value format

    for arg_2, arg_3 in zip(*arg_0.to_event_values()):

        arg_4 = arg_3['pattern_id']
        arg_5 = arg_3['occurrence_id']
        arg_6 = (arg_2, arg_3['midi_pitch'])

        # Push this note observation into the correct pattern/occurrence
        arg_1[arg_4][arg_5].append(arg_6)

    # Convert to list-list-tuple format for mir_eval
    return [list(arg_7.values()) for arg_7 in six.itervalues(arg_1)]

Convert a pattern_jku annotation object to mir_eval format .


return (LSTMStateTuple(self._num_units, self._num_units) if self._state_is_tuple else 2 * self._num_units)

def Func(arg_0):
        """State size of the LSTMStateTuple."""
        return (LSTMStateTuple(arg_0._num_units, arg_0._num_units) if arg_0._state_is_tuple else 2 * arg_0._num_units)


def Func ( arg_0 ) : if arg_0 . _user_id is None : arg_0 . _user_id = arg_0 . get_user_data ( ) [ 'id' ] return arg_0 . _user_id

def Func(arg_0):
		'Returns "id" of a OneDrive user.'
		if arg_0._user_id is None:
			arg_0._user_id = arg_0.get_user_data()['id']
		return arg_0._user_id


(self, parent_traj_node, load_data, with_links, recursive,
                         max_depth, current_depth, trajectory, as_new, hdf5_group)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                         arg_5, arg_6, arg_7, arg_8, arg_9):
        """Loads a node from hdf5 file and if desired recursively everything below

        :param parent_traj_node: The parent node whose child should be loaded
        :param load_data: How to load the data
        :param with_links: If links should be loaded
        :param recursive: Whether loading recursively below hdf5_group
        :param max_depth: Maximum depth
        :param current_depth: Current depth
        :param trajectory: The trajectory object
        :param as_new: If trajectory is loaded as new
        :param hdf5_group: The hdf5 group containing the child to be loaded

        """
        if arg_5 is None:
            arg_5 = float('inf')

        arg_10 = [(arg_1, arg_6, arg_9)]

        while arg_10:
            arg_1, arg_6, arg_9 = arg_10.pop()

            if isinstance(arg_9, pt.link.SoftLink):
                if arg_3:
                    # We end up here when auto-loading a soft link
                    arg_0._tree_load_link(arg_1, arg_2=arg_2, traj=arg_7,
                                         arg_8=arg_8, hdf5_soft_link=arg_9)
                continue

            arg_11 = arg_9._v_name
            arg_12 = arg_0._all_get_from_attrs(arg_9, HDF5StorageService.LEAF)
            arg_13 = arg_11 in arg_1._children

            if arg_12:
                # In case we have a leaf node, we need to check if we have to create a new
                # parameter or result

                if arg_13:
                    arg_14 = arg_1._children[arg_11]
                # Otherwise we need to create a new instance
                else:
                    arg_14 = arg_0._tree_create_leaf(arg_11, arg_7, arg_9)

                    # Add the instance to the trajectory tree
                    arg_1._add_leaf_from_storage(arg_20=(arg_14,), kwargs={})

                arg_0._prm_load_parameter_or_result(arg_14, arg_2=arg_2,
                                                   _hdf5_group=arg_9)
                if arg_8:
                    arg_14._stored = False

            else:
                if arg_13:
                    arg_16 = arg_1._children[arg_11]

                    if arg_2 == pypetconstants.OVERWRITE_DATA:
                        arg_16.v_annotations.f_empty()
                        arg_16.v_comment = ''
                else:
                    if HDF5StorageService.CLASS_NAME in arg_9._v_attrs:
                        arg_18 = arg_0._all_get_from_attrs(arg_9,
                                                              HDF5StorageService.CLASS_NAME)
                        arg_19 = arg_7._create_class(arg_18)
                        arg_14 = arg_7._construct_instance(arg_19, arg_11)
                        arg_20 = (arg_14,)
                    else:
                        arg_20 = (arg_11,)
                    # If the group does not exist create it'
                    arg_16 = arg_1._add_group_from_storage(arg_20=arg_20, kwargs={})

                # Load annotations and comment
                arg_0._grp_load_group(arg_16, arg_2=arg_2, arg_3=arg_3,
                                     arg_4=False, arg_5=arg_5,
                                     _traj=arg_7, _as_new=arg_8,
                                     _hdf5_group=arg_9)

                if arg_4 and arg_6 < arg_5:
                    arg_21 = arg_6 + 1
                    for arg_22 in (arg_9._v_groups, arg_9._v_links):
                        for arg_23 in arg_22:
                            arg_24 = arg_22[arg_23]
                            arg_10.append((arg_16, arg_21, arg_24))


def Func ( ) : arg_0 = None arg_1 = psutil . net_if_addrs ( ) for arg_2 , arg_3 in arg_1 . items ( ) : for arg_4 in arg_3 : if arg_4 . family == socket . AF_INET : arg_5 = ipaddress . ip_address ( arg_4 . address ) if not ( arg_5 . is_link_local or arg_5 . is_loopback ) : arg_0 = str ( arg_5 ) break return arg_0

def Func():
    """
        Gets the IP from the inet interfaces.
    """
    arg_0 = None
    arg_1 = psutil.net_if_addrs()
    for arg_2, arg_3 in arg_1.items():
        for arg_4 in arg_3:
            if arg_4.family == socket.AF_INET:
                arg_5 = ipaddress.ip_address(arg_4.address)
                if not (arg_5.is_link_local or arg_5.is_loopback):
                    arg_0 = str(arg_5)
                    break
    return arg_0


def Func ( arg_0 , arg_1 = True ) : if arg_1 : return arg_0 . _leaves . copy ( ) else : return arg_0 . _leaves

def Func(arg_0, arg_1=True):
        """Returns a dictionary of all leaves hanging immediately below this group.

        :param copy:

            Whether the group's original dictionary or a shallow copy is returned.
            If you want the real dictionary please do not modify it at all!

        :returns: Dictionary of nodes

        """
        if arg_1:
            return arg_0._leaves.copy()
        else:
            return arg_0._leaves

Returns a dictionary of all leaves hanging immediately below this group .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
if
arg_1
:
print
(
"%s\n%s"
%
(
arg_1
,
"'"
*
len
(
arg_1
)
)
,
file
=
arg_0
)
if
arg_3
:
print
(
normalize_text
(
arg_3
,
line_len
=
79
,
indent
=
""
)
,
file
=
arg_0
)
print
(
file
=
arg_0
)
for
arg_4
,
arg_5
,
arg_6
in
arg_2
:
arg_7
=
arg_5
.
get
(
"help"
)
print
(
":%s:"
%
arg_4
,
file
=
arg_0
)
if
arg_7
:
arg_7
=
normalize_text
(
arg_7
,
line_len
=
79
,
indent
=
"  "
)
print
(
arg_7
,
file
=
arg_0
)
if
arg_6
:
arg_6
=
str
(
_format_option_value
(
arg_5
,
arg_6
)
)
print
(
file
=
arg_0
)
print
(
"  Default: ``%s``"
%
arg_6
.
replace
(
"`` "
,
"```` ``"
)
,
file
=
arg_0
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """format an options section using as ReST formatted output"""
    if arg_1:
        print("%s\n%s" % (arg_1, "'" * len(arg_1)), file=arg_0)
    if arg_3:
        print(normalize_text(arg_3, line_len=79, indent=""), file=arg_0)
        print(file=arg_0)
    for arg_4, arg_5, arg_6 in arg_2:
        arg_7 = arg_5.get("help")
        print(":%s:" % arg_4, file=arg_0)
        if arg_7:
            arg_7 = normalize_text(arg_7, line_len=79, indent="  ")
            print(arg_7, file=arg_0)
        if arg_6:
            arg_6 = str(_format_option_value(arg_5, arg_6))
            print(file=arg_0)
            print("  Default: ``%s``" % arg_6.replace("`` ", "```` ``"), file=arg_0)


def
Func
(
arg_0
)
:
if
arg_0
is
:
raise
X10InvalidHouseCode
(
'%r is not a valid house code'
%
arg_0
)
if
not
isinstance
(
arg_0
,
basestring
)
:
raise
X10InvalidHouseCode
(
'%r is not a valid house code'
%
arg_0
)
if
len
(
arg_0
)
!=
1
:
raise
X10InvalidHouseCode
(
'%r is not a valid house code'
%
arg_0
)
arg_0
=
arg_0
.
upper
(
)
if
not
(
'A'
<=
arg_0
<=
'P'
)
:
raise
X10InvalidHouseCode
(
'%r is not a valid house code'
%
arg_0
)
return
arg_0

def Func(arg_0):
    """Returns a normalized house code, i.e. upper case.
    Raises exception X10InvalidHouseCode if house code appears to be invalid
    """
    if arg_0 is None:
        raise X10InvalidHouseCode('%r is not a valid house code' % arg_0)
    if not isinstance(arg_0, basestring):
        raise X10InvalidHouseCode('%r is not a valid house code' % arg_0)
    if len(arg_0) != 1:
        raise X10InvalidHouseCode('%r is not a valid house code' % arg_0)
    arg_0 = arg_0.upper()
    if not ('A' <= arg_0 <= 'P'):
        raise X10InvalidHouseCode('%r is not a valid house code' % arg_0)
    return arg_0

Returns a normalized house code i . e . upper case . Raises exception X10InvalidHouseCode if house code appears to be invalid


def
Func
(
)
:
from
.
import
log
arg_0
=
logging
.
getLogger
(
"gromacs"
)
arg_0
.
info
(
"GromacsWrapper %s STOPPED logging"
,
get_version
(
)
)
log
.
clear_handlers
(
arg_0
)

def Func():
    """Stop logging to logfile and console."""
    from . import log
    arg_0 = logging.getLogger("gromacs")
    arg_0.info("GromacsWrapper %s STOPPED logging", get_version())
    log.clear_handlers(arg_0)


def Func ( ) : arg_0 = { loc_A : None , loc_B : None } def program ( ( arg_1 , arg_2 ) ) : arg_0 [ arg_1 ] = arg_2 if arg_0 [ loc_A ] == arg_0 [ loc_B ] == 'Clean' : return 'NoOp' elif arg_2 == 'Dirty' : return 'Suck' elif arg_1 == loc_A : return 'Right' elif arg_1 == loc_B : return 'Left' return Agent ( program )

def Func():
    "An agent that keeps track of what locations are clean or dirty."
    arg_0 = {loc_A: None, loc_B: None}
    def program((arg_1, arg_2)):
        "Same as ReflexVacuumAgent, except if everything is clean, do NoOp."
        arg_0[arg_1] = arg_2 ## Update the model here
        if arg_0[loc_A] == arg_0[loc_B] == 'Clean': return 'NoOp'
        elif arg_2 == 'Dirty': return 'Suck'
        elif arg_1 == loc_A: return 'Right'
        elif arg_1 == loc_B: return 'Left'
    return Agent(program)

An agent that keeps track of what locations are clean or dirty .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _perform_request ( url = '/datacenters/%s' % ( arg_1 ) , method = 'DELETE' ) return arg_2

def Func(arg_0, arg_1):
        """
        Removes the data center and all its components such as servers, NICs,
        load balancers, volumes.

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

        """
        arg_2 = arg_0._perform_request(
            url='/datacenters/%s' % (arg_1),
            method='DELETE')

        return arg_2

Removes the data center and all its components such as servers NICs load balancers volumes .


def Func ( arg_0 , arg_1 : arg_2 ) -> None : if 'bio2bel' not in arg_1 . annotation_list : arg_1 . annotation_list [ 'bio2bel' ] = set ( ) arg_1 . annotation_list [ 'bio2bel' ] . add ( arg_0 . module_name )

def Func(arg_0, arg_1: arg_2) -> None:
        """Add this manager as an annotation to the graph."""
        if 'bio2bel' not in arg_1.annotation_list:
            arg_1.annotation_list['bio2bel'] = set()

        arg_1.annotation_list['bio2bel'].add(arg_0.module_name)

Add this manager as an annotation to the graph .


def Func(arg_0, arg_1, arg_2):
    """
    Get the data sharing consent object associated with a certain user of a customer for a program.

    :param username: The user that grants consent.
    :param program_uuid: The program for which consent is granted.
    :param enterprise_customer_uuid: The consent requester.
    :return: The data sharing consent object
    """
    arg_3 = get_enterprise_customer(arg_2)
    arg_4 = CourseCatalogApiServiceClient(arg_3.site)
    arg_5 = arg_4.get_program_course_keys(arg_1)
    arg_6 = (
        get_data_sharing_consent(arg_0, arg_2, course_id=individual_course_id)
        for individual_course_id in arg_5
    )
    return ProxyDataSharingConsent.from_children(arg_1, *arg_6)

Get the data sharing consent object associated with a certain user of a customer for a program .


return np.dot(np.dot(cob, data), cob.conj().T) / 2**num_qubits

def Func(arg_0, arg_1):
    """Change of basis of bipartite matrix represenation."""
    # Change basis: sum_{i=0}^3 =|\sigma_i>><i|
    arg_2 = np.array(
        [[1, 0, 0, 1], [0, 1, 1j, 0], [0, 1, -1j, 0], [1, 0j, 0, -1]],
        dtype=complex)
    # Note that we manually renormalized after change of basis
    # to avoid rounding errors from square-roots of 2.
    arg_3 = arg_2
    for arg_4 in range(arg_1 - 1):
        arg_5 = int(np.sqrt(len(arg_3)))
        arg_3 = np.reshape(
            np.transpose(
                np.reshape(
                    np.kron(arg_2, arg_3), (2, 2, arg_5, arg_5, 4, arg_5 * arg_5)),
                (0, 2, 1, 3, 4, 5)), (4 * arg_5 * arg_5, 4 * arg_5 * arg_5))
    return np.dot(np.dot(arg_3, arg_0), arg_3.conj().T) / 2**arg_1

Change of basis of bipartite matrix represenation .


def Func(arg_0, arg_1, arg_2):
    """solve Tx=Z by a variation of Levinson algorithm where T
    is a complex hermitian toeplitz matrix

    :param T0: zero lag value
    :param T: r1 to rN

    :return: X

    used by eigen PSD method
    """
    assert len(arg_1)>0
    arg_3 = len(arg_1)
    arg_4 = numpy.zeros(arg_3+1,dtype=complex)
    arg_5 = numpy.zeros(arg_3,dtype=complex)
    arg_6 = arg_0
    if arg_6 == 0: raise ValueError("P must be different from zero")
    arg_4[0] = arg_2[0]/arg_0
    for arg_7 in range(0, arg_3):
        arg_8 = arg_1[arg_7]
        arg_9 = arg_4[0]*arg_1[arg_7]
        if arg_7 == 0:
            arg_10 = -arg_8 / arg_6
        else:
            for arg_11 in range(0, arg_7):
                arg_8 = arg_8 + arg_5[arg_11] * arg_1[arg_7-arg_11-1]
                arg_9 = arg_9 + arg_4[arg_11+1] * arg_1[arg_7-arg_11-1]
            arg_10 = -arg_8 / arg_6
        arg_6 = arg_6 * (1. - (arg_10.real**2+arg_10.imag**2))
        if arg_6 <= 0:
            raise ValueError("singular matrix")
        arg_5[arg_7] = arg_10
        arg_12 = (arg_2[arg_7+1]-arg_9)/arg_6

        if arg_7 == 0:
            #print 'skipping code for k=0'
            arg_4[arg_7+1] = arg_12
            for arg_11 in range(0,arg_7+1):
                arg_4[arg_11] = arg_4[arg_11] + arg_12 * arg_5[arg_7-arg_11].conjugate()
            continue
        arg_13 = (arg_7+1)//2
        for arg_11 in range(0, arg_13):
            arg_14 = arg_7-arg_11-1
            arg_8=arg_5[arg_11]
            arg_5[arg_11] = arg_8+arg_10*arg_5[arg_14].conjugate()
            if arg_11 != arg_14:
                arg_5[arg_14] = arg_5[arg_14] + arg_10*arg_8.conjugate()
        arg_4[arg_7+1] = arg_12
        for arg_11 in range(0,arg_7+1):
            arg_4[arg_11] = arg_4[arg_11] + arg_12 * arg_5[arg_7-arg_11].conjugate()
    return arg_4

solve Tx = Z by a variation of Levinson algorithm where T is a complex hermitian toeplitz matrix


def Func ( arg_0 , arg_1 = "r" , arg_2 = True ) : with open ( arg_0 , arg_1 ) as filey : if arg_2 is True : arg_3 = filey . readlines ( ) else : arg_3 = filey . read ( ) return arg_3

def Func(arg_0, arg_1="r", arg_2=True):
    '''write_file will open a file, "filename" and write content, "content"
       and properly close the file
    '''
    with open(arg_0, arg_1) as filey:
        if arg_2 is True:
            arg_3 = filey.readlines()
        else:
            arg_3 = filey.read()
    return arg_3

write_file will open a file filename and write content content and properly close the file


def Func ( arg_0 ) : arg_1 = { arg_0 . _run_object } try : with open ( arg_0 . _run_object , 'rb' ) as srcfile , _CodeEventsTracker ( arg_1 ) as prof : arg_2 = compile ( srcfile . read ( ) , arg_0 . _run_object , 'exec' ) prof . compute_mem_overhead ( ) exec ( arg_2 , arg_0 . _globs , None ) except SystemExit : pass return prof , None

def Func(arg_0):
        """Returns memory stats for a module."""
        arg_1 = {arg_0._run_object}
        try:
            with open(arg_0._run_object, 'rb') as srcfile,\
                _CodeEventsTracker(arg_1) as prof:
                arg_2 = compile(srcfile.read(), arg_0._run_object, 'exec')
                prof.compute_mem_overhead()
                exec(arg_2, arg_0._globs, None)
        except SystemExit:
            pass
        return prof, None


return self.request(id, "stable", json=revert_json, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = { "JobID" : arg_1 , "JobVersion" : arg_2 , "Stable" : arg_3 } return arg_0 . request ( arg_1 , "stable" , json = arg_4 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        """ This endpoint sets the job's stability.

           https://www.nomadproject.io/docs/http/job.html

            arguments:
              - id
              - version, Specifies the job version to revert to.
              - stable, Specifies whether the job should be marked as stable or not.
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_4 = {"JobID": arg_1,
                       "JobVersion": arg_2,
                       "Stable": arg_3}
        return arg_0.request(arg_1, "stable", json=arg_4, method="post").json()

This endpoint sets the job s stability .


def Func ( arg_0 ) : arg_0 . __iterator , arg_0 . __saved = itertools . tee ( arg_0 . __saved )

def Func(arg_0):
		"""
		Resets the iterator to the start.

		Any remaining values in the current iteration are discarded.
		"""
		arg_0.__iterator, arg_0.__saved = itertools.tee(arg_0.__saved)


def Func(arg_0, arg_1):
        """
        Given a potentially complex type, split it into its base type and specializers
        """

        arg_2 = arg_0._canonicalize_type(arg_1)
        if '(' not in arg_2:
            return arg_2, False, []

        arg_3, arg_4 = arg_2.split('(')
        if len(arg_4) == 0 or arg_4[-1] != ')':
            raise ArgumentError("syntax error in complex type, no matching ) found", passed_type=arg_1, basetype=arg_3, subtype_string=arg_4)

        arg_4 = arg_4[:-1]

        arg_5 = arg_4.split(',')
        return arg_3, True, arg_5

Given a potentially complex type split it into its base type and specializers


def Func ( arg_0 , arg_1 ) : arg_2 = ET . Element ( 'xs:schema' ) arg_2 . set ( 'xmlns:xs' , 'http://www.w3.org/2001/XMLSchema' ) arg_3 = lambda selected : ooaofooa . is_global ( selected ) for arg_4 in arg_0 . select_many ( 'S_DT' , arg_3 ) : arg_5 = build_type ( arg_4 ) if arg_5 is not None : arg_2 . append ( arg_5 ) arg_6 = lambda selected : ooaofooa . is_contained_in ( selected , arg_1 ) for arg_4 in arg_0 . select_many ( 'S_DT' , arg_6 ) : arg_5 = build_type ( arg_4 ) if arg_5 is not None : arg_2 . append ( arg_5 ) arg_7 = build_component ( arg_0 , arg_1 ) arg_2 . append ( arg_7 ) return arg_2

def Func(arg_0, arg_1):
    '''
    Build an xsd schema from a bridgepoint component.
    '''
    arg_2 = ET.Element('xs:schema')
    arg_2.set('xmlns:xs', 'http://www.w3.org/2001/XMLSchema')

    arg_3 = lambda selected: ooaofooa.is_global(selected)
    for arg_4 in arg_0.select_many('S_DT', arg_3):
        arg_5 = build_type(arg_4)
        if arg_5 is not None:
            arg_2.append(arg_5)

    arg_6 = lambda selected: ooaofooa.is_contained_in(selected, arg_1)
    for arg_4 in arg_0.select_many('S_DT', arg_6):
        arg_5 = build_type(arg_4)
        if arg_5 is not None:
            arg_2.append(arg_5)

    arg_7 = build_component(arg_0, arg_1)
    arg_2.append(arg_7)

    return arg_2

Build an xsd schema from a bridgepoint component .


def Func(arg_0, arg_1):
    """Return zoom level as integer or throw error."""
    try:
        return int(arg_0.strip(arg_1))
    except Exception as e:
        raise MapcheteConfigError("zoom level could not be determined: %s" % e)

Return zoom level as integer or throw error .


(self, train, valid=None, algo='rmsprop', subalgo='rmsprop',
                  save_every=0, save_progress=None, **kwargs)

def Func(arg_0, arg_1, arg_2=None, arg_3='rmsprop', arg_4='rmsprop',
                  arg_5=0, arg_6=None, **arg_7):
        '''Train our network, one batch at a time.

        This method yields a series of ``(train, valid)`` monitor pairs. The
        ``train`` value is a dictionary mapping names to monitor values
        evaluated on the training dataset. The ``valid`` value is also a
        dictionary mapping names to values, but these values are evaluated on
        the validation dataset.

        Because validation might not occur every training iteration, the
        validation monitors might be repeated for multiple training iterations.
        It is probably most helpful to think of the validation monitors as being
        the "most recent" values that have been computed.

        After training completes, the network attribute of this class will
        contain the trained network parameters.

        Parameters
        ----------
        train : :class:`Dataset <downhill.dataset.Dataset>` or list
            A dataset to use when training the network. If this is a
            ``downhill.Dataset`` instance, it will be used directly as the
            training datset. If it is a list of numpy arrays or a list of
            callables, it will be converted to a ``downhill.Dataset`` and then
            used as the training set.
        valid : :class:`Dataset <downhill.dataset.Dataset>` or list, optional
            If this is provided, it will be used as a validation dataset. If not
            provided, the training set will be used for validation. (This is not
            recommended!)
        algo : str, optional
            An optimization algorithm to use for training our network. If not
            provided, :class:`RMSProp <downhill.adaptive.RMSProp>` will be used.
        subalgo : str, optional
            An optimization algorithm to use for a trainer that requires a
            "sub-algorithm," sugh as an unsupervised pretrainer. Defaults to
            :class:`RMSProp <downhill.adaptive.RMSProp>`.
        save_every : int or float, optional
            If this is nonzero and ``save_progress`` is not None, then the model
            being trained will be saved periodically. If this is a float, it is
            treated as a number of minutes to wait between savings. If it is an
            int, it is treated as the number of training epochs to wait between
            savings. Defaults to 0.
        save_progress : str or file handle, optional
            If this is not None, and ``save_progress`` is nonzero, then save the
            model periodically during training. This parameter gives either (a)
            the full path of a file to save the model, or (b) a file-like object
            where the model should be saved. If it is a string and the given
            name contains a "{}" format specifier, it will be filled with the
            integer Unix timestamp at the time the model is saved. Defaults to
            None, which does not save models.

        Yields
        ------
        training : dict
            A dictionary of monitor values computed using the training dataset,
            at the conclusion of training. This dictionary will at least contain
            a 'loss' key that indicates the value of the loss function. Other
            keys may be available depending on the trainer being used.
        validation : dict
            A dictionary of monitor values computed using the validation
            dataset, at the conclusion of training.
        '''
        if 'rng' not in arg_7:
            arg_7['rng'] = arg_0._rng

        def create_dataset(arg_8, **arg_7):
            arg_9 = arg_7.get('name', 'dataset')
            arg_10 = '{}_batches'.format(arg_9)
            return downhill.Dataset(
                arg_8,
                arg_9=arg_9,
                batch_size=arg_7.get('batch_size', 32),
                iteration_size=arg_7.get('iteration_size', arg_7.get(arg_10)),
                axis=arg_7.get('axis', 0),
                rng=arg_7['rng'])

        # set up datasets ...
        if arg_2 is None:
            arg_2 = arg_1
        if not isinstance(arg_2, downhill.Dataset):
            arg_2 = create_dataset(arg_2, arg_9='valid', **arg_7)
        if not isinstance(arg_1, downhill.Dataset):
            arg_1 = create_dataset(arg_1, arg_9='train', **arg_7)

        if 'algorithm' in arg_7:
            warnings.warn(
                'please use the "algo" keyword arg instead of "algorithm"',
                DeprecationWarning)
            arg_3 = arg_7.pop('algorithm')
            if isinstance(arg_3, (list, tuple)):
                arg_3 = arg_3[0]

        # set up trainer ...
        if isinstance(arg_3, util.basestring):
            arg_3 = arg_3.lower()
            if arg_3 == 'sample':
                arg_3 = trainer.SampleTrainer(arg_0)
            elif arg_3.startswith('layer') or arg_3.startswith('sup'):
                arg_3 = trainer.SupervisedPretrainer(arg_4, arg_0)
            elif arg_3.startswith('pre') or arg_3.startswith('unsup'):
                arg_3 = trainer.UnsupervisedPretrainer(arg_4, arg_0)
            else:
                arg_3 = trainer.DownhillTrainer(arg_3, arg_0)

        # set up check to save model ...
        def needs_saving(arg_11, arg_12):
            if arg_6 is None:
                return False
            if isinstance(arg_5, float):
                return arg_11 > 60 * arg_5
            if isinstance(arg_5, int):
                return arg_12 % arg_5 == 0
            return False

        # train it!
        arg_13 = time.time()
        for arg_14, arg_15 in enumerate(arg_3.Func(arg_1, arg_2, **arg_7)):
            yield arg_15
            arg_16 = time.time()
            if arg_14 and needs_saving(arg_16 - arg_13, arg_14):
                arg_17 = arg_6
                if isinstance(arg_17, util.basestring):
                    arg_17 = arg_6.format(int(arg_16))
                arg_0.save(arg_17)
                arg_13 = arg_16


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
int
)
or
arg_1
<
1
:
raise
ParameterError
(
"order must be an integer > 0"
)
util
.
valid_audio
(
arg_0
,
mono
=
True
)
return
__Func
(
arg_0
,
arg_1
)

def Func(arg_0, arg_1):
    """Linear Prediction Coefficients via Burg's method

    This function applies Burg's method to estimate coefficients of a linear
    filter on `y` of order `order`.  Burg's method is an extension to the
    Yule-Walker approach, which are both sometimes referred to as LPC parameter
    estimation by autocorrelation.

    It follows the description and implementation approach described in the
    introduction in [1]_.  N.B. This paper describes a different method, which
    is not implemented here, but has been chosen for its clear explanation of
    Burg's technique in its introduction.

    .. [1] Larry Marple
           A New Autoregressive Spectrum Analysis Algorithm
           IEEE Transactions on Accoustics, Speech, and Signal Processing
           vol 28, no. 4, 1980

    Parameters
    ----------
    y : np.ndarray
        Time series to fit

    order : int > 0
        Order of the linear filter

    Returns
    -------
    a : np.ndarray of length order + 1
        LP prediction error coefficients, i.e. filter denominator polynomial

    Raises
    ------
    ParameterError
        - If y is not valid audio as per `util.valid_audio`
        - If order < 1 or not integer
    FloatingPointError
        - If y is ill-conditioned

    See also
    --------
    scipy.signal.lfilter

    Examples
    --------
    Compute LP coefficients of y at order 16 on entire series

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=30,
    ...                      duration=10)
    >>> librosa.Func(y, 16)

    Compute LP coefficients, and plot LP estimate of original series

    >>> import matplotlib.pyplot as plt
    >>> import scipy
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=30,
    ...                      duration=0.020)
    >>> a = librosa.Func(y, 2)
    >>> y_hat = scipy.signal.lfilter([0] + -1*a[1:], [1], y)
    >>> plt.figure()
    >>> plt.plot(y)
    >>> plt.plot(y_hat)
    >>> plt.legend(['y', 'y_hat'])
    >>> plt.title('LP Model Forward Prediction')

    """
    if not isinstance(arg_1, int) or arg_1 < 1:
        raise ParameterError("order must be an integer > 0")

    util.valid_audio(arg_0, mono=True)

    return __Func(arg_0, arg_1)

Linear Prediction Coefficients via Burg's method

    This function applies Burg's method to estimate coefficients of a linear
    filter on `y` of order `order`.  Burg's method is an extension to the
    Yule-Walker approach, which are both sometimes referred to as LPC parameter
    estimation by autocorrelation.

    It follows the description and implementation approach described in the
    introduction in [1]_.  N.B. This paper describes a different method, which
    is not implemented here, but has been chosen for its clear explanation of
    Burg's technique in its introduction.

    .. [1] Larry Marple
           A New Autoregressive Spectrum Analysis Algorithm
           IEEE Transactions on Accoustics, Speech, and Signal Processing
           vol 28, no. 4, 1980

    Parameters
    ----------
    y : np.ndarray
        Time series to fit

    order : int > 0
        Order of the linear filter

    Returns
    -------
    a : np.ndarray of length order + 1
        LP prediction error coefficients, i.e. filter denominator polynomial

    Raises
    ------
    ParameterError
        - If y is not valid audio as per `util.valid_audio`
        - If order < 1 or not integer
    FloatingPointError
        - If y is ill-conditioned

    See also
    --------
    scipy.signal.lfilter

    Examples
    --------
    Compute LP coefficients of y at order 16 on entire series

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=30,
    ...                      duration=10)
    >>> librosa.lpc(y, 16)

    Compute LP coefficients, and plot LP estimate of original series

    >>> import matplotlib.pyplot as plt
    >>> import scipy
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=30,
    ...                      duration=0.020)
    >>> a = librosa.lpc(y, 2)
    >>> y_hat = scipy.signal.lfilter([0] + -1*a[1:], [1], y)
    >>> plt.figure()
    >>> plt.plot(y)
    >>> plt.plot(y_hat)
    >>> plt.legend(['y', 'y_hat'])
    >>> plt.title('LP Model Forward Prediction')

Linear Prediction Coefficients via Burg s method


(self, valid_features=["pcp", "tonnetz", "mfcc",
                                          "cqt", "tempogram"])

def Func(arg_0, arg_1=["pcp", "tonnetz", "mfcc",
                                          "cqt", "tempogram"]):
        """This method obtains the actual features."""
        # Use specific feature
        if arg_0.feature_str not in arg_1:
            raise RuntimeError("Feature %s in not valid for algorithm: %s "
                               "(valid features are %s)." %
                               (arg_0.feature_str, __name__, arg_1))
        else:
            try:
                arg_2 = arg_0.features.features
            except KeyError:
                raise RuntimeError("Feature %s in not supported by MSAF" %
                                   (arg_0.feature_str))

        return arg_2

This method obtains the actual features .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
False
try
:
arg_3
=
"0150310228"
+
binascii
.
hexlify
(
arg_1
)
+
"2903"
arg_4
=
arg_0
.
calc_crc16
(
arg_3
[
2
:
]
.
decode
(
"hex"
)
)
arg_5
=
arg_3
+
arg_4
arg_0
.
m_serial_port
.
write
(
arg_5
.
decode
(
"hex"
)
)
if
arg_0
.
m_serial_port
.
getResponse
(
arg_0
.
getContext
(
)
)
.
encode
(
"hex"
)
==
"06"
:
ekm_log
(
"Password accepted ("
+
arg_0
.
getContext
(
)
+
")"
)
arg_2
=
True
else
:
ekm_log
(
"Password call failure no 06("
+
arg_0
.
getContext
(
)
+
")"
)
except
:
ekm_log
(
"Password call failure by exception("
+
arg_0
.
getContext
(
)
+
")"
)
ekm_log
(
traceback
.
format_exc
(
sys
.
exc_info
(
)
)
)
return
arg_2

def Func(arg_0, arg_1):
        """ Password step of set commands

        This method is normally called within another serial command, so it
        does not issue a termination string.  Any default password is set
        in the caller parameter list, never here.

        Args:
            password_str (str): Required password.

        Returns:
            bool: True on completion and ACK.
        """
        arg_2 = False
        try:
            arg_3 = "0150310228" + binascii.hexlify(arg_1) + "2903"
            arg_4 = arg_0.calc_crc16(arg_3[2:].decode("hex"))
            arg_5 = arg_3 + arg_4
            arg_0.m_serial_port.write(arg_5.decode("hex"))
            if arg_0.m_serial_port.getResponse(arg_0.getContext()).encode("hex") == "06":
                ekm_log("Password accepted (" + arg_0.getContext() + ")")
                arg_2 = True
            else:
                ekm_log("Password call failure no 06(" + arg_0.getContext() + ")")
        except:
            ekm_log("Password call failure by exception(" + arg_0.getContext() + ")")

            ekm_log(traceback.format_exc(sys.exc_info()))

        return arg_2


return fp.write(writes(nb, format, **kwargs))

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : return arg_1 . Func ( Funcs ( arg_0 , arg_2 , ** arg_3 ) )

def Func(arg_0, arg_1, arg_2, **arg_3):
    """Write a notebook to a file in a given format in the current nbformat version.

    This function always Funcs the notebook in the current nbformat version.

    Parameters
    ----------
    nb : NotebookNode
        The notebook to Func.
    fp : file
        Any file-like object with a Func method.
    format : (u'json', u'ipynb', u'py')
        The format to Func the notebook in.

    Returns
    -------
    s : unicode
        The notebook string.
    """
    return arg_1.Func(Funcs(arg_0, arg_2, **arg_3))

Write a notebook to a file in a given format in the current nbformat version.

    This function always writes the notebook in the current nbformat version.

    Parameters
    ----------
    nb : NotebookNode
        The notebook to write.
    fp : file
        Any file-like object with a write method.
    format : (u'json', u'ipynb', u'py')
        The format to write the notebook in.

    Returns
    -------
    s : unicode
        The notebook string.

Write a notebook to a file in a given format in the current nbformat version .


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

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


def
Func
(
arg_0
,
arg_1
)
:
info
(
"relaying message: {message}"
)
if
not
arg_1
.
was_sent_by
(
arg_0
.
_id_factory
)
:
arg_0
.
pipe
.
send
(
arg_1
)
arg_0
.
pipe
.
deliver
(
)

def Func(arg_0, arg_1):
        """
        Relay messages from the forum on the server to the client represented
        by this actor.
        """
        info("relaying message: {message}")

        if not arg_1.was_sent_by(arg_0._id_factory):
            arg_0.pipe.send(arg_1)
            arg_0.pipe.deliver()

Relay messages from the forum on the server to the client represented by this actor .


return {t.tag: parse_text(t.text) for t in node}

def
Func
(
arg_0
)
:
_LOGGER
.
info
(
"Get traffic meter"
)
def
parse_text
(
arg_1
)
:
def
tofloats
(
arg_2
)
:
return
(
float
(
arg_3
)
for
arg_3
in
arg_2
)
try
:
if
"/"
in
arg_1
:
return
tuple
(
tofloats
(
arg_1
.
split
(
'/'
)
)
)
elif
":"
in
arg_1
:
arg_4
,
arg_5
=
tofloats
(
arg_1
.
split
(
':'
)
)
return
timedelta
(
hours
=
arg_4
,
minutes
=
arg_5
)
else
:
return
float
(
arg_1
)
except
ValueError
:
return
arg_6
,
arg_7
=
arg_0
.
_make_request
(
SERVICE_DEVICE_CONFIG
,
"GetTrafficMeterStatistics"
)
if
not
arg_6
:
return
arg_6
,
arg_8
=
_find_node
(
arg_7
.
text
,
".//GetTrafficMeterStatisticsResponse"
)
if
not
arg_6
:
return
return
{
arg_3
.
tag
:
parse_text
(
arg_3
.
text
)
for
arg_3
in
arg_8
}

def Func(arg_0):
        """
        Return dict of traffic meter stats.

        Returns None if error occurred.
        """
        _LOGGER.info("Get traffic meter")

        def parse_text(arg_1):
            """
                there are three kinds of values in the returned data
                This function parses the different values and returns
                (total, avg), timedelta or a plain float
            """
            def tofloats(arg_2): return (float(arg_3) for arg_3 in arg_2)
            try:
                if "/" in arg_1:  # "6.19/0.88" total/avg
                    return tuple(tofloats(arg_1.split('/')))
                elif ":" in arg_1:  # 11:14 hr:mn
                    arg_4, arg_5 = tofloats(arg_1.split(':'))
                    return timedelta(hours=arg_4, minutes=arg_5)
                else:
                    return float(arg_1)
            except ValueError:
                return None

        arg_6, arg_7 = arg_0._make_request(SERVICE_DEVICE_CONFIG,
                                               "GetTrafficMeterStatistics")
        if not arg_6:
            return None

        arg_6, arg_8 = _find_node(
            arg_7.text,
            ".//GetTrafficMeterStatisticsResponse")
        if not arg_6:
            return None

        return {arg_3.tag: parse_text(arg_3.text) for arg_3 in arg_8}


def
Func
(
arg_0
)
:
if
not
arg_0
.
settings
:
return
try
:
arg_0
.
__index
.
Func
(
arg_0
.
settings
)
logger
.
info
(
'APPLY SETTINGS ON %s'
,
arg_0
.
index_name
)
except
AlgoliaException
as
e
:
if
DEBUG
:
raise
e
else
:
logger
.
warning
(
'SETTINGS NOT APPLIED ON %s: %s'
,
arg_0
.
model
,
e
)

def Func(arg_0):
        """Applies the settings to the index."""
        if not arg_0.settings:
            return

        try:
            arg_0.__index.Func(arg_0.settings)
            logger.info('APPLY SETTINGS ON %s', arg_0.index_name)
        except AlgoliaException as e:
            if DEBUG:
                raise e
            else:
                logger.warning('SETTINGS NOT APPLIED ON %s: %s',
                               arg_0.model, e)


def Func ( arg_0 , arg_1 , arg_2 ) : from numpy import log , array arg_3 = arg_0 * log ( array ( arg_1 ) ) + 2. * ( array ( arg_2 ) + 1 ) return arg_3

def Func(arg_0, arg_1, arg_2):
    r"""Akaike Information Criterion

    :param rho: rho at order k
    :param N: sample size
    :param k: AR order.

    If k is the AR order and N the size of the sample, then Akaike criterion is

    .. math:: Func(k) = \log(\rho_k) + 2\frac{k+1}{N}

    ::

        Func(64, [0.5,0.3,0.2], [1,2,3])

    :validation: double checked versus octave.
    """
    from numpy import log, array
    #k+1 #todo check convention. agrees with octave

    arg_3 = arg_0 * log(array(arg_1)) + 2.* (array(arg_2)+1)
    return arg_3

r"""Akaike Information Criterion

    :param rho: rho at order k
    :param N: sample size
    :param k: AR order.

    If k is the AR order and N the size of the sample, then Akaike criterion is

    .. math:: AIC(k) = \log(\rho_k) + 2\frac{k+1}{N}

    ::

        AIC(64, [0.5,0.3,0.2], [1,2,3])

    :validation: double checked versus octave.


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . seq = arg_0 . seq . replace ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        '''Replaces all occurrences of 'old' with 'new' '''
        arg_0.seq = arg_0.seq.replace(arg_1, arg_2)

Replaces all occurrences of old with new


def Func ( arg_0 , arg_1 = arg_2 ( 'inf' ) ) : arg_3 = os . path . abspath ( arg_0 ) . count ( os . path . sep ) for arg_4 in os . walk ( arg_0 ) : arg_5 , arg_6 , arg_7 = arg_4 arg_8 = arg_5 . count ( os . path . sep ) - arg_3 yield arg_4 if arg_8 >= arg_1 : arg_6 [ : ] = [ ]

def Func(arg_0, arg_1=arg_2('inf')):
	"""Walk a directory tree with configurable depth.

	Parameters:
		path (str): A directory path to walk.

		max_depth (int): The depth in the directory tree to walk.
			A depth of '0' limits the walk to the top directory.
			Default: No limit.
	"""

	arg_3 = os.path.abspath(arg_0).count(os.path.sep)

	for arg_4 in os.walk(arg_0):
		arg_5, arg_6, arg_7 = arg_4
		arg_8 = arg_5.count(os.path.sep) - arg_3

		yield arg_4

		if arg_8 >= arg_1:
			arg_6[:] = []

Walk a directory tree with configurable depth .


def Func(arg_0, arg_1, arg_2=None):
		'''
			Func - Delete one object

			@param obj - object to delete
			@param conn - Connection to reuse, or None

			@return - number of items deleted (0 or 1)
		'''
		if not getattr(arg_1, '_id', None):
			return 0

		if arg_2 is None:
			arg_2 = arg_0._get_connection()
			arg_3 = arg_2.pipeline()
			arg_4 = True
		else:
			arg_3 = arg_2 # In this case, we are inheriting a pipeline
			arg_4 = False

		arg_3.delete(arg_0._get_key_for_id(arg_1._id))
		arg_0._rem_id_from_keys(arg_1._id, arg_3)
		for arg_5 in arg_0.indexedFields:
			arg_0._rem_id_from_index(arg_5, arg_1._id, arg_1._origData[arg_5], arg_3)

		arg_1._id = None

		if arg_4 is True:
			arg_3.execute()

		return 1

deleteOne - Delete one object

			@param obj - object to delete
			@param conn - Connection to reuse, or None

			@return - number of items deleted (0 or 1)


def Func(arg_0, *arg_1, **arg_2):
    """
    Assert that the argument has the specified type.

    This function is used to check that the type of the argument is correct, otherwises it raises an H2OTypeError.
    See more details in the module's help.

    :param var: variable to check
    :param types: the expected types
    :param kwargs:
        message: override the error message
        skip_frames: how many local frames to skip when printing out the error.

    :raises H2OTypeError: if the argument is not of the desired type.
    """
    assert arg_1, "The list of expected types was not provided"
    arg_3 = arg_1[0] if len(arg_1) == 1 else U(*arg_1)
    if _check_type(arg_0, arg_3): return

    # Type check failed => Create a nice error message
    assert set(arg_2).issubset({"message", "skip_frames"}), "Unexpected keyword arguments: %r" % arg_2
    arg_4 = arg_2.get("message", None)
    arg_5 = arg_2.get("skip_frames", 1)
    arg_6 = _retrieve_assert_arguments()
    arg_7 = arg_6[0]
    arg_8 = _get_type_name(arg_3, dump=", ".join(arg_6[1:]))
    arg_9 = _get_type_name(type(arg_0))
    raise H2OTypeError(var_name=arg_7, var_value=arg_0, var_type_name=arg_9, exp_type_name=arg_8, arg_4=arg_4,
                       arg_5=arg_5)

Assert that the argument has the specified type .


(self, expected_codes, received_code, info)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not any ( map ( arg_2 . matches , arg_1 ) ) : raise errors . StatusCodeError ( arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Checks if any of expected matches received.

        :param expected_codes: tuple of expected codes
        :type expected_codes: :py:class:`tuple`

        :param received_code: received code for matching
        :type received_code: :py:class:`aioftp.Code`

        :param info: list of response lines from server
        :type info: :py:class:`list`

        :raises aioftp.StatusCodeError: if received code does not matches any
            expected code
        """
        if not any(map(arg_2.matches, arg_1)):
            raise errors.StatusCodeError(arg_1, arg_2, arg_3)

Checks if any of expected matches received .


(name=None, group=None, release=None, except_release=None,
    dryrun=1, verbose=1)

def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
arg_4
=
1
,
arg_5
=
1
)
:
arg_5
=
int
(
arg_5
)
if
env
.
vm_type
==
EC2
:
arg_6
=
get_ec2_connection
(
)
arg_7
=
list_instances
(
arg_0
=
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
)
for
arg_8
,
arg_9
in
arg_7
.
items
(
)
:
arg_10
=
arg_9
[
'public_dns_name'
]
print
(
'\nDeleting %s (%s)...'
%
(
arg_8
,
arg_9
[
'id'
]
)
)
if
not
get_dryrun
(
)
:
arg_6
.
terminate_instances
(
instance_ids
=
[
arg_9
[
'id'
]
]
)
arg_11
=
os
.
path
.
expanduser
(
'~/.ssh/known_hosts'
)
arg_12
=
'ssh-keygen -f "%s" -R %s'
%
(
arg_11
,
arg_10
)
local_or_dryrun
(
arg_12
)
else
:
raise
NotImplementedError

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None,
    arg_4=1, arg_5=1):
    """
    Permanently erase one or more VM instances from existence.
    """

    arg_5 = int(arg_5)

    if env.vm_type == EC2:
        arg_6 = get_ec2_connection()

        arg_7 = list_instances(
            arg_0=arg_0,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
        )

        for arg_8, arg_9 in arg_7.items():
            arg_10 = arg_9['public_dns_name']
            print('\nDeleting %s (%s)...' \
                % (arg_8, arg_9['id']))
            if not get_dryrun():
                arg_6.terminate_instances(instance_ids=[arg_9['id']])

            # Clear host key on localhost.
            arg_11 = os.path.expanduser('~/.ssh/known_hosts')
            arg_12 = 'ssh-keygen -f "%s" -R %s' % (arg_11, arg_10)
            local_or_dryrun(arg_12)

    else:
        raise NotImplementedError

Permanently erase one or more VM instances from existence .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split
(
" "
)
if
len
(
arg_2
)
<
12
:
raise
ValueError
(
"Invalid mnemonic phrase"
)
if
len
(
arg_2
)
>
13
:
arg_1
=
arg_2
[
:
24
]
else
:
arg_1
=
arg_2
[
:
12
]
arg_3
=
""
.
join
(
word
[
:
arg_0
.
unique_prefix_length
]
for
word
in
arg_1
)
arg_3
=
bytearray
(
arg_3
.
encode
(
'utf-8'
)
)
arg_4
=
(
(
crc32
(
arg_3
)
&
0xffffffff
)
^
0xffffffff
)
>>
0
arg_5
=
(
(
arg_4
^
0xffffffff
)
>>
0
)
%
len
(
arg_1
)
return
arg_2
[
arg_5
]

def Func(arg_0, arg_1):
        """Given a mnemonic word string, return a string of the computed checksum.

        :rtype: str
        """
        arg_2 = arg_1.split(" ")
        if len(arg_2) < 12:
            raise ValueError("Invalid mnemonic phrase")
        if len(arg_2) > 13:
            # Standard format
            arg_1 = arg_2[:24]
        else:
            # MyMonero format
            arg_1 = arg_2[:12]
        arg_3 = "".join(word[:arg_0.unique_prefix_length] for word in arg_1)
        arg_3 = bytearray(arg_3.encode('utf-8'))
        arg_4 = ((crc32(arg_3) & 0xffffffff) ^ 0xffffffff ) >> 0
        arg_5 = ((arg_4 ^ 0xffffffff) >> 0) % len(arg_1)
        return arg_2[arg_5]

Given a mnemonic word string return a string of the computed checksum .


return util.get_object(
            obj=config,
            predefined=tensorforce.core.optimizers.solvers.solvers,
            kwargs=kwargs
        )

def Func ( arg_0 , arg_1 = None ) : return util . get_object ( obj = arg_0 , predefined = tensorforce . core . optimizers . solvers . solvers , arg_1 = arg_1 )

def Func(arg_0, arg_1=None):
        """
        Creates a solver from a specification dict.
        """
        return util.get_object(
            obj=arg_0,
            predefined=tensorforce.core.optimizers.solvers.solvers,
            arg_1=arg_1
        )

Creates a solver from a specification dict .


(self, data, fixedGaps=None, verbose=True)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True ) : arg_4 = str ( uuid . uuid4 ( ) ) os . makedirs ( '/tmp/cdt_gies' + arg_4 + '/' ) arg_0 . arguments [ '{FOLDER}' ] = '/tmp/cdt_gies' + arg_4 + '/' def retrieve_result ( ) : return read_csv ( '/tmp/cdt_gies' + arg_4 + '/result.csv' , delimiter = ',' ) . values try : arg_1 . to_csv ( '/tmp/cdt_gies' + arg_4 + '/data.csv' , header = False , index = False ) if arg_2 is not None : arg_2 . to_csv ( '/tmp/cdt_gies' + arg_4 + '/fixedgaps.csv' , index = False , header = False ) arg_0 . arguments [ '{SKELETON}' ] = 'TRUE' else : arg_0 . arguments [ '{SKELETON}' ] = 'FALSE' arg_6 = launch_R_script ( "{}/R_templates/gies.R" . format ( os . path . dirname ( os . path . realpath ( __file__ ) ) ) , arg_0 . arguments , output_function = retrieve_result , arg_3 = arg_3 ) except Exception as e : rmtree ( '/tmp/cdt_gies' + arg_4 + '' ) raise e except KeyboardInterrupt : rmtree ( '/tmp/cdt_gies' + arg_4 + '/' ) raise KeyboardInterrupt rmtree ( '/tmp/cdt_gies' + arg_4 + '' ) return arg_6

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """Setting up and running GIES with all arguments."""
        # Run gies
        arg_4 = str(uuid.uuid4())
        os.makedirs('/tmp/cdt_gies' + arg_4 + '/')
        arg_0.arguments['{FOLDER}'] = '/tmp/cdt_gies' + arg_4 + '/'

        def retrieve_result():
            return read_csv('/tmp/cdt_gies' + arg_4 + '/result.csv', delimiter=',').values

        try:
            arg_1.to_csv('/tmp/cdt_gies' + arg_4 + '/data.csv', header=False, index=False)
            if arg_2 is not None:
                arg_2.to_csv('/tmp/cdt_gies' + arg_4 + '/fixedgaps.csv', index=False, header=False)
                arg_0.arguments['{SKELETON}'] = 'TRUE'
            else:
                arg_0.arguments['{SKELETON}'] = 'FALSE'

            arg_6 = launch_R_script("{}/R_templates/gies.R".format(os.path.dirname(os.path.realpath(__file__))),
                                          arg_0.arguments, output_function=retrieve_result, arg_3=arg_3)
        # Cleanup
        except Exception as e:
            rmtree('/tmp/cdt_gies' + arg_4 + '')
            raise e
        except KeyboardInterrupt:
            rmtree('/tmp/cdt_gies' + arg_4 + '/')
            raise KeyboardInterrupt
        rmtree('/tmp/cdt_gies' + arg_4 + '')
        return arg_6

Setting up and running GIES with all arguments .


def Func ( arg_0 , arg_1 ) : arg_2 = ( tf . rank ( arg_1 ) if tensorshape_util . rank ( arg_1 . shape ) is None else tensorshape_util . rank ( arg_1 . shape ) ) arg_3 = ( tf . size ( input = arg_0 . event_shape_tensor ( ) ) if tensorshape_util . rank ( arg_0 . event_shape ) is None else tensorshape_util . rank ( arg_0 . event_shape ) ) arg_4 = ( tf . size ( input = arg_0 . _batch_shape_unexpanded ) if tensorshape_util . rank ( arg_0 . batch_shape ) is None else tensorshape_util . rank ( arg_0 . batch_shape ) ) arg_5 = arg_2 - arg_4 - arg_3 if isinstance ( arg_5 , int ) : arg_6 = arg_1 . shape [ : arg_5 ] else : arg_6 = tf . TensorShape ( None ) if tensorshape_util . is_fully_defined ( arg_6 ) : arg_7 = np . int32 ( arg_6 ) else : arg_7 = tf . shape ( input = arg_1 ) [ : arg_5 ] return arg_7 , arg_6

def Func(arg_0, arg_1):
    """Computes graph and static `sample_shape`."""
    arg_2 = (
        tf.rank(arg_1) if tensorshape_util.rank(arg_1.shape) is None else
        tensorshape_util.rank(arg_1.shape))
    arg_3 = (
        tf.size(input=arg_0.event_shape_tensor())
        if tensorshape_util.rank(arg_0.event_shape) is None else
        tensorshape_util.rank(arg_0.event_shape))
    arg_4 = (
        tf.size(input=arg_0._batch_shape_unexpanded)
        if tensorshape_util.rank(arg_0.batch_shape) is None else
        tensorshape_util.rank(arg_0.batch_shape))
    arg_5 = arg_2 - arg_4 - arg_3
    if isinstance(arg_5, int):
      arg_6 = arg_1.shape[:arg_5]
    else:
      arg_6 = tf.TensorShape(None)
    if tensorshape_util.is_fully_defined(arg_6):
      arg_7 = np.int32(arg_6)
    else:
      arg_7 = tf.shape(input=arg_1)[:arg_5]
    return arg_7, arg_6

Computes graph and static sample_shape .


def Func ( arg_0 ) : if isinstance ( arg_0 , DAVError ) : return arg_0 elif isinstance ( arg_0 , Exception ) : return DAVError ( HTTP_INTERNAL_ERROR , src_exception = arg_0 ) else : return DAVError ( HTTP_INTERNAL_ERROR , "{}" . format ( arg_0 ) )

def Func(arg_0):
    """Convert any non-DAVError exception to HTTP_INTERNAL_ERROR."""
    if isinstance(arg_0, DAVError):
        return arg_0
    elif isinstance(arg_0, Exception):
        # traceback.print_exc()
        return DAVError(HTTP_INTERNAL_ERROR, src_exception=arg_0)
    else:
        return DAVError(HTTP_INTERNAL_ERROR, "{}".format(arg_0))

Convert any non - DAVError exception to HTTP_INTERNAL_ERROR .


def Func(arg_0, arg_1):
        """
        Grab contents of 'doc' and return it

        :param doc: The active document
        :return:
        """
        arg_2 = arg_1.get_start_iter()
        arg_3 = arg_1.get_end_iter()
        arg_4 = arg_1.get_text(arg_2, arg_3, False)
        return arg_4


def Func ( arg_0 ) : arg_1 = dict ( value = arg_0 [ 'value' ] , accession = arg_0 . get ( 'accession' ) , revstat = arg_0 . get ( 'revstat' ) ) return arg_1

def Func(arg_0):
    """docstring for Func"""
    arg_1 = dict(
        value = arg_0['value'],
        accession = arg_0.get('accession'),
        revstat = arg_0.get('revstat')
    )

    return arg_1


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_2 [ 'strict_slashes' ] = arg_2 . pop ( 'strict_slashes' , False ) arg_3 = _validate_schema ( arg_2 . pop ( '_body' , None ) ) arg_4 = _validate_schema ( arg_2 . pop ( '_query' , None ) ) arg_5 = _validate_schema ( arg_2 . pop ( 'marshal_with' , None ) ) arg_6 = arg_2 . pop ( 'validate' , True ) def decorator ( arg_7 ) : @ arg_0 . Func ( * arg_1 , ** arg_2 ) @ wraps ( arg_7 ) def wrapper ( * arg_8 , ** arg_9 ) : try : if arg_4 is not None : arg_4 . strict = arg_6 arg_11 = furl ( request . url ) arg_9 [ '_query' ] = arg_4 . load ( arg_13 = arg_11 . args ) if arg_3 is not None : arg_3 . strict = arg_6 arg_12 = request . get_json ( ) if arg_12 is None : arg_12 = { } arg_9 [ '_body' ] = arg_3 . load ( arg_13 = arg_12 ) except ValidationError as err : return jsonify ( err . messages ) , 422 if arg_5 : arg_13 = arg_5 . dump ( arg_7 ( * arg_8 , ** arg_9 ) ) return jsonify ( arg_13 [ 0 ] ) return arg_7 ( * arg_8 , ** arg_9 ) return arg_7 return decorator

def Func(arg_0, *arg_1, **arg_2):
    """Journey Func decorator

    Enables simple serialization, deserialization and validation of Flask Funcs with the help of Marshmallow.

    :param bp: :class:`flask.Blueprint` object
    :param args: args to pass along to `Blueprint.Func`
    :param kwargs:
        - :strict_slashes: Enable / disable strict slashes (default False)
        - :validate: Enable / disable body/query validation (default True)
        - :_query: Unmarshal Query string into this schema
        - :_body: Unmarshal JSON body into this schema
        - :marshal_with: Serialize the output with this schema
    :raises:
        - ValidationError if the query parameters or JSON body fails validation
    """

    arg_2['strict_slashes'] = arg_2.pop('strict_slashes', False)
    arg_3 = _validate_schema(arg_2.pop('_body', None))
    arg_4 = _validate_schema(arg_2.pop('_query', None))
    arg_5 = _validate_schema(arg_2.pop('marshal_with', None))
    arg_6 = arg_2.pop('validate', True)

    def decorator(arg_7):
        @arg_0.Func(*arg_1, **arg_2)
        @wraps(arg_7)
        def wrapper(*arg_8, **arg_9):
            """If a schema (_body and/or _query) was supplied to the Func decorator, the deserialized
            :class`marshmallow.Schema` object is injected into the decorated function's kwargs."""

            try:
                if arg_4 is not None:
                    arg_4.strict = arg_6
                    arg_11 = furl(request.url)
                    arg_9['_query'] = arg_4.load(arg_13=arg_11.args)

                if arg_3 is not None:
                    arg_3.strict = arg_6
                    arg_12 = request.get_json()

                    if arg_12 is None:
                        # Set json_data to empty dict if body is empty, so it gets picked up by the validator
                        arg_12 = {}

                    arg_9['_body'] = arg_3.load(arg_13=arg_12)

            except ValidationError as err:
                return jsonify(err.messages), 422

            if arg_5:
                arg_13 = arg_5.dump(arg_7(*arg_8, **arg_9))
                return jsonify(arg_13[0])

            return arg_7(*arg_8, **arg_9)

        return arg_7

    return decorator

Journey route decorator

    Enables simple serialization, deserialization and validation of Flask routes with the help of Marshmallow.

    :param bp: :class:`flask.Blueprint` object
    :param args: args to pass along to `Blueprint.route`
    :param kwargs:
        - :strict_slashes: Enable / disable strict slashes (default False)
        - :validate: Enable / disable body/query validation (default True)
        - :_query: Unmarshal Query string into this schema
        - :_body: Unmarshal JSON body into this schema
        - :marshal_with: Serialize the output with this schema
    :raises:
        - ValidationError if the query parameters or JSON body fails validation


def Func ( arg_0 , arg_1 ) : if arg_1 . line [ - 1 ] == ESC_HELP and arg_1 . esc != ESC_SHELL and arg_1 . esc != ESC_SH_CAP : return arg_0 . prefilter_manager . get_handler_by_name ( 'help' ) else : if arg_1 . pre : return None return arg_0 . prefilter_manager . get_handler_by_esc ( arg_1 . esc )

def Func(arg_0, arg_1):
        """Check for escape character and return either a handler to handle it,
        or None if there is no escape char."""
        if arg_1.line[-1] == ESC_HELP \
               and arg_1.esc != ESC_SHELL \
               and arg_1.esc != ESC_SH_CAP:
            # the ? can be at the end, but *not* for either kind of shell escape,
            # because a ? can be a vaild final char in a shell cmd
            return arg_0.prefilter_manager.get_handler_by_name('help')
        else:
            if arg_1.pre:
                return None
            # This returns None like it should if no handler exists
            return arg_0.prefilter_manager.get_handler_by_esc(arg_1.esc)

Check for escape character and return either a handler to handle it or None if there is no escape char .


def Func ( arg_0 , arg_1 ) : if not arg_0 . logging_context : arg_0 . binary_annotations . update ( arg_1 ) else : arg_0 . logging_context . tags . update ( arg_1 )

def Func(arg_0, arg_1):
        """Updates the binary annotations for the current span."""
        if not arg_0.logging_context:
            # This is not the root span, so binary annotations will be added
            # to the log handler when this span context exits.
            arg_0.binary_annotations.update(arg_1)
        else:
            # Otherwise, we're in the context of the root span, so just update
            # the binary annotations for the logging context directly.
            arg_0.logging_context.tags.update(arg_1)

Updates the binary annotations for the current span .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
join
(
DATASETS
,
arg_0
)
arg_3
=
os
.
path
.
dirname
(
arg_2
)
if
not
os
.
path
.
exists
(
arg_3
)
:
print
(
'creating dataset directory: %s'
,
arg_3
)
os
.
makedirs
(
arg_3
)
if
not
os
.
path
.
exists
(
arg_2
)
:
if
sys
.
version_info
<
(
3
,
)
:
urllib
.
urlretrieve
(
arg_1
,
arg_2
)
else
:
urllib
.
request
.
urlretrieve
(
arg_1
,
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
    '''Find the location of a dataset on disk, downloading if needed.'''
    arg_2 = os.path.join(DATASETS, arg_0)
    arg_3 = os.path.dirname(arg_2)
    if not os.path.exists(arg_3):
        print('creating dataset directory: %s', arg_3)
        os.makedirs(arg_3)
    if not os.path.exists(arg_2):
        if sys.version_info < (3, ):
            urllib.urlretrieve(arg_1, arg_2)
        else:
            urllib.request.urlretrieve(arg_1, arg_2)
    return arg_2

Find the location of a dataset on disk downloading if needed .


def Func():
    """Create coverage reports and open them in the browser."""
    arg_0 = "Usage: %prog PATH_TO_PACKAGE"
    arg_1 = optparse.OptionParser(arg_0=arg_0)
    arg_1.add_option(
        "-v", "--verbose",
        action="store_true", dest="verbose", default=False,
        help="Show debug output")
    arg_1.add_option(
        "-d", "--output-dir",
        action="store", type="string", dest="output_dir",
        default='',
        help="")
    arg_1.add_option(
        "-t", "--test-args",
        action="store", type="string", dest="test_args",
        default='',
        help=("Pass argument on to bin/test. Quote the argument, " +
              "for instance \"-t '-m somemodule'\"."))
    (arg_2, arg_3) = arg_1.parse_args()
    if arg_2.verbose:
        arg_4 = logging.DEBUG
    else:
        arg_4 = logging.INFO
    logging.basicConfig(level=arg_4,
                        format="%(levelname)s: %(message)s")

    arg_5 = os.getcwd()
    arg_6 = os.path.join(arg_5, 'bin', 'test')
    if not os.path.exists(arg_6):
        raise RuntimeError("Test command doesn't exist: %s" % arg_6)

    arg_7 = os.path.join(arg_5, 'bin', 'coverage')
    if not os.path.exists(arg_7):
        logger.debug("Trying globally installed coverage command.")
        arg_7 = 'coverage'

    logger.info("Running tests in coverage mode (can take a long time)")
    arg_8 = [arg_7, 'run', arg_6]
    if arg_2.test_args:
        arg_8.append(arg_2.test_args)
    system(" ".join(arg_8))
    logger.debug("Creating coverage reports...")
    if arg_2.output_dir:
        arg_9 = arg_2.output_dir
        arg_10 = False
    else:
        arg_9 = 'htmlcov'  # The default
        arg_10 = True
    system("%s html --directory=%s" % (arg_7, arg_9))
    logger.info("Wrote coverage files to %s", arg_9)
    if arg_10:
        arg_11 = os.path.abspath(
            os.path.join(arg_9, 'index.html'))
        logger.debug("About to open %s in your webbrowser.", arg_11)
        webbrowser.open('file://' + arg_11)
        logger.info("Opened reports in your browser.")

Create coverage reports and open them in the browser .


return tempfile.NamedTemporaryFile(mode='w',
                                       dir=os.path.dirname(filename),
                                       prefix=os.path.basename(filename),
                                       suffix=os.fsencode('.tmp'),
                                       delete=False)

def Func ( arg_0 ) : return tempfile . NamedTemporaryFile ( mode = 'w' , dir = os . path . dirname ( arg_0 ) , prefix = os . path . basename ( arg_0 ) , suffix = os . fsencode ( '.tmp' ) , delete = False )

def Func(arg_0):
    """
    Create a NamedTemporaryFile instance to be passed to atomic_writer
    """
    return tempfile.NamedTemporaryFile(mode='w',
                                       dir=os.path.dirname(arg_0),
                                       prefix=os.path.basename(arg_0),
                                       suffix=os.fsencode('.tmp'),
                                       delete=False)


def Func(arg_0, arg_1):
    """Create the `role_based_access_control` switch if it does not already exist."""
    arg_2 = arg_0.get_model('waffle', 'Switch')
    arg_2.objects.update_or_create(name=ENTERPRISE_ROLE_BASED_ACCESS_CONTROL_SWITCH, defaults={'active': False})

Create the role_based_access_control switch if it does not already exist .


def Func ( arg_0 ) : with arg_0 . lock : if arg_0 . initiator : if arg_0 . _output_state is None : arg_0 . _initiate ( )

def Func(arg_0):
        """Called when transport has been connected.

        Send the stream head if initiator.
        """
        with arg_0.lock:
            if arg_0.initiator:
                if arg_0._output_state is None:
                    arg_0._initiate()

Called when transport has been connected .


def Func(arg_0):
        """
        Returns the Session currently used.

        :return: An instance of :class:`OpenSSL.SSL.Session` or
            :obj:`None` if no session exists.

        .. versionadded:: 0.14
        """
        arg_1 = _lib.SSL_get1_session(arg_0._ssl)
        if arg_1 == _ffi.NULL:
            return None

        arg_2 = Session.__new__(Session)
        arg_2._session = _ffi.gc(arg_1, _lib.SSL_SESSION_free)
        return arg_2


return SOURCE_TABLE_HTML % u'\n'.join(line.render() for line in
                                              self.get_annotated_lines())

def Func ( arg_0 ) : return SOURCE_TABLE_HTML % u'\n' . join ( arg_1 . render ( ) for arg_1 in arg_0 . get_annotated_lines ( ) )

def Func(arg_0):
        """Render the sourcecode."""
        return SOURCE_TABLE_HTML % u'\n'.join(arg_1.render() for arg_1 in
                                              arg_0.get_annotated_lines())


def Func ( arg_0 ) : arg_1 = elements ( ) arg_2 = re . compile ( '\(([A-z0-9]+)\)([0-9]+)?' ) arg_3 = re . compile ( '([A-Z][a-z]?)([0-9]+)?' ) arg_4 = arg_2 . findall ( arg_0 ) arg_5 = arg_2 . sub ( '' , arg_0 ) arg_6 = 0 if len ( arg_4 ) > 0 : for arg_7 , arg_8 in arg_4 : arg_9 = 0 for arg_10 , arg_11 in arg_3 . findall ( arg_7 ) : arg_12 = ( arg_1 . loc [ arg_10 , 'atomic_weight' ] * arg_1 . loc [ arg_10 , 'percent' ] / 100 ) . sum ( ) if arg_11 == '' : arg_11 = 1 else : arg_11 = int ( arg_11 ) arg_9 += arg_12 * arg_11 if arg_8 == '' : arg_8 = 1 else : arg_8 = int ( arg_8 ) arg_6 += arg_9 * arg_8 for arg_10 , arg_11 in arg_3 . findall ( arg_5 ) : arg_12 = ( arg_1 . loc [ arg_10 , 'atomic_weight' ] * arg_1 . loc [ arg_10 , 'percent' ] / 100 ) . sum ( ) if arg_11 == '' : arg_11 = 1 else : arg_11 = int ( arg_11 ) arg_6 += arg_12 * arg_11 return arg_6

def Func(arg_0):
    """
    Returns molecular weight of molecule.

    Where molecule is in standard chemical notation,
    e.g. 'CO2', 'HCO3' or B(OH)4

    Returns
    -------
    molecular_weight : float
    """

    # load periodic table
    arg_1 = elements()

    # define regexs
    arg_2 = re.compile('\(([A-z0-9]+)\)([0-9]+)?')
    arg_3 = re.compile('([A-Z][a-z]?)([0-9]+)?')

    arg_4 = arg_2.findall(arg_0)  # find subgroups in parentheses
    arg_5 = arg_2.sub('', arg_0)  # get remainder

    arg_6 = 0
    # deal with sub-groups
    if len(arg_4) > 0:
        for arg_7, arg_8 in arg_4:
            arg_9 = 0
            for arg_10, arg_11 in arg_3.findall(arg_7):
                arg_12 = (arg_1.loc[arg_10, 'atomic_weight'] *
                      arg_1.loc[arg_10, 'percent'] / 100).sum()
                if arg_11 == '':
                    arg_11 = 1
                else:
                    arg_11 = int(arg_11)
                arg_9 += arg_12 * arg_11
            if arg_8 == '':
                arg_8 = 1
            else:
                arg_8 = int(arg_8)
            arg_6 += arg_9 * arg_8
    # deal with remainder
    for arg_10, arg_11 in arg_3.findall(arg_5):
        arg_12 = (arg_1.loc[arg_10, 'atomic_weight'] *
              arg_1.loc[arg_10, 'percent'] / 100).sum()
        if arg_11 == '':
            arg_11 = 1
        else:
            arg_11 = int(arg_11)
        arg_6 += arg_12 * arg_11
    return arg_6


return (prevFieldName, bitOffset - prevFieldOffset)

def Func(arg_0, arg_1, arg_2=False):
    """
    Return a description of the given bit in the encoded output.
    This will include the field name and the offset within the field.

    :param bitOffset:      Offset of the bit to get the description of
    :param formatted:      If True, the bitOffset is w.r.t. formatted output,
                          which includes separators
    :return:             tuple(``fieldName``, ``offsetWithinField``)
    """

    # Find which field it's in
    (arg_3, arg_4) = (None, None)
    arg_5 = arg_0.getDescription()
    for arg_6 in xrange(len(arg_5)):
      (arg_7, arg_8) = arg_5[arg_6]
      if arg_2:
        arg_8 = arg_8 + arg_6
        if arg_1 == arg_8-1:
          arg_3 = "separator"
          arg_4 = arg_1
          break

      if arg_1 < arg_8:
        break
      (arg_3, arg_4) = (arg_7, arg_8)

    # Return the field name and offset within the field
    # return (fieldName, bitOffset - fieldOffset)
    arg_9 = arg_0.getDisplayWidth() if arg_2 else arg_0.getWidth()

    if arg_4 is None or arg_1 > arg_0.getWidth():
      raise IndexError("Bit is outside of allowable range: [0 - %d]" % arg_9)

    return (arg_3, arg_1 - arg_4)

Return a description of the given bit in the encoded output . This will include the field name and the offset within the field .


return list(Artist(self.__client, item) for item in related['artists'])

async def Func ( arg_0 ) -> List [ Artist ] : arg_1 = await arg_0 . __client . http . artist_Func ( arg_0 . id ) return list ( Artist ( arg_0 . __client , arg_2 ) for arg_2 in arg_1 [ 'artists' ] )

async def Func(arg_0) -> List[Artist]:
        """Get Spotify catalog information about artists similar to a given artist.

        Similarity is based on analysis of the Spotify community’s listening history.

        Returns
        -------
        artists : List[Artits]
            The artists deemed similar.
        """
        arg_1 = await arg_0.__client.http.artist_Func(arg_0.id)
        return list(Artist(arg_0.__client, arg_2) for arg_2 in arg_1['artists'])

Get Spotify catalog information about artists similar to a given artist .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . client . crate_attribute ( arg_1 , "versions" ) arg_3 = json . loads ( arg_2 ) return arg_3

def Func(arg_0, arg_1):
        """Get crate versions data"""

        arg_2 = arg_0.client.crate_attribute(arg_1, "versions")

        arg_3 = json.loads(arg_2)

        return arg_3


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . category arg_0 . category = 'ilm' arg_5 = states . ImageState ( Image ( arg_1 . get ( ) . copy ( ) ) , [ arg_0 ] , pad = 0 , mdl = mdl . SmoothFieldModel ( ) ) do_levmarq ( arg_5 , arg_0 . params , ** arg_2 ) arg_0 . category = arg_3

def Func(arg_0, arg_1, **arg_2):
    """
    Fits a new component to an old component

    Calls do_levmarq to match the .get() fields of the two objects. The
    parameters of new_comp are modified in place.

    Parameters
    ----------
    new_comp : :class:`peri.comps.comp`
        The new object, whose parameters to update to fit the field of
        `old_comp`. Must have a .get() attribute which returns an ndarray
    old_comp : peri.comp
        The old ilm to match to.

    Other Parameters
    ----------------
        Any keyword arguments to be passed to the optimizer LMGlobals
        through do_levmarq.

    See Also
    --------
    do_levmarq : Levenberg-Marquardt minimization using a random subset
        of the image pixels.
    """
    #resetting the category to ilm:
    arg_3 = arg_0.category
    arg_0.category = 'ilm'
    arg_5 = states.ImageState(Image(arg_1.get().copy()), [arg_0], pad=0,
            mdl=mdl.SmoothFieldModel())
    do_levmarq(arg_5, arg_0.params, **arg_2)
    arg_0.category = arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _load_data ( arg_0 . PROGRAMS_ENDPOINT , default = [ ] ) arg_3 = [ program for program in arg_2 if program . get ( 'title' ) == arg_1 ] if len ( arg_3 ) > 1 : raise MultipleProgramMatchError ( len ( arg_3 ) ) elif len ( arg_3 ) == 1 : return arg_3 [ 0 ] else : return None

def Func(arg_0, arg_1):
        """
        Return single program by name, or None if not found.

        Arguments:
            program_title(string): Program title as seen by students and in Course Catalog Admin

        Returns:
            dict: Program data provided by Course Catalog API

        """
        arg_2 = arg_0._load_data(arg_0.PROGRAMS_ENDPOINT, default=[])
        arg_3 = [program for program in arg_2 if program.get('title') == arg_1]
        if len(arg_3) > 1:
            raise MultipleProgramMatchError(len(arg_3))
        elif len(arg_3) == 1:
            return arg_3[0]
        else:
            return None

Return single program by name or None if not found .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 is None or isinstance ( arg_2 , ( int , float , bool ) ) : arg_2 = str ( arg_2 ) if arg_1 . endswith ( '64' ) : arg_2 = urlsafe_b64encode ( arg_2 . encode ( 'utf-8' ) ) arg_2 = arg_2 . replace ( b ( '=' ) , b ( '' ) ) arg_0 . _parameters [ arg_1 ] = arg_2

def Func(arg_0, arg_1, arg_2):
        """
        Set a url parameter.

        Parameters
        ----------
        key : str
            If key ends with '64', the value provided will be automatically
            base64 encoded.
        """
        if arg_2 is None or isinstance(arg_2, (int, float, bool)):
            arg_2 = str(arg_2)

        if arg_1.endswith('64'):
            arg_2 = urlsafe_b64encode(arg_2.encode('utf-8'))
            arg_2 = arg_2.replace(b('='), b(''))

        arg_0._parameters[arg_1] = arg_2


def Func ( arg_0 , arg_1 ) : arg_0 . md5 . Func ( to_bytes ( str ( type ( arg_1 ) ) ) ) if isinstance ( arg_1 , string_class ) : arg_0 . md5 . Func ( to_bytes ( arg_1 ) ) elif arg_1 is None : pass elif isinstance ( arg_1 , ( int , float ) ) : arg_0 . md5 . Func ( to_bytes ( str ( arg_1 ) ) ) elif isinstance ( arg_1 , ( tuple , list ) ) : for arg_2 in arg_1 : arg_0 . Func ( arg_2 ) elif isinstance ( arg_1 , dict ) : arg_3 = arg_1 . keys ( ) for arg_4 in sorted ( arg_3 ) : arg_0 . Func ( arg_4 ) arg_0 . Func ( arg_1 [ arg_4 ] ) else : for arg_4 in dir ( arg_1 ) : if arg_4 . startswith ( '__' ) : continue arg_5 = getattr ( arg_1 , arg_4 ) if inspect . isroutine ( arg_5 ) : continue arg_0 . Func ( arg_4 ) arg_0 . Func ( arg_5 )

def Func(arg_0, arg_1):
        """Add `v` to the hash, recursively if needed."""
        arg_0.md5.Func(to_bytes(str(type(arg_1))))
        if isinstance(arg_1, string_class):
            arg_0.md5.Func(to_bytes(arg_1))
        elif arg_1 is None:
            pass
        elif isinstance(arg_1, (int, float)):
            arg_0.md5.Func(to_bytes(str(arg_1)))
        elif isinstance(arg_1, (tuple, list)):
            for arg_2 in arg_1:
                arg_0.Func(arg_2)
        elif isinstance(arg_1, dict):
            arg_3 = arg_1.keys()
            for arg_4 in sorted(arg_3):
                arg_0.Func(arg_4)
                arg_0.Func(arg_1[arg_4])
        else:
            for arg_4 in dir(arg_1):
                if arg_4.startswith('__'):
                    continue
                arg_5 = getattr(arg_1, arg_4)
                if inspect.isroutine(arg_5):
                    continue
                arg_0.Func(arg_4)
                arg_0.Func(arg_5)

Add v to the hash recursively if needed .


def Func ( arg_0 , arg_1 = None ) : import pyglet from IPython . lib . inputhookpyglet import inputhook_pyglet arg_0 . set_inputhook ( inputhook_pyglet ) arg_0 . _current_gui = GUI_PYGLET return arg_1

def Func(arg_0, arg_1=None):
        """Enable event loop integration with pyglet.

        Parameters
        ----------
        app : ignored
           Ignored, it's only a placeholder to keep the call signature of all
           gui activation methods consistent, which simplifies the logic of
           supporting magics.

        Notes
        -----
        This methods sets the ``PyOS_InputHook`` for pyglet, which allows
        pyglet to integrate with terminal based applications like
        IPython.

        """
        import pyglet
        from IPython.lib.inputhookpyglet import inputhook_pyglet
        arg_0.set_inputhook(inputhook_pyglet)
        arg_0._current_gui = GUI_PYGLET
        return arg_1

Enable event loop integration with pyglet .


(self, datacenter_id, server_id, depth=1)

def Func(arg_0, arg_1, arg_2, arg_3=1):
        """
        Retrieves a list of all NICs bound to the specified server.

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

        :param      server_id: The unique ID of the server.
        :type       server_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_4 = arg_0._perform_request(
            '/datacenters/%s/servers/%s/nics?depth=%s' % (
                arg_1,
                arg_2,
                str(arg_3)))

        return arg_4

Retrieves a list of all NICs bound to the specified server .


def Func ( arg_0 ) : arg_1 = json . loads ( arg_0 ) arg_2 = arg_1 [ 'items' ] for arg_3 in arg_2 : yield arg_3

def Func(arg_0):
        """Parse a StackExchange API raw response.

        The method parses the API response retrieving the
        questions from the received items

        :param items: items from where to parse the questions

        :returns: a generator of questions
        """
        arg_1 = json.loads(arg_0)
        arg_2 = arg_1['items']
        for arg_3 in arg_2:
            yield arg_3

Parse a StackExchange API raw response .


def Func(arg_0, arg_1):
        """Change the number of servers in the queue to ``n``.

        Parameters
        ----------
        n : int or :const:`numpy.infty`
            A positive integer (or ``numpy.infty``) to set the number
            of queues in the system to.

        Raises
        ------
        TypeError
            If ``n`` is not an integer or positive infinity then this
            error is raised.
        ValueError
            If ``n`` is not positive.
        """
        if not isinstance(arg_1, numbers.Integral) and arg_1 is not infty:
            arg_2 = "n must be an integer or infinity.\n{0}"
            raise TypeError(arg_2.format(str(arg_0)))
        elif arg_1 <= 0:
            arg_2 = "n must be a positive integer or infinity.\n{0}"
            raise ValueError(arg_2.format(str(arg_0)))
        else:
            arg_0.num_servers = arg_1

Change the number of servers in the queue to n .


def Func(arg_0):
    ''' Get the command to start the checkpoint manager process'''

    arg_1 = 'org.apache.heron.ckptmgr.CheckpointManager'

    arg_2 = arg_0.checkpoint_manager_ram / (1024 * 1024)
    arg_3 = [os.path.join(arg_0.heron_java_home, "bin/java"),
                   '-Xms%dM' % arg_2,
                   '-Xmx%dM' % arg_2,
                   '-XX:+PrintCommandLineFlags',
                   '-verbosegc',
                   '-XX:+PrintGCDetails',
                   '-XX:+PrintGCTimeStamps',
                   '-XX:+PrintGCDateStamps',
                   '-XX:+PrintGCCause',
                   '-XX:+UseGCLogFileRotation',
                   '-XX:NumberOfGCLogFiles=5',
                   '-XX:GCLogFileSize=100M',
                   '-XX:+PrintPromotionFailure',
                   '-XX:+PrintTenuringDistribution',
                   '-XX:+PrintHeapAtGC',
                   '-XX:+HeapDumpOnOutOfMemoryError',
                   '-XX:+UseConcMarkSweepGC',
                   '-XX:+UseConcMarkSweepGC',
                   '-Xloggc:log-files/gc.ckptmgr.log',
                   '-Djava.net.preferIPv4Stack=true',
                   '-cp',
                   arg_0.checkpoint_manager_classpath,
                   arg_1,
                   '-t' + arg_0.topology_name,
                   '-i' + arg_0.topology_id,
                   '-c' + arg_0.ckptmgr_ids[arg_0.shard],
                   '-p' + arg_0.checkpoint_manager_port,
                   '-f' + arg_0.stateful_config_file,
                   '-o' + arg_0.override_config_file,
                   '-g' + arg_0.heron_internals_config_file]
    arg_4 = {}
    arg_4[arg_0.ckptmgr_ids[arg_0.shard]] = Command(arg_3, arg_0.shell_env)

    return arg_4


def Func ( arg_0 , arg_1 = None ) : arg_2 = "%s%s" % ( arg_0 . endpoint , arg_1 ) arg_0 . self_link = arg_1 arg_0 . request = requests . get ( url = arg_2 , headers = arg_0 . default_headers ( ) ) arg_0 . request . encoding = "utf-8" try : arg_0 . request . raise_for_status ( ) except requests . exceptions . HTTPError : error_handler ( arg_0 . request ) return arg_0 . request

def Func(arg_0, arg_1=None):
        """
        Retrieve Zotero items via the API
        Combine endpoint and request to access the specific resource
        Returns a JSON document
        """
        arg_2 = "%s%s" % (arg_0.endpoint, arg_1)
        # The API doesn't return this any more, so we have to cheat
        arg_0.self_link = arg_1
        arg_0.request = requests.get(url=arg_2, headers=arg_0.default_headers())
        arg_0.request.encoding = "utf-8"
        try:
            arg_0.request.raise_for_status()
        except requests.exceptions.HTTPError:
            error_handler(arg_0.request)
        return arg_0.request


def Func(arg_0, arg_1):
    """Return a valid docker_path for a GCS bucket."""
    # Assume URI is a directory path.
    arg_1 = directory_fmt(arg_1)
    arg_2, arg_3 = _gcs_uri_rewriter(arg_1)
    arg_4 = os.path.join(arg_0._relative_path, arg_3)
    return arg_4

Return a valid docker_path for a GCS bucket .


def Func ( arg_0 ) : if type ( arg_0 ) is str : arg_0 = glob . glob ( arg_0 + "/*.*" ) arg_1 = [ ] for arg_2 in arg_0 : if arg_2 [ - 4 : ] . lower ( ) == '.abf' : arg_3 = arg_2 . split ( '.' ) [ - 1 ] arg_1 . append ( os . path . basename ( arg_2 ) . replace ( '.' + arg_3 , '' ) ) return sorted ( arg_1 )

def Func(arg_0):
    """given a path or list of files, return ABF IDs."""
    if type(arg_0) is str:
        arg_0=glob.glob(arg_0+"/*.*")
    arg_1=[]
    for arg_2 in arg_0:
        if arg_2[-4:].lower()=='.abf':
            arg_3=arg_2.split('.')[-1]
            arg_1.append(os.path.basename(arg_2).replace('.'+arg_3,''))
    return sorted(arg_1)

given a path or list of files return ABF IDs .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
not
in
arg_0
.
chains
:
setattr
(
arg_0
.
chains
,
arg_1
,
MarkovChain
(
arg_2
=
arg_2
)
)
else
:
raise
ValueError
(
"Chain with this name already exists"
)

def Func(arg_0, arg_1, arg_2):
        """
        Add chain to current shelve file

        Args:
            name: chain name
            order: markov chain order
        """

        if arg_1 not in arg_0.chains:
            setattr(arg_0.chains, arg_1, MarkovChain(arg_2=arg_2))
        else:
            raise ValueError("Chain with this name already exists")


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( 'style' ) if arg_2 and 'text-decoration:underline' in arg_2 : arg_1 . wrap ( arg_0 . soup . new_tag ( 'u' ) )

def Func(arg_0, arg_1):
        """
        See if span tag has underline style and wrap with u tag.
        """
        arg_2 = arg_1.get('style')
        if arg_2 and 'text-decoration:underline' in arg_2:
            arg_1.wrap(arg_0.soup.new_tag('u'))

See if span tag has underline style and wrap with u tag .


(self, server_name, name, start_ip_address,
                             end_ip_address)

return self._perform_put(
            self._get_firewall_rules_path(server_name, name),
            _SqlManagementXmlSerializer.update_firewall_rule_to_xml(
                name, start_ip_address, end_ip_address
            )
        )

def Func(arg_0, arg_1, arg_2, arg_3,
                             arg_4):
        '''
        Update a firewall rule for an Azure SQL Database server.

        server_name:
            Name of the server to set the firewall rule on.
        name:
            The name of the firewall rule to update.
        start_ip_address:
            The lowest IP address in the range of the server-level firewall
            setting. IP addresses equal to or greater than this can attempt to
            connect to the server. The lowest possible IP address is 0.0.0.0.
        end_ip_address:
            The highest IP address in the range of the server-level firewall
            setting. IP addresses equal to or less than this can attempt to
            connect to the server. The highest possible IP address is
            255.255.255.255.
        '''
        _validate_not_none('server_name', arg_1)
        _validate_not_none('name', arg_2)
        _validate_not_none('start_ip_address', arg_3)
        _validate_not_none('end_ip_address', arg_4)
        return arg_0._perform_put(
            arg_0._get_firewall_rules_path(arg_1, arg_2),
            _SqlManagementXmlSerializer.Func_to_xml(
                arg_2, arg_3, arg_4
            )
        )

Update a firewall rule for an Azure SQL Database server .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . _abooks : if arg_2 . name == arg_1 : return arg_2

def Func(arg_0, arg_1):
        """Get one of the backing abdress books by its name,

        :param name: the name of the address book to get
        :type name: str
        :returns: the matching address book or None
        :rtype: AddressBook or NoneType

        """
        for arg_2 in arg_0._abooks:
            if arg_2.name == arg_1:
                return arg_2