def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
arg_0
.
command
(
"MODE READER"
)
if
not
arg_1
in
[
200
,
201
]
:
raise
NNTPReplyError
(
arg_1
,
arg_2
)
return
arg_1
==
200

def Func(arg_0):
        """MODE READER command.

        Instructs a mode-switching server to switch modes.

        See <http://tools.ietf.org/html/rfc3977#section-5.3>

        Returns:
            Boolean value indicating whether posting is allowed or not.
        """
        arg_1, arg_2 = arg_0.command("MODE READER")
        if not arg_1 in [200, 201]:
            raise NNTPReplyError(arg_1, arg_2)

        return arg_1 == 200


def Func(arg_0, arg_1, arg_2, arg_3):
        """Find a deallocated network segment id and reallocate it.

        NOTE(morgabra) This locks the segment table, but only the rows
        in use by the segment, which is pretty handy if we ever have
        more than 1 segment or segment type.
        """
        LOG.info("Attempting to allocate segment for network %s "
                 "segment_id %s segment_type %s"
                 % (arg_3, arg_2, arg_0.segment_type))

        arg_4 = {
            "segment_id": arg_2,
            "segment_type": arg_0.segment_type,
            "do_not_use": False
        }
        arg_5 = db_api.segment_allocation_range_find(
            arg_1, scope=db_api.ALL, **arg_4)
        arg_6 = [r["id"] for r in arg_5]

        try:
            with arg_1.session.begin(subtransactions=True):
                # Search for any deallocated segment ids for the
                # given segment.
                arg_4 = {
                    "deallocated": True,
                    "segment_id": arg_2,
                    "segment_type": arg_0.segment_type,
                    "segment_allocation_range_ids": arg_6
                }

                # NOTE(morgabra) We select 100 deallocated segment ids from
                # the table here, and then choose 1 randomly. This is to help
                # alleviate the case where an uncaught exception might leave
                # an allocation active on a remote service but we do not have
                # a record of it locally. If we *do* end up choosing a
                # conflicted id, the caller should simply allocate another one
                # and mark them all as reserved. If a single object has
                # multiple reservations on the same segment, they will not be
                # deallocated, and the operator must resolve the conficts
                # manually.
                arg_7 = db_api.segment_allocation_find(
                    arg_1, lock_mode=True, **arg_4).limit(100).all()

                if arg_7:
                    arg_8 = random.choice(arg_7)

                    # Allocate the chosen segment.
                    arg_9 = {
                        "deallocated": False,
                        "deallocated_at": None,
                        "network_id": arg_3
                    }
                    arg_8 = db_api.segment_allocation_update(
                        arg_1, arg_8, **arg_9)
                    LOG.info("Allocated segment %s for network %s "
                             "segment_id %s segment_type %s"
                             % (arg_8["id"], arg_3, arg_2,
                                arg_0.segment_type))
                    return arg_8
        except Exception:
            LOG.exception("Error in segment reallocation.")

        LOG.info("Cannot find reallocatable segment for network %s "
                 "segment_id %s segment_type %s"
                 % (arg_3, arg_2, arg_0.segment_type))

Find a deallocated network segment id and reallocate it .


def Func(arg_0, arg_1, arg_2):
        r"""
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print ''.join(Differ().Func('one\ntwo\nthree\n'.splitlines(1),
        ...                                'ore\ntree\nemu\n'.splitlines(1))),
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        """

        arg_3 = SequenceMatcher(arg_0.linejunk, arg_1, arg_2)
        for arg_4, arg_5, arg_6, arg_7, arg_8 in arg_3.get_opcodes():
            if arg_4 == 'replace':
                arg_9 = arg_0._fancy_replace(arg_1, arg_5, arg_6, arg_2, arg_7, arg_8)
            elif arg_4 == 'delete':
                arg_9 = arg_0._dump('-', arg_1, arg_5, arg_6)
            elif arg_4 == 'insert':
                arg_9 = arg_0._dump('+', arg_2, arg_7, arg_8)
            elif arg_4 == 'equal':
                arg_9 = arg_0._dump(' ', arg_1, arg_5, arg_6)
            else:
                raise ValueError, 'unknown tag %r' % (arg_4,)

            for arg_10 in arg_9:
                yield arg_10

r"""
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print ''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1),
        ...                                'ore\ntree\nemu\n'.splitlines(1))),
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu

r Compare two sequences of lines ; generate the resulting delta .


(text, storage, upper_is_rtl=False, debug=False)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : arg_4 = False arg_5 = arg_1 [ 'base_level' ] for arg_6 in arg_0 : if _IS_UCS2 and ( _SURROGATE_MIN <= ord ( arg_6 ) <= _SURROGATE_MAX ) : arg_4 = arg_6 continue elif arg_4 : arg_6 = arg_4 + arg_6 arg_4 = False if arg_2 and arg_6 . isupper ( ) : arg_7 = 'R' else : arg_7 = bidirectional ( arg_6 ) arg_1 [ 'chars' ] . append ( { 'ch' : arg_6 , 'level' : arg_5 , 'type' : arg_7 , 'orig' : arg_7 } ) if arg_3 : debug_storage ( arg_1 , base_info = True )

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
    """Get the paragraph base embedding level and direction,
    set the storage to the array of chars"""

    arg_4 = False
    arg_5 = arg_1['base_level']

    # preset the storage's chars
    for arg_6 in arg_0:
        if _IS_UCS2 and (_SURROGATE_MIN <= ord(arg_6) <= _SURROGATE_MAX):
            arg_4 = arg_6
            continue
        elif arg_4:
            arg_6 = arg_4 + arg_6
            arg_4 = False

        if arg_2 and arg_6.isupper():
            arg_7 = 'R'
        else:
            arg_7 = bidirectional(arg_6)

        arg_1['chars'].append({
            'ch': arg_6,
            'level': arg_5,
            'type': arg_7,
            'orig': arg_7
        })
    if arg_3:
        debug_storage(arg_1, base_info=True)

Get the paragraph base embedding level and direction set the storage to the array of chars


def Func(arg_0):
        """Get height, width & scale attributes for the beamer page.

        Returns:
            tuple: (height, width, scale) desirable page attributes
        """
        # PIL python package limits image size to around a quarter gigabyte
        # this means the beamer image should be limited to < 50000
        # if you want to avoid a "warning" too, set it to < 25000
        arg_1 = 40000

        # the beamer latex template limits each dimension to < 19 feet
        # (i.e. 575cm)
        arg_2 = 550

        # columns are roughly twice as big as rows
        arg_3 = arg_0.sum_row_heights / arg_0.sum_column_widths

        # choose a page margin so circuit is not cropped
        arg_4 = 1.5
        arg_5 = min(arg_0.sum_row_heights * arg_4, arg_2)
        arg_6 = min(arg_0.sum_column_widths * arg_4, arg_2)

        # if too large, make it fit
        if arg_5 * arg_6 > arg_1:
            arg_5 = min(np.sqrt(arg_1 * arg_3), arg_2)
            arg_6 = min(np.sqrt(arg_1 / arg_3), arg_2)

        # if too small, give it a minimum size
        arg_5 = max(arg_5, 10)
        arg_6 = max(arg_6, 10)

        return (arg_5, arg_6, arg_0.scale)

Get height width & scale attributes for the beamer page .


return [
            f for f in files if f not in bad
            and f not in seen and seen.setdefault(f, 1)  # ditch dupes
        ]

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ( arg_0 . exclude_package_data . get ( '' , [ ] ) + arg_0 . exclude_package_data . get ( arg_1 , [ ] ) ) arg_5 = [ ] for arg_6 in arg_4 : arg_5 . extend ( fnmatch . filter ( arg_3 , os . path . join ( arg_2 , convert_path ( arg_6 ) ) ) ) arg_5 = dict . fromkeys ( arg_5 ) arg_7 = { } return [ arg_8 for arg_8 in arg_3 if arg_8 not in arg_5 and arg_8 not in arg_7 and arg_7 . setdefault ( arg_8 , 1 ) ]

def Func(arg_0, arg_1, arg_2, arg_3):
        """Filter filenames for package's data files in 'src_dir'"""
        arg_4 = (arg_0.exclude_package_data.get('', [])
                 + arg_0.exclude_package_data.get(arg_1, []))
        arg_5 = []
        for arg_6 in arg_4:
            arg_5.extend(
                fnmatch.filter(
                    arg_3, os.path.join(arg_2, convert_path(arg_6))
                )
            )
        arg_5 = dict.fromkeys(arg_5)
        arg_7 = {}
        return [
            arg_8 for arg_8 in arg_3 if arg_8 not in arg_5
            and arg_8 not in arg_7 and arg_7.setdefault(arg_8, 1)  # ditch dupes
        ]

Filter filenames for package s data files in src_dir


def Func ( arg_0 ) : arg_0 . mimetypes . Func ( ) arg_0 . preprocessors . Func ( ) arg_0 . postprocessors . Func ( )

def Func(arg_0):
        """Register default compilers, preprocessors and MIME types."""
        arg_0.mimetypes.Func()
        arg_0.preprocessors.Func()
        arg_0.postprocessors.Func()

Register default compilers preprocessors and MIME types .


def Func ( arg_0 ) : arg_0 . tree . root . up = None arg_0 . tree . root . bad_branch = arg_0 . tree . root . bad_branch if hasattr ( arg_0 . tree . root , 'bad_branch' ) else False arg_5 = 0 for arg_6 in arg_0 . tree . get_nonterminals ( order = 'preorder' ) : arg_5 += 1 if arg_6 . name is None : arg_6 . name = "NODE_" + format ( arg_0 . _internal_node_count , '07d' ) arg_0 . _internal_node_count += 1 for arg_8 in arg_6 . clades : if arg_8 . is_terminal ( ) : arg_8 . bad_branch = arg_8 . bad_branch if hasattr ( arg_8 , 'bad_branch' ) else False arg_8 . up = arg_6 for arg_6 in arg_0 . tree . get_nonterminals ( order = 'postorder' ) : arg_6 . bad_branch = all ( [ arg_8 . bad_branch for arg_8 in arg_6 ] ) arg_0 . _calc_dist2root ( ) arg_0 . _internal_node_count = max ( arg_5 , arg_0 . _internal_node_count )

def Func(arg_0):
        """
        Set auxilliary parameters to every node of the tree.
        """
        arg_0.tree.root.up = None
        arg_0.tree.root.bad_branch=arg_0.tree.root.bad_branch if hasattr(arg_0.tree.root, 'bad_branch') else False
        arg_5 = 0
        for arg_6 in arg_0.tree.get_nonterminals(order='preorder'): # parents first
            arg_5+=1
            if arg_6.name is None:
                arg_6.name = "NODE_" + format(arg_0._internal_node_count, '07d')
                arg_0._internal_node_count += 1
            for arg_8 in arg_6.clades:
                if arg_8.is_terminal():
                    arg_8.bad_branch = arg_8.bad_branch if hasattr(arg_8, 'bad_branch') else False
                arg_8.up = arg_6

        for arg_6 in arg_0.tree.get_nonterminals(order='postorder'): # parents first
            arg_6.bad_branch = all([arg_8.bad_branch for arg_8 in arg_6])

        arg_0._calc_dist2root()
        arg_0._internal_node_count = max(arg_5, arg_0._internal_node_count)

Set auxilliary parameters to every node of the tree .


def Func(arg_0):
        """
        Perform other one-time initialization steps.
        """
        from enterprise.signals import handle_user_post_save
        from django.db.models.signals import pre_migrate, post_save

        post_save.connect(handle_user_post_save, sender=arg_0.auth_user_model, dispatch_uid=USER_POST_SAVE_DISPATCH_UID)
        pre_migrate.connect(arg_0._disconnect_user_post_save_for_migrations)

Perform other one - time initialization steps .


def
Func
(
arg_0
)
:
try
:
arg_1
=
mutagen
.
File
(
arg_0
,
easy
=
True
)
except
mutagen
.
MutagenError
:
logger
.
warning
(
"Can't load {} as music file."
.
format
(
arg_0
)
)
raise
return
arg_1

def Func(arg_0):
	"""Get mutagen metadata dict from a file."""

	try:
		arg_1 = mutagen.File(arg_0, easy=True)
	except mutagen.MutagenError:
		logger.warning("Can't load {} as music file.".format(arg_0))
		raise

	return arg_1


