(spia_matrices: Dict[str, pd.DataFrame],
                         u: CentralDogma,
                         v: CentralDogma,
                         edge_data: EdgeData,
                         )

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 . DataFrame ] , arg_5 : arg_6 , arg_7 : arg_6 , arg_8 : arg_9 , ) -> None : if arg_5 . namespace . upper ( ) != 'HGNC' or arg_7 . namespace . upper ( ) != 'HGNC' : return arg_10 = arg_5 . name arg_11 = arg_7 . name arg_12 = arg_8 [ RELATION ] if arg_12 in CAUSAL_INCREASE_RELATIONS : if arg_7 . variants and any ( isinstance ( arg_13 , ProteinModification ) for arg_13 in arg_7 . variants ) : for arg_13 in arg_7 . variants : if not isinstance ( arg_13 , ProteinModification ) : continue if arg_13 [ IDENTIFIER ] [ NAME ] == "Ub" : arg_0 [ "activation_ubiquination" ] [ arg_10 ] [ arg_11 ] = 1 elif arg_13 [ IDENTIFIER ] [ NAME ] == "Ph" : arg_0 [ "activation_phosphorylation" ] [ arg_10 ] [ arg_11 ] = 1 elif isinstance ( arg_7 , ( Gene , Rna ) ) : arg_0 [ 'expression' ] [ arg_10 ] [ arg_11 ] = 1 else : arg_0 [ 'activation' ] [ arg_10 ] [ arg_11 ] = 1 elif arg_12 in CAUSAL_DECREASE_RELATIONS : if arg_7 . variants and any ( isinstance ( arg_13 , ProteinModification ) for arg_13 in arg_7 . variants ) : for arg_13 in arg_7 . variants : if not isinstance ( arg_13 , ProteinModification ) : continue if arg_13 [ IDENTIFIER ] [ NAME ] == "Ub" : arg_0 [ 'inhibition_ubiquination' ] [ arg_10 ] [ arg_11 ] = 1 elif arg_13 [ IDENTIFIER ] [ NAME ] == "Ph" : arg_0 [ "inhibition_phosphorylation" ] [ arg_10 ] [ arg_11 ] = 1 elif isinstance ( arg_7 , ( Gene , Rna ) ) : arg_0 [ "repression" ] [ arg_10 ] [ arg_11 ] = 1 else : arg_0 [ "inhibition" ] [ arg_10 ] [ arg_11 ] = 1 elif arg_12 == ASSOCIATION : arg_0 [ "binding_association" ] [ arg_10 ] [ arg_11 ] = 1

def Func(arg_0: arg_1[arg_2, arg_3.DataFrame],
                         arg_5: arg_6,
                         arg_7: arg_6,
                         arg_8: arg_9,
                         ) -> None:
    """Populate the adjacency matrix."""
    if arg_5.namespace.upper() != 'HGNC' or arg_7.namespace.upper() != 'HGNC':
        return

    arg_10 = arg_5.name
    arg_11 = arg_7.name
    arg_12 = arg_8[RELATION]

    if arg_12 in CAUSAL_INCREASE_RELATIONS:
        # If it has pmod check which one and add it to the corresponding matrix
        if arg_7.variants and any(isinstance(arg_13, ProteinModification) for arg_13 in arg_7.variants):
            for arg_13 in arg_7.variants:
                if not isinstance(arg_13, ProteinModification):
                    continue
                if arg_13[IDENTIFIER][NAME] == "Ub":
                    arg_0["activation_ubiquination"][arg_10][arg_11] = 1
                elif arg_13[IDENTIFIER][NAME] == "Ph":
                    arg_0["activation_phosphorylation"][arg_10][arg_11] = 1
        elif isinstance(arg_7, (Gene, Rna)):  # Normal increase, add activation
            arg_0['expression'][arg_10][arg_11] = 1
        else:
            arg_0['activation'][arg_10][arg_11] = 1

    elif arg_12 in CAUSAL_DECREASE_RELATIONS:
        # If it has pmod check which one and add it to the corresponding matrix
        if arg_7.variants and any(isinstance(arg_13, ProteinModification) for arg_13 in arg_7.variants):
            for arg_13 in arg_7.variants:
                if not isinstance(arg_13, ProteinModification):
                    continue
                if arg_13[IDENTIFIER][NAME] == "Ub":
                    arg_0['inhibition_ubiquination'][arg_10][arg_11] = 1
                elif arg_13[IDENTIFIER][NAME] == "Ph":
                    arg_0["inhibition_phosphorylation"][arg_10][arg_11] = 1
        elif isinstance(arg_7, (Gene, Rna)):  # Normal decrease, check which matrix
            arg_0["repression"][arg_10][arg_11] = 1
        else:
            arg_0["inhibition"][arg_10][arg_11] = 1

    elif arg_12 == ASSOCIATION:
        arg_0["binding_association"][arg_10][arg_11] = 1


def Func ( arg_0 , arg_1 ) : if arg_0 . use_mutation_length : return max ( ttconf . MIN_BRANCH_LENGTH * arg_0 . one_mutation , arg_1 . mutation_length ) else : return max ( ttconf . MIN_BRANCH_LENGTH * arg_0 . one_mutation , arg_1 . branch_length )

def Func(arg_0, arg_1):
        """
        Set branch lengths to either mutation lengths of given branch lengths.
        The assigend values are to be used in the following ML analysis.
        """
        if arg_0.use_mutation_length:
            return max(ttconf.MIN_BRANCH_LENGTH*arg_0.one_mutation, arg_1.mutation_length)
        else:
            return max(ttconf.MIN_BRANCH_LENGTH*arg_0.one_mutation, arg_1.branch_length)

Set branch lengths to either mutation lengths of given branch lengths . The assigend values are to be used in the following ML analysis .


