(
        st, tile, rad='calc', max_iter=3, invert='guess', max_allowed_remove=20,
        minmass=None, use_tp=False, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'calc'
,
arg_3
=
3
,
arg_4
=
'guess'
,
arg_5
=
20
,
arg_6
=
,
arg_7
=
False
,
**
arg_8
)
:
if
arg_2
==
'calc'
:
arg_2
=
guess_add_radii
(
arg_0
)
if
arg_4
==
'guess'
:
arg_4
=
guess_invert
(
arg_0
)
arg_9
=
np
.
copy
(
arg_0
.
error
)
arg_10
=
np
.
nonzero
(
arg_1
.
contains
(
arg_0
.
obj_get_positions
(
)
)
)
[
0
]
if
arg_10
.
size
>=
arg_5
:
CLOG
.
fatal
(
'Misfeatured region too large!'
)
raise
RuntimeError
elif
arg_10
.
size
>=
arg_5
/
2
:
CLOG
.
warn
(
'Large misfeatured regions.'
)
elif
arg_10
.
size
>
0
:
arg_11
,
arg_12
=
arg_0
.
obj_remove_particle
(
arg_10
)
arg_13
=
arg_10
.
size
arg_14
=
[
]
for
arg_15
in
range
(
arg_3
)
:
if
arg_4
:
im
=
1
arg_0
.
residuals
[
arg_1
.
slicer
]
else
:
im
=
arg_0
.
residuals
[
arg_1
.
slicer
]
guess
,
arg_15
=
_feature_guess
(
im
,
arg_2
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
accepts
,
poses
=
check_add_particles
(
arg_0
,
guess
+
arg_1
.
l
,
arg_2
=
arg_2
,
do_opt
=
True
,
**
arg_8
)
arg_14
.
extend
(
poses
)
arg_13
+=
accepts
if
accepts
==
0
:
break
else
:
CLOG
.
warn
(
'Runaway adds or insufficient max_iter'
)
arg_16
=
[
]
for
arg_17
in
arg_14
:
arg_16
.
append
(
arg_0
.
obj_closest_particle
(
arg_17
)
)
if
len
(
arg_16
)
>
arg_5
:
for
arg_18
in
range
(
0
,
len
(
arg_16
)
,
arg_5
)
:
opt
.
do_levmarq_particles
(
arg_0
,
np
.
array
(
arg_16
[
arg_18
:
arg_18
+
arg_5
]
)
,
include_rad
=
True
,
arg_3
=
3
)
elif
len
(
arg_16
)
>
0
:
opt
.
do_levmarq_particles
(
arg_0
,
arg_16
,
include_rad
=
True
,
arg_3
=
3
)
arg_19
=
(
arg_10
.
size
>
0
)
or
(
len
(
arg_16
)
>
0
)
if
arg_19
&
(
arg_0
.
error
>
arg_9
)
:
CLOG
.
info
(
'Failed addsub, Tile {} -> {}'
.
format
(
arg_1
.
l
.
tolist
(
)
,
arg_1
.
r
.
tolist
(
)
)
)
if
len
(
arg_16
)
>
0
:
arg_15
=
arg_0
.
obj_remove_particle
(
arg_16
)
if
arg_10
.
size
>
0
:
for
arg_17
,
arg_20
in
zip
(
arg_11
.
reshape
(
1
,
3
)
,
arg_12
.
reshape
(
1
)
)
:
arg_15
=
arg_0
.
obj_add_particle
(
arg_17
,
arg_20
)
arg_13
=
0
arg_16
=
[
]
return
arg_13
,
arg_16

def Func(
        arg_0, arg_1, arg_2='calc', arg_3=3, arg_4='guess', arg_5=20,
        arg_6=None, arg_7=False, **arg_8):
    """
    Automatically adds and subtracts missing & extra particles in a region
    of poor fit.

    Parameters
    ----------
    st: :class:`peri.states.State`
        The state to add and subtract particles to.
    tile : :class:`peri.util.Tile`
        The poorly-fit region to examine.
    rad : Float or 'calc', optional
        The initial radius for added particles; added particles radii are
        not fit until the end of add_subtract. Default is ``'calc'``, which
        uses the median radii of active particles.
    max_iter : Int, optional
        The maximum number of loops for attempted adds at one tile location.
        Default is 3.
    invert : {'guess', True, False}, optional
        Whether to invert the image for feature_guess -- True for dark
        particles on a bright background, False for bright particles. The
        default is to guess from the state's current particles.
    max_allowed_remove : Int, optional
        The maximum number of particles to remove. If the misfeatured tile
        contains more than this many particles, raises an error. If it
        contains more than half as many particles, logs a warning. If more
        than this many particles are added, they are optimized in blocks of
        ``max_allowed_remove``. Default is 20.

    Other Parameters
    ----------------
    im_change_frac : Float on [0, 1], optional.
        If adding or removing a particle decreases the error less than
        ``im_change_frac``*the change in the image, the particle is deleted.
        Default is 0.2.

    min_derr : {Float, ``'3sig'``}, optional
        The minimum change in the state's error to keep a particle in the
        image. Default is ``'3sig'`` which uses ``3*st.sigma``.

    do_opt : Bool, optional
        Set to False to avoid optimizing particle positions after adding
        them. Default is True.

    minmass : Float, optional
        The minimum mass for a particle to be identified as a feature, as
        used by trackpy. Defaults to a decent guess.

    use_tp : Bool, optional
        Set to True to use trackpy to find missing particles inside the
        image. Not recommended since trackpy deliberately cuts out particles
        at the edge of the image. Default is False.

    Outputs
    -------
    n_added : Int
        The change in the number of particles, i.e. ``n_added-n_subtracted``
    ainds: List of ints
        The indices of the added particles.

    Notes
    --------
    The added/removed positions returned are whether or not the
    position has been added or removed ever. It's possible/probably that
    a position is added, then removed during a later iteration.

    Algorithm is:
    1.  Remove all particles within the tile.
    2.  Feature and add particles to the tile.
    3.  Optimize the added particles positions only.
    4.  Run 2-3 until no particles have been added.
    5.  Optimize added particle radii
    Because all the particles are removed within a tile, it is important
    to set max_allowed_remove to a reasonable value. Otherwise, if the
    tile is the size of the image it can take a long time to remove all
    the particles and re-add them.
    """
    if arg_2 == 'calc':
        arg_2 = guess_add_radii(arg_0)
    if arg_4 == 'guess':
        arg_4 = guess_invert(arg_0)
    # 1. Remove all possibly bad particles within the tile.
    arg_9 = np.copy(arg_0.error)
    arg_10 = np.nonzero(arg_1.contains(arg_0.obj_get_positions()))[0]
    if arg_10.size >= arg_5:
        CLOG.fatal('Misfeatured region too large!')
        raise RuntimeError
    elif arg_10.size >= arg_5/2:
        CLOG.warn('Large misfeatured regions.')
    elif arg_10.size > 0:
        arg_11, arg_12 = arg_0.obj_remove_particle(arg_10)

    # 2-4. Feature & add particles to the tile, optimize, run until none added
    arg_13 = -arg_10.size
    arg_14 = []
    for arg_15 in range(arg_3):
        if arg_4:
            im = 1 - arg_0.residuals[arg_1.slicer]
        else:
            im = arg_0.residuals[arg_1.slicer]
        guess, arg_15 = _feature_guess(im, arg_2, arg_6=arg_6, arg_7=arg_7)
        accepts, poses = check_add_particles(
                arg_0, guess+arg_1.l, arg_2=arg_2, do_opt=True, **arg_8)
        arg_14.extend(poses)
        arg_13 += accepts
        if accepts == 0:
            break
    else:  # for-break-else
        CLOG.warn('Runaway adds or insufficient max_iter')

    # 5. Optimize added pos + rad:
    arg_16 = []
    for arg_17 in arg_14:
        arg_16.append(arg_0.obj_closest_particle(arg_17))
    if len(arg_16) > arg_5:
        for arg_18 in range(0, len(arg_16), arg_5):
            opt.do_levmarq_particles(
                arg_0, np.array(arg_16[arg_18:arg_18 + arg_5]),
                include_rad=True, arg_3=3)
    elif len(arg_16) > 0:
        opt.do_levmarq_particles(arg_0, arg_16, include_rad=True, arg_3=3)

    # 6. Ensure that current error after add-subtracting is lower than initial
    arg_19 = (arg_10.size > 0) or (len(arg_16) > 0)
    if arg_19 & (arg_0.error > arg_9):
        CLOG.info('Failed addsub, Tile {} -> {}'.format(
            arg_1.l.tolist(), arg_1.r.tolist()))
        if len(arg_16) > 0:
            arg_15 = arg_0.obj_remove_particle(arg_16)
        if arg_10.size > 0:
            for arg_17, arg_20 in zip(arg_11.reshape(-1, 3), arg_12.reshape(-1)):
                arg_15 = arg_0.obj_add_particle(arg_17, arg_20)
        arg_13 = 0
        arg_16 = []
    return arg_13, arg_16

Automatically adds and subtracts missing & extra particles in a region of poor fit .


return sum(parse_token(*token) for token in _re_token.findall(duration))

def
Func
(
arg_0
)
:
arg_1
=
re
.
compile
(
"([0-9.]+)([dhms]?)"
)
def
parse_token
(
arg_2
,
arg_3
)
:
arg_4
=
{
'd'
:
86400
,
'h'
:
3600
,
'm'
:
60
,
's'
:
1
,
}
if
arg_3
:
if
arg_3
in
arg_4
:
return
int
(
float
(
arg_2
)
*
arg_4
[
arg_3
]
*
1000
)
else
:
raise
StepperConfigurationError
(
'Failed to parse duration: %s'
%
arg_0
)
else
:
return
int
(
float
(
arg_2
)
*
1000
)
return
sum
(
parse_token
(
*
arg_5
)
for
arg_5
in
arg_1
.
findall
(
arg_0
)
)

def Func(arg_0):
    '''
    Parse duration string, such as '3h2m3s' into milliseconds

    >>> Func('3h2m3s')
    10923000

    >>> Func('0.3s')
    300

    >>> Func('5')
    5000
    '''
    arg_1 = re.compile("([0-9.]+)([dhms]?)")

    def parse_token(arg_2, arg_3):
        arg_4 = {
            'd': 86400,
            'h': 3600,
            'm': 60,
            's': 1,
        }
        if arg_3:
            if arg_3 in arg_4:
                return int(float(arg_2) * arg_4[arg_3] * 1000)
            else:
                raise StepperConfigurationError(
                    'Failed to parse duration: %s' % arg_0)
        else:
            return int(float(arg_2) * 1000)

    return sum(parse_token(*arg_5) for arg_5 in arg_1.findall(arg_0))

Parse duration string, such as '3h2m3s' into milliseconds

    >>> parse_duration('3h2m3s')
    10923000

    >>> parse_duration('0.3s')
    300

    >>> parse_duration('5')
    5000

Parse duration string such as 3h2m3s into milliseconds


(
        self,
        book,
        range_,
        sheet=None,
        name=None,
        names_row=None,
        param_cols=None,
        space_param_order=None,
        cells_param_order=None,
        transpose=False,
        names_col=None,
        param_rows=None,
    )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3=None,
        arg_4=None,
        arg_5=None,
        arg_6=None,
        arg_7=None,
        arg_8=None,
        arg_9=False,
        arg_10=None,
        arg_11=None,
    ):
        """Create a child space from an Excel range.

        To use this method, ``openpyxl`` package must be installed.

        Args:
            book (str): Path to an Excel file.
            range_ (str): Range expression, such as "A1", "$G4:$K10",
                or named range "NamedRange1".
            sheet (str): Sheet name (case ignored).
            name (str, optional): Name of the space. Defaults to ``SpaceN``,
                where ``N`` is a number determined automatically.
            names_row (optional): an index number indicating
                what row contains the names of cells and parameters.
                Defaults to the top row (0).
            param_cols (optional): a sequence of index numbers
                indicating parameter columns.
                Defaults to only the leftmost column ([0]).
            names_col (optional): an index number, starting from 0,
                indicating what column contains additional parameters.
            param_rows (optional): a sequence of index numbers, starting from
                0, indicating rows of additional parameters, in case cells are
                defined in two dimensions.
            transpose (optional): Defaults to ``False``.
                If set to ``True``, "row(s)" and "col(s)" in the parameter
                names are interpreted inversely, i.e.
                all indexes passed to "row(s)" parameters are interpreted
                as column indexes,
                and all indexes passed to "col(s)" parameters as row indexes.
            space_param_order: a sequence to specify space parameters and
                their orders. The elements of the sequence denote the indexes
                of ``param_cols`` elements, and optionally the index of
                ``param_rows`` elements shifted by the length of
                ``param_cols``. The elements of this parameter and
                ``cell_param_order`` must not overlap.
            cell_param_order (optional): a sequence to reorder the parameters.
                The elements of the sequence denote the indexes of
                ``param_cols`` elements, and optionally the index of
                ``param_rows`` elements shifted by the length of
                ``param_cols``. The elements of this parameter and
                ``cell_space_order`` must not overlap.

        Returns:
            The new child space created from the Excel range.
        """

        arg_12 = arg_0._impl.Func(
            arg_1,
            arg_2,
            arg_3,
            arg_4,
            arg_5,
            arg_6,
            arg_7,
            arg_8,
            arg_9,
            arg_10,
            arg_11,
        )

        return get_interfaces(arg_12)