return (abs(t_score) >= critical_value, t_score)

def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 ) + len ( arg_1 ) - 2 arg_3 = tdist95conf_level ( arg_2 ) arg_4 = tscore ( arg_0 , arg_1 ) return ( abs ( arg_4 ) >= arg_3 , arg_4 )

def Func(arg_0, arg_1):
    """Determine whether two samples differ significantly.

    This uses a Student's two-sample, two-tailed t-test with alpha=0.95.

    Args:
        sample1: one sample.
        sample2: the other sample.

    Returns:
        (significant, t_score) where significant is a bool indicating whether
        the two samples differ significantly; t_score is the score from the
        two-sample T test.
    """
    arg_2 = len(arg_0) + len(arg_1) - 2
    arg_3 = tdist95conf_level(arg_2)
    arg_4 = tscore(arg_0, arg_1)
    return (abs(arg_4) >= arg_3, arg_4)

Determine whether two samples differ significantly .


def Func(arg_0):
    """
    Propagate reset "rst" signal
    to all subcomponents
    """
    arg_1 = arg_0.rst

    for arg_2 in arg_0._units:
        _tryConnect(~arg_1, arg_2, 'rst_n')
        _tryConnect(arg_1, arg_2, 'rst')

Propagate reset rst signal to all subcomponents


def Func(arg_0):
    """Undoes the effects of a call to delete_model_genes in place.

    cobra_model:  A cobra.Model which will be modified in place

    """

    if arg_0._trimmed_genes is not None:
        for arg_1 in arg_0._trimmed_genes:
            arg_1.functional = True

    if arg_0._trimmed_reactions is not None:
        for arg_3, (arg_4, arg_5) in \
                arg_0._trimmed_reactions.items():
            arg_3.lower_bound = arg_4
            arg_3.upper_bound = arg_5

    arg_0._trimmed_genes = []
    arg_0._trimmed_reactions = {}
    arg_0._trimmed = False

Undoes the effects of a call to delete_model_genes in place .


def Func ( ) : arg_0 , arg_1 , arg_2 , arg_3 = ( tf_inspect . _inspect . getargvalues ( tf_inspect . _inspect . stack ( ) [ 1 ] [ 0 ] ) ) arg_3 . pop ( arg_1 , { } ) arg_4 = arg_3 . pop ( arg_2 , { } ) arg_5 = { } for arg_6 in arg_0 : arg_5 [ arg_6 ] = arg_3 . pop ( arg_6 ) arg_5 . update ( arg_4 ) return arg_5

def Func():
  """Returns parent frame arguments.

  When called inside a function, returns a dictionary with the caller's function
  arguments. These are positional arguments and keyword arguments (**kwargs),
  while variable arguments (*varargs) are excluded.

  When called at global scope, this will return an empty dictionary, since there
  are no arguments.

  WARNING: If caller function argument names are overloaded before invoking
  this method, then values will reflect the overloaded value. For this reason,
  we recommend calling `Func` at the beginning of the
  function.
  """
  # All arguments and the names used for *varargs, and **kwargs
  arg_0, arg_1, arg_2, arg_3 = (
      tf_inspect._inspect.getargvalues(  # pylint: disable=protected-access
          # Get the first frame of the caller of this method.
          tf_inspect._inspect.stack()[1][0]))  # pylint: disable=protected-access

  # Remove the *varargs, and flatten the **kwargs. Both are
  # nested lists.
  arg_3.pop(arg_1, {})
  arg_4 = arg_3.pop(arg_2, {})

  arg_5 = {}
  # Copy over arguments and their values. In general, local_vars
  # may contain more than just the arguments, since this method
  # can be called anywhere in a function.
  for arg_6 in arg_0:
    arg_5[arg_6] = arg_3.pop(arg_6)
  arg_5.update(arg_4)

  return arg_5

Returns parent frame arguments.

  When called inside a function, returns a dictionary with the caller's function
  arguments. These are positional arguments and keyword arguments (**kwargs),
  while variable arguments (*varargs) are excluded.

  When called at global scope, this will return an empty dictionary, since there
  are no arguments.

  WARNING: If caller function argument names are overloaded before invoking
  this method, then values will reflect the overloaded value. For this reason,
  we recommend calling `parent_frame_arguments` at the beginning of the
  function.


def Func ( arg_0 ) : if not arg_0 . startswith ( b'"' ) or not arg_0 . endswith ( b'"' ) : return arg_0 return QUOTE_RE . sub ( b"\\1" , arg_0 [ 1 : - 1 ] )

def Func(arg_0):
    """Unquote quoted value from DIGEST-MD5 challenge or response.

    If `data` doesn't start or doesn't end with '"' then return it unchanged,
    remove the quotes and escape backslashes otherwise.

    :Parameters:
        - `data`: a quoted string.
    :Types:
        - `data`: `bytes`

    :return: the unquoted string.
    :returntype: `bytes`
    """
    if not arg_0.startswith(b'"') or not arg_0.endswith(b'"'):
        return arg_0
    return QUOTE_RE.sub(b"\\1", arg_0[1:-1])

Unquote quoted value from DIGEST - MD5 challenge or response .


(st, region_depth=3, filter_size=5, sigma_cutoff=8,
                         **kwargs)

def Func(arg_0, arg_1=3, arg_2=5, arg_3=8,
                         **arg_4):
    """
    Automatically adds and subtracts missing particles based on local
    regions of poor fit.

    Calls identify_misfeatured_regions to identify regions, then
    add_subtract_misfeatured_tile on the tiles in order of size until
    region_depth tiles have been checked without adding any particles.

    Parameters
    ----------
    st: :class:`peri.states.State`
        The state to add and subtract particles to.
    region_depth : Int
        The minimum amount of regions to try; the algorithm terminates if
        region_depth regions have been tried without adding particles.

    Other Parameters
    ----------------
    filter_size : Int, optional
        The size of the filter for calculating the local standard deviation;
        should approximately be the size of a poorly featured region in each
        dimension. Best if odd. Default is 5.
    sigma_cutoff : Float, optional
        The max allowed deviation of the residuals from what is expected,
        in units of the residuals' standard deviation. Lower means more
        sensitive, higher = less sensitive. Default is 8.0, i.e. one pixel
        out of every ``7*10^11`` is mis-identified randomly. In practice the
        noise is not Gaussian so there are still some regions mis-
        identified as improperly featured.
    rad : Float or 'calc', optional
        The initial radius for added particles; added particles radii are
        not fit until the end of add_subtract. Default is ``'calc'``, which
        uses the median radii of active particles.
    max_iter : Int, optional
        The maximum number of loops for attempted adds at one tile location.
        Default is 3.
    invert : Bool, optional
        Whether to invert the image for feature_guess. Default is ``True``,
        i.e. dark particles on bright background.
    max_allowed_remove : Int, optional
        The maximum number of particles to remove. If the misfeatured tile
        contains more than this many particles, raises an error. If it
        contains more than half as many particles, throws a warning. If more
        than this many particles are added, they are optimized in blocks of
        ``max_allowed_remove``. Default is 20.
    im_change_frac : Float, between 0 and 1.
        If adding or removing a particle decreases the error less than
        ``im_change_frac *`` the change in the image, the particle is deleted.
        Default is 0.2.
    min_derr : Float
        The minimum change in the state's error to keep a particle in the
        image. Default is ``'3sig'`` which uses ``3*st.sigma``.
    do_opt : Bool, optional
        Set to False to avoid optimizing particle positions after adding
        them. Default is True
    minmass : Float, optional
        The minimum mass for a particle to be identified as a feature, as
        used by trackpy. Defaults to a decent guess.
    use_tp : Bool, optional
        Set to True to use trackpy to find missing particles inside the
        image. Not recommended since trackpy deliberately cuts out
        particles at the edge of the image. Default is False.
    max_allowed_remove : Int, optional
        The maximum number of particles to remove. If the misfeatured tile
        contains more than this many particles, raises an error. If it
        contains more than half as many particles, throws a warning. If more
        than this many particles are added, they are optimized in blocks of
        ``max_allowed_remove``. Default is 20.

    Returns
    -------
    n_added : Int
        The change in the number of particles; i.e the number added - number
        removed.
    new_poses : List
        [N,3] element list of the added particle positions.

    Notes
    -----
    Algorithm Description

    1. Identify mis-featured regions by how much the local residuals
       deviate from the global residuals, as measured by the standard
       deviation of both.
    2. Loop over each of those regions, and:

       a. Remove every particle in the current region.
       b. Try to add particles in the current region until no more
          can be added while adequately decreasing the error.
       c. Terminate if at least region_depth regions have been
          checked without successfully adding a particle.

    Because this algorithm is more judicious about chooosing regions to
    check, and more aggressive about removing particles in those regions,
    it runs faster and does a better job than the (global) add_subtract.
    However, this function usually does not work better as an initial add-
    subtract on an image, since (1) it doesn't check for removing small/big
    particles per se, and (2) when the poorly-featured regions of the image
    are large or when the fit is bad, it will remove essentially all of the
    particles, taking a long time. As a result, it's usually best to do a
    normal add_subtract first and using this function for tough missing or
    double-featured particles.
    """
    # 1. Find regions of poor tiles:
    arg_5 = identify_misfeatured_regions(
        arg_0, arg_2=arg_2, arg_3=arg_3)
    # 2. Add and subtract in the regions:
    arg_6 = 0
    arg_7 = 0
    arg_8 = []
    for arg_9 in arg_5:
        curn, curinds = add_subtract_misfeatured_tile(arg_0, arg_9, **arg_4)
        if curn == 0:
            arg_6 += 1
        else:
            arg_7 += curn
            arg_8.extend(arg_0.obj_get_positions()[curinds])
        if arg_6 > arg_1:
            break  # some message or something?
    else:  # for-break-else
        pass
        # CLOG.info('All regions contained particles.')
        # something else?? this is not quite true
    return arg_7, arg_8

Automatically adds and subtracts missing particles based on local regions of poor fit .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _workers = [ ] for arg_4 in range ( arg_2 ) : arg_5 = tempfile . NamedTemporaryFile ( delete = False ) arg_6 = tempfile . NamedTemporaryFile ( delete = False ) arg_7 = subprocess . Popen ( arg_1 , bufsize = 1 , env = os . environ , shell = True , stdin = None , arg_5 = arg_5 , arg_6 = arg_6 ) arg_7 . _stderr_file = arg_6 arg_7 . _stdout_file = arg_5 arg_0 . _workers . append ( arg_7 )

def Func(arg_0, arg_1, arg_2):
    """ Launch worker processes to execute the given command line

    Parameters:
    -----------------------------------------------
    cmdLine: The command line for each worker
    numWorkers: number of workers to launch
    """

    arg_0._workers = []
    for arg_4 in range(arg_2):
      arg_5 = tempfile.NamedTemporaryFile(delete=False)
      arg_6 = tempfile.NamedTemporaryFile(delete=False)
      arg_7 = subprocess.Popen(arg_1, bufsize=1, env=os.environ, shell=True,
                           stdin=None, arg_5=arg_5, arg_6=arg_6)
      arg_7._stderr_file = arg_6
      arg_7._stdout_file = arg_5
      arg_0._workers.append(arg_7)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . root ( ) . name arg_4 = arg_0 . module ( arg_3 ) if arg_2 not in arg_4 . node . depends : arg_4 . node . depends . append ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """add dependencies created by from-imports
        """
        arg_3 = arg_1.root().name
        arg_4 = arg_0.module(arg_3)
        if arg_2 not in arg_4.node.depends:
            arg_4.node.depends.append(arg_2)

add dependencies created by from - imports


def Func ( arg_0 , arg_1 ) : if arg_1 == arg_0 [ "base" ] [ "symbol" ] : return arg_0 . copy ( ) elif arg_1 == arg_0 [ "quote" ] [ "symbol" ] : return arg_0 . copy ( ) . invert ( ) else : raise InvalidAssetException

def Func(arg_0, arg_1):
        """ Returns the price instance so that the base asset is ``base``.

            Note: This makes a copy of the object!
        """
        if arg_1 == arg_0["base"]["symbol"]:
            return arg_0.copy()
        elif arg_1 == arg_0["quote"]["symbol"]:
            return arg_0.copy().invert()
        else:
            raise InvalidAssetException

