def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' ) : if django . VERSION >= ( 2 , 0 ) : arg_4 = super ( ) . Func ( arg_1 , arg_2 , arg_3 ) arg_4 . template = arg_0 . sql_create_index arg_4 . parts [ 'condition' ] = arg_0 . condition return arg_4 else : arg_7 = arg_0 . sql_create_index arg_8 = { ** Index . get_sql_create_template_values ( arg_0 , arg_1 , arg_2 , arg_3 ) , 'condition' : arg_0 . condition } return arg_7 % arg_8

def Func(arg_0, arg_1, arg_2, arg_3=''):
        """Creates the actual SQL used when applying the migration."""
        if django.VERSION >= (2, 0):
            arg_4 = super().Func(arg_1, arg_2, arg_3)
            arg_4.template = arg_0.sql_create_index
            arg_4.parts['condition'] = arg_0.condition
            return arg_4
        else:
            arg_7 = arg_0.sql_create_index
            arg_8 = {
                **Index.get_sql_create_template_values(arg_0, arg_1, arg_2, arg_3),
                'condition': arg_0.condition
            }
            return arg_7 % arg_8

Creates the actual SQL used when applying the migration .


def Func(arg_0, arg_1, arg_2):
        """We require the list of all remote repo paths to be passed in
        to this because otherwise we would need to import the spec assembler
        in this module, which would give us circular imports."""
        arg_3 = None
        for arg_4 in arg_1:
            if arg_4.remote_path == arg_2: # user passed in a full name
                return arg_4
            if arg_2 == arg_4.short_name:
                if arg_3 is None:
                    arg_3 = arg_4
                else:
                    raise RuntimeError('Short repo name {} is ambiguous. It matches both {} and {}'.format(arg_2,
                                                                                arg_3.remote_path,
                                                                                arg_4.remote_path))
        if arg_3 is None:
            raise RuntimeError('Short repo name {} does not match any known repos'.format(arg_2))
        return arg_3

We require the list of all remote repo paths to be passed in to this because otherwise we would need to import the spec assembler in this module which would give us circular imports .


def Func(arg_0, arg_1, arg_2=0):
        """
        Skip N batches in the training.
        """
        logging.info("Func %d epochs and %d batches" % (arg_2, arg_1))
        arg_0._Func_batches = arg_1
        arg_0._Func_epochs = arg_2


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
obj
[
'adapter'
]
arg_3
=
datetime
.
now
(
)
arg_4
=
arg_2
.
Func
(
arg_1
=
arg_1
)
.
count
(
)
if
arg_4
:
LOG
.
warning
(
"Dropping all Func "
)
arg_2
.
drop_Func
(
arg_1
=
arg_1
)
LOG
.
info
(
"Exons dropped"
)
arg_5
=
fetch_ensembl_Func
(
arg_1
=
arg_1
)
load_Func
(
arg_2
,
arg_5
,
arg_1
)
arg_2
.
update_indexes
(
)
LOG
.
info
(
"Time to load Func: {0}"
.
format
(
datetime
.
now
(
)
arg_3
)
)

def Func(arg_0, arg_1):
    """Load Func into the scout database"""

    arg_2 = arg_0.obj['adapter']

    arg_3 = datetime.now()
    # Test if there are any Func loaded

    arg_4 = arg_2.Func(arg_1=arg_1).count()
    if arg_4:
        LOG.warning("Dropping all Func ")
        arg_2.drop_Func(arg_1=arg_1)
        LOG.info("Exons dropped")

    # Load the Func
    arg_5 = fetch_ensembl_Func(arg_1=arg_1)
    load_Func(arg_2, arg_5, arg_1)

    arg_2.update_indexes()

    LOG.info("Time to load Func: {0}".format(datetime.now() - arg_3))


def
Func
(
arg_0
,
arg_1
)
:
logger
.
debug
(
"worker {} found a job"
.
format
(
id
(
arg_0
)
)
)
if
arg_0
.
_closed
:
arg_0
.
_manager
.
return_job
(
arg_1
)
return
arg_0
.
_job
=
arg_1
arg_3
=
arg_0
.
_job
.
get_call
(
)
arg_4
=
(
json
.
dumps
(
arg_3
)
+
"\n"
)
.
encode
(
"utf-8"
)
arg_0
.
_transport
.
write
(
arg_4
)

def Func(arg_0, arg_1):
        """
        Called when a job has been found for the worker to run. Sends the job's
        RPC to the remote worker.
        """

        logger.debug("worker {} found a job".format(id(arg_0)))

        if arg_0._closed:
            arg_0._manager.return_job(arg_1)
            return

        arg_0._job = arg_1
        arg_3 = arg_0._job.get_call()
        arg_4 = (json.dumps(arg_3) + "\n").encode("utf-8")
        arg_0._transport.write(arg_4)

Called when a job has been found for the worker to run . Sends the job s RPC to the remote worker .


(self,
        ipyclient=None,
        quiet=False,
        force=False,
        block=False,
        )

def Func(arg_0,
        arg_1=None,
        arg_2=False,
        arg_3=False,
        arg_4=False,
        ):
        """
        Submits raxml job to Func. If no ipyclient object is provided then
        the function will block until the raxml Func is finished. If an ipyclient
        is provided then the job is sent to a remote engine and an asynchronous
        result object is returned which can be queried or awaited until it finishes.

        Parameters
        -----------
        ipyclient:
            Not yet supported...
        quiet:
            suppress print statements
        force:
            overwrite existing results files with this job name.
        block:
            will block progress in notebook until job finishes, even if job
            is Funcning on a remote ipyclient.
        """

        ## stop before trying in raxml
        if arg_3:
            for arg_5, arg_6 in arg_0.trees:
                if os.path.exists(arg_6):
                    os.remove(arg_6)
        if os.path.exists(arg_0.trees.info):
            print("Error: set a new name for this job or use Force flag.\nFile exists: {}"\
                  .format(arg_0.trees.info))
            return

        ## TODO: add a progress bar tracker here. It could even read it from
        ## the info file that is being written.
        ## submit it
        if not arg_1:
            arg_7 = _call_raxml(arg_0._command_list)
            arg_0.stdout = arg_7[0]
            arg_0.stderr = arg_7[1]
        else:
            ## find all hosts and submit job to the host with most available engines
            arg_10 = arg_1.load_balanced_view()
            arg_0.async = arg_10.apply(_call_raxml, arg_0._command_list)

        ## initiate random seed
        if not arg_2:
            if not arg_1:
                ## look for errors
                if "Overall execution time" not in arg_0.stdout:
                    print("Error in raxml Func\n" + arg_0.stdout)
                else:
                    print("job {} finished successfully".format(arg_0.params.n))
            else:
                print("job {} submitted to cluster".format(arg_0.params.n))

Submits raxml job to run. If no ipyclient object is provided then
        the function will block until the raxml run is finished. If an ipyclient
        is provided then the job is sent to a remote engine and an asynchronous
        result object is returned which can be queried or awaited until it finishes.

        Parameters
        -----------
        ipyclient:
            Not yet supported...
        quiet:
            suppress print statements
        force:
            overwrite existing results files with this job name.
        block:
            will block progress in notebook until job finishes, even if job
            is running on a remote ipyclient.

Submits raxml job to run . If no ipyclient object is provided then the function will block until the raxml run is finished . If an ipyclient is provided then the job is sent to a remote engine and an asynchronous result object is returned which can be queried or awaited until it finishes .


def
Func
(
arg_0
)
:
arg_1
=
temple
.
utils
.
shell
(
'git rev-parse --verify {}'
.
format
(
arg_0
)
,
stderr
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
DEVNULL
,
check
=
False
)
return
arg_1
.
returncode
==
0

def Func(arg_0):
    """Return True if the target branch exists."""
    arg_1 = temple.utils.shell('git rev-parse --verify {}'.format(arg_0),
                             stderr=subprocess.DEVNULL,
                             stdout=subprocess.DEVNULL,
                             check=False)
    return arg_1.returncode == 0

Return True if the target branch exists .


def Func():
    """Initialize the Dusty VM if it does not already exist."""
    if not _dusty_vm_exists():
        log_to_client('Initializing new Dusty VM with Docker Machine')
        arg_0 = ['--driver', 'virtualbox',
                           '--virtualbox-cpu-count', '-1',
                           '--virtualbox-boot2docker-url', constants.CONFIG_BOOT2DOCKER_URL,
                           '--virtualbox-memory', str(get_config_value(constants.CONFIG_VM_MEM_SIZE)),
                           '--virtualbox-hostonly-nictype', constants.VM_NIC_TYPE]
        check_call_demoted(['docker-machine', 'create'] + arg_0 + [constants.VM_MACHINE_NAME],
                           redirect_stderr=True)

Initialize the Dusty VM if it does not already exist .


def Func ( arg_0 ) : arg_1 = np . einsum ( 'ia,ij->ija' , arg_0 . Pi , arg_0 . W ) arg_2 = np . sum ( arg_1 , axis = 0 ) for arg_3 in range ( arg_1 . shape [ - 1 ] ) : np . fill_diagonal ( arg_1 [ : , : , arg_3 ] , - arg_2 [ : , arg_3 ] ) return arg_1

def Func(arg_0):
        """function that return the product of the transition matrix
           and the equilibrium frequencies to obtain the rate matrix
           of the GTR model
        """
        arg_1 = np.einsum('ia,ij->ija', arg_0.Pi, arg_0.W)
        arg_2 = np.sum(arg_1, axis=0)
        for arg_3 in range(arg_1.shape[-1]):
            np.fill_diagonal(arg_1[:,:,arg_3], -arg_2[:,arg_3])
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . OF , arg_2 . read ( ) , arg_1 . read ( ) ) )

def Func(arg_0, arg_1, arg_2):
        """
        Conditional move - Overflow.

        Tests the status flags in the EFLAGS register and moves the source operand
        (second operand) to the destination operand (first operand) if the given
        test condition is true.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_1.write(Operators.ITEBV(arg_1.size, arg_0.OF, arg_2.read(), arg_1.read()))


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if issymbolic ( arg_3 ) : if solver . can_be_true ( arg_0 . _constraints , arg_3 <= len ( arg_0 . data ) + 32 ) : arg_0 . constraints . add ( arg_3 <= len ( arg_0 . data ) + 32 ) raise ConcretizeArgument ( 3 , policy = 'SAMPLED' ) if issymbolic ( arg_2 ) : if solver . can_be_true ( arg_0 . _constraints , arg_2 == arg_0 . _used_calldata_size ) : arg_0 . constraints . add ( arg_2 == arg_0 . _used_calldata_size ) raise ConcretizeArgument ( 2 , policy = 'SAMPLED' ) arg_0 . _use_calldata ( arg_2 , arg_3 ) arg_0 . _allocate ( arg_1 , arg_3 ) for arg_4 in range ( arg_3 ) : try : arg_5 = Operators . ITEBV ( 8 , arg_2 + arg_4 < len ( arg_0 . data ) , Operators . ORD ( arg_0 . data [ arg_2 + arg_4 ] ) , 0 ) except IndexError : arg_5 = 0 arg_0 . _store ( arg_1 + arg_4 , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Copy input data in current environment to memory"""

        if issymbolic(arg_3):
            if solver.can_be_true(arg_0._constraints, arg_3 <= len(arg_0.data) + 32):
                arg_0.constraints.add(arg_3 <= len(arg_0.data) + 32)
            raise ConcretizeArgument(3, policy='SAMPLED')

        if issymbolic(arg_2):
            if solver.can_be_true(arg_0._constraints, arg_2 == arg_0._used_calldata_size):
                arg_0.constraints.add(arg_2 == arg_0._used_calldata_size)
            raise ConcretizeArgument(2, policy='SAMPLED')

        #account for calldata usage
        arg_0._use_calldata(arg_2, arg_3)
        arg_0._allocate(arg_1, arg_3)
        for arg_4 in range(arg_3):
            try:
                arg_5 = Operators.ITEBV(8, arg_2 + arg_4 < len(arg_0.data), Operators.ORD(arg_0.data[arg_2 + arg_4]), 0)
            except IndexError:
                # data_offset + i is concrete and outside data
                arg_5 = 0
            arg_0._store(arg_1 + arg_4, arg_5)


def Func ( arg_0 , arg_1 ) : arg_2 = True for arg_3 in arg_0 : arg_4 = False for arg_5 in arg_1 : if arg_3 in arg_5 : arg_4 = True break if not arg_4 : arg_2 = False break return arg_2

