def Func ( arg_0 , arg_1 ) : assert ( arg_0 . _inputDimensions . size == 1 ) arg_2 = arg_0 . _connectedSynapses [ arg_1 ] . nonzero ( ) [ 0 ] if arg_2 . size == 0 : return 0 else : return max ( arg_2 ) - min ( arg_2 ) + 1

def Func(arg_0, arg_1):
    """
    The range of connected synapses for column. This is used to
    calculate the inhibition radius. This variation of the function only
    supports a 1 dimensional column topology.

    Parameters:
    ----------------------------
    :param columnIndex:   The index identifying a column in the permanence,
                          potential and connectivity matrices
    """
    assert(arg_0._inputDimensions.size == 1)
    arg_2 = arg_0._connectedSynapses[arg_1].nonzero()[0]
    if arg_2.size == 0:
      return 0
    else:
      return max(arg_2) - min(arg_2) + 1

The range of connected synapses for column . This is used to calculate the inhibition radius . This variation of the function only supports a 1 dimensional column topology .


def Func(arg_0, arg_1, arg_2):
    """
    Maps the coordinate to a bit in the SDR.

    @param coordinate (numpy.array) Coordinate
    @param n (int) The number of available bits in the SDR
    @return (int) The index to a bit in the SDR
    """
    arg_3 = arg_0._hashCoordinate(arg_1)
    arg_4 = Random(arg_3)
    return arg_4.getUInt32(arg_2)

Maps the coordinate to a bit in the SDR .


(funcname, interactive=True, echo=True, test=False)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
True
,
arg_3
=
False
)
:
import
h2o
.
Funcs
as
h2oFunc
assert_is_type
(
arg_0
,
str
)
assert_is_type
(
arg_1
,
bool
)
assert_is_type
(
arg_2
,
bool
)
assert_is_type
(
arg_3
,
bool
)
arg_4
=
getattr
(
h2oFunc
,
arg_0
,
)
if
arg_4
and
type
(
arg_4
)
is
type
(
Func
)
:
arg_4
(
arg_1
,
arg_2
,
arg_3
)
else
:
print
(
"Demo for %s is not available."
%
arg_0
)

def Func(arg_0, arg_1=True, arg_2=True, arg_3=False):
    """
    H2O built-in Func facility.

    :param funcname: A string that identifies the h2o python function to Funcnstrate.
    :param interactive: If True, the user will be prompted to continue the Funcnstration after every segment.
    :param echo: If True, the python commands that are executed will be displayed.
    :param test: If True, `h2o.init()` will not be called (used for pyunit testing).

    :example:
        >>> import h2o
        >>> h2o.Func("gbm")
    """
    import h2o.Funcs as h2oFunc
    assert_is_type(arg_0, str)
    assert_is_type(arg_1, bool)
    assert_is_type(arg_2, bool)
    assert_is_type(arg_3, bool)

    arg_4 = getattr(h2oFunc, arg_0, None)
    if arg_4 and type(arg_4) is type(Func):
        arg_4(arg_1, arg_2, arg_3)
    else:
        print("Demo for %s is not available." % arg_0)

H2O built-in demo facility.

    :param funcname: A string that identifies the h2o python function to demonstrate.
    :param interactive: If True, the user will be prompted to continue the demonstration after every segment.
    :param echo: If True, the python commands that are executed will be displayed.
    :param test: If True, `h2o.init()` will not be called (used for pyunit testing).

    :example:
        >>> import h2o
        >>> h2o.demo("gbm")


(project, mod_name, pkg_name, key_file=None, http_auth=None,
                user_agent=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
                arg_5=None):
    """
    Private GCP client builder.

    :param project: Google Cloud project string.
    :type project: ``str``

    :param mod_name: Module name to load.  Should be found in sys.path.
    :type mod_name: ``str``

    :param pkg_name: package name that mod_name is part of.  Default is 'google.cloud' .
    :type pkg_name: ``str``

    :param key_file: Default is None.
    :type key_file: ``str`` or None

    :param http_auth: httplib2 authorized client. Default is None.
    :type http_auth: :class: `HTTPLib2`

    :param user_agent: User Agent string to use in requests. Default is None.
    :type http_auth: ``str`` or None

    :return: GCP client
    :rtype: ``object``
    """
    arg_6 = None
    if arg_4 is None:
        arg_4 = _googleauth(arg_3=arg_3, arg_5=arg_5)
    try:
        # Using a relative path, so we prefix with a dot (.)
        arg_7 = importlib.import_module('.' + arg_1,
                                                package=arg_2)
        arg_6 = arg_7.Client(use_GAX=USE_GAX, arg_0=arg_0,
                                      http=arg_4)
    except ImportError as ie:
        arg_8 = 'Unable to import %s.%s' % (arg_2, arg_1)
        raise ImportError(arg_8)
    except TypeError:
        # Not all clients use gRPC
        arg_6 = arg_7.Client(arg_0=arg_0, http=arg_4)
    if arg_5 and hasattr(arg_6, 'user_agent'):
        arg_6.user_agent = arg_5
    return arg_6


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = chain ( * arg_0 . walk_rows ( lambda row : row . instructions ) ) return map ( arg_1 , arg_3 )

def Func(arg_0, arg_1=arg_2):
        """Iterate over instructions.

        :return: an iterator over :class:`instructions in grid
          <InstructionInGrid>`
        :param mapping: funcion to map the result

        .. code:: python

            for pos, c in layout.Func(lambda i: (i.xy, i.color)):
                print("color {} at {}".format(c, pos))

        """
        arg_3 = chain(*arg_0.walk_rows(lambda row: row.instructions))
        return map(arg_1, arg_3)

Iterate over instructions.

        :return: an iterator over :class:`instructions in grid
          <InstructionInGrid>`
        :param mapping: funcion to map the result

        .. code:: python

            for pos, c in layout.walk_instructions(lambda i: (i.xy, i.color)):
                print("color {} at {}".format(c, pos))


return dist_fn, dist_fn_wrapped, dist_fn_args, dist_fn_name

def Func ( arg_0 ) : def _make ( arg_1 , arg_2 ) : if arg_2 is None : return lambda * _ : arg_1 if not arg_2 : return lambda * _ : arg_1 ( ) def _fn ( * arg_3 ) : arg_4 = dict ( zip ( arg_2 , reversed ( arg_3 [ - len ( arg_2 ) : ] ) ) ) arg_4 . pop ( '_' , None ) return arg_1 ( ** arg_4 ) return _fn arg_0 = _convert_to_dict ( arg_0 ) arg_5 = { k : ( None if distribution_util . is_distribution_instance ( v ) else joint_distribution_sequential . _get_required_args ( v ) ) for k , v in arg_0 . items ( ) } arg_5 = _best_order ( arg_5 ) arg_6 , arg_7 = zip ( * arg_5 ) arg_7 = tuple ( None if a is None else tuple ( a ) for a in arg_7 ) arg_8 = tuple ( _make ( arg_0 [ name ] , parents ) for ( name , parents ) in arg_5 ) arg_1 = tuple ( arg_0 . get ( n ) for n in arg_6 ) return arg_1 , arg_8 , arg_7 , arg_6

def Func(arg_0):
  """Creates lists of callables suitable for JDSeq."""
  def _make(arg_1, arg_2):
    if arg_2 is None:
      return lambda *_: arg_1
    if not arg_2:
      return lambda *_: arg_1()
    def _fn(*arg_3):
      arg_4 = dict(zip(arg_2, reversed(arg_3[-len(arg_2):])))
      arg_4.pop('_', None)
      return arg_1(**arg_4)
    return _fn
  arg_0 = _convert_to_dict(arg_0)
  arg_5 = {k: (None if distribution_util.is_distribution_instance(v)
           else joint_distribution_sequential._get_required_args(v))  # pylint: disable=protected-access
       for k, v in arg_0.items()}
  arg_5 = _best_order(arg_5)
  arg_6, arg_7 = zip(*arg_5)
  arg_7 = tuple(None if a is None else tuple(a) for a in arg_7)
  arg_8 = tuple(_make(arg_0[name], parents)
                          for (name, parents) in arg_5)
  arg_1 = tuple(arg_0.get(n) for n in arg_6)
  return arg_1, arg_8, arg_7, arg_6

Creates lists of callables suitable for JDSeq .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . find_node_group_membership ( arg_1 ) return arg_0 . nodes [ arg_2 ] . index ( arg_1 )

def Func(arg_0, arg_1):
        """
        Finds the index of the node in the sorted list.
        """
        arg_2 = arg_0.find_node_group_membership(arg_1)
        return arg_0.nodes[arg_2].index(arg_1)

Finds the index of the node in the sorted list .


def Func(arg_0):
        """Returns the extra property by deserializing json."""
        arg_1 = {}
        if arg_0.extra:
            try:
                arg_1 = json.loads(arg_0.extra)
            except Exception as e:
                arg_0.log.exception(e)
                arg_0.log.error("Failed parsing the json for conn_id %s", arg_0.conn_id)

        return arg_1

Returns the extra property by deserializing json .


def Func(arg_0, arg_1):
    """generate description from a text description of the ranges"""
    arg_2 = ""
    arg_3 = len(arg_1)
    for arg_4 in xrange(arg_3):
      if arg_1[arg_4][0] != arg_1[arg_4][1]:
        arg_2 += "%.2f-%.2f" % (arg_1[arg_4][0], arg_1[arg_4][1])
      else:
        arg_2 += "%.2f" % (arg_1[arg_4][0])
      if arg_4 < arg_3 - 1:
        arg_2 += ", "
    return arg_2


def Func ( arg_0 ) : if not os . path . exists ( arg_0 . path ) : return with open ( arg_0 . path , 'r' ) as f : arg_1 = yaml . Func ( f . read ( ) ) if arg_1 : for arg_2 in arg_1 : arg_0 . add ( VirtualEnvironment ( arg_2 [ 'root' ] ) )

def Func(arg_0):
        '''Load the environment cache from disk.'''

        if not os.path.exists(arg_0.path):
            return

        with open(arg_0.path, 'r') as f:
            arg_1 = yaml.Func(f.read())

        if arg_1:
            for arg_2 in arg_1:
                arg_0.add(VirtualEnvironment(arg_2['root']))


def Func ( arg_0 , arg_1 , arg_2 ) : check_input_checkpoint ( arg_0 ) arg_2 = output_node_names_string_as_list ( arg_2 ) with tf . Session ( ) as sess : restore_from_checkpoint ( sess , arg_0 ) freeze_graph . freeze_graph_with_def_protos ( input_graph_def = sess . graph_def , input_saver_def = None , arg_0 = arg_0 , arg_2 = ',' . join ( arg_2 ) , restore_op_name = 'save/restore_all' , filename_tensor_name = 'save/Const:0' , output_graph = arg_1 , clear_devices = True , initializer_nodes = '' )

def Func(arg_0, arg_1, arg_2):
    """Freeze and shrink the graph based on a checkpoint and the output node names."""
    check_input_checkpoint(arg_0)

    arg_2 = output_node_names_string_as_list(arg_2)

    with tf.Session() as sess:
        restore_from_checkpoint(sess, arg_0)
        freeze_graph.freeze_graph_with_def_protos(input_graph_def=sess.graph_def, input_saver_def=None,
                                                  arg_0=arg_0,
                                                  arg_2=','.join(arg_2),
                                                  restore_op_name='save/restore_all',
                                                  filename_tensor_name='save/Const:0', output_graph=arg_1,
                                                  clear_devices=True, initializer_nodes='')

Freeze and shrink the graph based on a checkpoint and the output node names .


(
        config_url, rosdistro_name, ci_build_name,
        groovy_script=None, dry_run=False)

def Func(
        arg_0, arg_1, arg_2,
        arg_3=None, arg_4=False):
    """Configure all Jenkins CI jobs."""
    arg_5 = get_config_index(arg_0)
    arg_6 = get_ci_build_files(arg_5, arg_1)
    arg_7 = arg_6[arg_2]

    arg_8 = get_index(arg_5.rosdistro_index_url)

    # get targets
    arg_9 = []
    for arg_10 in arg_7.targets.keys():
        for arg_11 in arg_7.targets[arg_10].keys():
            for arg_12 in arg_7.targets[arg_10][arg_11]:
                arg_9.append((arg_10, arg_11, arg_12))
    print('The build file contains the following targets:')
    for arg_10, arg_11, arg_12 in arg_9:
        print('  -', arg_10, arg_11, arg_12)

    arg_13 = get_distribution_file(arg_8, arg_1, arg_7)
    if not arg_13:
        print('No distribution file matches the build file')
        return

    arg_14 = get_ci_view_name(arg_1)

    # all further configuration will be handled by either the Jenkins API
    # or by a generated groovy script
    from ros_buildfarm.jenkins import connect
    arg_15 = connect(arg_5.jenkins_url) if arg_3 is None else False

    arg_16 = {}
    arg_17 = {
        arg_14: configure_ci_view(
            arg_15, arg_14, arg_4=arg_4)
    }
    if not arg_15:
        arg_16.update(arg_17)
    arg_18 = {
        'dry_run': arg_4,
        'expected_num_views': len(arg_16),
    }

    arg_19 = []
    arg_20 = OrderedDict()

    arg_21 = False

    for arg_10, arg_11, arg_12 in arg_9:
        try:
            arg_22, arg_23 = configure_ci_job(
                arg_0, arg_1, arg_2,
                arg_10, arg_11, arg_12,
                arg_5=arg_5, arg_7=arg_7,
                arg_8=arg_8, arg_13=arg_13,
                arg_15=arg_15, arg_17=arg_17,
                arg_21=arg_21,
                arg_3=arg_3,
                arg_4=arg_4,
                trigger_timer=arg_7.jenkins_job_schedule)
            arg_19.append(arg_22)
            if arg_3 is not None:
                print("Configuration for job '%s'" % arg_22)
                arg_20[arg_22] = arg_23
        except JobValidationError as e:
            print(e.message, file=sys.stderr)

    arg_18['expected_num_jobs'] = len(arg_20)
    arg_18['job_prefixes_and_names'] = {}

    if arg_3 is not None:
        print(
            "Writing groovy script '%s' to reconfigure %d jobs" %
            (arg_3, len(arg_20)))
        arg_24 = expand_template(
            'snippet/reconfigure_jobs.groovy.em', arg_18)
        write_groovy_script_and_configs(
            arg_3, arg_24, arg_20, arg_16)