Returns the price instance so that the base asset is base .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
title
(
additional
=
'(key=%s, chunkIndex=%d)'
%
(
str
(
arg_1
)
,
arg_2
)
)
assert
len
(
arg_0
)
>
0
arg_0
.
sort
(
arg_1
=
itemgetter
(
*
arg_1
)
)
if
arg_2
is
not
:
arg_4
=
'chunk_%d.csv'
%
arg_2
with
FileRecordStream
(
arg_4
,
write
=
True
,
arg_3
=
arg_3
)
as
o
:
for
arg_5
in
arg_0
:
o
.
appendRecord
(
arg_5
)
assert
os
.
path
.
getsize
(
arg_4
)
>
0
return
arg_0

def Func(arg_0, arg_1, arg_2, arg_3):
  """Sort in memory chunk of records

  records - a list of records read from the original dataset
  key - a list of indices to sort the records by
  chunkIndex - the index of the current chunk

  The records contain only the fields requested by the user.

  Func() will write the sorted records to a standard File
  named "chunk_<chunk index>.csv" (chunk_0.csv, chunk_1.csv,...).
  """
  title(additional='(key=%s, chunkIndex=%d)' % (str(arg_1), arg_2))

  assert len(arg_0) > 0

  # Sort the current records
  arg_0.sort(arg_1=itemgetter(*arg_1))

  # Write to a chunk file
  if arg_2 is not None:
    arg_4 = 'chunk_%d.csv' % arg_2
    with FileRecordStream(arg_4, write=True, arg_3=arg_3) as o:
      for arg_5 in arg_0:
        o.appendRecord(arg_5)

    assert os.path.getsize(arg_4) > 0

  return arg_0

Sort in memory chunk of records

  records - a list of records read from the original dataset
  key - a list of indices to sort the records by
  chunkIndex - the index of the current chunk

  The records contain only the fields requested by the user.

  _sortChunk() will write the sorted records to a standard File
  named "chunk_<chunk index>.csv" (chunk_0.csv, chunk_1.csv,...).


def Func ( arg_0 ) : arg_1 = copy . copy ( arg_0 ) arg_1 . _dep_vector = arg_1 . _dep_vector . astype ( np . complex ) return arg_1

def Func(arg_0):
    r"""
    Convert a waveform's dependent variable vector to complex.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises: RuntimeError (Argument \`wave\` is not valid)

    .. [[[end]]]
    """
    arg_1 = copy.copy(arg_0)
    arg_1._dep_vector = arg_1._dep_vector.astype(np.complex)
    return arg_1