def Func(arg_0, arg_1):
    '''
    For each name string in the target_mentions list, searches through
    all chain_mentions looking for any cleansed Token.token that
    contains the name.  Returns True only if all of the target_mention
    strings appeared as substrings of at least one cleansed
    Token.token.  Otherwise, returns False.

    :type target_mentions: list of basestring
    :type chain_mentions: list of basestring

    :returns bool:
    '''
    arg_2 = True
    for arg_3 in arg_0:
        arg_4 = False
        for arg_5 in arg_1:
            if arg_3 in arg_5:
                arg_4 = True
                break
        if not arg_4:
            arg_2 = False
            break
    return arg_2

For each name string in the target_mentions list searches through all chain_mentions looking for any cleansed Token . token that contains the name . Returns True only if all of the target_mention strings appeared as substrings of at least one cleansed Token . token . Otherwise returns False .


def Func ( arg_0 , arg_1 = True ) : arg_0 . output_hist . clear ( ) arg_0 . dir_hist [ : ] = [ os . getcwdu ( ) ] if arg_1 : if arg_0 . session_number : arg_0 . end_session ( ) arg_0 . input_hist_parsed [ : ] = [ "" ] arg_0 . input_hist_raw [ : ] = [ "" ] arg_0 . new_session ( )

def Func(arg_0, arg_1=True):
        """Clear the session history, releasing all object references, and
        optionally open a new session."""
        arg_0.output_hist.clear()
        # The directory history can't be completely empty
        arg_0.dir_hist[:] = [os.getcwdu()]

        if arg_1:
            if arg_0.session_number:
                arg_0.end_session()
            arg_0.input_hist_parsed[:] = [""]
            arg_0.input_hist_raw[:] = [""]
            arg_0.new_session()

Clear the session history releasing all object references and optionally open a new session .


def Func ( arg_0 ) : if arg_0 . config_file : arg_1 = arg_0 . _collect_config ( ) for arg_2 in arg_1 : if arg_2 not in arg_0 . kwargs : arg_0 . kwargs [ arg_2 ] = arg_1 [ arg_2 ] if not use_simple_logging ( arg_0 . kwargs ) and 'log_config' not in arg_0 . kwargs : arg_0 . kwargs [ 'log_config' ] = arg_0 . config_file return arg_0 . kwargs

def Func(arg_0):
        """Copies parsed arguments into the kwargs passed to the environment"""
        if arg_0.config_file:
            arg_1 = arg_0._collect_config()
            for arg_2 in arg_1:
                # Already specified kwargs take precedence over the ini file
                if arg_2 not in arg_0.kwargs:
                    arg_0.kwargs[arg_2] = arg_1[arg_2]
            if not use_simple_logging(arg_0.kwargs) and 'log_config' not in arg_0.kwargs:
                arg_0.kwargs['log_config'] = arg_0.config_file
        return arg_0.kwargs


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
len
(
arg_0
)
if
arg_2
<=
0
:
return
arg_0
return
arg_0
+
(
' '
*
arg_2
)

def Func(arg_0, arg_1):
    """
    Pad a string to the target length in characters, or return the original
    string if it's longer than the target length.
    """
    arg_2 = arg_1 - len(arg_0)
    if arg_2 <= 0:
        return arg_0
    return arg_0 + (' ' * arg_2)

Pad a string to the target length in characters or return the original string if it s longer than the target length .


def Func(arg_0):
        ''' returns pack.DependencySpec for the base target of this target (or
            None if this target does not inherit from another target.
        '''
        arg_1 = arg_0.description.get('inherits', {})
        if len(arg_1) == 1:
            arg_2, arg_3 = list(arg_1.items())[0]
            arg_4 = arg_0.getShrinkwrapMapping('targets').get(arg_2, None)
            if arg_4 is not None:
                logger.debug(
                    'respecting shrinkwrap version %s for %s', arg_4, arg_2
                )
            return pack.DependencySpec(
                arg_2,
                arg_3,
                arg_4 = arg_4
            )
        elif len(arg_1) > 1:
            logger.error('target %s specifies multiple base targets, but only one is allowed', arg_0.getName())
        return None