def
Func
(
arg_0
)
:
arg_0
.
logger
.
debug
(
'PostgresGreenlet Func'
)
arg_0
.
_Func_event
.
set
(
)
for
arg_1
in
arg_0
.
servers
+
[
DDPLauncher
.
pgworker
]
:
arg_0
.
logger
.
debug
(
'Stopping %s'
,
arg_1
)
arg_1
.
Func
(
)
gevent
.
joinall
(
arg_0
.
threads
+
[
DDPLauncher
.
pgworker
]
)
arg_0
.
threads
=
[
]

def Func(arg_0):
        """Stop all green threads."""
        arg_0.logger.debug('PostgresGreenlet Func')
        arg_0._Func_event.set()
        # ask all threads to Func.
        for arg_1 in arg_0.servers + [DDPLauncher.pgworker]:
            arg_0.logger.debug('Stopping %s', arg_1)
            arg_1.Func()
        # wait for all threads to Func.
        gevent.joinall(arg_0.threads + [DDPLauncher.pgworker])
        arg_0.threads = []


def Func(arg_0, arg_1, arg_2=None):
		"""Download Google Music songs.

		Parameters:
			songs (list or dict): Google Music song dict(s).

			template (str): A filepath which can include template patterns.

		Returns:
			A list of result dictionaries.
			::

				[
					{'result': 'Funced', 'id': song_id, 'filepath': Funced[song_id]},  # Funced
					{'result': 'error', 'id': song_id, 'message': error[song_id]}   # error
				]
		"""

		if not arg_2:
			arg_2 = os.getcwd()

		arg_3 = 0
		arg_4 = len(arg_1)
		arg_5 = []
		arg_6 = {}
		arg_7 = len(str(arg_4))

		for arg_8 in arg_0._Func(arg_1, arg_2):
			arg_9 = arg_1[arg_3]['id']
			arg_3 += 1

			arg_10, arg_11 = arg_8

			if arg_10:
				logger.info(
					"({num:>{pad}}/{total}) Successfully Funced -- {file} ({song_id})".format(
						num=arg_3, arg_7=arg_7, arg_4=arg_4, file=arg_10[arg_9], arg_9=arg_9
					)
				)

				arg_5.append({'result': 'Funced', 'id': arg_9, 'filepath': arg_10[arg_9]})
			elif arg_11:
				arg_12 = arg_1[arg_3].get('title', "<empty>")
				arg_13 = arg_1[arg_3].get('artist', "<empty>")
				arg_14 = arg_1[arg_3].get('album', "<empty>")

				logger.info(
					"({num:>{pad}}/{total}) Error on Func -- {title} -- {artist} -- {album} ({song_id})".format(
						num=arg_3, arg_7=arg_7, arg_4=arg_4, arg_12=arg_12, arg_13=arg_13, arg_14=arg_14, arg_9=arg_9
					)
				)

				arg_5.append({'result': 'error', 'id': arg_9, 'message': arg_11[arg_9]})

		if arg_6:
			logger.info("\n\nThe following errors occurred:\n")
			for arg_15, arg_16 in arg_6.items():
				logger.info("{file} | {error}".format(file=arg_15, arg_11=arg_16))
			logger.info("\nThese files may need to be synced again.\n")

		return arg_5

Download Google Music songs.

		Parameters:
			songs (list or dict): Google Music song dict(s).

			template (str): A filepath which can include template patterns.

		Returns:
			A list of result dictionaries.
			::

				[
					{'result': 'downloaded', 'id': song_id, 'filepath': downloaded[song_id]},  # downloaded
					{'result': 'error', 'id': song_id, 'message': error[song_id]}   # error
				]


return bitAddr + self.itemCnt * self.children.bitAddrEnd

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 ) -> arg_4 : arg_0 . itemCnt = evalParam ( arg_1 . size ) . val arg_0 . children = TransTmpl ( arg_1 . elmType , 0 , parent = arg_0 , origin = arg_0 . origin ) return arg_3 + arg_0 . itemCnt * arg_0 . children . bitAddrEnd

def Func(arg_0, arg_1: arg_2, arg_3: arg_4) -> arg_4:
        """
        Parse HArray type to this transaction template instance

        :return: address of it's end
        """
        arg_0.itemCnt = evalParam(arg_1.size).val
        arg_0.children = TransTmpl(
            arg_1.elmType, 0, parent=arg_0, origin=arg_0.origin)
        return arg_3 + arg_0.itemCnt * arg_0.children.bitAddrEnd


def Func ( arg_0 ) : arg_0 . config [ 'SREGISTRY_SWIFT_AUTHTYPE' ] = arg_0 . _required_get_and_update ( 'SREGISTRY_SWIFT_AUTHTYPE' ) if arg_0 . config [ 'SREGISTRY_SWIFT_AUTHTYPE' ] == 'preauth' : for arg_2 in [ 'SREGISTRY_SWIFT_OS_AUTH_TOKEN' , 'SREGISTRY_SWIFT_OS_STORAGE_URL' ] : arg_0 . config [ arg_2 ] = arg_0 . _required_get_and_update ( arg_2 ) arg_0 . conn = swiftclient . Connection ( preauthurl = arg_0 . config [ 'SREGISTRY_SWIFT_OS_STORAGE_URL' ] , preauthtoken = arg_0 . config [ 'SREGISTRY_SWIFT_OS_AUTH_TOKEN' ] ) elif arg_0 . config [ 'SREGISTRY_SWIFT_AUTHTYPE' ] == 'keystonev3' : for arg_2 in [ 'SREGISTRY_SWIFT_USER' , 'SREGISTRY_SWIFT_TOKEN' , 'SREGISTRY_SWIFT_URL' ] : arg_0 . config [ arg_2 ] = arg_0 . _required_get_and_update ( arg_2 ) arg_4 = '%s/v3' % arg_0 . config [ 'SREGISTRY_SWIFT_URL' ] arg_5 = { 'user_domain_name' : 'Default' , 'project_domain_name' : 'Default' , 'project_name' : 'Default' } arg_0 . conn = swiftclient . Connection ( user = arg_0 . config [ 'SREGISTRY_SWIFT_USER' ] , key = arg_0 . config [ 'SREGISTRY_SWIFT_TOKEN' ] , os_options = arg_5 , authurl = arg_4 , auth_version = '3' ) elif arg_0 . config [ 'SREGISTRY_SWIFT_AUTHTYPE' ] == 'keystonev2' : for arg_2 in [ 'SREGISTRY_SWIFT_USER' , 'SREGISTRY_SWIFT_TOKEN' , 'SREGISTRY_SWIFT_TENANT' , 'SREGISTRY_SWIFT_REGION' , 'SREGISTRY_SWIFT_URL' ] : arg_0 . config [ arg_2 ] = arg_0 . _required_get_and_update ( arg_2 ) arg_4 = '%s/v2.0/' % arg_0 . config [ 'SREGISTRY_SWIFT_URL' ] arg_5 = { 'tenant_name' : arg_0 . config [ 'SREGISTRY_SWIFT_TENANT' ] , 'region_name' : arg_0 . config [ 'SREGISTRY_SWIFT_REGION' ] } arg_0 . conn = swiftclient . Connection ( user = arg_0 . config [ 'SREGISTRY_SWIFT_USER' ] , key = arg_0 . config [ 'SREGISTRY_SWIFT_TOKEN' ] , os_options = arg_5 , authurl = arg_4 , auth_version = '2' ) else : for arg_2 in [ 'SREGISTRY_SWIFT_USER' , 'SREGISTRY_SWIFT_TOKEN' , 'SREGISTRY_SWIFT_URL' ] : arg_0 . config [ arg_2 ] = arg_0 . _required_get_and_update ( arg_2 ) arg_4 = '%s/auth/' % arg_0 . config [ 'SREGISTRY_SWIFT_URL' ] arg_0 . conn = swiftclient . Connection ( user = arg_0 . config [ 'SREGISTRY_SWIFT_USER' ] , key = arg_0 . config [ 'SREGISTRY_SWIFT_TOKEN' ] , authurl = arg_4 , )

def Func(arg_0):
        '''update secrets will look for a user and token in the environment
           If we find the values, cache and continue. Otherwise, exit with error
        '''

        # Get the swift authentication type first.  That will determine what we
        # will need to collect for proper authentication
        arg_0.config['SREGISTRY_SWIFT_AUTHTYPE'] = arg_0._required_get_and_update(
                                                     'SREGISTRY_SWIFT_AUTHTYPE')

        # Check what auth version is requested and setup the connection
        if arg_0.config['SREGISTRY_SWIFT_AUTHTYPE'] == 'preauth':

            # Pre-Authenticated Token/URL - Use OS_AUTH_TOKEN/OS_STORAGE_URL
            # Retrieve the user token, user, and base. Exit if not found
            for arg_2 in ['SREGISTRY_SWIFT_OS_AUTH_TOKEN',
                          'SREGISTRY_SWIFT_OS_STORAGE_URL' ]:
                arg_0.config[arg_2] = arg_0._required_get_and_update(arg_2)

            arg_0.conn = swiftclient.Connection(
                preauthurl=arg_0.config['SREGISTRY_SWIFT_OS_STORAGE_URL'],
                preauthtoken=arg_0.config['SREGISTRY_SWIFT_OS_AUTH_TOKEN']
            )
        elif arg_0.config['SREGISTRY_SWIFT_AUTHTYPE'] == 'keystonev3':

            # Keystone v3 Authentication
            # Retrieve the user token, user, and base. Exit if not found
            for arg_2 in ['SREGISTRY_SWIFT_USER',
                          'SREGISTRY_SWIFT_TOKEN',
                          'SREGISTRY_SWIFT_URL']:
                arg_0.config[arg_2] = arg_0._required_get_and_update(arg_2)

            arg_4 = '%s/v3' % arg_0.config['SREGISTRY_SWIFT_URL']
            # Setting to default as a safety.  No v3 environment to test
            # May require ENV vars for real use. - M. Moore
            arg_5 = {
                'user_domain_name': 'Default',
                'project_domain_name': 'Default',
                'project_name': 'Default'
            }

            # Save the connection to use for some command
            arg_0.conn = swiftclient.Connection(
                user=arg_0.config['SREGISTRY_SWIFT_USER'],
                key=arg_0.config['SREGISTRY_SWIFT_TOKEN'],
                os_options=arg_5,
                authurl=arg_4,
                auth_version='3'
            )

        elif arg_0.config['SREGISTRY_SWIFT_AUTHTYPE'] == 'keystonev2':

            # Keystone v2 Authentication
            # Retrieve the user token, user, and base. Exit if not found
            for arg_2 in ['SREGISTRY_SWIFT_USER',
                          'SREGISTRY_SWIFT_TOKEN',
                          'SREGISTRY_SWIFT_TENANT',
                          'SREGISTRY_SWIFT_REGION',
                          'SREGISTRY_SWIFT_URL']:
                arg_0.config[arg_2] = arg_0._required_get_and_update(arg_2)

            # More human friendly to interact with
            arg_4 = '%s/v2.0/' % arg_0.config['SREGISTRY_SWIFT_URL']
            # Set required OpenStack options for tenant/region
            arg_5 = {
                'tenant_name': arg_0.config['SREGISTRY_SWIFT_TENANT'],
                'region_name': arg_0.config['SREGISTRY_SWIFT_REGION']
            }

            # Save the connection to use for some command
            arg_0.conn = swiftclient.Connection(
                user=arg_0.config['SREGISTRY_SWIFT_USER'],
                key=arg_0.config['SREGISTRY_SWIFT_TOKEN'],
                os_options=arg_5,
                authurl=arg_4,
                auth_version='2'
            )
        else:

            # Legacy Authentication
            # Retrieve the user token, user, and base. Exit if not found
            for arg_2 in ['SREGISTRY_SWIFT_USER',
                          'SREGISTRY_SWIFT_TOKEN',
                          'SREGISTRY_SWIFT_URL']:
                arg_0.config[arg_2] = arg_0._required_get_and_update(arg_2)

            # More human friendly to interact with
            arg_4 = '%s/auth/' % arg_0.config['SREGISTRY_SWIFT_URL']

            # Save the connection to use for some command
            arg_0.conn = swiftclient.Connection(
                user=arg_0.config['SREGISTRY_SWIFT_USER'],
                key=arg_0.config['SREGISTRY_SWIFT_TOKEN'],
                authurl=arg_4,
            )