(self, stream_id, task_ids, grouping, source_comp_name)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_1 not in arg_0 . targets : arg_0 . targets [ arg_1 ] = [ ] arg_0 . targets [ arg_1 ] . append ( Target ( arg_2 , arg_3 , arg_4 ) )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Adds the target component

    :type stream_id: str
    :param stream_id: stream id into which tuples are emitted
    :type task_ids: list of str
    :param task_ids: list of task ids to which tuples are emitted
    :type grouping: ICustomStreamGrouping object
    :param grouping: custom grouping to use
    :type source_comp_name: str
    :param source_comp_name: source component name
    """
    if arg_1 not in arg_0.targets:
      arg_0.targets[arg_1] = []
    arg_0.targets[arg_1].append(Target(arg_2, arg_3, arg_4))


def Func(arg_0, *arg_1):
        """Parse a list of arguments.

        Parse argument strings needed to run a backend command. The result
        will be a `argFunc.Namespace` object populated with the values
        obtained after the validation of the parameters.

        :param args: argument strings

        :result: an object with the Funcd values
        """
        arg_2 = arg_0.Funcr.Func_args(arg_1)

        # Category was not set, remove it
        if arg_2.category is None:
            delattr(arg_2, 'category')

        if arg_0._from_date:
            arg_2.from_date = str_to_datetime(arg_2.from_date)
        if arg_0._to_date and arg_2.to_date:
            arg_2.to_date = str_to_datetime(arg_2.to_date)
        if arg_0._archive and arg_2.archived_since:
            arg_2.archived_since = str_to_datetime(arg_2.archived_since)

        if arg_0._archive and arg_2.fetch_archive and arg_2.no_archive:
            raise AttributeError("fetch-archive and no-archive arguments are not compatible")
        if arg_0._archive and arg_2.fetch_archive and not arg_2.category:
            raise AttributeError("fetch-archive needs a category to work with")

        # Set aliases
        for arg_6, arg_7 in arg_0.aliases.items():
            if (arg_6 not in arg_2) and (arg_7 in arg_2):
                arg_8 = getattr(arg_2, arg_7, None)
                setattr(arg_2, arg_6, arg_8)

        return arg_2

Parse a list of arguments.

        Parse argument strings needed to run a backend command. The result
        will be a `argparse.Namespace` object populated with the values
        obtained after the validation of the parameters.

        :param args: argument strings

        :result: an object with the parsed values


(listen, verbosity=1, debug_port=0, **ssl_args)

def
Func
(
arg_0
,
arg_1
=
1
,
arg_2
=
0
,
**
arg_3
)
:
arg_4
=
DDPLauncher
(
debug
=
arg_1
==
3
,
arg_1
=
arg_1
)
if
arg_2
:
arg_4
.
Funcrs
.
append
(
arg_4
.
get_backdoor_Funcr
(
'localhost:%d'
%
arg_2
)
)
arg_4
.
add_web_Funcrs
(
arg_0
,
**
arg_3
)
arg_5
=
{
val
:
name
for
name
,
val
in
vars
(
signal
)
.
items
(
)
if
name
.
startswith
(
'SIG'
)
}
def
sighandler
(
arg_6
=
,
arg_7
=
)
:
arg_4
.
logger
.
info
(
'Received signal %s in frame %r'
,
arg_5
.
get
(
arg_6
,
arg_6
)
,
arg_7
,
)
arg_4
.
stop
(
)
for
arg_6
in
[
signal
.
SIGINT
,
signal
.
SIGQUIT
]
:
gevent
.
signal
(
arg_6
,
sighandler
)
arg_4
.
run
(
)

def Func(arg_0, arg_1=1, arg_2=0, **arg_3):
    """Spawn greenlets for handling websockets and PostgreSQL calls."""
    arg_4 = DDPLauncher(debug=arg_1 == 3, arg_1=arg_1)
    if arg_2:
        arg_4.Funcrs.append(
            arg_4.get_backdoor_Funcr('localhost:%d' % arg_2)
        )
    arg_4.add_web_Funcrs(arg_0, **arg_3)
    # die gracefully with SIGINT or SIGQUIT
    arg_5 = {
        val: name
        for name, val
        in vars(signal).items()
        if name.startswith('SIG')
    }

    def sighandler(arg_6=None, arg_7=None):
        """Signal handler"""
        arg_4.logger.info(
            'Received signal %s in frame %r',
            arg_5.get(arg_6, arg_6),
            arg_7,
        )
        arg_4.stop()
    for arg_6 in [signal.SIGINT, signal.SIGQUIT]:
        gevent.signal(arg_6, sighandler)
    arg_4.run()

Spawn greenlets for handling websockets and PostgreSQL calls .


def Func ( arg_0 ) : with open ( arg_0 ) as fp : arg_1 = json . load ( fp ) return arg_1 return False

def Func(arg_0):
    """Get data from json file
    """
    with open(arg_0) as fp:
        arg_1 = json.load(fp)
        return arg_1

    return False


return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
                   context, ctx.app)

def Func ( arg_0 , ** arg_1 ) : arg_2 = _app_ctx_stack . top arg_2 . app . update_template_context ( arg_1 ) return _render ( arg_2 . app . jinja_env . get_or_select_template ( arg_0 ) , arg_1 , arg_2 . app )

def Func(arg_0, **arg_1):
    """Renders a template from the template folder with the given
    context.

    :param template_name_or_list: the name of the template to be
                                  rendered, or an iterable with template names
                                  the first one existing will be rendered
    :param context: the variables that should be available in the
                    context of the template.
    """
    arg_2 = _app_ctx_stack.top
    arg_2.app.update_template_context(arg_1)
    return _render(arg_2.app.jinja_env.get_or_select_template(arg_0),
                   arg_1, arg_2.app)

Renders a template from the template folder with the given context .


return CloudLayer(
        intensity_mean=(220, 255), intensity_freq_exponent=(-2.0, -1.5), intensity_coarse_scale=2,
        alpha_min=(0.7, 0.9), alpha_multiplier=0.3, alpha_size_px_max=(2, 8), alpha_freq_exponent=(-4.0, -2.0),
        sparsity=0.9, density_multiplier=(0.4, 0.9),
        name=name, deterministic=deterministic, random_state=random_state
    )

def Func ( arg_0 = None , arg_1 = False , arg_2 = None ) : if arg_0 is None : arg_0 = "Unnamed%s" % ( ia . caller_name ( ) , ) return CloudLayer ( intensity_mean = ( 220 , 255 ) , intensity_freq_exponent = ( - 2.0 , - 1.5 ) , intensity_coarse_scale = 2 , alpha_min = ( 0.7 , 0.9 ) , alpha_multiplier = 0.3 , alpha_size_px_max = ( 2 , 8 ) , alpha_freq_exponent = ( - 4.0 , - 2.0 ) , sparsity = 0.9 , density_multiplier = ( 0.4 , 0.9 ) , arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0=None, arg_1=False, arg_2=None):
    """
    Augmenter to draw fog in images.

    This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
    to fairly dense clouds with low-frequency patterns.

    This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
    and ``960x1280``.

    dtype support::

        * ``uint8``: yes; tested
        * ``uint16``: no (1)
        * ``uint32``: no (1)
        * ``uint64``: no (1)
        * ``int8``: no (1)
        * ``int16``: no (1)
        * ``int32``: no (1)
        * ``int64``: no (1)
        * ``float16``: no (1)
        * ``float32``: no (1)
        * ``float64``: no (1)
        * ``float128``: no (1)
        * ``bool``: no (1)

        - (1) Parameters of this augmenter are optimized for the value range of uint8.
              While other dtypes may be accepted, they will lead to images augmented in
              ways inappropriate for the respective dtype.

    Parameters
    ----------
    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.Func()

    Creates an augmenter that adds fog to images.

    """
    if arg_0 is None:
        arg_0 = "Unnamed%s" % (ia.caller_name(),)

    return CloudLayer(
        intensity_mean=(220, 255), intensity_freq_exponent=(-2.0, -1.5), intensity_coarse_scale=2,
        alpha_min=(0.7, 0.9), alpha_multiplier=0.3, alpha_size_px_max=(2, 8), alpha_freq_exponent=(-4.0, -2.0),
        sparsity=0.9, density_multiplier=(0.4, 0.9),
        arg_0=arg_0, arg_1=arg_1, arg_2=arg_2
    )

Augmenter to draw fog in images.

    This is a wrapper around ``CloudLayer``. It executes a single layer per image with a configuration leading
    to fairly dense clouds with low-frequency patterns.

    This augmenter seems to be fairly robust w.r.t. the image size. Tested with ``96x128``, ``192x256``
    and ``960x1280``.

    dtype support::

        * ``uint8``: yes; tested
        * ``uint16``: no (1)
        * ``uint32``: no (1)
        * ``uint64``: no (1)
        * ``int8``: no (1)
        * ``int16``: no (1)
        * ``int32``: no (1)
        * ``int64``: no (1)
        * ``float16``: no (1)
        * ``float32``: no (1)
        * ``float64``: no (1)
        * ``float128``: no (1)
        * ``bool``: no (1)

        - (1) Parameters of this augmenter are optimized for the value range of uint8.
              While other dtypes may be accepted, they will lead to images augmented in
              ways inappropriate for the respective dtype.

    Parameters
    ----------
    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.Fog()

    Creates an augmenter that adds fog to images.


def Func(arg_0, arg_1=False):
        """ Check for uncommitted changes, return `True` if everything is clean.

            Inspired by http://stackoverflow.com/questions/3878624/.
        """
        # Update the index
        arg_0.run('git update-index -q --ignore-submodules --refresh', **RUN_KWARGS)
        arg_2 = True

        # Disallow unstaged changes in the working tree
        try:
            arg_0.run('git diff-files --quiet --ignore-submodules --', report_error=False, **RUN_KWARGS)
        except exceptions.Failure:
            arg_2 = False
            if not arg_1:
                notify.warning('You have unstaged changes!')
                arg_0.run('git diff-files --name-status -r --ignore-submodules -- >&2', **RUN_KWARGS)

        # Disallow uncommitted changes in the index
        try:
            arg_0.run('git diff-index --cached --quiet HEAD --ignore-submodules --', report_error=False, **RUN_KWARGS)
        except exceptions.Failure:
            arg_2 = False
            if not arg_1:
                notify.warning('Your index contains uncommitted changes!')
                arg_0.run('git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2', **RUN_KWARGS)

        return arg_2

Check for uncommitted changes return True if everything is clean .


def Func(arg_0, arg_1=None):
    """This is a decorator which can be used if a kwarg has changed
    its name over versions to also support the old argument name.

    Issues a warning if the old keyword argument is detected and
    converts call to new API.

    :param old_name:

        Old name of the keyword argument

    :param new_name:

        New name of keyword argument

    """

    def wrapper(arg_2):
        @functools.wraps(arg_2)
        def new_func(*arg_3, **arg_4):

            if arg_0 in arg_4:
                if arg_1 is None:
                    arg_5 = 'Using deprecated keyword argument `%s` in function `%s`. ' \
                                 'This keyword is no longer supported, please don`t use it ' \
                                 'anymore.' % (arg_0, arg_2.__name__)
                else:
                    arg_5 = 'Using deprecated keyword argument `%s` in function `%s`, ' \
                                 'please use keyword `%s` instead.' % \
                                 (arg_0, arg_2.__name__, arg_1)
                warnings.warn(arg_5, category=DeprecationWarning)
                arg_6 = arg_4.pop(arg_0)
                if arg_1 is not None:
                    arg_4[arg_1] = arg_6

            return arg_2(*arg_3, **arg_4)

        return new_func

    return wrapper

This is a decorator which can be used if a kwarg has changed its name over versions to also support the old argument name .


Returns intersection of two lists.  Assumes the lists are sorted by start positions

def Func ( arg_0 , arg_1 ) : if len ( arg_0 ) == 0 or len ( arg_1 ) == 0 : return [ ] arg_2 = [ ] arg_3 = 0 for arg_4 in arg_0 : while arg_3 < len ( arg_1 ) and arg_1 [ arg_3 ] . end < arg_4 . start : arg_3 += 1 if arg_3 == len ( arg_1 ) : break while arg_3 < len ( arg_1 ) and arg_4 . intersects ( arg_1 [ arg_3 ] ) : arg_2 . append ( arg_4 . Func ( arg_1 [ arg_3 ] ) ) arg_3 += 1 arg_3 = max ( 0 , arg_3 - 1 ) return arg_2

def Func(arg_0, arg_1):
    '''Returns Func of two lists.  Assumes the lists are sorted by start positions'''
    if len(arg_0) == 0 or len(arg_1) == 0:
        return []

    arg_2 = []
    arg_3 = 0

    for arg_4 in arg_0:
        while arg_3 < len(arg_1) and arg_1[arg_3].end < arg_4.start:
            arg_3 += 1

        if arg_3 == len(arg_1):
            break

        while arg_3 < len(arg_1) and arg_4.intersects(arg_1[arg_3]):
            arg_2.append(arg_4.Func(arg_1[arg_3]))
            arg_3 += 1

        arg_3 = max(0, arg_3 - 1)

    return arg_2

Returns intersection of two lists . Assumes the lists are sorted by start positions


def Func ( arg_0 ) : arg_1 = os . path . abspath ( os . path . dirname ( __file__ ) ) arg_2 = os . path . abspath ( os . path . join ( arg_1 , '..' ) ) arg_3 = 'sphinx-apidoc' if hasattr ( sys , 'real_prefix' ) : arg_4 = os . path . abspath ( os . path . join ( sys . prefix , 'bin' ) ) arg_3 = os . path . join ( arg_4 , arg_3 ) check_call ( [ arg_3 , '-o' , arg_1 , os . path . join ( arg_2 , 'enterprise' ) , os . path . join ( arg_2 , 'enterprise/migrations' ) ] )

def Func(arg_0):  # pylint: disable=unused-argument
    """
    Run sphinx-apidoc after Sphinx initialization.

    Read the Docs won't run tox or custom shell commands, so we need this to
    avoid checking in the generated reStructuredText files.
    """
    arg_1 = os.path.abspath(os.path.dirname(__file__))
    arg_2 = os.path.abspath(os.path.join(arg_1, '..'))
    arg_3 = 'sphinx-apidoc'
    if hasattr(sys, 'real_prefix'):  # Check to see if we are in a virtualenv
        # If we are, assemble the path manually
        arg_4 = os.path.abspath(os.path.join(sys.prefix, 'bin'))
        arg_3 = os.path.join(arg_4, arg_3)
    check_call([arg_3, '-o', arg_1, os.path.join(arg_2, 'enterprise'),
                os.path.join(arg_2, 'enterprise/migrations')])

Run sphinx - apidoc after Sphinx initialization .


def Func(arg_0):
        """
        Determine the mole amounts of all the compounds.

        :returns: List of amounts. [kmol]
        """

        arg_1 = arg_0._compound_masses * 1.0
        for arg_2 in arg_0.material.compounds:
            arg_3 = arg_0.material.get_compound_index(arg_2)
            arg_1[arg_3] = stoich.amount(arg_2, arg_1[arg_3])
        return arg_1

Determine the mole amounts of all the compounds .


return {name: val for name, val in zip(self.arg_names, arg_vals)}

def Func(arg_0, arg_1, arg_2=None):
        """Check if there are any missing or duplicate arguments.

        Args:
            pos_args (list): A list of arguments that will be passed as positional
                arguments.
            kwargs (dict): A dictionary of the keyword arguments that will be passed.

        Returns:
            dict: A dictionary of argument name to argument value, pulled from either
                the value passed or the default value if no argument is passed.

        Raises:
            ArgumentError: If a positional or keyword argument does not fit in the spec.
            ValidationError: If an argument is passed twice.
        """

        if arg_2 is None:
            arg_2 = {}

        if arg_0.varargs is not None or arg_0.kwargs is not None:
            raise InternalError("Func cannot be called on a function that takes *args or **kwargs")

        arg_3 = object()

        arg_4 = [arg_3]*len(arg_0.arg_names)
        arg_5 = {arg_11: arg_6 for arg_6, arg_11 in enumerate(arg_0.arg_names)}

        for arg_6, arg_7 in enumerate(arg_1):
            if arg_6 >= len(arg_4):
                raise ArgumentError("Too many positional arguments, first excessive argument=%s" % str(arg_7))

            arg_4[arg_6] = arg_7

        for arg_7, arg_8 in arg_2.items():
            arg_9 = arg_5.get(arg_7)
            if arg_9 is None:
                raise ArgumentError("Cannot find argument by name: %s" % arg_7)

            if arg_4[arg_9] is not arg_3:
                raise ValidationError("Argument %s passed twice" % arg_7)

            arg_4[arg_9] = arg_8

        # Fill in any default variables if their args are missing
        if len(arg_0.arg_defaults) > 0:
            for arg_6 in range(0, len(arg_0.arg_defaults)):
                arg_10 = -len(arg_0.arg_defaults) + arg_6
                if arg_4[arg_10] is arg_3:
                    arg_4[arg_10] = arg_0.arg_defaults[arg_6]

        # Now make sure there isn't a missing gap
        if arg_3 in arg_4:
            arg_9 = arg_4.index(arg_3)
            raise ArgumentError("Missing a required argument (position: %d, name: %s)" % (arg_9, arg_0.arg_names[arg_9]))

        return {arg_11: arg_8 for arg_11, arg_8 in zip(arg_0.arg_names, arg_4)}

Check if there are any missing or duplicate arguments .


def Func ( arg_0 ) : arg_1 = CustomLink . objects . filter ( publication__in = arg_0 ) arg_2 = CustomFile . objects . filter ( publication__in = arg_0 ) arg_3 = { } for arg_4 in arg_0 : arg_4 . links = [ ] arg_4 . files = [ ] arg_3 [ arg_4 . id ] = arg_4 for arg_8 in arg_1 : arg_3 [ arg_8 . publication_id ] . links . append ( arg_8 ) for arg_9 in arg_2 : arg_3 [ arg_9 . publication_id ] . files . append ( arg_9 )

def Func(arg_0):
	"""
	Load custom links and files from database and attach to publications.
	"""

	arg_1 = CustomLink.objects.filter(publication__in=arg_0)
	arg_2 = CustomFile.objects.filter(publication__in=arg_0)

	arg_3 = {}
	for arg_4 in arg_0:
		arg_4.links = []
		arg_4.files = []
		arg_3[arg_4.id] = arg_4

	for arg_8 in arg_1:
		arg_3[arg_8.publication_id].links.append(arg_8)
	for arg_9 in arg_2:
		arg_3[arg_9.publication_id].files.append(arg_9)

Load custom links and files from database and attach to publications .


(y=None, sr=22050, C=None, hop_length=512, fmin=None,
               norm=np.inf, threshold=0.0, tuning=None, n_chroma=12,
               n_octaves=7, window=None, bins_per_octave=None, cqt_mode='full')

def Func(arg_0=None, arg_1=22050, arg_2=None, arg_3=512, arg_4=None,
               arg_5=arg_6.inf, arg_8=0.0, arg_9=None, arg_10=12,
               arg_11=7, arg_12=None, arg_13=None, arg_14='full'):
    r'''Constant-Q chromagram

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series

    sr : number > 0
        sampling rate of `y`

    C : np.ndarray [shape=(d, t)] [Optional]
        a pre-computed constant-Q spectrogram

    hop_length : int > 0
        number of samples between successive chroma frames

    fmin : float > 0
        minimum frequency to analyze in the CQT.
        Default: 'C1' ~= 32.7 Hz

    norm : int > 0, +-np.inf, or None
        Column-wise normalization of the chromagram.

    threshold : float
        Pre-normalization energy threshold.  Values below the
        threshold are discarded, resulting in a sparse chromagram.

    tuning : float
        Deviation (in cents) from A440 tuning

    n_chroma : int > 0
        Number of chroma bins to produce

    n_octaves : int > 0
        Number of octaves to analyze above `fmin`

    window : None or np.ndarray
        Optional window parameter to `filters.cq_to_chroma`

    bins_per_octave : int > 0
        Number of bins per octave in the CQT.
        Default: matches `n_chroma`

    cqt_mode : ['full', 'hybrid']
        Constant-Q transform mode

    Returns
    -------
    chromagram : np.ndarray [shape=(n_chroma, t)]
        The output chromagram

    See Also
    --------
    librosa.util.normalize
    librosa.core.cqt
    librosa.core.hybrid_cqt
    chroma_stft

    Examples
    --------
    Compare a long-window STFT chromagram to the CQT chromagram

    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      offset=10, duration=15)
    >>> chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr,
    ...                                           n_chroma=12, n_fft=4096)
    >>> chroma_cq = librosa.feature.Func(y=y, sr=sr)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(2,1,1)
    >>> librosa.display.specshow(chroma_stft, y_axis='chroma')
    >>> plt.title('chroma_stft')
    >>> plt.colorbar()
    >>> plt.subplot(2,1,2)
    >>> librosa.display.specshow(chroma_cq, y_axis='chroma', x_axis='time')
    >>> plt.title('Func')
    >>> plt.colorbar()
    >>> plt.tight_layout()

    '''

    arg_15 = {'full': cqt, 'hybrid': hybrid_cqt}

    if arg_13 is None:
        arg_13 = arg_10

    # Build the CQT if we don't have one already
    if arg_2 is None:
        arg_2 = arg_6.abs(arg_15[arg_14](arg_0, arg_1=arg_1,
                                      arg_3=arg_3,
                                      arg_4=arg_4,
                                      n_bins=arg_11 * arg_13,
                                      arg_13=arg_13,
                                      arg_9=arg_9))

    # Map to chroma
    arg_16 = filters.cq_to_chroma(arg_2.shape[0],
                                     arg_13=arg_13,
                                     arg_10=arg_10,
                                     arg_4=arg_4,
                                     arg_12=arg_12)
    arg_17 = arg_16.dot(arg_2)

    if arg_8 is not None:
        arg_17[arg_17 < arg_8] = 0.0

    # Normalize
    if arg_5 is not None:
        arg_17 = util.normalize(arg_17, arg_5=arg_5, axis=0)

    return arg_17

r'''Constant-Q chromagram

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series

    sr : number > 0
        sampling rate of `y`

    C : np.ndarray [shape=(d, t)] [Optional]
        a pre-computed constant-Q spectrogram

    hop_length : int > 0
        number of samples between successive chroma frames

    fmin : float > 0
        minimum frequency to analyze in the CQT.
        Default: 'C1' ~= 32.7 Hz

    norm : int > 0, +-np.inf, or None
        Column-wise normalization of the chromagram.

    threshold : float
        Pre-normalization energy threshold.  Values below the
        threshold are discarded, resulting in a sparse chromagram.

    tuning : float
        Deviation (in cents) from A440 tuning

    n_chroma : int > 0
        Number of chroma bins to produce

    n_octaves : int > 0
        Number of octaves to analyze above `fmin`

    window : None or np.ndarray
        Optional window parameter to `filters.cq_to_chroma`

    bins_per_octave : int > 0
        Number of bins per octave in the CQT.
        Default: matches `n_chroma`

    cqt_mode : ['full', 'hybrid']
        Constant-Q transform mode

    Returns
    -------
    chromagram : np.ndarray [shape=(n_chroma, t)]
        The output chromagram

    See Also
    --------
    librosa.util.normalize
    librosa.core.cqt
    librosa.core.hybrid_cqt
    chroma_stft

    Examples
    --------
    Compare a long-window STFT chromagram to the CQT chromagram

    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      offset=10, duration=15)
    >>> chroma_stft = librosa.feature.chroma_stft(y=y, sr=sr,
    ...                                           n_chroma=12, n_fft=4096)
    >>> chroma_cq = librosa.feature.chroma_cqt(y=y, sr=sr)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(2,1,1)
    >>> librosa.display.specshow(chroma_stft, y_axis='chroma')
    >>> plt.title('chroma_stft')
    >>> plt.colorbar()
    >>> plt.subplot(2,1,2)
    >>> librosa.display.specshow(chroma_cq, y_axis='chroma', x_axis='time')
    >>> plt.title('chroma_cqt')
    >>> plt.colorbar()
    >>> plt.tight_layout()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . _text arg_3 = [ len ( e ) for e in arg_2 ] arg_4 = [ max ( len ( t ) , 1 ) for t in arg_1 . _tokens ] arg_5 = [ e . count ( "," ) for e in arg_2 ] arg_6 = [ e . count ( "'" ) for e in arg_2 ] arg_7 = [ e . count ( "." ) + e . count ( "?" ) + e . count ( "!" ) for e in arg_2 ] arg_8 = [ arg_3 [ m ] / float ( arg_4 [ m ] ) for m in xrange ( 0 , len ( arg_2 ) ) ] arg_9 , arg_10 = arg_0 . _get_grammar_errors ( arg_1 . _pos , arg_1 . _text , arg_1 . _tokens ) arg_11 = [ arg_9 [ m ] / float ( arg_4 [ m ] ) for m in xrange ( 0 , len ( arg_2 ) ) ] arg_12 = numpy . array ( ( arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_11 ) ) . transpose ( ) return arg_12 . copy ( )

def Func(arg_0, arg_1):
        """
        Generates length based features from an essay set
        Generally an internal function called by gen_feats
        Returns an array of length features
        e_set - EssaySet object
        """
        arg_2 = arg_1._text
        arg_3 = [len(e) for e in arg_2]
        arg_4 = [max(len(t),1) for t in arg_1._tokens]
        arg_5 = [e.count(",") for e in arg_2]
        arg_6 = [e.count("'") for e in arg_2]
        arg_7 = [e.count(".") + e.count("?") + e.count("!") for e in arg_2]
        arg_8 = [arg_3[m] / float(arg_4[m]) for m in xrange(0, len(arg_2))]

        arg_9,arg_10= arg_0._get_grammar_errors(arg_1._pos,arg_1._text,arg_1._tokens)
        arg_11 = [arg_9[m] / float(arg_4[m]) for m in xrange(0, len(arg_2))]

        arg_12 = numpy.array((
        arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9,
        arg_11)).transpose()

        return arg_12.copy()


def Func(arg_0, arg_1=None, arg_2=None):
    """Obtains the configuration used for cookiecutter templating

    Args:
        template: Path to the template
        default_config (dict, optional): The default configuration
        version (str, optional): The git SHA or branch to use when
            checking out template. Defaults to latest version

    Returns:
        tuple: The cookiecutter repo directory and the config dict
    """
    arg_1 = arg_1 or {}
    arg_3 = cc_config.get_user_config()
    arg_4, arg_5 = cc_repository.determine_repo_dir(
        arg_0=arg_0,
        abbreviations=arg_3['abbreviations'],
        clone_to_dir=arg_3['cookiecutters_dir'],
        checkout=arg_2,
        no_input=True)
    arg_6 = os.path.join(arg_4, 'cookiecutter.json')
    arg_7 = cc_generate.generate_context(
        arg_6=arg_6,
        default_context={**arg_3['default_context'], **arg_1})
    return arg_4, cc_prompt.prompt_for_config(arg_7)


def
Func
(
arg_0
)
:
arg_1
=
'script.tmpl'
if
arg_0
:
arg_1
=
arg_1
.
replace
(
'.tmpl'
,
' (dev).tmpl'
)
arg_2
=
resource_string
(
'setuptools'
,
arg_1
)
return
arg_2
.
decode
(
'utf-8'
)

def Func(arg_0):
        """
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        """
        # See https://bitbucket.org/pypa/setuptools/issue/134 for info
        # on script file naming and downstream issues with SVR4
        arg_1 = 'script.tmpl'
        if arg_0:
            arg_1 = arg_1.replace('.tmpl', ' (dev).tmpl')

        arg_2 = resource_string('setuptools', arg_1)
        return arg_2.decode('utf-8')

There are a couple of template scripts in the package . This function loads one of them and prepares it for use .


def Func ( arg_0 ) : if arg_0 . condition == b'com.microsoft:server-busy' : return errors . ErrorAction ( retry = True , backoff = 4 ) if arg_0 . condition == b'com.microsoft:timeout' : return errors . ErrorAction ( retry = True , backoff = 2 ) if arg_0 . condition == b'com.microsoft:operation-cancelled' : return errors . ErrorAction ( retry = True ) if arg_0 . condition == b"com.microsoft:container-close" : return errors . ErrorAction ( retry = True , backoff = 4 ) if arg_0 . condition in _NO_RETRY_ERRORS : return errors . ErrorAction ( retry = False ) return errors . ErrorAction ( retry = True )

def Func(arg_0):
    """Handle connection and service errors.

    Called internally when an event has failed to send so we
    can parse the error to determine whether we should attempt
    to retry sending the event again.
    Returns the action to take according to error type.

    :param error: The error received in the send attempt.
    :type error: Exception
    :rtype: ~uamqp.errors.ErrorAction
    """
    if arg_0.condition == b'com.microsoft:server-busy':
        return errors.ErrorAction(retry=True, backoff=4)
    if arg_0.condition == b'com.microsoft:timeout':
        return errors.ErrorAction(retry=True, backoff=2)
    if arg_0.condition == b'com.microsoft:operation-cancelled':
        return errors.ErrorAction(retry=True)
    if arg_0.condition == b"com.microsoft:container-close":
        return errors.ErrorAction(retry=True, backoff=4)
    if arg_0.condition in _NO_RETRY_ERRORS:
        return errors.ErrorAction(retry=False)
    return errors.ErrorAction(retry=True)


def Func(arg_0, arg_1={}):
    """Return a list of lists, where the i-th element is the list of indexes
    for the neighbors of square i."""
    if arg_1.get(arg_0):
        return arg_1.get(arg_0)
    arg_2 = exact_sqrt(arg_0)
    arg_3 = [None] * arg_0
    for arg_4 in range(arg_0):
        arg_3[arg_4] = []
        arg_5 = arg_4 < arg_2
        arg_6 = arg_4 >= arg_0 - arg_2
        arg_7 = arg_4 % arg_2 == 0
        arg_8 = (arg_4+1) % arg_2 == 0
        if not arg_5:
            arg_3[arg_4].append(arg_4 - arg_2)
            if not arg_7:  arg_3[arg_4].append(arg_4 - arg_2 - 1)
            if not arg_8: arg_3[arg_4].append(arg_4 - arg_2 + 1)
        if not arg_6:
            arg_3[arg_4].append(arg_4 + arg_2)
            if not arg_7:  arg_3[arg_4].append(arg_4 + arg_2 - 1)
            if not arg_8: arg_3[arg_4].append(arg_4 + arg_2 + 1)
        if not arg_7: arg_3[arg_4].append(arg_4 - 1)
        if not arg_8: arg_3[arg_4].append(arg_4 + 1)
    arg_1[arg_0] = arg_3
    return arg_3

Return a list of lists where the i - th element is the list of indexes for the neighbors of square i .


def Func ( arg_0 ) : arg_1 = int ( arg_0 . t_stop - arg_0 . t_start ) arg_2 = int ( np . round ( ( arg_0 . f_stop - arg_0 . f_start ) / abs ( arg_0 . header [ b'foff' ] ) ) ) arg_3 = ( arg_1 , int ( arg_0 . header [ b'nifs' ] ) , arg_2 ) return arg_3

def Func(arg_0):
        """Calculate shape of data of interest.
        """

        #Check how many integrations requested
        arg_1 = int(arg_0.t_stop - arg_0.t_start)
        #Check how many frequency channels requested
        arg_2 = int(np.round((arg_0.f_stop - arg_0.f_start) / abs(arg_0.header[b'foff'])))

        arg_3 = (arg_1,int(arg_0.header[b'nifs']),arg_2)

        return arg_3


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = list ( map ( float , arg_2 [ "svg" ] [ "@viewBox" ] . split ( ) ) ) arg_4 = arg_0 . _zoom / ( arg_3 [ 3 ] - arg_3 [ 1 ] ) arg_0 . _symbol_id_to_scale [ arg_1 ] = arg_4

def Func(arg_0, arg_1, arg_2):
        """Compute the scale of an instruction svg.

        Compute the scale using the bounding box stored in the
        :paramref:`svg_dict`. The scale is saved in a dictionary using
        :paramref:`instruction_id` as key.

        :param str instruction_id: id identifying a symbol in the defs
        :param dict svg_dict: dictionary containing the SVG for the
          instruction currently processed
        """
        arg_3 = list(map(float, arg_2["svg"]["@viewBox"].split()))
        arg_4 = arg_0._zoom / (arg_3[3] - arg_3[1])
        arg_0._symbol_id_to_scale[arg_1] = arg_4

Compute the scale of an instruction svg .


def Func(arg_0, arg_1):
        """Convert record schema to a valid deposit schema.

        :param record: The record used to build deposit schema.
        :returns: The absolute URL to the schema or `None`.
        """
        arg_2 = current_jsonschemas.url_to_path(arg_1['$schema'])
        arg_3 = current_app.config['DEPOSIT_JSONSCHEMAS_PREFIX']
        if arg_2:
            return current_jsonschemas.path_to_url(
                arg_3 + arg_2
            )

Convert record schema to a valid deposit schema .


def Func(arg_0, arg_1, arg_2):
    """Base pprint for all functions and builtin functions."""
    if arg_0.__module__ in ('__builtin__', 'exceptions') or not arg_0.__module__:
        arg_3 = arg_0.__name__
    else:
        arg_3 = arg_0.__module__ + '.' + arg_0.__name__
    arg_1.text('<function %s>' % arg_3)

Base pprint for all functions and builtin functions .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = utils . expand_modules ( arg_1 , arg_0 . config . black_list , arg_0 . config . black_list_re ) for arg_4 in arg_3 : arg_5 = modname = arg_4 [ "mod" ] arg_6 = arg_4 [ "key" ] arg_0 . set_current_module ( modname ) if arg_6 == "fatal" : arg_5 = str ( arg_4 [ "ex" ] ) . replace ( os . getcwd ( ) + os . sep , "" ) arg_0 . add_message ( arg_6 , args = arg_5 ) return arg_2

def Func(arg_0, arg_1):
        """get modules and errors from a list of modules and handle errors
        """
        arg_2, arg_3 = utils.expand_modules(
            arg_1, arg_0.config.black_list, arg_0.config.black_list_re
        )
        for arg_4 in arg_3:
            arg_5 = modname = arg_4["mod"]
            arg_6 = arg_4["key"]
            arg_0.set_current_module(modname)
            if arg_6 == "fatal":
                arg_5 = str(arg_4["ex"]).replace(os.getcwd() + os.sep, "")
            arg_0.add_message(arg_6, args=arg_5)
        return arg_2


def Func(arg_0, arg_1=False):
    """
    Automatically get repo

    Parameters
    ----------

    autooptions: dgit.json content

    """

    # plugin manager
    arg_2 = plugins_get_mgr()

    # get the repo manager
    arg_3 = arg_2.get(what='repomanager', name='git')

    arg_4 = None

    try:
        if arg_1:
            print("Looking repo")
        arg_4 = arg_3.lookup(username=arg_0['username'],
                              reponame=arg_0['reponame'])
    except:
        # Clone the repo
        try:
            print("Checking and cloning if the dataset exists on backend")
            arg_5 = arg_0['remoteurl']
            if arg_1:
                print("Doesnt exist. trying to clone: {}".format(arg_5))
            common_clone(arg_5)
            arg_4 = arg_3.lookup(username=arg_0['username'],
                                  reponame=arg_0['reponame'])
            if arg_1:
                print("Cloning successful")
        except:
            # traceback.print_exc()
            arg_6 = input("Repo doesnt exist. Should I create one? [yN]")
            if arg_6 == 'y':
                arg_7 = "git"
                if arg_0['remoteurl'].startswith('s3://'):
                    arg_7 = 'git+s3'
                arg_4 = common_init(username=arg_0['username'],
                                   reponame=arg_0['reponame'],
                                   arg_7=arg_7,
                                   force=True,
                                   arg_8=arg_0)

                if arg_1:
                    print("Successfully inited repo")
            else:
                raise Exception("Cannot load repo")

    arg_4.options = arg_0

    return arg_4


(self, parameterName, index, parameterValue)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_1
==
'topDownMode'
:
arg_0
.
topDownMode
=
arg_3
elif
arg_1
==
'predictedField'
:
arg_0
.
predictedField
=
arg_3
else
:
raise
Exception
(
'Unknown parameter: '
+
arg_1
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
      Set the value of a Spec parameter. Most parameters are handled
      automatically by PyRegion's parameter set mechanism. The ones that need
      special treatment are explicitly handled here.
    """
    if arg_1 == 'topDownMode':
      arg_0.topDownMode = arg_3
    elif arg_1 == 'predictedField':
      arg_0.predictedField = arg_3
    else:
      raise Exception('Unknown parameter: ' + arg_1)