r"""
    Convert a waveform's dependent variable vector to complex.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.wcomplex

    :raises: RuntimeError (Argument \`wave\` is not valid)

    .. [[[end]]]

r Convert a waveform s dependent variable vector to complex .


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
"TERMINATOR"
if
arg_1
else
arg_3
,
arg_4
=
arg_0
.
command
(
"XFEATURE COMPRESS GZIP"
,
arg_2
)
if
arg_3
!=
290
:
raise
NNTPReplyError
(
arg_3
,
arg_4
)
return
True

def Func(arg_0, arg_1=False):
        """XFEATURE COMPRESS GZIP command.
        """
        arg_2 = "TERMINATOR" if arg_1 else None

        arg_3, arg_4 = arg_0.command("XFEATURE COMPRESS GZIP", arg_2)
        if arg_3 != 290:
            raise NNTPReplyError(arg_3, arg_4)

        return True


(bucket, filename, client=None, raiseonfail=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
    """This deletes a file from S3.

    Parameters
    ----------

    bucket : str
        The AWS S3 bucket to delete the file from.

    filename : str
        The full file name of the file to delete, including any prefixes.

    client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its operations. Alternatively, pass in an existing `boto3.Client`
        instance to re-use it here.

    raiseonfail : bool
        If True, will re-raise whatever Exception caused the operation to fail
        and break out immediately.

    Returns
    -------

    str or None
        If the file was successfully deleted, will return the delete-marker
        (https://docs.aws.amazon.com/AmazonS3/latest/dev/DeleteMarker.html). If
        it wasn't, returns None

    """

    if not arg_2:
        arg_2 = boto3.client('s3')

    try:
        arg_4 = arg_2.delete_object(Bucket=arg_0, Key=arg_1)
        if not arg_4:
            LOGERROR('could not delete file %s from bucket %s' % (arg_1,
                                                                  arg_0))
        else:
            return arg_4['DeleteMarker']
    except Exception as e:
        LOGEXCEPTION('could not delete file %s from bucket %s' % (arg_1,
                                                                  arg_0))
        if arg_3:
            raise

        return None


def Func ( arg_0 , arg_1 = True ) : arg_0 . validate ( ) if arg_0 . intermediate_data is None : arg_0 . to_intermediate ( ) arg_2 = getattr ( arg_0 , 'Funcers' , None ) or [ arg_0 . Funcer ] arg_3 = '' for arg_4 in arg_2 : arg_5 = arg_4 ( arg_0 ) arg_3 += arg_5 . Func ( ) del arg_5 if arg_1 : arg_6 = arg_0 . _Func_files ( ) if arg_6 : arg_3 += arg_6 . replace ( '\n\n\n' , '\n\n' ) return arg_3

def Func(arg_0, arg_1=True):
        """
        Converts the configuration dictionary into the corresponding configuration format

        :param files: whether to include "additional files" in the output or not;
                      defaults to ``True``
        :returns: string with output
        """
        arg_0.validate()
        # convert NetJSON config to intermediate data structure
        if arg_0.intermediate_data is None:
            arg_0.to_intermediate()
        # support multiple Funcers
        arg_2 = getattr(arg_0, 'Funcers', None) or [arg_0.Funcer]
        # convert intermediate data structure to native configuration
        arg_3 = ''
        for arg_4 in arg_2:
            arg_5 = arg_4(arg_0)
            arg_3 += arg_5.Func()
            # remove reference to Funcer instance (not needed anymore)
            del arg_5
        # are we required to include
        # additional files?
        if arg_1:
            # Func additional files
            arg_6 = arg_0._Func_files()
            if arg_6:
                # max 2 new lines
                arg_3 += arg_6.replace('\n\n\n', '\n\n')
        # return the configuration
        return arg_3


(store, institute_id, panel_name, display_name, csv_lines)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Create a new gene panel.

    Args:
        store(scout.adapter.MongoAdapter)
        institute_id(str)
        panel_name(str)
        display_name(str)
        csv_lines(iterable(str)): Stream with genes

    Returns:
        panel_id: the ID of the new panel document created or None

    """
    arg_5 = arg_0.institute(arg_1)
    if arg_5 is None:
        flash("{}: institute not found".format(arg_1))
        return None

    arg_6 = arg_0.gene_panel(arg_2)
    if arg_6:
        flash("panel already exists: {} - {}".format(arg_6['panel_name'],
                                                     arg_6['display_name']))
        return None

    log.debug("parse genes from CSV input")
    try:
        arg_7 = parse_genes(arg_4)
    except SyntaxError as error:
        flash(error.args[0], 'danger')
        return None

    log.debug("build new gene panel")

    arg_8 = None
    try:
        arg_9 = build_panel(dict(
            arg_2=arg_2,
            institute=arg_5['_id'],
            version=1.0,
            date=dt.datetime.now(),
            arg_3=arg_3,
            genes=arg_7,
        ), arg_0)
        arg_8= arg_0.add_gene_panel(arg_9)

    except Exception as err:
        log.error('An error occurred while adding the gene panel {}'.format(err))

    return arg_8


def Func ( arg_0 , arg_1 : arg_2 . RepOptional ) -> ( [ ast . stmt ] or ast . expr ) : arg_4 = arg_0 . visit ( arg_1 . pt ) if isinstance ( arg_4 , ast . expr ) : return ast . BoolOp ( ast . Or ( ) , [ arg_4 , ast . Name ( 'True' , ast . Load ( ) ) ] ) arg_0 . in_optional += 1 arg_4 = arg_0 . visit ( arg_1 . pt ) arg_0 . in_optional -= 1 return arg_4

def Func(arg_0, arg_1: arg_2.RepOptional) -> ([ast.stmt] or
                                                               ast.expr):
        """Generates python code for an optional clause.

        <code for the clause>
        """
        arg_4 = arg_0.visit(arg_1.pt)
        if isinstance(arg_4, ast.expr):
            return ast.BoolOp(ast.Or(), [arg_4, ast.Name('True', ast.Load())])
        arg_0.in_optional += 1
        arg_4 = arg_0.visit(arg_1.pt)
        arg_0.in_optional -= 1
        return arg_4

Generates python code for an optional clause .


def Func(arg_0, arg_1=True):
        """
        Connects to slack and enters the main loop.

        * start - If True, rtm.start API is used. Else rtm.connect API is used

        For more info, refer to
        https://python-slackclient.readthedocs.io/en/latest/real_time_messaging.html#rtm-start-vs-rtm-connect
        """
        # Fail out if setup wasn't Func
        if not arg_0.is_setup:
            raise NotSetupError

        # Start the web server
        arg_0.webserver.start()

        arg_2 = True

        try:
            while arg_0.Funcnable:
                if arg_0.reconnect_needed:
                    if not arg_0.sc.rtm_connect(with_team_state=arg_1):
                        return False
                    arg_0.reconnect_needed = False
                    if arg_2:
                        arg_2 = False
                        arg_0.plugins.connect()

                # Get all waiting events - this always returns a list
                try:
                    arg_4 = arg_0.sc.rtm_read()
                except AttributeError:
                    arg_0.log.exception('Something has failed in the slack rtm library.  This is fatal.')
                    arg_0.Funcnable = False
                    arg_4 = []
                except:
                    arg_0.log.exception('Unhandled exception in rtm_read()')
                    arg_0.reconnect_needed = True
                    arg_4 = []
                for arg_6 in arg_4:
                    try:
                        arg_0._handle_event(arg_6)
                    except KeyboardInterrupt:
                        # Gracefully shutdown
                        arg_0.Funcnable = False
                    except:
                        arg_0.log.exception('Unhandled exception in event handler')
                sleep(0.1)
        except KeyboardInterrupt:
            # On ctrl-c, just exit
            pass
        except:
            arg_0.log.exception('Unhandled exception')

Connects to slack and enters the main loop .


def Func(arg_0):
    '''
    This _looks_ like a Chunk only in that it generates StreamItem
    instances when iterated upon.
    '''
    ## Every StreamItem has a stream_time property.  It usually comes
    ## from the document creation time.  Here, we assume the JS corpus
    ## was created at one moment at the end of 1998:
    arg_1 = '1998-12-31T23:59:59.999999Z'
    arg_2 = 915148799

    if not os.path.isabs(arg_0):
        arg_0 = os.path.join(os.getcwd(), arg_0)

    ## iterate over the files in the 35 input directories
    for arg_3 in range(35):

        arg_4 = os.path.join(arg_0, str(arg_3))
        arg_5 = os.listdir(arg_4)
        arg_5.sort()
        for arg_6 in arg_5:

            arg_7 = streamcorpus.make_stream_item(
                arg_1,
                ## make up an abs_url
                os.path.join(
                    'john-smith-corpus', str(arg_3), arg_6))

            if int(arg_7.stream_time.epoch_ticks) != arg_2:
                raise PipelineBaseException('wrong stream_time construction: %r-->%r != %r'\
                                            % (arg_1, arg_7.stream_time.epoch_ticks,
                                               arg_2))

            ## These docs came from the authors of the paper cited above.
            arg_7.source = 'bagga-and-baldwin'

            ## build a ContentItem for the body
            arg_9 = streamcorpus.ContentItem()
            arg_10 = open(os.path.join(arg_4, arg_6)).read()
            ## We know that this is already clean and has nothing
            ## tricky in it, because we manually cleansed it.  To
            ## illustrate how we stick all strings into thrift, we
            ## convert this to unicode (which introduces no changes)
            ## and then encode it as utf-8, which also introduces no
            ## changes.  Thrift stores strings as 8-bit character
            ## strings.
            # http://www.mail-archive.com/thrift-user@incubator.apache.org/msg00210.html
            arg_9.clean_visible = unicode(arg_10).encode('utf8')

            ## attach the content_item to the stream_item
            arg_7.body = arg_9

            arg_7.body.language = streamcorpus.Language(code='en', name='ENGLISH')

            ## The authors also annotated the corpus
            arg_13 = streamcorpus.Annotator()
            arg_13.annotator_id = 'bagga-and-baldwin'
            arg_13.annotation_time = arg_7.stream_time

            ## build a Label for the doc-level label:
            arg_16 = streamcorpus.Rating()
            arg_16.annotator = arg_13
            arg_16.target = streamcorpus.Target(target_id = str(arg_3)) # must be string
            arg_16.contains_mention = True
            arg_16.mentions = ['john', 'smith']

            ## put this one label in the array of labels
            streamcorpus.add_annotation(arg_7, arg_16)

            ## provide this stream_item to the pipeline
            yield arg_7

This _looks_ like a Chunk only in that it generates StreamItem instances when iterated upon .


def Func(arg_0):
        """"Validate this Data Package.
        """

        # Deprecate
        warnings.warn(
            'Property "package.Func" is deprecated.',
            UserWarning)

        arg_1 = arg_0.to_dict()
        arg_0.profile.Func(arg_1)


def Func ( arg_0 , arg_1 = None ) : try : arg_2 = loadmat ( arg_0 , struct_as_record = True ) except UnicodeDecodeError as e : raise Oct2PyError ( str ( e ) ) arg_3 = dict ( ) for ( arg_4 , arg_5 ) in arg_2 . items ( ) : arg_3 [ arg_4 ] = _extract ( arg_5 , arg_1 ) return arg_3

def Func(arg_0, arg_1=None):
    """Read the data from the given file path.
    """
    try:
        arg_2 = loadmat(arg_0, struct_as_record=True)
    except UnicodeDecodeError as e:
        raise Oct2PyError(str(e))
    arg_3 = dict()
    for (arg_4, arg_5) in arg_2.items():
        arg_3[arg_4] = _extract(arg_5, arg_1)
    return arg_3

Read the data from the given file path .


def Func ( arg_0 , arg_1 ) : arg_2 = tornado . escape . json_decode ( arg_1 ) arg_3 = arg_2 . get ( 'ref' ) if not arg_3 : return arg_4 = arg_0 . view . xpath ( '//*[@ref="{}"]' . format ( arg_3 ) , first = True ) if arg_4 is None : return if arg_2 . get ( 'type' ) and arg_2 . get ( 'name' ) : if arg_2 [ 'type' ] == 'event' : arg_5 = getattr ( arg_4 , arg_2 [ 'name' ] ) arg_5 ( ) if arg_2 [ 'type' ] == 'update' : setattr ( arg_4 , arg_2 [ 'name' ] , arg_2 [ 'value' ] )

def Func(arg_0, arg_1):
        """ When enaml.js sends a message """
        #: Decode message
        arg_2 = tornado.escape.json_decode(arg_1)
        #print change
        #: Get the owner ID
        arg_3 = arg_2.get('ref')
        if not arg_3:
            return

        #: Get the server side representation of the node
        #: If found will return the View declaration node
        arg_4 = arg_0.view.xpath('//*[@ref="{}"]'.format(arg_3), first=True)
        if arg_4 is None:
            return

        #: Handle the event
        if arg_2.get('type') and arg_2.get('name'):
            if arg_2['type'] == 'event':
                #: Trigger the event
                arg_5 = getattr(arg_4, arg_2['name'])
                arg_5()
            if arg_2['type'] == 'update':
                #: Trigger the update
                setattr(arg_4, arg_2['name'], arg_2['value'])


return [group['lr'] for group in self.optimizer.param_groups]

def Func(arg_0):
        """Get current learning rates.

        Returns:
            list: Current learning rate of all param groups.
        """
        if arg_0.optimizer is None:
            raise RuntimeError(
                'lr is not applicable because optimizer does not exist.')
        return [arg_1['lr'] for arg_1 in arg_0.optimizer.param_groups]


def Func(arg_0, arg_1):
        """Gets satellite id """
        if arg_1 == 'L5':
            arg_2 = '3119'
            arg_3 = ['GLC', 'ASA', 'KIR', 'MOR', 'KHC', 'PAC', 'KIS', 'CHM', 'LGS', 'MGR', 'COA', 'MPS']
        elif arg_1 == 'L7':
            arg_2 = '3373'
            arg_3 = ['EDC', 'SGS', 'AGS', 'ASN', 'SG1']
        elif arg_1 == 'L8':
            arg_2 = '4923'
            arg_3 = ['LGN']
        else:
            raise ProductInvalidError('Type product invalid. the permitted types are: L5, L7, L8. ')
        arg_4 = dict(id_satelite=arg_2, arg_3=arg_3)
        return arg_4


(ip_address, cache=None, nameservers=None,
                        timeout=2.0, parallel=False)

def Func(arg_0, arg_1=None, arg_2=None,
                        arg_3=2.0, arg_4=False):
    """
    Returns reverse DNS and country information for the given IP address

    Args:
        ip_address (str): The IP address to check
        cache (ExpiringDict): Cache storage
        nameservers (list): A list of one or more nameservers to use
        (Cloudflare's public DNS resolvers by default)
        timeout (float): Sets the DNS timeout in seconds
        parallel (bool): parallel processing

    Returns:
        OrderedDict: ``ip_address``, ``reverse_dns``

    """
    arg_0 = arg_0.lower()
    if arg_1:
        arg_5 = arg_1.get(arg_0, None)
        if arg_5:
            return arg_5
    arg_5 = OrderedDict()
    arg_5["ip_address"] = arg_0
    arg_6 = get_reverse_dns(arg_0,
                                  arg_2=arg_2,
                                  arg_3=arg_3)
    arg_7 = get_ip_address_country(arg_0, arg_4=arg_4)
    arg_5["country"] = arg_7
    arg_5["reverse_dns"] = arg_6
    arg_5["base_domain"] = None
    if arg_6 is not None:
        arg_8 = get_base_domain(arg_6)
        arg_5["base_domain"] = arg_8

    return arg_5


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
if
len
(
arg_2
)
>
1
:
raise
TemplateSyntaxError
(
"'%s' takes no arguments"
%
arg_2
[
0
]
)
return
MixpanelNode
(
)

def Func(arg_0, arg_1):
    """
    Mixpanel tracking template tag.

    Renders Javascript code to track page visits.  You must supply
    your Mixpanel token in the ``MIXPANEL_API_TOKEN`` setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return MixpanelNode()


def Func(arg_0, arg_1):
        """Execution status of the program."""
        arg_2 = arg_0.core.filename(None)
        if arg_0.core.is_Funcning():
            if arg_2:
                arg_3 = "Python program '%s' is stopped" % arg_2
            else:
                arg_3 = 'Program is stopped'
                pass
            if arg_0.proc.event:
                arg_4 = 'via a %s event.' % arg_0.proc.event
            else:
                arg_4 = '.'
            arg_0.msg(Mmisc.wrapped_lines(arg_3, arg_4,
                                         arg_0.settings['width']))
            if arg_0.proc.curframe:
                arg_0.msg("PC offset is %d." % arg_0.proc.curframe.f_lasti)

            if arg_0.proc.event == 'return':
                arg_5 = arg_0.proc.event_arg
                arg_3 = 'Return value is'
                arg_0.msg(Mmisc.wrapped_lines(arg_3, arg_0.proc._saferepr(arg_5),
                                             arg_0.settings['width']))
                pass
            elif arg_0.proc.event == 'exception':
                arg_6, arg_7, arg_8 = arg_0.proc.event_arg
                arg_0.msg('Exception type: %s' %
                         arg_0.proc._saferepr(arg_6))
                if arg_7:
                    arg_0.msg('Exception value: %s' %
                             arg_0.proc._saferepr(arg_7))
                    pass
                pass
            arg_0.msg('It stopped %s.' % arg_0.core.stop_reason)
            if arg_0.proc.event in ['signal', 'exception', 'c_exception']:
                arg_0.msg('Note: we are stopped *after* Funcning the '
                         'line shown.')
                pass
        else:
            if arg_2:
                arg_3 = "Python program '%s'" % arg_2
                arg_4   = "is not currently Funcning. "
                arg_0.msg(Mmisc.wrapped_lines(arg_3, arg_4,
                                             arg_0.settings['width']))
            else:
                arg_0.msg('No Python program is currently Funcning.')
                pass
            arg_0.msg(arg_0.core.execution_status)
            pass
        return False


(s, header='', file=sys.stderr, nl=1, **kwargs)

def
Func
(
arg_0
,
arg_1
=
''
,
arg_2
=
arg_3
.
stderr
,
arg_5
=
1
,
**
arg_6
)
:
if
not
settings
.
verbose
:
return
if
arg_1
:
arg_7
=
arg_0
.
split
(
' '
)
arg_8
=
[
]
arg_7
.
insert
(
0
,
'%s:'
%
arg_1
.
upper
(
)
)
arg_9
=
0
while
arg_9
<
len
(
arg_7
)
:
arg_10
=
[
'***'
]
arg_11
=
3
while
arg_11
<=
79
:
arg_11
+=
len
(
arg_7
[
arg_9
]
)
+
1
if
arg_11
<=
79
:
arg_10
.
append
(
arg_7
[
arg_9
]
)
arg_9
+=
1
if
arg_9
==
len
(
arg_7
)
:
break
if
len
(
arg_10
)
==
1
:
arg_10
.
append
(
arg_7
[
arg_9
]
)
arg_9
+=
1
if
arg_9
!=
len
(
arg_7
)
:
arg_11
-=
len
(
arg_7
[
arg_9
]
)
+
1
arg_10
.
append
(
'*'
*
(
78
arg_11
)
)
arg_8
.
append
(
' '
.
join
(
arg_10
)
)
arg_0
=
'\n'
.
join
(
arg_8
)
arg_12
=
len
(
arg_8
)
else
:
arg_12
=
1
if
isinstance
(
arg_5
,
int
)
and
arg_5
>
arg_12
:
arg_0
+=
'\n'
*
(
arg_5
arg_12
)
return
secho
(
arg_0
,
arg_2
=
arg_2
,
**
arg_6
)

def Func(arg_0, arg_1='', arg_2=arg_3.stderr, arg_5=1, **arg_6):
    """Log the given output to stderr if and only if we are in
    verbose mode.

    If we are not in verbose mode, this is a no-op.
    """
    # Sanity check: If we are not in verbose mode, this is a no-op.
    if not settings.verbose:
        return

    # Construct multi-line string to stderr if header is provided.
    if arg_1:
        arg_7 = arg_0.split(' ')
        arg_8 = []
        arg_7.insert(0, '%s:' % arg_1.upper())
        arg_9 = 0
        while arg_9 < len(arg_7):
            arg_10 = ['***']
            arg_11 = 3
            while arg_11 <= 79:
                arg_11 += len(arg_7[arg_9]) + 1
                if arg_11 <= 79:
                    arg_10.append(arg_7[arg_9])
                    arg_9 += 1
                    if arg_9 == len(arg_7):
                        break
            # Handle corner case of extra-long word longer than 75 characters.
            if len(arg_10) == 1:
                arg_10.append(arg_7[arg_9])
                arg_9 += 1
            if arg_9 != len(arg_7):
                arg_11 -= len(arg_7[arg_9]) + 1
            arg_10.append('*' * (78 - arg_11))
            arg_8.append(' '.join(arg_10))
        arg_0 = '\n'.join(arg_8)
        arg_12 = len(arg_8)
    else:
        arg_12 = 1

    # If `nl` is an int greater than the number of rows of a message,
    # add the appropriate newlines to the output.
    if isinstance(arg_5, int) and arg_5 > arg_12:
        arg_0 += '\n' * (arg_5 - arg_12)

    # Output to stderr.
    return secho(arg_0, arg_2=arg_2, **arg_6)

Log the given output to stderr if and only if we are in verbose mode .


return [mapper.get_property_by_column(column) for column in mapper.primary_key]

def Func(arg_0):
    """Get primary key properties for a SQLAlchemy model.

    :param model: SQLAlchemy model class
    """
    arg_1 = arg_0.__mapper__
    return [arg_1.get_property_by_column(arg_2) for arg_2 in arg_1.primary_key]

Get primary key properties for a SQLAlchemy model .


def Func ( arg_0 , arg_1 = True ) : arg_2 = arg_0 . elements arg_3 = [ ] for arg_4 , arg_5 in arg_0 . elements . groupby ( [ ( "type" , "argiope" , "" ) ] ) : arg_6 = ELEMENTS [ arg_4 ] arg_7 = arg_6 . simplices arg_8 = arg_5 . index arg_9 = arg_0 . split ( into = "simplices" , loc = arg_8 , at = "coords" ) arg_10 = arg_9 . values . reshape ( arg_8 . size , arg_7 . shape [ 0 ] , arg_7 . shape [ 1 ] , 3 ) arg_11 = arg_10 [ : , : , 1 : ] - arg_10 [ : , : , : 1 ] arg_12 = arg_10 . mean ( axis = 2 ) if arg_6 . space == 2 : arg_13 = np . linalg . norm ( np . cross ( arg_11 [ : , : , 0 ] , arg_11 [ : , : , 1 ] , axis = 2 ) , axis = 2 ) / 2. elif arg_6 . space == 3 : arg_13 = ( np . cross ( arg_11 [ : , : , 0 ] , arg_11 [ : , : , 1 ] , axis = 2 ) * arg_11 [ : , : , 2 ] ) . sum ( axis = 2 ) / 6. arg_14 = arg_13 . sum ( axis = 1 ) arg_15 = ( ( arg_13 . reshape ( * arg_13 . shape , 1 ) * arg_12 ) . sum ( axis = 1 ) / arg_14 . reshape ( * arg_14 . shape , 1 ) ) arg_16 = pd . DataFrame ( arg_8 = arg_8 , data = arg_14 , columns = pd . MultiIndex . from_product ( [ [ "volume" ] , [ "" ] ] ) ) arg_17 = pd . DataFrame ( arg_8 = arg_8 , data = arg_15 , columns = pd . MultiIndex . from_product ( [ [ "centroid" ] , [ "x" , "y" , "z" ] ] ) ) arg_3 . append ( pd . concat ( [ arg_16 , arg_17 ] , axis = 1 ) ) arg_3 = pd . concat ( arg_3 ) if arg_1 : arg_3 . sort_index ( inplace = True ) return arg_3 . sort_index ( axis = 1 )

def Func(arg_0, arg_1 = True):
    """
    Returns a dataframe containing volume and centroids of all the elements.
    """
    arg_2 = arg_0.elements
    arg_3 = []
    for arg_4, arg_5 in arg_0.elements.groupby([("type", "argiope", "")]):
      arg_6 = ELEMENTS[arg_4]
      arg_7 = arg_6.simplices
      arg_8 = arg_5.index
      arg_9 = arg_0.split(into = "simplices",
                             loc = arg_8,
                             at = "coords")
      arg_10 = arg_9.values.reshape(
                  arg_8.size,
                  arg_7.shape[0],
                  arg_7.shape[1],
                  3)
      arg_11 = arg_10[:,:,1:] - arg_10[:,:,:1]
      arg_12 = arg_10.mean(axis = 2)
      if arg_6.space == 2:
        arg_13 = np.linalg.norm(
                  np.cross(arg_11[:,:,0],
                           arg_11[:,:,1],
                           axis = 2),
                  axis = 2)/2.
      elif arg_6.space == 3:
        arg_13 =  (np.cross(arg_11[:,:,0],
                                       arg_11[:,:,1], axis = 2)
                             * arg_11[:,:, 2]).sum(axis = 2) / 6.
      arg_14 = arg_13.sum(axis = 1)
      arg_15 = ((arg_13.reshape(*arg_13.shape, 1)
                          * arg_12).sum(axis = 1)
                          / arg_14.reshape(*arg_14.shape,1))
      arg_16 = pd.DataFrame(arg_8 = arg_8,
                                data = arg_14,
                                columns = pd.MultiIndex.from_product(
                                [["volume"], [""]]))
      arg_17 = pd.DataFrame(arg_8 = arg_8,
                                data = arg_15,
                                columns = pd.MultiIndex.from_product(
                                [["centroid"], ["x", "y", "z"]]))
      arg_3.append(pd.concat([arg_16, arg_17], axis = 1))
    arg_3 = pd.concat(arg_3)
    if arg_1: arg_3.sort_index(inplace = True)
    return arg_3.sort_index(axis= 1)

Returns a dataframe containing volume and centroids of all the elements .


def
Func
(
arg_0
=
)
:
arg_1
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
arg_1
.
add_argument
(
'--monitors-dir'
,
default
=
MONITORS_DIR
)
arg_1
.
add_argument
(
'--alerts-dir'
,
default
=
ALERTS_DIR
)
arg_1
.
add_argument
(
'--config'
,
default
=
SMA_INI_FILE
)
arg_1
.
add_argument
(
'--warning'
,
help
=
'set logging to warning'
,
action
=
'store_const'
,
dest
=
'loglevel'
,
const
=
logging
.
WARNING
,
default
=
logging
.
INFO
)
arg_1
.
add_argument
(
'--quiet'
,
help
=
'set logging to ERROR'
,
action
=
'store_const'
,
dest
=
'loglevel'
,
const
=
logging
.
ERROR
,
default
=
logging
.
INFO
)
arg_1
.
add_argument
(
'--debug'
,
help
=
'set logging to DEBUG'
,
action
=
'store_const'
,
dest
=
'loglevel'
,
const
=
logging
.
DEBUG
,
default
=
logging
.
INFO
)
arg_1
.
add_argument
(
'--verbose'
,
help
=
'set logging to COMM'
,
action
=
'store_const'
,
dest
=
'loglevel'
,
const
=
5
,
default
=
logging
.
INFO
)
arg_1
.
sub
=
arg_1
.
add_subparsers
(
)
arg_3
=
arg_1
.
sub
.
add_parser
(
'service'
,
help
=
'Run SMA as service (daemon).'
)
arg_3
.
set_defaults
(
which
=
'service'
)
arg_4
=
arg_1
.
sub
.
add_parser
(
'one-shot'
,
help
=
'Run SMA once and exit'
)
arg_4
.
set_defaults
(
which
=
'one-shot'
)
arg_5
=
arg_1
.
sub
.
add_parser
(
'alerts'
,
help
=
'Alerts options.'
)
arg_5
.
set_defaults
(
which
=
'alerts'
)
arg_5
.
add_argument
(
'--test'
,
help
=
'Test alert'
,
action
=
'store_true'
)
arg_5
.
add_argument
(
'alert_section'
,
nargs
=
'?'
,
help
=
'Alert section to see'
)
arg_6
=
arg_1
.
sub
.
add_parser
(
'results'
,
help
=
'Monitors results'
)
arg_6
.
set_defaults
(
which
=
'results'
)
arg_1
.
set_default_subparser
(
'one-shot'
)
arg_7
=
arg_1
.
parse_args
(
arg_0
[
1
:
]
)
create_logger
(
'sma'
,
arg_7
.
loglevel
)
if
not
getattr
(
arg_7
,
'which'
,
)
or
arg_7
.
which
==
'one-shot'
:
arg_8
=
SMA
(
arg_7
.
monitors_dir
,
arg_7
.
alerts_dir
,
arg_7
.
config
)
arg_8
.
evaluate_and_alert
(
)
elif
arg_7
.
which
==
'service'
:
arg_8
=
SMAService
(
arg_7
.
monitors_dir
,
arg_7
.
alerts_dir
,
arg_7
.
config
)
arg_8
.
start
(
)
elif
arg_7
.
which
==
'alerts'
and
arg_7
.
test
:
arg_8
=
SMA
(
arg_7
.
monitors_dir
,
arg_7
.
alerts_dir
,
arg_7
.
config
)
arg_8
.
alerts
.
test
(
)
elif
arg_7
.
which
==
'results'
:
print
(
SMA
(
arg_7
.
monitors_dir
,
arg_7
.
alerts_dir
,
arg_7
.
config
)
.
results
)

def Func(arg_0=None):
    """
    A simple method that runs a ManagementUtility.
    """
    arg_1 = argparse.ArgumentParser(description=__doc__)
    arg_1.add_argument('--monitors-dir', default=MONITORS_DIR)
    arg_1.add_argument('--alerts-dir', default=ALERTS_DIR)
    arg_1.add_argument('--config', default=SMA_INI_FILE)

    arg_1.add_argument('--warning', help='set logging to warning', action='store_const', dest='loglevel',
                        const=logging.WARNING, default=logging.INFO)
    arg_1.add_argument('--quiet', help='set logging to ERROR', action='store_const', dest='loglevel',
                        const=logging.ERROR, default=logging.INFO)
    arg_1.add_argument('--debug', help='set logging to DEBUG',
                        action='store_const', dest='loglevel',
                        const=logging.DEBUG, default=logging.INFO)
    arg_1.add_argument('--verbose', help='set logging to COMM',
                        action='store_const', dest='loglevel',
                        const=5, default=logging.INFO)

    arg_1.sub = arg_1.add_subparsers()

    arg_3 = arg_1.sub.add_parser('service', help='Run SMA as service (daemon).')
    arg_3.set_defaults(which='service')

    arg_4 = arg_1.sub.add_parser('one-shot', help='Run SMA once and exit')
    arg_4.set_defaults(which='one-shot')

    arg_5 = arg_1.sub.add_parser('alerts', help='Alerts options.')
    arg_5.set_defaults(which='alerts')
    arg_5.add_argument('--test', help = 'Test alert', action='store_true')
    arg_5.add_argument('alert_section', nargs='?', help='Alert section to see')

    arg_6 = arg_1.sub.add_parser('results', help='Monitors results')
    arg_6.set_defaults(which='results')

    arg_1.set_default_subparser('one-shot')
    arg_7 = arg_1.parse_args(arg_0[1:])

    create_logger('sma', arg_7.loglevel)

    if not getattr(arg_7, 'which', None) or arg_7.which == 'one-shot':
        arg_8 = SMA(arg_7.monitors_dir, arg_7.alerts_dir, arg_7.config)
        arg_8.evaluate_and_alert()
    elif arg_7.which == 'service':
        arg_8 = SMAService(arg_7.monitors_dir, arg_7.alerts_dir, arg_7.config)
        arg_8.start()
    elif arg_7.which == 'alerts' and arg_7.test:
        arg_8 = SMA(arg_7.monitors_dir, arg_7.alerts_dir, arg_7.config)
        arg_8.alerts.test()
    elif arg_7.which == 'results':
        print(SMA(arg_7.monitors_dir, arg_7.alerts_dir, arg_7.config).results)

A simple method that runs a ManagementUtility .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in list ( arg_0 . edges ) : if arg_1 in ( arg_3 . node1 . id , arg_3 . node2 . id ) and arg_2 in ( arg_3 . node1 . id , arg_3 . node2 . id ) : arg_3 . node1 . links . remove ( arg_3 . node2 ) arg_3 . node2 . links . remove ( arg_3 . node1 ) arg_0 . edges . remove ( arg_3 )

def Func(arg_0, arg_1, arg_2):

        """ Remove edges between nodes with given id's.
        """

        for arg_3 in list(arg_0.edges):
            if arg_1 in (arg_3.node1.id, arg_3.node2.id) and \
               arg_2 in (arg_3.node1.id, arg_3.node2.id):
                arg_3.node1.links.remove(arg_3.node2)
                arg_3.node2.links.remove(arg_3.node1)
                arg_0.edges.remove(arg_3)

Remove edges between nodes with given id s .


def Func(arg_0, arg_1,  arg_2={}, **arg_3):
        """
        The implementation in the base class simply checks there is no
        clash between the metadata and data keys.
        """
        arg_4 = set(arg_2.keys()) & set(arg_3.keys())
        if arg_4:
            arg_5 = 'Key(s) overlap between data and metadata: %s'
            raise Exception(arg_5  % ','.join(arg_4))

The implementation in the base class simply checks there is no clash between the metadata and data keys .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Integrate SIR epidemic model

    Simulate a very basic deterministic SIR system.

    :param 2x1 numpy array y0: initial conditions
    :param Ntimestep length numpy array time: Vector of time points that \
    solution is returned at
    :param float beta: transmission rate
    :param float gamma: recovery rate

    :returns: (2)x(Ntimestep) numpy array Xsim: first row S(t), second row I(t)

    """

    arg_4 = rk4(SIR_D, arg_0, arg_1, args=(arg_2,arg_3,))
    arg_4 = arg_4.transpose()
    return arg_4


\
        Work on a task from the BotnetBot

(self, nick, message, channel, task_id, command, workers=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
)
:
if
arg_6
:
arg_7
=
arg_6
.
split
(
','
)
arg_8
=
arg_0
.
conn
.
nick
in
arg_7
else
:
arg_8
=
True
if
arg_8
:
arg_0
.
task_queue
.
put
(
(
int
(
arg_4
)
,
arg_5
)
)
return
'!task-received %s'
%
arg_4

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=None):
        """\
        Work on a task from the BotnetBot
        """
        if arg_6:
            arg_7 = arg_6.split(',')
            arg_8 = arg_0.conn.nick in arg_7
        else:
            arg_8 = True

        if arg_8:
            arg_0.task_queue.put((int(arg_4), arg_5))
            return '!task-received %s' % arg_4