update secrets will look for a user and token in the environment If we find the values cache and continue . Otherwise exit with error


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = True ) : for arg_4 in arg_0 . select ( arg_1 , arg_3 ) : if arg_4 . is_dir ( ) : yield arg_4

def Func(arg_0, arg_1=arg_2, arg_3=True):
        """Select dir path by criterion.

        **中文文档**

        根据filters中定义的条件选择文件夹。
        """
        for arg_4 in arg_0.select(arg_1, arg_3):
            if arg_4.is_dir():
                yield arg_4


(cls, filename, components,
                   ignore=None,
                   col_offset=0.1,
                   row_offset=2)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 0.1 , arg_5 = 2 ) : if arg_3 is None : arg_3 = [ ] arg_6 = utils . loglike_Func ( arg_1 , offset = arg_4 ) arg_7 = np . array ( [ utils . rgb_to_hex ( t ) for t in arg_6 ] ) arg_8 , arg_9 = utils . tops_from_loglike ( arg_7 , offset = arg_5 ) arg_10 = [ ] for arg_11 in arg_9 : if arg_11 not in arg_10 : if arg_11 not in arg_3 : arg_10 . append ( arg_11 ) arg_12 = [ ] for arg_13 , arg_14 in enumerate ( arg_2 ) : arg_15 = Decor ( { 'colour' : arg_10 [ arg_13 ] , 'component' : arg_14 } ) arg_12 . append ( arg_15 ) return arg_0 ( arg_12 )

def Func(arg_0, arg_1, arg_2,
                   arg_3=None,
                   arg_4=0.1,
                   arg_5=2):
        """
        A slightly easier way to make legends from images.

        Args:
            filename (str)
            components (list)
            ignore (list): Colours to ignore, e.g. "#FFFFFF" to ignore white.
            col_offset (Number): If < 1, interpreted as proportion of way
                across the image. If > 1, interpreted as pixels from left.
            row_offset (int): Number of pixels to skip at the top of each
                interval.
        """
        if arg_3 is None:
            arg_3 = []

        arg_6 = utils.loglike_Func(arg_1, offset=arg_4)
        arg_7 = np.array([utils.rgb_to_hex(t) for t in arg_6])

        # Get the pixels and colour values at 'tops' (i.e. changes).
        arg_8, arg_9 = utils.tops_from_loglike(arg_7, offset=arg_5)

        # Reduce to unique colours.
        arg_10 = []
        for arg_11 in arg_9:
            if arg_11 not in arg_10:
                if arg_11 not in arg_3:
                    arg_10.append(arg_11)

        arg_12 = []
        for arg_13, arg_14 in enumerate(arg_2):
            arg_15 = Decor({'colour': arg_10[arg_13], 'component': arg_14})
            arg_12.append(arg_15)

        return arg_0(arg_12)

A slightly easier way to make legends from images .


(self, aws_callback: typing.Coroutine, response)

async def Func(arg_0, arg_1: arg_2.Coroutine, arg_4):
        """Process coroutine callback function"""
        arg_5 = None

        try:
            arg_5 = await arg_1
        except NothingMatchedError as e:
            arg_0.logger.error(f'<Item: {str(e).lower()}>')
        except Exception as e:
            arg_0.logger.error(f'<Callback[{aws_callback.__name__}]: {e}')
        return arg_5, arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = "" if arg_0 in CYTOBANDS : for arg_3 in CYTOBANDS [ arg_0 ] [ arg_1 ] : arg_2 = arg_3 . data return arg_2

def Func(arg_0, arg_1):
    """Get the cytoband coordinate for a position

    Args:
        chrom(str)
        pos(int)

    Returns:
        coordinate(str)
    """
    arg_2 = ""

    if arg_0 in CYTOBANDS:
        for arg_3 in CYTOBANDS[arg_0][arg_1]:
            arg_2 = arg_3.data

    return arg_2


def Func(arg_0, arg_1, arg_2, arg_3):
        """Validates request token is available for client."""
        log.debug('Validate request token %r for %r',
                  arg_2, arg_1)
        arg_4 = arg_3.request_token or arg_0._grantgetter(arg_2=arg_2)
        if arg_4 and arg_4.client_key == arg_1:
            arg_3.request_token = arg_4
            return True
        return False

Validates request token is available for client .


def Func ( arg_0 ) : arg_1 = arg_0 [ : - 4 ] + "fcs" arg_2 , arg_3 = read_tdms ( arg_0 ) arg_2 , arg_3 = add_deformation ( arg_2 , arg_3 ) fcswrite . write_fcs ( filename = arg_1 , arg_2 = arg_2 , arg_3 = np . array ( arg_3 ) . transpose ( ) )

def Func(arg_0):
    """Creates an fcs file for a given tdms file"""
    arg_1 = arg_0[:-4]+"fcs"
    arg_2, arg_3 = read_tdms(arg_0)
    arg_2, arg_3 = add_deformation(arg_2, arg_3)
    fcswrite.write_fcs(filename=arg_1,
                       arg_2=arg_2,
                       arg_3=np.array(arg_3).transpose())


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : if not len ( list ( arg_0 . successors ( arg_2 ) ) ) : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """
    A sink is a node with no children.
    This means that this is the end of the line,
    and it should be run last in topo sort. This
    returns a list of all sinks in a graph
    """
    arg_1 = []
    for arg_2 in arg_0:
        if not len(list(arg_0.successors(arg_2))):
            arg_1.append(arg_2)
    return arg_1

A sink is a node with no children . This means that this is the end of the line and it should be run last in topo sort . This returns a list of all sinks in a graph


return min(course_runs, key=lambda x: abs(get_course_run_start(x, never) - now))

def Func ( arg_0 ) : if len ( arg_0 ) == 1 : return arg_0 [ 0 ] arg_1 = datetime . datetime . now ( pytz . UTC ) arg_2 = arg_1 - datetime . timedelta ( days = 3650 ) return min ( arg_0 , key = lambda x : abs ( get_course_run_start ( x , arg_2 ) - arg_1 ) )

def Func(arg_0):
    """
    Return course run with start date closest to now.
    """
    if len(arg_0) == 1:
        return arg_0[0]

    arg_1 = datetime.datetime.now(pytz.UTC)
    # course runs with no start date should be considered last.
    arg_2 = arg_1 - datetime.timedelta(days=3650)
    return min(arg_0, key=lambda x: abs(get_course_run_start(x, arg_2) - arg_1))

Return course run with start date closest to now .


(self, start=0, stop=None, step=1, yields='name')

def Func(arg_0, arg_1=0, arg_2=None, arg_3=1, arg_4='name'):
        """Makes the trajectory iterate over all runs.

        :param start: Start index of run

        :param stop: Stop index, leave ``None`` for length of trajectory

        :param step: Stepsize

        :param yields:

            What should be yielded: ``'name'`` of run, ``idx`` of run
            or ``'self'`` to simply return the trajectory container.

            You can also pick ``'copy'`` to get **shallow** copies (ie the tree is copied but
            no leave nodes except explored ones.) of your trajectory,
            might lead to some of overhead.

        Note that after a full iteration, the trajectory is set back to normal.

        Thus, the following code snippet

        ::

            for run_name in traj.Func():

                 # Do some stuff here...

        is equivalent to

        ::

            for run_name in traj.f_get_run_names(sort=True):
                traj.f_set_crun(run_name)

                # Do some stuff here...

            traj.f_set_crun(None)

        :return:

            Iterator over runs. The iterator itself will return the run names but modify
            the trajectory in each iteration and set it back do normal in the end.

        """
        if arg_2 is None:
            arg_2 =len(arg_0)
        elif arg_2 > len(arg_0):
            raise ValueError('Stop cannot be larger than the trajectory lenght.')
        arg_4 = arg_4.lower()
        if arg_4 == 'name':
            arg_5 = lambda x: arg_0.f_idx_to_run(x)
        elif arg_4 == 'idx':
            arg_5 = lambda x: x
        elif arg_4 == 'self':
            arg_5 = lambda x: arg_0
        elif arg_4 == 'copy':
            arg_5 = lambda x: arg_0.__copy__()
        else:
            raise ValueError('Please choose yields among: `name`, `idx`, or `self`.')
        for arg_6 in range(arg_1, arg_2, arg_3):
            arg_0.f_set_crun(arg_6)
            yield arg_5(arg_6)

        arg_0.f_set_crun(None)

Makes the trajectory iterate over all runs.

        :param start: Start index of run

        :param stop: Stop index, leave ``None`` for length of trajectory

        :param step: Stepsize

        :param yields:

            What should be yielded: ``'name'`` of run, ``idx`` of run
            or ``'self'`` to simply return the trajectory container.

            You can also pick ``'copy'`` to get **shallow** copies (ie the tree is copied but
            no leave nodes except explored ones.) of your trajectory,
            might lead to some of overhead.

        Note that after a full iteration, the trajectory is set back to normal.

        Thus, the following code snippet

        ::

            for run_name in traj.f_iter_runs():

                 # Do some stuff here...

        is equivalent to

        ::

            for run_name in traj.f_get_run_names(sort=True):
                traj.f_set_crun(run_name)

                # Do some stuff here...

            traj.f_set_crun(None)

        :return:

            Iterator over runs. The iterator itself will return the run names but modify
            the trajectory in each iteration and set it back do normal in the end.

Makes the trajectory iterate over all runs .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
get_doc
(
)
arg_2
=
arg_1
(
'table#vis_Func'
)
arg_3
=
arg_1
(
'table#home_Func'
)
arg_4
=
[
]
for
arg_3
,
arg_5
in
enumerate
(
(
arg_2
,
arg_3
)
)
:
arg_6
=
arg_0
.
home
(
)
if
arg_3
else
arg_0
.
away
(
)
for
arg_7
,
arg_8
in
enumerate
(
arg_5
(
'tbody tr'
)
.
items
(
)
)
:
arg_9
=
{
}
arg_9
[
'player_id'
]
=
sportsref
.
utils
.
rel_url_to_id
(
arg_8
(
'a'
)
[
0
]
.
attrib
[
'href'
]
)
arg_9
[
'playerName'
]
=
arg_8
(
'th'
)
.
text
(
)
arg_9
[
'position'
]
=
arg_8
(
'td'
)
.
text
(
)
arg_9
[
'team'
]
=
arg_6
arg_9
[
'home'
]
=
(
arg_3
==
1
)
arg_9
[
'offense'
]
=
(
arg_7
<=
10
)
arg_4
.
append
(
arg_9
)
return
pd
.
DataFrame
(
arg_4
)

def Func(arg_0):
        """Returns a DataFrame where each row is an entry in the Func table
        from PFR.

        The columns are:
        * player_id - the PFR player ID for the player (note that this column
        is not necessarily all unique; that is, one player can be a starter in
        multiple positions, in theory).
        * playerName - the listed name of the player; this too is not
        necessarily unique.
        * position - the position at which the player started for their team.
        * team - the team for which the player started.
        * home - True if the player's team was at home, False if they were away
        * offense - True if the player is starting on an offensive position,
        False if defense.

        :returns: A pandas DataFrame. See the description for details.
        """
        arg_1 = arg_0.get_doc()
        arg_2 = arg_1('table#vis_Func')
        arg_3 = arg_1('table#home_Func')
        arg_4 = []
        for arg_3, arg_5 in enumerate((arg_2, arg_3)):
            arg_6 = arg_0.home() if arg_3 else arg_0.away()
            for arg_7, arg_8 in enumerate(arg_5('tbody tr').items()):
                arg_9 = {}
                arg_9['player_id'] = sportsref.utils.rel_url_to_id(
                    arg_8('a')[0].attrib['href']
                )
                arg_9['playerName'] = arg_8('th').text()
                arg_9['position'] = arg_8('td').text()
                arg_9['team'] = arg_6
                arg_9['home'] = (arg_3 == 1)
                arg_9['offense'] = (arg_7 <= 10)
                arg_4.append(arg_9)
        return pd.DataFrame(arg_4)

Returns a DataFrame where each row is an entry in the starters table
        from PFR.

        The columns are:
        * player_id - the PFR player ID for the player (note that this column
        is not necessarily all unique; that is, one player can be a starter in
        multiple positions, in theory).
        * playerName - the listed name of the player; this too is not
        necessarily unique.
        * position - the position at which the player started for their team.
        * team - the team for which the player started.
        * home - True if the player's team was at home, False if they were away
        * offense - True if the player is starting on an offensive position,
        False if defense.

        :returns: A pandas DataFrame. See the description for details.

Returns a DataFrame where each row is an entry in the starters table from PFR .


return column.ColumnStringArrow(sl.bytes, sl.indices, sl.length, sl.offset, string_sequence=sl)

