def Func ( arg_0 , arg_1 = None ) : if os . path . isdir ( arg_0 ) : return SuiteFolder ( arg_0 , arg_1 ) else : arg_2 = RobotFile ( arg_0 , arg_1 ) for arg_3 in arg_2 . tables : if isinstance ( arg_3 , TestcaseTable ) : arg_2 . __class__ = SuiteFile return arg_2 arg_2 . __class__ = ResourceFile return arg_2

def Func(arg_0, arg_1=None):
    '''Return an instance of SuiteFile, ResourceFile, SuiteFolder

    Exactly which is returned depends on whether it's a file or
    folder, and if a file, the contents of the file. If there is a
    testcase table, this will return an instance of SuiteFile,
    otherwise it will return an instance of ResourceFile.
    '''

    if os.path.isdir(arg_0):
        return SuiteFolder(arg_0, arg_1)

    else:
        arg_2 = RobotFile(arg_0, arg_1)

        for arg_3 in arg_2.tables:
            if isinstance(arg_3, TestcaseTable):
                arg_2.__class__ = SuiteFile
                return arg_2

        arg_2.__class__ = ResourceFile
        return arg_2

Return an instance of SuiteFile ResourceFile SuiteFolder


def Func(arg_0, arg_1):
    """Check arguments passed by user that are not checked by argparse itself."""
    if arg_0.asm_block not in ['auto', 'manual']:
        try:
            arg_0.asm_block = int(arg_0.asm_block)
        except ValueError:
            arg_1.error('--asm-block can only be "auto", "manual" or an integer')

    # Set default unit depending on performance model requested
    if not arg_0.unit:
        if 'Roofline' in arg_0.pmodel or 'RooflineIACA' in arg_0.pmodel:
            arg_0.unit = 'FLOP/s'
        else:
            arg_0.unit = 'cy/CL'

Check arguments passed by user that are not checked by argparse itself .


def Func ( arg_0 , arg_1 ) : arg_2 = ast . Name ( "%s.%s" % ( arg_1 . value . id , arg_1 . attr ) , arg_1 . ctx ) return ast . copy_location ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
        """Flatten one level of attribute access."""
        arg_2 = ast.Name("%s.%s" % (arg_1.value.id, arg_1.attr), arg_1.ctx)
        return ast.copy_location(arg_2, arg_1)


(self, name=None, index=None, as_new=False, load_parameters=pypetconstants.LOAD_DATA,
               load_derived_parameters=pypetconstants.LOAD_SKELETON,
               load_results=pypetconstants.LOAD_SKELETON,
               load_other_data=pypetconstants.LOAD_SKELETON,
               recursive=True,
               load_data=None,
               max_depth=None,
               force=False,
               dynamic_imports=None,
               with_run_information=True,
               with_meta_data=True,
               storage_service=None, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False, arg_4=arg_5.LOAD_DATA,
               arg_7=arg_5.LOAD_SKELETON,
               arg_9=arg_5.LOAD_SKELETON,
               arg_10=arg_5.LOAD_SKELETON,
               arg_11=True,
               arg_12=None,
               arg_13=None,
               arg_14=False,
               arg_15=None,
               arg_16=True,
               arg_17=True,
               arg_18=None, **arg_19):
        """Loads a trajectory via the storage service.

        If you want to load individual results or parameters manually, you can take
        a look at :func:`~pypet.trajectory.Trajectory.Func_items`.
        To only load subtrees check out :func:`~pypet.naturalnaming.NNGroupNode.Func_child`.

        For `Func` you can pass the following arguments:

        :param name:

            Name of the trajectory to be loaded. If no name or index is specified
            the current name of the trajectory is used.

        :param index:

            If you don't specify a name you can specify an integer index instead.
            The corresponding trajectory in the hdf5 file at the index
            position is loaded (counting starts with 0). Negative indices are also allowed
            counting in reverse order. For instance, `-1` refers to the last trajectory in
            the file, `-2` to the second last, and so on.

        :param as_new:

            Whether you want to rerun the experiments. So the trajectory is loaded only
            with parameters. The current trajectory name is kept in this case, which should be
            different from the trajectory name specified in the input parameter `name`.
            If you load `as_new=True` all parameters are unlocked.
            If you load `as_new=False` the current trajectory is replaced by the one on disk,
            i.e. name, timestamp, formatted time etc. are all taken from disk.

        :param load_parameters: How parameters and config items are loaded

        :param load_derived_parameters: How derived parameters are loaded

        :param load_results: How results are loaded

            You can specify how to load the parameters, derived parameters and results
            as follows:

                * :const:`pypet.pypetconstants.LOAD_NOTHING`: (0)

                    Nothing is loaded.

                * :const:`pypet.pypetconstants.LOAD_SKELETON`: (1)

                    The skeleton is loaded including annotations (See :ref:`more-on-annotations`).
                    This means that only empty
                    *parameter* and *result* objects will
                    be created  and you can manually load the data into them afterwards.
                    Note that :class:`pypet.annotations.Annotations` do not count as data and they
                    will be loaded because they are assumed to be small.

                * :const:`pypet.pypetconstants.LOAD_DATA`: (2)

                    The whole data is loaded. Note in case you have non-empty leaves
                    already in RAM, these are left untouched.

                * :const:`pypet.pypetconstants.OVERWRITE_DATA`: (3)

                    As before, but non-empty nodes are emptied and reloaded.

                Note that in all cases except :const:`pypet.pypetconstants.LOAD_NOTHING`,
                annotations will be reloaded if the corresponding instance
                is created or the annotations of an existing instance were emptied before.

        :param recursive:

            If data should be loaded recursively. If set to `None`, this is equivalent to
            set all data loading to `:const:`pypet.pypetconstants.LOAD_NOTHING`.

        :param load_data:

            As the above, per default set to `None`. If not `None` the setting of `load_data`
            will overwrite the settings of `load_parameters`, `load_derived_parameters`,
            `load_results`, and `load_other_data`. This is more or less or shortcut if all
            types should be loaded the same.

        :param max_depth:

            Maximum depth to load nodes (inclusive).

        :param force:

            *pypet* will refuse to load trajectories that have been created using *pypet* with a
            different version number or a different python version.
            To force the load of a trajectory from a previous version
            simply set ``force = True``. Note that it is not checked if other versions of packages
            differ from previous experiments, i.e. numpy, scipy, etc. But you can check
            for this manually. The versions of other packages can be found under
            ``'config.environment.name_of_environment.versions.package_name'``.

        :param dynamic_imports:

            If you've written a custom parameter that needs to be loaded dynamically
            during runtime, this needs to be specified here as a list of classes or
            strings naming classes and there module paths. For example:
            `dynamic_imports = ['pypet.parameter.PickleParameter',MyCustomParameter]`

            If you only have a single class to import, you do not need the list brackets:
            `dynamic_imports = 'pypet.parameter.PickleParameter'`

            The classes passed here are added for good and will be kept by the trajectory.
            Please add your dynamically imported classes only once.

        :param with_run_information:

            If information about the individual runs should be loaded. If you have many
            runs, like 1,000,000 or more you can spare time by setting
            `with_run_information=False`.
            Note that `f_get_run_information` and `f_idx_to_run` do not work in such a case.
            Moreover, setting `v_idx` does not work either. If you load the trajectory
            without this information, be careful, this is not recommended.

        :param wiht_meta_data:

            If meta data should be loaded.

        :param storage_service:

            Pass a storage service used by the trajectory. Alternatively pass a constructor
            and other ``**kwargs`` are passed onto the constructor. Leave `None` in combination
            with using no other kwargs, if you don't want to change the service
            the trajectory is currently using.

        :param kwargs:

            Other arguments passed to the storage service constructor. Don't pass any
            other kwargs and ``storage_service=None``,
            if you don't want to change the current service.

        """
        # Do some argument validity checks first
        if arg_1 is None and arg_2 is None:
            arg_1 = arg_0.v_name

        if arg_3:
            arg_4 = arg_5.LOAD_DATA
            arg_7 = arg_5.LOAD_NOTHING
            arg_9 = arg_5.LOAD_NOTHING
            arg_10 = arg_5.LOAD_NOTHING

        arg_20 = set(arg_19.keys())
        if arg_0.v_storage_service is None or arg_18 is not None or len(arg_19) > 0:
            arg_0._storage_service, arg_20 = storage_factory(arg_18=arg_18,
                                                                   trajectory=arg_0, **arg_19)
        if len(arg_20) > 0:
            raise ValueError('The following keyword arguments were not used: `%s`' %
                             str(arg_20))

        if arg_15 is not None:
            arg_0.f_add_to_dynamic_imports(arg_15)

        if arg_12 is not None:
            arg_4 = arg_12
            arg_7 = arg_12
            arg_9 = arg_12
            arg_10 = arg_12

        arg_0._storage_service.load(arg_5.TRAJECTORY, arg_0, trajectory_name=arg_1,
                                   trajectory_index=arg_2,
                                   arg_3=arg_3, arg_4=arg_4,
                                   arg_7=arg_7,
                                   arg_9=arg_9,
                                   arg_10=arg_10,
                                   arg_11=arg_11,
                                   arg_13=arg_13,
                                   arg_16=arg_16,
                                   arg_17=arg_17,
                                   arg_14=arg_14)

        # If a trajectory is newly loaded, all parameters are unlocked.
        if arg_3:
            for arg_22 in arg_0._parameters.values():
                arg_22.f_unlock()