Create a child space from an Excel range .


def Func ( arg_0 ) : if arg_0 . is_relative : arg_1 = str ( arg_0 . level ) + "%" else : arg_1 = arg_0 . level return arg_1

def Func(arg_0):
        ''' format level str '''
        if arg_0.is_relative:
            arg_1 = str(arg_0.level) + "%"
        else:
            arg_1 = arg_0.level
        return arg_1


def Func(arg_0, arg_1, arg_2=2):
        """
        Start memory and CPU monitoring, with the time interval between
        each process scan

        @param process_name: Process name, ex: firefox-bin.
        @type process_name: string
        @param interval: Time interval between each process scan
        @type interval: double

        @return: 1 on success
        @rtype: integer
        """
        if arg_1 in arg_0._process_stats:
            # Stop previously running instance
            # At any point, only one process name can be tracked
            # If an instance already exist, then stop it
            arg_0._process_stats[arg_1].stop()
        # Create an instance of process stat
        arg_0._process_stats[arg_1] = ProcessStats(arg_1, arg_2)
        # start monitoring the process
        arg_0._process_stats[arg_1].start()
        return 1

Start memory and CPU monitoring with the time interval between each process scan


return seed_size + length_size + len(self) * hashvalue_size

def Func ( arg_0 , arg_1 = '@' ) : arg_2 = struct . calcsize ( arg_1 + 'q' ) arg_3 = struct . calcsize ( arg_1 + 'i' ) arg_4 = struct . calcsize ( arg_1 + 'I' ) return arg_2 + arg_3 + len ( arg_0 ) * arg_4

def Func(arg_0, arg_1='@'):
        '''Compute the byte size after serialization.

        Args:
            byteorder (str, optional): This is byte order of the serialized data. Use one
                of the `byte order characters
                <https://docs.python.org/3/library/struct.html#byte-order-size-and-alignment>`_:
                ``@``, ``=``, ``<``, ``>``, and ``!``.
                Default is ``@`` -- the native order.

        Returns:
            int: Size in number of bytes after serialization.
        '''
        # Use 8 bytes to store the seed integer
        arg_2 = struct.calcsize(arg_1+'q')
        # Use 4 bytes to store the number of hash values
        arg_3 = struct.calcsize(arg_1+'i')
        # Use 4 bytes to store each hash value as we are using the lower 32 bit
        arg_4 = struct.calcsize(arg_1+'I')
        return arg_2 + arg_3 + len(arg_0) * arg_4

Compute the byte size after serialization .


def Func ( arg_0 , arg_1 ) : assert len ( arg_0 ) == len ( arg_1 ) for arg_2 , arg_3 in zip ( arg_0 , arg_1 ) : arg_3 . annotation = arg_2 . annotation

def Func(arg_0, arg_1):
    """
    Copy annotations from the tokens listed in src to the tokens in dest
    """
    assert len(arg_0) == len(arg_1)
    for arg_2, arg_3 in zip(arg_0, arg_1):
        arg_3.annotation = arg_2.annotation


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , collections . Mapping ) : if arg_0 is None : arg_0 = { } arg_0 . update ( ** arg_1 ) elif isinstance ( arg_1 , six . string_types ) : if arg_0 is None : arg_0 = [ ] arg_0 . append ( arg_1 ) elif isinstance ( arg_1 , collections . Iterable ) : if arg_0 is None : arg_0 = [ ] arg_0 . extend ( arg_1 ) else : if arg_0 is None : arg_0 = [ ] arg_0 . append ( arg_1 ) return arg_0

def Func(arg_0, arg_1):
    """Extends a collection with a value."""
    if isinstance(arg_1, collections.Mapping):
        if arg_0 is None:
            arg_0 = {}
        arg_0.update(**arg_1)

    elif isinstance(arg_1, six.string_types):
        if arg_0 is None:
            arg_0 = []
        arg_0.append(arg_1)

    elif isinstance(arg_1, collections.Iterable):
        if arg_0 is None:
            arg_0 = []
        arg_0.extend(arg_1)

    else:
        if arg_0 is None:
            arg_0 = []
        arg_0.append(arg_1)

    return arg_0