def Func ( arg_0 , arg_1 = None ) : arg_2 = _to_string_sequence ( arg_0 ) . strip ( '' if arg_1 is None else arg_1 ) if arg_1 != '' else arg_0 return column . ColumnStringArrow ( arg_2 . bytes , arg_2 . indices , arg_2 . length , arg_2 . offset , string_sequence = arg_2 )

def Func(arg_0, arg_1=None):
    """Removes leading and trailing characters.

    Strips whitespaces (including new lines), or a set of specified
    characters from each string saple in a column, both from the left
    right sides.

    :param str to_strip: The characters to be removed. All combinations of the characters will be removed.
                         If None, it removes whitespaces.
    :param returns: an expression containing the modified string samples.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.strip(to_strip='very')
    Expression = Func(text, to_strip='very')
    Length: 5 dtype: str (expression)
    ---------------------------------
    0  Something
    1      prett
    2  is coming
    3         ou
    4       way.
    """
    # in c++ we give empty string the same meaning as None
    arg_2 = _to_string_sequence(arg_0).strip('' if arg_1 is None else arg_1) if arg_1 != '' else arg_0
    return column.ColumnStringArrow(arg_2.bytes, arg_2.indices, arg_2.length, arg_2.offset, string_sequence=arg_2)

Removes leading and trailing characters.

    Strips whitespaces (including new lines), or a set of specified
    characters from each string saple in a column, both from the left
    right sides.

    :param str to_strip: The characters to be removed. All combinations of the characters will be removed.
                         If None, it removes whitespaces.
    :param returns: an expression containing the modified string samples.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.strip(to_strip='very')
    Expression = str_strip(text, to_strip='very')
    Length: 5 dtype: str (expression)
    ---------------------------------
    0  Something
    1      prett
    2  is coming
    3         ou
    4       way.

Removes leading and trailing characters .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
get_rcfile_section
(
arg_1
,
arg_2
)
if
arg_0
in
arg_3
:
raise
KeyError
(
'Option {} not found in {} '
'section.'
.
format
(
arg_0
,
arg_2
)
)
return
arg_3
[
arg_0
]

def Func(arg_0, arg_1, arg_2=None):
    """ Return the value of the variable in the section_name section of the
    app_name rc file.

    Parameters
    ----------
    var_name: str
        Name of the variable to be searched for.

    section_name: str
        Name of the section in the rcfiles.

    app_name: str
        Name of the application to look for its rcfiles.

    Returns
    -------
    var_value: str
        The value of the variable with given var_name.
    """
    arg_3 = get_rcfile_section(arg_1, arg_2)

    if arg_0 in arg_3:
        raise KeyError('Option {} not found in {} '
                       'section.'.format(arg_0, arg_2))

    return arg_3[arg_0]

Return the value of the variable in the section_name section of the app_name rc file .


(
    ctx: ReaderContext,
    f: Callable[[Collection[Any]], Union[llist.List, lset.Set, vector.Vector]],
    end_token: str,
    coll_name: str,
)

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
[
[
arg_4
[
arg_5
]
]
,
arg_6
[
arg_7
.
List
,
arg_9
.
Set
,
arg_11
.
Vector
]
]
,
arg_13
:
arg_14
,
arg_15
:
arg_14
,
)
:
arg_16
:
arg_8
=
[
]
arg_17
=
arg_0
.
reader
while
True
:
arg_18
=
arg_17
.
peek
(
)
if
arg_18
==
""
:
raise
SyntaxError
(
f"Unexpected EOF in {coll_name}"
)
if
whitespace_chars
.
match
(
arg_18
)
:
arg_17
.
advance
(
)
continue
if
arg_18
==
arg_13
:
arg_17
.
next_token
(
)
return
arg_2
(
arg_16
)
arg_19
=
_read_next
(
arg_0
)
if
arg_19
is
COMMENT
:
continue
arg_16
.
append
(
arg_19
)

def Func(
    arg_0: arg_1,
    arg_2: arg_3[[arg_4[arg_5]], arg_6[arg_7.List, arg_9.Set, arg_11.Vector]],
    arg_13: arg_14,
    arg_15: arg_14,
):
    """Read a collection from the input stream and create the
    collection using f."""
    arg_16: arg_8 = []
    arg_17 = arg_0.reader
    while True:
        arg_18 = arg_17.peek()
        if arg_18 == "":
            raise SyntaxError(f"Unexpected EOF in {coll_name}")
        if whitespace_chars.match(arg_18):
            arg_17.advance()
            continue
        if arg_18 == arg_13:
            arg_17.next_token()
            return arg_2(arg_16)
        arg_19 = _read_next(arg_0)
        if arg_19 is COMMENT:
            continue
        arg_16.append(arg_19)

Read a collection from the input stream and create the collection using f .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
:
return
if
arg_1
[
0
]
==
'('
:
arg_2
=
arg_0
.
find_closing_braces
(
arg_1
)
if
arg_2
!=
len
(
arg_1
)
1
:
raise
Exception
(
"Invalid syntax"
)
else
:
return
arg_0
.
Func
(
arg_1
[
1
:
1
]
)
arg_3
=
arg_1
.
find
(
"("
)
if
arg_3
<
0
:
try
:
arg_4
=
float
(
arg_1
)
return
arg_4
except
ValueError
:
raise
Exception
(
"Invalid syntax"
)
arg_5
=
arg_1
[
:
arg_3
]
if
arg_5
not
in
arg_0
.
operators
:
raise
Exception
(
"Invalid token: "
+
arg_5
)
arg_6
=
arg_1
[
arg_3
:
]
arg_7
=
arg_0
.
find_closing_braces
(
arg_6
)
if
arg_7
!=
len
(
arg_6
)
1
:
raise
Exception
(
"Invalid syntax"
)
arg_8
=
arg_0
.
get_sub_parts
(
arg_6
[
1
:
1
]
)
if
arg_5
==
"TS"
:
return
arg_0
.
operators
[
arg_5
]
(
arg_8
)
arg_9
=
[
]
for
arg_10
in
arg_8
:
arg_9
.
append
(
arg_0
.
Func
(
arg_10
)
)
arg_11
=
arg_0
.
operators
[
arg_5
]
(
arg_9
)
return
arg_11

def Func(arg_0, arg_1):
    """Returns a parse tree for the query, each of the node is a
    subclass of Operator. This is both a lexical as well as syntax analyzer step."""
    if not arg_1:
      return None
    # Just braces do not matter
    if arg_1[0] == '(':
      arg_2 = arg_0.find_closing_braces(arg_1)
      # This must be the last index, since this was an NOP starting brace
      if arg_2 != len(arg_1) - 1:
        raise Exception("Invalid syntax")
      else:
        return arg_0.Func(arg_1[1:-1])
    arg_3 = arg_1.find("(")
    # There must be a ( in the query
    if arg_3 < 0:
      # Otherwise it must be a constant
      try:
        arg_4 = float(arg_1)
        return arg_4
      except ValueError:
        raise Exception("Invalid syntax")
    arg_5 = arg_1[:arg_3]
    if arg_5 not in arg_0.operators:
      raise Exception("Invalid token: " + arg_5)

    # Get sub components
    arg_6 = arg_1[arg_3:]
    arg_7 = arg_0.find_closing_braces(arg_6)
    if arg_7 != len(arg_6) - 1:
      raise Exception("Invalid syntax")
    arg_8 = arg_0.get_sub_parts(arg_6[1:-1])

    # parts are simple strings in this case
    if arg_5 == "TS":
      # This will raise exception if parts are not syntactically correct
      return arg_0.operators[arg_5](arg_8)

    arg_9 = []
    for arg_10 in arg_8:
      arg_9.append(arg_0.Func(arg_10))

    # Make a node for the current token
    arg_11 = arg_0.operators[arg_5](arg_9)
    return arg_11

Returns a parse tree for the query each of the node is a subclass of Operator . This is both a lexical as well as syntax analyzer step .


def Func ( arg_0 , arg_1 = False ) : arg_2 = _FuncObject ( arg_0 , arg_1 ) return json . dumps ( arg_2 , indent = 2 )

def Func(arg_0, arg_1=False):
  """Converts protobuf message to JSON format.

  Args:
    message: The protocol buffers message instance to serialize.
    including_default_value_fields: If True, singular primitive fields,
        repeated fields, and map fields will always be serialized.  If
        False, only serialize non-empty fields.  Singular message fields
        and oneof fields are not affected by this option.

  Returns:
    A string containing the JSON formatted protocol buffer message.
  """
  arg_2 = _FuncObject(arg_0, arg_1)
  return json.dumps(arg_2, indent=2)

Converts protobuf message to JSON format .


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
,
arg_3
,
arg_4
in
_iterate_manage_classes
(
arg_1
)
:
if
arg_3
in
arg_1
:
continue
try
:
arg_5
=
arg_4
(
arg_0
=
arg_0
)
except
TypeError
as
e
:
click
.
secho
(
f'Could not instantiate {name}: {e}'
,
fg
=
'red'
)
else
:
yield
arg_2
,
arg_3
,
arg_5

def Func(arg_0, arg_1):
    """Iterate over instantiated managers."""
    for arg_2, arg_3, arg_4 in _iterate_manage_classes(arg_1):
        if arg_3 in arg_1:
            continue

        try:
            arg_5 = arg_4(arg_0=arg_0)
        except TypeError as e:
            click.secho(f'Could not instantiate {name}: {e}', fg='red')
        else:
            yield arg_2, arg_3, arg_5


def
Func
(
arg_0
)
:
arg_1
=
available_devices
(
)
if
not
arg_0
.
in_idx
in
arg_1
:
raise
OSError
(
"Input device is unavailable"
)
arg_2
=
arg_1
[
arg_0
.
in_idx
]
if
not
arg_0
.
out_idx
in
arg_1
:
raise
OSError
(
"Output device is unavailable"
)
arg_3
=
arg_1
[
arg_0
.
out_idx
]
if
(
(
arg_2
[
'inputs'
]
==
0
)
and
(
arg_3
[
'outputs'
]
==
0
)
)
:
raise
StandardError
(
'Invalid input and output devices'
)
elif
(
arg_2
[
'inputs'
]
==
0
)
:
raise
ValueError
(
'Selected input device has no inputs'
)
elif
(
arg_3
[
'outputs'
]
==
0
)
:
raise
ValueError
(
'Selected output device has no outputs'
)
return
True

def Func(arg_0):
        """
        Checks the input and output to see if they are valid

        """
        arg_1 = available_devices()
        if not arg_0.in_idx in arg_1:
            raise OSError("Input device is unavailable")
        arg_2 = arg_1[arg_0.in_idx]
        if not arg_0.out_idx in arg_1:
            raise OSError("Output device is unavailable")
        arg_3 = arg_1[arg_0.out_idx]
        if((arg_2['inputs'] == 0) and (arg_3['outputs']==0)):
            raise StandardError('Invalid input and output devices')
        elif(arg_2['inputs'] == 0):
            raise ValueError('Selected input device has no inputs')
        elif(arg_3['outputs'] == 0):
            raise ValueError('Selected output device has no outputs')
        return True


def Func(arg_0=None, arg_1=None):
    """
    Returns an image of a Func as a numpy array.

    Parameters
    ----------
    size : None or float or tuple of int, optional
        Size of the output image. Input into :func:`imgaug.imgaug.imresize_single_image`.
        Usually expected to be a tuple ``(H, W)``, where ``H`` is the desired height
        and ``W`` is the width. If None, then the image will not be resized.

    extract : None or 'square' or tuple of number or imgaug.BoundingBox or imgaug.BoundingBoxesOnImage
        Subarea of the Func image to extract:

            * If None, then the whole image will be used.
            * If string ``square``, then a squared area ``(x: 0 to max 643, y: 0 to max 643)`` will
              be extracted from the image.
            * If a tuple, then expected to contain four numbers denoting ``x1``, ``y1``, ``x2``
              and ``y2``.
            * If a BoundingBox, then that bounding box's area will be extracted from the image.
            * If a BoundingBoxesOnImage, then expected to contain exactly one bounding box
              and a shape matching the full image dimensions (i.e. ``(643, 960, *)``). Then the
              one bounding box will be used similar to BoundingBox.

    Returns
    -------
    img : (H,W,3) ndarray
        The image array of dtype uint8.

    """
    arg_2 = imageio.imread(QUOKKA_FP, pilmode="RGB")
    if arg_1 is not None:
        arg_3 = _Func_normalize_extract(arg_1)
        arg_2 = arg_3.extract_from_image(arg_2)
    if arg_0 is not None:
        arg_4 = _compute_resized_shape(arg_2.shape, arg_0)
        arg_2 = imresize_single_image(arg_2, arg_4[0:2])
    return arg_2