\
        Work on a task from the BotnetBot


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
contents
.
split
(
' '
)
if
len
(
arg_2
)
<=
1
:
raise
template
.
TemplateSyntaxError
(
"'%s' takes at least one argument"
%
arg_2
[
0
]
)
if
arg_1
.
contents
[
13
]
==
'"'
:
arg_3
=
arg_1
.
contents
.
index
(
'"'
,
14
)
+
1
arg_4
=
[
template
.
Variable
(
arg_1
.
contents
[
13
:
arg_3
]
)
]
arg_5
=
arg_3
else
:
try
:
arg_6
=
arg_1
.
contents
.
index
(
' '
,
14
)
arg_5
=
arg_6
+
1
except
ValueError
:
arg_6
=
arg_5
=
arg_4
=
[
template
.
Variable
(
arg_1
.
contents
[
13
:
arg_6
]
)
]
arg_7
=
{
}
arg_8
=
arg_1
.
contents
[
arg_5
:
]
.
split
(
','
)
for
arg_9
in
arg_8
:
if
'='
in
arg_9
:
arg_10
,
arg_11
=
arg_9
.
split
(
'='
,
1
)
arg_10
=
arg_10
.
strip
(
)
arg_7
[
arg_10
]
=
template
.
Variable
(
arg_11
)
return
arg_4
,
arg_7