(self, zone, resource_id, body, project_id=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Sets machine type of an instance defined by project_id, zone and resource_id.
        Must be called with keyword arguments rather than positional.

        :param zone: Google Cloud Platform zone where the instance exists.
        :type zone: str
        :param resource_id: Name of the Compute Engine instance resource
        :type resource_id: str
        :param body: Body required by the Compute Engine setMachineType API,
            as described in
            https://cloud.google.com/compute/docs/reference/rest/v1/instances/setMachineType
        :type body: dict
        :param project_id: Optional, Google Cloud Platform project ID where the
            Compute Engine Instance exists. If set to None or missing,
            the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """
        arg_5 = arg_0._execute_Func(arg_1, arg_2, arg_3, arg_4)
        try:
            arg_6 = arg_5["name"]
        except KeyError:
            raise AirflowException(
                "Wrong response '{}' returned - it should contain "
                "'name' field".format(arg_5))
        arg_0._wait_for_operation_to_complete(arg_4=arg_4,
                                             arg_6=arg_6,
                                             arg_1=arg_1)

Sets machine type of an instance defined by project_id zone and resource_id . Must be called with keyword arguments rather than positional .


async
def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
arg_0
.
url_builder
(
arg_1
,
url_params
=
arg_2
)
logger
.
info
(
'Executing method %r'
,
arg_1
)
arg_4
=
await
aiohttp
.
get
(
arg_3
)
logger
.
info
(
'Status: %r'
,
arg_4
.
status
)
if
arg_4
.
status
==
200
:
arg_5
=
await
arg_4
.
json
(
)
logger
.
debug
(
'...with JSON %r'
,
arg_5
)
if
arg_5
.
get
(
'ok'
)
:
return
arg_5
raise
SlackApiError
(
arg_5
[
'error'
]
)
else
:
raise_for_status
(
arg_4
)

async def Func(arg_0, arg_1, **arg_2):
        """Execute a specified Slack Web API method.

        Arguments:
          method (:py:class:`str`): The name of the method.
          **params (:py:class:`dict`): Any additional parameters
            required.

        Returns:
          :py:class:`dict`: The JSON data from the response.

        Raises:
          :py:class:`aiohttp.web_exceptions.HTTPException`: If the HTTP
            request returns a code other than 200 (OK).
          SlackApiError: If the Slack API is reached but the response
           contains an error message.

        """
        arg_3 = arg_0.url_builder(arg_1, url_params=arg_2)
        logger.info('Executing method %r', arg_1)
        arg_4 = await aiohttp.get(arg_3)
        logger.info('Status: %r', arg_4.status)
        if arg_4.status == 200:
            arg_5 = await arg_4.json()
            logger.debug('...with JSON %r', arg_5)
            if arg_5.get('ok'):
                return arg_5
            raise SlackApiError(arg_5['error'])
        else:
            raise_for_status(arg_4)

Execute a specified Slack Web API method .


(cls, cur, table: str, order_by: str, columns: list=None, where_keys: list=None, limit=100,
               offset=0)

def Func(arg_0, arg_1, arg_2: arg_3, arg_4: arg_3, arg_5: arg_6=None, arg_7: arg_6=None, arg_8=100,
               arg_9=0):
        """
        Creates a Func query for Funcive columns with where keys
        Supports multiple where claus with and or or both

        Args:
            table: a string indicating the name of the table
            order_by: a string indicating column name to order the results on
            columns: list of columns to Func from
            where_keys: list of dictionary
            limit: the limit on the number of results
            offset: offset on the results

            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and across dictionaries get 'OR'-ed

        Returns:
            A list of 'Record' object with table columns as properties

        """
        if arg_5:
            arg_10 = arg_0._COMMA.join(arg_5)
            if arg_7:
                arg_11, arg_12 = arg_0._get_where_clause_with_values(arg_7)
                arg_13 = arg_0._Func_Funcive_column_with_condition.format(arg_10, arg_2, arg_11,
                                                                           arg_4, arg_8, arg_9)
                arg_14, arg_15 = arg_13, arg_12
            else:
                arg_13 = arg_0._Func_Funcive_column.format(arg_10, arg_2, arg_4, arg_8, arg_9)
                arg_14, arg_15 = arg_13, ()
        else:
            if arg_7:
                arg_11, arg_12 = arg_0._get_where_clause_with_values(arg_7)
                arg_13 = arg_0._Func_all_string_with_condition.format(arg_2, arg_11, arg_4, arg_8, arg_9)
                arg_14, arg_15 = arg_13, arg_12
            else:
                arg_13 = arg_0._Func_all_string.format(arg_2, arg_4, arg_8, arg_9)
                arg_14, arg_15 = arg_13, ()

        yield from arg_1.execute(arg_14, arg_15)
        return (yield from arg_1.fetchall())

Creates a select query for selective columns with where keys
        Supports multiple where claus with and or or both

        Args:
            table: a string indicating the name of the table
            order_by: a string indicating column name to order the results on
            columns: list of columns to select from
            where_keys: list of dictionary
            limit: the limit on the number of results
            offset: offset on the results

            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and across dictionaries get 'OR'-ed

        Returns:
            A list of 'Record' object with table columns as properties


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
try
:
arg_4
=
Status
(
arg_3
)
arg_0
.
logger
.
debug
(
"Received %s action from %s"
%
(
arg_4
.
action
,
arg_4
.
clientId
)
)
if
arg_0
.
deviceStatusCallback
:
arg_0
.
deviceStatusCallback
(
arg_4
)
except
InvalidEventException
as
e
:
arg_0
.
logger
.
critical
(
str
(
e
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Internal callback for device status messages, parses source device from topic string and
        passes the information on to the registerd device status callback
        """
        try:
            arg_4 = Status(arg_3)
            arg_0.logger.debug("Received %s action from %s" % (arg_4.action, arg_4.clientId))
            if arg_0.deviceStatusCallback:
                arg_0.deviceStatusCallback(arg_4)
        except InvalidEventException as e:
            arg_0.logger.critical(str(e))

Internal callback for device status messages parses source device from topic string and passes the information on to the registerd device status callback


def Func(arg_0):
        """Read a block from the server. Lines are read until a character ``.`` is found

        :return: the read block
        :rtype: string

        """
        arg_1 = ''
        while not arg_0._stop:
            arg_2 = arg_0._readline()
            if arg_2 == '.':
                break
            arg_1 += arg_2
        return arg_1

Read a block from the server . Lines are read until a character . is found


def Func(arg_0, arg_1):
    '''run a build, meaning inserting an instance. Retry if there is failure

       Parameters
       ==========
       config: the configuration dictionary generated by setup_build

    '''
    arg_2 = arg_0._get_project()
    arg_3 = arg_0._get_zone()

    bot.custom(prefix='INSTANCE', message=arg_1['name'], color="CYAN")
    bot.info(arg_1['description'])

    arg_4 = arg_0._compute_service.instances().insert(arg_2=arg_2,
                                                        arg_3=arg_3,
                                                        body=arg_1).execute()

    # Direct the user to the web portal with log
    arg_5 = arg_0._get_ipaddress(arg_1['name'])
    bot.info('Robot Logger: http://%s' %arg_5)
    bot.info('Allow a few minutes for web server install, beepboop!')
    return arg_4

run a build meaning inserting an instance . Retry if there is failure


return ReturnInfo(ret_def, None, True, desc)

def Func(arg_0, arg_1=False):
    """Parse a single return statement declaration.

    The valid types of return declarion are a Returns: section heading
    followed a line that looks like:
    type [format-as formatter]: description

    OR

    type [show-as (string | context)]: description sentence
    """

    arg_2, arg_3, arg_4 = arg_0.partition(':')
    if arg_3 == "":
        raise ValidationError("Invalid return declaration in docstring, missing colon", declaration=arg_2)

    if not arg_1:
        arg_4 = None

    if 'show-as' in arg_2:
        arg_5, arg_6, arg_7 = arg_2.partition('show-as')
        arg_5 = arg_5.strip()
        arg_7 = arg_7.strip()

        if arg_7 not in ('string', 'context'):
            raise ValidationError("Unkown show-as formatting specifier", found=arg_7, expected=['string', 'context'])

        if arg_7 == 'string':
            return ReturnInfo(None, str, True, arg_4)

        return ReturnInfo(None, None, False, arg_4)

    if 'format-as' in arg_2:
        arg_5, arg_6, arg_8 = arg_2.partition('format-as')
        arg_5 = arg_5.strip()
        arg_8 = arg_8.strip()

        return ReturnInfo(arg_5, arg_8, True, arg_4)

    return ReturnInfo(arg_2, None, True, arg_4)

Parse a single return statement declaration .


return current and current is current.parent.name

def Func ( arg_0 ) : arg_1 = arg_0 while arg_1 and not isinstance ( arg_1 . parent , astroid . ExceptHandler ) : arg_1 = arg_1 . parent return arg_1 and arg_1 is arg_1 . parent . name

def Func(arg_0):
    """Returns true if node is inside the name of an except handler."""
    arg_1 = arg_0
    while arg_1 and not isinstance(arg_1.parent, astroid.ExceptHandler):
        arg_1 = arg_1.parent

    return arg_1 and arg_1 is arg_1.parent.name

Returns true if node is inside the name of an except handler .


def Func ( arg_0 ) : assert not hasattr ( arg_0 , "meta" ) arg_0 . _basilisp_fn = True arg_0 . meta = None arg_0 . with_meta = partial ( _fn_with_meta , arg_0 ) return arg_0

def Func(arg_0):
    """Create a Basilisp function, setting meta and supplying a with_meta
    method implementation."""
    assert not hasattr(arg_0, "meta")
    arg_0._basilisp_fn = True
    arg_0.meta = None
    arg_0.with_meta = partial(_fn_with_meta, arg_0)
    return arg_0

Create a Basilisp function setting meta and supplying a with_meta method implementation .


def Func(arg_0, arg_1):
        """Retain the identities in SortingHat based on the `retention_time`
        value declared in the setup.cfg.

        :param retention_time: maximum number of minutes wrt the current date to retain the SortingHat data
        """
        arg_2 = arg_0.conf['es_enrichment']['url']
        arg_3 = arg_0.db
        arg_4 = arg_0.get_backend(arg_0.backend_section)
        arg_5 = arg_0.config.get_active_data_sources()

        if arg_1 is None:
            logger.debug("[identities retention] Retention policy disabled, no identities will be deleted.")
            return

        if arg_1 <= 0:
            logger.debug("[identities retention] Retention time must be greater than 0.")
            return

        Func(arg_1, arg_2, arg_3, arg_4, arg_5)

Retain the identities in SortingHat based on the retention_time value declared in the setup . cfg .


def Func(arg_0, arg_1, arg_2):
        """Register a conversion from Python to OpenMath

        :param py_class: A Python class the conversion is attached to, or None
        :type py_class: None, type

        :param converter: A conversion function or an OpenMath object
        :type converter: Callable, OMAny

        :rtype: None

        ``converter`` will used to convert any object of type ``py_class``,
        or any object if ``py_class`` is ``None``. If ``converter`` is an
        OpenMath object, it is returned immediately. If it is a callable, it
        is called with the Python object as paramter; in this case, it must
        either return an OpenMath object, or raise an exception.  The
        special exception ``CannotConvertError`` can be used to signify that
        ``converter`` does not know how to convert the current object, and that
        ``to_openmath`` shall continue with the other converters. Any other
        exception stops conversion immediately.

        Converters registered by this function are called in order from the
        most recent to the oldest.
        """
        if arg_1 is not None and not isclass(arg_1):
            raise TypeError('Expected class, found %r' % arg_1)
        if not callable(arg_2) and not isinstance(arg_2, om.OMAny):
            raise TypeError('Expected callable or openmath.OMAny object, found %r' % arg_2)
        arg_0._conv_to_om.append((arg_1, arg_2))


def Func ( arg_0 , arg_1 ) : arg_1 = str ( arg_1 ) if len ( arg_1 ) == 0 : return True if arg_1 [ 0 ] == u'#' : return True arg_2 = arg_0 . _split_line ( arg_1 ) return arg_0 . invoke ( arg_2 )

def Func(arg_0, arg_1):
        """Parse and invoke a string line.

        Args:
            line (str): The line that we want to parse and invoke.

        Returns:
            bool: A boolean specifying if the last function created a new context
                (False if a new context was created) and a list with the remainder of the
                command line if this function did not consume all arguments.)
        """

        # Make sure line is a unicode string on all python versions
        arg_1 = str(arg_1)

        # Ignore empty lines and comments
        if len(arg_1) == 0:
            return True

        if arg_1[0] == u'#':
            return True

        arg_2 = arg_0._split_line(arg_1)
        return arg_0.invoke(arg_2)


def Func(arg_0, arg_1, arg_2):
        """ Builds a Godot graph.
        """
        arg_3 = None

        for arg_4 in arg_2:
            arg_5 = arg_4[0]
            if arg_5 == ADD_NODE:
                arg_5, arg_6, arg_7 = arg_4
                arg_1.add_node(arg_6, **arg_7)

            elif arg_5 == ADD_EDGE:
                arg_5, arg_8, arg_9, arg_7 = arg_4
                arg_10 = arg_11 = ""
                if isinstance(arg_8,tuple):
                    arg_10 = arg_8[1]
                    arg_8 = arg_8[0]
                if isinstance(arg_9,tuple):
                    arg_11 = arg_9[1]
                    arg_9 = arg_9[0]

                arg_1.add_edge(arg_8, arg_9, tailport=arg_10, headport=arg_11,
                               **arg_7)

            elif arg_5 in [ADD_GRAPH_TO_NODE_EDGE,
                         ADD_GRAPH_TO_GRAPH_EDGE,
                         ADD_NODE_TO_GRAPH_EDGE]:
                arg_5, arg_8, arg_9, arg_7 = arg_4
                arg_10 = arg_11 = ""

                if isinstance(arg_8,tuple):
                    arg_10 = arg_8[1]

                if isinstance(arg_9,tuple):
                    arg_11 = arg_9[1]

                if not (arg_5 == ADD_NODE_TO_GRAPH_EDGE):
                    if arg_5 == ADD_GRAPH_TO_NODE_EDGE:
                        arg_8 = arg_3
                    else:
                        arg_8 = arg_20
                        arg_9 = arg_3
                else:
                    arg_9 = arg_3

                arg_12 = isinstance(arg_8, (Subgraph, Cluster))
                arg_13 = isinstance(dst, (Subgraph, Cluster))

                if arg_12:
                    arg_14 = arg_8.nodes
                else:
                    arg_14 = [arg_8]
                if arg_13:
                    arg_15 = dst.nodes
                else:
                    arg_15 = [dst]

                for arg_16 in arg_14:
                    for arg_17 in arg_15:
                        arg_1.add_edge(from_node=arg_16, to_node=arg_17,
                                       tailport=arg_10, headport=arg_11,
                                       **kwds)

            elif arg_5 == SET_GRAPH_ATTR:
                arg_1.set( **arg_4[1] )

            elif arg_5 == SET_DEF_NODE_ATTR:
                arg_1.default_node.set( **arg_4[1] )

            elif arg_5 == SET_DEF_EDGE_ATTR:
                arg_1.default_edge.set( **arg_4[1] )

            elif arg_5 == SET_DEF_GRAPH_ATTR:
                arg_1.default_graph.set( **arg_4[1] )

            elif arg_5 == ADD_SUBGRAPH:
                arg_5, arg_18, arg_19 = arg_4
                if arg_3:
                    arg_20 = arg_3
                if arg_18.startswith("cluster"):
                    arg_21 = Cluster(ID=arg_18)
                    arg_21 = arg_0.Func(arg_21, arg_19)
                    arg_1.add_cluster(arg_21)
                else:
                    arg_3 = Subgraph(ID=arg_18)
                    arg_3 = arg_0.Func(arg_3, arg_19)
                    arg_1.add_subgraph(arg_3)

        return arg_1


def Func(arg_0 : arg_1[arg_2, arg_3]) -> arg_1[arg_2, arg_2]:
    """Will build the actual config for Jinja2, based on SDK config.
    """
    arg_4 = arg_0.copy()
    # Manage the classifier stable/beta
    arg_5 = arg_4.pop("is_stable", False)
    if arg_5:
        arg_4["classifier"] = "Development Status :: 5 - Production/Stable"
    else:
        arg_4["classifier"] = "Development Status :: 4 - Beta"
    # Manage the nspkg
    arg_6 = arg_4["package_name"]
    arg_4["package_nspkg"] = arg_4.pop(
        "package_nspkg",
        arg_6[:arg_6.rindex('-')]+"-nspkg"
    )
    # ARM?
    arg_4['is_arm'] = arg_4.pop("is_arm", True)

    # Do I need msrestazure for this package?
    arg_4['need_msrestazure'] = arg_4.pop("need_msrestazure", True)

    # Pre-compute some Jinja variable that are complicated to do inside the templates
    arg_7 = arg_4["package_nspkg"][:-len('-nspkg')].split('-')
    arg_4['nspkg_names'] = [
        ".".join(arg_7[:i+1])
        for i in range(len(arg_7))
    ]
    arg_4['init_names'] = [
        "/".join(arg_7[:i+1])+"/__init__.py"
        for i in range(len(arg_7))
    ]

    # Return result
    return arg_4

Will build the actual config for Jinja2 based on SDK config .


def Func ( arg_0 , Func ) : _set_params ( arg_0 . ode_obj , 'Vel' , Func , arg_0 . ADOF + arg_0 . LDOF )

def Func(arg_0, Func):
        '''Set the target velocities for this object's degrees of freedom.

        Parameters
        ----------
        velocities : float or sequence of float
            A target velocity value to set on all degrees of freedom, or a list
            containing one such value for each degree of freedom. For rotational
            degrees of freedom, these values must be in radians / second.
        '''
        _set_params(arg_0.ode_obj, 'Vel', Func, arg_0.ADOF + arg_0.LDOF)

Set the target velocities for this object s degrees of freedom .


def Func ( arg_0 , arg_1 ) : if arg_1 is None : arg_0 . __metricNames = set ( [ ] ) else : arg_0 . __metricNames = set ( arg_1 )

def Func(arg_0, arg_1):
    """ Tell the writer which metrics should be written

    Parameters:
    -----------------------------------------------------------------------
    metricsNames: A list of metric lables to be written
    """
    if arg_1 is None:
      arg_0.__metricNames = set([])
    else:
      arg_0.__metricNames = set(arg_1)


def Func ( arg_0 = "runinfo" ) : if not os . path . isdir ( arg_0 ) : return [ ] arg_1 = sorted ( os . listdir ( arg_0 ) ) if len ( arg_1 ) == 0 : return [ ] arg_2 = arg_1 [ - 1 ] arg_3 = os . path . abspath ( '{}/{}/checkpoint' . format ( arg_0 , arg_2 ) ) if ( not ( os . path . isdir ( arg_3 ) ) ) : return [ ] return [ arg_3 ]

def Func(arg_0="runinfo"):
    """Find the checkpoint from the last run, if one exists.

    Note that checkpoints are incremental, and this helper will not find
    previous checkpoints from earlier than the most recent run. It probably
    should be made to do so.

    Kwargs:
       - rundir(str) : Path to the runinfo directory

    Returns:
     - a list suitable for checkpointFiles parameter of DataFlowKernel
       constructor, with 0 or 1 elements

    """
    if not os.path.isdir(arg_0):
        return []

    arg_1 = sorted(os.listdir(arg_0))

    if len(arg_1) == 0:
        return []

    arg_2 = arg_1[-1]
    arg_3 = os.path.abspath('{}/{}/checkpoint'.format(arg_0, arg_2))

    if(not(os.path.isdir(arg_3))):
        return []

    return [arg_3]

Find the checkpoint from the last run if one exists .


def Func(arg_0):
        """
        Return only the default value, if there is one.

        """
        arg_1 = arg_0.source[arg_0.col_offset:]
        arg_2 = re.compile('''pyconfig\.[eginst]+\(['"][^)]+?['"], ?(.*?)\)''')
        arg_3 = arg_2.match(arg_1)
        if not arg_3:
            return ''

        return arg_3.group(1)

Return only the default value if there is one .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Builds the connections.

        Build is only performed if connections have not
        been pre-Func.

        :param traj: Trajectory container

        :param brian_list:

            List of objects passed to BRIAN network constructor.

            Adds:

            Connections, amount depends on clustering

        :param network_dict:

            Dictionary of elements shared among the components

            Expects:

            'neurons_i': Inhibitory neuron group

            'neurons_e': Excitatory neuron group

            Adds:

            Connections, amount depends on clustering

        """
        if not hasattr(arg_0, '_pre_Func') or not arg_0._pre_Func:
            arg_0._Func_connections(arg_1, arg_2, arg_3)

Builds the connections.

        Build is only performed if connections have not
        been pre-build.

        :param traj: Trajectory container

        :param brian_list:

            List of objects passed to BRIAN network constructor.

            Adds:

            Connections, amount depends on clustering

        :param network_dict:

            Dictionary of elements shared among the components

            Expects:

            'neurons_i': Inhibitory neuron group

            'neurons_e': Excitatory neuron group

            Adds:

            Connections, amount depends on clustering


def Func(arg_0, arg_1):
    """
    Run one iteration of this model.

    :param inputRecord: (object)
           A record object formatted according to
           :meth:`~nupic.data.record_stream.RecordStreamIface.getNextRecord` or
           :meth:`~nupic.data.record_stream.RecordStreamIface.getNextRecordDict`
           result format.
    :returns: (:class:`~nupic.frameworks.opf.opf_utils.ModelResult`)
             An ModelResult namedtuple. The contents of ModelResult.inferences
             depends on the the specific inference type of this model, which
             can be queried by :meth:`.getInferenceType`.
    """
    # 0-based prediction index for ModelResult
    arg_2 = arg_0._numPredictions
    arg_0._numPredictions += 1
    arg_3 = opf_utils.ModelResult(arg_2=arg_2,
                                   rawInput=arg_1)
    return arg_3


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Fetches Tree for current or given TreeItem."""
        if arg_2 is None:
            arg_2 = arg_0.get_object(arg_1, arg_3).tree_id
        arg_0.tree = MODEL_TREE_CLASS._default_manager.get(pk=arg_2)
        arg_0.tree.verbose_name_plural = arg_0.tree._meta.verbose_name_plural
        arg_0.tree.urls = _TREE_URLS
        return arg_0.tree

Fetches Tree for current or given TreeItem .


def Func(arg_0, arg_1, arg_2=5.0):
        """Helper function to continuously poll reads on the FTDI device until an
        expected number of bytes are returned.  Will throw a timeout error if no
        data is received within the specified number of timeout seconds.  Returns
        the read data as a string if successful, otherwise raises an execption.
        """
        arg_3 = time.time()
        # Start with an empty response buffer.
        arg_4 = bytearray(arg_1)
        arg_5 = 0
        # Loop calling read until the response buffer is full or a timeout occurs.
        while time.time() - arg_3 <= arg_2:
            arg_6, arg_7 = ftdi.read_data(arg_0._ctx, arg_1 - arg_5)
            # Fail if there was an error reading data.
            if arg_6 < 0:
                raise RuntimeError('ftdi_read_data failed with error code {0}.'.format(arg_6))
            # Add returned data to the buffer.
            arg_4[arg_5:arg_5+arg_6] = arg_7[:arg_6]
            arg_5 += arg_6
            # Buffer is full, return the result data.
            if arg_5 >= arg_1:
                return str(arg_4)
            time.sleep(0.01)
        raise RuntimeError('Timeout while polling ftdi_read_data for {0} bytes!'.format(arg_1))

Helper function to continuously poll reads on the FTDI device until an expected number of bytes are returned . Will throw a timeout error if no data is received within the specified number of timeout seconds . Returns the read data as a string if successful otherwise raises an execption .


(
    ctx: ReaderContext, form: IterableLispForm
)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> Iterable [ LispForm ] : arg_4 = [ ] for arg_5 in arg_2 : if _is_unquote ( arg_5 ) : arg_4 . append ( llist . l ( _LIST , arg_5 [ 1 ] ) ) elif _is_unquote_splicing ( arg_5 ) : arg_4 . append ( arg_5 [ 1 ] ) else : arg_4 . append ( llist . l ( _LIST , _process_syntax_quoted_form ( arg_0 , arg_5 ) ) ) return arg_4

def Func(
    arg_0: arg_1, arg_2: arg_3
) -> Iterable[LispForm]:
    """Expand syntax quoted forms to handle unquoting and unquote-splicing.

    The unquoted form (unquote x) becomes:
        (list x)

    The unquote-spliced form (unquote-splicing x) becomes
        x

    All other forms are recursively processed as by _process_syntax_quoted_form
    and are returned as:
        (list form)"""
    arg_4 = []

    for arg_5 in arg_2:
        if _is_unquote(arg_5):
            arg_4.append(llist.l(_LIST, arg_5[1]))
        elif _is_unquote_splicing(arg_5):
            arg_4.append(arg_5[1])
        else:
            arg_4.append(llist.l(_LIST, _process_syntax_quoted_form(arg_0, arg_5)))

    return arg_4

Expand syntax quoted forms to handle unquoting and unquote - splicing .


(self, session=None, prefetch=0, mode=ReceiveSettleMode.PeekLock, idle_timeout=0, **kwargs)

return Receiver(
            handler_id,
            self.entity_uri,
            self.auth_config,
            loop=self.loop,
            debug=self.debug,
            timeout=int(idle_timeout * 1000),
            prefetch=prefetch,
            mode=mode,
            **kwargs)

def Func(arg_0, arg_1=None, arg_2=0, arg_3=arg_4.PeekLock, arg_6=0, **arg_7):
        """Get a Receiver for the Service Bus endpoint.

        A Receiver represents a single open connection with which multiple receive operations can be made.

        :param session: A specific session from which to receive. This must be specified for a
         sessionful entity, otherwise it must be None. In order to receive the next available
         session, set this to NEXT_AVAILABLE.
        :type session: str or ~azure.servicebus.common.constants.NEXT_AVAILABLE
        :param prefetch: The maximum number of messages to cache with each request to the service.
         The default value is 0, meaning messages will be received from the service and processed
         one at a time. Increasing this value will improve message throughput performance but increase
         the chance that messages will expire while they are cached if they're not processed fast enough.
        :type prefetch: int
        :param mode: The mode with which messages will be retrieved from the entity. The two options
         are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
         lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
         will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
         the client fails to process the message. The default mode is PeekLock.
        :type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
        :param idle_timeout: The timeout in seconds between received messages after which the receiver will
         automatically shutdown. The default value is 0, meaning no timeout.
        :type idle_timeout: int
        :returns: A Receiver instance with an unopened connection.
        :rtype: ~azure.servicebus.aio.async_receive_handler.Receiver

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START open_close_receiver_context]
                :end-before: [END open_close_receiver_context]
                :language: python
                :dedent: 4
                :caption: Receive messages with a Receiver.

        """
        if arg_0.entity and not arg_0.requires_session and arg_1:
            raise ValueError("A session cannot be used with a non-sessionful entitiy.")
        if arg_0.entity and arg_0.requires_session and not arg_1:
            raise ValueError("This entity requires a session.")
        if int(arg_2) < 0 or int(arg_2) > 50000:
            raise ValueError("Prefetch must be an integer between 0 and 50000 inclusive.")

        arg_2 += 1
        arg_8 = str(uuid.uuid4())
        if arg_1:
            return SessionReceiver(
                arg_8,
                arg_0.entity_uri,
                arg_0.auth_config,
                arg_1=arg_1,
                loop=arg_0.loop,
                debug=arg_0.debug,
                timeout=int(arg_6 * 1000),
                arg_2=arg_2,
                arg_3=arg_3,
                **arg_7)
        return Receiver(
            arg_8,
            arg_0.entity_uri,
            arg_0.auth_config,
            loop=arg_0.loop,
            debug=arg_0.debug,
            timeout=int(arg_6 * 1000),
            arg_2=arg_2,
            arg_3=arg_3,
            **arg_7)

Get a Receiver for the Service Bus endpoint .


def Func ( arg_0 , arg_1 ) : try : arg_2 = os . umask ( 0 ) os . makedirs ( arg_0 , arg_1 ) except OSError : if not os . path . isdir ( arg_0 ) : raise finally : os . umask ( arg_2 )

def Func(arg_0, arg_1):
    """
    Creates the directory specified by path, creating intermediate directories
    as necessary. If directory already exists, this is a no-op.

    :param path: The directory to create
    :type path: str
    :param mode: The mode to give to the directory e.g. 0o755, ignores umask
    :type mode: int
    """
    try:
        arg_2 = os.umask(0)
        os.makedirs(arg_0, arg_1)
    except OSError:
        if not os.path.isdir(arg_0):
            raise
    finally:
        os.umask(arg_2)

Creates the directory specified by path creating intermediate directories as necessary . If directory already exists this is a no - op .


def
Func
(
arg_0
)
:
arg_1
=
import_string
(
arg_0
)
if
not
issubclass
(
arg_1
,
BaseFinder
)
:
raise
ImproperlyConfigured
(
'Finder "%s" is not a subclass of "%s"'
%
(
arg_1
,
BaseFinder
)
)
return
arg_1
(
)

def Func(arg_0):
    """
    Imports the media fixtures files finder class described by import_path, where
    import_path is the full Python path to the class.
    """
    arg_1 = import_string(arg_0)
    if not issubclass(arg_1, BaseFinder):
        raise ImproperlyConfigured('Finder "%s" is not a subclass of "%s"' %
                                   (arg_1, BaseFinder))
    return arg_1()

Imports the media fixtures files finder class described by import_path where import_path is the full Python path to the class .


def Func ( arg_0 , arg_1 ) : arg_0 . data = arg_1 arg_0 . lexer . Func ( arg_1 )

def Func(arg_0, arg_1):
        """Set the Func text data."""
        arg_0.data = arg_1
        arg_0.lexer.Func(arg_1)


def Func(arg_0, arg_1):
        """Format a list of traceback entry tuples for printing.

        Given a list of tuples as returned by extract_tb() or
        extract_stack(), return a list of strings ready for printing.
        Each string in the resulting list corresponds to the item with the
        same index in the argument list.  Each string ends in a newline;
        the strings may contain internal newlines as well, for those items
        whose source text line is not None.

        Lifted almost verbatim from traceback.py
        """

        arg_2 = arg_0.Colors
        arg_3 = []
        for arg_4, arg_5, arg_6, arg_7 in arg_1[:-1]:
            arg_8 = '  File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \
                    (arg_2.filename, arg_4, arg_2.Normal,
                     arg_2.lineno, arg_5, arg_2.Normal,
                     arg_2.name, arg_6, arg_2.Normal)
            if arg_7:
                arg_8 += '    %s\n' % arg_7.strip()
            arg_3.append(arg_8)
        # Emphasize the last entry
        arg_4, arg_5, arg_6, arg_7 = arg_1[-1]
        arg_8 = '%s  File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \
                (arg_2.normalEm,
                 arg_2.filenameEm, arg_4, arg_2.normalEm,
                 arg_2.linenoEm, arg_5, arg_2.normalEm,
                 arg_2.nameEm, arg_6, arg_2.normalEm,
                 arg_2.Normal)
        if arg_7:
            arg_8 += '%s    %s%s\n' % (arg_2.line, arg_7.strip(),
                                            arg_2.Normal)
        arg_3.append(arg_8)
        #from pprint import pformat; print 'LISTTB', pformat(list) # dbg
        return arg_3