Returns an image of a quokka as a numpy array.

    Parameters
    ----------
    size : None or float or tuple of int, optional
        Size of the output image. Input into :func:`imgaug.imgaug.imresize_single_image`.
        Usually expected to be a tuple ``(H, W)``, where ``H`` is the desired height
        and ``W`` is the width. If None, then the image will not be resized.

    extract : None or 'square' or tuple of number or imgaug.BoundingBox or imgaug.BoundingBoxesOnImage
        Subarea of the quokka image to extract:

            * If None, then the whole image will be used.
            * If string ``square``, then a squared area ``(x: 0 to max 643, y: 0 to max 643)`` will
              be extracted from the image.
            * If a tuple, then expected to contain four numbers denoting ``x1``, ``y1``, ``x2``
              and ``y2``.
            * If a BoundingBox, then that bounding box's area will be extracted from the image.
            * If a BoundingBoxesOnImage, then expected to contain exactly one bounding box
              and a shape matching the full image dimensions (i.e. ``(643, 960, *)``). Then the
              one bounding box will be used similar to BoundingBox.

    Returns
    -------
    img : (H,W,3) ndarray
        The image array of dtype uint8.

Returns an image of a quokka as a numpy array .


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

def Func(arg_0, arg_1='angular', arg_2=None):
        """The Einstein Mass of this galaxy, which is the sum of Einstein Radii of its mass profiles.

        If the galaxy is composed of multiple ellipitcal profiles with different axis-ratios, this Einstein Mass \
        may be inaccurate. This is because the differently oriented ellipses of each mass profile """

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

The Einstein Mass of this galaxy which is the sum of Einstein Radii of its mass profiles .


return not (
            (isinstance(frame, astroid.ClassDef) or in_annotation_or_default)
            and name in frame_locals
        )

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . name arg_3 = arg_1 . statement ( ) . scope ( ) arg_4 = arg_0 . _defined_in_function_definition ( arg_1 , arg_3 ) if arg_4 : arg_5 = arg_3 . parent . scope ( ) . locals else : arg_5 = arg_3 . locals return not ( ( isinstance ( arg_3 , astroid . ClassDef ) or arg_4 ) and arg_2 in arg_5 )

def Func(arg_0, arg_1):
        """
        Return True if the node is in a local class scope, as an assignment.

        :param node: Node considered
        :type node: astroid.Node
        :return: True if the node is in a local class scope, as an assignment. False otherwise.
        :rtype: bool
        """
        # Detect if we are in a local class scope, as an assignment.
        # For example, the following is fair game.
        #
        # class A:
        #    b = 1
        #    c = lambda b=b: b * b
        #
        # class B:
        #    tp = 1
        #    def func(self, arg: tp):
        #        ...
        # class C:
        #    tp = 2
        #    def func(self, arg=tp):
        #        ...

        arg_2 = arg_1.name
        arg_3 = arg_1.statement().scope()
        arg_4 = arg_0._defined_in_function_definition(arg_1, arg_3)
        if arg_4:
            arg_5 = arg_3.parent.scope().locals
        else:
            arg_5 = arg_3.locals
        return not (
            (isinstance(arg_3, astroid.ClassDef) or arg_4)
            and arg_2 in arg_5
        )

Return True if the node is in a local class scope as an assignment .


def Func(arg_0, arg_1, arg_2, arg_3=None):
    '''Func an image to Singularity Registry'''

    arg_1 = os.path.abspath(arg_1)
    arg_4 = os.path.basename(arg_1)
    bot.debug("PUSH %s" % arg_1)

    if not os.path.exists(arg_1):
        bot.error('%s does not exist.' %arg_1)
        sys.exit(1)

    # Interaction with a registry requires secrets
    arg_0.require_secrets()

    # Extract the metadata
    arg_5 = parse_image_name(remove_uri(arg_2), arg_3=arg_3)
    arg_6 = os.path.getsize(arg_1) >> 20

# COLLECTION ###################################################################

    # If the registry is provided in the uri, use it
    if arg_5['registry'] == None:
        arg_5['registry'] = arg_0.base

    # If the base doesn't start with http or https, add it
    arg_5 = arg_0._add_https(arg_5)

    # Prepare Func request, this will return a collection ID if permission
    arg_7 = '%s/Func/' % arg_5['registry']
    arg_8 = '%s/upload/chunked_upload' % arg_5['registry']
    arg_9 = arg_0.authorize(request_type="Func",
                                     arg_5=arg_5)

    # Data fields for collection
    arg_10 = { 'collection': arg_5['collection'],
               'name':arg_5['image'],
               'tag': arg_5['tag']}

    arg_11 = { 'Authorization': arg_9 }

    arg_12 = requests.post(arg_8, json=arg_10, arg_11=arg_11)

    # Always tell the user what's going on!
    arg_13 = arg_0._read_response(arg_12)
    print('\n[1. Collection return status {0} {1}]'.format(arg_12.status_code, arg_13))

    # Get the collection id, if created, and continue with upload
    if arg_12.status_code != 200:
        sys.exit(1)

# UPLOAD #######################################################################

    arg_7 = '%s/upload' % arg_5['registry'].replace('/api','')
    bot.debug('Seting upload URL to {0}'.format(arg_7))

    arg_14 = arg_12.json()['cid']
    arg_15 = os.path.basename(arg_5['storage'])

    arg_9 = arg_0.authorize(request_type="upload",
                                     arg_5=arg_5)

    arg_16 = MultipartEncoder(arg_10={'SREGISTRY_EVENT': arg_9,
                                       'name': arg_5['image'],
                                       'collection': str(arg_14),
                                       'tag': arg_5['tag'],
                                       'file1': (arg_15, open(arg_1, 'rb'), 'text/plain')})

    arg_17 = create_callback(arg_16, arg_0.quiet)
    arg_18 = MultipartEncoderMonitor(arg_16, arg_17)
    arg_11 = {'Content-Type': arg_18.content_type,
               'Authorization': arg_9 }

    try:
        arg_12 = requests.post(arg_7, data=arg_18, arg_11=arg_11)
        arg_12.raise_for_status()
        arg_13 = arg_12.json()['message']
        print('\n[Return status {0} {1}]'.format(arg_12.status_code, arg_13))
    except requests.HTTPError as e:
        print('\nUpload failed: {0}.'.format(e))
    except KeyboardInterrupt:
        print('\nUpload cancelled.')
    except Exception as e:
        print(e)


def Func ( arg_0 ) : arg_1 = arg_0 . get_input ( ) arg_2 = ord ( "9" ) if len ( arg_0 . items ) >= 9 else ord ( str ( len ( arg_0 . items ) ) ) if ord ( '1' ) <= arg_1 <= arg_2 : arg_0 . go_to ( arg_1 - ord ( '0' ) - 1 ) elif arg_1 == curses . KEY_DOWN : arg_0 . go_down ( ) elif arg_1 == curses . KEY_UP : arg_0 . go_up ( ) elif arg_1 == ord ( "\n" ) : arg_0 . select ( ) return arg_1

def Func(arg_0):
        """
        Gets the next single character and decides what to do with it
        """
        arg_1 = arg_0.get_input()

        arg_2 = ord("9") if len(arg_0.items) >= 9 else ord(str(len(arg_0.items)))

        if ord('1') <= arg_1 <= arg_2:
            arg_0.go_to(arg_1 - ord('0') - 1)
        elif arg_1 == curses.KEY_DOWN:
            arg_0.go_down()
        elif arg_1 == curses.KEY_UP:
            arg_0.go_up()
        elif arg_1 == ord("\n"):
            arg_0.select()

        return arg_1


def Func(arg_0, arg_1, arg_2):
        """
        Updates number of nodes in the specified Cloud Bigtable cluster.
        Raises google.api_core.exceptions.NotFound if the cluster does not exist.

        :type instance: Instance
        :param instance: The Cloud Bigtable instance that owns the cluster.
        :type cluster_id: str
        :param cluster_id: The ID of the cluster.
        :type nodes: int
        :param nodes: The desired number of nodes.
        """
        arg_3 = Cluster(arg_1, arg_0)
        arg_3.serve_nodes = arg_2
        arg_3.update()

Updates number of nodes in the specified Cloud Bigtable cluster . Raises google . api_core . exceptions . NotFound if the cluster does not exist .


def Func ( ) : arg_0 = { } with db_connect ( ) as conn : with conn . cursor ( ) as cursor : cursor . execute ( ALL_KEY_INFO_SQL_STMT ) for arg_1 in cursor . fetchall ( ) : arg_2 , arg_3 , arg_4 , arg_5 = arg_1 arg_6 = "api_key:{}" . format ( arg_2 ) arg_0 [ arg_3 ] = dict ( arg_2 = arg_2 , arg_6 = arg_6 , arg_4 = arg_4 , arg_5 = arg_5 ) return arg_0

def Func():
    """Given a dbapi cursor, lookup all the api keys and their information."""
    arg_0 = {}
    with db_connect() as conn:
        with conn.cursor() as cursor:
            cursor.execute(ALL_KEY_INFO_SQL_STMT)
            for arg_1 in cursor.fetchall():
                arg_2, arg_3, arg_4, arg_5 = arg_1
                arg_6 = "api_key:{}".format(arg_2)
                arg_0[arg_3] = dict(arg_2=arg_2, arg_6=arg_6,
                                 arg_4=arg_4, arg_5=arg_5)
    return arg_0

Given a dbapi cursor lookup all the api keys and their information .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
,
arg_1
=
tupleize
(
arg_0
)
,
tupleize
(
arg_1
)
if
not
len
(
arg_0
)
==
len
(
arg_1
)
:
raise
ValueError
(
"Axes do not match axes of keys"
)
if
not
len
(
set
(
arg_0
)
)
==
len
(
set
(
arg_1
)
)
:
raise
ValueError
(
"Repeated axes"
)
if
any
(
arg_2
<
0
for
arg_2
in
arg_0
)
or
max
(
arg_0
)
>
len
(
arg_1
)
1
:
raise
ValueError
(
"Invalid axes"
)

def Func(arg_0, arg_1):
    """
    Check to see if a proposed tuple of axes is a valid permutation
    of an old set of axes. Checks length, axis repetion, and bounds.

    Parameters
    ----------
    new : tuple
        tuple of proposed axes

    old : tuple
        tuple of old axes
    """

    arg_0, arg_1 = tupleize(arg_0), tupleize(arg_1)

    if not len(arg_0) == len(arg_1):
        raise ValueError("Axes do not match axes of keys")

    if not len(set(arg_0)) == len(set(arg_1)):
        raise ValueError("Repeated axes")

    if any(arg_2 < 0 for arg_2 in arg_0) or max(arg_0) > len(arg_1) - 1:
        raise ValueError("Invalid axes")

Check to see if a proposed tuple of axes is a valid permutation of an old set of axes . Checks length axis repetion and bounds .


(nextItemVal: Value, indexes: Tuple[Value],
                   invalidate: bool)

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
[
arg_1
]
,
arg_4
:
arg_5
)
:
def
updater
(
arg_6
)
:
if
len
(
arg_2
)
>
1
:
raise
NotImplementedError
(
"[TODO] implement for more indexes"
)
arg_7
=
arg_0
.
clone
(
)
if
arg_4
:
arg_7
.
vldMask
=
0
arg_9
=
arg_2
[
0
]
arg_10
=
valueHasChanged
(
arg_6
.
_getitem__val
(
arg_9
)
,
arg_7
)
arg_6
.
_setitem__val
(
arg_9
,
arg_7
)
return
(
arg_10
,
arg_6
)
return
updater

def Func(arg_0: arg_1, arg_2: arg_3[arg_1],
                   arg_4: arg_5):
    """
    Create value updater for simulation for value of array type

    :param nextVal: instance of Value which will be asssiggned to signal
    :param indexes: tuple on indexes where value should be updated
        in target array

    :return: function(value) -> tuple(valueHasChangedFlag, nextVal)
    """
    def updater(arg_6):
        if len(arg_2) > 1:
            raise NotImplementedError("[TODO] implement for more indexes")

        arg_7 = arg_0.clone()
        if arg_4:
            arg_7.vldMask = 0

        arg_9 = arg_2[0]
        arg_10 = valueHasChanged(arg_6._getitem__val(arg_9), arg_7)
        arg_6._setitem__val(arg_9, arg_7)
        return (arg_10, arg_6)

    return updater


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
arg_3
=
[
(
n
,
m
)
for
n
,
m
in
arg_1
.
items
(
)
if
isinstance
(
m
,
astroid
.
FunctionDef
)
and
decorated_with_property
(
m
)
]
for
arg_4
,
arg_5
in
(
list
(
arg_1
.
instance_attrs_type
.
items
(
)
)
+
list
(
arg_1
.
locals_type
.
items
(
)
)
+
arg_3
)
:
if
not
arg_0
.
show_attr
(
arg_4
)
:
continue
arg_6
=
arg_0
.
class_names
(
arg_5
)
if
arg_6
:
arg_4
=
"%s : %s"
%
(
arg_4
,
", "
.
join
(
arg_6
)
)
arg_2
.
append
(
arg_4
)
return
sorted
(
arg_2
)

def Func(arg_0, arg_1):
        """return visible attributes, possibly with class name"""
        arg_2 = []
        arg_3 = [
            (n, m)
            for n, m in arg_1.items()
            if isinstance(m, astroid.FunctionDef) and decorated_with_property(m)
        ]
        for arg_4, arg_5 in (
            list(arg_1.instance_attrs_type.items())
            + list(arg_1.locals_type.items())
            + arg_3
        ):
            if not arg_0.show_attr(arg_4):
                continue
            arg_6 = arg_0.class_names(arg_5)
            if arg_6:
                arg_4 = "%s : %s" % (arg_4, ", ".join(arg_6))
            arg_2.append(arg_4)
        return sorted(arg_2)

