(self, cluster, project_id=None, retry=DEFAULT, timeout=DEFAULT)

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4, arg_5=arg_4):
        """
        Creates a cluster, consisting of the specified number and type of Google Compute
        Engine instances.

        :param cluster: A Cluster protobuf or dict. If dict is provided, it must
            be of the same form as the protobuf message
            :class:`google.cloud.container_v1.types.Cluster`
        :type cluster: dict or google.cloud.container_v1.types.Cluster
        :param project_id: Google Cloud Platform project ID
        :type project_id: str
        :param retry: A retry object (``google.api_core.retry.Retry``) used to
            retry requests.
            If None is specified, requests will not be retried.
        :type retry: google.api_core.retry.Retry
        :param timeout: The amount of time, in seconds, to wait for the request to
            complete. Note that if retry is specified, the timeout applies to each
            individual attempt.
        :type timeout: float
        :return: The full url to the new, or existing, cluster
        :raises:
            ParseError: On JSON parsing problems when trying to convert dict
            AirflowException: cluster is not dict type nor Cluster proto type
        """

        if isinstance(arg_1, dict):
            arg_6 = Cluster()
            arg_1 = arg_0._dict_to_proto(py_dict=arg_1, proto=arg_6)
        elif not isinstance(arg_1, Cluster):
            raise AirflowException(
                "cluster is not instance of Cluster proto or python dict")

        arg_0._append_label(arg_1, 'airflow-version', 'v' + version.version)

        arg_0.log.info(
            "Creating (project_id=%s, zone=%s, cluster_name=%s)",
            arg_0.project_id, arg_0.location, arg_1.name
        )
        try:
            arg_7 = arg_0.get_client().Func(arg_2=arg_2 or arg_0.project_id,
                                                  zone=arg_0.location,
                                                  arg_1=arg_1,
                                                  arg_3=arg_3,
                                                  arg_5=arg_5)
            arg_7 = arg_0.wait_for_operation(arg_7)

            return arg_7.target_link
        except AlreadyExists as error:
            arg_0.log.info('Assuming Success: %s', error.message)
            return arg_0.get_cluster(name=arg_1.name).self_link

Creates a cluster consisting of the specified number and type of Google Compute Engine instances .


def Func ( arg_0 , arg_1 = 'default' ) : arg_2 = get ( arg_0 , 'instance/service-accounts/{0}/token' . format ( arg_1 ) ) arg_3 = client . _UTCNOW ( ) + datetime . timedelta ( seconds = arg_2 [ 'expires_in' ] ) return arg_2 [ 'access_token' ] , arg_3

def Func(arg_0, arg_1='default'):
    """Fetch an oauth token for the

    Args:
        http: an object to be used to make HTTP requests.
        service_account: An email specifying the service account this token
            should represent. Default will be a token for the "default" service
            account of the current compute engine instance.

    Returns:
         A tuple of (access token, token expiration), where access token is the
         access token as a string and token expiration is a datetime object
         that indicates when the access token will expire.
    """
    arg_2 = get(
        arg_0,
        'instance/service-accounts/{0}/token'.format(arg_1))
    arg_3 = client._UTCNOW() + datetime.timedelta(
        seconds=arg_2['expires_in'])
    return arg_2['access_token'], arg_3


def Func(arg_0, arg_1, arg_2="this feature"):
        """Raises an exception if the given app setting is not defined."""
        if arg_1 not in arg_0.settings:
            raise Exception("You must define the '%s' setting in your "
                            "application to use %s" % (arg_1, arg_2))

Raises an exception if the given app setting is not defined .


return GeneratedPyAST(
        node=ast.Call(func=fn_ast.node, args=list(args_nodes), keywords=[]),
        dependencies=list(chain(fn_ast.dependencies, args_deps)),
    )

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> GeneratedPyAST : assert arg_2 . op == NodeOp . INVOKE arg_4 = gen_py_ast ( arg_0 , arg_2 . fn ) arg_5 , arg_6 = _collection_ast ( arg_0 , arg_2 . args ) return GeneratedPyAST ( arg_2 = ast . Call ( func = arg_4 . node , args = list ( arg_6 ) , keywords = [ ] ) , dependencies = list ( chain ( arg_4 . dependencies , arg_5 ) ) , )

def Func(arg_0: arg_1, arg_2: arg_3) -> GeneratedPyAST:
    """Return a Python AST Node for a Basilisp function invocation."""
    assert arg_2.op == NodeOp.INVOKE

    arg_4 = gen_py_ast(arg_0, arg_2.fn)
    arg_5, arg_6 = _collection_ast(arg_0, arg_2.args)

    return GeneratedPyAST(
        arg_2=ast.Call(func=arg_4.node, args=list(arg_6), keywords=[]),
        dependencies=list(chain(arg_4.dependencies, arg_5)),
    )

Return a Python AST Node for a Basilisp function invocation .


def Func(arg_0, arg_1=True):
		'''
                Func - Reload this object from the database, overriding any local changes and merging in any updates.

		    @param cascadeObjects <bool> Default True. If True, foreign-linked objects will be Funced if their values have changed
		      since last save/fetch. If False, only if the pk changed will the foreign linked objects be Funced.

                    @raises KeyError - if this object has not been saved (no primary key)

                    @return - Dict with the keys that were updated. Key is field name that was updated,
		       and value is tuple of (old value, new value).

		    NOTE: Currently, this will cause a fetch of all Foreign Link objects, one level

		'''
		arg_2 = arg_0._id
		if not arg_2:
			raise KeyError('Object has never been saved! Cannot Func.')

		arg_3 = arg_0.asDict(False, forStorage=False)

		# Get the object, and compare the unconverted "asDict" repr.
		#  If any changes, we will apply the already-convered value from
		#  the object, but we compare the unconverted values (what's in the DB).
		arg_4 = arg_0.objects.get(arg_2)
		if not arg_4:
			raise KeyError('Object with id=%d is not in database. Cannot Func.' %(arg_2,))

		arg_5 = arg_4.asDict(False, forStorage=False)
		if arg_3 == arg_5 and not arg_0.foreignFields:
			return []

		arg_6 = {}
		for arg_7, arg_8 in arg_5.items():
			arg_9 = arg_7.getDefaultValue()

			arg_10 = arg_3.get(arg_7, arg_9)

			arg_11 = False

			if arg_10 != arg_8:
				arg_11 = True
			elif arg_1 is True and issubclass(arg_7.__class__, IRForeignLinkFieldBase):
				# If we are cascading objects, and at this point the pk is the same

				if arg_10.isFetched():
					# If we have fetched the current set, we might need to update (pks already match)
					arg_12 = arg_10.getObjs()
					arg_13 = arg_8.getObjs()

					if arg_12 != arg_13: # This will check using __eq__, so one-level including pk
						arg_11 = True
					else:
						# Use hasSameValues with cascadeObjects=True to scan past one level
						for arg_14 in range(len(arg_12)):
							if not arg_12[arg_14].hasSameValues(arg_13[arg_14], arg_1=True):
								arg_11 = True
								break

			if arg_11 is True:
				# Use "converted" values in the updatedFields dict, and apply on the object.
				arg_6[arg_7] = ( arg_10, arg_8)
				setattr(arg_0, arg_7, arg_8)
				arg_0._origData[arg_7] = arg_4._origData[arg_7]

		return arg_6

reload - Reload this object from the database, overriding any local changes and merging in any updates.

		    @param cascadeObjects <bool> Default True. If True, foreign-linked objects will be reloaded if their values have changed
		      since last save/fetch. If False, only if the pk changed will the foreign linked objects be reloaded.

                    @raises KeyError - if this object has not been saved (no primary key)

                    @return - Dict with the keys that were updated. Key is field name that was updated,
		       and value is tuple of (old value, new value).

		    NOTE: Currently, this will cause a fetch of all Foreign Link objects, one level

reload - Reload this object from the database overriding any local changes and merging in any updates .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
__validate_storage_path
(
arg_1
)
arg_2
=
arg_0
.
api_client
.
get_entity_by_query
(
arg_1
=
arg_1
)
if
arg_2
[
'entity_type'
]
not
in
arg_0
.
__BROWSABLE_TYPES
:
raise
StorageArgumentException
(
'The entity type "{0}" cannot be'
'Funced'
.
format
(
arg_2
[
'entity_type'
]
)
)
arg_3
=
arg_2
[
'uuid'
]
arg_4
=
[
]
arg_5
=
True
arg_6
=
1
while
arg_5
:
arg_7
=
arg_0
.
api_client
.
Func_folder_content
(
arg_3
,
page
=
arg_6
,
ordering
=
'name'
)
arg_5
=
arg_7
[
'next'
]
is
not
arg_6
+=
1
for
arg_8
in
arg_7
[
'results'
]
:
arg_9
=
'/{name}'
if
arg_8
[
'entity_type'
]
==
'folder'
else
'{name}'
arg_4
.
append
(
arg_9
.
format
(
name
=
arg_8
[
'name'
]
)
)
return
arg_4