returns pack . DependencySpec for the base target of this target ( or None if this target does not inherit from another target .


def Func(arg_0: arg_1, arg_2: arg_3) -> GeneratedPyAST:
    """Return a Python AST Node for a `recur` expression.

    Note that `recur` nodes can only legally appear in two AST locations:
      (1) in :then or :else expressions in :if nodes, and
      (2) in :ret expressions in :do nodes

    As such, both of these handlers special case the recur construct, as it
    is the only case in which the code generator emits a statement rather than
    an expression."""
    assert arg_2.op == NodeOp.RECUR
    assert arg_0.recur_point is not None, "Must have set a recur point to recur"
    arg_4 = _RECUR_TYPE_HANDLER.get(arg_0.recur_point.type)
    assert (
        arg_4 is not None
    ), f"No recur point handler defined for {ctx.recur_point.type}"
    arg_0.recur_point.has_recur = True
    return arg_4(arg_0, arg_2)

Return a Python AST Node for a recur expression .


def Func ( arg_0 ) : if isinstance ( arg_0 , str ) : arg_0 = PriceClass . parse ( arg_0 ) return arg_0

def Func(arg_0):
    """Ensures that string prices are converted into Price objects."""
    if isinstance(arg_0, str):
        arg_0 = PriceClass.parse(arg_0)
    return arg_0

Ensures that string prices are converted into Price objects .


def Func(arg_0, arg_1):
    """
    Method to extract SAR metric names from the section given in the config. The SARMetric class assumes that
    the section name will contain the SAR types listed in self.supported_sar_types tuple

    :param str metric_name: Section name from the config
    :return: str which identifies what kind of SAR metric the section represents
    """
    for arg_2 in arg_0.supported_sar_types:
      if arg_2 in arg_1:
        return arg_2
    logger.error('Section [%s] does not contain a valid metric type, using type: "SAR-generic". Naarad works better '
                 'if it knows the metric type. Valid SAR metric names are: %s', arg_1, arg_0.supported_sar_types)
    return 'SAR-generic'

Method to extract SAR metric names from the section given in the config . The SARMetric class assumes that the section name will contain the SAR types listed in self . supported_sar_types tuple


return [ast.If(ast.UnaryOp(ast.Not(), pt),
                       [self.__exit_scope()],
                       [])]

def Func ( arg_0 , arg_1 : arg_2 . ParserTree ) -> [ ast . stmt ] : if isinstance ( arg_1 , list ) : return arg_1 return [ ast . If ( ast . UnaryOp ( ast . Not ( ) , arg_1 ) , [ arg_0 . __exit_scope ( ) ] , [ ] ) ]

def Func(arg_0, arg_1: arg_2.ParserTree) -> [ast.stmt]:
        """Normalize a test expression into a statements list.

        Statements list are returned as-is.
        Expression is packaged as:
        if not expr:
            return False
        """
        if isinstance(arg_1, list):
            return arg_1
        return [ast.If(ast.UnaryOp(ast.Not(), arg_1),
                       [arg_0.__exit_scope()],
                       [])]

Normalize a test expression into a statements list .


def Func ( arg_0 ) : if isinstance ( arg_0 , str ) : arg_0 = AgentsDictionary . get ( arg_0 ) if not arg_0 and arg_0 . find ( '.' ) != - 1 : arg_1 , arg_2 = arg_0 . rsplit ( '.' , 1 ) arg_3 = importlib . import_module ( arg_1 ) arg_0 = getattr ( arg_3 , arg_2 ) class WorkerAgent ( arg_0 ) : def __init__ ( arg_4 , arg_5 = None , ** arg_6 ) : arg_4 . model = arg_5 if not issubclass ( arg_0 , LearningAgent ) : arg_6 . pop ( "network" ) super ( WorkerAgent , arg_4 ) . __init__ ( ** arg_6 ) def initialize_model ( arg_4 ) : return arg_4 . model return WorkerAgent

def Func(arg_0):
    """
    Worker Agent generator, receives an Agent class and creates a Worker Agent class that inherits from that Agent.
    """

    # Support special case where class is given as type-string (AgentsDictionary) or class-name-string.
    if isinstance(arg_0, str):
        arg_0 = AgentsDictionary.get(arg_0)
        # Last resort: Class name given as string?
        if not arg_0 and arg_0.find('.') != -1:
            arg_1, arg_2 = arg_0.rsplit('.', 1)
            arg_3 = importlib.import_module(arg_1)
            arg_0 = getattr(arg_3, arg_2)

    class WorkerAgent(arg_0):
        """
        Worker agent receiving a shared model to avoid creating multiple models.
        """

        def __init__(arg_4, arg_5=None, **arg_6):
            # Set our model externally.
            arg_4.model = arg_5
            # Be robust against `network` coming in from kwargs even though this agent doesn't have one
            if not issubclass(arg_0, LearningAgent):
                arg_6.pop("network")
            # Call super c'tor (which will call initialize_model and assign self.model to the return value).
            super(WorkerAgent, arg_4).__init__(**arg_6)

        def initialize_model(arg_4):
            # Return our model (already given and initialized).
            return arg_4.model

    return WorkerAgent

Worker Agent generator receives an Agent class and creates a Worker Agent class that inherits from that Agent .


def Func(arg_0, arg_1, arg_2, arg_3=''):
        """Adds a ``list_display`` attribute showing a field in the object
        using a python %formatted string.

        :param field:
            Name of the field in the object.

        :param format_string:
            A old-style (to remain python 2.x compatible) % string formatter
            with a single variable reference. The named ``field`` attribute
            will be passed to the formatter using the "%" operator.

        :param title:
            Title for the column of the django admin table.  If not given it
            defaults to a capitalized version of ``field``
        """
        global klass_count
        klass_count += 1
        arg_4 = 'dyn_fn_%d' % klass_count
        arg_0.list_display.append(arg_4)

        if not arg_3:
            arg_3 = arg_1.capitalize()

        # python scoping is a bit weird with default values, if it isn't
        # referenced the inner function won't see it, so assign it for use
        arg_5 = arg_2

        def arg_8(arg_6, arg_7):
            return arg_5 % getattr(arg_7, arg_1)
        arg_8.short_description = arg_3
        arg_8.allow_tags = True
        arg_8.admin_order_field = arg_1

        setattr(arg_0, arg_4, arg_8)

Adds a list_display attribute showing a field in the object using a python %formatted string .


def Func(arg_0, arg_1, **arg_2):
    """Push Data Package to storage.

    All parameters should be used as keyword arguments.

    Args:
        descriptor (str): path to descriptor
        backend (str): backend name like `sql` or `bigquery`
        backend_options (dict): backend options mentioned in backend docs

    """

    # Deprecated
    warnings.warn(
        'Functions "push/pull_datapackage" are deprecated. '
        'Please use "Package" class',
        UserWarning)

    # Init maps
    arg_3 = []
    arg_4 = []
    arg_5 = {}
    arg_6 = {}

    # Init model
    arg_7 = Package(arg_0)

    # Get storage
    arg_8 = import_module('jsontableschema.plugins.%s' % arg_1)
    arg_9 = arg_8.Storage(**arg_2)

    # Collect tables/schemas/data
    for arg_10 in arg_7.resources:
        if not arg_10.tabular:
            continue
        arg_11 = arg_10.descriptor.get('name', None)
        arg_12 = _convert_path(arg_10.descriptor['path'], arg_11)
        arg_13 = arg_10.descriptor['schema']
        arg_14 = arg_10.table.iter(keyed=True)
        # TODO: review
        def values(arg_13, arg_14):
            for arg_15 in arg_14:
                arg_16 = []
                for arg_17 in arg_13['fields']:
                    arg_16.append(arg_15.get(arg_17['name'], None))
                yield tuple(arg_16)
        arg_3.append(arg_12)
        arg_4.append(arg_13)
        arg_5[arg_12] = values(arg_13, arg_14)
        if arg_11 is not None:
            arg_6[arg_11] = arg_12
    arg_4 = _convert_schemas(arg_6, arg_4)

    # Create tables
    for arg_12 in arg_3:
        if arg_12 in arg_9.buckets:
            arg_9.delete(arg_12)
    arg_9.create(arg_3, arg_4)

    # Write data to tables
    for arg_12 in arg_9.buckets:
        if arg_12 in arg_5:
            arg_9.write(arg_12, arg_5[arg_12])
    return arg_9


def Func ( arg_0 ) : arg_1 = posixpath . normpath ( arg_0 . strip ( '/' ) ) if arg_1 == '.' : arg_1 = '' elif arg_1 . startswith ( '..' ) : raise PathOutsideRoot ( arg_1 ) return arg_1

def Func(arg_0):
    """
    Resolve paths with '..' to normalized paths, raising an error if the final
    result is outside root.
    """
    arg_1 = posixpath.normpath(arg_0.strip('/'))
    if arg_1 == '.':
        arg_1 = ''
    elif arg_1.startswith('..'):
        raise PathOutsideRoot(arg_1)
    return arg_1

Resolve paths with .. to normalized paths raising an error if the final result is outside root .


def Func(arg_0, arg_1, arg_2):
    """
    Add noise to pattern.

    @param bits   (set)   Indices of on bits
    @param amount (float) Probability of switching an on bit with a random bit

    @return (set) Indices of on bits in noisy pattern
    """
    arg_3 = set()

    for arg_4 in arg_1:
      if arg_0._random.getReal64() < arg_2:
        arg_3.add(arg_0._random.getUInt32(arg_0._n))
      else:
        arg_3.add(arg_4)

    return arg_3


(params, w_name, scope_name, inputs, layers, weights, names)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert slice operation.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting slice ...')

    if len(arg_0['axes']) > 1:
        raise AssertionError('Cannot convert slice by multiple dimensions')

    if arg_0['axes'][0] not in [0, 1, 2, 3]:
        raise AssertionError('Slice by dimension more than 3 or less than 0 is not supported')

    def target_layer(arg_7, arg_8=arg_9(arg_0['axes'][0]), arg_10=arg_9(arg_0['starts'][0]), arg_11=arg_9(arg_0['ends'][0])):
        if arg_8 == 0:
            return arg_7[arg_10:arg_11]
        elif arg_8 == 1:
            return arg_7[:, arg_10:arg_11]
        elif arg_8 == 2:
            return arg_7[:, :, arg_10:arg_11]
        elif arg_8 == 3:
            return arg_7[:, :, :, arg_10:arg_11]

    arg_12 = keras.layers.Lambda(target_layer)
    arg_4[arg_2] = arg_12(arg_4[arg_3[0]])


def Func ( arg_0 , arg_1 ) : arg_2 = urllib . request . urlopen ( arg_0 ) arg_3 = open ( arg_1 , 'w' ) arg_3 . write ( arg_2 . read ( ) ) arg_3 . close ( )

def Func(arg_0, arg_1):
    """Copies a file from its location on the web to a designated
    place on the local machine.

    Args:
        file_path: Complete url of the file to copy, string (e.g. http://fool.com/input.css).

        target_path: Path and name of file on the local machine, string. (e.g. /directory/output.css)

    Returns:
        None.

    """
    arg_2 = urllib.request.urlopen(arg_0)
    arg_3 = open(arg_1, 'w')
    arg_3.write(arg_2.read())
    arg_3.close()

Copies a file from its location on the web to a designated place on the local machine .


return self.accuracy() / random_accuracy

def Func ( arg_0 ) : if arg_0 . population ( ) == 0 : return float ( 'NaN' ) arg_1 = ( arg_0 . cond_pos_pop ( ) / arg_0 . population ( ) ) ** 2 + ( arg_0 . cond_neg_pop ( ) / arg_0 . population ( ) ) ** 2 return arg_0 . accuracy ( ) / arg_1

def Func(arg_0):
        r"""Return gain in accuracy.

        The gain in accuracy is defined as:
        :math:`G(accuracy) = \frac{accuracy}{random~ accuracy}`

        Cf. https://en.wikipedia.org/wiki/Gain_(information_retrieval)

        Returns
        -------
        float
            The gain in accuracy of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        1.4325259515570934

        """
        if arg_0.population() == 0:
            return float('NaN')
        arg_1 = (arg_0.cond_pos_pop() / arg_0.population()) ** 2 + (
            arg_0.cond_neg_pop() / arg_0.population()
        ) ** 2
        return arg_0.accuracy() / arg_1

r"""Return gain in accuracy.

        The gain in accuracy is defined as:
        :math:`G(accuracy) = \frac{accuracy}{random~ accuracy}`

        Cf. https://en.wikipedia.org/wiki/Gain_(information_retrieval)

        Returns
        -------
        float
            The gain in accuracy of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.accuracy_gain()
        1.4325259515570934


def Func(arg_0, arg_1):
        '''
        Handles CONNACK packet from the server
        '''
        arg_2 = arg_0.__class__.__name__
        log.error("Unexpected {packet:7} packet received in {log_source}", packet="CONNACK")


(group,
                   login_url=None,
                   redirect_field_name=REDIRECT_FIELD_NAME,
                   skip_superuser=True)

def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 , arg_4 = True ) : def decorator ( arg_5 ) : @ login_required ( arg_2 = arg_2 , arg_1 = arg_1 ) def _wrapped_view ( arg_6 , * arg_7 , ** arg_8 ) : if not ( arg_6 . user . is_superuser and arg_4 ) : if arg_6 . user . groups . filter ( name = arg_0 ) . count ( ) == 0 : raise PermissionDenied return arg_5 ( arg_6 , * arg_7 , ** arg_8 ) return _wrapped_view return decorator

def Func(arg_0,
                   arg_1=None,
                   arg_2=arg_3,
                   arg_4=True):
    """
    View decorator for requiring a user group.
    """
    def decorator(arg_5):
        @login_required(arg_2=arg_2,
                        arg_1=arg_1)
        def _wrapped_view(arg_6, *arg_7, **arg_8):

            if not (arg_6.user.is_superuser and arg_4):
                if arg_6.user.groups.filter(name=arg_0).count() == 0:
                    raise PermissionDenied

            return arg_5(arg_6, *arg_7, **arg_8)
        return _wrapped_view

    return decorator

View decorator for requiring a user group .


def Func ( arg_0 , arg_1 ) : if not arg_0 . options . include_labels : return copy . deepcopy ( arg_1 ) arg_2 = [ ] arg_3 = set ( arg_0 . options . include_labels ) for arg_4 in arg_1 : arg_5 = [ label [ "name" ] for label in arg_4 [ "labels" ] ] if arg_3 . intersection ( arg_5 ) : arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
        """
        Filter issues to include only issues with labels
        specified in include_labels.

        :param list(dict) issues: Pre-filtered issues.
        :rtype: list(dict)
        :return: Filtered issues.
        """

        if not arg_0.options.include_labels:
            return copy.deepcopy(arg_1)
        arg_2 = []
        arg_3 = set(arg_0.options.include_labels)
        for arg_4 in arg_1:
            arg_5 = [label["name"] for label in arg_4["labels"]]
            if arg_3.intersection(arg_5):
                arg_2.append(arg_4)
        return arg_2

Filter issues to include only issues with labels specified in include_labels .


def Func ( arg_0 , arg_1 = None ) : super ( BaseParallelApplication , arg_0 ) . Func ( arg_1 ) arg_0 . to_work_dir ( ) arg_0 . reinit_logging ( )

def Func(arg_0, arg_1=None):
        """Func the app"""
        super(BaseParallelApplication, arg_0).Func(arg_1)
        arg_0.to_work_dir()
        arg_0.reinit_logging()


return _convert(self._ip, notation=NM_BITS,
                        inotation=IP_DOT, _check=False, _isnm=self._isnm)

def Func ( arg_0 ) : return _convert ( arg_0 . _ip , notation = NM_BITS , inotation = IP_DOT , _check = False , _isnm = arg_0 . _isnm )

def Func(arg_0):
        """Return the bits notation of the netmask."""
        return _convert(arg_0._ip, notation=NM_BITS,
                        inotation=IP_DOT, _check=False, _isnm=arg_0._isnm)

Return the bits notation of the netmask .


(self, txt, x, y, width=None, height=1000000, enableRendering=False, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=1000000, arg_6=False, **arg_7):
        '''
        Draws an outlined path of the input text
        '''
        arg_1 = arg_0.Text(arg_1, arg_2, arg_3, arg_4, arg_5, **arg_7)
        arg_8 = arg_1.path
        if draw:
            arg_8.draw()
        return arg_8


def Func ( arg_0 , arg_1 ) : if arg_0 . parent is None : return arg_0 if arg_0 . parent . task_spec == arg_1 : return arg_0 . parent return arg_0 . parent . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        Returns the ancestor that has the given task spec assigned.
        If no such ancestor was found, the root task is returned.

        :type  task_spec: TaskSpec
        :param task_spec: The wanted task spec.
        :rtype:  Task
        :returns: The ancestor.
        """
        if arg_0.parent is None:
            return arg_0
        if arg_0.parent.task_spec == arg_1:
            return arg_0.parent
        return arg_0.parent.Func(arg_1)

Returns the ancestor that has the given task spec assigned . If no such ancestor was found the root task is returned .


def Func ( arg_0 ) : arg_1 = teff ( arg_0 ) arg_2 = luminosity ( arg_0 ) arg_3 = arg_0 . to_array ( ) arg_4 = 0 for arg_5 in arg_3 : arg_5 [ 'lum' ] [ 0 ] = np . array ( [ arg_2 [ arg_4 ] ] , dtype = 'f' ) arg_5 [ 'temp' ] [ 0 ] = np . array ( [ arg_1 [ arg_4 ] ] , dtype = 'f' ) arg_4 += 1 arg_3 = round_arr_teff_luminosity ( arg_3 ) return arg_3

def Func(arg_0):
    """
    Create a numpy.ndarray with all observed fields and
    computed teff and luminosity values.
    """
    arg_1 = teff(arg_0)
    arg_2 = luminosity(arg_0)
    arg_3 = arg_0.to_array()
    arg_4 = 0
    for arg_5 in arg_3:
        arg_5['lum'][0] = np.array([arg_2[arg_4]], dtype='f')
        arg_5['temp'][0] = np.array([arg_1[arg_4]], dtype='f')
        arg_4 += 1
    arg_3 = round_arr_teff_luminosity(arg_3)
    return arg_3

Create a numpy . ndarray with all observed fields and computed teff and luminosity values .


Outputs the error msg to the file if specified, or to the
        io_manager's stderr if available, or to sys.stderr.

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . Func_encountered = True arg_2 . write ( arg_0 . Func_prefix ) arg_2 . write ( arg_1 ) arg_2 . write ( '\n' ) arg_2 . flush ( )

def Func(arg_0, arg_1, arg_2=None):
        """
        Outputs the Func msg to the file if specified, or to the
        io_manager's stderr if available, or to sys.stderr.
        """
        arg_0.Func_encountered = True
        arg_2.write(arg_0.Func_prefix)
        arg_2.write(arg_1)
        arg_2.write('\n')
        arg_2.flush()

Outputs the error msg to the file if specified or to the io_manager s stderr if available or to sys . stderr .


def Func(arg_0):
        """
        List of Func of this slack team
        """
        if not arg_0._Func:
            arg_0._Func = arg_0._call_api('Func.list')['Func']
        return arg_0._Func


def Func ( arg_0 ) : arg_0 = internal . OrganizationCourse . objects . get ( id = arg_0 . id , active = True ) _inactivate_record ( arg_0 )

def Func(arg_0):  # pylint: disable=invalid-name
    """
    Inactivates an active organization-course relationship
    """
    arg_0 = internal.OrganizationCourse.objects.get(
        id=arg_0.id,
        active=True
    )
    _inactivate_record(arg_0)

Inactivates an active organization - course relationship


(self, joint, other_body, offset=(0, 0, 0), other_offset=(0, 0, 0),
                   **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=(0, 0, 0), arg_4=(0, 0, 0),
                   **arg_5):
        '''Move another body next to this one and join them together.

        This method will move the ``other_body`` so that the anchor points for
        the joint coincide. It then creates a joint to fasten the two bodies
        together. See :func:`World.move_next_to` and :func:`World.join`.

        Parameters
        ----------
        joint : str
            The type of joint to use when connecting these bodies.
        other_body : :class:`Body` or str
            The other body to join with this one.
        offset : 3-tuple of float, optional
            The body-relative offset where the anchor for the joint should be
            placed. Defaults to (0, 0, 0). See :func:`World.move_next_to` for a
            description of how offsets are specified.
        other_offset : 3-tuple of float, optional
            The offset on the second body where the joint anchor should be
            placed. Defaults to (0, 0, 0). Like ``offset``, this is given as an
            offset relative to the size and shape of ``other_body``.
        '''
        arg_6 = arg_0.world.move_next_to(arg_0, arg_2, arg_3, arg_4)
        arg_0.world.join(arg_1, arg_0, arg_2, arg_6=arg_6, **arg_5)

Move another body next to this one and join them together .


return RestaurantDataSet([gen() for i in range(n)])

def Func ( arg_0 = 20 ) : def gen ( ) : arg_1 = map ( random . choice , arg_2 . values ) arg_1 [ arg_2 . target ] = Fig [ 18 , 2 ] ( arg_1 ) return arg_1 return RestaurantDataSet ( [ gen ( ) for arg_4 in range ( arg_0 ) ] )

def Func(arg_0=20):
    "Generate a DataSet with n examples."
    def gen():
        arg_1 = map(random.choice, arg_2.values)
        arg_1[arg_2.target] = Fig[18,2](arg_1)
        return arg_1
    return RestaurantDataSet([gen() for arg_4 in range(arg_0)])


def Func(arg_0):
        """check packers for binary data and datetime support."""
        arg_1 = arg_0.pack
        arg_2 = arg_0.unpack

        # check simple serialization
        arg_3 = dict(a=[1,'hi'])
        try:
            arg_4 = arg_1(arg_3)
        except Exception:
            raise ValueError("packer could not serialize a simple message")

        # ensure packed message is bytes
        if not isinstance(arg_4, bytes):
            raise ValueError("message packed to %r, but bytes are required"%type(arg_4))

        # check that unpack is pack's inverse
        try:
            arg_5 = arg_2(arg_4)
        except Exception:
            raise ValueError("unpacker could not handle the packer's output")

        # check datetime support
        arg_3 = dict(t=datetime.now())
        try:
            arg_5 = arg_2(arg_1(arg_3))
        except Exception:
            arg_0.pack = lambda o: arg_1(squash_dates(o))
            arg_0.unpack = lambda s: extract_dates(arg_2(s))

check packers for binary data and datetime support .


(self, target_address, source_address=None,
                        event_handler=None, name=None, properties=None)

def Func(arg_0, arg_1, arg_2=None,
                        arg_3=None, arg_4=None, arg_5=None):
        """Factory method for creating Receive links."""
        arg_6 = arg_4 or str(arg_1)
        if arg_6 in arg_0._receiver_links:
            raise KeyError("Receiver %s already exists!" % arg_6)

        arg_7 = _SessionProxy("session-%s" % arg_6, arg_0)
        arg_7.open()
        arg_8 = arg_7.new_receiver(arg_6)
        arg_8.configure(arg_1, arg_2, arg_3, arg_5)
        arg_0._receiver_links[arg_6] = arg_8
        return arg_8

Factory method for creating Receive links .


return Message(
            id=data['message']['mid'],
            platform=self.platform,
            text=data['message']['text'],
            user=data['sender']['id'],
            timestamp=data['timestamp'],
            raw=data,
            chat=None,  # TODO: Refactor build_messages and Message class
        )

def Func ( arg_0 , arg_1 ) : if not arg_1 : return None return Message ( id = arg_1 [ 'message' ] [ 'mid' ] , platform = arg_0 . platform , text = arg_1 [ 'message' ] [ 'text' ] , user = arg_1 [ 'sender' ] [ 'id' ] , timestamp = arg_1 [ 'timestamp' ] , raw = arg_1 , chat = None , )

def Func(arg_0, arg_1):
        '''
        Return a Message instance according to the data received from
        Facebook Messenger API.
        '''
        if not arg_1:
            return None

        return Message(
            id=arg_1['message']['mid'],
            platform=arg_0.platform,
            text=arg_1['message']['text'],
            user=arg_1['sender']['id'],
            timestamp=arg_1['timestamp'],
            raw=arg_1,
            chat=None,  # TODO: Refactor Funcs and Message class
        )

Return a Message instance according to the data received from Facebook Messenger API .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 arg_3 = _read_checkplot_picklefile ( arg_1 ) arg_4 = [ ] for arg_5 in arg_2 : try : arg_4 . append ( _dict_get ( arg_3 , arg_5 ) ) except Exception as e : arg_4 . append ( np . nan ) return arg_4

def Func(arg_0):
    '''This gets the required keys from the requested file.

    Parameters
    ----------

    task : tuple
        Task is a two element tuple::

        - task[0] is the dict to work on

        - task[1] is a list of lists of str indicating all the key address to
          extract items from the dict for

    Returns
    -------

    list
        This is a list of all of the items at the requested key addresses.

    '''
    arg_1, arg_2 = arg_0

    arg_3 = _read_checkplot_picklefile(arg_1)

    arg_4 = []

    for arg_5 in arg_2:

        try:
            arg_4.append(_dict_get(arg_3, arg_5))
        except Exception as e:
            arg_4.append(np.nan)

    return arg_4

This gets the required keys from the requested file .


def Func ( ** arg_0 ) -> str : arg_1 = arg_0 . pop ( 'func' , 'unknown' ) if 'ticker' in arg_0 : arg_0 [ 'ticker' ] = arg_0 [ 'ticker' ] . replace ( '/' , '_' ) arg_2 = utils . to_str ( arg_0 , fmt = '{value}' , sep = '/' ) [ 1 : - 1 ] return f'{func}/{info}'

def Func(**arg_0) -> str:
    """
    Full infomation for missing query
    """
    arg_1 = arg_0.pop('func', 'unknown')
    if 'ticker' in arg_0: arg_0['ticker'] = arg_0['ticker'].replace('/', '_')
    arg_2 = utils.to_str(arg_0, fmt='{value}', sep='/')[1:-1]
    return f'{func}/{info}'


def Func(arg_0):
        """Asserts that val is a unicode string."""
        if type(arg_0.val) is not unicode:
            arg_0._err('Expected <%s> to be unicode, but was <%s>.' % (arg_0.val, type(arg_0.val).__name__))
        return arg_0


(model, path="", get_jar=True, jar_name="")

def
Func
(
arg_0
,
arg_1
=
""
,
arg_2
=
True
,
arg_3
=
""
)
:
assert_is_type
(
arg_0
,
ModelBase
)
assert_is_type
(
arg_1
,
str
)
assert_is_type
(
arg_2
,
bool
)
if
not
arg_0
.
have_pojo
:
raise
H2OValueError
(
"Export to POJO not supported"
)
if
arg_1
==
""
:
arg_4
=
api
(
"GET /3/Models.java/%s"
%
arg_0
.
model_id
)
print
(
arg_4
)
return
else
:
arg_5
=
api
(
"GET /3/Models.java/%s"
%
arg_0
.
model_id
,
save_to
=
arg_1
)
if
arg_2
:
if
arg_3
==
""
:
api
(
"GET /3/h2o-genmodel.jar"
,
save_to
=
os
.
path
.
join
(
arg_1
,
"h2o-genmodel.jar"
)
)
else
:
api
(
"GET /3/h2o-genmodel.jar"
,
save_to
=
os
.
path
.
join
(
arg_1
,
arg_3
)
)
return
arg_5

def Func(arg_0, arg_1="", arg_2=True, arg_3=""):
    """
    Download the POJO for this model to the directory specified by path; if path is "", then dump to screen.

    :param model: the model whose scoring POJO should be retrieved.
    :param path: an absolute path to the directory where POJO should be saved.
    :param get_jar: retrieve the h2o-genmodel.jar also (will be saved to the same folder ``path``).
    :param jar_name: Custom name of genmodel jar.
    :returns: location of the downloaded POJO file.
    """
    assert_is_type(arg_0, ModelBase)
    assert_is_type(arg_1, str)
    assert_is_type(arg_2, bool)

    if not arg_0.have_pojo:
        raise H2OValueError("Export to POJO not supported")

    if arg_1 == "":
        arg_4 = api("GET /3/Models.java/%s" % arg_0.model_id)
        print(arg_4)
        return None
    else:
        arg_5 = api("GET /3/Models.java/%s" % arg_0.model_id, save_to=arg_1)
        if arg_2:
            if arg_3 == "":
                api("GET /3/h2o-genmodel.jar", save_to=os.path.join(arg_1, "h2o-genmodel.jar"))
            else:
                api("GET /3/h2o-genmodel.jar", save_to=os.path.join(arg_1, arg_3))
        return arg_5

Download the POJO for this model to the directory specified by path ; if path is then dump to screen .


def Func(arg_0):
        ''' Voids the invoice if it is valid to do so. '''
        if arg_0.invoice.total_payments() > 0:
            raise ValidationError("Invoices with payments must be refunded.")
        elif arg_0.invoice.is_refunded:
            raise ValidationError("Refunded invoices may not be Funced.")
        if arg_0.invoice.is_paid:
            arg_0._release_cart()

        arg_0._mark_Func()

Voids the invoice if it is valid to do so .


def Func ( ) : arg_0 = environ . get ( 'TERM' , None ) if arg_0 : if ( arg_0 . startswith ( 'xterm' , ) or arg_0 . startswith ( 'eterm' ) or arg_0 == 'dtterm' ) : return False return True

def Func():
    """Get bacground from
    default values based on the TERM environment variable
    """
    arg_0 = environ.get('TERM', None)
    if arg_0:
        if (arg_0.startswith('xterm',) or arg_0.startswith('eterm')
            or arg_0 == 'dtterm'):
            return False
    return True


def Func ( arg_0 = None , arg_1 = None ) : from imgaug . augmentables . kps import Keypoint , KeypointsOnImage arg_2 , arg_3 = 0 , 0 if arg_1 is not None : arg_4 = _quokka_normalize_extract ( arg_1 ) arg_2 = arg_4 . x1 arg_3 = arg_4 . y1 with open ( QUOKKA_ANNOTATIONS_FP , "r" ) as f : arg_5 = json . load ( f ) arg_6 = [ ] for arg_7 in arg_5 [ "keypoints" ] : arg_6 . append ( Keypoint ( x = arg_7 [ "x" ] - arg_2 , y = arg_7 [ "y" ] - arg_3 ) ) if arg_1 is not None : arg_8 = ( arg_4 . height , arg_4 . width , 3 ) else : arg_8 = ( 643 , 960 , 3 ) arg_9 = KeypointsOnImage ( arg_6 , arg_8 = arg_8 ) if arg_0 is not None : arg_10 = _compute_resized_shape ( arg_8 , arg_0 ) arg_9 = arg_9 . on ( arg_10 ) return arg_9

def Func(arg_0=None, arg_1=None):
    """
    Returns example keypoints on the standard example quokke image.

    The keypoints cover the eyes, ears, nose and paws.

    Parameters
    ----------
    size : None or float or tuple of int or tuple of float, optional
        Size of the output image on which the keypoints are placed. If None, then the keypoints
        are not projected to any new size (positions on the original image are used).
        Floats lead to relative size changes, ints to absolute sizes in pixels.

    extract : None or 'square' or tuple of number or imgaug.BoundingBox or imgaug.BoundingBoxesOnImage
        Subarea to extract from the image. See :func:`imgaug.quokka`.

    Returns
    -------
    kpsoi : imgaug.KeypointsOnImage
        Example keypoints on the quokka image.

    """
    # TODO get rid of this deferred import
    from imgaug.augmentables.kps import Keypoint, KeypointsOnImage

    arg_2, arg_3 = 0, 0
    if arg_1 is not None:
        arg_4 = _quokka_normalize_extract(arg_1)
        arg_2 = arg_4.x1
        arg_3 = arg_4.y1
    with open(QUOKKA_ANNOTATIONS_FP, "r") as f:
        arg_5 = json.load(f)
    arg_6 = []
    for arg_7 in arg_5["keypoints"]:
        arg_6.append(Keypoint(x=arg_7["x"] - arg_2, y=arg_7["y"] - arg_3))
    if arg_1 is not None:
        arg_8 = (arg_4.height, arg_4.width, 3)
    else:
        arg_8 = (643, 960, 3)
    arg_9 = KeypointsOnImage(arg_6, arg_8=arg_8)
    if arg_0 is not None:
        arg_10 = _compute_resized_shape(arg_8, arg_0)
        arg_9 = arg_9.on(arg_10)
    return arg_9

Returns example keypoints on the standard example quokke image .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/BulkCall/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST BulkCalls Helper
        """
        arg_2 = '/' + arg_0.api_version + '/BulkCall/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . validated_user ( arg_1 , purpose = HashPurpose . PASSWORD_RESET , minutes_valid = HASH_MINUTES_VALID [ HashPurpose . PASSWORD_RESET ] , ) arg_3 . set_password ( arg_2 ) arg_3 . save ( ) arg_0 . do_login ( arg_3 ) return { "userId" : this . user_ddp_id }

def Func(arg_0, arg_1, arg_2):
        """Reset password using a token received in email then logs user in."""
        arg_3 = arg_0.validated_user(
            arg_1, purpose=HashPurpose.PASSWORD_RESET,
            minutes_valid=HASH_MINUTES_VALID[HashPurpose.PASSWORD_RESET],
        )
        arg_3.set_password(arg_2)
        arg_3.save()
        arg_0.do_login(arg_3)
        return {"userId": this.user_ddp_id}

Reset password using a token received in email then logs user in .


def Func(arg_0):
  """Converts a datestamp from RFC3339 UTC to a datetime.

  Args:
    rfc3339_utc_string: a datetime string in RFC3339 UTC "Zulu" format

  Returns:
    A datetime.
  """

  # The timestamp from the Google Operations are all in RFC3339 format, but
  # they are sometimes formatted to millisconds, microseconds, sometimes
  # nanoseconds, and sometimes only seconds:
  # * 2016-11-14T23:05:56Z
  # * 2016-11-14T23:05:56.010Z
  # * 2016-11-14T23:05:56.010429Z
  # * 2016-11-14T23:05:56.010429380Z
  arg_1 = re.match(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).?(\d*)Z',
               arg_0)

  # It would be unexpected to get a different date format back from Google.
  # If we raise an exception here, we can break people completely.
  # Instead, let's just return None and people can report that some dates
  # are not showing up.
  # We might reconsider this approach in the future; it was originally
  # established when dates were only used for display.
  if not arg_1:
    return None

  arg_2 = arg_1.groups()
  if len(arg_2[6]) not in (0, 3, 6, 9):
    return None

  # Create a UTC datestamp from parsed components
  # 1- Turn components 0-5 from strings to integers
  # 2- If the last component does not exist, set it to 0.
  #    If it does exist, make sure to interpret it as milliseconds.
  arg_3 = [int(val) for val in arg_2[:6]]

  arg_4 = arg_2[6]
  if not arg_4:
    arg_5 = 0
  elif len(arg_4) == 3:
    arg_5 = int(arg_4) * 1000
  elif len(arg_4) == 6:
    arg_5 = int(arg_4)
  elif len(arg_4) == 9:
    # When nanoseconds are provided, we round
    arg_5 = int(round(int(arg_4) / 1000))
  else:
    assert False, 'Fraction length not 0, 6, or 9: {}'.len(arg_4)

  try:
    return datetime(arg_3[0], arg_3[1], arg_3[2], arg_3[3], arg_3[4], arg_3[5], arg_5, tzinfo=pytz.utc)
  except ValueError as e:
    assert False, 'Could not parse RFC3339 datestring: {} exception: {}'.format(
        arg_0, e)

Converts a datestamp from RFC3339 UTC to a datetime .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . __cut_to_size ( ) : arg_1 . post ( 'tasks_admin' , arg_2 . as_payload ( ) , replacements = { 'slug' : arg_2 . challenge . slug } )

def Func(arg_0, arg_1):
        """Create the tasks on the server"""
        for arg_2 in arg_0.__cut_to_size():
            arg_1.post(
                'tasks_admin',
                arg_2.as_payload(),
                replacements={
                    'slug': arg_2.challenge.slug})


def Func(arg_0, arg_1, arg_2, arg_3):
    """Add the same edge, but in the opposite direction if not already present.

    :type graph: pybel.BELGraph
    :type u: tuple
    :type v: tuple
    :type k: int
    """
    if arg_1 in arg_0[arg_2]:
        for arg_4 in arg_0[arg_2][arg_1].values():
            if arg_4 == arg_0[arg_1][arg_2][arg_3]:
                return

    arg_0.add_edge(arg_2, arg_1, key=arg_3, **arg_0[arg_1][arg_2][arg_3])

Add the same edge but in the opposite direction if not already present .


(self, address, size, prot, flags, fd, offset)

return self.sys_mmap2(address, size, prot, flags, fd, offset)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """Wrapper for mmap2"""
        return arg_0.sys_mmap2(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6)


Return a list of templates as template objects.

return [
            Template(_lststr, _type_to_spans, span, 'Template')
            for span in self._subspans('Template')]

def Func ( arg_0 ) -> List [ 'Template' ] : arg_1 = arg_0 . _lststr arg_2 = arg_0 . _type_to_spans return [ Template ( arg_1 , arg_2 , arg_3 , 'Template' ) for arg_3 in arg_0 . _subspans ( 'Template' ) ]

def Func(arg_0) -> List['Template']:
        """Return a list of Func as template objects."""
        arg_1 = arg_0._lststr
        arg_2 = arg_0._type_to_spans
        return [
            Template(arg_1, arg_2, arg_3, 'Template')
            for arg_3 in arg_0._subspans('Template')]

Return a list of templates as template objects .


def Func(arg_0, **arg_1):
        """Promote engine to listening kernel, accessible to frontends."""
        if arg_0.kernel_app is not None:
            return

        arg_0.log.info("Opening ports for direct connections as an IPython kernel")

        arg_2 = arg_0.kernel

        arg_1.setdefault('config', arg_0.config)
        arg_1.setdefault('log', arg_0.log)
        arg_1.setdefault('profile_dir', arg_0.profile_dir)
        arg_1.setdefault('session', arg_0.engine.session)

        arg_3 = arg_0.kernel_app = arg_4(**arg_1)

        # allow IPKernelApp.instance():
        arg_4._instance = arg_3

        arg_3.init_connection_file()
        # relevant contents of init_sockets:

        arg_3.shell_port = arg_3._bind_socket(arg_2.shell_streams[0], arg_3.shell_port)
        arg_3.log.debug("shell ROUTER Channel on port: %i", arg_3.shell_port)

        arg_3.iopub_port = arg_3._bind_socket(arg_2.iopub_socket, arg_3.iopub_port)
        arg_3.log.debug("iopub PUB Channel on port: %i", arg_3.iopub_port)

        arg_2.stdin_socket = arg_0.engine.context.socket(zmq.ROUTER)
        arg_3.stdin_port = arg_3._bind_socket(arg_2.stdin_socket, arg_3.stdin_port)
        arg_3.log.debug("stdin ROUTER Channel on port: %i", arg_3.stdin_port)

        # start the heartbeat, and log connection info:

        arg_3.init_heartbeat()

        arg_3.log_connection_info()
        arg_3.write_connection_file()

Promote engine to listening kernel accessible to frontends .


return self.fetch_json(
            uri_path=self.base_uri,
            query_params=query_params or {}
        )

def Func ( arg_0 , arg_1 = None ) : return arg_0 . fetch_json ( uri_path = arg_0 . base_uri , arg_1 = arg_1 or { } )

def Func(arg_0, arg_1=None):
        '''
        Get all information for this Checklist. Returns a dictionary of values.
        '''
        # We don't use trelloobject.TrelloObject.get_checklist_json, because
        # that is meant to return lists of checklists.
        return arg_0.fetch_json(
            uri_path=arg_0.base_uri,
            arg_1=arg_1 or {}
        )

Get all information for this Checklist . Returns a dictionary of values .


(self, form, template_pack=TEMPLATE_PACK, **kwargs)

return render_to_string(link_template,
                                {
                                    'link': self,
                                    'item_has_errors': self.has_errors(form)
                                })

def Func(arg_0, arg_1, arg_2=arg_3, **arg_4):
        """
        Render the link for the tab-pane. It must be called after render so
        ``css_class`` is updated with ``active`` class name if needed.
        """
        arg_5 = arg_0.link_template % arg_2
        return render_to_string(arg_5,
                                {
                                    'link': arg_0,
                                    'item_has_errors': arg_0.has_errors(arg_1)
                                })

Render the link for the tab - pane . It must be called after render so css_class is updated with active class name if needed .


def Func(arg_0):
    """
    json.loads wants an unistr in Python3. Convert it.
    """
    if not hasattr(arg_0, 'encode'):
        try:
            arg_0 = arg_0.decode('utf-8')
        except UnicodeDecodeError:
            raise ValueError(
                'Expected valid UTF8 for JSON data, got %r' % (arg_0,))
    return arg_0

json . loads wants an unistr in Python3 . Convert it .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . material . get_compound_index ( arg_1 ) return stoich . amount ( arg_1 , arg_0 . _compound_masses [ arg_2 ] )

def Func(arg_0, arg_1):
        """
        Determine the mole amount of the specified compound.

        :returns: Amount. [kmol]
        """

        arg_2 = arg_0.material.get_compound_index(arg_1)
        return stoich.amount(arg_1, arg_0._compound_masses[arg_2])

Determine the mole amount of the specified compound .


def Func ( arg_0 ) : if arg_0 . _is_ndb ( ) : _NDB_KEY ( arg_0 . _model , arg_0 . _key_name ) . delete ( ) else : arg_1 = db . Key . from_path ( arg_0 . _model . kind ( ) , arg_0 . _key_name ) db . delete ( arg_1 )

def Func(arg_0):
        """Delete entity from datastore.

        Attempts to delete using the key_name stored on the object, whether or
        not the given key is in the datastore.
        """
        if arg_0._is_ndb():
            _NDB_KEY(arg_0._model, arg_0._key_name).delete()
        else:
            arg_1 = db.Key.from_path(arg_0._model.kind(), arg_0._key_name)
            db.delete(arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
memoize
or
not
arg_2
[
'memoize'
]
:
arg_2
[
'hashsum'
]
=
return
,
arg_3
=
arg_0
.
make_hash
(
arg_2
)
arg_4
=
False
arg_5
=
if
arg_3
in
arg_0
.
memo_lookup_table
:
arg_4
=
True
arg_5
=
arg_0
.
memo_lookup_table
[
arg_3
]
logger
.
info
(
"Task %s using result from cache"
,
arg_1
)
arg_2
[
'hashsum'
]
=
arg_3
return
arg_4
,
arg_5

def Func(arg_0, arg_1, arg_2):
        """Create a hash of the task and its inputs and check the lookup table for this hash.

        If present, the results are returned. The result is a tuple indicating whether a memo
        exists and the result, since a Null result is possible and could be confusing.
        This seems like a reasonable option without relying on an cache_miss exception.

        Args:
            - task(task) : task from the dfk.tasks table

        Returns:
            Tuple of the following:
            - present (Bool): Is this present in the memo_lookup_table
            - Result (Py Obj): Result of the function if present in table

        This call will also set task['hashsum'] to the unique hashsum for the func+inputs.
        """
        if not arg_0.memoize or not arg_2['memoize']:
            arg_2['hashsum'] = None
            return None, None

        arg_3 = arg_0.make_hash(arg_2)
        arg_4 = False
        arg_5 = None
        if arg_3 in arg_0.memo_lookup_table:
            arg_4 = True
            arg_5 = arg_0.memo_lookup_table[arg_3]
            logger.info("Task %s using result from cache", arg_1)

        arg_2['hashsum'] = arg_3
        return arg_4, arg_5

Create a hash of the task and its inputs and check the lookup table for this hash .


(self, *, limit: Optional[int] = 20, offset: Optional[int] = 0, include_groups=None, market: Optional[str] = None)

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

async def Func ( arg_0 , * , arg_1 : arg_2 [ arg_3 ] = 20 , arg_4 : arg_2 [ arg_3 ] = 0 , arg_5 = None , arg_6 : arg_2 [ arg_7 ] = None ) -> List [ Album ] : from . album import Album arg_8 = await arg_0 . __client . http . artist_albums ( arg_0 . id , arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) return list ( Album ( arg_0 . __client , arg_9 ) for arg_9 in arg_8 [ 'items' ] )

async def Func(arg_0, *, arg_1: arg_2[arg_3] = 20, arg_4: arg_2[arg_3] = 0, arg_5=None, arg_6: arg_2[arg_7] = None) -> List[Album]:
        """Get the albums of a Spotify artist.

        Parameters
        ----------
        limit : Optional[int]
            The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
        offset : Optiona[int]
            The offset of which Spotify should start yielding from.
        include_groups : INCLUDE_GROUPS_TP
            INCLUDE_GROUPS
        market : Optional[str]
            An ISO 3166-1 alpha-2 country code.

        Returns
        -------
        albums : List[Album]
            The albums of the artist.
        """
        from .album import Album

        arg_8 = await arg_0.__client.http.artist_albums(arg_0.id, arg_1=arg_1, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6)
        return list(Album(arg_0.__client, arg_9) for arg_9 in arg_8['items'])


return H2OFrame._expr(ExprNode("mojo.pipeline.transform", self.pipeline_id[0], data, allow_timestamps))

def Func(arg_0, arg_1, arg_2=False):
        """
        Transform H2OFrame using a MOJO Pipeline.

        :param data: Frame to be Funced.
        :param allow_timestamps: Allows datetime columns to be used directly with MOJO pipelines. It is recommended
        to parse your datetime columns as Strings when using pipelines because pipelines can interpret certain datetime
        formats in a different way. If your H2OFrame is parsed from a binary file format (eg. Parquet) instead of CSV
        it is safe to turn this option on and use datetime columns directly.

        :returns: A new H2OFrame.
        """
        assert_is_type(arg_1, H2OFrame)
        assert_is_type(arg_2, bool)
        return H2OFrame._expr(ExprNode("mojo.pipeline.Func", arg_0.pipeline_id[0], arg_1, arg_2))

Transform H2OFrame using a MOJO Pipeline.

        :param data: Frame to be transformed.
        :param allow_timestamps: Allows datetime columns to be used directly with MOJO pipelines. It is recommended
        to parse your datetime columns as Strings when using pipelines because pipelines can interpret certain datetime
        formats in a different way. If your H2OFrame is parsed from a binary file format (eg. Parquet) instead of CSV
        it is safe to turn this option on and use datetime columns directly.

        :returns: A new H2OFrame.

Transform H2OFrame using a MOJO Pipeline .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = SecretLinkFactory . Func ( arg_1 , arg_2 = arg_2 ) if arg_3 : arg_4 = arg_0 . query . get ( arg_3 [ 'id' ] ) if arg_4 and arg_4 . is_valid ( ) : return True return False

def Func(arg_0, arg_1, arg_2):
        """Validate a secret link token.

        Only queries the database if token is valid to determine that the token
        has not been revoked.
        """
        arg_3 = SecretLinkFactory.Func(
            arg_1, arg_2=arg_2
        )

        if arg_3:
            arg_4 = arg_0.query.get(arg_3['id'])
            if arg_4 and arg_4.is_valid():
                return True
        return False


def Func(arg_0, arg_1):
        """Display an evaluation section as a text."""
        arg_0.section += 1
        arg_0.format_children(arg_1)
        arg_0.section -= 1
        arg_0.writeln()

Display an evaluation section as a text .


return BusinessDate.from_ymd(datetime_date.year, datetime_date.month, datetime_date.day)

def Func ( arg_0 ) : return BusinessDate . from_ymd ( arg_0 . year , arg_0 . month , arg_0 . day )

def Func(arg_0):
        """
        construct BusinessDate instance from datetime.date instance,
        raise ValueError exception if not possible

        :param datetime.date datetime_date: calendar day
        :return bool:
        """
        return BusinessDate.from_ymd(arg_0.year, arg_0.month, arg_0.day)

construct BusinessDate instance from datetime . date instance raise ValueError exception if not possible


Population fitness == average member fitness score

def Func ( arg_0 ) : if len ( arg_0 . __members ) != 0 : if arg_0 . __num_processes > 1 : arg_1 = [ arg_2 . get ( ) for arg_2 in arg_0 . __members ] else : arg_1 = arg_0 . __members return sum ( arg_2 . Func_score for arg_2 in arg_1 ) / len ( arg_1 ) else : return None

def Func(arg_0):
        '''Population Func == average member Func score'''

        if len(arg_0.__members) != 0:
            if arg_0.__num_processes > 1:
                arg_1 = [arg_2.get() for arg_2 in arg_0.__members]
            else:
                arg_1 = arg_0.__members
            return sum(arg_2.Func_score for arg_2 in arg_1) / len(arg_1)
        else:
            return None


def Func ( arg_0 , arg_1 = None ) : optparse . OptionParser . Func ( arg_0 , arg_1 ) arg_1 . flush ( )

def Func(arg_0, arg_1=None):
        """
        Outputs version information to the file if specified, or to
        the io_manager's stdout if available, or to sys.stdout.
        """
        optparse.OptionParser.Func(arg_0, arg_1)
        arg_1.flush()

Outputs version information to the file if specified or to the io_manager s stdout if available or to sys . stdout .


def Func(arg_0, arg_1, arg_2):
        """Resolve a request to a route handler.

        Arguments:
          method (str): HTTP method, e.g. GET, POST, etc. (type: str)
          path (str): Request path

        Returns:
          tuple or None: A tuple of three items:

            1. Route handler (callable)
            2. Positional arguments (list)
            3. Keyword arguments (dict)

          ``None`` if no route matches the request.
        """
        if arg_1 in arg_0._literal and arg_2 in arg_0._literal[arg_1]:
            return arg_0._literal[arg_1][arg_2], [], {}
        else:
            return arg_0._Func_non_literal_route(arg_1, arg_2)


def Func(arg_0, **arg_1):
        '''
        Get all the boards for this organisation. Returns a list of Board s.

        Returns:
            list(Board): The boards attached to this organisation
        '''
        arg_2 = arg_0.Func_json(arg_0.base_uri, arg_1=arg_1)

        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(arg_0.create_board(arg_4))

        return arg_3

Get all the boards for this organisation . Returns a list of Board s .


def
Func
(
arg_0
=
True
)
:
def
deprecate_decorator
(
arg_1
)
:
import
nose
def
_Func_imp
(
*
arg_2
,
**
arg_3
)
:
arg_4
=
WarningManager
(
record
=
True
)
arg_5
=
arg_4
.
__enter__
(
)
warnings
.
simplefilter
(
'always'
)
try
:
arg_1
(
*
arg_2
,
**
arg_3
)
if
not
len
(
arg_5
)
>
0
:
raise
AssertionError
(
"No warning raised when calling %s"
%
arg_1
.
__name__
)
if
not
arg_5
[
0
]
.
category
is
DeprecationWarning
:
raise
AssertionError
(
"First warning for %s is not a "
"DeprecationWarning( is %s)"
%
(
arg_1
.
__name__
,
arg_5
[
0
]
)
)
finally
:
arg_4
.
__exit__
(
)
if
callable
(
arg_0
)
:
arg_6
=
arg_0
(
)
else
:
arg_6
=
arg_0
if
arg_6
:
return
nose
.
tools
.
make_decorator
(
arg_1
)
(
_Func_imp
)
else
:
return
arg_1
return
deprecate_decorator

def Func(arg_0=True):
    """
    Filter deprecation warnings while running the test suite.

    This decorator can be used to filter DeprecationWarning's, to avoid
    printing them during the test suite run, while checking that the test
    actually raises a DeprecationWarning.

    Parameters
    ----------
    conditional : bool or callable, optional
        Flag to determine whether to mark test as Func or not. If the
        condition is a callable, it is used at runtime to dynamically make the
        decision. Default is True.

    Returns
    -------
    decorator : function
        The `Func` decorator itself.

    Notes
    -----
    .. versionadded:: 1.4.0

    """
    def deprecate_decorator(arg_1):
        # Local import to avoid a hard nose dependency and only incur the
        # import time overhead at actual test-time.
        import nose

        def _Func_imp(*arg_2, **arg_3):
            # Poor man's replacement for the with statement
            arg_4 = WarningManager(record=True)
            arg_5 = arg_4.__enter__()
            warnings.simplefilter('always')
            try:
                arg_1(*arg_2, **arg_3)
                if not len(arg_5) > 0:
                    raise AssertionError("No warning raised when calling %s"
                            % arg_1.__name__)
                if not arg_5[0].category is DeprecationWarning:
                    raise AssertionError("First warning for %s is not a " \
                            "DeprecationWarning( is %s)" % (arg_1.__name__, arg_5[0]))
            finally:
                arg_4.__exit__()

        if callable(arg_0):
            arg_6 = arg_0()
        else:
            arg_6 = arg_0
        if arg_6:
            return nose.tools.make_decorator(arg_1)(_Func_imp)
        else:
            return arg_1
    return deprecate_decorator

Filter deprecation warnings while running the test suite.

    This decorator can be used to filter DeprecationWarning's, to avoid
    printing them during the test suite run, while checking that the test
    actually raises a DeprecationWarning.

    Parameters
    ----------
    conditional : bool or callable, optional
        Flag to determine whether to mark test as deprecated or not. If the
        condition is a callable, it is used at runtime to dynamically make the
        decision. Default is True.

    Returns
    -------
    decorator : function
        The `deprecated` decorator itself.

    Notes
    -----
    .. versionadded:: 1.4.0

Filter deprecation warnings while running the test suite .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
name
in
arg_0
.
_declarations
:
raise
ValueError
(
'Variable already declared'
)
arg_0
.
_declarations
[
arg_1
.
name
]
=
arg_1
return
arg_1

def Func(arg_0, arg_1):
        """ Declare the variable `var` """
        if arg_1.name in arg_0._declarations:
            raise ValueError('Variable already declared')
        arg_0._declarations[arg_1.name] = arg_1
        return arg_1


(self, bucket, key, extra_args=None, subscribers=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """Delete an S3 object.

        :type bucket: str
        :param bucket: The name of the bucket.

        :type key: str
        :param key: The name of the S3 object to Func.

        :type extra_args: dict
        :param extra_args: Extra arguments that may be passed to the
            DeleteObject call.

        :type subscribers: list
        :param subscribers: A list of subscribers to be invoked during the
            process of the transfer request.  Note that the ``on_progress``
            callback is not invoked during object deletion.

        :rtype: s3transfer.futures.TransferFuture
        :return: Transfer future representing the deletion.

        """
        if arg_3 is None:
            arg_3 = {}
        if arg_4 is None:
            arg_4 = []
        arg_0._validate_all_known_args(arg_3, arg_0.ALLOWED_DELETE_ARGS)
        arg_5 = CallArgs(
            arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
            arg_4=arg_4
        )
        return arg_0._submit_transfer(arg_5, DeleteSubmissionTask)

Delete an S3 object.

        :type bucket: str
        :param bucket: The name of the bucket.

        :type key: str
        :param key: The name of the S3 object to delete.

        :type extra_args: dict
        :param extra_args: Extra arguments that may be passed to the
            DeleteObject call.

        :type subscribers: list
        :param subscribers: A list of subscribers to be invoked during the
            process of the transfer request.  Note that the ``on_progress``
            callback is not invoked during object deletion.

        :rtype: s3transfer.futures.TransferFuture
        :return: Transfer future representing the deletion.


def Func ( arg_0 ) : if isinstance ( arg_0 , ( type ( object . __init__ ) , type ( object . __call__ ) ) ) : arg_1 = lambda * args , ** kwargs : arg_0 ( * args , ** kwargs ) arg_1 . __name__ = arg_0 . __name__ arg_1 . __doc__ = arg_0 . __doc__ arg_1 . __module__ = '' arg_1 . __wrapped__ = arg_0 return arg_1 return arg_0

def Func(arg_0):
  """Make sure `fn` can be wrapped cleanly by functools.wraps."""
  # Handle "wrapped_descriptor" and "method-wrapper" types.
  if isinstance(arg_0, (type(object.__init__), type(object.__call__))):
    # pylint: disable=unnecessary-lambda
    arg_1 = lambda *args, **kwargs: arg_0(*args, **kwargs)
    arg_1.__name__ = arg_0.__name__
    arg_1.__doc__ = arg_0.__doc__
    arg_1.__module__ = ''  # These types have no __module__, sigh.
    arg_1.__wrapped__ = arg_0
    return arg_1

  # Otherwise we're good to go...
  return arg_0

Make sure fn can be wrapped cleanly by functools . wraps .


return nx.lexicographical_topological_sort(self._multi_graph,
                                                   key=lambda x: str(x.qargs))

def Func ( arg_0 ) : return nx . lexicographical_topological_sort ( arg_0 . _multi_graph , key = lambda x : str ( x . qargs ) )

def Func(arg_0):
        """
        Yield nodes in topological order.

        Returns:
            generator(DAGNode): node in topological order
        """
        return nx.lexicographical_topological_sort(arg_0._multi_graph,
                                                   key=lambda x: str(x.qargs))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . path if arg_1 : arg_2 = os . path . relpath ( arg_0 . path , arg_1 ) arg_3 = arg_0 . name if arg_3 in set ( [ '__init__.py' , '__main__.py' ] ) : arg_2 = os . path . dirname ( arg_2 ) return arg_2

def Func(arg_0, arg_1):
        """return that path to be able to call this script from the passed in
        basename

        example --
            basepath = /foo/bar
            self.path = /foo/bar/che/baz.py
            self.Func(basepath) # che/baz.py

        basepath -- string -- the directory you would be calling this script in
        return -- string -- the minimum path that you could use to execute this script
            in basepath
        """
        arg_2 = arg_0.path
        if arg_1:
            arg_2 = os.path.relpath(arg_0.path, arg_1)

        arg_3 = arg_0.name
        if arg_3 in set(['__init__.py', '__main__.py']):
            arg_2 = os.path.dirname(arg_2)

        return arg_2

return that path to be able to call this script from the passed in
        basename

        example --
            basepath = /foo/bar
            self.path = /foo/bar/che/baz.py
            self.call_path(basepath) # che/baz.py

        basepath -- string -- the directory you would be calling this script in
        return -- string -- the minimum path that you could use to execute this script
            in basepath


def Func(arg_0, arg_1):
    """
    Use SAMtools to create reference index file

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str ref_id: FileStoreID for the reference genome
    :return: FileStoreID for reference index
    :rtype: str
    """
    arg_0.fileStore.logToMaster('Created reference index')
    arg_2 = arg_0.fileStore.getLocalTempDir()
    arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_2, 'ref.fasta'))
    arg_3 = ['faidx', 'ref.fasta']
    dockerCall(arg_0=arg_0, workDir=arg_2, parameters=arg_3,
               tool='quay.io/ucsc_cgl/samtools:0.1.19--dd5ac549b95eb3e5d166a5e310417ef13651994e')
    return arg_0.fileStore.writeGlobalFile(os.path.join(arg_2, 'ref.fasta.fai'))


def Func ( arg_0 ) : if arg_0 . nruns == 0 : return None arg_1 = arg_0 . communicationChannel . Func ( ) if arg_1 is not None : arg_0 . nruns -= 1 return arg_1

def Func(arg_0):
        """Return a pair of a run id and a result.

        This method waits until an event loop finishes.
        This method returns None if no loop is running.
        """
        if arg_0.nruns == 0:
            return None
        arg_1 = arg_0.communicationChannel.Func()
        if arg_1 is not None:
            arg_0.nruns -= 1
        return arg_1

Return a pair of a run id and a result .


def Func ( arg_0 , arg_1 ) : arg_1 = tf . keras . initializers . get ( arg_1 ) def masked_initializer ( arg_2 , arg_3 = None , arg_4 = None ) : if arg_4 is None : arg_5 = arg_1 ( arg_2 , arg_3 ) else : arg_5 = arg_1 ( arg_2 , arg_3 , arg_4 ) return tf . cast ( arg_0 , arg_5 . dtype ) * arg_5 return masked_initializer

def Func(arg_0, arg_1):
  """Returns a masked version of the given initializer."""
  arg_1 = tf.keras.initializers.get(arg_1)
  def masked_initializer(arg_2, arg_3=None, arg_4=None):
    # If no `partition_info` is given, then don't pass it to `initializer`, as
    # `initializer` may be a `tf.compat.v2.initializers.Initializer` (which
    # don't accept a `partition_info` argument).
    if arg_4 is None:
      arg_5 = arg_1(arg_2, arg_3)
    else:
      arg_5 = arg_1(arg_2, arg_3, arg_4)
    return tf.cast(arg_0, arg_5.dtype) * arg_5
  return masked_initializer

Returns a masked version of the given initializer .


def Func(arg_0):
        """
        Cancels the job set. The job set is immediately finished, and all
        queued jobs are discarded.
        """

        if arg_0._active_jobs == 0:
            return

        arg_0._jobs = iter(())
        arg_0._on_deck = None
        arg_0._return_queue.clear()
        arg_0._active_jobs = 0

        arg_0._done()

Cancels the job set . The job set is immediately finished and all queued jobs are discarded .


def Func(arg_0):
        """Validate IP allocation pools.

        Verify start and end address for each allocation pool are valid,
        ie: constituted by valid and appropriately ordered IP addresses.
        Also, verify pools do not overlap among themselves.
        Finally, verify that each range fall within the subnet's CIDR.
        """
        arg_1 = arg_0._alloc_pools
        arg_2 = arg_0._subnet_cidr

        LOG.debug(_("Performing IP validity checks on allocation pools"))
        arg_3 = []
        for arg_4 in arg_1:
            try:
                arg_5 = netaddr.IPAddress(arg_4['start'])
                arg_6 = netaddr.IPAddress(arg_4['end'])
            except netaddr.AddrFormatError:
                LOG.info(_("Found invalid IP address in pool: "
                           "%(start)s - %(end)s:"),
                         {'start': arg_4['start'],
                          'end': arg_4['end']})
                raise n_exc_ext.InvalidAllocationPool(pool=arg_4)
            if (arg_5.version != arg_0._subnet_cidr.version or
                    arg_6.version != arg_0._subnet_cidr.version):
                LOG.info(_("Specified IP addresses do not match "
                           "the subnet IP version"))
                raise n_exc_ext.InvalidAllocationPool(pool=arg_4)
            if arg_6 < arg_5:
                LOG.info(_("Start IP (%(start)s) is greater than end IP "
                           "(%(end)s)"),
                         {'start': arg_4['start'], 'end': arg_4['end']})
                raise n_exc_ext.InvalidAllocationPool(pool=arg_4)
            if (arg_5 < arg_0._subnet_first_ip or
                    arg_6 > arg_0._subnet_last_ip):
                LOG.info(_("Found pool larger than subnet "
                           "CIDR:%(start)s - %(end)s"),
                         {'start': arg_4['start'],
                          'end': arg_4['end']})
                raise n_exc_ext.OutOfBoundsAllocationPool(
                    pool=arg_4,
                    arg_2=arg_2)
            # Valid allocation pool
            # Create an IPSet for it for easily verifying overlaps
            arg_3.append(netaddr.IPSet(netaddr.IPRange(
                arg_4['start'],
                arg_4['end']).cidrs()))

        LOG.debug(_("Checking for overlaps among allocation pools "
                    "and gateway ip"))
        arg_7 = arg_1[:]

        # Use integer cursors as an efficient way for implementing
        # comparison and avoiding comparing the same pair twice
        for arg_8 in xrange(len(arg_3)):
            for arg_9 in xrange(arg_8 + 1, len(arg_3)):
                if arg_3[arg_8] & arg_3[arg_9]:
                    arg_10 = arg_7[arg_8]
                    arg_11 = arg_7[arg_9]
                    LOG.info(_("Found overlapping ranges: %(l_range)s and "
                               "%(r_range)s"),
                             {'l_range': arg_10, 'r_range': arg_11})
                    raise n_exc_ext.OverlappingAllocationPools(
                        pool_1=arg_10,
                        pool_2=arg_11,
                        arg_2=arg_2)


async def Func(arg_0, arg_1, **arg_2):
        """
        Rout the message down the correct stream.
        """
        # Check the frame looks good
        if isinstance(arg_1, dict) and "stream" in arg_1 and "payload" in arg_1:
            # Match it to a channel
            arg_3 = arg_1["stream"]
            arg_4 = arg_1["payload"]
            # block upstream frames
            if arg_3 not in arg_0.applications_accepting_frames:
                raise ValueError("Invalid multiplexed frame received (stream not mapped)")
            # send it on to the application that handles this stream
            await arg_0.send_upstream(
                message={
                    "type": "websocket.receive",
                    "text": await arg_0.encode_json(arg_4)
                },
                stream_name=arg_3
            )
            return
        else:
            raise ValueError("Invalid multiplexed **frame received (no channel/payload key)")

Rout the message down the correct stream .


return media_project, static_main, static_project, template_target

def Func ( arg_0 ) : import requests arg_1 = os . path . join ( arg_0 . project_directory , 'dist' , 'media' ) arg_2 = False arg_3 = os . path . join ( arg_0 . project_directory , 'dist' , 'static' ) arg_4 = os . path . join ( arg_0 . project_directory , 'templates' ) arg_5 = tempfile . mkdtemp ( ) arg_6 = requests . get ( data . ALDRYN_BOILERPLATE ) arg_7 = zipfile . ZipFile ( BytesIO ( arg_6 . content ) ) arg_7 . extractall ( path = arg_5 ) for arg_8 in os . listdir ( os . path . join ( arg_5 , 'aldryn-boilerplate-standard-master' ) ) : arg_9 = os . path . join ( arg_5 , 'aldryn-boilerplate-standard-master' , arg_8 ) arg_10 = os . path . join ( arg_0 . project_directory , arg_8 ) if os . path . isfile ( arg_9 ) : shutil . copy ( arg_9 , arg_10 ) else : shutil . copytree ( arg_9 , arg_10 ) shutil . rmtree ( arg_5 ) return arg_1 , arg_2 , arg_3 , arg_4

def Func(arg_0):  # pragma: no cover
    """
    Install aldryn boilerplate

    :param config_data: configuration data
    """
    import requests
    arg_1 = os.path.join(arg_0.project_directory, 'dist', 'media')
    arg_2 = False
    arg_3 = os.path.join(arg_0.project_directory, 'dist', 'static')
    arg_4 = os.path.join(arg_0.project_directory, 'templates')
    arg_5 = tempfile.mkdtemp()
    arg_6 = requests.get(data.ALDRYN_BOILERPLATE)
    arg_7 = zipfile.ZipFile(BytesIO(arg_6.content))
    arg_7.extractall(path=arg_5)
    for arg_8 in os.listdir(os.path.join(arg_5, 'aldryn-boilerplate-standard-master')):
        arg_9 = os.path.join(arg_5, 'aldryn-boilerplate-standard-master', arg_8)
        arg_10 = os.path.join(arg_0.project_directory, arg_8)
        if os.path.isfile(arg_9):
            shutil.copy(arg_9, arg_10)
        else:
            shutil.copytree(arg_9, arg_10)
    shutil.rmtree(arg_5)
    return arg_1, arg_2, arg_3, arg_4


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_2 . get ( 'label' ) arg_4 = False if arg_3 is None : arg_3 = 'buffer' arg_4 = True arg_5 = arg_2 . get ( 'taint' , frozenset ( ) ) arg_6 = arg_0 . _constraints . new_array ( name = arg_3 , index_max = arg_1 , value_bits = 8 , arg_5 = arg_5 , arg_4 = arg_4 ) arg_0 . _input_symbols . append ( arg_6 ) if arg_2 . get ( 'cstring' , False ) : for arg_7 in range ( arg_1 - 1 ) : arg_0 . _constraints . add ( arg_6 [ arg_7 ] != 0 ) return arg_6

def Func(arg_0, arg_1, **arg_2):
        """Create and return a symbolic buffer of length `nbytes`. The buffer is
        not written into State's memory; write it to the state's memory to
        introduce it into the program state.

        :param int nbytes: Length of the new buffer
        :param str label: (keyword arg only) The label to assign to the buffer
        :param bool cstring: (keyword arg only) Whether or not to enforce that the buffer is a cstring
                 (i.e. no NULL bytes, except for the last byte). (bool)
        :param taint: Taint identifier of the new buffer
        :type taint: tuple or frozenset

        :return: :class:`~manticore.core.smtlib.expression.Expression` representing the buffer.
        """
        arg_3 = arg_2.get('label')
        arg_4 = False
        if arg_3 is None:
            arg_3 = 'buffer'
            arg_4 = True
        arg_5 = arg_2.get('taint', frozenset())
        arg_6 = arg_0._constraints.new_array(name=arg_3, index_max=arg_1, value_bits=8, arg_5=arg_5, arg_4=arg_4)
        arg_0._input_symbols.append(arg_6)

        if arg_2.get('cstring', False):
            for arg_7 in range(arg_1 - 1):
                arg_0._constraints.add(arg_6[arg_7] != 0)

        return arg_6

Create and return a symbolic buffer of length nbytes . The buffer is not written into State s memory ; write it to the state s memory to introduce it into the program state .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 = arg_0 . extract ( ) if type ( arg_2 ) == int or arg_2 is None : arg_2 = np . random . RandomState ( seed = arg_2 ) arg_3 = arg_2 . choice ( len ( arg_0 ) , len ( arg_0 ) , replace = False ) return arg_0 . take ( arg_3 ) . split ( arg_1 )

def Func(arg_0, arg_1, arg_2=None):
        '''Returns a list containing random portions of the DataFrame.

        {note_copy}

        Example:

        >>> import vaex, import numpy as np
        >>> np.random.seed(111)
        >>> df = vaex.from_arrays(x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> for dfs in df.Func(frac=0.3, random_state=42):
        ...     print(dfs.x.values)
        ...
        [8 1 5]
        [0 7 2 9 4 3 6]
        >>> for split in df.Func(frac=[0.2, 0.3, 0.5], random_state=42):
        ...     print(dfs.x.values)
        [8 1]
        [5 0 7]
        [2 9 4 3 6]

        :param int/list frac: If int will split the DataFrame in two portions, the first of which will have size as specified by this parameter. If list, the generator will generate as many portions as elements in the list, where each element defines the relative fraction of that portion.
        :param int random_state: (default, None) Random number seed for reproducibility.
        :return: A list of DataFrames.
        :rtype: list
        '''
        arg_0 = arg_0.extract()
        if type(arg_2) == int or arg_2 is None:
            arg_2 = np.random.RandomState(seed=arg_2)
        arg_3 = arg_2.choice(len(arg_0), len(arg_0), replace=False)
        return arg_0.take(arg_3).split(arg_1)

Returns a list containing random portions of the DataFrame.

        {note_copy}

        Example:

        >>> import vaex, import numpy as np
        >>> np.random.seed(111)
        >>> df = vaex.from_arrays(x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> for dfs in df.split_random(frac=0.3, random_state=42):
        ...     print(dfs.x.values)
        ...
        [8 1 5]
        [0 7 2 9 4 3 6]
        >>> for split in df.split_random(frac=[0.2, 0.3, 0.5], random_state=42):
        ...     print(dfs.x.values)
        [8 1]
        [5 0 7]
        [2 9 4 3 6]

        :param int/list frac: If int will split the DataFrame in two portions, the first of which will have size as specified by this parameter. If list, the generator will generate as many portions as elements in the list, where each element defines the relative fraction of that portion.
        :param int random_state: (default, None) Random number seed for reproducibility.
        :return: A list of DataFrames.
        :rtype: list

Returns a list containing random portions of the DataFrame .


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
six
.
string_types
)
:
try
:
arg_1
=
dateutil
.
parser
.
parse
(
arg_1
)
except
ValueError
:
raise
ValueError
(
'Invalid date format for statistic {}.'
)
.
format
(
arg_0
.
query_name
)
if
not
isinstance
(
arg_1
,
datetime
)
:
raise
TypeError
(
'Invalid date type for statistic {}.'
)
.
format
(
arg_0
.
query_name
)
return
arg_1

def Func(arg_0, arg_1):
        """Extract date from string if necessary.

        :returns: the extracted date.
        """
        if isinstance(arg_1, six.string_types):
            try:
                arg_1 = dateutil.parser.parse(arg_1)
            except ValueError:
                raise ValueError(
                    'Invalid date format for statistic {}.'
                ).format(arg_0.query_name)
        if not isinstance(arg_1, datetime):
            raise TypeError(
                'Invalid date type for statistic {}.'
            ).format(arg_0.query_name)
        return arg_1


(self, func, sequence, reduce=None, star=False, minlength=0)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = False , arg_5 = 0 ) : def realreduce ( arg_6 ) : if arg_3 : if isinstance ( arg_6 , tuple ) : return arg_3 ( * arg_6 ) else : return arg_3 ( arg_6 ) return arg_6 def realfunc ( arg_7 ) : if arg_4 : return arg_1 ( * arg_7 ) else : return arg_1 ( arg_7 ) if len ( arg_2 ) <= 0 or arg_0 . np == 0 or get_debug ( ) : arg_0 . local = lambda : None arg_0 . local . rank = 0 arg_10 = [ realreduce ( realfunc ( arg_7 ) ) for arg_7 in arg_2 ] arg_0 . local = None return arg_10 arg_11 = min ( [ arg_0 . np , len ( arg_2 ) ] ) arg_12 = arg_0 . backend . QueueFactory ( 64 ) arg_13 = arg_0 . backend . QueueFactory ( 64 ) arg_0 . ordered . reset ( ) arg_14 = ProcessGroup ( main = arg_0 . _main , arg_11 = arg_11 , backend = arg_0 . backend , args = ( arg_12 , arg_13 , arg_2 , realfunc ) ) arg_14 . start ( ) arg_15 = [ ] arg_16 = [ ] def arg_19 ( arg_14 , arg_12 , arg_16 ) : arg_17 = 0 try : for arg_7 , arg_18 in enumerate ( arg_2 ) : if not hasattr ( arg_2 , '__getitem__' ) : arg_14 . put ( arg_12 , ( arg_7 , arg_18 ) ) else : arg_14 . put ( arg_12 , ( arg_7 , ) ) arg_17 = arg_17 + 1 arg_16 . append ( arg_17 ) for arg_7 in range ( arg_11 ) : arg_14 . put ( arg_12 , None ) except StopProcessGroup : return finally : pass arg_19 = threading . Thread ( None , arg_19 , args = ( arg_14 , arg_12 , arg_16 ) ) arg_19 . start ( ) arg_20 = 0 try : while True : try : arg_21 = arg_14 . get ( arg_13 ) except queue . Empty : continue except StopProcessGroup : raise arg_14 . get_exception ( ) arg_21 = arg_21 [ 0 ] , realreduce ( arg_21 [ 1 ] ) heapq . heappush ( arg_15 , arg_21 ) arg_20 = arg_20 + 1 if len ( arg_16 ) > 0 and arg_20 == arg_16 [ 0 ] : break arg_10 = [ ] while len ( arg_15 ) > 0 : arg_10 . append ( heapq . heappop ( arg_15 ) [ 1 ] ) arg_14 . join ( ) arg_19 . join ( ) assert arg_16 [ 0 ] == len ( arg_10 ) return arg_10 except BaseException as e : arg_14 . killall ( ) arg_14 . join ( ) arg_19 . join ( ) raise

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False, arg_5=0):
        """ Map-reduce with multile processes.

            Apply func to each item on the sequence, in parallel.
            As the results are collected, reduce is called on the result.
            The reduced result is returned as a list.

            Parameters
            ----------
            func : callable
                The function to call. It must accept the same number of
                arguments as the length of an item in the sequence.

                .. warning::

                    func is not supposed to use exceptions for flow control.
                    In non-debug mode all exceptions will be wrapped into
                    a :py:class:`SlaveException`.

            sequence : list or array_like
                The sequence of arguments to be applied to func.

            reduce : callable, optional
                Apply an reduction operation on the
                return values of func. If func returns a tuple, they
                are treated as positional arguments of reduce.

            star : boolean
                if True, the items in sequence are treated as positional
                arguments of reduce.

            minlength: integer
                Minimal length of `sequence` to start parallel processing.
                if len(sequence) < minlength, fall back to sequential
                processing. This can be used to avoid the overhead of starting
                the worker processes when there is little work.

            Returns
            -------
            results : list
                The list of reduced results from the Func operation, in
                the order of the arguments of sequence.

            Raises
            ------
            SlaveException
                If any of the slave process encounters
                an exception. Inspect :py:attr:`SlaveException.reason` for the underlying exception.

        """
        def realreduce(arg_6):
            if arg_3:
                if isinstance(arg_6, tuple):
                    return arg_3(*arg_6)
                else:
                    return arg_3(arg_6)
            return arg_6

        def realfunc(arg_7):
            if arg_4: return arg_1(*arg_7)
            else: return arg_1(arg_7)

        if len(arg_2) <= 0 or arg_0.np == 0 or get_debug():
            # Do this in serial
            arg_0.local = lambda : None
            arg_0.local.rank = 0

            arg_10 = [realreduce(realfunc(arg_7)) for arg_7 in arg_2]

            arg_0.local = None
            return arg_10

        # never use more than len(sequence) processes
        arg_11 = min([arg_0.np, len(arg_2)])

        arg_12 = arg_0.backend.QueueFactory(64)
        arg_13 = arg_0.backend.QueueFactory(64)
        arg_0.ordered.reset()

        arg_14 = ProcessGroup(main=arg_0._main, arg_11=arg_11,
                backend=arg_0.backend,
                args=(arg_12, arg_13, arg_2, realfunc))

        arg_14.start()

        arg_15 = []
        arg_16 = []
        def arg_19(arg_14, arg_12, arg_16):
            #   will fail silently if any error occurs.
            arg_17 = 0
            try:
                for arg_7, arg_18 in enumerate(arg_2):
                    if not hasattr(arg_2, '__getitem__'):
                        arg_14.put(arg_12, (arg_7, arg_18))
                    else:
                        arg_14.put(arg_12, (arg_7, ))
                    arg_17 = arg_17 + 1
                arg_16.append(arg_17)

                for arg_7 in range(arg_11):
                    arg_14.put(arg_12, None)
            except StopProcessGroup:
                return
            finally:
                pass
        arg_19 = threading.Thread(None, arg_19, args=(arg_14, arg_12, arg_16))
        arg_19.start()

        # we run fetcher on main thread to catch exceptions
        # raised by reduce
        arg_20 = 0
        try:
            while True:
                try:
                    arg_21 = arg_14.get(arg_13)
                except queue.Empty:
                    continue
                except StopProcessGroup:
                    raise arg_14.get_exception()
                arg_21 = arg_21[0], realreduce(arg_21[1])
                heapq.heappush(arg_15, arg_21)
                arg_20 = arg_20 + 1
                if len(arg_16) > 0 and arg_20 == arg_16[0]:
                    # if finished feeding see if all
                    # results have been obtained
                    break
            arg_10 = []
#            R.close()
#            R.join_thread()
            while len(arg_15) > 0:
                arg_10.append(heapq.heappop(arg_15)[1])
            arg_14.join()
            arg_19.join()
            assert arg_16[0] == len(arg_10)
            return arg_10
        except BaseException as e:
            arg_14.killall()
            arg_14.join()
            arg_19.join()
            raise

Map-reduce with multile processes.

            Apply func to each item on the sequence, in parallel.
            As the results are collected, reduce is called on the result.
            The reduced result is returned as a list.

            Parameters
            ----------
            func : callable
                The function to call. It must accept the same number of
                arguments as the length of an item in the sequence.

                .. warning::

                    func is not supposed to use exceptions for flow control.
                    In non-debug mode all exceptions will be wrapped into
                    a :py:class:`SlaveException`.

            sequence : list or array_like
                The sequence of arguments to be applied to func.

            reduce : callable, optional
                Apply an reduction operation on the
                return values of func. If func returns a tuple, they
                are treated as positional arguments of reduce.

            star : boolean
                if True, the items in sequence are treated as positional
                arguments of reduce.

            minlength: integer
                Minimal length of `sequence` to start parallel processing.
                if len(sequence) < minlength, fall back to sequential
                processing. This can be used to avoid the overhead of starting
                the worker processes when there is little work.

            Returns
            -------
            results : list
                The list of reduced results from the map operation, in
                the order of the arguments of sequence.

            Raises
            ------
            SlaveException
                If any of the slave process encounters
                an exception. Inspect :py:attr:`SlaveException.reason` for the underlying exception.


def
Func
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)
:
if
not
arg_1
.
startswith
(
'nonlocal image URI found:'
)
:
Func_old
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """Do not warn on external images."""
    if not arg_1.startswith('nonlocal image URI found:'):
        Func_old(arg_0, arg_1, *arg_2, **arg_3)


(
    generated_python: str,
    var_name: str = _GENERATED_PYTHON_VAR_NAME,
    which_ns: Optional[str] = None,
)

def Func ( arg_0 : arg_1 , arg_2 : arg_1 = arg_3 , arg_4 : arg_5 [ arg_1 ] = None , ) -> None : if arg_4 is None : arg_4 = get_current_ns ( ) . name arg_6 = sym . Symbol ( arg_2 , ns = arg_4 ) arg_7 = Maybe ( Var . find ( arg_6 ) ) . or_else ( lambda : Var . intern ( sym . symbol ( arg_4 ) , sym . symbol ( arg_2 ) , "" , dynamic = True , meta = lmap . map ( { _PRIVATE_META_KEY : True } ) , ) ) arg_7 . value = arg_7 . value + arg_0

def Func(
    arg_0: arg_1,
    arg_2: arg_1 = arg_3,
    arg_4: arg_5[arg_1] = None,
) -> None:
    """Add generated Python code to a dynamic variable in which_ns."""
    if arg_4 is None:
        arg_4 = get_current_ns().name
    arg_6 = sym.Symbol(arg_2, ns=arg_4)
    arg_7 = Maybe(Var.find(arg_6)).or_else(
        lambda: Var.intern(
            sym.symbol(arg_4),  # type: ignore
            sym.symbol(arg_2),
            "",
            dynamic=True,
            meta=lmap.map({_PRIVATE_META_KEY: True}),
        )
    )
    arg_7.value = arg_7.value + arg_0

Add generated Python code to a dynamic variable in which_ns .