Set the value of a Spec parameter . Most parameters are handled automatically by PyRegion s parameter set mechanism . The ones that need special treatment are explicitly handled here .


(lcdict,
                         filterflags=True,
                         nanfilter='sap,pdc',
                         timestoignore=None)

def Func(arg_0,
                         arg_1=True,
                         arg_2='sap,pdc',
                         arg_3=None):
    '''This filters the Kepler `lcdict`, removing nans and bad
    observations.

    By default, this function removes points in the Kepler LC that have ANY
    quality flags set.

    Parameters
    ----------

    lcdict : lcdict
        An `lcdict` produced by `consolidate_kepler_fitslc` or
        `read_kepler_fitslc`.

    filterflags : bool
        If True, will remove any measurements that have non-zero quality flags
        present. This usually indicates an issue with the instrument or
        spacecraft.

    nanfilter : {'sap','pdc','sap,pdc'}
        Indicates the flux measurement type(s) to apply the filtering to.

    timestoignore : list of tuples or None
        This is of the form::

            [(time1_start, time1_end), (time2_start, time2_end), ...]

        and indicates the start and end times to mask out of the final
        lcdict. Use this to remove anything that wasn't caught by the quality
        flags.

    Returns
    -------

    lcdict
        Returns an `lcdict` (this is useable by most astrobase functions for LC
        processing). The `lcdict` is filtered IN PLACE!

    '''

    arg_4 = arg_0['columns']

    # filter all bad LC points as noted by quality flags
    if arg_1:

        arg_5 = arg_0['time'].size
        arg_6 = arg_0['sap_quality'] == 0

        for arg_7 in arg_4:
            if '.' in arg_7:
                arg_8, arg_9 = arg_7.split('.')
                arg_0[arg_8][arg_9] = arg_0[arg_8][arg_9][arg_6]
            else:
                arg_0[arg_7] = arg_0[arg_7][arg_6]

        arg_10 = arg_0['time'].size
        LOGINFO('applied quality flag filter, ndet before = %s, ndet after = %s'
                % (arg_5, arg_10))

    if arg_2 and arg_2 == 'sap,pdc':
        arg_11 = (
            npisfinite(arg_0['sap']['sap_flux']) &
            npisfinite(arg_0['pdc']['pdcsap_flux']) &
            npisfinite(arg_0['time'])
        )
    elif arg_2 and arg_2 == 'sap':
        arg_11 = (
            npisfinite(arg_0['sap']['sap_flux']) &
            npisfinite(arg_0['time'])
        )
    elif arg_2 and arg_2 == 'pdc':
        arg_11 = (
            npisfinite(arg_0['pdc']['pdcsap_flux']) &
            npisfinite(arg_0['time'])
        )

    # remove nans from all columns
    if arg_2:

        arg_5 = arg_0['time'].size
        for arg_7 in arg_4:
            if '.' in arg_7:
                arg_8, arg_9 = arg_7.split('.')
                arg_0[arg_8][arg_9] = arg_0[arg_8][arg_9][arg_11]
            else:
                arg_0[arg_7] = arg_0[arg_7][arg_11]

        arg_10 = arg_0['time'].size

        LOGINFO('removed nans, ndet before = %s, ndet after = %s'
                % (arg_5, arg_10))

    # exclude all times in timestoignore
    if (arg_3 and
        isinstance(arg_3, list) and
        len(arg_3) > 0):

        arg_12 = npfull_like(arg_0['time'], True, dtype=np.bool_)
        arg_5 = arg_12.size

        # get all the masks
        for arg_13 in arg_3:
            arg_14, arg_15 = arg_13[0], arg_13[1]
            arg_16 = ~((arg_0['time'] >= arg_14) & (arg_0['time'] <= arg_15))
            arg_12 = arg_12 & arg_16

        # apply the masks
        for arg_7 in arg_4:
            if '.' in arg_7:
                arg_8, arg_9 = arg_7.split('.')
                arg_0[arg_8][arg_9] = arg_0[arg_8][arg_9][arg_12]
            else:
                arg_0[arg_7] = arg_0[arg_7][arg_12]

        arg_10 = arg_0['time'].size
        LOGINFO('removed timestoignore, ndet before = %s, ndet after = %s'
                % (arg_5, arg_10))

    return arg_0