Format a list of traceback entry tuples for printing .


def Func(arg_0, arg_1=None):
        """Clear selective variables from internal namespaces based on a
        specified regular expression.

        Parameters
        ----------
        regex : string or compiled pattern, optional
            A regular expression pattern that will be used in searching
            variable names in the users namespaces.
        """
        if arg_1 is not None:
            try:
                arg_2 = re.compile(arg_1)
            except TypeError:
                raise TypeError('regex must be a string or compiled pattern')
            # Search for keys in each namespace that match the given regex
            # If a match is found, delete the key/value pair.
            for arg_3 in arg_0.all_ns_refs:
                for arg_4 in arg_3:
                    if arg_2.search(arg_4):
                        del arg_3[arg_4]

Clear selective variables from internal namespaces based on a specified regular expression .


def Func(arg_0):
    """Checkout, update and branch from the specified branch."""
    try:
        # Ensure that we're in a git repository. This command is silent unless
        # you're not actually in a git repository, in which case, you receive a
        # "Not a git repository" error message.
        arg_1 = subprocess.check_output(['git', 'rev-parse']).decode('utf-8')
        sys.stdout.write(arg_1)
    except subprocess.CalledProcessError:
        # Bail if we're not in a git repository.
        return

    # This behavior ensures a better user experience for those that aren't
    # intimately familiar with git.
    ensure_remote_branch_is_tracked(arg_0)

    # Switch to the specified branch and update it.
    subprocess.check_call(['git', 'checkout', '--quiet', arg_0])

    # Pulling is always safe here, because we never commit to this branch.
    subprocess.check_call(['git', 'pull', '--quiet'])

    # Checkout the top commit in the branch, effectively going "untracked."
    subprocess.check_call(['git', 'checkout', '--quiet', '%s~0' % arg_0])

    # Clean up the repository of Python cruft. Because we've just switched
    # branches and compiled Python files should not be version controlled,
    # there are likely leftover compiled Python files sitting on disk which may
    # confuse some tools, such as sqlalchemy-migrate.
    subprocess.check_call(['find', '.', '-name', '"*.pyc"', '-delete'])

    # For the sake of user experience, give some familiar output.
    print('Your branch is up to date with branch \'origin/%s\'.' % arg_0)