Loads a trajectory via the storage service.

        If you want to load individual results or parameters manually, you can take
        a look at :func:`~pypet.trajectory.Trajectory.f_load_items`.
        To only load subtrees check out :func:`~pypet.naturalnaming.NNGroupNode.f_load_child`.

        For `f_load` you can pass the following arguments:

        :param name:

            Name of the trajectory to be loaded. If no name or index is specified
            the current name of the trajectory is used.

        :param index:

            If you don't specify a name you can specify an integer index instead.
            The corresponding trajectory in the hdf5 file at the index
            position is loaded (counting starts with 0). Negative indices are also allowed
            counting in reverse order. For instance, `-1` refers to the last trajectory in
            the file, `-2` to the second last, and so on.

        :param as_new:

            Whether you want to rerun the experiments. So the trajectory is loaded only
            with parameters. The current trajectory name is kept in this case, which should be
            different from the trajectory name specified in the input parameter `name`.
            If you load `as_new=True` all parameters are unlocked.
            If you load `as_new=False` the current trajectory is replaced by the one on disk,
            i.e. name, timestamp, formatted time etc. are all taken from disk.

        :param load_parameters: How parameters and config items are loaded

        :param load_derived_parameters: How derived parameters are loaded

        :param load_results: How results are loaded

            You can specify how to load the parameters, derived parameters and results
            as follows:

                * :const:`pypet.pypetconstants.LOAD_NOTHING`: (0)

                    Nothing is loaded.

                * :const:`pypet.pypetconstants.LOAD_SKELETON`: (1)

                    The skeleton is loaded including annotations (See :ref:`more-on-annotations`).
                    This means that only empty
                    *parameter* and *result* objects will
                    be created  and you can manually load the data into them afterwards.
                    Note that :class:`pypet.annotations.Annotations` do not count as data and they
                    will be loaded because they are assumed to be small.

                * :const:`pypet.pypetconstants.LOAD_DATA`: (2)

                    The whole data is loaded. Note in case you have non-empty leaves
                    already in RAM, these are left untouched.

                * :const:`pypet.pypetconstants.OVERWRITE_DATA`: (3)

                    As before, but non-empty nodes are emptied and reloaded.

                Note that in all cases except :const:`pypet.pypetconstants.LOAD_NOTHING`,
                annotations will be reloaded if the corresponding instance
                is created or the annotations of an existing instance were emptied before.

        :param recursive:

            If data should be loaded recursively. If set to `None`, this is equivalent to
            set all data loading to `:const:`pypet.pypetconstants.LOAD_NOTHING`.

        :param load_data:

            As the above, per default set to `None`. If not `None` the setting of `load_data`
            will overwrite the settings of `load_parameters`, `load_derived_parameters`,
            `load_results`, and `load_other_data`. This is more or less or shortcut if all
            types should be loaded the same.

        :param max_depth:

            Maximum depth to load nodes (inclusive).

        :param force:

            *pypet* will refuse to load trajectories that have been created using *pypet* with a
            different version number or a different python version.
            To force the load of a trajectory from a previous version
            simply set ``force = True``. Note that it is not checked if other versions of packages
            differ from previous experiments, i.e. numpy, scipy, etc. But you can check
            for this manually. The versions of other packages can be found under
            ``'config.environment.name_of_environment.versions.package_name'``.

        :param dynamic_imports:

            If you've written a custom parameter that needs to be loaded dynamically
            during runtime, this needs to be specified here as a list of classes or
            strings naming classes and there module paths. For example:
            `dynamic_imports = ['pypet.parameter.PickleParameter',MyCustomParameter]`

            If you only have a single class to import, you do not need the list brackets:
            `dynamic_imports = 'pypet.parameter.PickleParameter'`

            The classes passed here are added for good and will be kept by the trajectory.
            Please add your dynamically imported classes only once.

        :param with_run_information:

            If information about the individual runs should be loaded. If you have many
            runs, like 1,000,000 or more you can spare time by setting
            `with_run_information=False`.
            Note that `f_get_run_information` and `f_idx_to_run` do not work in such a case.
            Moreover, setting `v_idx` does not work either. If you load the trajectory
            without this information, be careful, this is not recommended.

        :param wiht_meta_data:

            If meta data should be loaded.

        :param storage_service:

            Pass a storage service used by the trajectory. Alternatively pass a constructor
            and other ``**kwargs`` are passed onto the constructor. Leave `None` in combination
            with using no other kwargs, if you don't want to change the service
            the trajectory is currently using.

        :param kwargs:

            Other arguments passed to the storage service constructor. Don't pass any
            other kwargs and ``storage_service=None``,
            if you don't want to change the current service.

Loads a trajectory via the storage service .


Send a delete request to the given path of the CRUD API. This deletes the object. Or at least tries to.

return self.handleresult(self.r.delete(urljoin(self.url + CRUD_PATH,
                                                       path)))

def Func ( arg_0 , arg_1 ) : return arg_0 . handleresult ( arg_0 . r . Func ( urljoin ( arg_0 . url + CRUD_PATH , arg_1 ) ) )

def Func(arg_0, arg_1):
        """Send a Func request to the given path of the CRUD API. This Funcs the object. Or at least tries to."""
        return arg_0.handleresult(arg_0.r.Func(urljoin(arg_0.url + CRUD_PATH,
                                                       arg_1)))

Send a delete request to the given path of the CRUD API . This deletes the object . Or at least tries to .


def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 . models ) : arg_3 = [ int ( arg_1 * len ( arg_0 . y ) ) for arg_1 in arg_0 . lc_range ] for arg_4 in arg_3 : arg_5 = arg_0 . X [ : arg_4 ] arg_6 = arg_0 . y [ : arg_4 ] arg_7 = Experiment ( arg_5 , arg_6 , arg_2 . estimator , arg_0 . scores , arg_0 . validation_method ) arg_7 . log_folder = arg_0 . log_folder arg_7 . Func ( )

def Func(arg_0):
        """
        Train model with transformed data
        """
        for arg_1, arg_2 in enumerate(arg_0.models):
            arg_3 = [int(arg_1 * len(arg_0.y)) for arg_1 in arg_0.lc_range]
            for arg_4 in arg_3:
                arg_5 = arg_0.X[:arg_4]
                arg_6 = arg_0.y[:arg_4]
                arg_7 = Experiment(arg_5, arg_6, arg_2.estimator, arg_0.scores,
                               arg_0.validation_method)
                arg_7.log_folder = arg_0.log_folder
                arg_7.Func()


return columnize.columnize(commands, displaywidth=width,
                                   lineprefix='    ')

def
Func
(
arg_0
,
arg_1
)
:
arg_1
.
sort
(
)
arg_2
=
arg_0
.
debugger
.
settings
[
'width'
]
return
columnize
.
columnize
(
arg_1
,
displaywidth
=
arg_2
,
lineprefix
=
'    '
)

def Func(arg_0, arg_1):
        """List commands arranged in an aligned columns"""
        arg_1.sort()
        arg_2 = arg_0.debugger.settings['width']
        return columnize.columnize(arg_1, displaywidth=arg_2,
                                   lineprefix='    ')


def Func ( ** arg_0 ) : arg_1 = '__' . join ( [ '{}:{}' . format ( item , value ) for item , value in iteritems ( arg_0 ) ] ) return hashlib . md5 ( arg_1 . encode ( 'utf-8' ) ) . hexdigest ( )

def Func(**arg_0):
    """
    Get MD5 encoded cache key for given arguments.

    Here is the format of key before MD5 encryption.
        key1:value1__key2:value2 ...

    Example:
        >>> Func(site_domain="example.com", resource="enterprise")
        # Here is key format for above call
        # "site_domain:example.com__resource:enterprise"
        a54349175618ff1659dee0978e3149ca

    Arguments:
        **kwargs: Key word arguments that need to be present in cache key.

    Returns:
         An MD5 encoded key uniquely identified by the key word arguments.
    """
    arg_1 = '__'.join(['{}:{}'.format(item, value) for item, value in iteritems(arg_0)])

    return hashlib.md5(arg_1.encode('utf-8')).hexdigest()

Get MD5 encoded cache key for given arguments.

    Here is the format of key before MD5 encryption.
        key1:value1__key2:value2 ...

    Example:
        >>> get_cache_key(site_domain="example.com", resource="enterprise")
        # Here is key format for above call
        # "site_domain:example.com__resource:enterprise"
        a54349175618ff1659dee0978e3149ca

    Arguments:
        **kwargs: Key word arguments that need to be present in cache key.

    Returns:
         An MD5 encoded key uniquely identified by the key word arguments.

Get MD5 encoded cache key for given arguments .


(enum_descriptor, locations, path, name_prefix='')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' ) : print ( make_subsection ( arg_3 + arg_0 . name ) ) arg_4 = arg_1 [ arg_2 ] if arg_4 . HasField ( 'leading_comments' ) : print ( textwrap . dedent ( arg_4 . leading_comments ) ) arg_5 = [ ] for arg_6 , arg_7 in enumerate ( arg_0 . value ) : arg_8 = arg_1 [ arg_2 + ( 2 , arg_6 ) ] arg_5 . append ( ( make_code ( arg_7 . name ) , arg_7 . number , textwrap . fill ( get_comment_from_location ( arg_8 ) , INFINITY ) , ) ) print_table ( ( 'Name' , 'Number' , 'Description' ) , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3=''):
    """Generate doc for an enum.

    Args:
        enum_descriptor: descriptor_pb2.EnumDescriptorProto instance for enum
            to generate docs for.
        locations: Dictionary of location paths tuples to
            descriptor_pb2.SourceCodeInfo.Location instances.
        path: Path tuple to the enum definition.
        name_prefix: Optional prefix for this enum's name.
    """
    print(make_subsection(arg_3 + arg_0.name))
    arg_4 = arg_1[arg_2]
    if arg_4.HasField('leading_comments'):
        print(textwrap.dedent(arg_4.leading_comments))

    arg_5 = []
    for arg_6, arg_7 in enumerate(arg_0.value):
        arg_8 = arg_1[arg_2 + (2, arg_6)]
        arg_5.append((
            make_code(arg_7.name),
            arg_7.number,
            textwrap.fill(get_comment_from_location(arg_8), INFINITY),
        ))
    print_table(('Name', 'Number', 'Description'), arg_5)


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Submits a callable to be executed with the given arguments.

        Count maximum reached work queue size in ThreadPoolExecutor.max_queue_size_reached.
        """
        arg_4 = super().Func(arg_1, *arg_2, **arg_3)
        arg_5 = arg_0._work_queue.qsize()
        if arg_5 > arg_0.max_queue_size_reached:
            arg_0.max_queue_size_reached = arg_5
        return arg_4

Submits a callable to be executed with the given arguments .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
for
arg_4
,
arg_5
in
arg_1
.
items
(
)
:
arg_6
=
"%s[%d]"
%
(
arg_4
[
0
]
.
name
,
arg_4
[
1
]
)
arg_7
=
"%s[%d]"
%
(
arg_5
[
0
]
.
name
,
arg_5
[
1
]
)
if
arg_4
not
in
arg_2
:
raise
DAGCircuitError
(
"invalid wire mapping key %s"
%
arg_6
)
if
arg_5
not
in
arg_3
:
raise
DAGCircuitError
(
"invalid wire mapping value %s"
%
arg_7
)
if
type
(
arg_4
)
is
not
type
(
arg_5
)
:
raise
DAGCircuitError
(
"inconsistent wire_map at (%s,%s)"
%
(
arg_6
,
arg_7
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Check that the wiremap is consistent.

        Check that the wiremap refers to valid wires and that
        those wires have consistent types.

        Args:
            wire_map (dict): map from (register,idx) in keymap to
                (register,idx) in valmap
            keymap (dict): a map whose keys are wire_map keys
            valmap (dict): a map whose keys are wire_map values

        Raises:
            DAGCircuitError: if wire_map not valid
        """
        for arg_4, arg_5 in arg_1.items():
            arg_6 = "%s[%d]" % (arg_4[0].name, arg_4[1])
            arg_7 = "%s[%d]" % (arg_5[0].name, arg_5[1])
            if arg_4 not in arg_2:
                raise DAGCircuitError("invalid wire mapping key %s" % arg_6)
            if arg_5 not in arg_3:
                raise DAGCircuitError("invalid wire mapping value %s" % arg_7)
            if type(arg_4) is not type(arg_5):
                raise DAGCircuitError("inconsistent wire_map at (%s,%s)" %
                                      (arg_6, arg_7))


return dump_to_response(request, [MODEL_TREE, MODEL_TREE_ITEM], filename_prefix='sitetrees')

def Func ( arg_0 , arg_1 ) : from smuggler . views import dump_to_response return dump_to_response ( arg_1 , [ MODEL_TREE , MODEL_TREE_ITEM ] , filename_prefix = 'sitetrees' )

def Func(arg_0, arg_1):
        """Dumps sitetrees with items using django-smuggler.

        :param request:
        :return:
        """
        from smuggler.views import dump_to_response
        return dump_to_response(arg_1, [MODEL_TREE, MODEL_TREE_ITEM], filename_prefix='sitetrees')

Dumps sitetrees with items using django - smuggler .


def Func ( arg_0 ) : arg_1 = urijoin ( CRATES_API_URL , CATEGORY_SUMMARY ) arg_2 = arg_0 . fetch ( arg_1 ) return arg_2

def Func(arg_0):
        """Get Crates.io Func"""

        arg_1 = urijoin(CRATES_API_URL, CATEGORY_SUMMARY)
        arg_2 = arg_0.fetch(arg_1)

        return arg_2


return all(status.passed for status in
                   self.get_dep_statuses(ti, session, dep_context))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : return all ( arg_4 . passed for arg_4 in arg_0 . get_dep_statuses ( arg_1 , arg_2 , arg_3 ) )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Returns whether or not this dependency is met for a given task instance. A
        dependency is considered met if all of the dependency statuses it reports are
        passing.

        :param ti: the task instance to see if this dependency is met for
        :type ti: airflow.models.TaskInstance
        :param session: database session
        :type session: sqlalchemy.orm.session.Session
        :param dep_context: The context this dependency is being checked under that stores
            state that can be used by this dependency.
        :type dep_context: BaseDepContext
        """
        return all(arg_4.passed for arg_4 in
                   arg_0.get_dep_statuses(arg_1, arg_2, arg_3))

Returns whether or not this dependency is met for a given task instance . A dependency is considered met if all of the dependency statuses it reports are passing .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = 'to' in arg_3 and arg_3 . pop ( 'to' ) arg_5 = re . compile ( arg_1 , * arg_2 , ** arg_3 ) if arg_4 is dict : for arg_6 in arg_0 : Func = arg_5 . match ( arg_6 ) if Func is not None : yield Func . groupdict ( ) elif arg_4 is tuple : for arg_6 in arg_0 : Func = arg_5 . match ( arg_6 ) if Func is not None : yield Func . groups ( ) elif arg_4 is list : for arg_6 in arg_0 : Func = arg_5 . match ( arg_6 ) if Func is not None : yield list ( Func . groups ( ) ) else : for arg_6 in arg_0 : Func = arg_5 . match ( arg_6 ) if Func is not None : yield Func

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """The pipe greps the data passed from previous generator according to
    given regular expression. The data passed to next pipe is MatchObject
    , dict or tuple which determined by 'to' in keyword argument.

    By default, match pipe yields MatchObject. Use 'to' in keyword argument
    to change the type of match result.

    If 'to' is dict, yield MatchObject.groupdict().
    If 'to' is tuple, yield MatchObject.groups().
    If 'to' is list, yield list(MatchObject.groups()).

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The pattern which used to filter data.
    :type pattern: str|unicode
    :param to: What data type the result should be stored. dict|tuple|list
    :type to: type
    :returns: generator
    """
    arg_4 = 'to' in arg_3 and arg_3.pop('to')
    arg_5 = re.compile(arg_1, *arg_2, **arg_3)

    if arg_4 is dict:
        for arg_6 in arg_0:
            Func = arg_5.match(arg_6)
            if Func is not None:
                yield Func.groupdict()
    elif arg_4 is tuple:
        for arg_6 in arg_0:
            Func = arg_5.match(arg_6)
            if Func is not None:
                yield Func.groups()
    elif arg_4 is list:
        for arg_6 in arg_0:
            Func = arg_5.match(arg_6)
            if Func is not None:
                yield list(Func.groups())
    else:
        for arg_6 in arg_0:
            Func = arg_5.match(arg_6)
            if Func is not None:
                yield Func

The pipe greps the data passed from previous generator according to given regular expression . The data passed to next pipe is MatchObject dict or tuple which determined by to in keyword argument .


def Func ( arg_0 = 100 , arg_1 = 0 , arg_2 = None ) : if arg_2 is not None : arg_3 = dict ( arg_0 = arg_0 , arg_2 = arg_2 ) else : print ( OFFSET_WARNING ) arg_3 = dict ( arg_0 = arg_0 , arg_1 = arg_1 ) try : arg_4 = _pybossa_req ( 'get' , 'project' , arg_3 = arg_3 ) if type ( arg_4 ) . __name__ == 'list' : return [ Project ( arg_5 ) for arg_5 in arg_4 ] else : raise TypeError except : raise

def Func(arg_0=100, arg_1=0, arg_2=None):
    """Return a list of registered projects.

    :param limit: Number of returned items, default 100
    :type limit: integer
    :param offset: Offset for the query, default 0
    :type offset: integer
    :param last_id: id of the last project, used for pagination. If provided, offset is ignored
    :type last_id: integer
    :rtype: list
    :returns: A list of PYBOSSA Projects

    """
    if arg_2 is not None:
        arg_3 = dict(arg_0=arg_0, arg_2=arg_2)
    else:
        print(OFFSET_WARNING)
        arg_3 = dict(arg_0=arg_0, arg_1=arg_1)
    try:
        arg_4 = _pybossa_req('get', 'project',
                           arg_3=arg_3)
        if type(arg_4).__name__ == 'list':
            return [Project(arg_5) for arg_5 in arg_4]
        else:
            raise TypeError
    except:  # pragma: no cover
        raise


def Func(arg_0, arg_1, arg_2):
  """Uses arg names to resolve distribution names."""
  if arg_1 is None:
    arg_1 = []
  else:
    arg_1 = arg_1.copy()
  arg_3 = len(arg_0)
  arg_1.extend([None]*(arg_3 - len(arg_1)))
  for arg_4, arg_5 in enumerate(reversed(arg_0)):
    if not arg_5:
      continue  # There's no args to analyze.
    arg_6 = arg_3 - arg_4 - 1
    for arg_7, arg_8 in enumerate(arg_5):
      arg_1[arg_6 - arg_7 - 1] = arg_8
  arg_7 = 0
  for arg_4 in range(len(arg_1)):
    arg_6 = arg_3 - arg_4 - 1
    if arg_1[arg_6] is None:
      arg_1[arg_6] = arg_2 if arg_7 == 0 else arg_2 + str(arg_7)
      arg_7 += 1
  return tuple(arg_1)

Uses arg names to resolve distribution names .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( "is_primary" , False ) with transaction . atomic ( ) : arg_4 = super ( EmailAddressManager , arg_0 ) . Func ( * arg_1 , ** arg_2 ) if arg_3 : arg_4 . set_primary ( ) return arg_4

def Func(arg_0, *arg_1, **arg_2):
        """
        Create a new email address.
        """
        arg_3 = arg_2.pop("is_primary", False)

        with transaction.atomic():
            arg_4 = super(EmailAddressManager, arg_0).Func(*arg_1, **arg_2)

            if arg_3:
                arg_4.set_primary()

        return arg_4


Internal instance method run by worker process to actually run the task callable.

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . func_from_info ( ) try : arg_3 = dict ( task = arg_0 , channel_message = arg_1 , ) arg_2 ( arg_3 ) finally : if arg_0 . end_Funcning < arg_0 . next_Func : arg_0 . enabled = False Channel ( KILL_TASK_CHANNEL ) . send ( { 'id' : arg_0 . pk } ) return if arg_0 . iterations == 0 : return else : arg_0 . iterations -= 1 if arg_0 . iterations == 0 : arg_0 . enabled = False Channel ( KILL_TASK_CHANNEL ) . send ( { 'id' : arg_0 . pk } ) arg_0 . save ( )

def Func(arg_0, arg_1):
        """Internal instance method Func by worker process to actually Func the task callable."""
        arg_2 = arg_0.func_from_info()
        try:
            arg_3 = dict(
                task=arg_0,
                channel_message=arg_1,
            )
            arg_2(arg_3)
        finally:
            if arg_0.end_Funcning < arg_0.next_Func:
                arg_0.enabled=False
                Channel(KILL_TASK_CHANNEL).send({'id': arg_0.pk})
                return
            if arg_0.iterations == 0:
                return
            else:
                arg_0.iterations -= 1
                if arg_0.iterations == 0:
                    arg_0.enabled = False
                    Channel(KILL_TASK_CHANNEL).send({'id':arg_0.pk})
                arg_0.save()

Internal instance method run by worker process to actually run the task callable .


def Func ( arg_0 , arg_1 = None ) : arg_1 = _make_callable ( arg_1 ) arg_2 = lambda x : not arg_1 ( x ) return arg_0 . filter ( arg_2 )

def Func(arg_0, arg_1=None):
        """
        Return a new Collection excluding some items

        Parameters:

            func : function(Node) -> Scalar

                A function that, when called on each item
                in the collection, returns a boolean-like
                value. If no function is provided, then
                truthy items will be removed.

        Returns:

            A new Collection consisting of the items
            where bool(func(item)) == False
        """
        arg_1 = _make_callable(arg_1)
        arg_2 = lambda x: not arg_1(x)
        return arg_0.filter(arg_2)


Interact with cases existing in the database.

(context, case_id, institute, reruns, finished, causatives, research_requested,
          is_research, status, json)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
,
arg_9
)
:
arg_10
=
arg_0
.
obj
[
'adapter'
]
arg_11
=
[
]
if
arg_1
:
arg_12
=
arg_10
.
case
(
arg_1
=
arg_1
)
if
arg_12
:
arg_11
.
append
(
arg_12
)
else
:
LOG
.
info
(
"No case with id {}"
.
format
(
arg_1
)
)
else
:
arg_11
=
arg_10
.
Func
(
collaborator
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
has_causatives
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_8
=
arg_8
)
arg_11
=
[
arg_12
for
arg_12
in
arg_11
]
if
len
(
arg_11
)
==
0
:
LOG
.
info
(
"No Func could be found"
)
if
arg_9
:
click
.
echo
(
dumps
(
arg_11
)
)
return
for
arg_13
in
arg_11
:
pp
(
arg_13
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6,
          arg_7, arg_8, arg_9):
    """Interact with Func existing in the database."""
    arg_10 = arg_0.obj['adapter']

    arg_11 = []
    if arg_1:
        arg_12 = arg_10.case(arg_1=arg_1)
        if arg_12:
            arg_11.append(arg_12)
        else:
            LOG.info("No case with id {}".format(arg_1))

    else:
        arg_11 = arg_10.Func(collaborator=arg_2, arg_3=arg_3,
                           arg_4=arg_4, has_causatives=arg_5,
                           arg_6=arg_6,
                           arg_7=arg_7, arg_8=arg_8)
        arg_11 = [arg_12 for arg_12 in arg_11]
        if len(arg_11) == 0:
            LOG.info("No Func could be found")

    if arg_9:
        click.echo(dumps(arg_11))
        return

    for arg_13 in arg_11:
        pp(arg_13)

Interact with cases existing in the database .


return render_template(
        'invenio_groups/pending.html',
        memberships=memberships,
        requests=True,
        page=page,
        per_page=per_page,
    )

def Func ( ) : arg_0 = request . args . get ( 'page' , 1 , type = int ) arg_1 = request . args . get ( 'per_page' , 5 , type = int ) arg_2 = Membership . query_Func ( current_user , eager = True ) . all ( ) return render_template ( 'invenio_groups/pending.html' , arg_2 = arg_2 , Func = True , arg_0 = arg_0 , arg_1 = arg_1 , )

def Func():
    """List all pending memberships, listed only for group admins."""
    arg_0 = request.args.get('page', 1, type=int)
    arg_1 = request.args.get('per_page', 5, type=int)
    arg_2 = Membership.query_Func(current_user, eager=True).all()

    return render_template(
        'invenio_groups/pending.html',
        arg_2=arg_2,
        Func=True,
        arg_0=arg_0,
        arg_1=arg_1,
    )

List all pending memberships listed only for group admins .


def Func ( arg_0 ) : arg_1 = None arg_2 = None if not google_v2_operations . is_done ( arg_0 . _op ) : arg_3 = google_v2_operations . get_last_event ( arg_0 . _op ) if arg_3 : arg_1 = arg_3 [ 'description' ] arg_4 = arg_3 . get ( 'details' , { } ) . get ( 'actionId' ) if arg_4 : arg_2 = google_v2_operations . get_action_by_id ( arg_0 . _op , arg_4 ) else : arg_1 = 'Pending' else : arg_5 = google_v2_operations . get_failed_events ( arg_0 . _op ) if arg_5 : arg_6 = arg_5 [ - 1 ] arg_1 = arg_6 . get ( 'details' , { } ) . get ( 'stderr' ) arg_4 = arg_6 . get ( 'details' , { } ) . get ( 'actionId' ) if arg_4 : arg_2 = google_v2_operations . get_action_by_id ( arg_0 . _op , arg_4 ) if not arg_1 : arg_7 = google_v2_operations . get_error ( arg_0 . _op ) if arg_7 : arg_1 = arg_7 [ 'message' ] else : arg_1 = 'Success' return arg_1 , arg_2

def Func(arg_0):
    """Returns the most relevant status string and failed action.

    This string is meant for display only.

    Returns:
      A printable status string and name of failed action (if any).
    """
    arg_1 = None
    arg_2 = None
    if not google_v2_operations.is_done(arg_0._op):
      arg_3 = google_v2_operations.get_last_event(arg_0._op)
      if arg_3:
        arg_1 = arg_3['description']
        arg_4 = arg_3.get('details', {}).get('actionId')
        if arg_4:
          arg_2 = google_v2_operations.get_action_by_id(arg_0._op, arg_4)
      else:
        arg_1 = 'Pending'
    else:
      arg_5 = google_v2_operations.get_failed_events(arg_0._op)
      if arg_5:
        arg_6 = arg_5[-1]
        arg_1 = arg_6.get('details', {}).get('stderr')
        arg_4 = arg_6.get('details', {}).get('actionId')
        if arg_4:
          arg_2 = google_v2_operations.get_action_by_id(arg_0._op, arg_4)
      if not arg_1:
        arg_7 = google_v2_operations.get_error(arg_0._op)
        if arg_7:
          arg_1 = arg_7['message']
        else:
          arg_1 = 'Success'

    return arg_1, arg_2

Returns the most relevant status string and failed action .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Resolve and validate auth token, returns user object."""
        try:
            arg_4, arg_5 = loads(arg_1.decode('base64'))
        except (ValueError, Error):
            arg_0.auth_failed(arg_1=arg_1)
        try:
            arg_6 = arg_0.user_model.objects.get(**{
                arg_0.user_model.USERNAME_FIELD: arg_4,
                'is_active': True,
            })
            arg_6.backend = 'django.contrib.auth.backends.ModelBackend'
        except arg_0.user_model.DoesNotExist:
            arg_0.auth_failed(arg_4=arg_4, arg_1=arg_1)
        if arg_5 not in iter_auth_hashes(arg_6, arg_2, arg_3):
            arg_0.auth_failed(arg_4=arg_4, arg_1=arg_1)
        return arg_6

Resolve and validate auth token returns user object .


def Func ( arg_0 = arg_1 ) : global arg_2 , arg_3 if arg_2 != arg_0 : arg_2 = arg_0 arg_3 = { } for arg_4 in glob ( os . path . join ( arg_0 , "*" ) ) : if os . path . isdir ( arg_4 ) : arg_5 = os . path . basename ( arg_4 ) arg_3 [ arg_5 ] = glob ( os . path . join ( arg_4 , "*" ) ) arg_3 [ arg_5 ] = [ os . path . basename ( f ) [ : - 4 ] for f in arg_3 [ arg_5 ] ] return arg_3

def Func(arg_0=arg_1):
    """
    A dictionary of all Func words.

    They keys in the dictionary correspond to subfolders in the Func cache.
    Each key has a list of words. Each of these words is the name of an XML-file
    in the subfolder. The XML-file contains color information harvested from the web
    (or handmade).
    """
    global arg_2, arg_3
    if arg_2 != arg_0:
        arg_2 = arg_0
        arg_3 = {}
        for arg_4 in glob(os.path.join(arg_0, "*")):
            if os.path.isdir(arg_4):
                arg_5 = os.path.basename(arg_4)
                arg_3[arg_5] = glob(os.path.join(arg_4, "*"))
                arg_3[arg_5] = [os.path.basename(f)[:-4] for f in arg_3[arg_5]]

    return arg_3

A dictionary of all aggregated words.

    They keys in the dictionary correspond to subfolders in the aggregated cache.
    Each key has a list of words. Each of these words is the name of an XML-file
    in the subfolder. The XML-file contains color information harvested from the web
    (or handmade).


async def Func(arg_0, arg_1, arg_2, arg_3):
        """Send output turn on command to the alarm."""
        """0x88   outputs on
              + 8 bytes - user code
              + 16/32 bytes - output list
              If function is accepted, function result can be
              checked by observe the system state """
        _LOGGER.debug("Turn on, output: %s, code: %s", arg_2, arg_1)
        while len(arg_1) < 16:
            arg_1 += 'F'

        arg_4 = bytearray.fromhex(arg_1)
        arg_5 = 0x88 if arg_3 else 0x89
        arg_6 = generate_query(arg_5.to_bytes(1, 'big') +
                              arg_4 +
                              output_bytes(arg_2))
        await arg_0._send_data(arg_6)

Send output turn on command to the alarm .


(self, algo, training_frame, parameters, timeoutSecs=60, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=60, **arg_5):
    '''
    Check a dictionary of model builder parameters on the h2o cluster
    using the given algorithm and model parameters.
    '''
    assert arg_1 is not None, '"algo" parameter is null'
    # Allow this now: assert training_frame is not None, '"training_frame" parameter is null'
    assert arg_3 is not None, '"parameters" parameter is null'

    arg_6 = arg_0.model_builders(arg_4=arg_4)
    assert arg_6 is not None, "/ModelBuilders REST call failed"
    assert arg_1 in arg_6['model_builders']
    arg_7 = arg_6['model_builders'][arg_1]

    # TODO: test this assert, I don't think this is working. . .
    if arg_2 is not None:
        arg_8 = arg_0.frames(key=arg_2)
        assert arg_8 is not None, "/Frames/{0} REST call failed".format(arg_2)

        arg_9 = arg_8['frames'][0]['key']['name']
        assert arg_9==arg_2, \
            "/Frames/{0} returned Frame {1} rather than Frame {2}".format(arg_2, arg_9, arg_2)

        arg_3['training_frame'] = arg_2

    # TODO: add parameter existence checks
    # TODO: add parameter value validation

    # FIX! why ignoreH2oError here?
    arg_10 = arg_0.do_json_request('/3/ModelBuilders.json/' + arg_1 + "/parameters", cmd='post',
        timeout=arg_4, postData=arg_3, ignoreH2oError=True, noExtraErrorCheck=True)

    verboseprint("model parameters validation: " + repr(arg_10))
    return arg_10

Check a dictionary of model builder parameters on the h2o cluster using the given algorithm and model parameters .


(values, axis=-1, direction='ASCENDING', stable=False, name=None)

return np.argsort(values, axis, kind='stable' if stable else 'quicksort')

def
Func
(
arg_0
,
arg_1
=
1
,
arg_2
=
'ASCENDING'
,
arg_3
=
False
,
arg_4
=
)
:
if
arg_2
==
'ASCENDING'
:
pass
elif
arg_2
==
'DESCENDING'
:
arg_0
=
np
.
negative
(
arg_0
)
else
:
raise
ValueError
(
'Unrecognized direction: {}.'
.
format
(
arg_2
)
)
return
np
.
argsort
(
arg_0
,
arg_1
,
kind
=
'stable'
if
arg_3
else
'quicksort'
)

def Func(arg_0, arg_1=-1, arg_2='ASCENDING', arg_3=False, arg_4=None):  # pylint: disable=unused-argument
  """Numpy implementation of `tf.argsort`."""
  if arg_2 == 'ASCENDING':
    pass
  elif arg_2 == 'DESCENDING':
    arg_0 = np.negative(arg_0)
  else:
    raise ValueError('Unrecognized direction: {}.'.format(arg_2))
  return np.argsort(arg_0, arg_1, kind='stable' if arg_3 else 'quicksort')


def Func(arg_0, arg_1, **arg_2):
        """ Creates a new style which inherits from the default style,
        or any other style which name is supplied to the optional template parameter.
        """
        if arg_1 == "default":
            arg_0[arg_1] = style(arg_1, arg_0._ctx, **arg_2)
            return arg_0[arg_1]
        arg_3 = arg_2.get("template", "default")
        arg_4 = arg_0[arg_1] = arg_0[arg_3].copy(arg_1)
        for arg_5 in arg_2:
            if arg_4.__dict__.has_key(arg_5):
                arg_4.__dict__[arg_5] = arg_2[arg_5]
        return arg_4

Creates a new style which inherits from the default style or any other style which name is supplied to the optional template parameter .


(self, beta, alpha, emit=None, emit_n=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """
        Sets the beam moments indirectly using Courant-Snyder parameters.

        Parameters
        ----------
        beta : float
            Courant-Snyder parameter :math:`\\beta`.
        alpha : float
            Courant-Snyder parameter :math:`\\alpha`.
        emit : float
            Beam emittance :math:`\\epsilon`.
        emit_n : float
            Normalized beam emittance :math:`\\gamma \\epsilon`.
        """

        arg_0._store_emit(arg_3=arg_3, arg_4=arg_4)

        arg_0._sx   = _np.sqrt(arg_1*arg_0.emit)
        arg_0._sxp  = _np.sqrt((1+arg_2**2)/arg_1*arg_0.emit)
        arg_0._sxxp = -arg_2*arg_0.emit

Sets the beam moments indirectly using Courant - Snyder parameters .


(freqCounts, title='On-Times Histogram', xLabel='On-Time')

def
Func
(
arg_0
,
arg_1
=
'On-Times Histogram'
,
arg_2
=
'On-Time'
)
:
import
pylab
pylab
.
ion
(
)
pylab
.
figure
(
)
pylab
.
bar
(
numpy
.
arange
(
len
(
arg_0
)
)
0.5
,
arg_0
)
pylab
.
title
(
arg_1
)
pylab
.
xlabel
(
arg_2
)

def Func(arg_0, arg_1='On-Times Histogram', arg_2='On-Time'):
  """
  This is usually used to display a histogram of the on-times encountered
  in a particular output.

  The freqCounts is a vector containg the frequency counts of each on-time
  (starting at an on-time of 0 and going to an on-time = len(freqCounts)-1)

  The freqCounts are typically generated from the averageOnTimePerTimestep
  or averageOnTime methods of this module.

  Parameters:
  -----------------------------------------------
  freqCounts:       The frequency counts to plot
  title:            Title of the plot

  """

  import pylab
  pylab.ion()
  pylab.figure()
  pylab.bar(numpy.arange(len(arg_0)) - 0.5, arg_0)
  pylab.title(arg_1)
  pylab.xlabel(arg_2)

This is usually used to display a histogram of the on - times encountered in a particular output .


def Func ( arg_0 ) : arg_1 = type ( env ) ( ) for arg_2 , arg_3 in six . iteritems ( env ) : if arg_2 . startswith ( arg_0 . name + '_' ) : arg_1 [ arg_2 [ arg_4 ( arg_0 . name ) + 1 : ] ] = arg_3 return arg_1

def Func(arg_0):
        """
        Returns a version of env filtered to only include the variables in our namespace.
        """
        arg_1 = type(env)()
        for arg_2, arg_3 in six.iteritems(env):
            if arg_2.startswith(arg_0.name+'_'):
                arg_1[arg_2[arg_4(arg_0.name)+1:]] = arg_3
        return arg_1

Returns a version of env filtered to only include the variables in our namespace .


def Func ( arg_0 , arg_1 = None ) : for arg_2 in arg_0 . assets . values ( ) : if arg_2 . has_bundles ( ) : arg_2 . collect_files ( ) if arg_1 is None : arg_1 = arg_0 . config . env if arg_1 == static_bundle . ENV_PRODUCTION : arg_0 . _minify ( emulate = True ) arg_0 . _add_url_prefix ( )

def Func(arg_0, arg_1=None):
        """
        Return links without build files
        """
        for arg_2 in arg_0.assets.values():
            if arg_2.has_bundles():
                arg_2.collect_files()
        if arg_1 is None:
            arg_1 = arg_0.config.env
        if arg_1 == static_bundle.ENV_PRODUCTION:
            arg_0._minify(emulate=True)
        arg_0._add_url_prefix()


def Func(arg_0, arg_1=None):
        """
        Runs the command passing in the parsed arguments.

        :param args: The arguments to Func the command with. If ``None`` the arguments
            are gathered from the argument parser. This is automatically set when calling
            sub commands and in most cases should not be set for the root command.

        :return: The status code of the action (0 on success)
        """
        arg_1 = arg_1 or arg_0.parse_args()

        arg_2 = getattr(arg_1, arg_0.sub_parser_dest_name, None)
        if arg_2:
            arg_3 = arg_0.get_sub_commands()
            arg_4 = arg_3[arg_2]
            return arg_4(arg_2).Func(arg_1)

        return arg_0.action(arg_1) or 0

Runs the command passing in the parsed arguments.

        :param args: The arguments to run the command with. If ``None`` the arguments
            are gathered from the argument parser. This is automatically set when calling
            sub commands and in most cases should not be set for the root command.

        :return: The status code of the action (0 on success)

Runs the command passing in the parsed arguments .


def Func ( arg_0 ) : arg_1 = "URL" if arg_0 . catched . lower ( ) not in PyFunceble . STATUS [ "list" ] [ "invalid" ] : Generate ( arg_0 . catched , arg_1 ) . status_file ( ) else : Generate ( arg_0 . catched , "SYNTAX" ) . status_file ( ) return arg_0 . catched

def Func(arg_0):
        """
        Handle the backend of the given status.
        """

        # We initiate the source we are going to parse to the Generate class.
        arg_1 = "URL"

        if arg_0.catched.lower() not in PyFunceble.STATUS["list"]["invalid"]:
            # The parsed status is not in the list of invalid.

            # We generate the status file with the catched status.
            Generate(arg_0.catched, arg_1).status_file()
        else:
            # The parsed status is in the list of invalid.

            # We generate the status file with the parsed status.
            Generate(arg_0.catched, "SYNTAX").status_file()

        # We return the parsed status.
        return arg_0.catched

Handle the backend of the given status .


return self.query.filter(SymbolMap.in_symbol == symbol).first()

def Func ( arg_0 , arg_1 : arg_2 ) -> SymbolMap : return arg_0 . query . filter ( SymbolMap . in_symbol == arg_1 ) . first ( )

def Func(arg_0, arg_1: arg_2) -> SymbolMap:
        """ Finds the map by in-symbol """
        return arg_0.query.filter(SymbolMap.in_symbol == arg_1).first()


def Func(arg_0, arg_1, arg_2):
        ''' Returns all of the items from queryset where the user has a
        product from a category invoking that item's condition in one of their
        carts. '''

        arg_3 = Q(
            enabling_category__product__productitem__cart__user=arg_2
        )
        arg_4 = commerce.Cart.STATUS_RELEASED
        arg_5 = Q(
            enabling_category__product__productitem__cart__status=arg_4
        )
        arg_1 = arg_1.filter(arg_3)
        arg_1 = arg_1.exclude(arg_5)

        return arg_1

Returns all of the items from queryset where the user has a product from a category invoking that item s condition in one of their carts .


(
    normal_loc, normal_scale, quadrature_size,
    validate_args=False, name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = None ) : with tf . name_scope ( arg_4 or "Func" ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_4 = "normal_loc" ) arg_5 = dtype_util . as_numpy_dtype ( arg_0 . dtype ) arg_1 = tf . convert_to_tensor ( value = arg_1 , dtype = arg_5 , arg_4 = "normal_scale" ) arg_1 = maybe_check_quadrature_param ( arg_1 , "normal_scale" , arg_3 ) arg_6 , arg_7 = np . polynomial . hermite . hermgauss ( deg = arg_2 ) arg_6 = arg_6 . astype ( arg_5 ) arg_7 = arg_7 . astype ( arg_5 ) arg_7 /= np . linalg . norm ( arg_7 , ord = 1 , keepdims = True ) arg_7 = tf . convert_to_tensor ( value = arg_7 , arg_4 = "probs" , dtype = arg_5 ) arg_6 = softmax ( - distribution_util . pad ( ( arg_0 [ ... , tf . newaxis ] + np . sqrt ( 2. ) * arg_1 [ ... , tf . newaxis ] * arg_6 ) , axis = - 2 , front = True ) , axis = - 2 ) return arg_6 , arg_7

def Func(
    arg_0, arg_1, arg_2,
    arg_3=False, arg_4=None):
  """Use Gauss-Hermite quadrature to form quadrature on `K - 1` simplex.

  A `SoftmaxNormal` random variable `Y` may be generated via

  ```
  Y = SoftmaxCentered(X),
  X = Normal(normal_loc, normal_scale)
  ```

  Note: for a given `quadrature_size`, this method is generally less accurate
  than `quadrature_scheme_softmaxnormal_quantiles`.

  Args:
    normal_loc: `float`-like `Tensor` with shape `[b1, ..., bB, K-1]`, B>=0.
      The location parameter of the Normal used to construct the SoftmaxNormal.
    normal_scale: `float`-like `Tensor`. Broadcastable with `normal_loc`.
      The scale parameter of the Normal used to construct the SoftmaxNormal.
    quadrature_size: Python `int` scalar representing the number of quadrature
      points.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    name: Python `str` name prefixed to Ops created by this class.

  Returns:
    grid: Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
      convex combination of affine parameters for `K` components.
      `grid[..., :, n]` is the `n`-th grid point, living in the `K - 1` simplex.
    probs:  Shape `[b1, ..., bB, K, quadrature_size]` `Tensor` representing the
      associated with each grid point.
  """
  with tf.name_scope(
      arg_4 or "Func"):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_4="normal_loc")
    arg_5 = dtype_util.as_numpy_dtype(arg_0.dtype)
    arg_1 = tf.convert_to_tensor(
        value=arg_1, dtype=arg_5, arg_4="normal_scale")

    arg_1 = maybe_check_quadrature_param(
        arg_1, "normal_scale", arg_3)

    arg_6, arg_7 = np.polynomial.hermite.hermgauss(deg=arg_2)
    arg_6 = arg_6.astype(arg_5)
    arg_7 = arg_7.astype(arg_5)
    arg_7 /= np.linalg.norm(arg_7, ord=1, keepdims=True)
    arg_7 = tf.convert_to_tensor(value=arg_7, arg_4="probs", dtype=arg_5)

    arg_6 = softmax(
        -distribution_util.pad(
            (arg_0[..., tf.newaxis] +
             np.sqrt(2.) * arg_1[..., tf.newaxis] * arg_6),
            axis=-2,
            front=True),
        axis=-2)  # shape: [B, components, deg]

    return arg_6, arg_7

Use Gauss - Hermite quadrature to form quadrature on K - 1 simplex .


(job, vcf_id, filter_name, filter_expression, ref_fasta, ref_fai, ref_dict)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Filters VCF file using GATK VariantFiltration. Fixes extra pair of quotation marks in VCF header that
    may interfere with other VCF tools.

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str vcf_id: FileStoreID for input VCF file
    :param str filter_name: Name of filter for VCF header
    :param str filter_expression: JEXL filter expression
    :param str ref_fasta: FileStoreID for reference genome fasta
    :param str ref_fai: FileStoreID for reference genome index file
    :param str ref_dict: FileStoreID for reference genome sequence dictionary file
    :return: FileStoreID for filtered VCF file
    :rtype: str
    """
    arg_7 = {'genome.fa': arg_4,
              'genome.fa.fai': arg_5,
              'genome.dict': arg_6,
              'input.vcf': arg_1}

    arg_8 = arg_0.fileStore.getLocalTempDir()
    for arg_9, arg_10 in arg_7.iteritems():
        arg_0.fileStore.readGlobalFile(arg_10, os.path.join(arg_8, arg_9))

    arg_11 = ['-T', 'VariantFiltration',
               '-R', 'genome.fa',
               '-V', 'input.vcf',
               '--filterName', arg_2,   # Documents filter name in header
               '--filterExpression', arg_3,
               '-o', 'filtered_variants.vcf']

    arg_0.fileStore.logToMaster('Running GATK VariantFiltration using {name}: '
                              '{expression}'.format(arg_9=arg_2, expression=arg_3))

    arg_12 = ['--rm', 'log-driver', 'none',
                         '-e', 'JAVA_OPTS=-Djava.io.tmpdir=/data/ -Xmx{}'.format(arg_0.memory)]
    dockerCall(arg_0=arg_0, workDir=arg_8,
               parameters=arg_11,
               tool='quay.io/ucsc_cgl/gatk:3.5--dba6dae49156168a909c43330350c6161dc7ecc2',
               dockerParameters=arg_12)

    # Remove extra quotation marks around filter expression.
    arg_13 = os.path.join(arg_8, 'filtered_variants.vcf')
    arg_14 = os.path.join(arg_8, 'fixed_header.vcf')
    arg_15 = re.escape('"%s"' % arg_3)
    with open(arg_13, 'r') as f, open(arg_14, 'w') as g:
        for arg_16 in f:
            g.write(re.sub(arg_15, arg_3, arg_16))

    return arg_0.fileStore.writeGlobalFile(arg_14)

Filters VCF file using GATK VariantFiltration . Fixes extra pair of quotation marks in VCF header that may interfere with other VCF tools .


(times, mags, errs, period,
                           magsarefluxes=False,
                           sigclip=10.0,
                           perioddeltapercent=10,
                           nphasebins=200,
                           mintransitduration=0.01,
                           maxtransitduration=0.4,
                           ingressdurationfraction=0.1,
                           verbose=True)

def Func(arg_0, arg_1, arg_2, arg_3,
                           arg_4=False,
                           arg_5=10.0,
                           arg_6=10,
                           arg_7=200,
                           arg_8=0.01,
                           arg_9=0.4,
                           arg_10=0.1,
                           arg_11=True):
    '''This calculates the SNR, depth, duration, a refit period, and time of
    center-transit for a single period.

    The equation used for SNR is::

        SNR = (transit model depth / RMS of LC with transit model subtracted)
              * sqrt(number of points in transit)

    NOTE: you should set the kwargs `sigclip`, `nphasebins`,
    `mintransitduration`, `maxtransitduration` to what you used for an initial
    BLS run to detect transits in the input light curve to match those input
    conditions.

    Parameters
    ----------

    times,mags,errs : np.array
        These contain the magnitude/flux time-series and any associated errors.

    period : float
        The period to search around and refit the transits. This will be used to
        calculate the start and end periods of a rerun of BLS to calculate the
        stats.

    magsarefluxes : bool
        Set to True if the input measurements in `mags` are actually fluxes and
        not magnitudes.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    perioddeltapercent : float
        The fraction of the period provided to use to search around this
        value. This is a percentage. The period range searched will then be::

            [period - (perioddeltapercent/100.0)*period,
             period + (perioddeltapercent/100.0)*period]

    nphasebins : int
        The number of phase bins to use in the BLS run.

    mintransitduration : float
        The minimum transit duration in phase to consider.

    maxtransitduration : float
        The maximum transit duration to consider.

    ingressdurationfraction : float
        The fraction of the transit duration to use to generate an initial value
        of the transit ingress duration for the BLS model refit. This will be
        fit by this function.

    verbose : bool
        If True, will indicate progress and any problems encountered.

    Returns
    -------

    dict
        A dict of the following form is returned::

            {'period': the refit best period,
             'epoch': the refit epoch (i.e. mid-transit time),
             'snr':the SNR of the transit,
             'transitdepth':the depth of the transit,
             'transitduration':the duration of the transit,
             'nphasebins':the input value of nphasebins,
             'transingressbin':the phase bin containing transit ingress,
             'transegressbin':the phase bin containing transit egress,
             'blsmodel':the full BLS model used along with its parameters,
             'subtractedmags':BLS model - phased light curve,
             'phasedmags':the phase light curve,
             'phases': the phase values}

    '''

    # get rid of nans first and sigclip
    arg_12, arg_13, arg_14 = sigclip_magseries(arg_0,
                                             arg_1,
                                             arg_2,
                                             arg_4=arg_4,
                                             arg_5=arg_5)

    # make sure there are enough points to calculate a spectrum
    if len(arg_12) > 9 and len(arg_13) > 9 and len(arg_14) > 9:

        # get the period interval
        arg_15 = arg_3 - arg_6*arg_3/100.0

        if arg_15 < 0:
            arg_15 = arg_3

        arg_16 = arg_3 + arg_6*arg_3/100.0

        # rerun BLS in serial mode around the specified period to get the
        # transit depth, duration, ingress and egress bins
        arg_17 = bls_serial_pfind(arg_12, arg_13, arg_14,
                                  arg_11=arg_11,
                                  arg_15=arg_15,
                                  arg_16=arg_16,
                                  arg_7=arg_7,
                                  arg_8=arg_8,
                                  arg_9=arg_9,
                                  arg_4=arg_4,
                                  get_stats=False,
                                  arg_5=None)

        if (not arg_17 or
            'blsresult' not in arg_17 or
            arg_17['blsresult'] is None):
            LOGERROR("BLS failed during a period-search "
                     "performed around the input best period: %.6f. "
                     "Can't continue. " % arg_3)
            return None

        arg_18 = arg_17['blsresult']['transdepth']
        arg_19 = arg_17['blsresult']['transduration']
        arg_20 = arg_17['bestperiod']
        arg_21 = arg_17['blsresult']['transingressbin']
        arg_22 = arg_17['blsresult']['transegressbin']
        arg_23 = arg_7

        arg_24 = _get_bls_stats(arg_12,
                               arg_13,
                               arg_14,
                               arg_18,
                               arg_19,
                               arg_10,
                               arg_7,
                               arg_21,
                               arg_22,
                               arg_20,
                               arg_23,
                               arg_4=arg_4,
                               arg_11=arg_11)

        return arg_24

    # if there aren't enough points in the mag series, bail out
    else:

        LOGERROR('no good detections for these times and mags, skipping...')
        return None

This calculates the SNR depth duration a refit period and time of center - transit for a single period .


return dict(institute=institute_obj, case=case_obj, format='html', **data)

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = institute_and_case ( store , arg_0 , arg_1 ) arg_4 = controllers . Func_content ( store , arg_2 , arg_3 ) return dict ( institute = arg_2 , case = arg_3 , format = 'html' , ** arg_4 )

def Func(arg_0, arg_1):
    """Visualize case report"""
    arg_2, arg_3 = institute_and_case(store, arg_0, arg_1)
    arg_4 = controllers.Func_content(store, arg_2, arg_3)
    return dict(institute=arg_2, case=arg_3, format='html', **arg_4)


def Func ( arg_0 ) : arg_1 = split_all ( arg_0 ) def get_assemblies ( ) : for arg_2 in range ( len ( arg_1 ) , 0 , - 1 ) : arg_3 = arg_1 [ : arg_2 ] arg_4 = arg_1 [ arg_2 : ] or [ '' ] yield ( os . path . join ( * arg_3 ) , posixpath . join ( * arg_4 ) ) for arg_5 , arg_6 in get_assemblies ( ) : if os . path . isfile ( arg_5 ) : return arg_5 , arg_6

def Func(arg_0):
	"""
	Given a path to a part in a zip file, return a path to the file and
	the path to the part.

	Assuming /foo.zipx exists as a file,

	>>> Func('/foo.zipx/dir/part') # doctest: +SKIP
	('/foo.zipx', '/dir/part')

	>>> Func('/foo.zipx') # doctest: +SKIP
	('/foo.zipx', '')
	"""
	arg_1 = split_all(arg_0)

	def get_assemblies():
		"""
		Enumerate the various combinations of file paths and part paths
		"""
		for arg_2 in range(len(arg_1), 0, -1):
			arg_3 = arg_1[:arg_2]
			arg_4 = arg_1[arg_2:] or ['']
			yield (os.path.join(*arg_3), posixpath.join(*arg_4))
	for arg_5, arg_6 in get_assemblies():
		if os.path.isfile(arg_5):
			return arg_5, arg_6

Given a path to a part in a zip file, return a path to the file and
	the path to the part.

	Assuming /foo.zipx exists as a file,

	>>> find_file('/foo.zipx/dir/part') # doctest: +SKIP
	('/foo.zipx', '/dir/part')

	>>> find_file('/foo.zipx') # doctest: +SKIP
	('/foo.zipx', '')

Given a path to a part in a zip file return a path to the file and the path to the part .


def Func ( arg_0 = None , arg_1 = None ) : arg_2 = 2 if arg_0 is None : arg_0 = [ ] if arg_1 is None : arg_1 = [ ] for arg_3 in arg_0 : if not Index ( arg_3 ) . exists ( ) : continue arg_4 = Index ( arg_3 ) arg_5 = "doc" arg_6 = "published_policy.fo" arg_7 = "fo" arg_8 = arg_4 . get_field_mapping ( fields = [ arg_6 ] ) arg_8 = arg_8 [ list ( arg_8 . keys ( ) ) [ 0 ] ] [ "mappings" ] if arg_5 not in arg_8 : continue arg_8 = arg_8 [ arg_5 ] [ arg_6 ] [ "mapping" ] [ arg_7 ] arg_9 = arg_8 [ "type" ] if arg_9 == "long" : arg_10 = "{0}-v{1}" . format ( arg_3 , arg_2 ) arg_11 = { "properties" : { "published_policy.fo" : { "type" : "text" , "fields" : { "keyword" : { "type" : "keyword" , "ignore_above" : 256 } } } } } Index ( arg_10 ) . create ( ) Index ( arg_10 ) . put_mapping ( doc_type = arg_5 , arg_11 = arg_11 ) reindex ( connections . get_connection ( ) , arg_3 , arg_10 ) Index ( arg_3 ) . delete ( ) for arg_12 in arg_1 : pass

def Func(arg_0=None, arg_1=None):
    """
    Updates index mappings

    Args:
        aggregate_indexes (list): A list of aggregate index names
        forensic_indexes (list): A list of forensic index names
    """
    arg_2 = 2
    if arg_0 is None:
        arg_0 = []
    if arg_1 is None:
        arg_1 = []
    for arg_3 in arg_0:
        if not Index(arg_3).exists():
            continue
        arg_4 = Index(arg_3)
        arg_5 = "doc"
        arg_6 = "published_policy.fo"
        arg_7 = "fo"
        arg_8 = arg_4.get_field_mapping(fields=[arg_6])
        arg_8 = arg_8[list(arg_8.keys())[0]]["mappings"]
        if arg_5 not in arg_8:
            continue

        arg_8 = arg_8[arg_5][arg_6]["mapping"][arg_7]
        arg_9 = arg_8["type"]
        if arg_9 == "long":
            arg_10 = "{0}-v{1}".format(arg_3, arg_2)
            arg_11 = {"properties": {"published_policy.fo": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "type": "keyword",
                        "ignore_above": 256
                    }
                }
            }
            }
            }
            Index(arg_10).create()
            Index(arg_10).put_mapping(doc_type=arg_5, arg_11=arg_11)
            reindex(connections.get_connection(), arg_3,
                    arg_10)
            Index(arg_3).delete()

    for arg_12 in arg_1:
        pass


Thunk to load the real StringIO on demand

def Func ( * arg_0 , ** arg_1 ) : global Func try : from cFunc import Func except ImportError : from Func import Func return Func ( * arg_0 , ** arg_1 )

def Func(*arg_0, **arg_1):
    """Thunk to load the real Func on demand"""
    global Func
    try:
        from cFunc import Func
    except ImportError:
        from Func import Func
    return Func(*arg_0,**arg_1)


(cls, path, concrete_start='', **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
,
**
arg_3
)
:
try
:
return
arg_0
(
_make_Func
(
arg_1
,
arg_2
)
,
**
arg_3
)
except
KeyError
:
raise
Exception
(
f'Invalid binary: {path}'
)

def Func(arg_0, arg_1, arg_2='', **arg_3):
        """
        Constructor for Decree binary analysis.

        :param str path: Path to binary to analyze
        :param str concrete_start: Concrete stdin to use before symbolic input
        :param kwargs: Forwarded to the Manticore constructor
        :return: Manticore instance, initialized with a Decree State
        :rtype: Manticore
        """
        try:
            return arg_0(_make_Func(arg_1, arg_2), **arg_3)
        except KeyError:  # FIXME(mark) magic parsing for DECREE should raise better error
            raise Exception(f'Invalid binary: {path}')

Constructor for Decree binary analysis .


def Func(arg_0, arg_1, arg_2=None):
        """ Parses a response.

        Args:
            text (str): Text to Func

        Kwargs:
            key (str): Key to look for, if any

        Returns:
            Parsed value

        Raises:
            ValueError
        """
        try:
            arg_3 = json.loads(arg_1)
        except ValueError as e:
            raise ValueError("%s: Value: [%s]" % (e, arg_1))

        if arg_3 and arg_2:
            if arg_2 not in arg_3:
                raise ValueError("Invalid response (key %s not found): %s" % (arg_2, arg_3))
            arg_3 = arg_3[arg_2]
        return arg_3

Parses a response.

        Args:
            text (str): Text to parse

        Kwargs:
            key (str): Key to look for, if any

        Returns:
            Parsed value

        Raises:
            ValueError


def Func ( arg_0 , arg_1 , arg_2 ) : def key ( arg_3 ) : return arg_3 . _get_attrib ( arg_2 , convert_to_str = True ) return sorted ( arg_1 , key = key )

def Func(arg_0, arg_1, arg_2):
        """
        Sorts a list of entries by the given attribute.
        """
        def key(arg_3):
            return arg_3._get_attrib(arg_2, convert_to_str=True)
        return sorted(arg_1, key=key)

Sorts a list of entries by the given attribute .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = multiprocessing . Manager ( ) arg_4 = arg_3 . dict ( ) arg_5 = ProcessWithException ( arg_4 , target = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 ) arg_5 . start ( ) arg_5 . join ( ) arg_6 = arg_5 . exception if arg_6 : raise arg_6 return arg_5 . output

def Func(arg_0, *arg_1, **arg_2):
    """Runs function in separate process.

    This function is used instead of a decorator, since Python multiprocessing
    module can't serialize decorated function on all platforms.
    """
    arg_3 = multiprocessing.Manager()
    arg_4 = arg_3.dict()
    arg_5 = ProcessWithException(
        arg_4, target=arg_0, arg_1=arg_1, arg_2=arg_2)
    arg_5.start()
    arg_5.join()
    arg_6 = arg_5.exception
    if arg_6:
        raise arg_6
    return arg_5.output


def Func ( arg_0 ) : [ Func_course_relationship ( arg_1 ) for arg_1 in internal . OrganizationCourse . objects . filter ( organization_id = arg_0 . id , active = True ) ] [ _inactivate_record ( arg_1 ) for arg_1 in internal . Organization . objects . filter ( id = arg_0 . id , active = True ) ]

def Func(arg_0):
    """
    Inactivates an activated organization as well as any active relationships
    """
    [Func_course_relationship(arg_1) for arg_1
     in internal.OrganizationCourse.objects.filter(organization_id=arg_0.id, active=True)]

    [_inactivate_record(arg_1) for arg_1
     in internal.Organization.objects.filter(id=arg_0.id, active=True)]


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = int ( arg_1 / 2 ) arg_4 = int ( arg_0 / 2 ) arg_5 = ( random . randint ( 0 , int ( arg_2 * arg_4 ) ) , random . randint ( 0 , int ( arg_2 * arg_3 ) ) ) arg_6 = ( random . randint ( arg_0 - int ( arg_2 * arg_4 ) - 1 , arg_0 - 1 ) , random . randint ( 0 , int ( arg_2 * arg_3 ) ) ) arg_7 = ( random . randint ( arg_0 - int ( arg_2 * arg_4 ) - 1 , arg_0 - 1 ) , random . randint ( arg_1 - int ( arg_2 * arg_3 ) - 1 , arg_1 - 1 ) ) arg_8 = ( random . randint ( 0 , int ( arg_2 * arg_4 ) ) , random . randint ( arg_1 - int ( arg_2 * arg_3 ) - 1 , arg_1 - 1 ) ) arg_9 = [ ( 0 , 0 ) , ( arg_0 - 1 , 0 ) , ( arg_0 - 1 , arg_1 - 1 ) , ( 0 , arg_1 - 1 ) ] arg_10 = [ arg_5 , arg_6 , arg_7 , arg_8 ] return arg_9 , arg_10

def Func(arg_0, arg_1, arg_2):
        """Get parameters for ``perspective`` for a random perspective transform.

        Args:
            width : width of the image.
            height : height of the image.

        Returns:
            List containing [top-left, top-right, bottom-right, bottom-left] of the orignal image,
            List containing [top-left, top-right, bottom-right, bottom-left] of the transformed image.
        """
        arg_3 = int(arg_1 / 2)
        arg_4 = int(arg_0 / 2)
        arg_5 = (random.randint(0, int(arg_2 * arg_4)),
                   random.randint(0, int(arg_2 * arg_3)))
        arg_6 = (random.randint(arg_0 - int(arg_2 * arg_4) - 1, arg_0 - 1),
                    random.randint(0, int(arg_2 * arg_3)))
        arg_7 = (random.randint(arg_0 - int(arg_2 * arg_4) - 1, arg_0 - 1),
                    random.randint(arg_1 - int(arg_2 * arg_3) - 1, arg_1 - 1))
        arg_8 = (random.randint(0, int(arg_2 * arg_4)),
                   random.randint(arg_1 - int(arg_2 * arg_3) - 1, arg_1 - 1))
        arg_9 = [(0, 0), (arg_0 - 1, 0), (arg_0 - 1, arg_1 - 1), (0, arg_1 - 1)]
        arg_10 = [arg_5, arg_6, arg_7, arg_8]
        return arg_9, arg_10

Get parameters for perspective for a random perspective transform .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . get_form_class ( ) arg_5 = arg_0 . get_form ( arg_4 ) arg_6 = arg_0 . get_initial ( ) [ 'mongo_id' ] for arg_7 in arg_5 . data . getlist ( 'mongo_id' ) : for arg_8 in arg_6 : if arg_7 == arg_8 : arg_0 . document . objects . get ( pk = arg_8 ) . delete ( ) return arg_0 . form_invalid ( arg_5 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Creates new mongoengine records."""
        # TODO - make sure to check the rights of the Funcer
        #self.get_queryset() # TODO - write something that grabs the document class better
        arg_4 = arg_0.get_form_class()
        arg_5 = arg_0.get_form(arg_4)
        arg_6 = arg_0.get_initial()['mongo_id']
        for arg_7 in arg_5.data.getlist('mongo_id'):
            for arg_8 in arg_6:
                if arg_7 == arg_8:
                    arg_0.document.objects.get(pk=arg_8).delete()

        return arg_0.form_invalid(arg_5)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
try
:
arg_0
.
channel
=
arg_0
.
ssh
.
get_transport
(
)
.
open_session
(
)
except
paramiko
.
SSHException
as
e
:
arg_0
.
unknown
(
"Create channel error: %s"
%
e
)
try
:
arg_0
.
channel
.
settimeout
(
arg_0
.
args
.
timeout
if
not
arg_2
else
arg_2
)
except
socket
.
timeout
as
e
:
arg_0
.
unknown
(
"Settimeout for channel error: %s"
%
e
)
try
:
arg_0
.
logger
.
debug
(
"command: {}"
.
format
(
arg_1
)
)
arg_0
.
channel
.
exec_command
(
arg_1
)
except
paramiko
.
SSHException
as
e
:
arg_0
.
unknown
(
"Execute command error: %s"
%
e
)
try
:
arg_0
.
stdin
=
arg_0
.
channel
.
makefile
(
'wb'
,
1
)
arg_0
.
stderr
=
map
(
string
.
strip
,
arg_0
.
channel
.
makefile_stderr
(
'rb'
,
1
)
.
readlines
(
)
)
arg_0
.
stdout
=
map
(
string
.
strip
,
arg_0
.
channel
.
makefile
(
'rb'
,
1
)
.
readlines
(
)
)
except
Exception
as
e
:
arg_0
.
unknown
(
"Get result error: %s"
%
e
)
try
:
arg_0
.
status
=
arg_0
.
channel
.
recv_exit_status
(
)
except
paramiko
.
SSHException
as
e
:
arg_0
.
unknown
(
"Get return code error: %s"
%
e
)
else
:
if
arg_0
.
status
!=
0
:
arg_0
.
unknown
(
"Return code: %d , stderr: %s"
%
(
arg_0
.
status
,
arg_0
.
errors
)
)
else
:
return
arg_0
.
stdout
finally
:
arg_0
.
logger
.
debug
(
"Execute command finish."
)

def Func(arg_0, arg_1, arg_2=None):
        """Execute a shell command."""
        try:
            arg_0.channel = arg_0.ssh.get_transport().open_session()
        except paramiko.SSHException as e:
            arg_0.unknown("Create channel error: %s" % e)
        try:
            arg_0.channel.settimeout(arg_0.args.timeout if not arg_2 else arg_2)
        except socket.timeout as e:
            arg_0.unknown("Settimeout for channel error: %s" % e)
        try:
            arg_0.logger.debug("command: {}".format(arg_1))
            arg_0.channel.exec_command(arg_1)
        except paramiko.SSHException as e:
            arg_0.unknown("Execute command error: %s" % e)
        try:
            arg_0.stdin = arg_0.channel.makefile('wb', -1)
            arg_0.stderr = map(string.strip, arg_0.channel.makefile_stderr('rb', -1).readlines())
            arg_0.stdout = map(string.strip, arg_0.channel.makefile('rb', -1).readlines())
        except Exception as e:
            arg_0.unknown("Get result error: %s" % e)
        try:
            arg_0.status = arg_0.channel.recv_exit_status()
        except paramiko.SSHException as e:
            arg_0.unknown("Get return code error: %s" % e)
        else:
            if arg_0.status != 0:
                arg_0.unknown("Return code: %d , stderr: %s" % (arg_0.status, arg_0.errors))
            else:
                return arg_0.stdout
        finally:
            arg_0.logger.debug("Execute command finish.")


def Func ( arg_0 ) : if os . path . isabs ( arg_0 ) and os . path . isfile ( arg_0 ) : return arg_0 else : return os . path . join ( os . getcwd ( ) , arg_0 )

def Func(arg_0):
        """
        Return a valid absolute path. filename can be relative or absolute.
        """
        if os.path.isabs(arg_0) and os.path.isfile(arg_0):
            return arg_0
        else:
            return os.path.join(os.getcwd(), arg_0)

Return a valid absolute path . filename can be relative or absolute .


def Func ( arg_0 ) : if not arg_0 . _Func : arg_0 . _Func = Funclocal . get_localzone ( ) . zone return arg_0 . _Func

def Func(arg_0):
        """Return the timezone. If none is set use system timezone"""
        if not arg_0._Func:
            arg_0._Func = Funclocal.get_localzone().zone
        return arg_0._Func

Return the timezone . If none is set use system timezone


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
type
(
arg_0
.
_ARCHIVE_REV_B
)
is
bool
:
return
arg_0
.
_ARCHIVE_REV_B
arg_3
=
ArchiveBStruct
.
unpack_from
(
arg_1
,
arg_2
)
if
arg_3
[
'RecType'
]
==
0
:
log
.
info
(
'detected archive rev. B'
)
arg_0
.
_ARCHIVE_REV_B
=
True
else
:
log
.
info
(
'detected archive rev. A'
)
arg_0
.
_ARCHIVE_REV_B
=
False
return
arg_0
.
_ARCHIVE_REV_B

def Func(arg_0, arg_1, arg_2):
        '''
        return True if weather station returns Rev.B archives
        '''
        # if pre-determined, return result
        if type(arg_0._ARCHIVE_REV_B) is bool:
            return arg_0._ARCHIVE_REV_B
        # assume, B and check 'RecType' field
        arg_3 = ArchiveBStruct.unpack_from(arg_1, arg_2)
        if arg_3['RecType'] == 0:
            log.info('detected archive rev. B')
            arg_0._ARCHIVE_REV_B = True
        else:
            log.info('detected archive rev. A')
            arg_0._ARCHIVE_REV_B = False

        return arg_0._ARCHIVE_REV_B

return True if weather station returns Rev . B archives


return str(header) if PY2 else bytes(header)

def Func ( arg_0 ) : arg_1 = bytearray ( 1 ) arg_2 = Func16Int ( arg_0 . msgId ) arg_1 [ 0 ] = 0xB0 arg_1 . extend ( FuncLength ( len ( arg_2 ) ) ) arg_1 . extend ( arg_2 ) arg_0 . Funcd = arg_1 return str ( arg_1 ) if PY2 else bytes ( arg_1 )

def Func(arg_0):
        '''
        Encode and store an UNSUBACK control packet
        '''
        arg_1    = bytearray(1)
        arg_2 = Func16Int(arg_0.msgId)
        arg_1[0] = 0xB0
        arg_1.extend(FuncLength(len(arg_2)))
        arg_1.extend(arg_2)
        arg_0.Funcd = arg_1
        return str(arg_1) if PY2 else bytes(arg_1)


def Func ( arg_0 ) : arg_1 = { 'name' : text_type ( arg_0 . __class__ . __name__ ) , 'code' : arg_0 . code , 'message' : '{0}' . format ( text_type ( arg_0 . message ) ) , 'data' : arg_0 . data } if current_app . config [ 'DEBUG' ] : import sys , traceback arg_1 [ 'stack' ] = traceback . format_exc ( ) arg_1 [ 'executable' ] = sys . executable return arg_1

def Func(arg_0):
        """Return the Exception data in a format for JSON-RPC
        """

        arg_1 = {
            'name': text_type(arg_0.__class__.__name__),
            'code': arg_0.code,
            'message': '{0}'.format(text_type(arg_0.message)),
            'data': arg_0.data
        }

        if current_app.config['DEBUG']:
            import sys, traceback
            arg_1['stack'] = traceback.format_exc()
            arg_1['executable'] = sys.executable

        return arg_1

Return the Exception data in a format for JSON - RPC


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 in arg_0 . _vowels : return True return False

def Func(arg_0, arg_1):
        """Return Porter helper function Func value.

        Parameters
        ----------
        term : str
            The word to scan for vowels

        Returns
        -------
        bool
            True iff a vowel exists in the term (as defined in the Porter
            stemmer definition)

        """
        for arg_2 in arg_1:
            if arg_2 in arg_0._vowels:
                return True
        return False

Return Porter helper function _has_vowel value.

        Parameters
        ----------
        term : str
            The word to scan for vowels

        Returns
        -------
        bool
            True iff a vowel exists in the term (as defined in the Porter
            stemmer definition)

Return Porter helper function _has_vowel value .


return (self.history_lock and
                (self._get_edited_history(self._history_index) !=
                 self.input_buffer) and
                (self._get_prompt_cursor().blockNumber() !=
                 self._get_end_cursor().blockNumber()))

def Func ( arg_0 ) : return ( arg_0 . history_lock and ( arg_0 . _get_edited_history ( arg_0 . _history_index ) != arg_0 . input_buffer ) and ( arg_0 . _get_prompt_cursor ( ) . blockNumber ( ) != arg_0 . _get_end_cursor ( ) . blockNumber ( ) ) )

def Func(arg_0):
        """ Returns whether history movement is locked.
        """
        return (arg_0.history_lock and
                (arg_0._get_edited_history(arg_0._history_index) !=
                 arg_0.input_buffer) and
                (arg_0._get_prompt_cursor().blockNumber() !=
                 arg_0._get_end_cursor().blockNumber()))

Returns whether history movement is locked .


(
            self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, custom_headers=None, raw=False, **operation_config)

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

def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=False, **arg_9):
        """Sets a secret in a specified key vault.

        The SET operation adds a secret to the Azure Key Vault. If the named
        secret already exists, Azure Key Vault creates a new version of that
        secret. This operation requires the secrets/set permission.

        :param vault_base_url: The vault name, for example
         https://myvault.vault.azure.net.
        :type vault_base_url: str
        :param secret_name: The name of the secret.
        :type secret_name: str
        :param value: The value of the secret.
        :type value: str
        :param tags: Application specific metadata in the form of key-value
         pairs.
        :type tags: dict[str, str]
        :param content_type: Type of the secret value such as a password.
        :type content_type: str
        :param secret_attributes: The secret management attributes.
        :type secret_attributes:
         ~azure.keyvault.v2016_10_01.models.SecretAttributes
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: SecretBundle or ClientRawResponse if raw=true
        :rtype: ~azure.keyvault.v2016_10_01.models.SecretBundle or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`KeyVaultErrorException<azure.keyvault.v2016_10_01.models.KeyVaultErrorException>`
        """
        arg_10 = models.SecretSetParameters(arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6)

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

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

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

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

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

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

        arg_18 = None

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

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

        return arg_18

Sets a secret in a specified key vault .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if not isinstance ( arg_1 , list ) : arg_2 = [ arg_1 ] arg_3 = arg_0 . estimator . Func ( arg_2 ) arg_3 = [ item [ 0 ] for item in arg_3 ] arg_3 = [ arg_0 . _remove_prefix ( label ) for label in arg_3 ] if not isinstance ( arg_1 , list ) : arg_3 = arg_3 [ 0 ] return arg_3

def Func(arg_0, arg_1):
        """ In order to obtain the most likely label for a list of text

        Parameters
        ----------
        X : list of string
            Raw texts

        Returns
        -------
        C : list of string
            List labels
        """
        arg_2 = arg_1
        if not isinstance(arg_1, list):
            arg_2 = [arg_1]
        arg_3 = arg_0.estimator.Func(arg_2)
        arg_3 = [item[0] for item in arg_3]
        arg_3 = [arg_0._remove_prefix(label) for label in arg_3]
        if not isinstance(arg_1, list):
            arg_3 = arg_3[0]
        return arg_3


return np.linspace(0,
                       float(sr) / 2,
                       int(1 + n_fft//2),
                       endpoint=True)

def Func ( arg_0 = 22050 , arg_1 = 2048 ) : return np . linspace ( 0 , float ( arg_0 ) / 2 , int ( 1 + arg_1 // 2 ) , endpoint = True )

def Func(arg_0=22050, arg_1=2048):
    '''Alternative implementation of `np.fft.fftfreq`

    Parameters
    ----------
    sr : number > 0 [scalar]
        Audio sampling rate

    n_fft : int > 0 [scalar]
        FFT window size

    Returns
    -------
    freqs : np.ndarray [shape=(1 + n_fft/2,)]
        Frequencies `(0, sr/n_fft, 2*sr/n_fft, ..., sr/2)`

    Examples
    --------
    >>> librosa.Func(sr=22050, n_fft=16)
    array([     0.   ,   1378.125,   2756.25 ,   4134.375,
             5512.5  ,   6890.625,   8268.75 ,   9646.875,  11025.   ])

    '''

    return np.linspace(0,
                       float(arg_0) / 2,
                       int(1 + arg_1//2),
                       endpoint=True)

Alternative implementation of `np.fft.fftfreq`

    Parameters
    ----------
    sr : number > 0 [scalar]
        Audio sampling rate

    n_fft : int > 0 [scalar]
        FFT window size

    Returns
    -------
    freqs : np.ndarray [shape=(1 + n_fft/2,)]
        Frequencies `(0, sr/n_fft, 2*sr/n_fft, ..., sr/2)`

    Examples
    --------
    >>> librosa.fft_frequencies(sr=22050, n_fft=16)
    array([     0.   ,   1378.125,   2756.25 ,   4134.375,
             5512.5  ,   6890.625,   8268.75 ,   9646.875,  11025.   ])

Alternative implementation of np . fft . fftfreq


(script, tex_name='TEMP3D_texture.png', tex_width=1024,
           tex_height=1024, overwrite_tex=False, assign_tex=False,
           fill_tex=True)

def Func(arg_0, arg_1='TEMP3D_texture.png', arg_2=1024,
           arg_3=1024, arg_4=False, arg_5=False,
           arg_6=True):
    """Transfer vertex colors to texture colors

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        tex_name (str): The texture file to be created
        tex_width (int): The texture width
        tex_height (int): The texture height
        overwrite_tex (bool): If current mesh has a texture will be overwritten (with provided texture dimension)
        assign_tex (bool): Assign the newly created texture
        fill_tex (bool): If enabled the unmapped texture space is colored using a pull push filling algorithm, if false is set to black
    """
    arg_7 = ''.join([
        '  <filter name="Vertex Color to Texture">\n',
        '    <Param name="textName" ',
        'value="%s" ' % arg_1,
        'description="Texture file" ',
        'type="RichString" ',
        '/>\n',
        '    <Param name="textW" ',
        'value="%d" ' % arg_2,
        'description="Texture width (px)" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="textH" ',
        'value="%d" ' % arg_3,
        'description="Texture height (px)" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="overwrite" ',
        'value="%s" ' % str(arg_4).lower(),
        'description="Overwrite texture" ',
        'type="RichBool" ',
        '/>\n',
        '    <Param name="assign" ',
        'value="%s" ' % str(arg_5).lower(),
        'description="Assign Texture" ',
        'type="RichBool" ',
        '/>\n',
        '    <Param name="pullpush" ',
        'value="%s" ' % str(arg_6).lower(),
        'description="Fill texture" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_7)
    return None


return [
      # Create input->hidden and hidden->hidden masks.
      inp[:, np.newaxis] <= out
      for inp, out in zip(degrees[:-1], degrees[1:])
  ] + [
      # Create hidden->output mask.
      degrees[-1][:, np.newaxis] < degrees[0]
  ]

def Func ( arg_0 ) : return [ arg_1 [ : , np . newaxis ] <= arg_2 for arg_1 , arg_2 in zip ( arg_0 [ : - 1 ] , arg_0 [ 1 : ] ) ] + [ arg_0 [ - 1 ] [ : , np . newaxis ] < arg_0 [ 0 ] ]

def Func(arg_0):
  """Returns a list of binary mask matrices enforcing autoregressivity."""
  return [
      # Create input->hidden and hidden->hidden masks.
      arg_1[:, np.newaxis] <= arg_2
      for arg_1, arg_2 in zip(arg_0[:-1], arg_0[1:])
  ] + [
      # Create hidden->output mask.
      arg_0[-1][:, np.newaxis] < arg_0[0]
  ]

Returns a list of binary mask matrices enforcing autoregressivity .


(docstring, def_lineno, code_lines, prefix)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_1
1
arg_5
=
arg_2
[
arg_4
]
arg_5
=
arg_5
.
rstrip
(
)
while
not
arg_5
.
endswith
(
':'
)
:
arg_4
+=
1
arg_5
+=
'\n'
+
arg_2
[
arg_4
]
.
rstrip
(
)
arg_5
=
textwrap
.
dedent
(
arg_5
)
.
rstrip
(
':'
)
arg_5
=
arg_5
.
replace
(
'\n'
,
'\n'
+
arg_3
)
arg_6
=
''
arg_7
=
False
arg_8
=
''
for
arg_9
in
arg_0
.
splitlines
(
)
:
if
arg_9
and
arg_9
[
0
]
==
':'
:
arg_7
=
True
if
not
arg_7
:
if
arg_6
:
arg_6
+=
'\n'
arg_6
+=
arg_9
else
:
if
arg_8
:
arg_8
+=
'\n'
arg_8
+=
arg_9
arg_6
=
arg_6
.
strip
(
)
arg_10
=
''
if
arg_6
:
arg_10
=
"%s%s"
%
(
arg_3
,
arg_6
.
replace
(
'\n'
,
'\n'
+
arg_3
)
)
arg_10
=
re
.
sub
(
'\n>(\\s+)\n'
,
'\n>\n'
,
arg_10
)
arg_8
=
arg_8
.
strip
(
)
if
arg_8
:
arg_5
+=
(
':\n%s    """\n%s    '
%
(
arg_3
,
arg_3
)
)
arg_5
+=
arg_8
.
replace
(
'\n'
,
'\n%s    '
%
arg_3
)
arg_5
+=
(
'\n%s    """'
%
arg_3
)
arg_5
=
re
.
sub
(
'\n>(\\s+)\n'
,
'\n>\n'
,
arg_5
)
for
arg_11
,
arg_12
in
definition_replacements
.
items
(
)
:
arg_5
=
arg_5
.
replace
(
arg_11
,
arg_12
)
return
(
arg_5
,
arg_10
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Extracts the function signature and description of a Python function

    :param docstring:
        A unicode string of the docstring for the function

    :param def_lineno:
        An integer line number that function was defined on

    :param code_lines:
        A list of unicode string lines from the source file the function was
        defined in

    :param prefix:
        A prefix to prepend to all output lines

    :return:
        A 2-element tuple:

         - [0] A unicode string of the function signature with a docstring of
               parameter info
         - [1] A markdown snippet of the function description
    """

    arg_4 = arg_1 - 1
    arg_5 = arg_2[arg_4]
    arg_5 = arg_5.rstrip()
    while not arg_5.endswith(':'):
        arg_4 += 1
        arg_5 += '\n' + arg_2[arg_4].rstrip()

    arg_5 = textwrap.dedent(arg_5).rstrip(':')
    arg_5 = arg_5.replace('\n', '\n' + arg_3)

    arg_6 = ''
    arg_7 = False

    arg_8 = ''

    for arg_9 in arg_0.splitlines():
        if arg_9 and arg_9[0] == ':':
            arg_7 = True
        if not arg_7:
            if arg_6:
                arg_6 += '\n'
            arg_6 += arg_9
        else:
            if arg_8:
                arg_8 += '\n'
            arg_8 += arg_9

    arg_6 = arg_6.strip()
    arg_10 = ''
    if arg_6:
        arg_10 = "%s%s" % (arg_3, arg_6.replace('\n', '\n' + arg_3))
        arg_10 = re.sub('\n>(\\s+)\n', '\n>\n', arg_10)

    arg_8 = arg_8.strip()
    if arg_8:
        arg_5 += (':\n%s    """\n%s    ' % (arg_3, arg_3))
        arg_5 += arg_8.replace('\n', '\n%s    ' % arg_3)
        arg_5 += ('\n%s    """' % arg_3)
        arg_5 = re.sub('\n>(\\s+)\n', '\n>\n', arg_5)

    for arg_11, arg_12 in definition_replacements.items():
        arg_5 = arg_5.replace(arg_11, arg_12)

    return (arg_5, arg_10)


(self, schedule, period, hour, minute, tariff)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
(
(
arg_1
not
in
range
(
Extents
.
Schedules
)
)
or
(
arg_2
not
in
range
(
Extents
.
Tariffs
)
)
or
(
arg_3
<
0
)
or
(
arg_3
>
23
)
or
(
arg_4
<
0
)
or
(
arg_4
>
59
)
or
(
arg_5
<
0
)
)
:
ekm_log
(
"Out of bounds in Schedule_"
+
str
(
arg_1
+
1
)
)
return
False
arg_2
+=
1
arg_6
=
"Min_"
+
str
(
arg_2
)
arg_7
=
"Hour_"
+
str
(
arg_2
)
arg_8
=
"Tariff_"
+
str
(
arg_2
)
if
arg_6
not
in
arg_0
.
m_schedule_params
:
ekm_log
(
"Incorrect index: "
+
arg_6
)
return
False
if
arg_7
not
in
arg_0
.
m_schedule_params
:
ekm_log
(
"Incorrect index: "
+
arg_7
)
return
False
if
arg_8
not
in
arg_0
.
m_schedule_params
:
ekm_log
(
"Incorrect index: "
+
arg_8
)
return
False
arg_0
.
m_schedule_params
[
arg_8
]
=
arg_5
arg_0
.
m_schedule_params
[
arg_7
]
=
arg_3
arg_0
.
m_schedule_params
[
arg_6
]
=
arg_4
arg_0
.
m_schedule_params
[
'Schedule'
]
=
arg_1
return
True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """ Assign one schedule tariff period to meter bufffer.

        Args:
            schedule (int): A :class:`~ekmmeters.Schedules` value or in range(Extents.Schedules).
            tariff (int): :class:`~ekmmeters.Tariffs` value or in range(Extents.Tariffs).
            hour (int): Hour from 0-23.
            minute (int): Minute from 0-59.
            tariff (int): Rate value.

        Returns:
            bool: True on completed assignment.
        """
        if ((arg_1 not in range(Extents.Schedules)) or
                (arg_2 not in range(Extents.Tariffs)) or
                (arg_3 < 0) or (arg_3 > 23) or (arg_4 < 0) or
                (arg_4 > 59) or (arg_5 < 0)):
            ekm_log("Out of bounds in Schedule_" + str(arg_1 + 1))
            return False

        arg_2 += 1
        arg_6 = "Min_" + str(arg_2)
        arg_7 = "Hour_" + str(arg_2)
        arg_8 = "Tariff_" + str(arg_2)
        if arg_6 not in arg_0.m_schedule_params:
            ekm_log("Incorrect index: " + arg_6)
            return False
        if arg_7 not in arg_0.m_schedule_params:
            ekm_log("Incorrect index: " + arg_7)
            return False
        if arg_8 not in arg_0.m_schedule_params:
            ekm_log("Incorrect index: " + arg_8)
            return False

        arg_0.m_schedule_params[arg_8] = arg_5
        arg_0.m_schedule_params[arg_7] = arg_3
        arg_0.m_schedule_params[arg_6] = arg_4
        arg_0.m_schedule_params['Schedule'] = arg_1
        return True

Assign one schedule tariff period to meter bufffer .


def Func(arg_0):
        """Revert the stack, gas, pc and memory allocation so it looks like before executing the instruction"""
        arg_1, arg_2, arg_3, arg_4, arg_5, arg_6 = arg_0._checkpoint_data
        arg_0._push_arguments(arg_4)
        arg_0._gas = arg_2
        arg_0._pc = arg_1
        arg_0._allocated = arg_6
        arg_0._checkpoint_data = None

Revert the stack gas pc and memory allocation so it looks like before executing the instruction