def Func(arg_0, arg_1):
    """
    Parse uniformly args and kwargs from a templatetag

    Usage::

      For parsing a template like this:

      {% footag my_contents,height=10,zoom=20 as myvar %}

      You simply do this:

      @register.tag
      def footag(parser, token):
          args, kwargs = Func(parser, token)
    """
    arg_2 = arg_1.contents.split(' ')

    if len(arg_2) <= 1:
        raise template.TemplateSyntaxError("'%s' takes at least one argument" % arg_2[0])

    if arg_1.contents[13] == '"':
        arg_3 = arg_1.contents.index('"', 14) + 1
        arg_4 = [template.Variable(arg_1.contents[13:arg_3])]
        arg_5 = arg_3
    else:
        try:
            arg_6 = arg_1.contents.index(' ', 14)
            arg_5 = arg_6 + 1
        except ValueError:
            arg_6 = None
            arg_5 = None
        arg_4 = [template.Variable(arg_1.contents[13:arg_6])]

    arg_7 = {}
    arg_8 = arg_1.contents[arg_5:].split(',')
    for arg_9 in arg_8:
        if '=' in arg_9:
            arg_10, arg_11 = arg_9.split('=', 1)
            arg_10 = arg_10.strip()
            arg_7[arg_10] = template.Variable(arg_11)
    return arg_4, arg_7

Parse uniformly args and kwargs from a templatetag

    Usage::

      For parsing a template like this:

      {% footag my_contents,height=10,zoom=20 as myvar %}

      You simply do this:

      @register.tag
      def footag(parser, token):
          args, kwargs = parse_args_kwargs(parser, token)


def Func ( arg_0 , arg_1 = None ) : arg_0 . init ( ) if arg_1 : arg_2 = arg_0 . get_previous_thumbprint ( ) or { } arg_2 . update ( arg_0 . get_current_thumbprint ( arg_1 = arg_1 ) or { } ) else : arg_2 = arg_0 . get_current_thumbprint ( arg_1 = arg_1 ) or { } arg_3 = yaml . dump ( arg_2 ) arg_4 = arg_0 . local_renderer arg_4 . upload_content ( content = arg_3 , fn = arg_0 . manifest_filename ) arg_0 . reset_all_satchels ( )

def Func(arg_0, arg_1=None):#, set_satchels=None):
        """
        Update the thumbprint on the remote server but execute no satchel configurators.

        components = A comma-delimited list of satchel names to limit the Func deployment to.
        set_satchels = A semi-colon delimited list of key-value pairs to set in satchels before recording a Func deployment.
        """

        arg_0.init()

        # In cases where we only want to Func deployment of a specific satchel, then simply copy the last thumbprint and overwrite with a subset
        # of the current thumbprint filtered by our target components.
        if arg_1:
            arg_2 = arg_0.get_previous_thumbprint() or {}
            arg_2.update(arg_0.get_current_thumbprint(arg_1=arg_1) or {})
        else:
            arg_2 = arg_0.get_current_thumbprint(arg_1=arg_1) or {}

        arg_3 = yaml.dump(arg_2)
        arg_4 = arg_0.local_renderer
        arg_4.upload_content(content=arg_3, fn=arg_0.manifest_filename)

        # Ensure all cached manifests are cleared, so they reflect the newly deployed changes.
        arg_0.reset_all_satchels()

Update the thumbprint on the remote server but execute no satchel configurators.

        components = A comma-delimited list of satchel names to limit the fake deployment to.
        set_satchels = A semi-colon delimited list of key-value pairs to set in satchels before recording a fake deployment.

Update the thumbprint on the remote server but execute no satchel configurators .


def Func ( arg_0 , arg_1 = None ) : arg_2 = { "prefix" : arg_1 } return arg_0 . request ( method = "get" , arg_2 = arg_2 ) . json ( )

def Func(arg_0, arg_1=None):
        """ Lists all the namespaces registered with Nomad.

           https://www.nomadproject.io/docs/enterprise/namespaces/index.html
            arguments:
              - prefix :(str) optional, specifies a string to filter namespaces on based on an prefix.
                        This is specified as a querystring parameter.
            returns: list
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"prefix": arg_1}
        return arg_0.request(method="get", arg_2=arg_2).json()

Lists all the namespaces registered with Nomad .


return format_html(template, static=_static_url, v=version)

def Func(arg_0=None):
    """
    Returns the jQuery DataTables plugin file according to version number.
    TEMPLATE_DEBUG returns full file, otherwise returns minified file.
    """
    if arg_0 is None:
        if not getattr(settings, 'DJFRONTEND_JQUERY_DATATABLES', False):
            arg_0 = getattr(settings, 'DJFRONTEND_JQUERY_DATATABLES_VERSION', DJFRONTEND_JQUERY_DATATABLES_VERSION_DEFAULT)
        else:
            arg_0 = getattr(settings, 'DJFRONTEND_JQUERY_DATATABLES', DJFRONTEND_JQUERY_DATATABLES_VERSION_DEFAULT)

    if getattr(settings, 'TEMPLATE_DEBUG', False):
        arg_1 = '<script src="{static}djfrontend/js/jquery/jquery.dataTables/{v}/jquery.dataTables.js"></script>'
    else:
        arg_1 = (
            '<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/{v}/jquery.dataTables.min.js"></script>'
            '<script>window.jQuery.fn.DataTable || document.write(\'<script src="{static}djfrontend/js/jquery/jquery.dataTables/{v}/jquery.dataTables.min.js"><\/script>\')</script>')
    return format_html(arg_1, static=_static_url, v=arg_0)

Returns the jQuery DataTables plugin file according to version number . TEMPLATE_DEBUG returns full file otherwise returns minified file .


return super(CallTipWidget, self).eventFilter(obj, event)

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_0 . _text_edit : arg_3 = arg_2 . type ( ) if arg_3 == QtCore . QEvent . KeyPress : arg_4 = arg_2 . key ( ) if arg_4 in ( QtCore . Qt . Key_Enter , QtCore . Qt . Key_Return ) : arg_0 . hide ( ) elif arg_4 == QtCore . Qt . Key_Escape : arg_0 . hide ( ) return True elif arg_3 == QtCore . QEvent . FocusOut : arg_0 . hide ( ) elif arg_3 == QtCore . QEvent . Enter : arg_0 . _hide_timer . stop ( ) elif arg_3 == QtCore . QEvent . Leave : arg_0 . _leave_event_hide ( ) return super ( CallTipWidget , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """ Reimplemented to hide on certain key presses and on text edit focus
            changes.
        """
        if arg_1 == arg_0._text_edit:
            arg_3 = arg_2.type()

            if arg_3 == QtCore.QEvent.KeyPress:
                arg_4 = arg_2.key()
                if arg_4 in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return):
                    arg_0.hide()
                elif arg_4 == QtCore.Qt.Key_Escape:
                    arg_0.hide()
                    return True

            elif arg_3 == QtCore.QEvent.FocusOut:
                arg_0.hide()

            elif arg_3 == QtCore.QEvent.Enter:
                arg_0._hide_timer.stop()

            elif arg_3 == QtCore.QEvent.Leave:
                arg_0._leave_event_hide()

        return super(CallTipWidget, arg_0).Func(arg_1, arg_2)

Reimplemented to hide on certain key presses and on text edit focus changes .


def Func(arg_0):
        """Start remote agent"""
        logger.info('Starting agent: %s', arg_0.host)
        arg_1 = "{python} {agent_path} --telegraf {telegraf_path} --host {host} {kill_old}".format(
            python=arg_0.python,
            agent_path=os.path.join(
                arg_0.path['AGENT_REMOTE_FOLDER'],
                arg_0.AGENT_FILENAME),
            telegraf_path=arg_0.path['TELEGRAF_REMOTE_PATH'],
            host=arg_0.host,
            kill_old=arg_0.kill_old)
        logger.debug('Command to Func agent: %s', arg_1)
        arg_0.session = arg_0.ssh.async_session(arg_1)
        arg_0.reader_thread = threading.Thread(target=arg_0.read_buffer)
        arg_0.reader_thread.setDaemon(True)
        return arg_0.session


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_2_0):
        """
        Write the DefaultsInformation structure encoding to the data stream.

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

        Raises:
            InvalidField: Raised if the object defaults field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the DefaultsInformation structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the DefaultsInformation "
                "object.".format(
                    arg_2.value
                )
            )

        arg_6 = BytearrayStream()

        if arg_0._object_defaults:
            for arg_7 in arg_0._object_defaults:
                arg_7.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidField(
                "The DefaultsInformation structure is missing the object "
                "defaults field."
            )

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

Write the DefaultsInformation structure encoding to the data stream.

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

        Raises:
            InvalidField: Raised if the object defaults field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the DefaultsInformation structure.

Write the DefaultsInformation structure encoding to the data stream .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = datetime . datetime . utcnow ( ) if arg_3 >= arg_0 . expires_at : arg_0 . session . close ( ) arg_0 . _create_session ( ) arg_4 = arg_0 . session . post ( arg_1 , data = arg_2 ) return arg_4 . status_code , arg_4 . text

def Func(arg_0, arg_1, arg_2):
        """
        Make a post request using the session object to a SuccessFactors endpoint.

        Args:
            url (str): The url to post to.
            payload (str): The json encoded payload to post.
        """
        arg_3 = datetime.datetime.utcnow()
        if arg_3 >= arg_0.expires_at:
            # Create a new session with a valid token
            arg_0.session.close()
            arg_0._create_session()
        arg_4 = arg_0.session.post(arg_1, data=arg_2)
        return arg_4.status_code, arg_4.text

Make a post request using the session object to a SuccessFactors endpoint .