Checkout update and branch from the specified branch .


def Func(arg_0, arg_1, arg_2, arg_3):
        """650 Translate Categories."""
        arg_4 = record_get_field_instances(arg_0.record,
                                                     tag='650',
                                                     ind1='1',
                                                     ind2='7')
        record_delete_fields(arg_0.record, "650")
        for arg_5 in arg_4:
            for arg_6, (arg_7, arg_8) in enumerate(arg_5[0]):
                if arg_7 == 'a':
                    arg_9 = arg_0.get_config_item(arg_8, arg_3)
                    if arg_9 != arg_8:
                        arg_10 = [('2', arg_2), ('a', arg_9)]
                    else:
                        arg_10 = [('2', arg_1), ('a', arg_8)]
                    record_add_field(arg_0.record, "650", ind1="1", ind2="7",
                                     subfields=arg_10)
                    break


def Func(arg_0, arg_1, arg_2=None):
    """Check whether an object is an instance of a certain class.

    ``Func()`` can currently only be used when chained from ``check_object()``, the function that is
    used to 'zoom in' on the object of interest.

    Args:
        inst (class): The class that the object should have.
        not_instance_msg (str): When specified, this overrides the automatically generated message in case
            the object does not have the expected class.
        state (State): The state that is passed in through the SCT chain (don't specify this).

    :Example:

        Student code and solution code::

            import numpy as np
            arr = np.array([1, 2, 3, 4, 5])

        SCT::

            # Verify the class of arr
            import numpy
            Ex().check_object('arr').Func(numpy.ndarray)
    """

    arg_0.assert_is(["object_assignments"], "Func", ["check_object"])

    arg_3 = arg_0.solution_parts.get("name")
    arg_4 = arg_0.student_parts.get("name")

    if arg_2 is None:
        arg_2 = "Is it a {{inst.__name__}}?"

    if not isInstanceInProcess(arg_3, arg_1, arg_0.solution_process):
        raise InstructorError(
            "`Func()` noticed that `%s` is not a `%s` in the solution process."
            % (arg_3, arg_1.__name__)
        )

    arg_5 = arg_0.build_message(arg_2, {"inst": arg_1})
    arg_6 = Feedback(arg_5, arg_0)
    arg_0.do_test(InstanceProcessTest(arg_4, arg_1, arg_0.student_process, arg_6))

    return arg_0

Check whether an object is an instance of a certain class.

    ``is_instance()`` can currently only be used when chained from ``check_object()``, the function that is
    used to 'zoom in' on the object of interest.

    Args:
        inst (class): The class that the object should have.
        not_instance_msg (str): When specified, this overrides the automatically generated message in case
            the object does not have the expected class.
        state (State): The state that is passed in through the SCT chain (don't specify this).

    :Example:

        Student code and solution code::

            import numpy as np
            arr = np.array([1, 2, 3, 4, 5])

        SCT::

            # Verify the class of arr
            import numpy
            Ex().check_object('arr').is_instance(numpy.ndarray)

Check whether an object is an instance of a certain class .


(self, start_count, next_idx, sources, i_str, t_path)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
dict
(
first
=
arg_1
,
source
=
arg_3
.
pop
(
)
,
)
arg_7
=
[
]
for
arg_8
in
arg_0
.
writers
:
logger
.
debug
(
'running %r on %r: %r'
,
arg_8
,
arg_4
,
arg_6
)
arg_9
=
arg_8
(
arg_5
,
arg_6
,
arg_4
)
logger
.
debug
(
'loaded (%d, %d) of %r into %r'
,
arg_1
,
arg_2
1
,
arg_4
,
arg_9
)
arg_7
+=
arg_9
return
arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        '''Run all of the writers over some intermediate chunk.

        :param int start_count: index of the first item
        :param int next_idx: index of the next item (after the last
          item in this chunk)
        :param list sources: source strings included in this chunk
          (usually only one source)
        :param str i_str: name of input file or other input
        :param str t_path: location of intermediate chunk on disk
        :return: list of output file paths or other outputs

        '''
        # writers put the chunk somewhere, and could delete it
        arg_6 = dict(
            first=arg_1,
            # num and md5 computed in each writers
            source=arg_3.pop(),
            )

        arg_7 = []
        for arg_8 in arg_0.writers:
            logger.debug('running %r on %r: %r', arg_8, arg_4, arg_6)
            arg_9 = arg_8(arg_5, arg_6, arg_4)
            logger.debug('loaded (%d, %d) of %r into %r',
                         arg_1, arg_2 - 1, arg_4, arg_9)
            arg_7 += arg_9
        return arg_7

Run all of the writers over some intermediate chunk .


def Func ( arg_0 , arg_1 , * arg_2 ) : arg_3 = arg_1 . operands [ 0 ] arg_4 = arg_1 . operands [ 1 ] if isinstance ( arg_4 , BitVecConstant ) : if arg_4 . value == 0 : return arg_3 if isinstance ( arg_3 , BitVecConstant ) : if arg_3 . value == 0 : return arg_4

def Func(arg_0, arg_1, *arg_2):
        """ a + 0  ==> a
            0 + a  ==> a
        """
        arg_3 = arg_1.operands[0]
        arg_4 = arg_1.operands[1]
        if isinstance(arg_4, BitVecConstant):
            if arg_4.value == 0:
                return arg_3
        if isinstance(arg_3, BitVecConstant):
            if arg_3.value == 0:
                return arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ 'content' ] arg_3 = arg_2 [ 'id' ] arg_4 = { arg_3 : arg_2 [ 'queue' ] } arg_0 . _update_engines ( arg_4 )

def Func(arg_0, arg_1):
        """Register a new engine, and update our connection info."""
        arg_2 = arg_1['content']
        arg_3 = arg_2['id']
        arg_4 = {arg_3 : arg_2['queue']}
        arg_0._update_engines(arg_4)

Register a new engine and update our connection info .


return attr.ib(validator=validator, *args, **kwargs)

def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_1
.
setdefault
(
'default'
,
'USD 0.00'
)
arg_1
.
setdefault
(
'converter'
,
Func_converter
)
if
'validator'
in
arg_1
:
arg_2
=
arg_1
.
pop
(
'validator'
)
if
not
isinstance
(
arg_2
,
(
tuple
,
list
)
)
:
arg_2
=
[
arg_2
]
else
:
arg_2
=
[
]
arg_2
.
append
(
instance_of
(
PriceClass
)
)
return
attr
.
ib
(
arg_2
=
arg_2
,
*
arg_0
,
**
arg_1
)

def Func(*arg_0, **arg_1):
    """Price field for attrs.

    See `help(attr.ib)` for full signature.

    Usage:

        >>> from pricing import fields
        ... @attr.s
        ... class Test:
        ...     Func: Price = fields.Func(default='USD 5.00')
        ...
        ... Test()
        Test(Func=USD 5.00)
    """

    arg_1.setdefault('default', 'USD 0.00')
    arg_1.setdefault('converter', Func_converter)

    if 'validator' in arg_1:
        arg_2 = arg_1.pop('validator')
        if not isinstance(arg_2, (tuple, list)):
            arg_2 = [arg_2]
    else:
        arg_2 = []
    arg_2.append(instance_of(PriceClass))
    return attr.ib(arg_2=arg_2, *arg_0, **arg_1)