This filters the Kepler lcdict removing nans and bad observations .


def Func(arg_0, arg_1):
        """Register a model in self."""
        arg_0.models[arg_1._meta.table_name] = arg_1
        arg_1._meta.database = arg_0.database
        return arg_1


def
Func
(
arg_0
,
arg_1
=
0
)
:
arg_2
=
[
]
def
_print
(
arg_3
,
arg_4
=
0
)
:
arg_2
.
append
(
_pad
(
arg_3
,
arg_4
=
arg_4
)
)
def
_pad
(
arg_3
,
arg_4
=
0
)
:
arg_5
=
'  '
*
(
arg_1
+
arg_4
)
arg_6
=
[
arg_5
+
line
for
line
in
arg_3
.
split
(
'\n'
)
]
return
'\n'
.
join
(
arg_6
)
def
_format_path
(
arg_7
)
:
def
_format
(
arg_8
)
:
if
isinstance
(
arg_8
,
str
)
:
return
'.{}'
.
format
(
arg_8
)
return
'[{}]'
.
format
(
arg_8
)
return
''
.
join
(
[
'<root>'
]
+
list
(
map
(
_format
,
arg_7
)
)
)
_print
(
'\'{}\' failed @ \'{}\' because of:'
.
format
(
arg_0
.
validator
,
_format_path
(
arg_0
.
absolute_path
)
)
)
if
not
arg_0
.
context
:
_print
(
str
(
arg_0
.
message
)
,
arg_4
=
1
)
else
:
for
arg_9
in
arg_0
.
context
:
arg_2
.
append
(
Func
(
arg_9
,
arg_1
+
1
)
)
return
'\n'
.
join
(
arg_2
)

def Func(arg_0, arg_1=0):
    """Return a cascading explanation of the validation error.

    Returns a cascading explanation of the validation error in the form of::

        <validator> failed @ <subfield_path> because of:
            <validator> failed @ <subfield_path> because of:
                ...
            <validator> failed @ <subfield_path> because of:
                ...
            ...

    For example::

        'oneOf' failed @ '<root>' because of:
            'required' failed @ '<root>.config' because of:
                'meas_level' is a required property

    Meaning the validator 'oneOf' failed while validating the whole object
    because of the validator 'required' failing while validating the property
    'config' because its 'meas_level' field is missing.

    The cascade repeats the format "<validator> failed @ <path> because of"
    until there are no deeper causes. In this case, the string representation
    of the error is shown.

    Args:
        err (jsonschema.ValidationError): the instance to explain.
        level (int): starting level of indentation for the cascade of
            explanations.

    Return:
        str: a formatted string with the explanation of the error.

    """
    arg_2 = []

    def _print(arg_3, arg_4=0):
        arg_2.append(_pad(arg_3, arg_4=arg_4))

    def _pad(arg_3, arg_4=0):
        arg_5 = '  ' * (arg_1 + arg_4)
        arg_6 = [arg_5 + line for line in arg_3.split('\n')]
        return '\n'.join(arg_6)

    def _format_path(arg_7):
        def _format(arg_8):
            if isinstance(arg_8, str):
                return '.{}'.format(arg_8)

            return '[{}]'.format(arg_8)

        return ''.join(['<root>'] + list(map(_format, arg_7)))

    _print('\'{}\' failed @ \'{}\' because of:'.format(
        arg_0.validator, _format_path(arg_0.absolute_path)))

    if not arg_0.context:
        _print(str(arg_0.message), arg_4=1)
    else:
        for arg_9 in arg_0.context:
            arg_2.append(Func(arg_9, arg_1+1))

    return '\n'.join(arg_2)

Return a cascading explanation of the validation error .


return {
        'text': doc['text'],
        'metadata': doc.get('metadata', []),
        'title': doc.get('title', '')
    }

def
Func
(
arg_0
)
:
arg_0
=
dict
(
arg_0
)
if
'text'
not
in
arg_0
:
raise
ValueError
(
"The document {!r} has no text field"
.
format
(
arg_0
)
)
return
{
'text'
:
arg_0
[
'text'
]
,
'metadata'
:
arg_0
.
get
(
'metadata'
,
[
]
)
,
'title'
:
arg_0
.
get
(
'title'
,
''
)
}

def Func(arg_0):
    """
    Limit a document to just the three fields we should upload.
    """
    # Mutate a copy of the document to fill in missing fields
    arg_0 = dict(arg_0)
    if 'text' not in arg_0:
        raise ValueError("The document {!r} has no text field".format(arg_0))
    return {
        'text': arg_0['text'],
        'metadata': arg_0.get('metadata', []),
        'title': arg_0.get('title', '')
    }

Limit a document to just the three fields we should upload .