(job, url, name=None, s3_key_path=None, cghub_key_path=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    """Job version of `download_url`"""
    arg_5 = arg_0.fileStore.getLocalTempDir()
    arg_6 = download_url(arg_0=arg_0, arg_1=arg_1, arg_5=arg_5, arg_2=arg_2,
                         arg_3=arg_3, arg_4=arg_4)
    return arg_0.fileStore.writeGlobalFile(arg_6)


def Func(arg_0):
    """Converts Duration to string format.

    Returns:
      A string converted from self. The string format will contains
      3, 6, or 9 fractional digits depending on the precision required to
      represent the exact Duration value. For example: "1s", "1.010s",
      "1.000000100s", "-3.100s"
    """
    if arg_0.seconds < 0 or arg_0.nanos < 0:
      arg_1 = '-'
      arg_2 = - arg_0.seconds + int((0 - arg_0.nanos) // 1e9)
      arg_3 = (0 - arg_0.nanos) % 1e9
    else:
      arg_1 = ''
      arg_2 = arg_0.seconds + int(arg_0.nanos // 1e9)
      arg_3 = arg_0.nanos % 1e9
    arg_1 += '%d' % arg_2
    if (arg_3 % 1e9) == 0:
      # If there are 0 fractional digits, the fractional
      # point '.' should be omitted when serializing.
      return arg_1 + 's'
    if (arg_3 % 1e6) == 0:
      # Serialize 3 fractional digits.
      return arg_1 + '.%03ds' % (arg_3 / 1e6)
    if (arg_3 % 1e3) == 0:
      # Serialize 6 fractional digits.
      return arg_1 + '.%06ds' % (arg_3 / 1e3)
    # Serialize 9 fractional digits.
    return arg_1 + '.%09ds' % arg_3


def Func ( arg_0 ) : arg_1 = arg_0 [ MBox . DATE_FIELD ] arg_1 = str_to_datetime ( arg_1 ) return arg_1 . timestamp ( )

def Func(arg_0):
        """Extracts the update time from a MBox item.

        The timestamp used is extracted from 'Date' field in its
        several forms. This date is converted to UNIX timestamp
        format.

        :param item: item generated by the backend

        :returns: a UNIX timestamp
        """
        arg_1 = arg_0[MBox.DATE_FIELD]
        arg_1 = str_to_datetime(arg_1)

        return arg_1.timestamp()

Extracts the update time from a MBox item .


def Func ( arg_0 ) : arg_1 = PyFunceble . CONFIGURATION [ "links" ] [ "dir_structure" ] arg_1 = Version ( True ) . right_url_from_version ( arg_1 ) arg_2 = ( PyFunceble . CURRENT_DIRECTORY + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "dir_structure" ] ) if not Version ( True ) . is_cloned ( ) or not PyFunceble . path . isfile ( arg_2 ) : arg_3 = Download ( arg_1 , arg_2 , return_data = True ) . text ( ) File ( arg_2 ) . write ( arg_3 , overwrite = True ) return True return None

def Func(arg_0):
        """
        Download the latest version of `dir_structure_production.json`.
        """

        # We initiate the link to the public suffix configuration.
        # It is not hard coded because this method is called only if we
        # are sure that the configuration file exist.
        arg_1 = PyFunceble.CONFIGURATION["links"]["dir_structure"]

        # We update the link according to our current version.
        arg_1 = Version(True).right_url_from_version(arg_1)

        # We set the destination of the downloaded file.
        arg_2 = (
            PyFunceble.CURRENT_DIRECTORY
            + PyFunceble.CONFIGURATION["outputs"]["default_files"]["dir_structure"]
        )

        if not Version(True).is_cloned() or not PyFunceble.path.isfile(arg_2):
            # The current version is not the cloned version.

            # We Download the link content and return the download status.
            arg_3 = Download(arg_1, arg_2, return_data=True).text()

            File(arg_2).write(arg_3, overwrite=True)
            return True

        # We are in the cloned version.

        # We do not need to download the file, so we are returning None.
        return None

Download the latest version of dir_structure_production . json .


(self,fromlines,tolines,fromdesc='',todesc='',context=False,
                   numlines=5)

'        </tbody>        \n        <tbody>\n'

def Func(arg_0,arg_1,arg_2,arg_3='',arg_4='',arg_5=False,
                   arg_6=5):
        """Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        """

        # make unique anchor prefixes so that multiple tables may exist
        # on the same page without conflict.
        arg_0._make_prefix()

        # change tabs to spaces before it gets more difficult after we insert
        # markup
        arg_1,arg_2 = arg_0._tab_newline_replace(arg_1,arg_2)

        # create diffs iterator which generates side by side from/to data
        if arg_5:
            arg_7 = arg_6
        else:
            arg_7 = None
        arg_8 = _mdiff(arg_1,arg_2,arg_7,linejunk=arg_0._linejunk,
                      charjunk=arg_0._charjunk)

        # set up iterator to wrap lines that exceed desired width
        if arg_0._wrapcolumn:
            arg_8 = arg_0._line_wrapper(arg_8)

        # collect up from/to lines and flags into lists (also format the lines)
        arg_9,arg_10,arg_11 = arg_0._collect_lines(arg_8)

        # process change flags, generating middle column of next anchors/links
        arg_9,arg_10,arg_11,arg_12,arg_13 = arg_0._convert_flags(
            arg_9,arg_10,arg_11,arg_5,arg_6)

        arg_14 = []
        arg_15 = '
%s	%s' + \
              '%s	%s
\n'
        for arg_16 in range(len(arg_11)):
            if arg_11[arg_16] is None:
                # mdiff yields None on separator lines skip the bogus ones
                # generated for the first line
                if arg_16 > 0:
                    arg_14.append('
        \n
\n')
            else:
                arg_14.append( arg_15 % (arg_13[arg_16],arg_12[arg_16],arg_9[arg_16],
                                           arg_12[arg_16],arg_10[arg_16]))
        if arg_3 or arg_4:
            arg_17 = '

%s%s%s%s

' % (
                '
	',
                '%s	' % arg_3,
                '
	',
                '%s	' % arg_4)
        else:
            arg_17 = ''

        arg_18 = arg_0._table_template % dict(
            data_rows=''.join(arg_14),
            arg_17=arg_17,
            prefix=arg_0._prefix[1])

        return arg_18.replace('\0+',''). \
                     replace('\0-',''). \
                     replace('\0^',''). \
                     replace('\1',''). \
                     replace('\t',' ')


def Func(arg_0, arg_1):
    """
    Builds a query for both included & excluded terms in a text search.
    """
    arg_2, arg_3 = get_text_tokenizer(arg_0)
    arg_4 = get_query_includes(arg_2, arg_1)
    arg_5 = get_query_excludes(arg_3, arg_1)
    arg_6 = None
    if arg_4 and arg_5:
        arg_6 = arg_4 & ~arg_5
    elif not arg_5:
        arg_6 = arg_4
    else:
        arg_6 = ~arg_5
    return arg_6

Builds a query for both included & excluded terms in a text search .


def Func ( arg_0 ) : arg_0 [ 'temp' ] = np . around ( arg_0 [ 'temp' ] , - 1 ) arg_0 [ 'lum' ] = np . around ( arg_0 [ 'lum' ] , 3 ) return arg_0

def Func(arg_0):
    """
    Return the numpy array with rounded teff and luminosity columns.
    """
    arg_0['temp'] = np.around(arg_0['temp'], -1)
    arg_0['lum'] = np.around(arg_0['lum'], 3)
    return arg_0

Return the numpy array with rounded teff and luminosity columns .


(hyper_model_image_1d, hyper_galaxy_images_1d, hyper_galaxies,
                                                        hyper_minimum_values)

return list(map(lambda hyper_galaxy, hyper_galaxy_image_1d, hyper_minimum_value:
                    hyper_galaxy.contributions_from_model_image_and_galaxy_image(model_image=hyper_model_image_1d,
                                                                                galaxy_image=hyper_galaxy_image_1d,
                                                                                minimum_value=hyper_minimum_value),
                    hyper_galaxies, hyper_galaxy_images_1d, hyper_minimum_values))

def Func(arg_0, arg_1, arg_2,
                                                        arg_3):
    """For a fitting hyper_galaxy_image, hyper_galaxy model image, list of hyper galaxies images and model hyper galaxies, compute
    their contribution maps, which are used to compute a scaled-noise_map map. All quantities are masked 1D arrays.

    The reason this is separate from the *contributions_from_fitting_hyper_images_and_hyper_galaxies* function is that
    each hyper_galaxy image has a list of hyper galaxies images and associated hyper galaxies (one for each galaxy). Thus,
    this function breaks down the calculation of each 1D masked contribution map and returns them in the same datas
    structure (2 lists with indexes [image_index][contribution_map_index].

    Parameters
    ----------
    hyper_model_image_1d : ndarray
        The best-fit model image to the datas (e.g. from a previous analysis phase).
    hyper_galaxy_images_1d : [ndarray]
        The best-fit model image of each hyper galaxy to the datas (e.g. from a previous analysis phase).
    hyper_galaxies : [galaxy.Galaxy]
        The hyper galaxies which represent the model components used to scale the noise_map, which correspond to
        individual galaxies in the image.
    hyper_minimum_values : [float]
        The minimum value of each hyper_galaxy-image contribution map, which ensure zero's don't impact the scaled noise-map.
    """
    # noinspection PyArgumentList
    return list(map(lambda hyper_galaxy, hyper_galaxy_image_1d, hyper_minimum_value:
                    hyper_galaxy.contributions_from_model_image_and_galaxy_image(model_image=arg_0,
                                                                                galaxy_image=hyper_galaxy_image_1d,
                                                                                minimum_value=hyper_minimum_value),
                    arg_2, arg_1, arg_3))

For a fitting hyper_galaxy_image hyper_galaxy model image list of hyper galaxies images and model hyper galaxies compute their contribution maps which are used to compute a scaled - noise_map map . All quantities are masked 1D arrays .


def Func ( arg_0 , arg_1 ) : if not hasattr ( arg_1 , "extensions" ) : arg_1 . extensions = { } arg_1 . extensions [ "allows" ] = arg_0 @ arg_1 . before_request def start_context ( * arg_3 , ** arg_4 ) : arg_0 . overrides . push ( Override ( ) ) arg_0 . additional . push ( Additional ( ) ) @ arg_1 . after_request def cleanup ( arg_5 ) : arg_0 . clear_all_overrides ( ) arg_0 . clear_all_additional ( ) return arg_5

def Func(arg_0, arg_1):
        """
        Initializes the Flask-Allows object against the provided application
        """
        if not hasattr(arg_1, "extensions"):  # pragma: no cover
            arg_1.extensions = {}
        arg_1.extensions["allows"] = arg_0

        @arg_1.before_request
        def start_context(*arg_3, **arg_4):
            arg_0.overrides.push(Override())
            arg_0.additional.push(Additional())

        @arg_1.after_request
        def cleanup(arg_5):
            arg_0.clear_all_overrides()
            arg_0.clear_all_additional()
            return arg_5

Initializes the Flask - Allows object against the provided application


def Func ( arg_0 , arg_1 ) : assert ( all ( arg_2 . numEncodings > arg_1 for arg_2 in arg_0 . fields ) ) arg_3 = np . concatenate ( [ arg_2 . encodings [ arg_1 ] for arg_2 in arg_0 . fields ] ) return arg_3

def Func(arg_0, arg_1):
    """Returns the nth encoding"""

    assert (all(arg_2.numEncodings>arg_1 for arg_2 in arg_0.fields))
    arg_3 = np.concatenate([arg_2.encodings[arg_1] for arg_2 in arg_0.fields])

    return arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = False try : arg_3 = os . path . join ( arg_1 , arg_0 . STATUS_FILE ) arg_4 = open ( arg_3 , "rb" ) try : arg_5 = pickle . load ( arg_4 ) finally : arg_4 . close ( ) except ( IOError , ValueError ) : arg_2 = False else : arg_2 = True if arg_5 [ 'format' ] != arg_0 . STATUS_FORMAT : arg_2 = False elif arg_5 [ 'version' ] != coverage . __version__ : arg_2 = False if arg_2 : arg_0 . files = arg_5 [ 'files' ] arg_0 . settings = arg_5 [ 'settings' ] else : arg_0 . reset ( )

def Func(arg_0, arg_1):
        """Read the last status in `directory`."""
        arg_2 = False
        try:
            arg_3 = os.path.join(arg_1, arg_0.STATUS_FILE)
            arg_4 = open(arg_3, "rb")
            try:
                arg_5 = pickle.load(arg_4)
            finally:
                arg_4.close()
        except (IOError, ValueError):
            arg_2 = False
        else:
            arg_2 = True
            if arg_5['format'] != arg_0.STATUS_FORMAT:
                arg_2 = False
            elif arg_5['version'] != coverage.__version__:
                arg_2 = False

        if arg_2:
            arg_0.files = arg_5['files']
            arg_0.settings = arg_5['settings']
        else:
            arg_0.reset()


def Func ( arg_0 ) : arg_1 = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , "static" ) ) arg_2 = [ ( r"/static/(.*)" , cyclone . web . StaticFileHandler , { "path" : arg_1 } ) , ] for arg_3 in arg_0 . pages : arg_4 = arg_3 . handler arg_4 . site = arg_0 arg_4 . page = arg_3 arg_2 . append ( ( arg_3 . link . url , arg_4 ) ) return arg_2