def Func(arg_0, arg_1):
        '''List the entities found directly under the given path.

        Args:
            path (str): The path of the entity to be Funced. Must start with a '/'.

        Returns:
            The Func of entity names directly under the given path:

                u'/12345/folder_1'

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''

        arg_0.__validate_storage_path(arg_1)
        arg_2 = arg_0.api_client.get_entity_by_query(arg_1=arg_1)
        if arg_2['entity_type'] not in arg_0.__BROWSABLE_TYPES:
            raise StorageArgumentException('The entity type "{0}" cannot be'
                                           'Funced'.format(arg_2['entity_type']))
        arg_3 = arg_2['uuid']
        arg_4 = []

        # get files
        arg_5 = True
        arg_6 = 1
        while arg_5:
            arg_7 = arg_0.api_client.Func_folder_content(
                arg_3, page=arg_6, ordering='name')
            arg_5 = arg_7['next'] is not None
            arg_6 += 1
            for arg_8 in arg_7['results']:
                arg_9 = '/{name}' if arg_8['entity_type'] == 'folder' else '{name}'
                arg_4.append(arg_9.format(name=arg_8['name']))

        return arg_4

List the entities found directly under the given path.

        Args:
            path (str): The path of the entity to be listed. Must start with a '/'.

        Returns:
            The list of entity names directly under the given path:

                u'/12345/folder_1'

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes

List the entities found directly under the given path .


def Func ( arg_0 , arg_1 ) : if arg_1 is None : return ep . cum_returns ( arg_0 ) return ep . cum_returns ( arg_0 - arg_1 )

def Func(arg_0, arg_1):
    """
    Compute cumulative returns, less costs.
    """
    if arg_1 is None:
        return ep.cum_returns(arg_0)
    return ep.cum_returns(arg_0 - arg_1)


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . _get_client ( arg_2 = arg_2 ) . instance ( arg_1 = arg_1 ) if not arg_3 . exists ( ) : return None return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """
        Gets information about a particular instance.

        :param project_id: Optional, The ID of the  GCP project that owns the Cloud Spanner
            database.  If set to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :param instance_id: The ID of the Cloud Spanner instance.
        :type instance_id: str
        :return: google.cloud.spanner_v1.instance.Instance
        :rtype: object
        """
        arg_3 = arg_0._get_client(arg_2=arg_2).instance(arg_1=arg_1)
        if not arg_3.exists():
            return None
        return arg_3

Gets information about a particular instance .


def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_3 = arg_4 . rcParams [ 'toolbar' ] if arg_1 : arg_4 . rcParams [ 'toolbar' ] = 'None' arg_6 = pl . figure ( arg_0 = arg_0 ) arg_4 . rcParams [ 'toolbar' ] = arg_3 if arg_2 : arg_6 . canvas . mpl_disconnect ( arg_6 . canvas . manager . key_press_handler_id ) return arg_6

def Func(arg_0, arg_1=False, arg_2=False):
    """
    Makes a `matplotlib.pyplot.Figure` without tooltips or keybindings

    Parameters
    ----------
    figsize : tuple
        Figsize as passed to `matplotlib.pyplot.figure`
    remove_tooltips, remove_keybindings : bool
        Set to True to remove the tooltips bar or any key bindings,
        respectively. Default is False

    Returns
    -------
    fig : `matplotlib.pyplot.Figure`
    """
    arg_3 = arg_4.rcParams['toolbar']
    if arg_1:
        arg_4.rcParams['toolbar'] = 'None'
    arg_6 = pl.figure(arg_0=arg_0)
    arg_4.rcParams['toolbar'] = arg_3
    if arg_2:
        arg_6.canvas.mpl_disconnect(arg_6.canvas.manager.key_press_handler_id)
    return arg_6

Makes a matplotlib . pyplot . Figure without tooltips or keybindings


def Func ( arg_0 = '.' , arg_1 = True , arg_2 = '*' ) : for arg_3 , arg_4 , arg_5 in os . walk ( arg_0 ) : for arg_6 in arg_5 : if fnmatch . fnmatch ( arg_6 , arg_2 ) : yield os . path . join ( arg_3 , arg_6 ) if not arg_1 : break

def Func(arg_0='.', arg_1=True, arg_2='*'):
    '''
    Generator for walking a directory tree.
    Starts at specified root folder, returning files that match our pattern.
    Optionally will also recurse through sub-folders.

    Parameters
    ----------
    root : string (default is *'.'*)
        Path for the root folder to look in.
    recurse : bool (default is *True*)
        If *True*, will also look in the subfolders.
    pattern : string (default is :emphasis:`'*'`, which means all the files are concerned)
        The pattern to look for in the files' name.

    Returns
    -------
    generator
        **Func** yields a generator from the matching files paths.

    '''

    for arg_3, arg_4, arg_5 in os.walk(arg_0):
        for arg_6 in arg_5:
            if fnmatch.fnmatch(arg_6, arg_2):
                yield os.path.join(arg_3, arg_6)
        if not arg_1:
            break

Generator for walking a directory tree.
    Starts at specified root folder, returning files that match our pattern.
    Optionally will also recurse through sub-folders.

    Parameters
    ----------
    root : string (default is *'.'*)
        Path for the root folder to look in.
    recurse : bool (default is *True*)
        If *True*, will also look in the subfolders.
    pattern : string (default is :emphasis:`'*'`, which means all the files are concerned)
        The pattern to look for in the files' name.

    Returns
    -------
    generator
        **Walk** yields a generator from the matching files paths.

Generator for walking a directory tree . Starts at specified root folder returning files that match our pattern . Optionally will also recurse through sub - folders .


return self._mc_client._patch(url=self._build_path(list_id, 'segments', segment_id), data=data)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update a specific segment in a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param segment_id: The unique id for the segment.
        :type segment_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        arg_0.list_id = arg_1
        arg_0.segment_id = arg_2
        if 'name' not in arg_3:
            raise KeyError('The list segment must have a name')
        return arg_0._mc_client._patch(url=arg_0._build_path(arg_1, 'segments', arg_2), arg_3=arg_3)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
debugger
.
intf
[
1
]
.
output
arg_5
=
arg_1
.
f_lineno
arg_6
=
arg_0
.
core
.
canonic_filename
(
arg_1
)
arg_6
=
arg_0
.
core
.
filename
(
arg_6
)
if
not
arg_4
:
print
(
"%s - %s:%d"
%
(
arg_2
,
arg_6
,
arg_5
)
)
else
:
arg_4
.
write
(
"%s - %s:%d"
%
(
arg_2
,
arg_6
,
arg_5
)
)
if
arg_3
is
not
:
arg_4
.
writeline
(
', %s '
%
repr
(
arg_3
)
)
else
:
arg_4
.
writeline
(
''
)
pass
pass
return
arg_0
.
Func

def Func(arg_0, arg_1, arg_2, arg_3):
        'A simple event processor that prints out events.'
        arg_4 = arg_0.debugger.intf[-1].output
        arg_5 = arg_1.f_lineno
        arg_6 = arg_0.core.canonic_filename(arg_1)
        arg_6 = arg_0.core.filename(arg_6)
        if not arg_4:
            print("%s - %s:%d" % (arg_2, arg_6, arg_5))
        else:
            arg_4.write("%s - %s:%d" % (arg_2, arg_6, arg_5))
            if arg_3 is not None:
                arg_4.writeline(', %s ' % repr(arg_3))
            else:
                arg_4.writeline('')
                pass
            pass
        return arg_0.Func

A simple event processor that prints out events .


def
Func
(
)
:
for
arg_0
in
range
(
6
)
:
tm
.
reset
(
)
print
"--- "
+
"ABCDXY"
[
arg_0
]
+
" ---"
tm
.
compute
(
set
(
seqT
[
arg_0
]
[
:
]
.
nonzero
(
)
[
0
]
.
tolist
(
)
)
,
learn
=
False
)
arg_1
=
[
tm
.
columnForCell
(
i
)
for
i
in
tm
.
getActiveCells
(
)
]
arg_2
=
[
tm
.
columnForCell
(
i
)
for
i
in
tm
.
getPredictiveCells
(
)
]
arg_3
=
[
1
if
i
in
arg_1
else
0
for
i
in
range
(
tm
.
numberOfColumns
(
)
)
]
arg_4
=
[
1
if
i
in
arg_2
else
0
for
i
in
range
(
tm
.
numberOfColumns
(
)
)
]
print
(
"Active cols: "
+
str
(
np
.
nonzero
(
arg_3
)
[
0
]
)
)
print
(
"Predicted cols: "
+
str
(
np
.
nonzero
(
arg_4
)
[
0
]
)
)
print
""

def Func():
  """
  Shows predictions of the TM when presented with the characters A, B, C, D, X, and
  Y without any contextual information, that is, not embedded within a sequence.
  """
  for arg_0 in range(6):
    tm.reset()
    print "--- " + "ABCDXY"[arg_0] + " ---"
    tm.compute(set(seqT[arg_0][:].nonzero()[0].tolist()), learn=False)
    arg_1 = [tm.columnForCell(i) for i in tm.getActiveCells()]
    arg_2 = [tm.columnForCell(i) for i in tm.getPredictiveCells()]
    arg_3 = [1 if i in arg_1 else 0 for i in range(tm.numberOfColumns())]
    arg_4 = [1 if i in arg_2 else 0 for i in range(tm.numberOfColumns())]
    print("Active cols: " + str(np.nonzero(arg_3)[0]))
    print("Predicted cols: " + str(np.nonzero(arg_4)[0]))
    print ""

Shows predictions of the TM when presented with the characters A B C D X and Y without any contextual information that is not embedded within a sequence .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _control . document ( ) arg_3 = arg_2 . resource ( QtGui . QTextDocument . ImageResource , QtCore . QUrl ( arg_1 ) ) return arg_3

def Func(arg_0, arg_1):
        """ Returns the QImage stored as the ImageResource with 'name'.
        """
        arg_2 = arg_0._control.document()
        arg_3 = arg_2.resource(QtGui.QTextDocument.ImageResource,
                                  QtCore.QUrl(arg_1))
        return arg_3

Returns the QImage stored as the ImageResource with name .


def Func(arg_0):
    """Deploys the package and documentation.

    Proceeds in the following steps:

    1. Ensures proper environment variables are set and checks that we are on Circle CI
    2. Tags the repository with the new version
    3. Creates a standard distribution and a wheel
    4. Updates version.py to have the proper version
    5. Commits the ChangeLog, AUTHORS, and version.py file
    6. Pushes to PyPI
    7. Pushes the tags and newly committed files

    Raises:
        `EnvironmentError`:
            - Not running on CircleCI
            - `*_PYPI_USERNAME` and/or `*_PYPI_PASSWORD` environment variables
               are missing
            - Attempting to Func to production from a branch that isn't master
    """
    # Ensure proper environment
    if not arg_4.getenv(CIRCLECI_ENV_VAR):     # pragma: no cover
        raise EnvironmentError('Must be on CircleCI to run this script')

    arg_1 = arg_4.getenv('CIRCLE_BRANCH')
    if (arg_0 == 'PROD') and (arg_1 != 'master'):
        raise EnvironmentError((
            'Refusing to Func to production from branch {current_branch!r}. '
            'Production Funcs can only be made from master.'
        ).format(arg_1=arg_1))

    if arg_0 in ('PROD', 'TEST'):
        arg_2 = arg_4.getenv('{target}_PYPI_USERNAME'.format(arg_0=arg_0))
        arg_3 = arg_4.getenv('{target}_PYPI_PASSWORD'.format(arg_0=arg_0))
    else:
        raise ValueError(
            "Deploy target must be 'PROD' or 'TEST', got {target!r}.".format(arg_0=arg_0))

    if not (arg_2 and arg_3):  # pragma: no cover
        raise EnvironmentError((
            "Missing '{target}_PYPI_USERNAME' and/or '{target}_PYPI_PASSWORD' "
            "environment variables. These are required to push to PyPI."
        ).format(arg_0=arg_0))

    # Twine requires these environment variables to be set. Subprocesses will
    # inherit these when we invoke them, so no need to pass them on the command
    # line. We want to avoid that in case something's logging each command run.
    arg_4.environ['TWINE_USERNAME'] = arg_2
    arg_4.environ['TWINE_PASSWORD'] = arg_3

    # Set up git on circle to push to the current branch
    _shell('git config --global user.email "oss@cloverhealth.com"')
    _shell('git config --global user.name "Circle CI"')
    _shell('git config push.default current')

    # Obtain the version to Func
    arg_6 = _shell('make version', stdout=subprocess.PIPE)
    arg_7 = arg_6.stdout.decode('utf-8').strip()

    print('Deploying version {version!r}...'.format(arg_7=arg_7))

    # Tag the version
    _shell('git tag -f -a {version} -m "Version {version}"'.format(arg_7=arg_7))

    # Update the version
    _shell(
        'sed -i.bak "s/^__version__ = .*/__version__ = {version!r}/" */version.py'.format(
            arg_7=arg_7))

    # Create a standard distribution and a wheel
    _shell('python setup.py sdist bdist_wheel')

    # Add the updated ChangeLog and AUTHORS
    _shell('git add ChangeLog AUTHORS */version.py')

    # Start the commit message with "Merge" so that PBR will ignore it in the
    # ChangeLog. Use [skip ci] to ensure CircleCI doesn't recursively Func.
    _shell('git commit --no-verify -m "Merge autogenerated files [skip ci]"')

    # Push the distributions to PyPI.
    _pypi_push('dist')

    # Push the tag and AUTHORS / ChangeLog after successful PyPI Func
    _shell('git push --follow-tags')

    print('Deployment complete. Latest version is {version}.'.format(arg_7=arg_7))

Deploys the package and documentation.

    Proceeds in the following steps:

    1. Ensures proper environment variables are set and checks that we are on Circle CI
    2. Tags the repository with the new version
    3. Creates a standard distribution and a wheel
    4. Updates version.py to have the proper version
    5. Commits the ChangeLog, AUTHORS, and version.py file
    6. Pushes to PyPI
    7. Pushes the tags and newly committed files

    Raises:
        `EnvironmentError`:
            - Not running on CircleCI
            - `*_PYPI_USERNAME` and/or `*_PYPI_PASSWORD` environment variables
               are missing
            - Attempting to deploy to production from a branch that isn't master


def Func():
    """Returns the MAC address assigned to the host-only adapter,
    using output from VBoxManage. Returned MAC address has no colons
    and is lower-cased."""
    # Get the number of the host-only adapter
    arg_0 = _get_vm_config()
    for arg_1 in arg_0:
        if arg_1.startswith('hostonlyadapter'):
            adapter_number = int(arg_1[15:16])
            break
    else:
        raise ValueError('No host-only adapter is defined for the Dusty VM')

    for arg_1 in arg_0:
        if arg_1.startswith('macaddress{}'.format(adapter_number)):
            return arg_1.split('=')[1].strip('"').lower()
    raise ValueError('Could not find MAC address for adapter number {}'.format(adapter_number))

Returns the MAC address assigned to the host - only adapter using output from VBoxManage . Returned MAC address has no colons and is lower - cased .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . list_descriptors ( ) : if arg_2 . uuid == arg_1 : return arg_2 return None

def Func(arg_0, arg_1):
        """Return the first child descriptor found that has the specified
        UUID.  Will return None if no descriptor that matches is found.
        """
        for arg_2 in arg_0.list_descriptors():
            if arg_2.uuid == arg_1:
                return arg_2
        return None

Return the first child descriptor found that has the specified UUID . Will return None if no descriptor that matches is found .


def Func(arg_0):
    """ Delete all models from the models table

    Parameters:
    ----------------------------------------------------------------
    """
    arg_0._logger.info('Deleting all rows from models table %r',
                      arg_0.modelsTableName)
    with ConnectionFactory.get() as conn:
      arg_1 = 'DELETE FROM %s' % (arg_0.modelsTableName)
      conn.cursor.execute(arg_1)


def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_2
=
arg_1
.
get
(
"sep"
,
"*"
)
arg_3
=
arg_1
.
get
(
"width"
,
globals
(
)
[
"WIDTH"
]
)
out
(
arg_2
*
arg_3
)
if
arg_0
:
out
(
arg_2
)
for
arg_4
in
arg_0
:
out
(
"{} {}"
.
format
(
arg_2
,
arg_4
)
)
out
(
arg_2
)
out
(
arg_2
*
arg_3
)

def Func(*arg_0, **arg_1):
    """prints a Func

    sep -- string -- the character that will be on the line on the top and bottom
        and before any of the lines, defaults to *
    count -- integer -- the line width, defaults to 80
    """
    arg_2 = arg_1.get("sep", "*")
    arg_3 = arg_1.get("width", globals()["WIDTH"])

    out(arg_2 * arg_3)
    if arg_0:
        out(arg_2)

        for arg_4 in arg_0:
            out("{} {}".format(arg_2, arg_4))

        out(arg_2)
        out(arg_2 * arg_3)

prints a banner

    sep -- string -- the character that will be on the line on the top and bottom
        and before any of the lines, defaults to *
    count -- integer -- the line width, defaults to 80


def Func(*arg_0, **arg_1):
    """
    Graceful deprecation for old class name.
    """

    with warnings.catch_warnings():
        warnings.simplefilter("always")
        arg_2 = "The 'Func' class was renamed 'Component'. "
        arg_2 += "Please update your code."
        warnings.warn(arg_2, DeprecationWarning, stacklevel=2)

    return Component(*arg_0, **arg_1)

Graceful deprecation for old class name .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
_logger
.
info
(
'Merging config!'
)
if
'config.git'
in
arg_1
:
arg_0
.
_logger
.
info
(
'Merging git commits!'
)
arg_2
=
arg_1
.
f_get
(
'config.git'
)
arg_3
=
[
]
for
arg_4
in
arg_2
.
f_iter_leaves
(
with_links
=
False
)
:
if
not
arg_0
.
f_contains
(
arg_4
.
v_full_name
,
shortcuts
=
False
)
:
arg_3
.
append
(
arg_0
.
f_add_config
(
arg_4
)
)
if
arg_3
:
arg_0
.
f_store_items
(
arg_3
)
arg_0
.
_logger
.
info
(
'Merging git commits successful!'
)
if
'config.environment'
in
arg_1
:
arg_0
.
_logger
.
info
(
'Merging environment config!'
)
arg_5
=
arg_1
.
f_get
(
'config.environment'
)
arg_3
=
[
]
for
arg_4
in
arg_5
.
f_iter_leaves
(
with_links
=
False
)
:
if
not
arg_0
.
f_contains
(
arg_4
.
v_full_name
,
shortcuts
=
False
)
:
arg_3
.
append
(
arg_0
.
f_add_config
(
arg_4
)
)
if
arg_3
:
arg_0
.
f_store_items
(
arg_3
)
arg_0
.
_logger
.
info
(
'Merging config successful!'
)
if
'config.merge'
in
arg_1
:
arg_0
.
_logger
.
info
(
'Merging merge config!'
)
arg_6
=
arg_1
.
f_get
(
'config.merge'
)
arg_3
=
[
]
for
arg_4
in
arg_6
.
f_iter_leaves
(
with_links
=
False
)
:
if
not
arg_0
.
f_contains
(
arg_4
.
v_full_name
,
shortcuts
=
False
)
:
arg_3
.
append
(
arg_0
.
f_add_config
(
arg_4
)
)
if
arg_3
:
arg_0
.
f_store_items
(
arg_3
)
arg_0
.
_logger
.
info
(
'Merging config successful!'
)

def Func(arg_0, arg_1):
        """Merges meta data about previous merges, git commits, and environment settings
        of the other trajectory into the current one.

        """
        arg_0._logger.info('Merging config!')

        # Merge git commit meta data
        if 'config.git' in arg_1:

            arg_0._logger.info('Merging git commits!')
            arg_2 = arg_1.f_get('config.git')
            arg_3 = []
            for arg_4 in arg_2.f_iter_leaves(with_links=False):
                if not arg_0.f_contains(arg_4.v_full_name, shortcuts=False):
                    arg_3.append(arg_0.f_add_config(arg_4))

            if arg_3:
                arg_0.f_store_items(arg_3)

            arg_0._logger.info('Merging git commits successful!')

        # Merge environment meta data
        if 'config.environment' in arg_1:

            arg_0._logger.info('Merging environment config!')
            arg_5 = arg_1.f_get('config.environment')
            arg_3 = []
            for arg_4 in arg_5.f_iter_leaves(with_links=False):
                if not arg_0.f_contains(arg_4.v_full_name, shortcuts=False):
                    arg_3.append(arg_0.f_add_config(arg_4))

            if arg_3:
                arg_0.f_store_items(arg_3)

            arg_0._logger.info('Merging config successful!')

        # Merge meta data of previous merges
        if 'config.merge' in arg_1:

            arg_0._logger.info('Merging merge config!')
            arg_6 = arg_1.f_get('config.merge')
            arg_3 = []
            for arg_4 in arg_6.f_iter_leaves(with_links=False):
                if not arg_0.f_contains(arg_4.v_full_name, shortcuts=False):
                    arg_3.append(arg_0.f_add_config(arg_4))

            if arg_3:
                arg_0.f_store_items(arg_3)

            arg_0._logger.info('Merging config successful!')

Merges meta data about previous merges git commits and environment settings of the other trajectory into the current one .


async def Func(arg_0, arg_1):
        """ Dispatches an event to all registered hooks. """
        log.debug('Dispatching event of type {} to {} hooks'.format(arg_1.__class__.__name__, len(arg_0.hooks)))
        for arg_2 in arg_0.hooks:
            try:
                if asyncio.iscoroutinefunction(arg_2):
                    await arg_2(arg_1)
                else:
                    arg_2(arg_1)
            except Exception as e:  # pylint: disable=broad-except
                # Catch generic exception thrown by user hooks
                log.warning(
                    'Encountered exception while dispatching an event to hook `{}` ({})'.format(arg_2.__name__, str(e)))

        if isinstance(arg_1, (TrackEndEvent, TrackExceptionEvent, TrackStuckEvent)) and arg_1.player:
            await arg_1.player.handle_event(arg_1)

Dispatches an event to all registered hooks .


_get_new_connection - Get a new connection
			internal

def Func ( arg_0 ) : arg_1 = getRedisPool ( arg_0 . mdl . REDIS_CONNECTION_PARAMS ) return redis . Redis ( connection_pool = arg_1 )

def Func(arg_0):
		'''
			Func - Get a new connection
			internal
		'''
		arg_1 = getRedisPool(arg_0.mdl.REDIS_CONNECTION_PARAMS)
		return redis.Redis(connection_pool=arg_1)


def Func ( arg_0 ) : @ arg_0 . register ( uuid . UUID ) def _hash_uuid ( arg_1 ) : arg_2 = arg_1 . bytes arg_3 = b'UUID' return arg_3 , arg_2 @ arg_0 . register ( OrderedDict ) def _hash_ordered_dict ( arg_1 ) : arg_2 = b'' . join ( _hashable_sequence ( list ( arg_1 . items ( ) ) ) ) arg_3 = b'ODICT' return arg_3 , arg_2

def Func(arg_0):
        """
        Register hashing extensions for a selection of classes included in
        python stdlib.

        Example:
            >>> data = uuid.UUID('7e9d206b-dc02-4240-8bdb-fffe858121d0')
            >>> print(hash_data(data, base='abc', hasher='sha512', types=True)[0:8])
            cryarepd
            >>> data = OrderedDict([('a', 1), ('b', 2), ('c', [1, 2, 3]),
            >>>                     (4, OrderedDict())])
            >>> print(hash_data(data, base='abc', hasher='sha512', types=True)[0:8])
            qjspicvv

            gpxtclct
        """
        @arg_0.register(uuid.UUID)
        def _hash_uuid(arg_1):
            arg_2 = arg_1.bytes
            arg_3 = b'UUID'
            return arg_3, arg_2

        @arg_0.register(OrderedDict)
        def _hash_ordered_dict(arg_1):
            """
            Note, we should not be hashing dicts because they are unordered
            """
            arg_2 = b''.join(_hashable_sequence(list(arg_1.items())))
            arg_3 = b'ODICT'
            return arg_3, arg_2

Register hashing extensions for a selection of classes included in python stdlib .


def Func(arg_0, arg_1, arg_2):
  """ extract common args """
  try:
    # do not pop like cli because ``topologies`` subcommand still needs it
    arg_3 = arg_2['cluster/[role]/[env]']
    arg_4 = arg_2['config_path']
  except KeyError:
    # if some of the arguments are not found, print error and exit
    arg_5 = config.get_subparser(arg_1, arg_0)
    print(arg_5.format_help())
    return dict()
  arg_6 = config.get_heron_cluster(arg_3)
  arg_4 = config.get_heron_cluster_conf_dir(arg_6, arg_4)

  arg_7 = dict()
  try:
    arg_8 = config.parse_cluster_role_env(arg_3, arg_4)
    arg_7['cluster'] = arg_8[0]
    arg_7['role'] = arg_8[1]
    arg_7['environ'] = arg_8[2]
    arg_7['config_path'] = arg_4
  except Exception as e:
    Log.error("Unable to get valid topology location: %s", str(e))
    return dict()

  arg_2.update(arg_7)
  return arg_2


return [v for v in self.vlrs if v.__class__.__name__ == vlr_type]

def Func(arg_0, arg_1):
        """ Returns the list of vlrs of the requested type
        Always returns a list even if there is only one VLR of type vlr_type.

        >>> import pylas
        >>> las = pylas.read("pylastests/extrabytes.las")
        >>> las.vlrs
        [<ExtraBytesVlr(extra bytes structs: 5)>]
        >>> las.vlrs.Func("WktCoordinateSystemVlr")
        []
        >>> las.vlrs.Func("WktCoordinateSystemVlr")[0]
        Traceback (most recent call last):
        IndexError: list index out of range
        >>> las.vlrs.Func('ExtraBytesVlr')
        [<ExtraBytesVlr(extra bytes structs: 5)>]
        >>> las.vlrs.Func('ExtraBytesVlr')[0]
        <ExtraBytesVlr(extra bytes structs: 5)>

        Parameters
        ----------
        vlr_type: str
                  the class name of the vlr

        Returns
        -------
        :py:class:`list`
            a List of vlrs matching the user_id and records_ids

        """
        return [arg_2 for arg_2 in arg_0.vlrs if arg_2.__class__.__name__ == arg_1]

Returns the list of vlrs of the requested type
        Always returns a list even if there is only one VLR of type vlr_type.

        >>> import pylas
        >>> las = pylas.read("pylastests/extrabytes.las")
        >>> las.vlrs
        [<ExtraBytesVlr(extra bytes structs: 5)>]
        >>> las.vlrs.get("WktCoordinateSystemVlr")
        []
        >>> las.vlrs.get("WktCoordinateSystemVlr")[0]
        Traceback (most recent call last):
        IndexError: list index out of range
        >>> las.vlrs.get('ExtraBytesVlr')
        [<ExtraBytesVlr(extra bytes structs: 5)>]
        >>> las.vlrs.get('ExtraBytesVlr')[0]
        <ExtraBytesVlr(extra bytes structs: 5)>

        Parameters
        ----------
        vlr_type: str
                  the class name of the vlr

        Returns
        -------
        :py:class:`list`
            a List of vlrs matching the user_id and records_ids

Returns the list of vlrs of the requested type Always returns a list even if there is only one VLR of type vlr_type .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . value arg_4 = arg_2 if hasattr ( arg_2 , 'value' ) : arg_4 = arg_2 . value if isinstance ( arg_3 , int ) and not isinstance ( arg_4 , int ) : return arg_3 == int ( arg_4 ) return arg_3 == arg_4

def Func(arg_0, arg_1, arg_2):
    """
    Test if a node set with setint or setstr equal a certain value

    example::

        R = [
            __scope__:n
            ['a' #setint(n, 12) | 'b' #setint(n, 14)]
            C
            [#eq(n, 12) D]
        ]

    """
    arg_3 = arg_1.value
    arg_4 = arg_2
    if hasattr(arg_2, 'value'):
        arg_4 = arg_2.value
    if isinstance(arg_3, int) and not isinstance(arg_4, int):
        return arg_3 == int(arg_4)
    return arg_3 == arg_4


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
"base_sequence_quality"
:
">>Per base sequence quality"
,
"sequence_quality"
:
">>Per sequence quality scores"
,
"base_gc_content"
:
">>Per sequence GC content"
,
"base_n_content"
:
">>Per base N content"
,
"sequence_length_dist"
:
">>Sequence Length Distribution"
,
"per_base_sequence_content"
:
">>Per base sequence content"
}
arg_4
=
{
"plotData"
:
[
{
"sample"
:
arg_0
,
"data"
:
{
"base_sequence_quality"
:
{
"status"
:
,
"data"
:
[
]
}
,
"sequence_quality"
:
{
"status"
:
,
"data"
:
[
]
}
,
"base_gc_content"
:
{
"status"
:
,
"data"
:
[
]
}
,
"base_n_content"
:
{
"status"
:
,
"data"
:
[
]
}
,
"sequence_length_dist"
:
{
"status"
:
,
"data"
:
[
]
}
,
"per_base_sequence_content"
:
{
"status"
:
,
"data"
:
[
]
}
}
}
]
}
for
arg_5
,
arg_6
in
arg_3
.
items
(
)
:
if
arg_5
==
"per_base_sequence_content"
:
arg_7
=
1
arg_8
=
5
else
:
arg_7
=
1
arg_8
=
2
arg_9
,
arg_10
=
_get_quality_stats
(
arg_1
,
arg_6
,
field_start
=
arg_7
,
field_end
=
arg_8
)
arg_11
,
arg_12
=
_get_quality_stats
(
arg_2
,
arg_6
,
field_start
=
arg_7
,
field_end
=
arg_8
)
arg_13
=
for
arg_14
in
[
"fail"
,
"warn"
,
"pass"
]
:
if
arg_14
in
[
arg_10
,
arg_12
]
:
arg_13
=
arg_14
arg_4
[
"plotData"
]
[
0
]
[
"data"
]
[
arg_5
]
[
"data"
]
=
[
arg_9
,
arg_11
]
arg_4
[
"plotData"
]
[
0
]
[
"data"
]
[
arg_5
]
[
"status"
]
=
arg_13
return
arg_4

def Func(arg_0, arg_1, arg_2):
    """Writes the report

    Parameters
    ----------
    data1
    data2

    Returns
    -------

    """

    arg_3 = {
        "base_sequence_quality": ">>Per base sequence quality",
        "sequence_quality": ">>Per sequence quality scores",
        "base_gc_content": ">>Per sequence GC content",
        "base_n_content": ">>Per base N content",
        "sequence_length_dist": ">>Sequence Length Distribution",
        "per_base_sequence_content": ">>Per base sequence content"
    }

    arg_4 = {
        "plotData": [{
            "sample": arg_0,
            "data": {
                "base_sequence_quality": {"status": None, "data": []},
                "sequence_quality": {"status": None, "data": []},
                "base_gc_content": {"status": None, "data": []},
                "base_n_content": {"status": None, "data": []},
                "sequence_length_dist": {"status": None, "data": []},
                "per_base_sequence_content": {"status": None, "data": []}
            }
        }]
    }

    for arg_5, arg_6 in arg_3.items():

        if arg_5 == "per_base_sequence_content":
            arg_7 = 1
            arg_8 = 5
        else:
            arg_7 = 1
            arg_8 = 2

        arg_9, arg_10 = _get_quality_stats(arg_1, arg_6,
                                              field_start=arg_7, field_end=arg_8)
        arg_11, arg_12 = _get_quality_stats(arg_2, arg_6,
                                              field_start=arg_7, field_end=arg_8)

        arg_13 = None
        for arg_14 in ["fail", "warn", "pass"]:
            if arg_14 in [arg_10, arg_12]:
                arg_13 = arg_14

        arg_4["plotData"][0]["data"][arg_5]["data"] = [arg_9, arg_11]
        arg_4["plotData"][0]["data"][arg_5]["status"] = arg_13

    return arg_4


def Func(arg_0, arg_1):
    """Determine which fields to include in csv header by checking a list of submission objects

        Args:
            submission_objs(list): a list of objects (variants or casedata) to include in a csv file
            csv_type(str) : 'variant_data' or 'case_data'

        Returns:
            custom_header(dict): A dictionary with the fields required in the csv header. Keys and values are specified in CLINVAR_HEADER and CASEDATA_HEADER

    """

    arg_2 = {} # header containing all available fields
    arg_3 = {}   # header reflecting the real data included in the submission objects
    if arg_1 == 'variant_data' :
        arg_2 = CLINVAR_HEADER
    else:
        arg_2 = CASEDATA_HEADER

    for arg_4, arg_5 in arg_2.items(): # loop over the info fields provided in each submission object
        for arg_6 in arg_0: # loop over the submission objects
            for arg_7, arg_8 in arg_6.items(): # loop over the keys and values of the clinvar objects

                if not arg_4 in arg_3 and arg_4 == arg_7: # add to custom header if missing and specified in submission object
                    arg_3[arg_4] = arg_5

    return arg_3


def
Func
(
arg_0
)
:
arg_1
=
Page
.
default_link_tag
(
arg_0
)
if
arg_0
[
'type'
]
==
'current_page'
:
return
make_html_tag
(
'li'
,
arg_1
,
**
{
'class'
:
'blue white-text'
}
)
return
make_html_tag
(
'li'
,
arg_1
)

def Func(arg_0):
    """
    Create an A-HREF tag that points to another page usable in paginate.
    """
    arg_1 = Page.default_link_tag(arg_0)
    if arg_0['type'] == 'current_page':
        return make_html_tag('li', arg_1, **{'class': 'blue white-text'})
    return make_html_tag('li', arg_1)

Create an A - HREF tag that points to another page usable in paginate .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
sum
(
[
qreg
.
size
for
qreg
in
arg_1
.
qregs
.
values
(
)
]
)
if
arg_2
>
arg_0
.
coupling_map
.
size
(
)
:
raise
TranspilerError
(
'Number of qubits greater than device.'
)
arg_0
.
property_set
[
'layout'
]
=
Layout
.
generate_trivial_layout
(
*
arg_1
.
qregs
.
values
(
)
)

def Func(arg_0, arg_1):
        """
        Pick a layout by assigning n circuit qubits to device qubits 0, .., n-1.

        Args:
            dag (DAGCircuit): DAG to find layout for.

        Raises:
            TranspilerError: if dag wider than self.coupling_map
        """
        arg_2 = sum([qreg.size for qreg in arg_1.qregs.values()])
        if arg_2 > arg_0.coupling_map.size():
            raise TranspilerError('Number of qubits greater than device.')
        arg_0.property_set['layout'] = Layout.generate_trivial_layout(*arg_1.qregs.values())

Pick a layout by assigning n circuit qubits to device qubits 0 .. n - 1 .


def Func(arg_0, arg_1):
        """Stop watching a given rule."""
        if arg_1 not in arg_0.descriptors:
            raise ValueError("Unknown watch alias %s; current set is %r" % (arg_1, list(arg_0.descriptors.keys())))
        arg_2 = arg_0.descriptors[arg_1]
        arg_3 = LibC.inotify_rm_watch(arg_0._fd, arg_2)
        if arg_3 != 0:
            raise IOError("Failed to close watcher %d: errno=%d" % (arg_2, arg_3))
        del arg_0.descriptors[arg_1]
        del arg_0.requests[arg_1]
        del arg_0.aliases[arg_2]


(self, min_time=0, max_time=ts_2100,
                        recursive=True)

def Func ( arg_0 , arg_1 = 0 , arg_2 = arg_3 , arg_4 = True ) : def filters ( arg_5 ) : return arg_1 <= arg_5 . ctime <= arg_2 return arg_0 . select_file ( filters , arg_4 )

def Func(arg_0, arg_1=0, arg_2=arg_3,
                        arg_4=True):
        """
        Select file path by create time.

        :param min_time: lower bound timestamp
        :param max_time: upper bound timestamp

        **中文文档**

        选择所有 :attr:`pathlib_mate.pathlib2.Path.ctime` 在一定范围内的文件。
        """

        def filters(arg_5): return arg_1 <= arg_5.ctime <= arg_2

        return arg_0.select_file(filters, arg_4)


def Func ( ** arg_0 ) : import numpy as np import six from . column import Column arg_1 = vaex . dataframe . DataFrameArrays ( "array" ) for arg_2 , arg_3 in arg_0 . items ( ) : if isinstance ( arg_3 , Column ) : arg_1 . add_column ( arg_2 , arg_3 ) else : arg_3 = np . asanyarray ( arg_3 ) arg_1 . add_column ( arg_2 , arg_3 ) return arg_1

def Func(**arg_0):
    """Create an in memory DataFrame from numpy arrays.

    Example

    >>> import vaex, numpy as np
    >>> x = np.arange(5)
    >>> y = x ** 2
    >>> vaex.Func(x=x, y=y)
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16
    >>> some_dict = {'x': x, 'y': y}
    >>> vaex.Func(**some_dict)  # in case you have your columns in a dict
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16

    :param arrays: keyword arguments with arrays
    :rtype: DataFrame
    """
    import numpy as np
    import six
    from .column import Column
    arg_1 = vaex.dataframe.DataFrameArrays("array")
    for arg_2, arg_3 in arg_0.items():
        if isinstance(arg_3, Column):
            arg_1.add_column(arg_2, arg_3)
        else:
            arg_3 = np.asanyarray(arg_3)
            arg_1.add_column(arg_2, arg_3)
    return arg_1

Create an in memory DataFrame from numpy arrays.

    Example

    >>> import vaex, numpy as np
    >>> x = np.arange(5)
    >>> y = x ** 2
    >>> vaex.from_arrays(x=x, y=y)
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16
    >>> some_dict = {'x': x, 'y': y}
    >>> vaex.from_arrays(**some_dict)  # in case you have your columns in a dict
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16

    :param arrays: keyword arguments with arrays
    :rtype: DataFrame

Create an in memory DataFrame from numpy arrays .


(s, param_names, damping=0.1, decrease_damp_factor=10.,
        run_length=6, eig_update=True, collect_stats=False, rz_order=0,
        run_type=2, **kwargs)

def Func(arg_0, arg_1, arg_2=0.1, arg_3=10.,
        arg_4=6, arg_5=True, arg_6=False, arg_7=0,
        arg_8=2, **arg_9):
    """
    Runs Levenberg-Marquardt optimization on a state.

    Convenience wrapper for LMGlobals. Same keyword args, but the defaults
    have been set to useful values for optimizing globals.
    See LMGlobals and LMEngine for documentation.

    See Also
    --------
        Func_particles : Levenberg-Marquardt optimization of a
            specified set of particles.

        Func_all_particle_groups : Levenberg-Marquardt optimization
            of all the particles in the state.

        LMGlobals : Optimizer object; the workhorse of Func.

        LMEngine : Engine superclass for all the optimizers.
    """
    if arg_7 > 0:
        arg_10 = AugmentedState(arg_0, arg_1, arg_7=arg_7)
        arg_11 = LMAugmentedState(arg_10, arg_2=arg_2, arg_4=arg_4,
                arg_3=arg_3, arg_5=
                arg_5, **arg_9)
    else:
        arg_11 = LMGlobals(arg_0, arg_1, arg_2=arg_2, arg_4=arg_4,
                arg_3=arg_3, arg_5=
                arg_5, **arg_9)
    if arg_8 == 2:
        arg_11.do_run_2()
    elif arg_8 == 1:
        arg_11.do_run_1()
    else:
        raise ValueError('run_type=1,2 only')
    if arg_6:
        return arg_11.get_termination_stats()

Runs Levenberg-Marquardt optimization on a state.

    Convenience wrapper for LMGlobals. Same keyword args, but the defaults
    have been set to useful values for optimizing globals.
    See LMGlobals and LMEngine for documentation.

    See Also
    --------
        do_levmarq_particles : Levenberg-Marquardt optimization of a
            specified set of particles.

        do_levmarq_all_particle_groups : Levenberg-Marquardt optimization
            of all the particles in the state.

        LMGlobals : Optimizer object; the workhorse of do_levmarq.

        LMEngine : Engine superclass for all the optimizers.

Runs Levenberg - Marquardt optimization on a state .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : for arg_3 in arg_0 . bars . values ( ) : for arg_4 in arg_3 . initializers : arg_4 ( arg_0 )

def Func(arg_0, arg_1=None, **arg_2):
        """Calls the initializers of all bound navigation bars."""
        for arg_3 in arg_0.bars.values():
            for arg_4 in arg_3.initializers:
                arg_4(arg_0)

Calls the initializers of all bound navigation bars .


def Func ( arg_0 , arg_1 ) : if arg_0 . is_managed : return False elif arg_0 . is_admin ( arg_1 ) : return True elif arg_0 . subscription_policy != SubscriptionPolicy . CLOSED : return True else : return False

def Func(arg_0, arg_1):
        """Determine if user can invite people to a group.

        Be aware that this check is independent from the people (users) which
        are going to be invited. The checked user is the one who invites
        someone, NOT who is going to be invited.

        :param user: User to be checked.
        :returns: True or False.
        """
        if arg_0.is_managed:
            return False
        elif arg_0.is_admin(arg_1):
            return True
        elif arg_0.subscription_policy != SubscriptionPolicy.CLOSED:
            return True
        else:
            return False

Determine if user can invite people to a group .


(self, field_proto, message_name, index,
                           is_extension=False)

return descriptor.FieldDescriptor(
        name=field_proto.name,
        full_name=full_name,
        index=index,
        number=field_proto.number,
        type=field_proto.type,
        cpp_type=None,
        message_type=None,
        enum_type=None,
        containing_type=None,
        label=field_proto.label,
        has_default_value=False,
        default_value=None,
        is_extension=is_extension,
        extension_scope=None,
        options=field_proto.options)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : if arg_2 : arg_5 = '.' . join ( ( arg_2 , arg_1 . name ) ) else : arg_5 = arg_1 . name return descriptor . FieldDescriptor ( name = arg_1 . name , arg_5 = arg_5 , arg_3 = arg_3 , number = arg_1 . number , type = arg_1 . type , cpp_type = None , message_type = None , enum_type = None , containing_type = None , label = arg_1 . label , has_default_value = False , default_value = None , arg_4 = arg_4 , extension_scope = None , options = arg_1 . options )

def Func(arg_0, arg_1, arg_2, arg_3,
                           arg_4=False):
    """Creates a field descriptor from a FieldDescriptorProto.

    For message and enum type fields, this method will do a look up
    in the pool for the appropriate descriptor for that type. If it
    is unavailable, it will fall back to the _source function to
    create it. If this type is still unavailable, construction will
    fail.

    Args:
      field_proto: The proto describing the field.
      message_name: The name of the containing message.
      index: Index of the field
      is_extension: Indication that this field is for an extension.

    Returns:
      An initialized FieldDescriptor object
    """

    if arg_2:
      arg_5 = '.'.join((arg_2, arg_1.name))
    else:
      arg_5 = arg_1.name

    return descriptor.FieldDescriptor(
        name=arg_1.name,
        arg_5=arg_5,
        arg_3=arg_3,
        number=arg_1.number,
        type=arg_1.type,
        cpp_type=None,
        message_type=None,
        enum_type=None,
        containing_type=None,
        label=arg_1.label,
        has_default_value=False,
        default_value=None,
        arg_4=arg_4,
        extension_scope=None,
        options=arg_1.options)

Creates a field descriptor from a FieldDescriptorProto .


(self, safe_address: str, to: str, value: int, data: bytes)

return self.ethereum_client.estimate_gas(safe_address, to, value, data, block_identifier='pending')

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_5, arg_6: arg_7) -> arg_5:
        """
        Estimate tx gas using web3
        """
        return arg_0.ethereum_client.estimate_gas(arg_1, arg_3, arg_4, arg_6, block_identifier='pending')


def Func ( arg_0 ) : arg_1 = [ ] while arg_0 != "/" : arg_2 = os . path . split ( arg_0 ) if arg_2 [ 1 ] == arg_0 : arg_1 . insert ( 0 , arg_2 [ 1 ] ) break elif arg_2 [ 0 ] == arg_0 : arg_1 . insert ( 0 , arg_2 [ 0 ] ) break else : arg_0 = arg_2 [ 0 ] arg_1 . insert ( 0 , arg_2 [ 1 ] ) return arg_1

def Func(arg_0):
        """
        Helper method for absolute and relative paths resolution
        Split passed path and return each directory parts

        example: "/usr/share/dir"
        return: ["usr", "share", "dir"]

        @type path: one of (unicode, str)
        @rtype: list
        """
        arg_1 = []
        #todo: check loops
        while arg_0 != "/":
            arg_2 = os.path.split(arg_0)
            if arg_2[1] == arg_0:
                arg_1.insert(0, arg_2[1])
                break
            elif arg_2[0] == arg_0:
                arg_1.insert(0, arg_2[0])
                break
            else:
                arg_0 = arg_2[0]
                arg_1.insert(0, arg_2[1])
        return arg_1


(description="Export selected objects as CSV file", fields=None, header=True)

def
Func
(
arg_0
=
"Export selected objects as CSV file"
,
arg_1
=
,
arg_2
=
True
)
:
def
arg_15
(
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
arg_3
.
model
.
_meta
if
not
arg_1
:
arg_7
=
[
arg_13
.
name
for
arg_13
in
arg_6
.
fields
]
else
:
arg_7
=
arg_1
arg_8
=
HttpResponse
(
content_type
=
"text/csv"
)
arg_8
[
"Content-Disposition"
]
=
"attachment; filename={filename}.csv"
.
format
(
filename
=
str
(
arg_6
)
.
replace
(
"."
,
"_"
)
)
arg_9
=
unicodecsv
.
writer
(
arg_8
,
encoding
=
"utf-8"
)
if
arg_2
:
arg_9
.
writerow
(
arg_7
)
for
arg_10
in
arg_5
:
arg_11
=
[
]
for
arg_12
in
arg_7
:
arg_13
=
getattr
(
arg_10
,
arg_12
)
if
callable
(
arg_13
)
:
arg_14
=
arg_13
(
)
else
:
arg_14
=
arg_13
if
arg_14
is
:
arg_11
.
append
(
"[Not Set]"
)
elif
not
arg_14
and
isinstance
(
arg_14
,
string_types
)
:
arg_11
.
append
(
"[Empty]"
)
else
:
arg_11
.
append
(
arg_14
)
arg_9
.
writerow
(
arg_11
)
return
arg_8
arg_15
.
short_description
=
arg_0
return
arg_15

def Func(arg_0="Export selected objects as CSV file", arg_1=None, arg_2=True):
    """
    Return an export csv action.

    Arguments:
        description (string): action description
        fields ([string]): list of model fields to include
        header (bool): whether or not to output the column names as the first row
    """
    # adapted from https://gist.github.com/mgerring/3645889
    def arg_15(arg_3, arg_4, arg_5):  # pylint: disable=unused-argument
        """
        Export model fields to CSV.
        """
        arg_6 = arg_3.model._meta

        if not arg_1:
            arg_7 = [arg_13.name for arg_13 in arg_6.fields]
        else:
            arg_7 = arg_1

        arg_8 = HttpResponse(content_type="text/csv")
        arg_8["Content-Disposition"] = "attachment; filename={filename}.csv".format(
            filename=str(arg_6).replace(".", "_")
        )

        arg_9 = unicodecsv.writer(arg_8, encoding="utf-8")
        if arg_2:
            arg_9.writerow(arg_7)
        for arg_10 in arg_5:
            arg_11 = []
            for arg_12 in arg_7:
                arg_13 = getattr(arg_10, arg_12)
                if callable(arg_13):
                    arg_14 = arg_13()
                else:
                    arg_14 = arg_13
                if arg_14 is None:
                    arg_11.append("[Not Set]")
                elif not arg_14 and isinstance(arg_14, string_types):
                    arg_11.append("[Empty]")
                else:
                    arg_11.append(arg_14)
            arg_9.writerow(arg_11)
        return arg_8

    arg_15.short_description = arg_0
    return arg_15


def Func ( arg_0 ) -> None : arg_0 . indexes = np . arange ( arg_0 . nrows ) if arg_0 . shuffle : np . random . shuffle ( arg_0 . indexes )

def Func(arg_0) -> None:
        'Updates indexes after each epoch for shuffling'
        arg_0.indexes = np.arange(arg_0.nrows)
        if arg_0.shuffle:
            np.random.shuffle(arg_0.indexes)


def Func ( arg_0 ) : arg_1 = arg_0 . _calc_selection_size ( ) if arg_1 > arg_0 . MAX_DATA_ARRAY_SIZE : return True else : return False

def Func(arg_0):
        """ Check if the current selection is too large.
        """

        arg_1 = arg_0._calc_selection_size()

        if arg_1 > arg_0.MAX_DATA_ARRAY_SIZE:
            return True
        else:
            return False

Check if the current selection is too large .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 . setdefault ( 'Dumper' , SafeDumper ) arg_2 . setdefault ( 'default_flow_style' , False ) arg_2 . setdefault ( 'allow_unicode' , True ) arg_1 = yaml . dump ( arg_1 , ** arg_2 ) . strip ( ) return u ( arg_1 )

def Func(arg_0, arg_1, **arg_2):
        """
        Export metadata as YAML. This uses yaml.SafeDumper by default.
        """
        arg_2.setdefault('Dumper', SafeDumper)
        arg_2.setdefault('default_flow_style', False)
        arg_2.setdefault('allow_unicode', True)

        arg_1 = yaml.dump(arg_1, **arg_2).strip()
        return u(arg_1)

Export metadata as YAML . This uses yaml . SafeDumper by default .


def Func ( arg_0 , arg_1 ) : if arg_0 . store . is_encrypted ( ) : return arg_0 . store . Func ( arg_1 )

def Func(arg_0, arg_1):
        """ Unlock the wallet database
        """
        if arg_0.store.is_encrypted():
            return arg_0.store.Func(arg_1)


(self, other, recursive=True, overwrite=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
False
)
:
if
not
isinstance
(
arg_1
,
composite
)
:
raise
AssertionError
(
'Cannot Func composite and {} types'
.
format
(
type
(
arg_1
)
)
)
if
arg_0
.
meta_type
!=
arg_1
.
meta_type
:
return
composite
(
[
arg_0
,
arg_1
]
)
if
arg_0
.
meta_type
==
'list'
:
arg_4
=
[
]
for
arg_5
in
arg_0
.
_list
:
arg_4
.
append
(
arg_5
)
for
arg_5
in
arg_1
.
_list
:
if
arg_5
not
in
arg_0
.
_list
:
arg_4
.
append
(
arg_5
)
return
composite
(
arg_4
)
elif
arg_0
.
meta_type
==
'dict'
:
arg_4
=
{
}
for
arg_6
in
list
(
set
(
list
(
arg_0
.
_dict
.
keys
(
)
)
+
list
(
arg_1
.
_dict
.
keys
(
)
)
)
)
:
arg_7
=
arg_0
.
_dict
.
get
(
arg_6
)
arg_8
=
arg_1
.
_dict
.
get
(
arg_6
)
if
arg_2
and
isinstance
(
arg_7
,
composite
)
and
isinstance
(
arg_8
,
composite
)
:
arg_4
[
arg_6
]
=
arg_7
.
Func
(
arg_8
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
elif
arg_7
==
arg_8
:
arg_4
[
arg_6
]
=
arg_7
elif
arg_7
is
:
arg_4
[
arg_6
]
=
arg_8
elif
arg_8
is
:
arg_4
[
arg_6
]
=
arg_7
elif
arg_3
:
arg_4
[
arg_6
]
=
arg_8
else
:
arg_4
[
arg_6
]
=
composite
(
[
arg_7
,
arg_8
]
)
return
composite
(
arg_4
)
return

def Func(arg_0, arg_1, arg_2=True, arg_3=False):
        """
        Recursively compute Func of data. For dictionaries, items
        for specific keys will be combined into a list, depending on the
        status of the overwrite= parameter. For lists, items will be appended
        and reduced to unique items. This method is meant to be analogous
        to set.Func for composite objects.

        Args:
            other (composite): Other composite object to Func with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.
            overwrite (bool): Whether or not to overwrite entries with the same
                key in a nested dictionary.
        """
        if not isinstance(arg_1, composite):
            raise AssertionError('Cannot Func composite and {} types'.format(type(arg_1)))

        if arg_0.meta_type != arg_1.meta_type:
            return composite([arg_0, arg_1])

        if arg_0.meta_type == 'list':
            arg_4 = []
            for arg_5 in arg_0._list:
                arg_4.append(arg_5)
            for arg_5 in arg_1._list:
                if arg_5 not in arg_0._list:
                    arg_4.append(arg_5)
            return composite(arg_4)
        elif arg_0.meta_type == 'dict':
            arg_4 = {}
            for arg_6 in list(set(list(arg_0._dict.keys()) + list(arg_1._dict.keys()))):
                arg_7 = arg_0._dict.get(arg_6)
                arg_8 = arg_1._dict.get(arg_6)
                if arg_2 and \
                   isinstance(arg_7, composite) and \
                   isinstance(arg_8, composite):
                    arg_4[arg_6] = arg_7.Func(arg_8, arg_2=arg_2, arg_3=arg_3)
                elif arg_7 == arg_8:
                    arg_4[arg_6] = arg_7
                elif arg_7 is None:
                    arg_4[arg_6] = arg_8
                elif arg_8 is None:
                    arg_4[arg_6] = arg_7
                elif arg_3:
                    arg_4[arg_6] = arg_8
                else:
                    arg_4[arg_6] = composite([arg_7, arg_8])
            return composite(arg_4)
        return

Recursively compute union of data. For dictionaries, items
        for specific keys will be combined into a list, depending on the
        status of the overwrite= parameter. For lists, items will be appended
        and reduced to unique items. This method is meant to be analogous
        to set.union for composite objects.

        Args:
            other (composite): Other composite object to union with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.
            overwrite (bool): Whether or not to overwrite entries with the same
                key in a nested dictionary.

Recursively compute union of data . For dictionaries items for specific keys will be combined into a list depending on the status of the overwrite = parameter . For lists items will be appended and reduced to unique items . This method is meant to be analogous to set . union for composite objects .


def Func(arg_0, arg_1, arg_2):
        """ Register a virtual Funcr which receives messages to the matching number.

            :type number: str
            :param number: Subscriber phone number
            :type callback: callable
            :param callback: A callback(OutgoingMessage) which handles the messages directed to the Funcr.
                The message object is augmented with the .reply(str) method which allows to send a reply easily!
            :rtype: LoopbackProvider
        """
        arg_0._Funcrs[arg_4(arg_1)] = arg_2
        return arg_0

Register a virtual subscriber which receives messages to the matching number.

            :type number: str
            :param number: Subscriber phone number
            :type callback: callable
            :param callback: A callback(OutgoingMessage) which handles the messages directed to the subscriber.
                The message object is augmented with the .reply(str) method which allows to send a reply easily!
            :rtype: LoopbackProvider

Register a virtual subscriber which receives messages to the matching number .


def
Func
(
arg_0
,
*
arg_1
)
:
if
isinstance
(
arg_0
,
exceptions
.
APIException
)
:
arg_2
=
{
}
if
getattr
(
arg_0
,
'auth_header'
,
)
:
arg_2
[
'WWW-Authenticate'
]
=
arg_0
.
auth_header
if
getattr
(
arg_0
,
'wait'
,
)
:
arg_2
[
'X-Throttle-Wait-Seconds'
]
=
'%d'
%
arg_0
.
wait
return
Response
(
{
'error'
:
arg_0
.
detail
}
,
status
=
arg_0
.
status_code
,
arg_2
=
arg_2
)
elif
isinstance
(
arg_0
,
Http404
)
:
return
Response
(
{
'error'
:
'Not found'
}
,
status
=
status
.
HTTP_404_NOT_FOUND
)
elif
isinstance
(
arg_0
,
PermissionDenied
)
:
return
Response
(
{
'error'
:
'Permission denied'
}
,
status
=
status
.
HTTP_403_FORBIDDEN
)
return

def Func(arg_0, *arg_1):
    """
    Returns the response that should be used for any given exception.

    By default we handle the REST framework `APIException`, and also
    Django's builtin `Http404` and `PermissionDenied` exceptions.

    Any unhandled exceptions may return `None`, which will cause a 500 error
    to be raised.
    """
    if isinstance(arg_0, exceptions.APIException):
        arg_2 = {}
        if getattr(arg_0, 'auth_header', None):
            arg_2['WWW-Authenticate'] = arg_0.auth_header
        if getattr(arg_0, 'wait', None):
            arg_2['X-Throttle-Wait-Seconds'] = '%d' % arg_0.wait

        return Response({'error': arg_0.detail},
                        status=arg_0.status_code,
                        arg_2=arg_2)

    elif isinstance(arg_0, Http404):
        return Response({'error': 'Not found'},
                        status=status.HTTP_404_NOT_FOUND)

    elif isinstance(arg_0, PermissionDenied):
        return Response({'error': 'Permission denied'},
                        status=status.HTTP_403_FORBIDDEN)

    # Note: Unhandled exceptions will raise a 500 error.
    return None

Returns the response that should be used for any given exception .


def Func(arg_0, arg_1):
        """Format the return value of this function as a string.

        Args:
            value (object): The return value that we are supposed to format.

        Returns:
            str: The formatted return value, or None if this function indicates
                that it does not return data
        """

        arg_0._ensure_loaded()

        if not arg_0.return_info.is_data:
            return None

        # If the return value is typed, use the type_system to format it
        if arg_0.return_info.type_name is not None:
            return typeinfo.type_system.format_value(arg_1, arg_0.return_info.type_name, arg_0.return_info.formatter)

        # Otherwise we expect a callable function to convert this value to a string
        return arg_0.return_info.formatter(arg_1)

Format the return value of this function as a string .


def Func ( arg_0 ) : for arg_1 in arg_0 . reactions : if arg_1 . annotation . get ( "sbo" ) : continue if len ( arg_1 . metabolites ) != 1 : continue arg_2 = list ( arg_1 . _metabolites ) [ 0 ] . id if arg_1 . id . startswith ( "EX_" ) and arg_1 . id == "EX_" + arg_2 : arg_1 . annotation [ "sbo" ] = "SBO:0000627" elif arg_1 . id . startswith ( "DM_" ) and arg_1 . id == "DM_" + arg_2 : arg_1 . annotation [ "sbo" ] = "SBO:0000628"

def Func(arg_0):
    """adds SBO terms for demands and exchanges

    This works for models which follow the standard convention for
    constructing and naming these reactions.

    The reaction should only contain the single metabolite being exchanged,
    and the id should be EX_metid or DM_metid
    """
    for arg_1 in arg_0.reactions:
        # don't annotate already annotated reactions
        if arg_1.annotation.get("sbo"):
            continue
        # only doing exchanges
        if len(arg_1.metabolites) != 1:
            continue
        arg_2 = list(arg_1._metabolites)[0].id
        if arg_1.id.startswith("EX_") and arg_1.id == "EX_" + arg_2:
            arg_1.annotation["sbo"] = "SBO:0000627"
        elif arg_1.id.startswith("DM_") and arg_1.id == "DM_" + arg_2:
            arg_1.annotation["sbo"] = "SBO:0000628"


(xdata, ydatas, yavg, yerr, fit, survival_prob, ax=None,
                 show_plt=True)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
,
arg_7
=
True
)
:
if
not
HAS_MATPLOTLIB
:
raise
ImportError
(
'The function Func needs matplotlib. '
'Run "pip install matplotlib" before.'
)
if
arg_6
is
:
plt
.
figure
(
)
arg_6
=
plt
.
gca
(
)
for
arg_8
in
arg_1
:
arg_6
.
plot
(
arg_0
,
arg_8
,
color
=
'gray'
,
linestyle
=
'none'
,
marker
=
'x'
)
arg_6
.
errorbar
(
arg_0
,
arg_2
,
arg_3
=
arg_3
,
color
=
'r'
,
linestyle
=
'--'
,
linewidth
=
3
)
arg_6
.
plot
(
arg_0
,
arg_5
(
arg_0
,
*
arg_4
)
,
color
=
'blue'
,
linestyle
=
'-'
,
linewidth
=
2
)
arg_6
.
tick_params
(
labelsize
=
14
)
arg_6
.
set_xlabel
(
'Clifford Length'
,
fontsize
=
16
)
arg_6
.
set_ylabel
(
'Z'
,
fontsize
=
16
)
arg_6
.
grid
(
True
)
if
arg_7
:
plt
.
show
(
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=None,
                 arg_7=True):
    """Plot randomized benchmarking data.

    Args:
        xdata (list): list of subsequence lengths
        ydatas (list): list of lists of survival probabilities for each
            sequence
        yavg (list): mean of the survival probabilities at each sequence
            length
        yerr (list): error of the survival
        fit (list): fit parameters
        survival_prob (callable): function that computes survival probability
        ax (Axes or None): plot axis (if passed in)
        show_plt (bool): display the plot.

    Raises:
        ImportError: If matplotlib is not installed.
    """
    # pylint: disable=invalid-name

    if not HAS_MATPLOTLIB:
        raise ImportError('The function Func needs matplotlib. '
                          'Run "pip install matplotlib" before.')
    if arg_6 is None:
        plt.figure()
        arg_6 = plt.gca()

    # Plot the result for each sequence
    for arg_8 in arg_1:
        arg_6.plot(arg_0, arg_8, color='gray', linestyle='none', marker='x')
    # Plot the mean with error bars
    arg_6.errorbar(arg_0, arg_2, arg_3=arg_3, color='r', linestyle='--', linewidth=3)

    # Plot the fit
    arg_6.plot(arg_0, arg_5(arg_0, *arg_4), color='blue', linestyle='-', linewidth=2)
    arg_6.tick_params(labelsize=14)
    # ax.tick_params(axis='x',labelrotation=70)

    arg_6.set_xlabel('Clifford Length', fontsize=16)
    arg_6.set_ylabel('Z', fontsize=16)
    arg_6.grid(True)

    if arg_7:
        plt.show()


def Func ( arg_0 , arg_1 , arg_2 = True ) : try : arg_3 = arg_1 for arg_4 in arg_0 . levels : if isinstance ( arg_3 , dict ) : arg_3 = arg_3 [ arg_4 ] elif isinstance ( arg_3 , list ) or isinstance ( arg_3 , tuple ) : arg_3 = arg_3 [ int ( arg_4 ) ] else : if callable ( getattr ( arg_3 , arg_4 ) ) : try : arg_3 = getattr ( arg_3 , arg_4 ) ( ) except KeyError : arg_3 = getattr ( arg_3 , arg_4 ) else : arg_5 = 'get_%s_display' % arg_4 arg_3 = getattr ( arg_3 , arg_5 ) ( ) if hasattr ( arg_3 , arg_5 ) else getattr ( arg_3 , arg_4 ) if not arg_3 : break return arg_3 except Exception as e : if arg_2 : return '' else : raise e

def Func(arg_0, arg_1, arg_2=True):
        """
        Return an object described by the accessor by traversing the attributes
        of context.

        """
        try:
            arg_3 = arg_1
            for arg_4 in arg_0.levels:
                if isinstance(arg_3, dict):
                    arg_3 = arg_3[arg_4]
                elif isinstance(arg_3, list) or isinstance(arg_3, tuple):
                    arg_3 = arg_3[int(arg_4)]
                else:
                    if callable(getattr(arg_3, arg_4)):
                        try:
                            arg_3 = getattr(arg_3, arg_4)()
                        except KeyError:
                            arg_3 = getattr(arg_3, arg_4)
                    else:
                        # for model field that has choice set
                        # use get_xxx_display to access
                        arg_5 = 'get_%s_display' % arg_4
                        arg_3 = getattr(arg_3, arg_5)() if hasattr(arg_3, arg_5) else getattr(arg_3, arg_4)
                if not arg_3:
                    break
            return arg_3
        except Exception as e:
            if arg_2:
                return ''
            else:
                raise e

Return an object described by the accessor by traversing the attributes of context .


def Func(arg_0, arg_1, arg_2):
    """
    Creates and initialized a TESTSUITE struct and site-effects such as creating
    output directories and forwarding initialization of testcases
    """

    arg_3 = copy.deepcopy(TESTSUITE)  # Setup the test-suite

    arg_3["name"] = arg_1.get("name")
    if arg_3["name"] is None:
        cij.err("rnr:Func: no testsuite is given")
        return None

    arg_3["alias"] = arg_1.get("alias")
    arg_3["ident"] = "%s_%d" % (arg_3["name"], arg_2)

    arg_3["res_root"] = os.sep.join([arg_0["conf"]["OUTPUT"], arg_3["ident"]])
    arg_3["aux_root"] = os.sep.join([arg_3["res_root"], "_aux"])

    arg_3["evars"].update(copy.deepcopy(arg_0["evars"]))
    arg_3["evars"].update(copy.deepcopy(arg_1.get("evars", {})))

    # Initialize
    os.makedirs(arg_3["res_root"])
    os.makedirs(arg_3["aux_root"])

    # Setup testsuite-hooks
    arg_3["hooks"] = hooks_setup(arg_0, arg_3, arg_1.get("hooks"))

    # Forward from declaration
    arg_3["hooks_pr_tcase"] = arg_1.get("hooks_pr_tcase", [])

    arg_3["fname"] = "%s.suite" % arg_3["name"]
    arg_3["fpath"] = os.sep.join([arg_0["conf"]["TESTSUITES"], arg_3["fname"]])

    #
    # Load testcases from .suite file OR from declaration
    #
    arg_4 = []                               # Load testcase fpaths
    if os.path.exists(arg_3["fpath"]):              # From suite-file
        arg_5 = (
            arg_6.strip() for arg_6 in open(arg_3["fpath"]).read().splitlines()
        )
        arg_4.extend(
            (arg_6 for arg_6 in arg_5 if len(arg_6) > 1 and arg_6[0] != "#")
        )
    else:                                           # From declaration
        arg_4.extend(arg_1.get("testcases", []))

    # NOTE: fix duplicates; allow them
    # NOTE: Currently hot-fixed here
    if len(set(arg_4)) != len(arg_4):
        cij.err("rnr:suite: failed: duplicate tcase in suite not supported")
        return None

    for arg_7 in arg_4:                # Setup testcases
        arg_8 = tcase_setup(arg_0, arg_3, arg_7)
        if not arg_8:
            cij.err("rnr:suite: failed: tcase_setup")
            return None

        arg_3["testcases"].append(arg_8)

    return arg_3

Creates and initialized a TESTSUITE struct and site - effects such as creating output directories and forwarding initialization of testcases


def Func ( arg_0 , arg_1 = "floats" , arg_2 = True ) : return arg_0 . image_frame . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1="floats", arg_2=True):
        """
        get image from ImageFrame
        """
        return arg_0.image_frame.Func(arg_1, arg_2)


(registration_id, data, encoding='utf-8', **kwargs)

def Func(arg_0, arg_1, arg_2='utf-8', **arg_3):
    """
    Standalone method to send a single gcm notification
    """

    arg_4 = GCMMessenger(arg_0, arg_1, arg_2=arg_2, **arg_3)
    return arg_4.send_plain()


(database=None, table=None, partitions=None, allow_multi_format=False)

def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
,
arg_3
=
False
)
:
assert_is_type
(
arg_0
,
str
,
)
assert_is_type
(
arg_1
,
str
)
assert_is_type
(
arg_2
,
[
[
str
]
]
,
)
arg_4
=
{
"database"
:
arg_0
,
"table"
:
arg_1
,
"partitions"
:
arg_2
,
"allow_multi_format"
:
arg_3
}
arg_5
=
H2OJob
(
api
(
"POST /3/ImportHiveTable"
,
data
=
arg_4
)
,
"Import Hive Table"
)
.
poll
(
)
return
get_frame
(
arg_5
.
dest_key
)

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=False):
    """
    Import Hive table to H2OFrame in memory.

    Make sure to start H2O with Hive on classpath. Uses hive-site.xml on classpath to connect to Hive.

    :param database: Name of Hive database (default database will be used by default)
    :param table: name of Hive table to import
    :param partitions: a list of lists of strings - partition key column values of partitions you want to import.
    :param allow_multi_format: enable import of partitioned tables with different storage formats used. WARNING:
        this may fail on out-of-memory for tables with a large number of small partitions.

    :returns: an :class:`H2OFrame` containing data of the specified Hive table.

    :examples:
        >>> my_citibike_data = h2o.Func("default", "table", [["2017", "01"], ["2017", "02"]])
    """
    assert_is_type(arg_0, str, None)
    assert_is_type(arg_1, str)
    assert_is_type(arg_2, [[str]], None)
    arg_4 = { "database": arg_0, "table": arg_1, "partitions": arg_2, "allow_multi_format": arg_3 }
    arg_5 = H2OJob(api("POST /3/ImportHiveTable", data=arg_4), "Import Hive Table").poll()
    return get_frame(arg_5.dest_key)

Import Hive table to H2OFrame in memory.

    Make sure to start H2O with Hive on classpath. Uses hive-site.xml on classpath to connect to Hive.

    :param database: Name of Hive database (default database will be used by default)
    :param table: name of Hive table to import
    :param partitions: a list of lists of strings - partition key column values of partitions you want to import.
    :param allow_multi_format: enable import of partitioned tables with different storage formats used. WARNING:
        this may fail on out-of-memory for tables with a large number of small partitions.

    :returns: an :class:`H2OFrame` containing data of the specified Hive table.

    :examples:
        >>> my_citibike_data = h2o.import_hive_table("default", "table", [["2017", "01"], ["2017", "02"]])

Import Hive table to H2OFrame in memory .


(self, file, dest_dir, copy_empty=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : if arg_1 . exists ( ) : if not arg_3 and arg_1 . is_empty ( ) : return None arg_2 . create ( ) arg_1 . copy ( arg_2 ) return arg_2 + arg_1 . get_basefile ( ) elif arg_3 : arg_2 = arg_2 + arg_1 . get_directory ( ) arg_2 . create ( ) arg_4 = arg_2 + arg_1 . get_basefile ( ) arg_4 . touch ( ) return arg_4 else : return None

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """ Backup file in dest_dir Directory.
        The return value is a File object pointing to the copied file in the
        destination directory or None if no file is copied.

        If file exists and it is not empty it is copied to dest_dir.
        If file exists and it is empty the file is copied only if copy_empty is
        True.
        If file does not exist and copy_empty is True a new file in dest_dir
        will be created.
        In all other cases no file will be copied and None is returned.
        """
        if arg_1.exists():
            if not arg_3 and arg_1.is_empty():
                return None
            arg_2.create()
            arg_1.copy(arg_2)
            return arg_2 + arg_1.get_basefile()
        elif arg_3:
            # create new file in dest_dir
            arg_2 = arg_2 + arg_1.get_directory()
            arg_2.create()
            arg_4 = arg_2 + arg_1.get_basefile()
            arg_4.touch()
            return arg_4
        else:
            return None

Backup file in dest_dir Directory . The return value is a File object pointing to the copied file in the destination directory or None if no file is copied .


(self, api_key=None, secret=None, list_data=None, auth=False, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=False, **arg_5):
        """Sends the given Payload to the API via the websocket connection.

        :param kwargs: payload paarameters as key=value pairs
        :return:
        """
        if arg_4:
            arg_6 = str(int(time.time() * 10000000))
            arg_7 = 'AUTH' + arg_6
            arg_8 = hmac.new(arg_2.encode(), arg_7.encode(),
                                hashlib.sha384).hexdigest()

            arg_9 = {'event': 'auth', 'apiKey': arg_1, 'authSig': arg_8,
                       'authPayload': arg_7, 'authNonce': arg_6}
            arg_9 = json.dumps(arg_9)
        elif arg_3:
            arg_9 = json.dumps(arg_3)
        else:
            arg_9 = json.dumps(arg_5)
        arg_0.log.debug("Func(): Sending payload to API: %s", arg_9)
        try:
            arg_0.socket.Func(arg_9)
        except websocket.WebSocketConnectionClosedException:
            arg_0.log.error("Func(): Did not Func out payload %s - client not connected. ", arg_5)

Sends the given Payload to the API via the websocket connection .


def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 . pre_order ( ) : arg_1 += arg_2 . prefix . count ( '\n' ) if isinstance ( arg_2 , Leaf ) : arg_2 . lineno = arg_1 arg_1 += str ( arg_2 . value ) . count ( '\n' )

def Func(arg_0):
    r"""Recomputes all line numbers based on the number of \n characters."""
    arg_1 = 0
    for arg_2 in arg_0.pre_order():
        arg_1 += arg_2.prefix.count('\n')
        if isinstance(arg_2, Leaf):
            arg_2.lineno = arg_1
            arg_1 += str(arg_2.value).count('\n')

r Recomputes all line numbers based on the number of \ n characters .


return BigQueryConnection(
            service=service,
            project_id=project,
            use_legacy_sql=self.use_legacy_sql,
            location=self.location,
            num_retries=self.num_retries
        )

def Func(arg_0):
        """
        Returns a BigQuery PEP 249 connection object.
        """
        arg_1 = arg_0.get_service()
        arg_2 = arg_0._get_field('project')
        return BigQueryConnection(
            arg_1=arg_1,
            project_id=arg_2,
            use_legacy_sql=arg_0.use_legacy_sql,
            location=arg_0.location,
            num_retries=arg_0.num_retries
        )

Returns a BigQuery PEP 249 connection object .


return getattr(redisent, 'object')(infotype, key)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . redises [ arg_0 . _getnodenamefor ( arg_2 ) + '_slave' ] return getattr ( arg_3 , 'Func' ) ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        "Return the encoding, idletime, or refcount about the key"
        arg_3 = arg_0.redises[arg_0._getnodenamefor(arg_2) + '_slave']
        return getattr(arg_3, 'Func')(arg_1, arg_2)

Return the encoding idletime or refcount about the key


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
db
.
view
(
"properties/by_url"
,
key
=
arg_1
,
include_docs
=
True
)
_logger
.
debug
(
"find(%r) returned %s"
%
(
arg_1
,
len
(
arg_2
)
)
)
assert
len
(
arg_2
)
<=
1
,
"Found multiple matches for %r"
%
arg_1
for
arg_3
in
arg_2
:
assert
arg_3
.
doc
return
arg_3
.
doc
return

def Func(arg_0, arg_1):
        """Return properties document for path."""
        # Query the permanent view to find a url
        arg_2 = arg_0.db.view("properties/by_url", key=arg_1, include_docs=True)
        _logger.debug("find(%r) returned %s" % (arg_1, len(arg_2)))
        assert len(arg_2) <= 1, "Found multiple matches for %r" % arg_1
        for arg_3 in arg_2:
            assert arg_3.doc
            return arg_3.doc
        return None


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_2 , list ) : arg_0 . eventCounter += len ( arg_2 ) else : arg_0 . eventCounter += 1 arg_2 = [ arg_2 ] arg_3 = arg_0 . _aggregateQueue ( arg_2 ) if arg_3 : if ( arg_1 in arg_0 . critical ) or ( arg_1 in arg_0 . warn ) : arg_0 . setStates ( arg_1 , arg_3 ) arg_0 . routeEvent ( arg_1 , arg_3 ) arg_3 = [ ] arg_0 . lastEvents [ arg_1 ] = time . time ( )

def Func(arg_0, arg_1, arg_2):
        """Callback that all event sources call when they have a new event
        or list of events
        """

        if isinstance(arg_2, list):
            arg_0.eventCounter += len(arg_2)
        else:
            arg_0.eventCounter += 1
            arg_2 = [arg_2]

        arg_3 = arg_0._aggregateQueue(arg_2)

        if arg_3:
            if (arg_1 in arg_0.critical) or (arg_1 in arg_0.warn):
                arg_0.setStates(arg_1, arg_3)

            arg_0.routeEvent(arg_1, arg_3)

        arg_3 = []

        arg_0.lastEvents[arg_1] = time.time()


(title, prefs, help_text='', static=True, readonly=False)

def Func(arg_0, arg_1, arg_2='', arg_3=True, arg_4=False):
    """Marks preferences group.

    :param str|unicode title: Group title

    :param list|tuple prefs: Preferences to group.

    :param str|unicode help_text: Field help text.

    :param bool static: Leave this preference static (do not store in DB).

    :param bool readonly: Make this field read only.

    """
    bind_proxy(arg_1, arg_0, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

    for arg_5 in arg_1:  # For preferences already marked by pref().
        if isinstance(arg_5, PrefProxy):
            arg_5.category = arg_0


def Func(arg_0, arg_1):
    """List bookmarked Func for user.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon bookmark Func
    ```

    \b
    ```bash
    $ polyaxon bookmark -u adam Func
    ```
    """
    arg_2 = get_username_or_local(arg_0.obj.get('username'))

    arg_1 = arg_1 or 1
    try:
        arg_3 = PolyaxonClient().bookmark.Func(username=arg_2, arg_1=arg_1)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error(
            'Could not get bookmarked Func for user `{}`.'.format(arg_2))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    arg_4 = get_meta_response(arg_3)
    if arg_4:
        Printer.print_header('Bookmarked Func for user `{}`.'.format(arg_2))
        Printer.print_header('Navigation:')
        dict_tabulate(arg_4)
    else:
        Printer.print_header('No bookmarked Func found for user `{}`.'.format(arg_2))

    arg_5 = [Printer.add_status_color(o.to_light_dict(humanize_values=True))
               for o in arg_3['results']]
    arg_5 = list_dicts_to_tabulate(arg_5)
    if arg_5:
        Printer.print_header("Projects:")
        dict_tabulate(arg_5, is_list_dict=True)

List bookmarked projects for user.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon bookmark projects
    ```

    \b
    ```bash
    $ polyaxon bookmark -u adam projects
    ```


def Func(arg_0):
    """Adds all necessary parameters to the `traj` container"""

    arg_0.f_add_parameter('steps', 10000, comment='Number of time steps to simulate')
    arg_0.f_add_parameter('dt', 0.01, comment='Step size')

    # Here we want to add the initial conditions as an array parameter. We will simulate
    # a 3-D differential equation, the Lorenz attractor.
    arg_0.f_add_parameter(ArrayParameter,'initial_conditions', np.array([0.0,0.0,0.0]),
                         comment = 'Our initial conditions, as default we will start from'
                                   ' origin!')

    # We will group all parameters of the Lorenz differential equation into the group 'func_params'
    arg_0.f_add_parameter('func_params.sigma', 10.0)
    arg_0.f_add_parameter('func_params.beta', 8.0/3.0)
    arg_0.f_add_parameter('func_params.rho', 28.0)

    #For the fun of it we will annotate the  group
    arg_0.func_params.v_annotations.info='This group contains as default the original values chosen ' \
                                   'by Edward Lorenz in 1963. Check it out on wikipedia ' \
                                   '(https://en.wikipedia.org/wiki/Lorenz_attractor)!'

Adds all necessary parameters to the traj container


def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = 4 arg_5 = 0.25 arg_6 = None if ( arg_2 is None ) and ( arg_3 is None ) : arg_2 = plt . figure ( figsize = ( arg_4 , 1 ) ) else : arg_6 = arg_2 if arg_3 is None : arg_3 = arg_2 . add_axes ( [ 0.1 * arg_5 , 0.1 , 0.8 * arg_5 , 0.8 ] ) else : arg_6 = arg_3 arg_7 = patches . Rectangle ( ( 0 , 0 ) , arg_4 * arg_5 , arg_4 * arg_5 , color = arg_0 . colour , lw = 1 , hatch = arg_0 . hatch , ec = 'k' ) arg_3 . add_patch ( arg_7 ) arg_3 . text ( 1.0 + 0.1 * arg_5 * arg_4 , arg_4 * arg_5 * 0.5 , arg_0 . component . summary ( arg_1 = arg_1 ) , fontsize = max ( arg_4 , 15 ) , verticalalignment = 'center' , horizontalalignment = 'left' ) arg_3 . set_xlim ( [ 0 , arg_4 * arg_5 ] ) arg_3 . set_ylim ( [ 0 , arg_4 * arg_5 ] ) arg_3 . get_xaxis ( ) . set_visible ( False ) arg_3 . get_yaxis ( ) . set_visible ( False ) arg_3 . invert_yaxis ( ) return arg_6

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Make a simple Func of the Decor.

        Args:
            fmt (str): A Python format string for the component summaries.
            fig (PyFunc figure): A figure, optional. Use either fig or ax, not
                both.
            ax (PyFunc axis): An axis, optional. Use either fig or ax, not
                both.

        Returns:
            fig or ax or None. If you pass in an ax, you get it back. If you pass
                in a fig, you get it. If you pass nothing, the function creates a
                Func object as a side-effect.
        """

        arg_4 = 4     # aspect ratio of decor Func
        arg_5 = 0.25  # ratio of decor tile width

        arg_6 = None

        if (arg_2 is None) and (arg_3 is None):
            arg_2 = plt.figure(figsize=(arg_4, 1))
        else:
            arg_6 = arg_2

        if arg_3 is None:
            arg_3 = arg_2.add_axes([0.1*arg_5, 0.1, 0.8*arg_5, 0.8])
        else:
            arg_6 = arg_3

        arg_7 = patches.Rectangle((0, 0),
                                  arg_4*arg_5, arg_4*arg_5,
                                  color=arg_0.colour,
                                  lw=1,
                                  hatch=arg_0.hatch,
                                  ec='k')
        arg_3.add_patch(arg_7)
        arg_3.text(1.0+0.1*arg_5*arg_4, arg_4*arg_5*0.5,
                arg_0.component.summary(arg_1=arg_1),
                fontsize=max(arg_4, 15),
                verticalalignment='center',
                horizontalalignment='left')
        arg_3.set_xlim([0, arg_4*arg_5])
        arg_3.set_ylim([0, arg_4*arg_5])
        arg_3.get_xaxis().set_visible(False)
        arg_3.get_yaxis().set_visible(False)
        arg_3.invert_yaxis()

        return arg_6

Make a simple plot of the Decor.

        Args:
            fmt (str): A Python format string for the component summaries.
            fig (Pyplot figure): A figure, optional. Use either fig or ax, not
                both.
            ax (Pyplot axis): An axis, optional. Use either fig or ax, not
                both.

        Returns:
            fig or ax or None. If you pass in an ax, you get it back. If you pass
                in a fig, you get it. If you pass nothing, the function creates a
                plot object as a side-effect.


def
Func
(
arg_0
)
:
try
:
return
[
float
(
arg_1
)
for
arg_1
in
arg_0
.
strip
(
'['
)
.
strip
(
']'
)
.
split
(
', '
)
]
except
:
return
[
float
(
arg_1
)
for
arg_1
in
arg_0
.
strip
(
'['
)
.
strip
(
']'
)
.
split
(
','
)
]

def Func(arg_0):
        """Pull comma separated string values out of a text file and converts them to float list"""
        try:
            return [float(arg_1) for arg_1 in arg_0.strip('[').strip(']').split(', ')]
        except:
            return [float(arg_1) for arg_1 in arg_0.strip('[').strip(']').split(',')]


(asana_workspace_id, name, notes, assignee, projects,
                completed, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                arg_5, **arg_6):
    """Creates a task"""
    put("Func",
        arg_0=arg_0,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5,
        **arg_6)


def Func(arg_0, arg_1, arg_2):
        """
        Return the offset from the iteration center in number of elements.

        The order of indices used in access is preserved.
        """
        # TODO to be replaced with compile_global_offsets
        arg_3 = 0
        arg_4 = arg_0.variables[arg_1][1]

        for arg_5, arg_6 in enumerate(arg_2):
            arg_7, arg_8, arg_9 = arg_6
            assert arg_7 == 'rel', 'Only relative access to arrays is supported at the moment'

            if arg_7 == 'rel':
                arg_3 += arg_0.subs_consts(
                    arg_9*reduce(operator.mul, arg_4[arg_5+1:], sympy.Integer(1)))
            else:
                # should not happen
                pass

        return arg_3

Return the offset from the iteration center in number of elements .


def Func ( arg_0 ) : arg_1 = np . real ( arg_0 ) arg_2 = np . imag ( arg_0 ) return np . sqrt ( arg_1 * arg_1 + arg_2 * arg_2 )

def Func(arg_0):
    """Magnitude of a complex matrix."""
    arg_1 = np.real(arg_0)
    arg_2 = np.imag(arg_0)
    return np.sqrt(arg_1 * arg_1 + arg_2 * arg_2);


def Func ( arg_0 , arg_1 ) : arg_2 = tf . nn . log_softmax if arg_1 else tf . nn . softmax arg_3 = arg_2 ( arg_0 . cat . logits ) arg_3 = tf . unstack ( arg_3 , num = arg_0 . num_components , axis = - 1 ) return arg_3

def Func(arg_0, arg_1):
    """Get a list of num_components batchwise probabilities."""
    arg_2 = tf.nn.log_softmax if arg_1 else tf.nn.softmax
    arg_3 = arg_2(arg_0.cat.logits)
    arg_3 = tf.unstack(arg_3, num=arg_0.num_components, axis=-1)
    return arg_3

Get a list of num_components batchwise probabilities .


def Func ( arg_0 ) : if arg_0 [ "file" ] and os . path . isfile ( arg_0 [ "file" ] ) : arg_0 [ "body" ] = open ( arg_0 [ "file" ] , "r" ) . read ( ) arg_0 [ "file" ] = None

def Func(arg_0):
    """Reads message body if specified via filepath."""
    if arg_0["file"] and os.path.isfile(arg_0["file"]):
        arg_0["body"] = open(arg_0["file"], "r").read()
        arg_0["file"] = None

Reads message body if specified via filepath .


def Func ( arg_0 , arg_1 ) : arg_2 = 1 arg_3 = arg_1 . get ( 'count' , 1 ) if isinstance ( arg_3 , int ) : arg_2 = max ( arg_3 , 1 ) def with_index ( arg_0 , arg_4 ) : if arg_0 and arg_4 : return '%s_%d' % ( arg_0 , arg_4 ) return arg_0 def get_instance ( arg_5 , arg_4 = None ) : return BlockadeContainerConfig ( with_index ( arg_5 , arg_4 ) , arg_1 [ 'image' ] , command = arg_1 . get ( 'command' ) , links = arg_1 . get ( 'links' ) , volumes = arg_1 . get ( 'volumes' ) , publish_ports = arg_1 . get ( 'ports' ) , expose_ports = arg_1 . get ( 'expose' ) , environment = arg_1 . get ( 'environment' ) , hostname = arg_1 . get ( 'hostname' ) , dns = arg_1 . get ( 'dns' ) , start_delay = arg_1 . get ( 'start_delay' , 0 ) , neutral = arg_1 . get ( 'neutral' , False ) , holy = arg_1 . get ( 'holy' , False ) , container_name = with_index ( arg_1 . get ( 'container_name' ) , arg_4 ) , cap_add = arg_1 . get ( 'cap_add' ) ) if arg_2 == 1 : yield get_instance ( arg_0 ) else : for arg_4 in range ( 1 , arg_2 + 1 ) : yield get_instance ( arg_0 , arg_4 )

def Func(arg_0, arg_1):
        '''
        Convert a dictionary of configuration values
        into a sequence of BlockadeContainerConfig instances
        '''

        # determine the number of instances of this container
        arg_2 = 1
        arg_3 = arg_1.get('count', 1)
        if isinstance(arg_3, int):
            arg_2 = max(arg_3, 1)

        def with_index(arg_0, arg_4):
            if arg_0 and arg_4:
                return '%s_%d' % (arg_0, arg_4)
            return arg_0

        def get_instance(arg_5, arg_4=None):
            return BlockadeContainerConfig(
                with_index(arg_5, arg_4),
                arg_1['image'],
                command=arg_1.get('command'),
                links=arg_1.get('links'),
                volumes=arg_1.get('volumes'),
                publish_ports=arg_1.get('ports'),
                expose_ports=arg_1.get('expose'),
                environment=arg_1.get('environment'),
                hostname=arg_1.get('hostname'),
                dns=arg_1.get('dns'),
                start_delay=arg_1.get('start_delay', 0),
                neutral=arg_1.get('neutral', False),
                holy=arg_1.get('holy', False),
                container_name=with_index(arg_1.get('container_name'), arg_4),
                cap_add=arg_1.get('cap_add'))

        if arg_2 == 1:
            yield get_instance(arg_0)
        else:
            for arg_4 in range(1, arg_2+1):
                # TODO: configurable name/index format
                yield get_instance(arg_0, arg_4)


return map(lambda n: format % n, itertools.count(1))

def
Func
(
arg_0
)
:
arg_1
=
'%s (%%d)%s'
%
splitext_files_only
(
arg_0
)
return
map
(
lambda
n
:
arg_1
%
n
,
itertools
.
count
(
1
)
)

def Func(arg_0):
	"""Append numbers in sequential order to the filename or folder name
	Numbers should be appended before the extension on a filename."""
	arg_1 = '%s (%%d)%s' % splitext_files_only(arg_0)
	return map(lambda n: arg_1 % n, itertools.count(1))

Append numbers in sequential order to the filename or folder name Numbers should be appended before the extension on a filename .


def Func ( arg_0 , arg_1 ) : def scale ( arg_2 ) : return np . multiply ( arg_1 , arg_2 ) if arg_0 . deflection_stack is not None : return arg_0 . deflection_stack . apply_function ( scale ) else : return None

def Func(arg_0, arg_1):
    """Given a plane and scaling factor, compute a set of scaled deflections.

    Parameters
    -----------
    plane : plane.Plane
        The plane whose deflection stack is scaled.
    scaling_factor : float
        The factor the deflection angles are scaled by, which is typically the scaling factor between redshifts for \
        multi-plane lensing.
    """

    def scale(arg_2):
        return np.multiply(arg_1, arg_2)

    if arg_0.deflection_stack is not None:
        return arg_0.deflection_stack.apply_function(scale)
    else:
        return None

Given a plane and scaling factor compute a set of scaled deflections .


(self, distance="distance", pm_long="pm_l", pm_lat="pm_b",
                                                     vl="vl", vb="vb",
                                                     propagate_uncertainties=False,
                                                     radians=False)

def
Func
(
arg_0
,
arg_1
=
"distance"
,
arg_2
=
"pm_l"
,
arg_3
=
"pm_b"
,
arg_4
=
"vl"
,
arg_5
=
"vb"
,
arg_6
=
False
,
arg_7
=
False
)
:
arg_8
=
4.74057
arg_0
.
add_variable
(
"k"
,
arg_8
,
overwrite
=
False
)
arg_0
.
add_virtual_column
(
arg_4
,
"k*{pm_long}*{distance}"
.
format
(
**
locals
(
)
)
)
arg_0
.
add_virtual_column
(
arg_5
,
"k* {pm_lat}*{distance}"
.
format
(
**
locals
(
)
)
)
if
arg_6
:
arg_0
.
propagate_uncertainties
(
[
arg_0
[
arg_4
]
,
arg_0
[
arg_5
]
]
)

def Func(arg_0, arg_1="distance", arg_2="pm_l", arg_3="pm_b",
                                                     arg_4="vl", arg_5="vb",
                                                     arg_6=False,
                                                     arg_7=False):
    """Convert proper motion to perpendicular velocities.

    :param distance:
    :param pm_long:
    :param pm_lat:
    :param vl:
    :param vb:
    :param cov_matrix_distance_pm_long_pm_lat:
    :param uncertainty_postfix:
    :param covariance_postfix:
    :param radians:
    :return:
    """
    arg_8 = 4.74057
    arg_0.add_variable("k", arg_8, overwrite=False)
    arg_0.add_virtual_column(arg_4, "k*{pm_long}*{distance}".format(**locals()))
    arg_0.add_virtual_column(arg_5, "k* {pm_lat}*{distance}".format(**locals()))
    if arg_6:
        arg_0.propagate_uncertainties([arg_0[arg_4], arg_0[arg_5]])

Convert proper motion to perpendicular velocities .