def Func ( arg_0 ) : arg_1 = np . array ( arg_0 . find_overlaps ( index = True ) ) if not arg_1 . any ( ) : return for arg_2 in arg_1 : arg_3 = arg_0 [ arg_2 ] . copy ( ) arg_4 = arg_0 [ arg_2 + 1 ] . copy ( ) del arg_0 [ arg_2 ] del arg_0 [ arg_2 ] arg_5 = arg_3 . merge ( arg_4 ) arg_0 . __insert ( arg_2 , arg_5 ) arg_1 += 1 return

def Func(arg_0):
        """
        Merges overlaps by merging overlapping Intervals.

        The function takes no arguments and returns ``None``. It operates on
        the striplog 'in place'

        TODO: This function will not work if any interval overlaps more than
            one other intervals at either its base or top.
        """
        arg_1 = np.array(arg_0.find_overlaps(index=True))

        if not arg_1.any():
            return

        for arg_2 in arg_1:
            arg_3 = arg_0[arg_2].copy()
            arg_4 = arg_0[arg_2 + 1].copy()

            # Get rid of the before and after pieces.
            del arg_0[arg_2]
            del arg_0[arg_2]

            # Make the new piece.
            arg_5 = arg_3.merge(arg_4)

            # Insert it.
            arg_0.__insert(arg_2, arg_5)

            arg_1 += 1

        return

Merges overlaps by merging overlapping Intervals .


Delete the key and return true if the key was deleted, else false

def Func ( arg_0 , arg_1 ) : arg_0 . db . remove ( Query ( ) . name == arg_1 ) return arg_0 . get ( arg_1 ) == { }

def Func(arg_0, arg_1):
        """Delete the key and return true if the key was Funcd, else false
        """
        arg_0.db.remove(Query().name == arg_1)
        return arg_0.get(arg_1) == {}

Delete the key and return true if the key was deleted else false


(self, stanza_namespace, stream_from, stream_to,
                        stream_id = None, version = u'1.0', language = None)

def Func(arg_0, arg_1, arg_2, arg_3,
                        arg_4 = None, arg_5 = u'1.0', arg_6 = None):
        """
        Send stream head via the transport.

        :Parameters:
            - `stanza_namespace`: namespace of stream stanzas (e.g.
              'jabber:client')
            - `stream_from`: the 'from' attribute of the stream. May be `None`.
            - `stream_to`: the 'to' attribute of the stream. May be `None`.
            - `version`: the 'version' of the stream.
            - `language`: the 'xml:lang' of the stream
        :Types:
            - `stanza_namespace`: `unicode`
            - `stream_from`: `unicode`
            - `stream_to`: `unicode`
            - `version`: `unicode`
            - `language`: `unicode`
        """
        # pylint: disable=R0913
        with arg_0.lock:
            arg_0._serializer = XMPPSerializer(arg_1,
                                            arg_0.settings["extra_ns_prefixes"])
            arg_8 = arg_0._serializer.emit_head(arg_2, arg_3,
                                                arg_4, arg_5, arg_6)
            arg_0._write(arg_8.encode("utf-8"))


return (metric.latest_count(frequency=params['frequency'], count=not params['cumulative'],
        cumulative=params['cumulative']), params['min'], params['max'])

def Func ( arg_0 ) : arg_1 = get_gecko_params ( arg_0 , cumulative = True ) arg_2 = Metric . objects . get ( uid = arg_1 [ 'uid' ] ) return ( arg_2 . latest_count ( frequency = arg_1 [ 'frequency' ] , count = not arg_1 [ 'cumulative' ] , cumulative = arg_1 [ 'cumulative' ] ) , arg_1 [ 'min' ] , arg_1 [ 'max' ] )

def Func(arg_0):
    """
    Returns a Geck-o-Meter control for the specified metric.
    """

    arg_1 = get_gecko_params(arg_0, cumulative=True)
    arg_2 = Metric.objects.get(uid=arg_1['uid'])

    return (arg_2.latest_count(frequency=arg_1['frequency'], count=not arg_1['cumulative'],
        cumulative=arg_1['cumulative']), arg_1['min'], arg_1['max'])

Returns a Geck - o - Meter control for the specified metric .


def Func ( arg_0 ) : if not arg_0 : yield None arg_1 = ( '\[(?P<grp>[^]]+)\]|' '(?P<chr>.)' ) for arg_2 in arg_0 . split ( '|' ) : arg_3 = re . match ( arg_1 , arg_2 ) if arg_3 . group ( 'grp' ) : arg_4 = group_iterator ( arg_3 . group ( 'grp' ) ) else : arg_4 = [ arg_3 . group ( 'chr' ) ] for arg_5 in arg_4 : if arg_2 [ arg_3 . end ( ) : ] : for arg_6 in Func ( arg_2 [ arg_3 . end ( ) : ] ) : yield arg_5 + arg_6 else : yield arg_5

def Func(arg_0):
    """
    Very reduced regular expressions for describing a group of registers.

    Only groups in square bracktes and unions with pipes (|) are supported.

    Examples:
    >>> list(Func('PMC[0-3]'))
    ['PMC0', 'PMC1', 'PMC2', 'PMC3']
    >>> list(Func('MBOX0C[01]'))
    ['MBOX0C0', 'MBOX0C1']
    >>> list(Func('CBOX2C1'))
    ['CBOX2C1']
    >>> list(Func('CBOX[0-3]C[01]'))
    ['CBOX0C0', 'CBOX0C1', 'CBOX1C0', 'CBOX1C1', 'CBOX2C0', 'CBOX2C1', 'CBOX3C0', 'CBOX3C1']
    >>> list(Func('PMC[0-1]|PMC[23]'))
    ['PMC0', 'PMC1', 'PMC2', 'PMC3']

    """
    if not arg_0:
        yield None
    arg_1 = ('\[(?P<grp>[^]]+)\]|'
                 '(?P<chr>.)')
    for arg_2 in arg_0.split('|'):
        arg_3 = re.match(arg_1, arg_2)

        if arg_3.group('grp'):
            arg_4 = group_iterator(arg_3.group('grp'))
        else:
            arg_4 = [arg_3.group('chr')]

        for arg_5 in arg_4:
            if arg_2[arg_3.end():]:
                for arg_6 in Func(arg_2[arg_3.end():]):
                    yield arg_5 + arg_6
            else:
                yield arg_5

Very reduced regular expressions for describing a group of registers.

    Only groups in square bracktes and unions with pipes (|) are supported.

    Examples:
    >>> list(register_options('PMC[0-3]'))
    ['PMC0', 'PMC1', 'PMC2', 'PMC3']
    >>> list(register_options('MBOX0C[01]'))
    ['MBOX0C0', 'MBOX0C1']
    >>> list(register_options('CBOX2C1'))
    ['CBOX2C1']
    >>> list(register_options('CBOX[0-3]C[01]'))
    ['CBOX0C0', 'CBOX0C1', 'CBOX1C0', 'CBOX1C1', 'CBOX2C0', 'CBOX2C1', 'CBOX3C0', 'CBOX3C1']
    >>> list(register_options('PMC[0-1]|PMC[23]'))
    ['PMC0', 'PMC1', 'PMC2', 'PMC3']

Very reduced regular expressions for describing a group of registers .


def Func ( arg_0 , arg_1 = False ) : arg_0 . root_allowed = arg_1 scan_devices ( arg_0 . on_push , lambda d : d . src . lower ( ) in arg_0 . devices , arg_0 . settings . get ( 'interface' ) )

def Func(arg_0, arg_1=False):
        """Start daemon mode

        :param bool root_allowed: Only used for ExecuteCmd
        :return: loop
        """
        arg_0.root_allowed = arg_1
        scan_devices(arg_0.on_push, lambda d: d.src.lower() in arg_0.devices, arg_0.settings.get('interface'))


def Func ( arg_0 ) : arg_1 = ( yield from arg_0 . handle_int ( arg_0 . API . get ( 'mute' ) ) ) return bool ( arg_1 )

def Func(arg_0):
        """Check if the device is muted."""
        arg_1 = (yield from arg_0.handle_int(arg_0.API.get('mute')))
        return bool(arg_1)


wait until all jobs finish and return a list of pids

def Func ( arg_0 ) : arg_1 = [ ] while arg_0 . running_procs : arg_1 . extend ( arg_0 . poll ( ) ) return arg_1

def Func(arg_0):
        """Func until all jobs finish and return a list of pids
        """
        arg_1 = [ ]
        while arg_0.running_procs:
            arg_1.extend(arg_0.poll())
        return arg_1


This selectively calls the child create method based on whether or not validation failed for each payload.

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if 'non_field_errors' not in arg_3 and not any ( isinstance ( arg_3 [ arg_4 ] , list ) for arg_4 in arg_3 ) : arg_2 . append ( arg_0 . child . Func ( arg_3 ) ) else : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """
        This selectively calls the child Func method based on whether or not validation failed for each payload.
        """
        arg_2 = []
        for arg_3 in arg_1:
            if 'non_field_errors' not in arg_3 and not any(isinstance(arg_3[arg_4], list) for arg_4 in arg_3):
                arg_2.append(arg_0.child.Func(arg_3))
            else:
                arg_2.append(arg_3)

        return arg_2

This selectively calls the child create method based on whether or not validation failed for each payload .


def
Func
(
*
arg_0
)
:
def
decorator
(
arg_1
)
:
@
wraps
(
arg_1
)
def
wrapper
(
*
arg_2
,
**
arg_3
)
:
arg_4
=
arg_0
[
0
]
if
len
(
arg_0
)
==
2
:
arg_5
=
arg_0
[
1
]
else
:
arg_5
=
arg_4
arg_6
=
arg_2
[
0
]
if
arg_6
.
method
!=
'POST'
:
logger
.
error
(
'POST required for this url'
)
raise
Http404
(
'only POST allowed for this url'
)
if
arg_4
not
in
arg_6
.
POST
:
arg_7
=
'Expected field named %s in POST'
%
arg_4
logger
.
error
(
arg_7
)
raise
Http404
(
arg_7
)
setattr
(
arg_6
,
arg_5
,
json
.
loads
(
arg_6
.
POST
[
arg_4
]
)
)
return
arg_1
(
*
arg_2
,
**
arg_3
)
return
wrapper
return
decorator

def Func(*arg_0):
    """View decorator that enforces that the method was called using POST and
    contains a field containing a JSON dictionary. This method should
    only be used to wrap views and assumes the first argument of the method
    being wrapped is a ``request`` object.

    .. code-block:: python

        @Func('data', 'json_data')
        def some_view(request):
            username = request.json_data['username']

    :param field:
        The name of the POST field that contains a JSON dictionary
    :param request_name:
        [optional] Name of the parameter on the request to put the
        deserialized JSON data. If not given the field name is used

    """
    def decorator(arg_1):
        @wraps(arg_1)
        def wrapper(*arg_2, **arg_3):
            arg_4 = arg_0[0]
            if len(arg_0) == 2:
                arg_5 = arg_0[1]
            else:
                arg_5 = arg_4

            arg_6 = arg_2[0]
            if arg_6.method != 'POST':
                logger.error('POST required for this url')
                raise Http404('only POST allowed for this url')

            if arg_4 not in arg_6.POST:
                arg_7 = 'Expected field named %s in POST' % arg_4
                logger.error(arg_7)
                raise Http404(arg_7)

            # deserialize the JSON and put it in the request
            setattr(arg_6, arg_5, json.loads(arg_6.POST[arg_4]))

            # everything verified, run the view
            return arg_1(*arg_2, **arg_3)
        return wrapper
    return decorator

View decorator that enforces that the method was called using POST and
    contains a field containing a JSON dictionary. This method should
    only be used to wrap views and assumes the first argument of the method
    being wrapped is a ``request`` object.

    .. code-block:: python

        @json_post_required('data', 'json_data')
        def some_view(request):
            username = request.json_data['username']

    :param field:
        The name of the POST field that contains a JSON dictionary
    :param request_name:
        [optional] Name of the parameter on the request to put the
        deserialized JSON data. If not given the field name is used

View decorator that enforces that the method was called using POST and contains a field containing a JSON dictionary . This method should only be used to wrap views and assumes the first argument of the method being wrapped is a request object .


def
Func
(
arg_0
,
arg_1
=
10
)
:
if
arg_1
<=
3
:
raise
ValueError
(
"max length must be larger than 3"
)
if
len
(
arg_0
)
>
arg_1
:
arg_0
=
"{}..."
.
format
(
arg_0
[
0
:
arg_1
3
]
)
return
arg_0