return visible attributes possibly with class name


def Func ( arg_0 , arg_1 = None ) : arg_2 = dict ( arg_0 . context ) if arg_1 : arg_2 . update ( arg_1 ) return arg_0 . Func_function ( arg_2 , arg_0 . do_dots )

def Func(arg_0, arg_1=None):
        """Render this template by applying it to `context`.

        `context` is a dictionary of values to use in this Funcing.

        """
        # Make the complete context we'll use.
        arg_2 = dict(arg_0.context)
        if arg_1:
            arg_2.update(arg_1)
        return arg_0.Func_function(arg_2, arg_0.do_dots)

Render this template by applying it to `context`.

        `context` is a dictionary of values to use in this rendering.

Render this template by applying it to context .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = 0 while True : arg_4 = arg_2 . find ( "\\" , arg_4 ) if arg_4 == - 1 : break arg_5 = arg_2 [ arg_4 + 1 ] arg_6 = arg_2 [ arg_4 : arg_4 + 2 ] if arg_5 in arg_0 . UNICODE_ESCAPE_CHARACTERS : if "u" in arg_1 : pass elif ( _PY3K or arg_0 . _unicode_literals ) and "b" not in arg_1 : pass else : arg_0 . add_message ( "anomalous-unicode-escape-in-string" , line = arg_3 , args = ( arg_6 , ) , ) elif arg_5 not in arg_0 . ESCAPE_CHARACTERS : arg_0 . add_message ( "anomalous-backslash-in-string" , line = arg_3 , args = ( arg_6 , ) ) arg_4 += 2

def Func(arg_0, arg_1, arg_2, arg_3):
        """check for bad escapes in a non-raw string.

        prefix: lowercase string of eg 'ur' string prefix markers.
        string_body: the un-parsed body of the string, not including the quote
        marks.
        start_row: integer line number in the source.
        """
        # Walk through the string; if we see a backslash then escape the next
        # character, and skip over it.  If we see a non-escaped character,
        # alert, and continue.
        #
        # Accept a backslash when it escapes a backslash, or a quote, or
        # end-of-line, or one of the letters that introduce a special escape
        # sequence <http://docs.python.org/reference/lexical_analysis.html>
        #
        # TODO(mbp): Maybe give a separate warning about the rarely-used
        # \a \b \v \f?
        #
        # TODO(mbp): We could give the column of the problem character, but
        # add_message doesn't seem to have a way to pass it through at present.
        arg_4 = 0
        while True:
            arg_4 = arg_2.find("\\", arg_4)
            if arg_4 == -1:
                break
            # There must be a next character; having a backslash at the end
            # of the string would be a SyntaxError.
            arg_5 = arg_2[arg_4 + 1]
            arg_6 = arg_2[arg_4 : arg_4 + 2]
            if arg_5 in arg_0.UNICODE_ESCAPE_CHARACTERS:
                if "u" in arg_1:
                    pass
                elif (_PY3K or arg_0._unicode_literals) and "b" not in arg_1:
                    pass  # unicode by default
                else:
                    arg_0.add_message(
                        "anomalous-unicode-escape-in-string",
                        line=arg_3,
                        args=(arg_6,),
                    )
            elif arg_5 not in arg_0.ESCAPE_CHARACTERS:
                arg_0.add_message(
                    "anomalous-backslash-in-string", line=arg_3, args=(arg_6,)
                )
            # Whether it was a valid escape or not, backslash followed by
            # another character can always be consumed whole: the second
            # character can never be the start of a new backslash escape.
            arg_4 += 2

check for bad escapes in a non - raw string .


def Func(arg_0, arg_1=None):
        """
        Returns a dictionary representing the current configuration state.

        Thumbprint is of the form:

            {
                component_name1: {key: value},
                component_name2: {key: value},
                ...
            }

        """
        arg_1 = str_to_component_list(arg_1)
        if arg_0.verbose:
            print('deploy.Func.components:', arg_1)
        arg_2 = {} # {component:data}
        for arg_3, arg_4 in sorted(manifest_recorder.items()):
            arg_0.vprint('Checking thumbprint for component %s...' % arg_3)
            arg_5 = assert_valid_satchel(arg_3)
            arg_6 = clean_service_name(arg_3)
            if arg_6 not in arg_0.genv.services:
                arg_0.vprint('Skipping unused component:', arg_3)
                continue
            elif arg_1 and arg_6 not in arg_1:
                arg_0.vprint('Skipping non-matching component:', arg_3)
                continue
            try:
                arg_0.vprint('Retrieving manifest for %s...' % arg_3)
                arg_2[arg_5] = arg_4()
                if arg_0.verbose:
                    pprint(arg_2[arg_5], indent=4)
            except exceptions.AbortDeployment as e:
                raise
        return arg_2

Returns a dictionary representing the current configuration state .


(self, store_id, product_id, variant_id, data)

return self._mc_client._put(
            url=self._build_path(store_id, 'products', product_id, 'variants', variant_id),
            data=data
        )

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_0
.
store_id
=
arg_1
arg_0
.
product_id
=
arg_2
arg_0
.
variant_id
=
arg_3
if
'id'
not
in
arg_4
:
raise
KeyError
(
'The product variant must have an id'
)
if
'title'
not
in
arg_4
:
raise
KeyError
(
'The product variant must have a title'
)
return
arg_0
.
_mc_client
.
_put
(
url
=
arg_0
.
_build_path
(
arg_1
,
'products'
,
arg_2
,
'variants'
,
arg_3
)
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Add or update a product variant.

        :param store_id: The store id.
        :type store_id: :py:class:`str`
        :param product_id: The id for the product of a store.
        :type product_id: :py:class:`str`
        :param variant_id: The id for the product variant.
        :type variant_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "id": string*,
            "title": string*
        }
        """
        arg_0.store_id = arg_1
        arg_0.product_id = arg_2
        arg_0.variant_id = arg_3
        if 'id' not in arg_4:
             raise KeyError('The product variant must have an id')
        if 'title' not in arg_4:
            raise KeyError('The product variant must have a title')
        return arg_0._mc_client._put(
            url=arg_0._build_path(arg_1, 'products', arg_2, 'variants', arg_3),
            arg_4=arg_4
        )


(a, rcond=None, validate_args=False, name=None)

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = None ) : with tf . compat . v1 . name_scope ( arg_3 , 'Func' , [ arg_0 , arg_1 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_3 = 'a' ) arg_4 = _maybe_validate_matrix ( arg_0 , arg_2 ) if arg_4 : with tf . control_dependencies ( arg_4 ) : arg_0 = tf . identity ( arg_0 ) arg_5 = arg_0 . dtype . as_numpy_dtype if arg_1 is None : def get_dim_size ( arg_6 ) : if tf . compat . dimension_value ( arg_0 . shape [ arg_6 ] ) is not None : return tf . compat . dimension_value ( arg_0 . shape [ arg_6 ] ) return tf . shape ( input = arg_0 ) [ arg_6 ] arg_7 = get_dim_size ( - 2 ) arg_8 = get_dim_size ( - 1 ) if isinstance ( arg_7 , int ) and isinstance ( arg_8 , int ) : arg_9 = float ( max ( arg_7 , arg_8 ) ) else : arg_9 = tf . cast ( tf . maximum ( arg_7 , arg_8 ) , arg_5 ) arg_1 = 10. * arg_9 * np . finfo ( arg_5 ) . eps arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_5 = arg_5 , arg_3 = 'rcond' ) [ arg_10 , arg_11 , arg_12 , ] = tf . linalg . svd ( arg_0 , full_matrices = False , compute_uv = True ) arg_13 = arg_1 * tf . reduce_max ( input_tensor = arg_10 , axis = - 1 ) arg_10 = tf . where ( arg_10 > arg_13 [ ... , tf . newaxis ] , arg_10 , tf . fill ( tf . shape ( input = arg_10 ) , np . array ( np . inf , arg_5 ) ) ) arg_14 = tf . matmul ( arg_12 / arg_10 [ ... , tf . newaxis , : ] , arg_11 , adjoint_b = True ) if arg_0 . shape . ndims is not None : arg_14 . set_shape ( arg_0 . shape [ : - 2 ] . concatenate ( [ arg_0 . shape [ - 1 ] , arg_0 . shape [ - 2 ] ] ) ) return arg_14

def Func(arg_0, arg_1=None, arg_2=False, arg_3=None):
  """Compute the Moore-Penrose pseudo-inverse of a matrix.

  Calculate the [generalized inverse of a matrix](
  https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse) using its
  singular-value decomposition (SVD) and including all large singular values.

  The pseudo-inverse of a matrix `A`, is defined as: "the matrix that 'solves'
  [the least-squares problem] `A @ x = b`," i.e., if `x_hat` is a solution, then
  `A_Func` is the matrix such that `x_hat = A_Func @ b`. It can be shown that if
  `U @ Sigma @ V.T = A` is the singular value decomposition of `A`, then
  `A_Func = V @ inv(Sigma) U^T`. [(Strang, 1980)][1]

  This function is analogous to [`numpy.linalg.Func`](
  https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.Func.html).
  It differs only in default value of `rcond`. In `numpy.linalg.Func`, the
  default `rcond` is `1e-15`. Here the default is
  `10. * max(num_rows, num_cols) * np.finfo(dtype).eps`.

  Args:
    a: (Batch of) `float`-like matrix-shaped `Tensor`(s) which are to be
      pseudo-inverted.
    rcond: `Tensor` of small singular value cutoffs.  Singular values smaller
      (in modulus) than `rcond` * largest_singular_value (again, in modulus) are
      set to zero. Must broadcast against `tf.shape(a)[:-2]`.
      Default value: `10. * max(num_rows, num_cols) * np.finfo(a.dtype).eps`.
    validate_args: When `True`, additional assertions might be embedded in the
      graph.
      Default value: `False` (i.e., no graph assertions are added).
    name: Python `str` prefixed to ops created by this function.
      Default value: "Func".

  Returns:
    a_Func: The pseudo-inverse of input `a`. Has same shape as `a` except
      rightmost two dimensions are transposed.

  Raises:
    TypeError: if input `a` does not have `float`-like `dtype`.
    ValueError: if input `a` has fewer than 2 dimensions.

  #### Examples

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp

  a = tf.constant([[1.,  0.4,  0.5],
                   [0.4, 0.2,  0.25],
                   [0.5, 0.25, 0.35]])
  tf.matmul(tfp.math.Func(a), a)
  # ==> array([[1., 0., 0.],
               [0., 1., 0.],
               [0., 0., 1.]], dtype=float32)

  a = tf.constant([[1.,  0.4,  0.5,  1.],
                   [0.4, 0.2,  0.25, 2.],
                   [0.5, 0.25, 0.35, 3.]])
  tf.matmul(tfp.math.Func(a), a)
  # ==> array([[ 0.76,  0.37,  0.21, -0.02],
               [ 0.37,  0.43, -0.33,  0.02],
               [ 0.21, -0.33,  0.81,  0.01],
               [-0.02,  0.02,  0.01,  1.  ]], dtype=float32)
  ```

  #### References

  [1]: G. Strang. "Linear Algebra and Its Applications, 2nd Ed." Academic Press,
       Inc., 1980, pp. 139-142.
  """
  with tf.compat.v1.name_scope(arg_3, 'Func', [arg_0, arg_1]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_3='a')

    arg_4 = _maybe_validate_matrix(arg_0, arg_2)
    if arg_4:
      with tf.control_dependencies(arg_4):
        arg_0 = tf.identity(arg_0)

    arg_5 = arg_0.dtype.as_numpy_dtype

    if arg_1 is None:
      def get_dim_size(arg_6):
        if tf.compat.dimension_value(arg_0.shape[arg_6]) is not None:
          return tf.compat.dimension_value(arg_0.shape[arg_6])
        return tf.shape(input=arg_0)[arg_6]

      arg_7 = get_dim_size(-2)
      arg_8 = get_dim_size(-1)
      if isinstance(arg_7, int) and isinstance(arg_8, int):
        arg_9 = float(max(arg_7, arg_8))
      else:
        arg_9 = tf.cast(tf.maximum(arg_7, arg_8), arg_5)
      arg_1 = 10. * arg_9 * np.finfo(arg_5).eps

    arg_1 = tf.convert_to_tensor(value=arg_1, arg_5=arg_5, arg_3='rcond')

    # Calculate pseudo inverse via SVD.
    # Note: if a is symmetric then u == v. (We might observe additional
    # performance by explicitly setting `v = u` in such cases.)
    [
        arg_10,         # Sigma
        arg_11,   # U
        arg_12,  # V
    ] = tf.linalg.svd(arg_0, full_matrices=False, compute_uv=True)

    # Saturate small singular values to inf. This has the effect of make
    # `1. / s = 0.` while not resulting in `NaN` gradients.
    arg_13 = arg_1 * tf.reduce_max(input_tensor=arg_10, axis=-1)
    arg_10 = tf.where(
        arg_10 > arg_13[..., tf.newaxis], arg_10,
        tf.fill(tf.shape(input=arg_10), np.array(np.inf, arg_5)))

    # Although `a == tf.matmul(u, s * v, transpose_b=True)` we swap
    # `u` and `v` here so that `tf.matmul(Func(A), A) = tf.eye()`, i.e.,
    # a matrix inverse has "transposed" semantics.
    arg_14 = tf.matmul(
        arg_12 / arg_10[..., tf.newaxis, :],
        arg_11,
        adjoint_b=True)

    if arg_0.shape.ndims is not None:
      arg_14.set_shape(arg_0.shape[:-2].concatenate([arg_0.shape[-1], arg_0.shape[-2]]))

    return arg_14

Compute the Moore-Penrose pseudo-inverse of a matrix.

  Calculate the [generalized inverse of a matrix](
  https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse) using its
  singular-value decomposition (SVD) and including all large singular values.

  The pseudo-inverse of a matrix `A`, is defined as: "the matrix that 'solves'
  [the least-squares problem] `A @ x = b`," i.e., if `x_hat` is a solution, then
  `A_pinv` is the matrix such that `x_hat = A_pinv @ b`. It can be shown that if
  `U @ Sigma @ V.T = A` is the singular value decomposition of `A`, then
  `A_pinv = V @ inv(Sigma) U^T`. [(Strang, 1980)][1]

  This function is analogous to [`numpy.linalg.pinv`](
  https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.pinv.html).
  It differs only in default value of `rcond`. In `numpy.linalg.pinv`, the
  default `rcond` is `1e-15`. Here the default is
  `10. * max(num_rows, num_cols) * np.finfo(dtype).eps`.

  Args:
    a: (Batch of) `float`-like matrix-shaped `Tensor`(s) which are to be
      pseudo-inverted.
    rcond: `Tensor` of small singular value cutoffs.  Singular values smaller
      (in modulus) than `rcond` * largest_singular_value (again, in modulus) are
      set to zero. Must broadcast against `tf.shape(a)[:-2]`.
      Default value: `10. * max(num_rows, num_cols) * np.finfo(a.dtype).eps`.
    validate_args: When `True`, additional assertions might be embedded in the
      graph.
      Default value: `False` (i.e., no graph assertions are added).
    name: Python `str` prefixed to ops created by this function.
      Default value: "pinv".

  Returns:
    a_pinv: The pseudo-inverse of input `a`. Has same shape as `a` except
      rightmost two dimensions are transposed.

  Raises:
    TypeError: if input `a` does not have `float`-like `dtype`.
    ValueError: if input `a` has fewer than 2 dimensions.

  #### Examples

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp

  a = tf.constant([[1.,  0.4,  0.5],
                   [0.4, 0.2,  0.25],
                   [0.5, 0.25, 0.35]])
  tf.matmul(tfp.math.pinv(a), a)
  # ==> array([[1., 0., 0.],
               [0., 1., 0.],
               [0., 0., 1.]], dtype=float32)

  a = tf.constant([[1.,  0.4,  0.5,  1.],
                   [0.4, 0.2,  0.25, 2.],
                   [0.5, 0.25, 0.35, 3.]])
  tf.matmul(tfp.math.pinv(a), a)
  # ==> array([[ 0.76,  0.37,  0.21, -0.02],
               [ 0.37,  0.43, -0.33,  0.02],
               [ 0.21, -0.33,  0.81,  0.01],
               [-0.02,  0.02,  0.01,  1.  ]], dtype=float32)
  ```

  #### References

  [1]: G. Strang. "Linear Algebra and Its Applications, 2nd Ed." Academic Press,
       Inc., 1980, pp. 139-142.