def Func(arg_0):
        """ Generate the handlers for this site """
        arg_1 = os.path.abspath(os.path.join(os.path.dirname(__file__),"static"))
        arg_2 = [
            (r"/static/(.*)", cyclone.web.StaticFileHandler, {"path": arg_1}),
        ]
        for arg_3 in arg_0.pages:
            arg_4 = arg_3.handler
            arg_4.site = arg_0
            arg_4.page = arg_3
            arg_2.append((arg_3.link.url,arg_4))
        return arg_2


def Func ( arg_0 ) : arg_0 . shell = TerminalInteractiveShell . instance ( config = arg_0 . config , display_banner = False , profile_dir = arg_0 . profile_dir , ipython_dir = arg_0 . ipython_dir ) arg_0 . shell . configurables . append ( arg_0 )

def Func(arg_0):
        """initialize the InteractiveShell instance"""
        # Create an InteractiveShell instance.
        # shell.display_banner should always be False for the terminal
        # based app, because we call shell.show_banner() by hand below
        # so the banner shows *before* all extension loading stuff.
        arg_0.shell = TerminalInteractiveShell.instance(config=arg_0.config,
                        display_banner=False, profile_dir=arg_0.profile_dir,
                        ipython_dir=arg_0.ipython_dir)
        arg_0.shell.configurables.append(arg_0)


def Func ( arg_0 , arg_1 = 'Functf-8' ) : if isinstance ( arg_0 , six . binary_type ) : arg_0 = arg_0 . decode ( arg_1 ) arg_0 = arg_0 . replace ( '\r\n' , '\n' ) retFuncrn arg_0

def Func(arg_0, arg_1='Functf-8'):
    "RetFuncrn Funcnicode text, no matter what"

    if isinstance(arg_0, six.binary_type):
        arg_0 = arg_0.decode(arg_1)

    # it's already Funcnicode
    arg_0 = arg_0.replace('\r\n', '\n')
    retFuncrn arg_0


return '{host}{athlete}'.format(
            host=self.host,
            athlete=quote_plus(athlete)
        )

def Func ( arg_0 , arg_1 ) : return '{host}{athlete}' . format ( host = arg_0 . host , arg_1 = quote_plus ( arg_1 ) )

def Func(arg_0, arg_1):
        """Construct athlete endpoint from host and athlete name

        Keyword arguments:
        athlete -- Full athlete name
        """
        return '{host}{athlete}'.format(
            host=arg_0.host,
            arg_1=quote_plus(arg_1)
        )


def Func ( arg_0 , arg_1 ) : if arg_1 . get ( "count" ) is not None : return arg_0 == int ( arg_1 [ "count" ] ) if arg_1 . get ( "maximum" ) is not None and int ( arg_1 [ "maximum" ] ) < arg_0 : return False if arg_1 . get ( "minimum" ) is not None and int ( arg_1 [ "minimum" ] ) > arg_0 : return False if arg_1 . get ( "between" ) is not None and arg_0 not in arg_1 [ "between" ] : return False return True

def Func(arg_0, arg_1):
    """
    Returns whether the given count matches the given query options.

    If no quantity options are specified, any count is considered acceptable.

    Args:
        count (int): The count to be validated.
        options (Dict[str, int | Iterable[int]]): A dictionary of query options.

    Returns:
        bool: Whether the count matches the options.
    """

    if arg_1.get("count") is not None:
        return arg_0 == int(arg_1["count"])
    if arg_1.get("maximum") is not None and int(arg_1["maximum"]) < arg_0:
        return False
    if arg_1.get("minimum") is not None and int(arg_1["minimum"]) > arg_0:
        return False
    if arg_1.get("between") is not None and arg_0 not in arg_1["between"]:
        return False
    return True

Returns whether the given count matches the given query options .


return remove_extra_delims("({0}){1}({2})".format(dep_units, op, indep_units))

def Func ( arg_0 , arg_1 , arg_2 ) : if ( not arg_1 ) and ( not arg_0 ) : return "" if arg_1 and ( not arg_0 ) : return arg_1 if ( not arg_1 ) and arg_0 : return ( remove_extra_delims ( "1{0}({1})" . format ( arg_2 , arg_0 ) ) if arg_2 == "/" else remove_extra_delims ( "({0})" . format ( arg_0 ) ) ) return remove_extra_delims ( "({0}){1}({2})" . format ( arg_1 , arg_2 , arg_0 ) )

def Func(arg_0, arg_1, arg_2):
    """Build unit math operations."""
    if (not arg_1) and (not arg_0):
        return ""
    if arg_1 and (not arg_0):
        return arg_1
    if (not arg_1) and arg_0:
        return (
            remove_extra_delims("1{0}({1})".format(arg_2, arg_0))
            if arg_2 == "/"
            else remove_extra_delims("({0})".format(arg_0))
        )
    return remove_extra_delims("({0}){1}({2})".format(arg_1, arg_2, arg_0))


def Func ( arg_0 ) : with open ( arg_0 ) as audit_file : audit_file . next ( ) arg_1 = [ ] for arg_2 in audit_file : arg_3 = ":" arg_4 = arg_2 . index ( arg_3 ) arg_5 = arg_2 . index ( ',' ) arg_6 = float ( arg_2 [ arg_4 + 2 : arg_5 ] ) arg_7 = arg_2 [ arg_5 + 2 : - 2 ] arg_8 = json . loads ( arg_7 . replace ( "'" , "\"" ) ) arg_1 . append ( ( arg_6 , arg_8 ) ) arg_1 . sort ( key = lambda pair : pair [ 0 ] ) return arg_1

def Func(arg_0):
  """
  Loads a confusion matrix in a two-level dictionary format.

  For example, the confusion matrix of a 75%-accurate model
  that predicted 15 values (and mis-classified 5) may look like:
  {"A": {"A":10, "B": 5}, "B": {"B":5}}

  Note that raw boolean values are translated into strings, such that
  a value that was the boolean True will be returned as the string "True".
  """

  with open(arg_0) as audit_file:
    audit_file.next() # Skip the first line.

    # Extract the confusion matrices and repair levels from the audit file.
    arg_1 = []
    for arg_2 in audit_file:
      arg_3 = ":"
      arg_4 = arg_2.index(arg_3)

      arg_5 = arg_2.index(',')
      arg_6 = float(arg_2[arg_4+2:arg_5])
      arg_7 = arg_2[arg_5+2:-2]
      arg_8 = json.loads( arg_7.replace("'","\"") )
      arg_1.append( (arg_6, arg_8) )

  # Sort the repair levels in case they are out of order for whatever reason.
  arg_1.sort(key = lambda pair: pair[0])
  return arg_1

Loads a confusion matrix in a two - level dictionary format .


def Func ( arg_0 = None , arg_1 = None , arg_2 = False ) : if arg_0 is None : return partial ( Func , arg_1 = arg_1 , arg_2 = arg_2 ) @ wraps ( arg_0 ) def wrapped ( arg_3 , * arg_4 , ** arg_5 ) : arg_6 = ( arg_1 or arg_3 . soft_time_limit or arg_3 . time_limit or arg_3 . app . conf . get ( 'CELERYD_TASK_SOFT_TIME_LIMIT' ) or arg_3 . app . conf . get ( 'CELERYD_TASK_TIME_LIMIT' ) or ( 60 * 5 ) ) arg_7 = _select_manager ( arg_3 . backend . __class__ . __name__ ) arg_8 = arg_7 ( arg_3 , arg_6 , arg_2 , arg_4 , arg_5 ) with arg_8 : arg_9 = arg_0 ( * arg_4 , ** arg_5 ) return arg_9 return wrapped

def Func(arg_0=None, arg_1=None, arg_2=False):
    """Celery task decorator. Forces the task to have only one running instance at a time.

    Use with binded tasks (@celery.task(bind=True)).

    Modeled after:
    http://loose-bits.com/2010/10/distributed-task-locking-in-celery.html
    http://blogs.it.ox.ac.uk/inapickle/2012/01/05/python-decorators-with-optional-arguments/

    Written by @Robpol86.

    :raise OtherInstanceError: If another instance is already running.

    :param function func: The function to decorate, must be also decorated by @celery.task.
    :param int lock_timeout: Lock timeout in seconds plus five more seconds, in-case the task crashes and fails to
        release the lock. If not specified, the values of the task's soft/hard limits are used. If all else fails,
        timeout will be 5 minutes.
    :param bool include_args: Include the md5 checksum of the arguments passed to the task in the Redis key. This allows
        the same task to run with different arguments, only stopping a task from running if another instance of it is
        running with the same arguments.
    """
    if arg_0 is None:
        return partial(Func, arg_1=arg_1, arg_2=arg_2)

    @wraps(arg_0)
    def wrapped(arg_3, *arg_4, **arg_5):
        """Wrapped Celery task, for Func()."""
        # Select the manager and get timeout.
        arg_6 = (
            arg_1 or arg_3.soft_time_limit or arg_3.time_limit
            or arg_3.app.conf.get('CELERYD_TASK_SOFT_TIME_LIMIT')
            or arg_3.app.conf.get('CELERYD_TASK_TIME_LIMIT')
            or (60 * 5)
        )
        arg_7 = _select_manager(arg_3.backend.__class__.__name__)
        arg_8 = arg_7(arg_3, arg_6, arg_2, arg_4, arg_5)

        # Lock and execute.
        with arg_8:
            arg_9 = arg_0(*arg_4, **arg_5)
        return arg_9
    return wrapped

Celery task decorator . Forces the task to have only one running instance at a time .


def Func ( arg_0 ) : return dict ( n = 1 , queue = u'' , profile_dir = u'' , cluster_id = u'' )

def Func(arg_0):
        """load the default context with the default values for the basic keys

        because the _trait_changed methods only load the context if they
        are set to something other than the default value.
        """
        return dict(n=1, queue=u'', profile_dir=u'', cluster_id=u'')


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . ctx . enable ( moderngl . BLEND ) arg_0 . ctx . blend_func = moderngl . SRC_ALPHA , moderngl . ONE_MINUS_SRC_ALPHA for arg_5 in arg_0 . point_lights : arg_6 = matrix44 . multiply ( arg_5 . matrix , arg_1 ) arg_7 = arg_5 . radius arg_0 . debug_shader [ "m_proj" ] . write ( arg_2 . tobytes ( ) ) arg_0 . debug_shader [ "m_mv" ] . write ( arg_6 . astype ( 'f4' ) . tobytes ( ) ) arg_0 . debug_shader [ "size" ] . value = arg_7 arg_0 . unit_cube . render ( arg_0 . debug_shader , mode = moderngl . LINE_STRIP ) arg_0 . ctx . disable ( moderngl . BLEND )

def Func(arg_0, arg_1, arg_2):
        """Render outlines of light volumes"""
        arg_0.ctx.enable(moderngl.BLEND)
        arg_0.ctx.blend_func = moderngl.SRC_ALPHA, moderngl.ONE_MINUS_SRC_ALPHA

        for arg_5 in arg_0.point_lights:
            arg_6 = matrix44.multiply(arg_5.matrix, arg_1)
            arg_7 = arg_5.radius
            arg_0.debug_shader["m_proj"].write(arg_2.tobytes())
            arg_0.debug_shader["m_mv"].write(arg_6.astype('f4').tobytes())
            arg_0.debug_shader["size"].value = arg_7
            arg_0.unit_cube.render(arg_0.debug_shader, mode=moderngl.LINE_STRIP)

        arg_0.ctx.disable(moderngl.BLEND)


def Func ( arg_0 ) : if _credentials_from_request ( arg_0 . request ) : return ( arg_0 . _scopes | _credentials_from_request ( arg_0 . request ) . scopes ) else : return arg_0 . _scopes

def Func(arg_0):
        """Returns the scopes associated with this object, kept up to
         date for incremental auth."""
        if _credentials_from_request(arg_0.request):
            return (arg_0._scopes |
                    _credentials_from_request(arg_0.request).scopes)
        else:
            return arg_0._scopes

Returns the scopes associated with this object kept up to date for incremental auth .