def Func(
        arg_0,
        arg_1=10):
    """
    Format a UUID string

    :param str uuid: UUID to format
    :param int max_length: Maximum length of result string (> 3)
    :return: Formatted UUID
    :rtype: str
    :raises ValueError: If *max_length* is not larger than 3

    This function formats a UUID so it is not longer than *max_length*
    characters. The resulting string is returned. It does so by replacing
    characters at the end of the *uuid* with three dots, if necessary.
    The idea is that the start of the *uuid* is the most important part
    to be able to identify the related entity.

    The default *max_length* is 10, which will result in a string
    containing the first 7 characters of the *uuid* passed in. Most of
    the time, such a string is still unique within a collection of UUIDs.
    """
    if arg_1 <= 3:
        raise ValueError("max length must be larger than 3")

    if len(arg_0) > arg_1:
        arg_0 = "{}...".format(arg_0[0:arg_1-3])

    return arg_0


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
:
arg_3
=
f
.
FilterRunner
(
arg_1
,
arg_0
)
if
arg_3
.
is_valid
(
)
:
return
arg_3
.
cleaned_data
else
:
raise
with_context
(
exc
=
ValueError
(
'{message} ({error_codes}) '
'(`exc.context["filter_errors"]` '
'contains more information).'
.
format
(
message
=
arg_2
,
error_codes
=
arg_3
.
error_codes
,
)
,
)
,
context
=
{
'filter_errors'
:
arg_3
.
get_errors
(
with_context
=
True
)
,
}
,
)
return
arg_0

def Func(arg_0, arg_1, arg_2):
    # type: (dict, Optional[f.BaseFilter], Text) -> dict
    """
    Applies a filter to a value.  If the value does not pass the
    filter, an exception will be raised with lots of contextual info
    attached to it.
    """
    if arg_1:
      arg_3 = f.FilterRunner(arg_1, arg_0)

      if arg_3.is_valid():
        return arg_3.cleaned_data
      else:
        raise with_context(
          exc = ValueError(
            '{message} ({error_codes}) '
            '(`exc.context["filter_errors"]` '
            'contains more information).'.format(
              message     = arg_2,
              error_codes = arg_3.error_codes,
            ),
          ),

          context = {
            'filter_errors': arg_3.get_errors(with_context=True),
          },
        )

    return arg_0

Applies a filter to a value . If the value does not pass the filter an exception will be raised with lots of contextual info attached to it .


def Func ( arg_0 ) : arg_1 = arg_0 [ '_deposit' ] [ 'pid' ] [ 'type' ] arg_2 = arg_0 [ '_deposit' ] [ 'pid' ] [ 'value' ] arg_3 = Resolver ( arg_1 = arg_1 , object_type = 'rec' , getter = partial ( arg_0 . published_record_class . get_record , with_deleted = True ) ) return arg_3 . resolve ( arg_2 )

def Func(arg_0):
        """Return a tuple with PID and published record."""
        arg_1 = arg_0['_deposit']['pid']['type']
        arg_2 = arg_0['_deposit']['pid']['value']

        arg_3 = Resolver(
            arg_1=arg_1, object_type='rec',
            getter=partial(arg_0.published_record_class.get_record,
                           with_deleted=True)
        )
        return arg_3.resolve(arg_2)

Return a tuple with PID and published record .


def Func(arg_0, arg_1):
    """Upload the package to an index server.

    This implies cleaning and re-building the package.

    :param repo: Required. Name of the index server to Func to, as specifies
        in your .pypirc configuration file.
    """
    arg_2 = ' '.join(
        shlex.quote(str(n))
        for n in ROOT.joinpath('dist').glob('pipfile[-_]cli-*')
    )
    arg_0.run(f'twine Func --repository="{repo}" {artifacts}')

Upload the package to an index server.

    This implies cleaning and re-building the package.

    :param repo: Required. Name of the index server to upload to, as specifies
        in your .pypirc configuration file.


def Func ( arg_0 , arg_1 : arg_2 . Capture ) -> [ ast . stmt ] or ast . expr : return ast . Name ( 'scope_not_implemented' , ast . Load ( ) ) raise NotImplementedError ( )

def Func(arg_0, arg_1: arg_2.Capture) -> [ast.stmt] or ast.expr:
        """Generates python code for a scope.

        if not self.begin():
            return False
        res = self.pt()
        if not self.end():
            return False
        return res
        """
        return ast.Name('scope_not_implemented', ast.Load())
        raise NotImplementedError()