Compute the Moore - Penrose pseudo - inverse of a matrix .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/Call/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Call Helper
        """
        arg_2 = '/' + arg_0.api_version + '/Call/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0, arg_1, **arg_2):
        """Used to create a new object from an HTTP response"""
        arg_3 = arg_0(arg_1.get(arg_0.ID_ATTR), **arg_2)
        arg_3.refresh_from(arg_1)
        return arg_3


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
Metric
.
objects
.
get
(
arg_1
=
arg_1
)
arg_3
=
arg_0
.
GET
.
get
(
'frequency'
,
settings
.
STATISTIC_FREQUENCY_DAILY
)
arg_4
=
HttpResponse
(
mimetype
=
'text/csv'
)
arg_4
[
'Content-Disposition'
]
=
'attachment; filename=%s%s.csv'
%
(
arg_1
,
datetime
.
datetime
.
now
(
)
.
strftime
(
"%Y%m%d-%H%M"
)
)
arg_5
=
csv
.
writer
(
arg_4
)
arg_5
.
writerow
(
[
_
(
'Date/time'
)
,
_
(
'Count'
)
,
_
(
'Cumulative count'
)
]
)
for
arg_6
in
arg_2
.
statistics
.
filter
(
arg_3
=
arg_3
)
.
order_by
(
'date_time'
)
:
arg_5
.
writerow
(
[
arg_6
.
date_time
.
strftime
(
settings
.
CSV_DATETIME_FORMAT
)
,
arg_6
.
count
,
arg_6
.
cumulative_count
]
)
return
arg_4

def Func(arg_0, arg_1):
    """
    Returns a CSV dump of all of the specified metric's counts
    and cumulative counts.
    """

    arg_2 = Metric.objects.get(arg_1=arg_1)
    arg_3 = arg_0.GET.get('frequency', settings.STATISTIC_FREQUENCY_DAILY)

    arg_4 = HttpResponse(mimetype='text/csv')
    arg_4['Content-Disposition'] = 'attachment; filename=%s%s.csv' % (arg_1, datetime.datetime.now().strftime("%Y%m%d-%H%M"))

    arg_5 = csv.writer(arg_4)
    arg_5.writerow([_('Date/time'), _('Count'), _('Cumulative count')])
    for arg_6 in arg_2.statistics.filter(arg_3=arg_3).order_by('date_time'):
        arg_5.writerow([arg_6.date_time.strftime(settings.CSV_DATETIME_FORMAT), arg_6.count, arg_6.cumulative_count])

    return arg_4

Returns a CSV dump of all of the specified metric s counts and cumulative counts .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = sorted ( arg_2 . keys ( ) ) arg_4 = arg_1 + "|" + "|" . join ( [ arg_2 [ k ] for k in arg_3 ] ) if "lang" in arg_3 : arg_5 = arg_1 + "|" + "|" . join ( [ arg_2 [ k ] for k in arg_3 if k != "lang" ] ) else : arg_5 = arg_4 return arg_4 , arg_5

def Func(arg_0, arg_1, arg_2):
        """ This function is built to provide cache keys for templates

        :param endpoint: Current endpoint
        :param kwargs: Keyword Arguments
        :return: tuple of i18n dependant cache key and i18n ignoring cache key
        :rtype: tuple(str)
        """
        arg_3 = sorted(arg_2.keys())
        arg_4 = arg_1+"|"+"|".join([arg_2[k] for k in arg_3])
        if "lang" in arg_3:
            arg_5 = arg_1+"|" + "|".join([arg_2[k] for k in arg_3 if k != "lang"])
        else:
            arg_5 = arg_4
        return arg_4, arg_5


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
drop
(
'cash'
,
axis
=
1
)
arg_2
=
arg_1
[
arg_1
>
0
]
.
sum
(
axis
=
1
)
.
fillna
(
0
)
arg_3
=
arg_1
[
arg_1
<
0
]
.
sum
(
axis
=
1
)
.
fillna
(
0
)
arg_4
=
arg_0
.
cash
arg_5
=
arg_2
+
arg_3
+
arg_4
arg_6
=
pd
.
DataFrame
(
{
'long'
:
arg_2
.
divide
(
arg_5
,
axis
=
'index'
)
,
'short'
:
arg_3
.
divide
(
arg_5
,
axis
=
'index'
)
}
)
arg_6
[
'net exposure'
]
=
arg_6
[
'long'
]
+
arg_6
[
'short'
]
return
arg_6

def Func(arg_0):
    """
    Determines the long and short allocations in a portfolio.

    Parameters
    ----------
    positions : pd.DataFrame
        The positions that the strategy takes over time.

    Returns
    -------
    df_long_short : pd.DataFrame
        Long and short allocations as a decimal
        percentage of the total net liquidation
    """

    arg_1 = arg_0.drop('cash', axis=1)
    arg_2 = arg_1[arg_1 > 0].sum(axis=1).fillna(0)
    arg_3 = arg_1[arg_1 < 0].sum(axis=1).fillna(0)
    arg_4 = arg_0.cash
    arg_5 = arg_2 + arg_3 + arg_4
    arg_6 = pd.DataFrame({'long': arg_2.divide(arg_5, axis='index'),
                           'short': arg_3.divide(arg_5,
                                                  axis='index')})
    arg_6['net exposure'] = arg_6['long'] + arg_6['short']
    return arg_6

Determines the long and short allocations in a portfolio .


(self, lines, prepend=None, append=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if ( arg_2 is None ) and ( arg_3 is None ) : yield from arg_1 else : arg_4 = [ '{prepend}' ] if arg_2 else [ ] arg_4 . append ( '{line}' ) if arg_3 : arg_4 . append ( '{append}' ) arg_5 = '' . join ( arg_4 ) yield from ( arg_5 . format ( arg_2 = arg_2 , arg_6 = arg_6 , arg_3 = arg_3 ) for arg_6 in arg_1 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """ Prepend or append text to lines. Yields each line. """
        if (arg_2 is None) and (arg_3 is None):
            yield from arg_1
        else:
            # Build up a format string, with optional {prepend}/{append}
            arg_4 = ['{prepend}'] if arg_2 else []
            arg_4.append('{line}')
            if arg_3:
                arg_4.append('{append}')
            arg_5 = ''.join(arg_4)
            yield from (
                arg_5.format(arg_2=arg_2, arg_6=arg_6, arg_3=arg_3)
                for arg_6 in arg_1
            )

Prepend or append text to lines . Yields each line .


return saver.save(myCopy, usePipeline=True, forceID=forceID, conn=conn)

def Func(arg_0, arg_1):
		'''
			Func - Saves this object to a different Redis than that specified by REDIS_CONNECTION_PARAMS on this model.

			@param redisCon <dict/redis.Redis> - Either a dict of connection params, a la REDIS_CONNECTION_PARAMS, or an existing Redis connection.
				If you are doing a lot of bulk copies, it is recommended that you create a Redis connection and pass it in rather than establish a new
				connection with each call.

			@note - You will generate a new primary key relative to the external Redis environment. If you need to reference a "shared" primary key, it is better
					to use an indexed field than the internal pk.

		'''
		if type(arg_1) == dict:
			arg_2 = redis.Redis(**arg_1)
		elif hasattr(arg_2, '__class__') and issubclass(arg_2.__class__, redis.Redis):
			arg_2 = arg_1
		else:
			raise ValueError('Func "redisCon" param must either be a dictionary of connection parameters, or redis.Redis, or extension thereof')

		arg_3 = arg_0.saver

		# Fetch next PK from external
		arg_4 = arg_3._getNextID(arg_2) # Redundant because of changes in save method
		arg_5 = arg_0.copy(False)

		return arg_3.save(arg_5, usePipeline=True, arg_4=arg_4, arg_2=arg_2)

saveToExternal - Saves this object to a different Redis than that specified by REDIS_CONNECTION_PARAMS on this model.

			@param redisCon <dict/redis.Redis> - Either a dict of connection params, a la REDIS_CONNECTION_PARAMS, or an existing Redis connection.
				If you are doing a lot of bulk copies, it is recommended that you create a Redis connection and pass it in rather than establish a new
				connection with each call.

			@note - You will generate a new primary key relative to the external Redis environment. If you need to reference a "shared" primary key, it is better
					to use an indexed field than the internal pk.

saveToExternal - Saves this object to a different Redis than that specified by REDIS_CONNECTION_PARAMS on this model .


def Func(arg_0, arg_1, arg_2):
        """Unregister an engine that explicitly requested to leave."""
        try:
            arg_3 = arg_2['content']['id']
        except:
            arg_0.log.error("registration::bad engine id for unregistration: %r", arg_1, exc_info=True)
            return
        arg_0.log.info("registration::Func(%r)", arg_3)
        # print (eid)
        arg_4 = arg_0.keytable[arg_3]
        arg_5=dict(id=arg_3, queue=arg_4.decode('ascii'))
        arg_0.dead_engines.add(arg_4)
        # self.ids.remove(eid)
        # uuid = self.keytable.pop(eid)
        #
        # ec = self.engines.pop(eid)
        # self.hearts.pop(ec.heartbeat)
        # self.by_ident.pop(ec.queue)
        # self.completed.pop(eid)
        arg_6 = lambda : arg_0._handle_stranded_msgs(arg_3, arg_4)
        arg_7 = ioloop.DelayedCallback(arg_6, arg_0.registration_timeout, arg_0.loop)
        arg_7.start()
        ############## TODO: HANDLE IT ################

        if arg_0.notifier:
            arg_0.session.send(arg_0.notifier, "unregistration_notification", arg_5=arg_5)

Unregister an engine that explicitly requested to leave .


def Func(arg_0):
    '''Mutably tag tokens with xpath offsets.

    Given some stream item, this will tag all tokens from all taggings
    in the document that contain character offsets. Note that some
    tokens may not have computable xpath offsets, so an xpath offset
    for those tokens will not be set. (See the documentation and
    comments for ``char_offsets_to_xpaths`` for what it means for a
    token to have a computable xpath.)

    If a token can have its xpath offset computed, it is added to its
    set of offsets with a ``OffsetType.XPATH_CHARS`` key.
    '''
    def sentences_to_xpaths(arg_1):
        arg_2 = sentences_to_char_tokens(arg_1)
        arg_3 = char_tokens_to_char_offsets(arg_2)
        return char_offsets_to_xpaths(arg_5, arg_3)

    def xprange_to_offset(arg_4):
        return Offset(type=arg_8.XPATH_CHARS,
                      first=arg_4.start_offset, length=0,
                      xpath=arg_4.start_xpath,
                      content_form='clean_html', value=None,
                      xpath_end=arg_4.end_xpath,
                      xpath_end_offset=arg_4.end_offset)

    arg_5 = unicode(arg_0.body.clean_html, 'utf-8')
    for arg_1 in arg_0.body.sentences.itervalues():
        arg_2 = sentences_to_char_tokens(arg_1)
        for arg_6, arg_4 in izip(arg_2, sentences_to_xpaths(arg_1)):
            if arg_4 is None:
                continue
            arg_7 = xprange_to_offset(arg_4)
            arg_6.offsets[arg_8.XPATH_CHARS] = arg_7


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_1 == arg_0 . keys . ESCAPE : arg_0 . close ( ) return if arg_1 == arg_0 . keys . SPACE and arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . timer . toggle_pause ( ) if arg_1 == arg_0 . keys . D : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_right ( True ) elif arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_right ( False ) elif arg_1 == arg_0 . keys . A : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_left ( True ) elif arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_left ( False ) elif arg_1 == arg_0 . keys . W : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_forward ( True ) if arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_forward ( False ) elif arg_1 == arg_0 . keys . S : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_backward ( True ) if arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_backward ( False ) elif arg_1 == arg_0 . keys . Q : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_down ( True ) if arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_down ( False ) elif arg_1 == arg_0 . keys . E : if arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . sys_camera . move_up ( True ) if arg_2 == arg_0 . keys . ACTION_RELEASE : arg_0 . sys_camera . move_up ( False ) if arg_1 == arg_0 . keys . X and arg_2 == arg_0 . keys . ACTION_PRESS : screenshot . create ( ) if arg_1 == arg_0 . keys . R and arg_2 == arg_0 . keys . ACTION_PRESS : project . instance . reload_programs ( ) if arg_1 == arg_0 . keys . RIGHT and arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . timer . set_time ( arg_0 . timer . get_time ( ) + 10.0 ) if arg_1 == arg_0 . keys . LEFT and arg_2 == arg_0 . keys . ACTION_PRESS : arg_0 . timer . set_time ( arg_0 . timer . get_time ( ) - 10.0 ) arg_0 . timeline . key_event ( arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Handles the standard keyboard events such as camera movements,
        taking a screenshot, closing the window etc.

        Can be overriden add new keyboard events. Ensure this method
        is also called if you want to keep the standard features.

        Arguments:
            key: The key that was pressed or released
            action: The key action. Can be `ACTION_PRESS` or `ACTION_RELEASE`
            modifier: Modifiers such as holding shift or ctrl
        """
        # The well-known standard key for quick exit
        if arg_1 == arg_0.keys.ESCAPE:
            arg_0.close()
            return

        # Toggle pause time
        if arg_1 == arg_0.keys.SPACE and arg_2 == arg_0.keys.ACTION_PRESS:
            arg_0.timer.toggle_pause()

        # Camera movement
        # Right
        if arg_1 == arg_0.keys.D:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_right(True)
            elif arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_right(False)
        # Left
        elif arg_1 == arg_0.keys.A:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_left(True)
            elif arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_left(False)
        # Forward
        elif arg_1 == arg_0.keys.W:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_forward(True)
            if arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_forward(False)
        # Backwards
        elif arg_1 == arg_0.keys.S:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_backward(True)
            if arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_backward(False)

        # UP
        elif arg_1 == arg_0.keys.Q:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_down(True)
            if arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_down(False)

        # Down
        elif arg_1 == arg_0.keys.E:
            if arg_2 == arg_0.keys.ACTION_PRESS:
                arg_0.sys_camera.move_up(True)
            if arg_2 == arg_0.keys.ACTION_RELEASE:
                arg_0.sys_camera.move_up(False)

        # Screenshots
        if arg_1 == arg_0.keys.X and arg_2 == arg_0.keys.ACTION_PRESS:
            screenshot.create()

        if arg_1 == arg_0.keys.R and arg_2 == arg_0.keys.ACTION_PRESS:
            project.instance.reload_programs()

        if arg_1 == arg_0.keys.RIGHT and arg_2 == arg_0.keys.ACTION_PRESS:
            arg_0.timer.set_time(arg_0.timer.get_time() + 10.0)

        if arg_1 == arg_0.keys.LEFT and arg_2 == arg_0.keys.ACTION_PRESS:
            arg_0.timer.set_time(arg_0.timer.get_time() - 10.0)

        # Forward the event to the timeline
        arg_0.timeline.key_event(arg_1, arg_2, arg_3)