Price field for attrs.

    See `help(attr.ib)` for full signature.

    Usage:

        >>> from pricing import fields
        ... @attr.s
        ... class Test:
        ...     price: Price = fields.price(default='USD 5.00')
        ...
        ... Test()
        Test(price=USD 5.00)


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 . pattern , unicode ) : arg_1 = re . compile ( arg_1 . pattern . encode ( 'utf-8' ) , arg_1 . flags & ~ re . UNICODE ) return arg_1

def Func(arg_0, arg_1):
        "Recompile unicode regexes as bytes regexes. Overridden in subclass."
        if isinstance(arg_1.pattern, unicode):
            arg_1 = re.compile(arg_1.pattern.encode('utf-8'), arg_1.flags &~ re.UNICODE)
        return arg_1

Recompile unicode regexes as bytes regexes . Overridden in subclass .


(content, tolerant_parsing=False, keep_inline_math=False, keep_comments=False)

return latexnodes2text(nodelist, keep_inline_math=keep_inline_math, keep_comments=keep_comments)

def Func(arg_0, arg_1=False, arg_2=False, arg_3=False):
    """
    Extracts text from `content` meant for database indexing. `content` is
    some LaTeX code.

    .. deprecated:: 1.0
       Please use :py:class:`LatexNodes2Text` instead.
    """

    (arg_4, arg_5, arg_6) = latexwalker.get_latex_nodes(arg_0, arg_2=arg_2,
                                                         arg_1=arg_1)

    return latexnodes2text(arg_4, arg_2=arg_2, arg_3=arg_3)

Extracts text from content meant for database indexing . content is some LaTeX code .