(self, token, item_id, filename, checksum=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : arg_5 = dict ( ) arg_5 [ 'token' ] = arg_1 arg_5 [ 'itemid' ] = arg_2 arg_5 [ 'filename' ] = arg_3 if arg_4 is not None : arg_5 [ 'checksum' ] = arg_4 arg_6 = arg_0 . request ( 'midas.upload.generatetoken' , arg_5 ) return arg_6 [ 'token' ]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Generate a token to use for upload.

        Midas Server uses a individual token for each upload. The token
        corresponds to the file specified and that file only. Passing the MD5
        checksum allows the server to determine if the file is already in the
        asset store.

        If :param:`checksum` is passed and the token returned is blank, the
        server already has this file and there is no need to follow this
        call with a call to `perform_upload`, as the passed in file will have
        been added as a bitstream to the item's latest revision, creating a
        new revision if one doesn't exist.

        :param token: A valid token for the user in question.
        :type token: string
        :param item_id: The id of the item in which to upload the file as a
            bitstream.
        :type item_id: int | long
        :param filename: The name of the file to generate the upload token for.
        :type filename: string
        :param checksum: (optional) The checksum of the file to upload.
        :type checksum: None | string
        :returns: String of the upload token.
        :rtype: string
        """
        arg_5 = dict()
        arg_5['token'] = arg_1
        arg_5['itemid'] = arg_2
        arg_5['filename'] = arg_3
        if arg_4 is not None:
            arg_5['checksum'] = arg_4
        arg_6 = arg_0.request('midas.upload.generatetoken', arg_5)
        return arg_6['token']


(input_file, output_file,
                         block_selection='auto',
                         pointer_increment='auto_with_manual_fallback',
                         debug=False)

def Func(arg_0, arg_1,
                         arg_2='auto',
                         arg_3='auto_with_manual_fallback',
                         arg_4=False):
    """
    Add IACA markers to an assembly file.

    If instrumentation fails because loop increment could not determined automatically, a ValueError
    is raised.

    :param input_file: file-like object to read from
    :param output_file: file-like object to write to
    :param block_selection: index of the assembly block to instrument, or 'auto' for automatically
                            using block with the
                            most vector instructions, or 'manual' to read index to prompt user
    :param pointer_increment: number of bytes the pointer is incremented after the loop or
                              - 'auto': automatic detection, otherwise RuntimeError is raised
                              - 'auto_with_manual_fallback': like auto with fallback to manual input
                              - 'manual': prompt user
    :param debug: output additional internal analysis information. Only works with manual selection.
    :return: the instrumented assembly block
    """
    arg_5 = arg_0.readlines()

    # If input and output files are the same, overwrite with output
    if arg_0 is arg_1:
        arg_1.seek(0)
        arg_1.truncate()

    if arg_4:
        arg_2 = 'manual'

    arg_6 = strip_and_uncomment(copy(arg_5))
    arg_6 = strip_unreferenced_labels(arg_6)
    arg_7 = find_asm_blocks(arg_6)
    if arg_2 == 'auto':
        arg_8 = select_best_block(arg_7)
    elif arg_2 == 'manual':
        arg_8 = userselect_block(arg_7, default=select_best_block(arg_7), arg_4=arg_4)
    elif isinstance(arg_2, int):
        arg_8 = arg_2
    else:
        raise ValueError("block_selection has to be an integer, 'auto' or 'manual' ")

    arg_9 = arg_7[arg_8][1]

    if arg_3 == 'auto':
        if arg_9['pointer_increment'] is None:
            raise RuntimeError("pointer_increment could not be detected automatically. Use "
                               "--pointer-increment to set manually to byte offset of store "
                               "pointer address between consecutive assembly block iterations.")
    elif arg_3 == 'auto_with_manual_fallback':
        if arg_9['pointer_increment'] is None:
            arg_9['pointer_increment'] = userselect_increment(arg_9)
    elif arg_3 == 'manual':
        arg_9['pointer_increment'] = userselect_increment(arg_9)
    elif isinstance(arg_3, int):
        arg_9['pointer_increment'] = arg_3
    else:
        raise ValueError("pointer_increment has to be an integer, 'auto', 'manual' or  "
                         "'auto_with_manual_fallback' ")

    arg_10 = insert_markers(arg_5, arg_9['first_line'], arg_9['last_line'])
    arg_1.writelines(arg_10)

    return arg_9


def Func(arg_0):
        ''' Renew lock on itself if find queue name or topic name and subscription
        name. '''
        if arg_0._queue_name:
            arg_0.service_bus_service.Func_queue_message(
                arg_0._queue_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        elif arg_0._topic_name and arg_0._subscription_name:
            arg_0.service_bus_service.Func_subscription_message(
                arg_0._topic_name,
                arg_0._subscription_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        else:
            raise AzureServiceBusPeekLockError(_ERROR_MESSAGE_NOT_PEEK_LOCKED_ON_RENEW_LOCK)

Renew lock on itself if find queue name or topic name and subscription name .


"         was moved to the cheroot project."

"         Consider using --server=cheroot."

def Func(arg_0, arg_1, arg_2):
    """Run WsgiDAV using cherrypy.wsgiserver if CherryPy is installed."""
    assert arg_2 == "cherrypy-wsgiserver"

    try:
        from cherrypy import arg_4
        from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter

        _logger.warning("WARNING: cherrypy.wsgiserver is deprecated.")
        _logger.warning(
            "         Starting with CherryPy 9.0 the functionality from cherrypy.wsgiserver"
        )
        _logger.warning("         was moved to the cheroot project.")
        _logger.warning("         Consider using --server=cheroot.")
    except ImportError:
        _logger.error("*" * 78)
        _logger.error("ERROR: Could not import cherrypy.wsgiserver.")
        _logger.error(
            "Try `pip install cherrypy` or specify another server using the --server option."
        )
        _logger.error("Note that starting with CherryPy 9.0, the server was moved to")
        _logger.error(
            "the cheroot project, so it is recommended to use `-server=cheroot`"
        )
        _logger.error("and run `pip install cheroot` instead.")
        _logger.error("*" * 78)
        raise

    arg_3 = "WsgiDAV/{} {} Python/{}".format(
        __version__, arg_4.CherryPyWSGIServer.version, util.PYTHON_VERSION
    )
    arg_4.CherryPyWSGIServer.version = arg_3

    # Support SSL
    arg_7 = _get_checked_path(arg_1.get("ssl_certificate"), arg_1)
    arg_8 = _get_checked_path(arg_1.get("ssl_private_key"), arg_1)
    arg_9 = _get_checked_path(
        arg_1.get("ssl_certificate_chain"), arg_1
    )
    arg_10 = "http"
    if arg_7:
        assert arg_8
        arg_4.CherryPyWSGIServer.ssl_adapter = BuiltinSSLAdapter(
            arg_7, arg_8, arg_9
        )
        arg_10 = "https"
        _logger.info("SSL / HTTPS enabled.")

    _logger.info("Running {}".format(arg_3))
    _logger.info(
        "Serving on {}://{}:{} ...".format(arg_10, arg_1["host"], arg_1["port"])
    )

    arg_12 = {
        "bind_addr": (arg_1["host"], arg_1["port"]),
        "wsgi_app": arg_0,
        "server_name": arg_3,
    }
    # Override or add custom args
    arg_12.update(arg_1.get("server_args", {}))

    arg_13 = arg_4.CherryPyWSGIServer(**arg_12)

    # If the caller passed a startup event, monkey patch the server to set it
    # when the request handler loop is entered
    arg_14 = arg_1.get("startup_event")
    if arg_14:

        def _patched_tick():
            arg_13.tick = arg_16  # undo the monkey patch
            arg_16()
            _logger.info("CherryPyWSGIServer is ready")
            arg_14.set()

        arg_16 = arg_13.tick
        arg_13.tick = _patched_tick

    try:
        arg_13.start()
    except KeyboardInterrupt:
        _logger.warning("Caught Ctrl-C, shutting down...")
    finally:
        arg_13.stop()
    return

Run WsgiDAV using cherrypy . wsgiserver if CherryPy is installed .


def Func ( arg_0 ) : arg_1 = arg_0 . getElementsByTagName ( "graphml" ) [ 0 ] arg_2 = arg_1 . getElementsByTagName ( "graph" ) [ 0 ] arg_3 = arg_2 . getAttribute ( 'id' ) arg_4 = Graph ( arg_3 ) for arg_5 in arg_2 . getElementsByTagName ( "node" ) : arg_6 = arg_4 . add_node ( id = arg_5 . getAttribute ( 'id' ) ) for arg_7 in arg_5 . getElementsByTagName ( "data" ) : if arg_7 . firstChild : arg_6 [ arg_7 . getAttribute ( "key" ) ] = arg_7 . firstChild . data else : arg_6 [ arg_7 . getAttribute ( "key" ) ] = "" for arg_9 in arg_2 . getElementsByTagName ( "edge" ) : arg_10 = arg_9 . getAttribute ( 'source' ) arg_11 = arg_9 . getAttribute ( 'target' ) arg_12 = arg_4 . add_edge_by_id ( arg_10 , arg_11 ) for arg_7 in arg_9 . getElementsByTagName ( "data" ) : if arg_7 . firstChild : arg_12 [ arg_7 . getAttribute ( "key" ) ] = arg_7 . firstChild . data else : arg_12 [ arg_7 . getAttribute ( "key" ) ] = "" return arg_4

def Func(arg_0):
        """Parse dom into a Graph.

        :param dom: dom as returned by minidom.parse or minidom.parseString
        :return: A Graph representation
        """
        arg_1 = arg_0.getElementsByTagName("graphml")[0]
        arg_2 = arg_1.getElementsByTagName("graph")[0]
        arg_3 = arg_2.getAttribute('id')

        arg_4 = Graph(arg_3)

        # # Get attributes
        # attributes = []
        # for attr in root.getElementsByTagName("key"):
        #     attributes.append(attr)

        # Get nodes
        for arg_5 in arg_2.getElementsByTagName("node"):
            arg_6 = arg_4.add_node(id=arg_5.getAttribute('id'))

            for arg_7 in arg_5.getElementsByTagName("data"):
                if arg_7.firstChild:
                    arg_6[arg_7.getAttribute("key")] = arg_7.firstChild.data
                else:
                    arg_6[arg_7.getAttribute("key")] = ""

        # Get edges
        for arg_9 in arg_2.getElementsByTagName("edge"):
            arg_10 = arg_9.getAttribute('source')
            arg_11 = arg_9.getAttribute('target')

            # source/target attributes refer to IDs: http://graphml.graphdrawing.org/xmlns/1.1/graphml-structure.xsd
            arg_12 = arg_4.add_edge_by_id(arg_10, arg_11)

            for arg_7 in arg_9.getElementsByTagName("data"):
                if arg_7.firstChild:
                    arg_12[arg_7.getAttribute("key")] = arg_7.firstChild.data
                else:
                    arg_12[arg_7.getAttribute("key")] = ""

        return arg_4


def Func ( arg_0 , arg_1 = None ) : if arg_0 . find ( os . sep ) != - 1 : return arg_0 if arg_1 is None : arg_1 = os . environ [ 'PATH' ] . split ( os . pathsep ) for arg_2 in arg_1 : arg_3 = osp . join ( arg_2 , arg_0 ) if osp . exists ( arg_3 ) : return arg_3 return arg_0

def Func(arg_0, arg_1=None):
    """Do a shell-like path lookup for py_script and return the results.
    If we can't find anything return py_script"""
    if arg_0.find(os.sep) != -1:
        # Don't search since this name has path separator components
        return arg_0
    if arg_1 is None:
        arg_1 = os.environ['PATH'].split(os.pathsep)
    for arg_2 in arg_1:
        arg_3 = osp.join(arg_2, arg_0)
        if osp.exists(arg_3):
            return arg_3
    # Failure
    return arg_0

Do a shell - like path lookup for py_script and return the results . If we can t find anything return py_script


def Func ( arg_0 ) : arg_1 = arg_0 . sections ( ) if not any ( arg_2 . startswith ( 'multiproc_' ) for arg_2 in arg_1 ) : return None arg_3 = NoInterpolationParser ( ) for arg_2 in arg_1 : if arg_2 . startswith ( 'multiproc_' ) : arg_4 = arg_2 . replace ( 'multiproc_' , '' ) arg_3 . add_section ( arg_4 ) arg_5 = arg_0 . options ( arg_2 ) for arg_6 in arg_5 : arg_7 = arg_0 . get ( arg_2 , arg_6 , raw = True ) arg_3 . set ( arg_4 , arg_6 , arg_7 ) return arg_3

def Func(arg_0):
        """ Searches for multiprocessing options within a ConfigParser.

        If such options are found, they are copied (without the `'multiproc_'` prefix)
        into a new parser.

        """
        arg_1 = arg_0.sections()
        if not any(arg_2.startswith('multiproc_') for arg_2 in arg_1):
            return None
        arg_3 = NoInterpolationParser()
        for arg_2 in arg_1:
            if arg_2.startswith('multiproc_'):
                arg_4 = arg_2.replace('multiproc_', '')
                arg_3.add_section(arg_4)
                arg_5 = arg_0.options(arg_2)
                for arg_6 in arg_5:
                    arg_7 = arg_0.get(arg_2, arg_6, raw=True)
                    arg_3.set(arg_4, arg_6, arg_7)
        return arg_3

Searches for multiprocessing options within a ConfigParser .


return [{
            'startDate': parse_datetime_to_epoch_millis(start),
            'endDate': parse_datetime_to_epoch_millis(end),
            'active': current_time_is_in_interval(start, end)
        }]

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( 'start' ) or UNIX_MIN_DATE_STRING arg_3 = arg_1 . get ( 'end' ) or UNIX_MAX_DATE_STRING return [ { 'startDate' : parse_datetime_to_epoch_millis ( arg_2 ) , 'endDate' : parse_datetime_to_epoch_millis ( arg_3 ) , 'active' : current_time_is_in_interval ( arg_2 , arg_3 ) } ]

def Func(arg_0, arg_1):
        """
        Return the schedule of the courseun content item.
        """
        arg_2 = arg_1.get('start') or UNIX_MIN_DATE_STRING
        arg_3 = arg_1.get('end') or UNIX_MAX_DATE_STRING
        return [{
            'startDate': parse_datetime_to_epoch_millis(arg_2),
            'endDate': parse_datetime_to_epoch_millis(arg_3),
            'active': current_time_is_in_interval(arg_2, arg_3)
        }]

Return the schedule of the courseun content item .


If intervals intersect, returns their intersection, otherwise returns None

def Func ( arg_0 , arg_1 ) : if arg_0 . intersects ( arg_1 ) : return Interval ( max ( arg_0 . start , arg_1 . start ) , min ( arg_0 . end , arg_1 . end ) ) else : return None

def Func(arg_0, arg_1):
        '''If intervals intersect, returns their Func, otherwise returns None'''
        if arg_0.intersects(arg_1):
            return Interval(max(arg_0.start, arg_1.start), min(arg_0.end, arg_1.end))
        else:
            return None

If intervals intersect returns their intersection otherwise returns None


def
Func
(
arg_0
)
:
if
not
arg_0
:
return
'   {}'
arg_1
=
[
]
for
arg_2
,
arg_3
in
sorted
(
six
.
iteritems
(
arg_0
)
)
:
if
not
isinstance
(
arg_3
,
DICT_EXPANDED_TYPES
)
:
arg_3
=
'...'
arg_1
.
append
(
_format_dict_item
(
arg_2
,
arg_3
)
)
return
mark_safe
(
u'<br/>'
.
join
(
arg_1
)
)

def Func(arg_0):
    """
    Briefly print the dictionary keys.
    """
    if not arg_0:
        return '   {}'

    arg_1 = []
    for arg_2, arg_3 in sorted(six.iteritems(arg_0)):
        if not isinstance(arg_3, DICT_EXPANDED_TYPES):
            arg_3 = '...'

        arg_1.append(_format_dict_item(arg_2, arg_3))

    return mark_safe(u'<br/>'.join(arg_1))


(self, document, retry=None, timeout=None, metadata=None)

return client.classify_text(document=document, retry=retry, timeout=timeout, metadata=metadata)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Classifies a document into categories.

        :param document: Input document.
            If a dict is provided, it must be of the same form as the protobuf message Document
        :type document: dict or class google.cloud.language_v1.types.Document
        :param retry: A retry object used to retry requests. If None is specified, requests will not be
            retried.
        :type retry: google.api_core.retry.Retry
        :param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
            retry is specified, the timeout applies to each individual attempt.
        :type timeout: float
        :param metadata: Additional metadata that is provided to the method.
        :type metadata: sequence[tuple[str, str]]]
        :rtype: google.cloud.language_v1.types.AnalyzeEntitiesResponse
        """
        arg_5 = arg_0.get_conn()

        return arg_5.Func(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)


def Func ( arg_0 ) : del arg_0 . J arg_0 . J = np . zeros ( [ arg_0 . param_vals . size , arg_0 . data . size ] ) arg_2 = np . zeros_like ( arg_0 . param_vals ) arg_3 = arg_0 . model . copy ( ) for arg_4 in range ( arg_0 . param_vals . size ) : arg_2 *= 0 arg_2 [ arg_4 ] = arg_0 . dl [ arg_4 ] arg_5 = arg_0 . func ( arg_0 . param_vals + arg_2 , * arg_0 . func_args , ** arg_0 . func_kwargs ) arg_6 = ( arg_5 - arg_3 ) / arg_2 [ arg_4 ] arg_0 . J [ arg_4 ] = - arg_6

def Func(arg_0):
        """Updates self.J, returns nothing"""
        del arg_0.J
        arg_0.J = np.zeros([arg_0.param_vals.size, arg_0.data.size])
        arg_2 = np.zeros_like(arg_0.param_vals)
        arg_3 = arg_0.model.copy()
        for arg_4 in range(arg_0.param_vals.size):
            arg_2 *= 0
            arg_2[arg_4] = arg_0.dl[arg_4]
            arg_5 = arg_0.func(arg_0.param_vals + arg_2, *arg_0.func_args, **arg_0.func_kwargs)
            arg_6 = (arg_5 - arg_3) / arg_2[arg_4]
            #J = grad(residuals) = -grad(model)
            arg_0.J[arg_4] = -arg_6


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 [ 0 ] , list ) : return [ arg_0 . estimator . tag ( arg_2 ) for arg_2 in arg_1 ] return arg_0 . estimator . tag ( arg_1 )

def Func(arg_0, arg_1):
        """Predict class labels for samples in X.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape = [n_samples, n_features]
            Samples.
        """
        if isinstance(arg_1[0], list):
            return [arg_0.estimator.tag(arg_2) for arg_2 in arg_1]
        return arg_0.estimator.tag(arg_1)


def Func ( arg_0 ) : arg_0 . setOnMessageReceivedCallback ( None ) arg_0 . setOnNodeConnectedCallback ( None ) arg_0 . setOnNodeDisconnectedCallback ( None ) arg_0 . setOnReadonlyNodeConnectedCallback ( None ) arg_0 . setOnReadonlyNodeDisconnectedCallback ( None ) for arg_1 in arg_0 . _nodes | arg_0 . _readonlyNodes : arg_0 . dropNode ( arg_1 ) if arg_0 . _server is not None : arg_0 . _server . unbind ( ) for arg_2 in arg_0 . _unknownConnections : arg_2 . disconnect ( ) arg_0 . _unknownConnections = set ( )

def Func(arg_0):
        """
        Destroy this transport
        """

        arg_0.setOnMessageReceivedCallback(None)
        arg_0.setOnNodeConnectedCallback(None)
        arg_0.setOnNodeDisconnectedCallback(None)
        arg_0.setOnReadonlyNodeConnectedCallback(None)
        arg_0.setOnReadonlyNodeDisconnectedCallback(None)
        for arg_1 in arg_0._nodes | arg_0._readonlyNodes:
            arg_0.dropNode(arg_1)
        if arg_0._server is not None:
            arg_0._server.unbind()
        for arg_2 in arg_0._unknownConnections:
            arg_2.disconnect()
        arg_0._unknownConnections = set()


def Func ( arg_0 , arg_1 = None ) : if arg_0 . ndim == 1 : arg_0 . shape = ( - 1 , 1 ) arg_3 = len ( arg_0 ) arg_4 = len ( arg_0 [ 0 ] ) if arg_1 is not None : import pdb pdb . set_trace ( ) arg_5 = numpy . random . randint ( 0 , arg_4 , arg_1 ) arg_0 = arg_0 [ : , arg_5 ] arg_6 = numpy . zeros ( arg_0 . shape , dtype = 'int32' ) for arg_7 in xrange ( arg_0 . shape [ 1 ] ) : _fillInOnTimes ( arg_0 [ : , arg_7 ] , arg_6 [ : , arg_7 ] ) arg_8 = arg_0 . sum ( axis = 1 ) arg_8 . clip ( min = 1 , max = numpy . inf , out = arg_8 ) arg_9 = arg_6 . sum ( axis = 1 , dtype = 'float64' ) / arg_8 arg_10 = arg_9 . sum ( ) / ( arg_9 > 0 ) . sum ( ) arg_11 = _accumulateFrequencyCounts ( arg_9 ) return ( arg_10 , arg_11 )

def Func(arg_0, arg_1=None):
  """
  Computes the average on-time of the outputs that are on at each time step, and
  then averages this over all time steps.

  This metric is resiliant to the number of outputs that are on at each time
  step. That is, if time step 0 has many more outputs on than time step 100, it
  won't skew the results. This is particularly useful when measuring the
  average on-time of things like the temporal memory output where you might
  have many columns bursting at the start of a sequence - you don't want those
  start of sequence bursts to over-influence the calculated average on-time.

  Parameters:
  -----------------------------------------------
  vectors:          the vectors for which the onTime is calculated. Row 0
                    contains the outputs from time step 0, row 1 from time step
                    1, etc.
  numSamples:       the number of elements for which on-time is calculated.
                    If not specified, then all elements are looked at.

  Returns  (scalar average on-time over all time steps,
            list containing frequency counts of each encountered on-time)

  """

  # Special case given a 1 dimensional vector: it represents a single column
  if arg_0.ndim == 1:
    arg_0.shape = (-1,1)
  arg_3 = len(arg_0)
  arg_4  = len(arg_0[0])

  # How many samples will we look at?
  if arg_1 is not None:
    import pdb; pdb.set_trace()   # Test this....
    arg_5    = numpy.random.randint(0, arg_4, arg_1)
    arg_0 = arg_0[:, arg_5]

  # Fill in each non-zero of vectors with the on-time that that output was
  #  on for.
  arg_6 = numpy.zeros(arg_0.shape, dtype='int32')
  for arg_7 in xrange(arg_0.shape[1]):
    _fillInOnTimes(arg_0[:,arg_7], arg_6[:,arg_7])

  # Compute the average on time for each time step
  arg_8 = arg_0.sum(axis=1)
  arg_8.clip(min=1, max=numpy.inf, out=arg_8)
  arg_9 = arg_6.sum(axis=1, dtype='float64') / arg_8
  arg_10 = arg_9.sum() / (arg_9 > 0).sum()

  # Generate the frequency counts for each duration
  arg_11 = _accumulateFrequencyCounts(arg_9)
  return (arg_10, arg_11)

Computes the average on - time of the outputs that are on at each time step and then averages this over all time steps .


(
    func_body,
    func_type=None,
    indent=2,
    format_locals=True,
)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
2
,
arg_3
=
True
,
)
:
if
arg_1
is
:
yield
'func'
else
:
arg_4
=
' (param {})'
.
format
(
' '
.
join
(
map
(
format_lang_type
,
arg_1
.
param_types
)
)
)
if
arg_1
.
param_types
else
''
arg_5
=
' (result {})'
.
format
(
format_lang_type
(
arg_1
.
return_type
)
)
if
arg_1
.
return_type
else
''
yield
'func'
+
arg_4
+
arg_5
if
arg_3
and
arg_0
.
locals
:
yield
'(locals {})'
.
format
(
' '
.
join
(
itertools
.
chain
.
from_iterable
(
itertools
.
repeat
(
format_lang_type
(
arg_6
.
type
)
,
arg_6
.
count
)
for
arg_6
in
arg_0
.
locals
)
)
)
arg_7
=
1
for
arg_8
in
decode_bytecode
(
arg_0
.
code
)
:
if
arg_8
.
op
.
flags
&
INSN_LEAVE_BLOCK
:
arg_7
-=
1
yield
' '
*
(
arg_7
*
arg_2
)
+
format_instruction
(
arg_8
)
if
arg_8
.
op
.
flags
&
INSN_ENTER_BLOCK
:
arg_7
+=
1

def Func(
    arg_0,
    arg_1=None,
    arg_2=2,
    arg_3=True,
):
    """
    Takes a `FunctionBody` and optionally a `FunctionType`, yielding the string
    representation of the function line by line. The function type is required
    for formatting function parameter and return value information.
    """
    if arg_1 is None:
        yield 'func'
    else:
        arg_4 = ' (param {})'.format(' '.join(
            map(format_lang_type, arg_1.param_types)
        )) if arg_1.param_types else ''
        arg_5 = ' (result {})'.format(
            format_lang_type(arg_1.return_type)
        ) if arg_1.return_type else ''
        yield 'func' + arg_4 + arg_5

    if arg_3 and arg_0.locals:
        yield '(locals {})'.format(' '.join(itertools.chain.from_iterable(
            itertools.repeat(format_lang_type(arg_6.type), arg_6.count)
            for arg_6 in arg_0.locals
        )))

    arg_7 = 1
    for arg_8 in decode_bytecode(arg_0.code):
        if arg_8.op.flags & INSN_LEAVE_BLOCK:
            arg_7 -= 1
        yield ' ' * (arg_7 * arg_2) + format_instruction(arg_8)
        if arg_8.op.flags & INSN_ENTER_BLOCK:
            arg_7 += 1

Takes a FunctionBody and optionally a FunctionType yielding the string representation of the function line by line . The function type is required for formatting function parameter and return value information .


def Func(arg_0=None, arg_1=False, **arg_2):
    '''
       get the correct client depending on the driver of interest. The
       selected client can be chosen based on the environment variable
       SREGISTRY_CLIENT, and later changed based on the image uri parsed
       If there is no preference, the default is to load the singularity
       hub client.

       Parameters
       ==========
       image: if provided, we derive the correct client based on the uri
       of an image. If not provided, we default to environment, then hub.
       quiet: if True, suppress most output about the client (e.g. speak)

    '''
    from sregistry.defaults import arg_4

    # Give the user a warning:
    if not check_install():
        bot.warning('Singularity is not installed, function might be limited.')

    # If an image is provided, use to determine client
    arg_3 = get_uri(arg_0)
    if arg_3 is not None:
        arg_4 = arg_3

    # If no obvious credential provided, we can use SREGISTRY_CLIENT
    if   arg_4 == 'aws': from .aws import arg_5
    elif arg_4 == 'docker': from .docker import arg_5
    elif arg_4 == 'dropbox': from .dropbox import arg_5
    elif arg_4 == 'gitlab': from .gitlab import arg_5
    elif arg_4 == 'globus': from .globus import arg_5
    elif arg_4 == 'nvidia': from .nvidia import arg_5
    elif arg_4 == 'hub': from .hub import arg_5
    elif arg_4 == 'google-drive': from .google_drive import arg_5
    elif arg_4 == 'google-compute': from .google_storage import arg_5
    elif arg_4 == 'google-storage': from .google_storage import arg_5
    elif arg_4 == 'google-build': from .google_build import arg_5
    elif arg_4 == 'registry': from .registry import arg_5
    elif arg_4 == 's3': from .s3 import arg_5
    elif arg_4 == 'swift': from .swift import arg_5
    else: from .hub import arg_5

    arg_5.client_name = arg_4
    arg_5.quiet = arg_1

    # Create credentials cache, if it doesn't exist
    arg_5._credential_cache = get_credential_cache()

    # Add the database, if wanted
    if SREGISTRY_DATABASE is not None:

        # These are global functions used across modules
        from sregistry.database import (
            init_db, arg_8, arg_9, arg_10, arg_12, arg_14, arg_15,
            arg_16, arg_11,
            arg_13,
            arg_18,
            arg_19,
            arg_17
        )

        # Actions
        arg_5._init_db = init_db
        arg_5.add = arg_8
        arg_5.cp = arg_9
        arg_5.get = arg_10
        arg_5.inspect = arg_11
        arg_5.mv = arg_12
        arg_5.rename = arg_13
        arg_5.rm = arg_14
        arg_5.rmi = arg_15
        arg_5.images = arg_16

        # Collections
        arg_5.get_or_create_collection = arg_17
        arg_5.get_container = arg_18
        arg_5.get_collection = arg_19

    # If no database, import dummy functions that return the equivalent
    else:
        from sregistry.database import ( arg_8, init_db )
        arg_5.add = arg_8
        arg_5._init_db = init_db

    # Initialize the database
    arg_20 = arg_5()

    if hasattr(arg_5, '_init_db'):
        arg_20._init_db(SREGISTRY_DATABASE)
    return arg_20

get the correct client depending on the driver of interest . The selected client can be chosen based on the environment variable SREGISTRY_CLIENT and later changed based on the image uri parsed If there is no preference the default is to load the singularity hub client .


(
            self, resource_group_name, automation_account_name, runbook_name, runbook_content, custom_headers=None, raw=False, callback=None, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None, arg_6=False, arg_7=None, arg_8=True, **arg_9):
        """Replaces the runbook draft content.

        :param resource_group_name: Name of an Azure Resource group.
        :type resource_group_name: str
        :param automation_account_name: The name of the automation account.
        :type automation_account_name: str
        :param runbook_name: The runbook name.
        :type runbook_name: str
        :param runbook_content: The runbook draft content.
        :type runbook_content: Generator
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns object or
         ClientRawResponse<object> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[Generator]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[Generator]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
        """
        arg_10 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=True,
            **arg_9
        )

        def get_long_running_output(arg_11):
            arg_12 = {
                'location': 'str',
            }
            arg_13 = arg_0._deserialize('object', arg_11)

            if arg_6:
                arg_14 = ClientRawResponse(arg_13, arg_11)
                arg_14.add_headers(arg_12)
                return arg_14

            return arg_13

        arg_15 = arg_9.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_8 is True: arg_16 = ARMPolling(arg_15, **arg_9)
        elif arg_8 is False: arg_16 = NoPolling()
        else: arg_16 = arg_8
        return LROPoller(arg_0._client, arg_10, get_long_running_output, arg_16)


Signal that this task is done.
        This is completely optional and will just call .update with the remaining work.

def
Func
(
arg_0
,
arg_1
:
arg_2
=
)
:
if
arg_1
is
:
arg_1
=
"{self.name} Func"
.
format
(
**
locals
(
)
)
if
arg_0
.
name
else
"Done"
arg_0
.
update
(
units
=
arg_0
.
total
arg_0
.
worked
,
arg_1
=
arg_1
)

def Func(arg_0, arg_1: arg_2=None):
        """
        Signal that this task is Func.
        This is completely optional and will just call .update with the remaining work.
        """
        if arg_1 is None:
            arg_1 = "{self.name} Func".format(**locals()) if arg_0.name else "Done"
        arg_0.update(units=arg_0.total - arg_0.worked, arg_1=arg_1)

Signal that this task is done . This is completely optional and will just call . update with the remaining work .


def Func(arg_0):
    r"""Nuttall tapering window

    :param N: window length

    .. math:: w(n) = a_0 - a_1 \cos\left(\frac{2\pi n}{N-1}\right)+ a_2 \cos\left(\frac{4\pi n}{N-1}\right)- a_3 \cos\left(\frac{6\pi n}{N-1}\right)

    with :math:`a_0 = 0.355768`, :math:`a_1 = 0.487396`, :math:`a_2=0.144232` and :math:`a_3=0.012604`

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import window_visu
        window_visu(64, 'nuttall', mindB=-80)

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    arg_1 = 0.355768
    arg_2 = 0.487396
    arg_3 = 0.144232
    arg_4 = 0.012604

    return _coeff4(arg_0, arg_1, arg_2, arg_3, arg_4)