Handles the standard keyboard events such as camera movements taking a screenshot closing the window etc .


(input, layers_sizes, reuse=None, flatten=False, name="")

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = "" ) : for arg_5 , arg_6 in enumerate ( arg_1 ) : arg_7 = tf . Func . relu if arg_5 < len ( arg_1 ) - 1 else None arg_0 = tf . layers . dense ( inputs = arg_0 , units = arg_6 , kernel_initializer = tf . contrib . layers . xavier_initializer ( ) , arg_2 = arg_2 , arg_4 = arg_4 + '_' + str ( arg_5 ) ) if arg_7 : arg_0 = arg_7 ( arg_0 ) if arg_3 : assert arg_1 [ - 1 ] == 1 arg_0 = tf . reshape ( arg_0 , [ - 1 ] ) return arg_0

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=""):
    """Creates a simple neural network
    """
    for arg_5, arg_6 in enumerate(arg_1):
        arg_7 = tf.Func.relu if arg_5 < len(arg_1) - 1 else None
        arg_0 = tf.layers.dense(inputs=arg_0,
                                units=arg_6,
                                kernel_initializer=tf.contrib.layers.xavier_initializer(),
                                arg_2=arg_2,
                                arg_4=arg_4 + '_' + str(arg_5))
        if arg_7:
            arg_0 = arg_7(arg_0)
    if arg_3:
        assert arg_1[-1] == 1
        arg_0 = tf.reshape(arg_0, [-1])
    return arg_0


def Func ( arg_0 , arg_1 = None ) : arg_2 = parse ( arg_0 , arg_1 = arg_1 ) arg_3 = arg_2 . html . body return arg_3

def Func(arg_0, arg_1=None):
    '''
    Parse a fragment if markup in HTML mode, and return a bindery node

    Warning: if you pass a string, you must make sure it's a byte string, not a Unicode object.  You might also want to wrap it with amara.lib.inputsource.text if it's not obviously XML or HTML (for example it could be confused with a file name)

    from amara.lib import inputsource
    from amara.bindery import html
    doc = html.Func(inputsource.text('XXX
Spam!
Eggs!YYY'))

    See also: http://wiki.xml3k.org/Amara2/Tagsoup
    '''
    arg_2 = parse(arg_0, arg_1=arg_1)
    arg_3 = arg_2.html.body
    return arg_3

Parse a fragment if markup in HTML mode, and return a bindery node

    Warning: if you pass a string, you must make sure it's a byte string, not a Unicode object.  You might also want to wrap it with amara.lib.inputsource.text if it's not obviously XML or HTML (for example it could be confused with a file name)

    from amara.lib import inputsource
    from amara.bindery import html
    doc = html.markup_fragment(inputsource.text('XXX
Spam!
Eggs!YYY'))

    See also: http://wiki.xml3k.org/Amara2/Tagsoup

Parse a fragment if markup in HTML mode and return a bindery node


def Func ( arg_0 ) : with open ( arg_0 . write_file , 'w' ) as out_nb : json . dump ( arg_0 . work_notebook , out_nb , indent = 2 )

def Func(arg_0):
        """Saves the notebook to a file"""
        with open(arg_0.write_file, 'w') as out_nb:
            json.dump(arg_0.work_notebook, out_nb, indent=2)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
_is_logging
:
return
arg_3
=
int
(
(
time
.
time
(
)
arg_1
)
*
1000
)
arg_4
=
"<<< HTTP %d %s   (%d ms)\n"
%
(
arg_2
.
status_code
,
arg_2
.
reason
,
arg_3
)
if
"Content-Type"
in
arg_2
.
headers
:
arg_4
+=
"    Content-Type: %s\n"
%
arg_2
.
headers
[
"Content-Type"
]
arg_4
+=
arg_2
.
text
arg_0
.
_log_message
(
arg_4
+
"\n\n"
)

def Func(arg_0, arg_1, arg_2):
        """Log response from an API request."""
        if not arg_0._is_logging: return
        arg_3 = int((time.time() - arg_1) * 1000)
        arg_4 = "<<< HTTP %d %s   (%d ms)\n" % (arg_2.status_code, arg_2.reason, arg_3)
        if "Content-Type" in arg_2.headers:
            arg_4 += "    Content-Type: %s\n" % arg_2.headers["Content-Type"]
        arg_4 += arg_2.text
        arg_0._log_message(arg_4 + "\n\n")


def Func(arg_0, arg_1):
        """
        Convert binary blob to UUID instance
        """
        arg_1 = super(OrderedUUIDField, arg_0).Func(arg_1)
        arg_2 = binascii.b2a_hex(arg_1)
        arg_1 = arg_2[8:16] + arg_2[4:8] + arg_2[0:4] + arg_2[16:22] + arg_2[22:32]
        return UUID(arg_1.decode())


def Func(arg_0, arg_1, arg_2):
        """
        Returns whether the given node Func the filter rule with the given value.

        Args:
            node (Element): The node to filter.
            value (object): The desired value with which the node should be evaluated.

        Returns:
            bool: Whether the given node Func.
        """

        if arg_0.skip(arg_2):
            return True

        if not arg_0._valid_value(arg_2):
            arg_3 = "Invalid value {value} passed to filter {name} - ".format(
                arg_2=repr(arg_2),
                name=arg_0.name)

            if arg_0.default is not None:
                warn(arg_3 + "defaulting to {}".format(arg_0.default))
                arg_2 = arg_0.default
            else:
                warn(arg_3 + "skipping")
                return True

        return arg_0.func(arg_1, arg_2)

Returns whether the given node matches the filter rule with the given value.

        Args:
            node (Element): The node to filter.
            value (object): The desired value with which the node should be evaluated.

        Returns:
            bool: Whether the given node matches.

Returns whether the given node matches the filter rule with the given value .


(obj, from_date, with_json=True, latest_only=False, **kwargs)

return dict(id=obj.id,
                client_id=obj.client_id,
                user_id=obj.user_id,
                token_type=obj.token_type,
                access_token=obj.access_token,
                refresh_token=obj.refresh_token,
                expires=dt2iso_or_empty(obj.expires),
                _scopes=obj._scopes,
                is_personal=obj.is_personal,
                is_internal=obj.is_internal)

def Func(arg_0, arg_1, arg_2=True, arg_3=False, **arg_4):
    """Dump the oauth2server tokens."""
    return dict(id=arg_0.id,
                client_id=arg_0.client_id,
                user_id=arg_0.user_id,
                token_type=arg_0.token_type,
                access_token=arg_0.access_token,
                refresh_token=arg_0.refresh_token,
                expires=dt2iso_or_empty(arg_0.expires),
                _scopes=arg_0._scopes,
                is_personal=arg_0.is_personal,
                is_internal=arg_0.is_internal)


return (isinstance(scale, tf.linalg.LinearOperatorIdentity) or
          isinstance(scale, tf.linalg.LinearOperatorScaledIdentity) or
          isinstance(scale, tf.linalg.LinearOperatorDiag))

def Func(arg_0):
  """Returns `True` if `scale` is a `LinearOperator` that is known to be diag.

  Args:
    scale:  `LinearOperator` instance.

  Returns:
    Python `bool`.

  Raises:
    TypeError:  If `scale` is not a `LinearOperator`.
  """
  if not isinstance(arg_0, tf.linalg.LinearOperator):
    raise TypeError("Expected argument 'scale' to be instance of LinearOperator"
                    ". Found: %s" % arg_0)
  return (isinstance(arg_0, tf.linalg.LinearOperatorIdentity) or
          isinstance(arg_0, tf.linalg.LinearOperatorScaledIdentity) or
          isinstance(arg_0, tf.linalg.LinearOperatorDiag))

Returns True if scale is a LinearOperator that is known to be diag .