return self.cls(ctxt, self.name, self.conf, step_addr)

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . cls ( arg_1 , arg_0 . name , arg_0 . conf , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Initialize the item.  This calls the class constructor with the
        appropriate arguments and returns the Funcialized object.

        :param ctxt: The context object.
        :param step_addr: The address of the step in the test
                          configuration.
        """

        return arg_0.cls(arg_1, arg_0.name, arg_0.conf, arg_2)

Initialize the item.  This calls the class constructor with the
        appropriate arguments and returns the initialized object.

        :param ctxt: The context object.
        :param step_addr: The address of the step in the test
                          configuration.

Initialize the item . This calls the class constructor with the appropriate arguments and returns the initialized object .


def Func ( arg_0 = 0 , arg_1 = 10 ) : arg_2 = random . choice ( range ( arg_0 * 100 , arg_1 * 100 ) ) return "%1.2f" % ( float ( arg_2 ) / 100 )

def Func(arg_0=0, arg_1=10):
    """Return a str of decimal with two digits after a decimal mark."""
    arg_2 = random.choice(range(arg_0 * 100, arg_1 * 100))
    return "%1.2f" % (float(arg_2) / 100)

Return a str of decimal with two digits after a decimal mark .


def Func(arg_0, arg_1, arg_2):
        """load gene set dict"""

        if isinstance(arg_2, dict):
            arg_3 = arg_2
        elif isinstance(arg_2, str):
            arg_3 = arg_0.parse_gmt(arg_2)
        else:
            raise Exception("Error parsing gmt parameter for gene sets")

        arg_4 = list(arg_3.keys())
        arg_0.n_genesets = len(arg_4)
        for arg_6 in arg_4:
            arg_7 = arg_3.get(arg_6)
            if isinstance(arg_7, set):
                arg_7 = list(arg_7)
                arg_3[arg_6] = arg_7
            arg_8 = np.in1d(arg_1, arg_7, assume_unique=True)
            arg_9 = arg_8.sum()
            if  arg_0.min_size <= arg_9 <= arg_0.max_size: continue
            del arg_3[arg_6]

        arg_10 = len(arg_4) - len(arg_3)
        arg_0._logger.info("%04d gene_sets have been filtered out when max_size=%s and min_size=%s"%(arg_10, arg_0.max_size, arg_0.min_size))

        if arg_10 == len(arg_4):
            arg_0._logger.error("No gene sets passed through filtering condition!!!, try new parameters again!\n" +\
                               "Note: check gene name, gmt file format, or filtering size." )
            sys.exit(0)

        arg_0._gmtdct=arg_3
        return arg_3


Compute PSD from samples and update average for given center frequency

def Func(arg_0, arg_1, arg_2):
        """Compute PSD from samples and Func average for given center frequency"""
        arg_3, arg_4 = simplespectral.welch(arg_2, arg_0._sample_rate, nperseg=arg_0._bins,
                                                     window=arg_0._fft_window, noverlap=arg_0._fft_overlap_bins,
                                                     detrend=arg_0._detrend)

        if arg_0._remove_dc:
            arg_4[0] = (arg_4[1] + arg_4[-1]) / 2

        with arg_1['Func_lock']:
            arg_1['repeats'] += 1
            if arg_1['pwr_array'] is None:
                arg_1['pwr_array'] = arg_4
            else:
                arg_1['pwr_array'] += arg_4


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_1 : for arg_3 in arg_1 : if isinstance ( arg_3 , datetime ) : arg_0 = CursorFormatter . Func_field ( arg_0 , arg_3 , arg_2 = arg_2 ) return arg_0

def Func(arg_0, arg_1, arg_2=None):
        '''
        For all the datetime fields in "datemap" find that key in doc and map the datetime object to
        a strftime string. This pprint and others will print out readable datetimes.
        '''
        if arg_1:
            for arg_3 in arg_1:
                if isinstance(arg_3, datetime):
                    arg_0=CursorFormatter.Func_field(arg_0, arg_3, arg_2=arg_2)
        return arg_0

For all the datetime fields in datemap find that key in doc and map the datetime object to a strftime string . This pprint and others will print out readable datetimes .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . ebs . Func ( source_environment_name = arg_1 , destination_environment_name = arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Swaps cnames for an environment
        """
        arg_0.ebs.Func(source_environment_name=arg_1,
                                         destination_environment_name=arg_2)


def Func ( arg_0 ) : arg_1 = time . time ( ) arg_2 = datetime . datetime . fromtimestamp ( arg_1 ) . strftime ( '%Y_%m_%d_%Hh%Mm%Ss' ) arg_3 = arg_0 . _run_information [ arg_0 . v_crun ] arg_3 [ 'timestamp' ] = arg_1 arg_3 [ 'time' ] = arg_2 if arg_0 . _environment_hexsha is not None : arg_3 [ 'short_environment_hexsha' ] = arg_0 . _environment_hexsha [ 0 : 7 ]

def Func(arg_0):
        """ Sets the start timestamp and formatted time to the current time. """
        arg_1 = time.time()
        arg_2 = datetime.datetime.fromtimestamp(arg_1).strftime('%Y_%m_%d_%Hh%Mm%Ss')
        arg_3 = arg_0._run_information[arg_0.v_crun]
        arg_3['timestamp'] = arg_1
        arg_3['time'] = arg_2
        if arg_0._environment_hexsha is not None:
            arg_3['short_environment_hexsha'] = arg_0._environment_hexsha[0:7]

Sets the start timestamp and formatted time to the current time .


(self, *, limit: Optional[int] = 20, offset: Optional[int] = 0)

return list(Track(self.__client, item) for item in data['items'])

async def Func ( arg_0 , * , arg_1 : arg_2 [ arg_3 ] = 20 , arg_4 : arg_2 [ arg_3 ] = 0 ) -> List [ Track ] : arg_5 = await arg_0 . __client . http . album_tracks ( arg_0 . id , arg_1 = arg_1 , arg_4 = arg_4 ) return list ( Track ( arg_0 . __client , arg_6 ) for arg_6 in arg_5 [ 'items' ] )

async def Func(arg_0, *, arg_1: arg_2[arg_3] = 20, arg_4: arg_2[arg_3] = 0) -> List[Track]:
        """get the albums tracks from spotify.

        Parameters
        ----------
        limit : Optional[int]
            The limit on how many tracks to retrieve for this album (default is 20).
        offset : Optional[int]
            The offset from where the api should start from in the tracks.

        Returns
        -------
        tracks : List[Track]
            The tracks of the artist.
        """
        arg_5 = await arg_0.__client.http.album_tracks(arg_0.id, arg_1=arg_1, arg_4=arg_4)
        return list(Track(arg_0.__client, arg_6) for arg_6 in arg_5['items'])


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . features_ = as_features ( arg_1 , stack = True , bare = True ) return arg_0

def Func(arg_0, arg_1, arg_2=None):
        '''
        Specify the data to which kernel values should be computed.

        Parameters
        ----------
        X : list of arrays or :class:`skl_groups.features.Features`
            The bags to compute "to".
        '''
        arg_0.features_ = as_features(arg_1, stack=True, bare=True)
        # TODO: could precompute things like squared norms if kernel == "rbf".
        # Probably should add support to sklearn instead of hacking it here.
        return arg_0

Specify the data to which kernel values should be computed .


def
Func
(
arg_0
)
:
if
arg_0
.
gender
==
female
:
arg_1
=
'Daughter'
elif
arg_0
.
gender
==
male
:
arg_1
=
'Son'
else
:
arg_1
=
'Child'
arg_2
=
arg_0
.
parents
[
0
]
arg_3
=
arg_0
.
parents
[
1
]
arg_4
=
'%s of %s, the %s, and %s, the %s.'
print
(
arg_4
%
(
arg_1
,
arg_2
.
name
,
arg_2
.
epithet
,
arg_3
.
name
,
arg_3
.
epithet
)
)

def Func(arg_0):
        """Print parents' names and epithets."""
        if arg_0.gender == female:
            arg_1 = 'Daughter'
        elif arg_0.gender == male:
            arg_1 = 'Son'
        else:
            arg_1 = 'Child'

        arg_2 = arg_0.parents[0]
        arg_3 = arg_0.parents[1]

        arg_4 = '%s of %s, the %s, and %s, the %s.'

        print(arg_4 % (arg_1, arg_2.name, arg_2.epithet, arg_3.name, arg_3.epithet))


return self._saver.save(
            sess=sess,
            save_path=save_path,
            global_step=timestep,
            write_meta_graph=False,
            write_state=True,  # Do we need this?
        )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Saves this component's managed variables.

        Args:
            sess: The session for which to Func the managed variables.
            Func_path: The path to Func data to.
            timestep: Optional, the timestep to append to the file name.

        Returns:
            Checkpoint path where the model was Funcd.
        """

        if arg_0._Funcr is None:
            raise TensorForceError("register_Funcr_ops should be called before Func")
        return arg_0._Funcr.Func(
            arg_1=arg_1,
            arg_2=arg_2,
            global_step=arg_3,
            write_meta_graph=False,
            write_state=True,  # Do we need this?
        )

Saves this component's managed variables.

        Args:
            sess: The session for which to save the managed variables.
            save_path: The path to save data to.
            timestep: Optional, the timestep to append to the file name.

        Returns:
            Checkpoint path where the model was saved.

Saves this component s managed variables .


(self, address, amount,
            priority=prio.NORMAL, payment_id=None, unlock_time=0,
            relay=True)

return self._backend.transfer(
            [(address, amount)],
            priority,
            payment_id,
            unlock_time,
            account=self.index,
            relay=relay)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = arg_4 . NORMAL , arg_6 = None , arg_7 = 0 , arg_8 = True ) : return arg_0 . _backend . Func ( [ ( arg_1 , arg_2 ) ] , arg_3 , arg_6 , arg_7 , account = arg_0 . index , arg_8 = arg_8 )

def Func(arg_0, arg_1, arg_2,
            arg_3=arg_4.NORMAL, arg_6=None, arg_7=0,
            arg_8=True):
        """
        Sends a Func. Returns a list of resulting transactions.

        :param address: destination :class:`Address <monero.address.Address>` or subtype
        :param amount: amount to send
        :param priority: transaction priority, implies fee. The priority can be a number
                    from 1 to 4 (unimportant, normal, elevated, priority) or a constant
                    from `monero.prio`.
        :param payment_id: ID for the payment (must be None if
                        :class:`IntegratedAddress <monero.address.IntegratedAddress>`
                        is used as the destination)
        :param unlock_time: the extra unlock delay
        :param relay: if `True`, the wallet will relay the transaction(s) to the network
                        immediately; when `False`, it will only return the transaction(s)
                        so they might be broadcasted later
        :rtype: list of :class:`Transaction <monero.transaction.Transaction>`
        """
        return arg_0._backend.Func(
            [(arg_1, arg_2)],
            arg_3,
            arg_6,
            arg_7,
            account=arg_0.index,
            arg_8=arg_8)

Sends a transfer. Returns a list of resulting transactions.

        :param address: destination :class:`Address <monero.address.Address>` or subtype
        :param amount: amount to send
        :param priority: transaction priority, implies fee. The priority can be a number
                    from 1 to 4 (unimportant, normal, elevated, priority) or a constant
                    from `monero.prio`.
        :param payment_id: ID for the payment (must be None if
                        :class:`IntegratedAddress <monero.address.IntegratedAddress>`
                        is used as the destination)
        :param unlock_time: the extra unlock delay
        :param relay: if `True`, the wallet will relay the transaction(s) to the network
                        immediately; when `False`, it will only return the transaction(s)
                        so they might be broadcasted later
        :rtype: list of :class:`Transaction <monero.transaction.Transaction>`

Sends a transfer . Returns a list of resulting transactions .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . GetConversationResponse ( ) await arg_0 . _pb_request ( 'conversations/getconversation' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Return conversation info and recent events."""
        arg_2 = hangouts_pb2.GetConversationResponse()
        await arg_0._pb_request('conversations/getconversation',
                               arg_1, arg_2)
        return arg_2

Return conversation info and recent events .


def Func(arg_0, arg_1=None, arg_2=None):
    """
    Generate a TomographyBasis object.

    See TomographyBasis for further details.abs

    Args:
        prep_fun (callable) optional: the function which adds preparation
            gates to a circuit.
        meas_fun (callable) optional: the function which adds measurement
            gates to a circuit.

    Returns:
        TomographyBasis: A tomography basis.
    """
    arg_3 = TomographyBasis(arg_0)
    arg_3.prep_fun = arg_1
    arg_3.meas_fun = arg_2
    return arg_3


def Func ( arg_0 ) : from kivy . graphics . svg import Svg arg_1 = arg_0 . temporary_path ( ".svg" ) try : return Svg ( arg_1 ) finally : remove_file ( arg_1 )

def Func(arg_0):
        """An SVG object.

        :return: an SVG object
        :rtype: kivy.graphics.svg.Svg
        :raises ImportError: if the module was not found
        """
        from kivy.graphics.svg import Svg
        arg_1 = arg_0.temporary_path(".svg")
        try:
            return Svg(arg_1)
        finally:
            remove_file(arg_1)


def Func ( arg_0 ) : for arg_1 in arg_0 . children : try : os . kill ( arg_1 , signal . SIGTRAP ) except OSError : continue arg_0 . join ( )

def Func(arg_0):
        """kill all slaves and reap the monitor """
        for arg_1 in arg_0.children:
            try:
                os.kill(arg_1, signal.SIGTRAP)
            except OSError:
                continue
        arg_0.join()


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
in
arg_0
.
_observers
:
raise
ValueError
(
'{} is already an observer of {}'
.
format
(
arg_1
,
arg_0
)
)
arg_0
.
_observers
.
append
(
arg_1
)

def Func(arg_0, arg_1):
        """Add an observer to this event.

        Args:
            callback: A function or coroutine callback to call when the event
                is fired.

        Raises:
            ValueError: If the callback has already been added.
        """
        if arg_1 in arg_0._observers:
            raise ValueError('{} is already an observer of {}'
                             .format(arg_1, arg_0))
        arg_0._observers.append(arg_1)


def Func ( arg_0 ) : arg_1 = ( int , float , str ) arg_2 = filter ( lambda a : is_type ( a , arg_0 ) , arg_1 ) [ 0 ] return arg_2 ( arg_0 )

def Func(arg_0):
    """Determine the type of x"""
    arg_1 = (int, float, str)
    arg_2 = filter(lambda a: is_type(a, arg_0), arg_1)[0]
    return arg_2(arg_0)


def Func(arg_0, arg_1, arg_2):
    """Get experiment or experiment job Func.

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

    Examples for getting experiment Func:

    \b
    ```bash
    $ polyaxon experiment -xp 19 Func
    ```

    For GPU Func

    \b
    ```bash
    $ polyaxon experiment -xp 19 Func --gpu
    ```

    Examples for getting experiment job Func:

    \b
    ```bash
    $ polyaxon experiment -xp 19 Func -j 1
    ```

    For GPU Func

    \b
    ```bash
    $ polyaxon experiment -xp 19 Func -j 1 --gpu
    ```
    """

    def get_experiment_Func():
        try:
            arg_3 = Printer.gpu_Func if arg_2 else Printer.Func
            PolyaxonClient().experiment.Func(
                arg_4, arg_5, arg_6, arg_3=arg_3)
        except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
            Printer.print_error('Could not get Func for experiment `{}`.'.format(arg_6))
            Printer.print_error('Error message `{}`.'.format(e))
            sys.exit(1)

    def get_experiment_job_Func():
        try:
            arg_3 = Printer.gpu_Func if arg_2 else Printer.Func
            PolyaxonClient().experiment_job.Func(arg_4,
                                                      arg_5,
                                                      arg_6,
                                                      arg_7,
                                                      arg_3=arg_3)
        except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
            Printer.print_error('Could not get Func for job `{}`.'.format(arg_7))
            Printer.print_error('Error message `{}`.'.format(e))
            sys.exit(1)

    arg_4, arg_5, arg_6 = get_project_experiment_or_local(arg_0.obj.get('project'),
                                                                      arg_0.obj.get('experiment'))

    if arg_1:
        arg_7 = get_experiment_job_or_local(arg_1)
        get_experiment_job_Func()
    else:
        get_experiment_Func()

Get experiment or experiment job resources.

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

    Examples for getting experiment resources:

    \b
    ```bash
    $ polyaxon experiment -xp 19 resources
    ```

    For GPU resources

    \b
    ```bash
    $ polyaxon experiment -xp 19 resources --gpu
    ```

    Examples for getting experiment job resources:

    \b
    ```bash
    $ polyaxon experiment -xp 19 resources -j 1
    ```

    For GPU resources

    \b
    ```bash
    $ polyaxon experiment -xp 19 resources -j 1 --gpu
    ```

Get experiment or experiment job resources .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Create request payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidField: Raised if the object type attribute or template
                attribute is not defined.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._object_type:
            arg_0._object_type.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidField(
                "The Create request payload is missing the object type field."
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0._template_attribute:
                arg_0._template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )
            else:
                raise exceptions.InvalidField(
                    "The Create request payload is missing the template "
                    "attribute field."
                )
        else:
            # NOTE (ph) For now, leave attributes natively in TemplateAttribute
            # form and just convert to the KMIP 2.0 Attributes form as needed
            # for encoding/decoding purposes. Changing the payload to require
            # the new Attributes structure will trigger a bunch of second-order
            # effects across the client and server codebases that is beyond
            # the scope of updating the Create payloads to support KMIP 2.0.
            if arg_0._template_attribute:
                arg_7 = objects.convert_template_attribute_to_attributes(
                    arg_0._template_attribute
                )
                arg_7.Func(arg_6, arg_2=arg_2)
            else:
                raise exceptions.InvalidField(
                    "The Create request payload is missing the template "
                    "attribute field."
                )

        arg_0.length = arg_6.length()
        super(CreateRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the Create request payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a write method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidField: Raised if the object type attribute or template
                attribute is not defined.

Write the data encoding the Create request payload to a buffer .


def Func(arg_0, *arg_1):
        """Register one or more instances of Magics.

        Take one or more classes or instances of classes that subclass the main
        `core.Magic` class, and Func them with IPython to use the magic
        functions they provide.  The registration process will then ensure that
        any methods that have decorated to provide line and/or cell magics will
        be recognized with the `%x`/`%%x` syntax as a line/cell magic
        respectively.

        If classes are given, they will be instantiated with the default
        constructor.  If your classes need a custom constructor, you should
        instanitate them first and pass the instance.

        The provided arguments can be an arbitrary mix of classes and instances.

        Parameters
        ----------
        magic_objects : one or more classes or instances
        """
        # Start by validating them to ensure they have all had their magic
        # methods Funced at the instance level
        for arg_2 in arg_1:
            if not arg_2.Funced:
                raise ValueError("Class of magics %r was constructed without "
                                 "the @Func_magics class decorator")
            if type(arg_2) in (type, MetaHasTraits):
                # If we're given an uninstantiated class
                arg_2 = arg_2(shell=arg_0.shell)

            # Now that we have an instance, we can Func it and update the
            # table of callables
            arg_0.registry[arg_2.__class__.__name__] = arg_2
            for arg_6 in magic_kinds:
                arg_0.magics[arg_6].update(arg_2.magics[arg_6])

Register one or more instances of Magics.

        Take one or more classes or instances of classes that subclass the main
        `core.Magic` class, and register them with IPython to use the magic
        functions they provide.  The registration process will then ensure that
        any methods that have decorated to provide line and/or cell magics will
        be recognized with the `%x`/`%%x` syntax as a line/cell magic
        respectively.

        If classes are given, they will be instantiated with the default
        constructor.  If your classes need a custom constructor, you should
        instanitate them first and pass the instance.

        The provided arguments can be an arbitrary mix of classes and instances.

        Parameters
        ----------
        magic_objects : one or more classes or instances

Register one or more instances of Magics .


def Func ( arg_0 ) : arg_1 = np . array ( arg_0 ) if arg_1 . ndim == 1 : return 1.0 return np . real ( np . trace ( arg_1 . dot ( arg_1 ) ) )

def Func(arg_0):
    """Calculate the Func of a quantum state.

    Args:
        state (ndarray): a quantum state
    Returns:
        float: Func.
    """
    arg_1 = np.array(arg_0)
    if arg_1.ndim == 1:
        return 1.0
    return np.real(np.trace(arg_1.dot(arg_1)))

Calculate the purity of a quantum state.

    Args:
        state (ndarray): a quantum state
    Returns:
        float: purity.

Calculate the purity of a quantum state .


def Func ( arg_0 ) : arg_1 = LOCAL_RE . match ( arg_0 ) arg_2 = REMOTE_RE . match ( arg_0 ) arg_3 = PLAIN_RE . match ( arg_0 ) if arg_1 : arg_4 = arg_1 . groupdict ( ) . get ( 'database' ) arg_5 = shortcuts . get_server ( ) if arg_4 not in arg_5 : arg_5 . create ( arg_4 ) return True elif arg_2 : arg_6 , arg_7 , arg_8 = map ( arg_2 . groupdict ( ) . get , ( 'hostname' , 'portnum' , 'database' ) ) arg_5 = shortcuts . get_server ( server_url = ( 'http://%s:%s' % ( arg_6 , arg_7 ) ) ) if arg_8 not in arg_5 : arg_5 . create ( arg_8 ) return True elif arg_3 : arg_4 = arg_3 . groupdict ( ) . get ( 'database' ) arg_5 = shortcuts . get_server ( ) if arg_4 not in arg_5 : arg_5 . create ( arg_4 ) return True return False

def Func(arg_0):
    """Make sure a DB specifier exists, creating it if necessary."""
    arg_1 = LOCAL_RE.match(arg_0)
    arg_2 = REMOTE_RE.match(arg_0)
    arg_3 = PLAIN_RE.match(arg_0)
    if arg_1:
        arg_4 = arg_1.groupdict().get('database')
        arg_5 = shortcuts.get_server()
        if arg_4 not in arg_5:
            arg_5.create(arg_4)
        return True
    elif arg_2:
        arg_6, arg_7, arg_8 = map(arg_2.groupdict().get,
            ('hostname', 'portnum', 'database'))
        arg_5 = shortcuts.get_server(
            server_url=('http://%s:%s' % (arg_6, arg_7)))
        if arg_8 not in arg_5:
            arg_5.create(arg_8)
        return True
    elif arg_3:
        arg_4 = arg_3.groupdict().get('database')
        arg_5 = shortcuts.get_server()
        if arg_4 not in arg_5:
            arg_5.create(arg_4)
        return True
    return False

Make sure a DB specifier exists creating it if necessary .


Enforces lower case options and option values where appropriate

def Func ( arg_0 , arg_1 ) : if type ( arg_0 ) is str : arg_0 = arg_0 . Func ( ) if type ( arg_1 ) is str : arg_1 = arg_1 . Func ( ) return ( arg_0 , arg_1 )

def Func(arg_0,arg_1):
    '''
    Enforces Func case options and option values where appropriate
    '''
    if type(arg_0) is str:
        arg_0=arg_0.Func()
    if type(arg_1) is str:
        arg_1=arg_1.Func()
    return (arg_0,arg_1)


def Func(arg_0, arg_1 = False):
        """Start the threads."""
        arg_0.daemon = arg_1
        arg_0.io_threads = []
        arg_0.event_thread = EventDispatcherThread(arg_0.event_dispatcher,
                                    arg_1 = arg_1, exc_queue = arg_0.exc_queue)
        arg_0.event_thread.Func()
        for arg_4 in arg_0.io_handlers:
            arg_0._run_io_threads(arg_4)
        for arg_4 in arg_0.timeout_handlers:
            arg_0._run_timeout_threads(arg_4)


def Func(arg_0, arg_1):
    """
    Prints latest tag's information
    """
    click.echo('=> Latest stable: {tag}'.format(
        tag=click.style(str(arg_0.latest_stable or 'N/A'), fg='yellow' if
                        arg_0.latest_stable else 'magenta')
    ))

    if arg_1 is not None:
        arg_2 = arg_0.latest_revision(arg_1)
        click.echo('=> Latest relative revision ({label}): {tag}'.format(
            arg_1=click.style(arg_1, fg='blue'),
            tag=click.style(str(arg_2 or 'N/A'),
                                fg='yellow' if arg_2 else 'magenta')
        ))


(
    existing_type,
    name=None,
    description=None,
    input_schema=None,
    output_schema=None,
    serialization_strategy=None,
    storage_plugins=None,
)

return _decorate_as_dagster_type(
        existing_type,
        key=name,
        name=name,
        description=description,
        input_schema=input_schema,
        output_schema=output_schema,
        serialization_strategy=serialization_strategy,
        storage_plugins=storage_plugins,
    )

def Func(
    arg_0,
    arg_1=None,
    arg_2=None,
    arg_3=None,
    arg_4=None,
    arg_5=None,
    arg_6=None,
):
    '''
    Takes a python cls and creates a type for it in the Dagster domain.

    Args:
        existing_type (cls)
            The python type you want to project in to the Dagster type system.
        name (Optional[str]):
        description (Optiona[str]):
        input_schema (Optional[InputSchema]):
            An instance of a class that inherits from :py:class:`InputSchema` that
            can map config data to a value of this type.

        output_schema (Optiona[OutputSchema]):
            An instance of a class that inherits from :py:class:`OutputSchema` that
            can map config data to persisting values of this type.

        serialization_strategy (Optional[SerializationStrategy]):
            The default behavior for how to serialize this value for
            persisting between execution steps.

        storage_plugins (Optional[Dict[RunStorageMode, TypeStoragePlugin]]):
            Storage type specific overrides for the serialization strategy.
            This allows for storage specific optimzations such as effecient
            distributed storage on S3.
    '''
    check.type_param(arg_0, 'existing_type')
    check.opt_str_param(arg_1, 'name')
    check.opt_str_param(arg_2, 'description')
    check.opt_inst_param(arg_3, 'input_schema', InputSchema)
    check.opt_inst_param(arg_4, 'output_schema', OutputSchema)
    check.opt_inst_param(arg_5, 'serialization_strategy', SerializationStrategy)
    arg_6 = check.opt_dict_param(arg_6, 'storage_plugins')

    if arg_5 is None:
        arg_5 = PickleSerializationStrategy()

    arg_1 = arg_0.__name__ if arg_1 is None else arg_1

    return _decorate_Func(
        arg_0,
        key=arg_1,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5,
        arg_6=arg_6,
    )

Takes a python cls and creates a type for it in the Dagster domain .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . write ( arg_2 , arg_0 . intf . data )

def Func(arg_0, arg_1, arg_2):
        """write data to interface"""
        arg_1.write(arg_2, arg_0.intf.data)


(self, coverage, store, workspace=None, filter=None, limit=None, offset=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=None):
        '''List granules of an imagemosaic'''
        arg_7 = dict()

        if arg_4 is not None:
            arg_7['filter'] = arg_4
        if arg_5 is not None:
            arg_7['limit'] = arg_5
        if arg_6 is not None:
            arg_7['offset'] = arg_6

        arg_8 = arg_3
        if isinstance(arg_2, basestring):
            arg_9 = arg_2
        else:
            arg_9 = arg_2.name
            arg_8 = arg_2.workspace.name

        if arg_8 is None:
            raise ValueError("Must specify workspace")

        arg_10 = build_url(
            arg_0.service_url,
            [
                "workspaces",
                arg_8,
                "coveragestores",
                arg_9,
                "coverages",
                arg_1,
                "index/granules.json"
            ],
            arg_7
        )

        # GET /workspaces/<ws>/coveragestores/<name>/coverages/<coverage>/index/granules.json
        arg_11 = {
            "Content-type": "application/json",
            "Accept": "application/json"
        }

        arg_12 = arg_0.http_request(arg_10, arg_11=arg_11)
        if arg_12.status_code != 200:
            FailedRequestError('Failed to list granules in mosaic {} : {}, {}'.format(arg_2, arg_12.status_code, arg_12.text))

        arg_0._cache.clear()
        return arg_12.json()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _trans ( arg_0 . pos [ arg_1 ] ) return Tile ( arg_2 , arg_2 ) . pad ( arg_0 . support_pad )

def Func(arg_0, arg_1):
        """Get the update tile surrounding particle `n` """
        arg_2 = arg_0._trans(arg_0.pos[arg_1])
        return Tile(arg_2, arg_2).pad(arg_0.support_pad)

Get the update tile surrounding particle n


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = cl . KMeans ( arg_1 , ** arg_2 ) arg_4 = arg_3 . fit ( arg_0 ) arg_5 = arg_4 . labels_ return arg_5 , [ np . nan ]

def Func(arg_0, arg_1, **arg_2):
    """
    Identify clusters using K - Means algorithm.

    Parameters
    ----------
    data : array_like
        array of size [n_samples, n_features].
    n_clusters : int
        The number of clusters expected in the data.

    Returns
    -------
    dict
        boolean array for each identified cluster.
    """
    arg_3 = cl.KMeans(arg_1, **arg_2)
    arg_4 = arg_3.fit(arg_0)

    arg_5 = arg_4.labels_

    return arg_5, [np.nan]

Identify clusters using K - Means algorithm .


def Func ( arg_0 , arg_1 , arg_2 = ( ) ) : for arg_3 in ( arg_0 . default_cmd_options + arg_2 ) : arg_1 = arg_0 . apply_option ( arg_1 , arg_3 , active = getattr ( arg_0 , arg_3 , False ) ) return arg_1

def Func(arg_0, arg_1, arg_2=()):
        """Apply command-line options."""
        for arg_3 in (arg_0.default_cmd_options + arg_2):
            arg_1 = arg_0.apply_option(arg_1, arg_3,
                                    active=getattr(arg_0, arg_3, False))
        return arg_1


def Func(**arg_0):
    """
    Make sure an EVM instruction has all of its arguments concretized according to
    provided policies.

    Example decoration:

        @Func(size='ONE', address='')
        def LOG(self, address, size, *topics):
            ...

    The above will make sure that the |size| parameter to LOG is Concretized when symbolic
    according to the 'ONE' policy and concretize |address| with the default policy.

    :param policies: A kwargs list of argument names and their respective policies.
                         Provide None or '' as policy to use default.
    :return: A function decorator
    """
    def concretizer(arg_1):
        @wraps(arg_1)
        def arg_11(*arg_2, **arg_3):
            arg_4 = inspect.getfullargspec(arg_1)
            for arg_5, arg_6 in arg_0.items():
                assert arg_5 in arg_4.args, "Concretizer argument not found in wrapped function."
                # index is 0-indexed, but ConcretizeArgument is 1-indexed. However, this is correct
                # since implementation method is always a bound method (self is param 0)
                arg_7 = arg_4.args.index(arg_5)
                if not issymbolic(arg_2[arg_7]):
                    continue
                if not arg_6:
                    arg_6 = 'SAMPLED'

                if arg_6 == "ACCOUNTS":
                    arg_8 = arg_2[arg_7]
                    arg_9 = arg_2[0].world
                    #special handler for EVM only policy
                    arg_10 = arg_9._constraint_to_accounts(arg_8, ty='both', include_zero=True)
                    arg_9.constraints.add(arg_10)
                    arg_6 = 'ALL'
                raise ConcretizeArgument(arg_7, arg_6=arg_6)
            return arg_1(*arg_2, **arg_3)
        arg_11.__signature__ = inspect.signature(arg_1)
        return arg_11
    return concretizer

Make sure an EVM instruction has all of its arguments concretized according to
    provided policies.

    Example decoration:

        @concretized_args(size='ONE', address='')
        def LOG(self, address, size, *topics):
            ...

    The above will make sure that the |size| parameter to LOG is Concretized when symbolic
    according to the 'ONE' policy and concretize |address| with the default policy.

    :param policies: A kwargs list of argument names and their respective policies.
                         Provide None or '' as policy to use default.
    :return: A function decorator

Make sure an EVM instruction has all of its arguments concretized according to provided policies .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . ensemble . Func ( arg_1 , arg_2 ) arg_3 = list ( set ( [ tuple ( arg_4 ) for arg_4 in arg_1 ] ) ) for arg_4 in arg_3 : arg_0 . feature_map [ arg_4 ] = arg_0 . ensemble . predict ( [ arg_4 ] ) [ 0 ]

def Func(arg_0, arg_1, arg_2):
        """Constructs the MDR ensemble from the provided training data

        Parameters
        ----------
        features: array-like {n_samples, n_features}
            Feature matrix
        classes: array-like {n_samples}
            List of class labels for prediction

        Returns
        -------
        None

        """
        arg_0.ensemble.Func(arg_1, arg_2)

        # Construct the feature map from the ensemble predictions
        arg_3 = list(set([tuple(arg_4) for arg_4 in arg_1]))
        for arg_4 in arg_3:
            arg_0.feature_map[arg_4] = arg_0.ensemble.predict([arg_4])[0]