def Func(arg_0):
    """
    Sanity checks an actions dict, used to define the action space for an MDP.
    Throws an error or warns if mismatches are found.

    Args:
        actions_spec (Union[None,dict]): The spec-dict to check (or None).

    Returns: Tuple of 1) the action space desc and 2) whether there is only one component in the action space.
    """
    # Leave incoming spec-dict intact.
    arg_1 = copy.deepcopy(arg_0)

    # Unique action shortform.
    arg_2 = ('type' in arg_1)
    if arg_2:
        arg_1 = dict(arg_4=arg_1)

    # Normalize actions.
    for arg_3, arg_4 in arg_1.items():
        # Set default type to int
        if 'type' not in arg_4:
            arg_4['type'] = 'int'

        # Check required values
        if arg_4['type'] == 'int':
            if 'num_actions' not in arg_4:
                raise TensorForceError("Action requires value 'num_actions' set!")
        elif arg_4['type'] == 'float':
            if ('min_value' in arg_4) != ('max_value' in arg_4):
                raise TensorForceError("Action requires both values 'min_value' and 'max_value' set!")

        # Set default shape to empty tuple (single-int, discrete action space)
        if 'shape' not in arg_4:
            arg_4['shape'] = ()

        # Convert int to unary tuple
        if isinstance(arg_4['shape'], int):
            arg_4['shape'] = (arg_4['shape'],)

    return arg_1, arg_2

Sanity checks an actions dict used to define the action space for an MDP . Throws an error or warns if mismatches are found .


return super().sys_openat(dirfd, buf, flags, mode)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        A version of openat that includes a symbolic path and symbolic directory file descriptor

        :param dirfd: directory file descriptor
        :param buf: address of zero-terminated pathname
        :param flags: file access bits
        :param mode: file permission mode
        """

        if issymbolic(arg_1):
            logger.debug("Ask to read from a symbolic directory file descriptor!!")
            # Constrain to a valid fd and one past the end of fds
            arg_0.constraints.add(arg_1 >= 0)
            arg_0.constraints.add(arg_1 <= len(arg_0.files))
            raise ConcretizeArgument(arg_0, 0)

        if issymbolic(arg_2):
            logger.debug("Ask to read to a symbolic buffer")
            raise ConcretizeArgument(arg_0, 1)

        return super().Func(arg_1, arg_2, arg_3, arg_4)