def Func ( arg_0 ) : arg_1 = arg_0 . data arg_0 . data = SortedKeyList ( key = arg_0 . _key ) return arg_1

def Func(arg_0):
        '''Replace this observation's data with a fresh container.

        Returns
        -------
        annotation_data : SortedKeyList
            The original annotation data container
        '''

        arg_1 = arg_0.data
        arg_0.data = SortedKeyList(key=arg_0._key)
        return arg_1

Replace this observation s data with a fresh container .


return (bool(last_two_blanks_re.match(new_src)) or
            bool(last_two_blanks_re2.match(new_src)) )

def Func ( arg_0 ) : if not arg_0 : return False arg_1 = '\n' . join ( [ '###\n' ] + arg_0 . splitlines ( ) [ - 2 : ] ) return ( bool ( Func_re . match ( arg_1 ) ) or bool ( Func_re2 . match ( arg_1 ) ) )

def Func(arg_0):
    """Determine if the input source ends in two blanks.

    A blank is either a newline or a line consisting of whitespace.

    Parameters
    ----------
    src : string
      A single or multiline string.
    """
    if not arg_0: return False
    # The logic here is tricky: I couldn't get a regexp to work and pass all
    # the tests, so I took a different approach: split the source by lines,
    # grab the last two and prepend '###\n' as a stand-in for whatever was in
    # the body before the last two lines.  Then, with that structure, it's
    # possible to analyze with two regexps.  Not the most elegant solution, but
    # it works.  If anyone tries to change this logic, make sure to validate
    # the whole test suite first!
    arg_1 = '\n'.join(['###\n'] + arg_0.splitlines()[-2:])
    return (bool(Func_re.match(arg_1)) or
            bool(Func_re2.match(arg_1)) )

Determine if the input source ends in two blanks .


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Sends a message to the UDP receiver

        Parameter
        ---------

        message_type: monitoring.MessageType (enum)
            In this case message type is RESOURCE_INFO most often
        task_id: int
            Task identifier of the task for which resource monitoring is being reported
        message: object
            Arbitrary pickle-able object that is to be sent

        Returns:
            # bytes sent
        """
        arg_4 = 0
        try:
            arg_5 = pickle.dumps((arg_0.source_id,   # Identifier for manager
                                   int(time.time()),  # epoch timestamp
                                   arg_1,
                                   arg_3))
        except Exception as e:
            print("Exception during pickling {}".format(e))
            return

        try:
            arg_4 = arg_0.sock.Functo(arg_5, (arg_0.ip, arg_0.port))
        except socket.timeout:
            print("Could not Func message within timeout limit")
            return False
        return arg_4


return sum([flux for flux in c_flux if flux > 0])

def Func(arg_0, arg_1, arg_2=True):
    """
    Compute the total components consumption or production flux.

    Parameters
    ----------
    flux : float
        The reaction flux for the components.
    components : list
        List of stoichiometrically weighted components.
    consumption : bool, optional
        Whether to sum up consumption or production fluxes.

    """

    arg_3 = 1 if arg_2 else -1
    arg_4 = [elem * arg_0 * arg_3 for elem in arg_1]

    return sum([arg_0 for arg_0 in arg_4 if arg_0 > 0])

Compute the total components consumption or production flux .


def Func(arg_0):
    '''Remove an environment'''

    click.echo()
    try:
        arg_1 = cpenv.resolve(arg_0)
    except cpenv.ResolveError as e:
        click.echo(e)
        return

    arg_2 = arg_1.resolved[0]
    if not isinstance(arg_2, cpenv.VirtualEnvironment):
        click.echo('{} is a module. Use `cpenv module Func` instead.')
        return

    click.echo(format_objects([arg_2]))
    click.echo()

    arg_3 = click.confirm(
        red('Are you sure you want to Func this environment?')
    )
    if arg_3:
        click.echo('Attempting to Func...', nl=False)

        try:
            arg_2.Func()
        except Exception as e:
            click.echo(bold_red('FAIL'))
            click.echo(e)
        else:
            click.echo(bold_green('OK!'))


def Func ( arg_0 , arg_1 = None ) : with db . session . begin_nested ( ) : if arg_0 . status != RequestStatus . PENDING : raise InvalidRequestStateError ( RequestStatus . PENDING ) arg_0 . status = RequestStatus . REJECTED request_Funced . send ( arg_0 , arg_1 = arg_1 )

def Func(arg_0, arg_1=None):
        """Reject request."""
        with db.session.begin_nested():
            if arg_0.status != RequestStatus.PENDING:
                raise InvalidRequestStateError(RequestStatus.PENDING)
            arg_0.status = RequestStatus.REJECTED
        request_Funced.send(arg_0, arg_1=arg_1)


def Func ( arg_0 , arg_1 = True ) : log . info ( arg_0 ) arg_2 = condor_submit ( arg_0 ) if arg_2 != 0 : subprocess . call ( arg_0 , arg_1 = arg_1 )

def Func(arg_0, arg_1=True):
    """
    Tries to submit cmd to HTCondor, if it does not succeed, it will
    be called with subprocess.call.

    Parameters
    ----------
    cmd: string
        Command to be submitted

    Returns
    -------
    """
    log.info(arg_0)
    arg_2 = condor_submit(arg_0)
    if arg_2 != 0:
        subprocess.call(arg_0, arg_1=arg_1)

Tries to submit cmd to HTCondor if it does not succeed it will be called with subprocess . call .


(self, client, cmdLine, clientInfo='', clientKey='', params='',
                alreadyRunning=False, minimumWorkers=0, maximumWorkers=0,
                jobType='', priority=DEFAULT_JOB_PRIORITY)

def Func(arg_0, arg_1, arg_2, arg_3='', arg_4='', arg_5='',
                arg_6=False, arg_7=0, arg_8=0,
                arg_9='', arg_10=arg_11):
    """ Add an entry to the jobs table for a new job request. This is called by
    clients that wish to startup a new job, like a Hypersearch, stream job, or
    specific model evaluation from the engine.

    This puts a new entry into the jobs table. The CJM is always periodically
    sweeping the jobs table and when it finds a new job, will proceed to start it
    up on Hadoop.

    Parameters:
    ----------------------------------------------------------------
    client:          Name of the client submitting the job
    cmdLine:         Command line to use to launch each worker process; must be
                      a non-empty string
    clientInfo:      JSON encoded dict of client specific information.
    clientKey:       Foreign key.
    params:          JSON encoded dict of the parameters for the job. This
                      can be fetched out of the database by the worker processes
                      based on the jobID.
    alreadyRunning:  Used for unit test purposes only. This inserts the job
                      in the running state. It is used when running a worker
                      in standalone mode without hadoop - it gives it a job
                      record to work with.
    minimumWorkers:  minimum number of workers design at a time.
    maximumWorkers:  maximum number of workers desired at a time.
    jobType:         The type of job that this is. This should be one of the
                      JOB_TYPE_XXXX enums. This is needed to allow a standard
                      way of recognizing a job's function and capabilities.
    priority:        Job scheduling priority; 0 is the default priority (
                      ClientJobsDAO.DEFAULT_JOB_PRIORITY); positive values are
                      higher priority (up to ClientJobsDAO.MAX_JOB_PRIORITY),
                      and negative values are lower priority (down to
                      ClientJobsDAO.MIN_JOB_PRIORITY). Higher-priority jobs will
                      be scheduled to run at the expense of the lower-priority
                      jobs, and higher-priority job tasks will preempt those
                      with lower priority if there is inadequate supply of
                      scheduling slots. Excess lower priority job tasks will
                      starve as long as slot demand exceeds supply. Most jobs
                      should be scheduled with DEFAULT_JOB_PRIORITY. System jobs
                      that must run at all cost, such as Multi-Model-Master,
                      should be scheduled with MAX_JOB_PRIORITY.

    retval:          jobID - unique ID assigned to this job
    """

    arg_12 = arg_0._normalizeHash(uuid.uuid1().bytes)

    @g_retrySQL
    def insertWithRetries():
      with ConnectionFactory.get() as conn:
        return arg_0._insertOrGetUniqueJobNoRetries(
          conn, arg_1=arg_1, arg_2=arg_2, arg_12=arg_12,
          arg_3=arg_3, arg_4=arg_4, arg_5=arg_5,
          arg_7=arg_7, arg_8=arg_8,
          arg_9=arg_9, arg_10=arg_10, arg_6=arg_6)

    try:
      arg_13 = insertWithRetries()
    except:
      arg_0._logger.exception(
        'Func FAILED: jobType=%r; client=%r; clientInfo=%r; clientKey=%r;'
        'jobHash=%r; cmdLine=%r',
        arg_9, arg_1, _abbreviate(arg_3, 48), arg_4, arg_12,
        arg_2)
      raise
    else:
      arg_0._logger.info(
        'Func: returning jobID=%s. jobType=%r; client=%r; clientInfo=%r; '
        'clientKey=%r; jobHash=%r; cmdLine=%r',
        arg_13, arg_9, arg_1, _abbreviate(arg_3, 48), arg_4,
        arg_12, arg_2)

    return arg_13

Add an entry to the jobs table for a new job request . This is called by clients that wish to startup a new job like a Hypersearch stream job or specific model evaluation from the engine .


def Func ( arg_0 , arg_1 ) : if arg_0 . own . get ( 'name' ) : arg_0 . func_name = arg_1 arg_0 . own [ 'name' ] [ 'value' ] = Js ( arg_1 )

def Func(arg_0, arg_1):
        '''name is py type'''
        if arg_0.own.get('name'):
            arg_0.func_name = arg_1
            arg_0.own['name']['value'] = Js(arg_1)


def
Func
(
arg_0
)
:
arg_0
.
__logger
.
debug
(
"Func(): Starting task <%s>"
,
arg_0
.
__task
[
'taskLabel'
]
)
if
arg_0
.
__cmdOptions
.
privateOptions
[
'testMode'
]
:
arg_1
=
10
else
:
arg_1
=
arg_0
.
__task
[
'iterationCount'
]
if
arg_1
>=
0
:
arg_2
=
iter
(
xrange
(
arg_1
)
)
else
:
arg_2
=
iter
(
itertools
.
count
(
)
)
arg_3
=
PeriodicActivityMgr
(
requestedActivities
=
arg_0
.
_createPeriodicActivities
(
)
)
arg_0
.
__model
.
resetSequenceStates
(
)
arg_0
.
__taskDriver
.
setup
(
)
while
True
:
try
:
next
(
arg_2
)
except
StopIteration
:
break
try
:
arg_4
=
arg_0
.
__datasetReader
.
next
(
)
except
StopIteration
:
break
arg_5
=
arg_0
.
__taskDriver
.
handleInputRecord
(
arg_4
=
arg_4
)
if
InferenceElement
.
encodings
in
arg_5
.
inferences
:
arg_5
.
inferences
.
pop
(
InferenceElement
.
encodings
)
arg_0
.
__predictionLogger
.
writeRecord
(
arg_5
)
arg_3
.
tick
(
)
arg_0
.
_getAndEmitExperimentMetrics
(
final
=
True
)
arg_0
.
__taskDriver
.
finalize
(
)
arg_0
.
__model
.
resetSequenceStates
(
)

def Func(arg_0):
    """Runs a single experiment task"""
    arg_0.__logger.debug("Func(): Starting task <%s>", arg_0.__task['taskLabel'])

    # Set up the task

    # Create our main loop-control iterator
    if arg_0.__cmdOptions.privateOptions['testMode']:
      arg_1 = 10
    else:
      arg_1 = arg_0.__task['iterationCount']

    if arg_1 >= 0:
      arg_2 = iter(xrange(arg_1))
    else:
      arg_2 = iter(itertools.count())

    # Initialize periodic activities
    arg_3 = PeriodicActivityMgr(
      requestedActivities=arg_0._createPeriodicActivities())

    # Reset sequence states in the model, so it starts looking for a new
    # sequence
    # TODO: should this be done in OPFTaskDriver.setup(), instead?  Is it always
    #       desired in Nupic?
    arg_0.__model.resetSequenceStates()

    # Have Task Driver perform its initial setup activities, including setup
    # callbacks
    arg_0.__taskDriver.setup()

    # Run it!
    while True:
      # Check controlling iterator first
      try:
        next(arg_2)
      except StopIteration:
        break

      # Read next input record
      try:
        arg_4 = arg_0.__datasetReader.next()
      except StopIteration:
        break

      # Process input record
      arg_5 = arg_0.__taskDriver.handleInputRecord(arg_4=arg_4)

      if InferenceElement.encodings in arg_5.inferences:
        arg_5.inferences.pop(InferenceElement.encodings)
      arg_0.__predictionLogger.writeRecord(arg_5)

      # Run periodic activities
      arg_3.tick()

    # Dump the experiment metrics at the end of the task
    arg_0._getAndEmitExperimentMetrics(final=True)

    # Have Task Driver perform its final activities
    arg_0.__taskDriver.finalize()

    # Reset sequence states in the model, so it starts looking for a new
    # sequence
    # TODO: should this be done in OPFTaskDriver.setup(), instead?  Is it always
    #       desired in Nupic?
    arg_0.__model.resetSequenceStates()


def Func(arg_0=''):
    """This is a decorator which can be used to mark functions
    as Func. It will result in a warning being emitted
    when the function is used.

    :param msg:

        Additional message added to the warning.

    """

    def wrapper(arg_1):
        @functools.wraps(arg_1)
        def new_func(*arg_2, **arg_3):
            arg_4 = "Call to Func function or property `%s`." % arg_1.__name__
            arg_4 = arg_4 + ' ' + arg_0
            warnings.warn(
                arg_4,
                category=DeprecationWarning,
            )
            return arg_1(*arg_2, **arg_3)

        return new_func

    return wrapper

This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emitted
    when the function is used.

    :param msg:

        Additional message added to the warning.

This is a decorator which can be used to mark functions as deprecated . It will result in a warning being emitted when the function is used .


def Func(arg_0, arg_1, arg_2):
        """Validate an alias and return the its number of arguments."""
        if arg_1 in arg_0.no_alias:
            raise InvalidAliasError("The name %s can't be aliased "
                                    "because it is a keyword or builtin." % arg_1)
        if not (isinstance(arg_2, basestring)):
            raise InvalidAliasError("An alias command must be a string, "
                                    "got: %r" % arg_2)
        arg_3 = arg_2.count('%s')
        if arg_3>0 and arg_2.find('%l')>=0:
            raise InvalidAliasError('The %s and %l specifiers are mutually '
                                    'exclusive in alias definitions.')
        return arg_3

Validate an alias and return the its number of arguments .


def Func ( arg_0 , arg_1 , arg_2 = ( 1 , ) ) : with torch . no_grad ( ) : arg_3 = max ( arg_2 ) arg_4 = arg_1 . size ( 0 ) arg_5 , arg_6 = arg_0 . topk ( arg_3 , 1 , True , True ) arg_6 = arg_6 . t ( ) arg_7 = arg_6 . eq ( arg_1 . view ( 1 , - 1 ) . expand_as ( arg_6 ) ) arg_8 = [ ] for arg_9 in arg_2 : arg_10 = arg_7 [ : arg_9 ] . view ( - 1 ) . float ( ) . sum ( 0 , keepdim = True ) arg_8 . append ( arg_10 . mul_ ( 100.0 / arg_4 ) ) return arg_8

def Func(arg_0, arg_1, arg_2=(1, )):
    """Computes the precision@k for the specified values of k"""
    with torch.no_grad():
        arg_3 = max(arg_2)
        arg_4 = arg_1.size(0)

        arg_5, arg_6 = arg_0.topk(arg_3, 1, True, True)
        arg_6 = arg_6.t()
        arg_7 = arg_6.eq(arg_1.view(1, -1).expand_as(arg_6))

        arg_8 = []
        for arg_9 in arg_2:
            arg_10 = arg_7[:arg_9].view(-1).float().sum(0, keepdim=True)
            arg_8.append(arg_10.mul_(100.0 / arg_4))
        return arg_8


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( arg_0 . opt . last_modified_before is not None ) or ( arg_0 . opt . last_modified_after is not None ) if arg_2 [ 'is_dir' ] : if not arg_3 : arg_1 . append ( arg_2 ) return if ( arg_0 . opt . last_modified_before is not None ) and arg_2 [ 'last_modified' ] >= arg_0 . opt . last_modified_before : return if ( arg_0 . opt . last_modified_after is not None ) and arg_2 [ 'last_modified' ] <= arg_0 . opt . last_modified_after : return arg_1 . append ( arg_2 )

def Func(arg_0, arg_1, arg_2):
    '''Check all file item with given conditions.'''
    arg_3 = (arg_0.opt.last_modified_before is not None) or (arg_0.opt.last_modified_after is not None)

    if arg_2['is_dir']:
      if not arg_3:
        arg_1.append(arg_2)
      return

    if (arg_0.opt.last_modified_before is not None) and arg_2['last_modified'] >= arg_0.opt.last_modified_before:
      return

    if (arg_0.opt.last_modified_after is not None) and arg_2['last_modified'] <= arg_0.opt.last_modified_after:
      return

    arg_1.append(arg_2)

Check all file item with given conditions .


return cls.processTmpl.render(
            indent=getIndent(ctx.indent),
            name=proc.name,
            hasToBeVhdlProcess=hasToBeVhdlProcess,
            extraVars=extraVarsSerialized,
            sensitivityList=", ".join(sensitivityList),
            statements=extraVarsInit + statemets
        )

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_1
.
statements
arg_4
=
[
]
arg_5
=
[
]
arg_6
=
arr_any
(
arg_3
,
lambda
x
:
isinstance
(
x
,
(
IfContainer
,
SwitchContainer
,
WhileContainer
,
WaitStm
)
)
)
arg_7
=
sorted
(
map
(
lambda
arg_11
:
arg_0
.
sensitivityListItem
(
arg_11
,
arg_2
)
,
arg_1
.
sensitivityList
)
)
if
arg_6
:
arg_8
=
arg_2
.
withIndent
(
)
else
:
arg_8
=
copy
(
arg_2
)
def
arg_15
(
arg_9
,
arg_10
)
:
arg_11
=
RtlSignal
(
,
,
arg_10
,
virtualOnly
=
True
)
arg_11
.
name
=
arg_2
.
scope
.
checkedName
(
arg_9
,
arg_11
)
arg_11
.
hidden
=
False
arg_14
=
arg_0
.
SignalItem
(
arg_11
,
arg_8
,
declaration
=
True
)
arg_4
.
append
(
arg_11
)
arg_5
.
append
(
arg_14
)
return
arg_11
arg_8
.
createTmpVarFn
=
arg_15
arg_16
=
[
arg_0
.
asHdl
(
arg_11
,
arg_8
)
for
arg_11
in
arg_3
]
arg_1
.
name
=
arg_2
.
scope
.
checkedName
(
arg_1
.
name
,
arg_1
)
arg_17
=
[
]
for
arg_11
in
arg_4
:
if
isinstance
(
arg_11
.
defVal
,
RtlSignalBase
)
or
arg_11
.
defVal
.
vldMask
:
arg_18
=
Assignment
(
arg_11
.
defVal
,
arg_11
,
virtualOnly
=
True
)
arg_17
.
append
(
arg_0
.
Assignment
(
arg_18
,
arg_8
)
)
else
:
assert
arg_11
.
drivers
,
arg_11
for
arg_19
in
arg_11
.
drivers
:
arg_17
.
append
(
arg_0
.
asHdl
(
arg_19
,
arg_8
)
)
arg_20
=
arg_6
arg_6
=
arg_4
or
arg_6
if
arg_6
and
not
arg_20
:
arg_21
=
getIndent
(
1
)
arg_16
=
list
(
map
(
lambda
x
:
arg_21
+
x
,
arg_16
)
)
return
arg_0
.
processTmpl
.
render
(
indent
=
getIndent
(
arg_2
.
indent
)
,
arg_12
=
arg_1
.
name
,
arg_6
=
arg_6
,
arg_4
=
arg_5
,
arg_7
=
", "
.
join
(
arg_7
)
,
statements
=
arg_17
+
arg_16
)

def Func(arg_0, arg_1, arg_2):
        """
        Serialize Func objects as VHDL

        :param scope: name scope to prevent name collisions
        """
        arg_3 = arg_1.statements
        arg_4 = []
        arg_5 = []

        arg_6 = arr_any(arg_3,
                                     lambda x: isinstance(x,
                                                          (IfContainer,
                                                           SwitchContainer,
                                                           WhileContainer,
                                                           WaitStm)))

        arg_7 = sorted(
            map(lambda arg_11: arg_0.sensitivityListItem(arg_11, arg_2),
                arg_1.sensitivityList))

        if arg_6:
            arg_8 = arg_2.withIndent()
        else:
            arg_8 = copy(arg_2)

        def arg_15(arg_9, arg_10):
            arg_11 = RtlSignal(None, None, arg_10, virtualOnly=True)
            arg_11.name = arg_2.scope.checkedName(arg_9, arg_11)
            arg_11.hidden = False
            arg_14 = arg_0.SignalItem(arg_11, arg_8, declaration=True)
            arg_4.append(arg_11)
            arg_5.append(arg_14)
            return arg_11

        arg_8.createTmpVarFn = arg_15

        arg_16 = [arg_0.asHdl(arg_11, arg_8) for arg_11 in arg_3]
        arg_1.name = arg_2.scope.checkedName(arg_1.name, arg_1)

        arg_17 = []
        for arg_11 in arg_4:
            if isinstance(arg_11.defVal, RtlSignalBase) or arg_11.defVal.vldMask:
                arg_18 = Assignment(arg_11.defVal, arg_11, virtualOnly=True)
                arg_17.append(arg_0.Assignment(arg_18, arg_8))
            else:
                assert arg_11.drivers, arg_11
            for arg_19 in arg_11.drivers:
                arg_17.append(arg_0.asHdl(arg_19, arg_8))

        arg_20 = arg_6
        arg_6 = arg_4 or arg_6

        if arg_6 and not arg_20:
            # add indent because we did not added it before because we did not
            # know t
            arg_21 = getIndent(1)
            arg_16 = list(map(lambda x: arg_21 + x, arg_16))

        return arg_0.processTmpl.render(
            indent=getIndent(arg_2.indent),
            arg_12=arg_1.name,
            arg_6=arg_6,
            arg_4=arg_5,
            arg_7=", ".join(arg_7),
            statements=arg_17 + arg_16
        )

Serialize HWProcess objects as VHDL

        :param scope: name scope to prevent name collisions


return cls(
        nodes['x'], nodes['y'], edges['from'], edges['to'], edges[imp_names],
        twoway=two_way)

def Func ( arg_0 , arg_1 ) : with pd . HDFStore ( arg_1 ) as store : arg_2 = store [ 'nodes' ] arg_3 = store [ 'edges' ] arg_4 = store [ 'two_way' ] [ 0 ] arg_5 = store [ 'impedance_names' ] . tolist ( ) return arg_0 ( arg_2 [ 'x' ] , arg_2 [ 'y' ] , arg_3 [ 'from' ] , arg_3 [ 'to' ] , arg_3 [ arg_5 ] , twoway = arg_4 )

def Func(arg_0, arg_1):
    """
    Build a Network from data in a Pandas HDFStore.

    Parameters
    ----------
    cls : class
        Class to instantiate, usually pandana.Network.
    filename : str

    Returns
    -------
    network : pandana.Network

    """
    with pd.HDFStore(arg_1) as store:
        arg_2 = store['nodes']
        arg_3 = store['edges']
        arg_4 = store['two_way'][0]
        arg_5 = store['impedance_names'].tolist()

    return arg_0(
        arg_2['x'], arg_2['y'], arg_3['from'], arg_3['to'], arg_3[arg_5],
        twoway=arg_4)

Build a Network from data in a Pandas HDFStore .


def Func ( arg_0 ) : def split_env ( arg_1 ) : if '=' in arg_1 : return arg_1 . split ( '=' , 1 ) else : return arg_1 , None arg_1 = { } for arg_2 in open ( arg_0 , 'r' ) : arg_2 = arg_2 . strip ( ) if arg_2 and not arg_2 . startswith ( '#' ) : arg_3 , arg_4 = split_env ( arg_2 ) arg_1 [ arg_3 ] = arg_4 return arg_1

def Func(arg_0):
    """
    This code is copied from Docker Compose, so that we're exactly compatible
    with their `env_file` option
    """
    def split_env(arg_1):
        if '=' in arg_1:
            return arg_1.split('=', 1)
        else:
            return arg_1, None
    arg_1 = {}
    for arg_2 in open(arg_0, 'r'):
        arg_2 = arg_2.strip()
        if arg_2 and not arg_2.startswith('#'):
            arg_3, arg_4 = split_env(arg_2)
            arg_1[arg_3] = arg_4
    return arg_1

This code is copied from Docker Compose so that we re exactly compatible with their env_file option


def Func(arg_0, arg_1="+", arg_2="+"):
        """
        Subscribe to device status messages

        # Parameters
        typeId (string): typeId for the subscription, optional.  Defaults to all device types (MQTT `+` wildcard)
        deviceId (string): deviceId for the subscription, optional.  Defaults to all devices (MQTT `+` wildcard)

        # Returns
        int: If the subscription was successful then the return Message ID (mid) for the subscribe request
            will be returned. The mid value can be used to track the subscribe request by checking against
            the mid argument if you register a subscriptionCallback method.
            If the subscription fails then the return value will be `0`
        """
        if arg_0._config.isQuickstart() and arg_2 == "+":
            arg_0.logger.warning("QuickStart applications do not support wildcard subscription to device status")
            return 0

        arg_3 = "iot-2/type/%s/id/%s/mon" % (arg_1, arg_2)
        return arg_0._subscribe(arg_3, 0)


def Func ( arg_0 , arg_1 ) : arg_1 . endlexpos = arg_1 . lexpos + len ( arg_1 . value ) return arg_1

def Func(arg_0, arg_1):
        r"\]"
        arg_1.endlexpos = arg_1.lexpos + len(arg_1.value)
        return arg_1


_compat_rem_str_id_from_index - Used in compat_convertHashedIndexes to remove the old string repr of a field,
				in order to later add the hashed value,

(self, indexedField, pk, val, conn=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
		'''
			Func - Used in compat_convertHashedIndexes to remove the old string repr of a field,
				in order to later add the hashed value,
		'''
		if arg_4 is None:
			arg_4 = arg_0._get_connection()
		arg_4.srem(arg_0._compat_get_str_key_for_index(arg_1, arg_3), arg_2)

_compat_rem_str_id_from_index - Used in compat_convertHashedIndexes to remove the old string repr of a field in order to later add the hashed value


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 [ "wsgi.url_scheme" ] + "://" if arg_0 . get ( "HTTP_HOST" ) : arg_2 += arg_0 [ "HTTP_HOST" ] else : arg_2 += arg_0 [ "SERVER_NAME" ] if arg_0 [ "wsgi.url_scheme" ] == "https" : if arg_0 [ "SERVER_PORT" ] != "443" : arg_2 += ":" + arg_0 [ "SERVER_PORT" ] else : if arg_0 [ "SERVER_PORT" ] != "80" : arg_2 += ":" + arg_0 [ "SERVER_PORT" ] arg_2 += compat . quote ( arg_0 . get ( "SCRIPT_NAME" , "" ) ) if arg_1 is None : arg_2 += compat . quote ( arg_0 . get ( "PATH_INFO" , "" ) ) if arg_0 . get ( "QUERY_STRING" ) : arg_2 += "?" + arg_0 [ "QUERY_STRING" ] else : arg_2 += arg_1 return arg_2

def Func(arg_0, arg_1=None):
    """URL reconstruction according to PEP 333.
    @see https://www.python.org/dev/peps/pep-3333/#url-reconstruction
    """
    arg_2 = arg_0["wsgi.url_scheme"] + "://"

    if arg_0.get("HTTP_HOST"):
        arg_2 += arg_0["HTTP_HOST"]
    else:
        arg_2 += arg_0["SERVER_NAME"]

        if arg_0["wsgi.url_scheme"] == "https":
            if arg_0["SERVER_PORT"] != "443":
                arg_2 += ":" + arg_0["SERVER_PORT"]
        else:
            if arg_0["SERVER_PORT"] != "80":
                arg_2 += ":" + arg_0["SERVER_PORT"]

    arg_2 += compat.quote(arg_0.get("SCRIPT_NAME", ""))

    if arg_1 is None:
        arg_2 += compat.quote(arg_0.get("PATH_INFO", ""))
        if arg_0.get("QUERY_STRING"):
            arg_2 += "?" + arg_0["QUERY_STRING"]
    else:
        arg_2 += arg_1  # TODO: quote?
    return arg_2

URL reconstruction according to PEP 333 .


def Func ( arg_0 ) : arg_0 . _command . append ( '\x87' ) arg_0 . _ft232h . _write ( '' . join ( arg_0 . _command ) ) return bytearray ( arg_0 . _ft232h . _poll_read ( arg_0 . _expected ) )

def Func(arg_0):
        """End I2C transaction and get response bytes, including ACKs."""
        # Ask to return response bytes immediately.
        arg_0._command.append('\x87')
        # Send the entire command to the MPSSE.
        arg_0._ft232h._write(''.join(arg_0._command))
        # Read response bytes and return them.
        return bytearray(arg_0._ft232h._poll_read(arg_0._expected))

End I2C transaction and get response bytes including ACKs .


return 0x40 | board_addr_pattern | rw_cmd_pattern

def Func(arg_0, arg_1):
        """Returns an SPI control byte.

        The MCP23S17 is a slave SPI device. The slave address contains
        four fixed bits and three user-defined hardware address bits
        (if enabled via IOCON.HAEN) (pins A2, A1 and A0) with the
        read/write bit filling out the control byte::

            +--------------------+
            |0|1|0|0|A2|A1|A0|R/W|
            +--------------------+
             7 6 5 4 3  2  1   0

        :param read_write_cmd: Read or write command.
        :type read_write_cmd: int
        """
        # board_addr_pattern = (self.hardware_addr & 0b111) << 1
        arg_2 = (arg_0.hardware_addr << 1) & 0xE
        arg_3 = arg_1 & 1  # make sure it's just 1 bit long
        return 0x40 | arg_2 | arg_3


Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , ConvertingDict ) and isinstance ( arg_1 , dict ) : arg_1 = ConvertingDict ( arg_1 ) arg_1 . configurator = arg_0 elif not isinstance ( arg_1 , ConvertingList ) and isinstance ( arg_1 , list ) : arg_1 = ConvertingList ( arg_1 ) arg_1 . configurator = arg_0 elif not isinstance ( arg_1 , ConvertingTuple ) and isinstance ( arg_1 , tuple ) : arg_1 = ConvertingTuple ( arg_1 ) arg_1 . configurator = arg_0 elif isinstance ( arg_1 , six . string_types ) : arg_3 = arg_0 . CONVERT_PATTERN . match ( arg_1 ) if arg_3 : arg_4 = arg_3 . groupdict ( ) arg_5 = arg_4 [ 'prefix' ] arg_6 = arg_0 . value_Funcers . get ( arg_5 , None ) if arg_6 : arg_7 = arg_4 [ 'suffix' ] arg_6 = getattr ( arg_0 , arg_6 ) arg_1 = arg_6 ( arg_7 ) return arg_1

def Func(arg_0, arg_1):
        """
        Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their Funcing alternatives. Strings are checked to
        see if they have a conversion format and are Funced if they do.
        """
        if not isinstance(arg_1, ConvertingDict) and isinstance(arg_1, dict):
            arg_1 = ConvertingDict(arg_1)
            arg_1.configurator = arg_0
        elif not isinstance(arg_1, ConvertingList) and isinstance(arg_1, list):
            arg_1 = ConvertingList(arg_1)
            arg_1.configurator = arg_0
        elif not isinstance(arg_1, ConvertingTuple) and\
                 isinstance(arg_1, tuple):
            arg_1 = ConvertingTuple(arg_1)
            arg_1.configurator = arg_0
        elif isinstance(arg_1, six.string_types):  # str for py3k
            arg_3 = arg_0.CONVERT_PATTERN.match(arg_1)
            if arg_3:
                arg_4 = arg_3.groupdict()
                arg_5 = arg_4['prefix']
                arg_6 = arg_0.value_Funcers.get(arg_5, None)
                if arg_6:
                    arg_7 = arg_4['suffix']
                    arg_6 = getattr(arg_0, arg_6)
                    arg_1 = arg_6(arg_7)
        return arg_1

Convert values to an appropriate type . dicts lists and tuples are replaced by their converting alternatives . Strings are checked to see if they have a conversion format and are converted if they do .


def
Func
(
arg_0
)
:
if
arg_0
.
disabled
:
warn
(
"Attempt to select disabled option: {}"
.
format
(
arg_0
.
value
or
arg_0
.
text
)
)
arg_0
.
base
.
Func
(
)

def Func(arg_0):
        """ Select this node if it is an option element inside a select tag. """
        if arg_0.disabled:
            warn("Attempt to select disabled option: {}".format(arg_0.value or arg_0.text))
        arg_0.base.Func()

Select this node if it is an option element inside a select tag .


def Func ( arg_0 ) : if isinstance ( arg_0 , list ) : arg_0 = u"" . join ( arg_0 ) return unicodedata . normalize ( "NFKC" , arg_0 )

def Func(arg_0):
    """Do NFKC normalization of Unicode data.

    :Parameters:
        - `data`: list of Unicode characters or Unicode string.

    :return: normalized Unicode string."""
    if isinstance(arg_0, list):
        arg_0 = u"".join(arg_0)
    return unicodedata.normalize("NFKC", arg_0)


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
filter
=
arg_1
arg_0
.
logger
.
info
(
"Setting filter to: %s"
,
arg_0
.
filter
)
if
arg_0
.
_connected
:
arg_0
.
_sendall
(
"#filter %s\r\n"
%
arg_0
.
filter
)

def Func(arg_0, arg_1):
        """
        Set a specified aprs-is filter for this connection
        """
        arg_0.filter = arg_1

        arg_0.logger.info("Setting filter to: %s", arg_0.filter)

        if arg_0._connected:
            arg_0._sendall("#filter %s\r\n" % arg_0.filter)

Set a specified aprs - is filter for this connection


(self, n=None, frac=None, replace=False, weights=None, random_state=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = None , arg_5 = None ) : arg_0 = arg_0 . extract ( ) if type ( arg_5 ) == int or arg_5 is None : arg_5 = np . random . RandomState ( seed = arg_5 ) if arg_1 is None and arg_2 is None : arg_1 = 1 elif arg_2 is not None : arg_1 = int ( round ( arg_2 * len ( arg_0 ) ) ) arg_6 = None if arg_4 is not None : arg_6 = arg_0 . evaluate ( arg_4 ) arg_6 = arg_6 / arg_0 . sum ( arg_4 ) arg_7 = arg_5 . choice ( len ( arg_0 ) , arg_1 , arg_3 = arg_3 , p = arg_6 ) return arg_0 . take ( arg_7 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False, arg_4=None, arg_5=None):
        '''Returns a DataFrame with a random set of rows

        {note_copy}

        Provide either n or frac.

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df
          #  s      x
          0  a      1
          1  b      2
          2  c      3
          3  d      4
        >>> df.Func(n=2, random_state=42) # 2 random rows, fixed seed
          #  s      x
          0  b      2
          1  d      4
        >>> df.Func(frac=1, random_state=42) # 'shuffling'
          #  s      x
          0  c      3
          1  a      1
          2  d      4
          3  b      2
        >>> df.Func(frac=1, replace=True, random_state=42) # useful for bootstrap (may contain repeated Funcs)
          #  s      x
          0  d      4
          1  a      1
          2  a      1
          3  d      4

        :param int n: number of Funcs to take (default 1 if frac is None)
        :param float frac: fractional number of takes to take
        :param bool replace: If true, a row may be drawn multiple times
        :param str or expression weights: (unnormalized) probability that a row can be drawn
        :param int or RandomState: seed or RandomState for reproducability, when None a random seed it chosen
        :return: {return_shallow_copy}
        :rtype: DataFrame
        '''
        arg_0 = arg_0.extract()
        if type(arg_5) == int or arg_5 is None:
            arg_5 = np.random.RandomState(seed=arg_5)
        if arg_1 is None and arg_2 is None:
            arg_1 = 1
        elif arg_2 is not None:
            arg_1 = int(round(arg_2 * len(arg_0)))
        arg_6 = None
        if arg_4 is not None:
            arg_6 = arg_0.evaluate(arg_4)
            arg_6 = arg_6 / arg_0.sum(arg_4)
        arg_7 = arg_5.choice(len(arg_0), arg_1, arg_3=arg_3, p=arg_6)
        return arg_0.take(arg_7)

Returns a DataFrame with a random set of rows

        {note_copy}

        Provide either n or frac.

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df
          #  s      x
          0  a      1
          1  b      2
          2  c      3
          3  d      4
        >>> df.sample(n=2, random_state=42) # 2 random rows, fixed seed
          #  s      x
          0  b      2
          1  d      4
        >>> df.sample(frac=1, random_state=42) # 'shuffling'
          #  s      x
          0  c      3
          1  a      1
          2  d      4
          3  b      2
        >>> df.sample(frac=1, replace=True, random_state=42) # useful for bootstrap (may contain repeated samples)
          #  s      x
          0  d      4
          1  a      1
          2  a      1
          3  d      4

        :param int n: number of samples to take (default 1 if frac is None)
        :param float frac: fractional number of takes to take
        :param bool replace: If true, a row may be drawn multiple times
        :param str or expression weights: (unnormalized) probability that a row can be drawn
        :param int or RandomState: seed or RandomState for reproducability, when None a random seed it chosen
        :return: {return_shallow_copy}
        :rtype: DataFrame


def Func ( arg_0 ) : arg_1 = get_namespace ( arg_0 , 'w' ) arg_2 = arg_0 . find ( '%srPr' % arg_1 ) if arg_2 is None : return False arg_3 = arg_2 . find ( '%si' % arg_1 ) return style_is_false ( arg_3 )

def Func(arg_0):
    """
    The function will return True if the r tag passed in is considered
    italicized.
    """
    arg_1 = get_namespace(arg_0, 'w')
    arg_2 = arg_0.find('%srPr' % arg_1)
    if arg_2 is None:
        return False
    arg_3 = arg_2.find('%si' % arg_1)
    return style_is_false(arg_3)

The function will return True if the r tag passed in is considered italicized .


return [event.message for event in instance_view.events]

def Func(arg_0, arg_1, arg_2):
        """
        Get the messages of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :return: A list of the event messages
        :rtype: list[str]
        """
        arg_3 = arg_0._get_instance_view(arg_1, arg_2)

        return [arg_4.message for arg_4 in arg_3.events]


def Func(arg_0, arg_1, arg_2=None):
    """
    Connect 1D vector signal to this structuralized interface

    :param packedSrc: vector which should be connected
    :param dstInterface: structuralized interface where should
        packedSrc be connected to
    :param exclude: sub interfaces of self which should be excluded
    """
    arg_3 = 0
    arg_4 = []
    for arg_5 in reversed(list(walkPhysInterfaces(arg_1))):
        if arg_2 is not None and arg_5 in arg_2:
            continue
        arg_6 = arg_5._sig
        arg_7 = arg_6._dtype
        if arg_7 == BIT:
            arg_8 = arg_0[arg_3]
            arg_3 += 1
        else:
            arg_9 = arg_7.bit_length()
            arg_8 = arg_0[(arg_9 + arg_3): arg_3]
            arg_3 += arg_9
        arg_4.append(arg_6(arg_8))

    return arg_4


def Func ( arg_0 , arg_1 : arg_2 ) -> Optional [ Argument ] : return Func ( arg_1 , reversed ( arg_0 . arguments ) )

def Func(arg_0, arg_1: arg_2) -> Optional[Argument]:
        """Return the last argument with the given name.

        Return None if no argument with that name is found.
        """
        return Func(arg_1, reversed(arg_0.arguments))

Return the last argument with the given name .


def Func ( arg_0 ) : arg_1 = np . median ( arg_0 . data . squeeze ( ) , axis = 0 ) arg_0 . data = arg_0 . data / arg_1

def Func(arg_0):
        """ One way to calibrate the band pass is to take the median value
            for every frequency fine channel, and divide by it.
        """

        arg_1 = np.median(arg_0.data.squeeze(),axis=0)
        arg_0.data = arg_0.data/arg_1

One way to calibrate the band pass is to take the median value for every frequency fine channel and divide by it .


return [self.mpiexec, '-n', str(ncores)]

def Func(arg_0, *arg_1, **arg_2):
        """Return a list of the mpi command portion of the commandline.

        Only allows primitive mpi at the moment:
           *mpiexec* -n *ncores* *mdrun* *mdrun-args*

        (This is a primitive example for OpenMP. Override it for more
        complicated cases.)
        """
        if arg_0.mpiexec is None:
            raise NotImplementedError("Override mpiexec to enable the simple OpenMP launcher")
        # example implementation
        arg_3 = arg_2.pop('ncores', 8)
        return [arg_0.mpiexec, '-n', str(arg_3)]

Return a list of the mpi command portion of the commandline .


(returns, factor_returns=None, positions=None,
                    transactions=None, turnover_denom='AGB',
                    live_start_date=None, bootstrap=False,
                    header_rows=None)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
arg_4
=
'AGB'
,
arg_5
=
,
arg_6
=
False
,
arg_7
=
)
:
if
arg_6
:
arg_8
=
timeseries
.
perf_stats_bootstrap
else
:
arg_8
=
timeseries
.
perf_stats
arg_9
=
arg_8
(
arg_0
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
)
arg_10
=
OrderedDict
(
)
if
len
(
arg_0
.
index
)
>
0
:
arg_10
[
'Start date'
]
=
arg_0
.
index
[
0
]
.
strftime
(
'%Y-%m-%d'
)
arg_10
[
'End date'
]
=
arg_0
.
index
[
1
]
.
strftime
(
'%Y-%m-%d'
)
if
arg_5
is
not
:
arg_5
=
ep
.
utils
.
get_utc_timestamp
(
arg_5
)
arg_11
=
arg_0
[
arg_0
.
index
<
arg_5
]
arg_12
=
arg_0
[
arg_0
.
index
>=
arg_5
]
arg_13
=
arg_14
=
arg_15
=
arg_16
=
if
arg_2
is
not
:
arg_13
=
arg_2
[
arg_2
.
index
<
arg_5
]
arg_14
=
arg_2
[
arg_2
.
index
>=
arg_5
]
if
arg_3
is
not
:
arg_15
=
arg_3
[
(
arg_3
.
index
<
arg_5
)
]
arg_16
=
arg_3
[
(
arg_3
.
index
>
arg_5
)
]
arg_17
=
arg_8
(
arg_11
,
arg_1
=
arg_1
,
arg_2
=
arg_13
,
arg_3
=
arg_15
,
arg_4
=
arg_4
)
arg_18
=
arg_8
(
arg_12
,
arg_1
=
arg_1
,
arg_2
=
arg_14
,
arg_3
=
arg_16
,
arg_4
=
arg_4
)
if
len
(
arg_0
.
index
)
>
0
:
arg_10
[
'In-sample months'
]
=
int
(
len
(
arg_11
)
/
APPROX_BDAYS_PER_MONTH
)
arg_10
[
'Out-of-sample months'
]
=
int
(
len
(
arg_12
)
/
APPROX_BDAYS_PER_MONTH
)
arg_19
=
pd
.
concat
(
OrderedDict
(
[
(
'In-sample'
,
arg_17
)
,
(
'Out-of-sample'
,
arg_18
)
,
(
'All'
,
arg_9
)
,
]
)
,
axis
=
1
)
else
:
if
len
(
arg_0
.
index
)
>
0
:
arg_10
[
'Total months'
]
=
int
(
len
(
arg_0
)
/
APPROX_BDAYS_PER_MONTH
)
arg_19
=
pd
.
DataFrame
(
arg_9
,
columns
=
[
'Backtest'
]
)
for
arg_20
in
arg_19
.
columns
:
for
arg_21
,
arg_22
in
arg_19
[
arg_20
]
.
iteritems
(
)
:
if
arg_21
in
STAT_FUNCS_PCT
:
arg_19
.
loc
[
arg_21
,
arg_20
]
=
str
(
np
.
round
(
arg_22
*
100
,
1
)
)
+
'%'
if
arg_7
is
:
arg_7
=
arg_10
else
:
arg_7
=
OrderedDict
(
arg_7
)
arg_7
.
update
(
arg_10
)
utils
.
print_table
(
arg_19
,
float_format
=
'{0:.2f}'
.
format
,
arg_7
=
arg_7
,
)

def Func(arg_0, arg_1=None, arg_2=None,
                    arg_3=None, arg_4='AGB',
                    arg_5=None, arg_6=False,
                    arg_7=None):
    """
    Prints some performance metrics of the strategy.

    - Shows amount of time the strategy has been run in backtest and
      out-of-sample (in live trading).

    - Shows Omega ratio, max drawdown, Calmar ratio, annual return,
      stability, Sharpe ratio, annual volatility, alpha, and beta.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    factor_returns : pd.Series, optional
        Daily noncumulative returns of the benchmark factor to which betas are
        computed. Usually a benchmark such as market returns.
         - This is in the same style as returns.
    positions : pd.DataFrame, optional
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    transactions : pd.DataFrame, optional
        Prices and amounts of executed trades. One row per trade.
        - See full explanation in tears.create_full_tear_sheet
    turnover_denom : str, optional
        Either AGB or portfolio_value, default AGB.
        - See full explanation in txn.get_turnover.
    live_start_date : datetime, optional
        The point in time when the strategy began live trading, after
        its backtest period.
    bootstrap : boolean, optional
        Whether to perform bootstrap analysis for the performance
        metrics.
         - For more information, see timeseries.perf_stats_bootstrap
    header_rows : dict or OrderedDict, optional
        Extra rows to display at the top of the displayed table.
    """

    if arg_6:
        arg_8 = timeseries.perf_stats_bootstrap
    else:
        arg_8 = timeseries.perf_stats

    arg_9 = arg_8(
        arg_0,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4)

    arg_10 = OrderedDict()
    if len(arg_0.index) > 0:
        arg_10['Start date'] = arg_0.index[0].strftime('%Y-%m-%d')
        arg_10['End date'] = arg_0.index[-1].strftime('%Y-%m-%d')

    if arg_5 is not None:
        arg_5 = ep.utils.get_utc_timestamp(arg_5)
        arg_11 = arg_0[arg_0.index < arg_5]
        arg_12 = arg_0[arg_0.index >= arg_5]

        arg_13 = None
        arg_14 = None
        arg_15 = None
        arg_16 = None

        if arg_2 is not None:
            arg_13 = arg_2[arg_2.index < arg_5]
            arg_14 = arg_2[arg_2.index >= arg_5]
            if arg_3 is not None:
                arg_15 = arg_3[(arg_3.index <
                                                arg_5)]
                arg_16 = arg_3[(arg_3.index >
                                                 arg_5)]

        arg_17 = arg_8(
            arg_11,
            arg_1=arg_1,
            arg_2=arg_13,
            arg_3=arg_15,
            arg_4=arg_4)

        arg_18 = arg_8(
            arg_12,
            arg_1=arg_1,
            arg_2=arg_14,
            arg_3=arg_16,
            arg_4=arg_4)
        if len(arg_0.index) > 0:
            arg_10['In-sample months'] = int(len(arg_11) /
                                                APPROX_BDAYS_PER_MONTH)
            arg_10['Out-of-sample months'] = int(len(arg_12) /
                                                    APPROX_BDAYS_PER_MONTH)

        arg_19 = pd.concat(OrderedDict([
            ('In-sample', arg_17),
            ('Out-of-sample', arg_18),
            ('All', arg_9),
        ]), axis=1)
    else:
        if len(arg_0.index) > 0:
            arg_10['Total months'] = int(len(arg_0) /
                                            APPROX_BDAYS_PER_MONTH)
        arg_19 = pd.DataFrame(arg_9, columns=['Backtest'])

    for arg_20 in arg_19.columns:
        for arg_21, arg_22 in arg_19[arg_20].iteritems():
            if arg_21 in STAT_FUNCS_PCT:
                arg_19.loc[arg_21, arg_20] = str(np.round(arg_22 * 100,
                                                            1)) + '%'
    if arg_7 is None:
        arg_7 = arg_10
    else:
        arg_7 = OrderedDict(arg_7)
        arg_7.update(arg_10)

    utils.print_table(
        arg_19,
        float_format='{0:.2f}'.format,
        arg_7=arg_7,
    )

Prints some performance metrics of the strategy .


def Func ( arg_0 , arg_1 ) : arg_2 = list ( ) for arg_3 in arg_0 . level . action_spec ( ) : if arg_3 [ 'min' ] == - 1 and arg_3 [ 'max' ] == 1 : arg_2 . append ( arg_1 [ arg_3 [ 'name' ] ] - 1 ) else : arg_2 . append ( arg_1 [ arg_3 [ 'name' ] ] ) arg_1 = np . array ( arg_2 , dtype = np . intc ) arg_4 = arg_0 . level . step ( arg_1 = arg_1 , num_steps = arg_0 . repeat_action ) arg_5 = arg_0 . level . observations ( ) [ 'RGB_INTERLACED' ] arg_6 = not arg_0 . level . is_running ( ) return arg_5 , arg_6 , arg_4

def Func(arg_0, arg_1):
        """
        Pass action to universe environment, return reward, next step, terminal state and
        additional info.

        :param action: action to Func as numpy array, should have dtype np.intc and should adhere to
            the specification given in DeepMindLabEnvironment.action_spec(level_id)
        :return: dict containing the next state, the reward, and a boolean indicating if the
            next state is a terminal state
        """
        arg_2 = list()
        for arg_3 in arg_0.level.action_spec():
            if arg_3['min'] == -1 and arg_3['max'] == 1:
                arg_2.append(arg_1[arg_3['name']] - 1)
            else:
                arg_2.append(arg_1[arg_3['name']])  # clip?
        arg_1 = np.array(arg_2, dtype=np.intc)

        arg_4 = arg_0.level.step(arg_1=arg_1, num_steps=arg_0.repeat_action)
        arg_5 = arg_0.level.observations()['RGB_INTERLACED']
        arg_6 = not arg_0.level.is_running()
        return arg_5, arg_6, arg_4

Pass action to universe environment, return reward, next step, terminal state and
        additional info.

        :param action: action to execute as numpy array, should have dtype np.intc and should adhere to
            the specification given in DeepMindLabEnvironment.action_spec(level_id)
        :return: dict containing the next state, the reward, and a boolean indicating if the
            next state is a terminal state

Pass action to universe environment return reward next step terminal state and additional info .


def Func(arg_0, arg_1, arg_2):
    """Every other row is indexed in reverse."""
    if arg_1 % 2:
        return arg_2.columns - 1 - arg_0, arg_1
    return arg_0, arg_1


def Func ( ) : with codecs . open ( os . path . join ( HERE , 'README.rst' ) , encoding = 'utf-8' ) as f : arg_0 = f . read ( ) return arg_0

def Func():
    """Get the long_description from the README.rst file. Assume UTF-8 encoding."""
    with codecs.open(os.path.join(HERE, 'README.rst'), encoding='utf-8') as f:
        arg_0 = f.read()
    return arg_0

Get the long_description from the README . rst file . Assume UTF - 8 encoding .


(self, roomId, title=None, **request_parameters)

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Update details for a room, by ID.

        Args:
            roomId(basestring): The room ID.
            title(basestring): A user-friendly name for the room.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Room: A Room object with the Funcd Webex Teams room details.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring, may_be_none=False)
        check_type(arg_1, basestring)

        arg_4 = dict_from_items_with_values(
            arg_3,
            arg_2=arg_2,
        )

        # API request
        arg_5 = arg_0._session.put(API_ENDPOINT + '/' + arg_1,
                                      json=arg_4)

        # Return a room object created from the response JSON data
        return arg_0._object_factory(OBJECT_TYPE, arg_5)

Update details for a room, by ID.

        Args:
            roomId(basestring): The room ID.
            title(basestring): A user-friendly name for the room.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Room: A Room object with the updated Webex Teams room details.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_1 : return '' if len ( arg_1 ) > arg_2 : return arg_1 [ : arg_2 - 3 ] + '...' return arg_1

def Func(arg_0, arg_1, arg_2):
    """Return a value for display; if longer than max length, use ellipsis."""
    if not arg_1:
      return ''
    if len(arg_1) > arg_2:
      return arg_1[:arg_2 - 3] + '...'
    return arg_1

Return a value for display ; if longer than max length use ellipsis .


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
Observation
)
:
raise
JamsError
(
'{} must be of type jams.Observation'
.
format
(
arg_1
)
)
return
arg_1
.
time

def Func(arg_0, arg_1):
        '''Provides sorting index for Observation objects'''
        if not isinstance(arg_1, Observation):
            raise JamsError('{} must be of type jams.Observation'.format(arg_1))

        return arg_1.time


Print a status of all jobs currently being managed.

def Func ( arg_0 , arg_1 = 0 ) : arg_0 . _update_Func ( ) arg_0 . _group_report ( arg_0 . running , 'Running' ) arg_0 . _group_report ( arg_0 . completed , 'Completed' ) arg_0 . _group_report ( arg_0 . dead , 'Dead' ) arg_0 . _comp_report [ : ] = [ ] arg_0 . _dead_report [ : ] = [ ]

def Func(arg_0,arg_1=0):
        """Print a Func of all jobs currently being managed."""

        arg_0._update_Func()
        arg_0._group_report(arg_0.running,'Running')
        arg_0._group_report(arg_0.completed,'Completed')
        arg_0._group_report(arg_0.dead,'Dead')
        # Also flush the report queues
        arg_0._comp_report[:] = []
        arg_0._dead_report[:] = []

Print a status of all jobs currently being managed .


def Func ( arg_0 ) : for arg_1 in arg_0 . get_ticklines ( ) + arg_0 . get_ticklabels ( ) : arg_1 . set_visible ( False )

def Func(arg_0):
    """
    Set visible property of ticklines and ticklabels of an axis to False
    """
    for arg_1 in arg_0.get_ticklines() + arg_0.get_ticklabels():
        arg_1.set_visible(False)


def
Func
(
arg_0
)
:
if
hasattr
(
arg_0
,
'__getattr__'
)
:
raise
TypeError
(
'__getattr__ already defined'
)
arg_0
.
__getattr__
=
_prfx_getattr_
arg_0
.
__setattr__
=
_prfx_setattr_
return
arg_0

def Func(arg_0):
    """Decorate that adds the prefix naming scheme"""
    if hasattr(arg_0, '__getattr__'):
        raise TypeError('__getattr__ already defined')
    arg_0.__getattr__ = _prfx_getattr_
    arg_0.__setattr__ = _prfx_setattr_
    return arg_0


return (
            min(len(concat_comp), len(concat_comp2))
            - min(len(src_comp), len(tar_comp))
        ) / max(len(src_comp), len(tar_comp))

def Func(arg_0, arg_1, arg_2):
        """Return the NCD between two strings using LZMA compression.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Compression Funcance

        Raises
        ------
        ValueError
            Install the PylibLZMA module in order to use LZMA

        Examples
        --------
        >>> cmp = NCDlzma()
        >>> cmp.Func('cat', 'hat')
        0.08695652173913043
        >>> cmp.Func('Niall', 'Neil')
        0.16
        >>> cmp.Func('aluminum', 'Catalan')
        0.16
        >>> cmp.Func('ATCG', 'TAGC')
        0.08695652173913043

        """
        if arg_1 == arg_2:
            return 0.0

        arg_1 = arg_1.encode('utf-8')
        arg_2 = arg_2.encode('utf-8')

        if lzma is not None:
            arg_3 = lzma.compress(arg_1)[14:]
            arg_4 = lzma.compress(arg_2)[14:]
            arg_5 = lzma.compress(arg_1 + arg_2)[14:]
            arg_6 = lzma.compress(arg_2 + arg_1)[14:]
        else:  # pragma: no cover
            raise ValueError(
                'Install the PylibLZMA module in order to use LZMA'
            )

        return (
            min(len(arg_5), len(arg_6))
            - min(len(arg_3), len(arg_4))
        ) / max(len(arg_3), len(arg_4))

Return the NCD between two strings using LZMA compression.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Compression distance

        Raises
        ------
        ValueError
            Install the PylibLZMA module in order to use LZMA

        Examples
        --------
        >>> cmp = NCDlzma()
        >>> cmp.dist('cat', 'hat')
        0.08695652173913043
        >>> cmp.dist('Niall', 'Neil')
        0.16
        >>> cmp.dist('aluminum', 'Catalan')
        0.16
        >>> cmp.dist('ATCG', 'TAGC')
        0.08695652173913043

Return the NCD between two strings using LZMA compression .


Update the chart's dataset, can be two dimensional or contain string data

def Func(arg_0, arg_1, arg_2=''):
        """
        Update the chart's Func, can be two dimensional or contain string data
        """
        arg_0._Func = arg_1
        arg_0._series = arg_2
        return arg_0

Update the chart s dataset can be two dimensional or contain string data


def Func ( arg_0 ) : if arg_0 . default_file : arg_0 . Func_default_config ( ) return arg_0 . Func_config_files ( arg_0 . all_config_files ( ) )

def Func(arg_0):
        """Read the default, additional, system, and user config files.

        :raises DefaultConfigValidationError: There was a validation error with
                                              the *default* file.
        """
        if arg_0.default_file:
            arg_0.Func_default_config()
        return arg_0.Func_config_files(arg_0.all_config_files())

Read the default additional system and user config files .


def Func(arg_0):
    """Translate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    """

    arg_1, arg_2 = 0, len(arg_0)
    arg_3 = ''
    while arg_1 < arg_2:
        arg_4 = arg_0[arg_1]
        arg_1 = arg_1+1
        if arg_4 == '*':
            arg_3 = arg_3 + '.*'
        elif arg_4 == '?':
            arg_3 = arg_3 + '.'
        elif arg_4 == '[':
            arg_5 = arg_1
            if arg_5 < arg_2 and arg_0[arg_5] == '!':
                arg_5 = arg_5+1
            if arg_5 < arg_2 and arg_0[arg_5] == ']':
                arg_5 = arg_5+1
            while arg_5 < arg_2 and arg_0[arg_5] != ']':
                arg_5 = arg_5+1
            if arg_5 >= arg_2:
                arg_3 = arg_3 + '\\['
            else:
                arg_6 = arg_0[arg_1:arg_5].replace('\\','\\\\')
                arg_1 = arg_5+1
                if arg_6[0] == '!':
                    arg_6 = '^' + arg_6[1:]
                elif arg_6[0] == '^':
                    arg_6 = '\\' + arg_6
                arg_3 = '%s[%s]' % (arg_3, arg_6)
        else:
            arg_3 = arg_3 + re.escape(arg_4)
    return arg_3 + '\Z(?ms)'

Translate a shell PATTERN to a regular expression .


return [unit_elapsed, unit_avg, unit_estEnd]


def Func ( arg_0 , arg_1 = arg_2 . curdir ) : for arg_4 , arg_5 , arg_6 in arg_2 . walk ( arg_2 . path . abspath ( arg_1 ) ) : for arg_7 in fnmatch . filter ( arg_6 , arg_0 ) : yield arg_2 . path . join ( arg_4 , arg_7 )

def Func(arg_0, arg_1=arg_2.curdir):
    """Locate all files matching supplied filename pattern recursively."""
    for arg_4, arg_5, arg_6 in arg_2.walk(arg_2.path.abspath(arg_1)):
        for arg_7 in fnmatch.filter(arg_6, arg_0):
            yield arg_2.path.join(arg_4, arg_7)

Locate all files matching supplied filename pattern recursively .


def Func():
    """
    Illustrate what the various input flags are and the options should be.

    :return: none
    """
    global g_script_name    # name of the script being run.

    print("")
    print("Usage:  " + g_script_name + " [...options...]")
    print("")
    print("     --help print out this help menu and show all the valid flags and inputs.")
    print("")
    print("    --inputfileadd filename where the new java messages to ignore are stored in.")
    print("")
    print("    --inputfilerm filename where the java messages are removed from the ignored list.")
    print("")
    print("    --loadjavamessage filename pickle file that stores the dict structure containing java messages to include.")
    print("")
    print("    --savejavamessage filename pickle file that saves the final dict structure after update.")
    print("")
    print("    --printjavamessage filename print java ignored java messages stored in pickle file filenam onto console and save into a text file.")
    print("")
    sys.exit(1)

Illustrate what the various input flags are and the options should be .


Returns just the timestamp portion of the datapoints as a list.
        The timestamps are in python datetime's date format.

return list(map(lambda x: datetime.datetime.fromtimestamp(x["t"]), self.raw()))

def Func ( arg_0 ) : reFuncurn lisFunc ( map ( lambda x : daFunceFuncime . daFunceFuncime . fromFuncimesFuncamp ( x [ "Func" ] ) , arg_0 . raw ( ) ) )

def Func(arg_0):
        """ReFuncurns jusFunc Funche FuncimesFuncamp porFuncion of Funche daFuncapoinFuncs as a lisFunc.
        The FuncimesFuncamps are in pyFunchon daFunceFuncime's daFunce formaFunc."""
        reFuncurn lisFunc(map(lambda x: daFunceFuncime.daFunceFuncime.fromFuncimesFuncamp(x["Func"]), arg_0.raw()))

Returns just the timestamp portion of the datapoints as a list . The timestamps are in python datetime s date format .


def Func(arg_0):
    """
    parse the arguments referring to the GTR model and return a GTR structure
    """
    arg_1 = arg_0.gtr
    arg_2 = arg_0.gtr_params
    if arg_1 == 'infer':
        arg_3 = GTR.standard('jc', alphabet='aa' if arg_0.aa else 'nuc')
    else:
        try:
            arg_4 = {}
            if arg_2 is not None:
                for arg_5 in arg_2:
                    arg_6 = arg_5.split('=')
                    if len(arg_6)!=2: continue
                    if arg_6[0] in ['pis', 'pi', 'Pi', 'Pis']:
                        arg_6[0] = 'pi'
                        arg_6[1] = list(map(float, arg_6[1].split(',')))
                    elif arg_6[0] not in ['alphabet']:
                        arg_6[1] = float(arg_6[1])
                    arg_4[arg_6[0]] = arg_6[1]
            else:
                print ("GTR params are not specified. Creating GTR model with default parameters")

            arg_3 = GTR.standard(arg_1, **arg_4)
            arg_7 = False
        except:
            print ("Could not create GTR model from input arguments. Using default (Jukes-Cantor 1969)")
            arg_3 = GTR.standard('jc', alphabet='aa' if arg_0.aa else 'nuc')
            arg_7 = False
    return arg_3


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = arg_0 . getSchema ( ) if arg_2 : arg_4 = arg_3 . read_packed ( arg_1 ) else : arg_4 = arg_3 . read ( arg_1 ) return arg_0 . read ( arg_4 )

def Func(arg_0, arg_1, arg_2=True):
    """
    Read serialized object from file.

    :param f: input file
    :param packed: If true, will assume content is packed
    :return: first-class instance initialized from proto obj
    """
    # Get capnproto schema from instance
    arg_3 = arg_0.getSchema()

    # Read from file
    if arg_2:
      arg_4 = arg_3.read_packed(arg_1)
    else:
      arg_4 = arg_3.read(arg_1)

    # Return first-class instance initialized from proto obj
    return arg_0.read(arg_4)


return render(request, 'happenings/event_comments.html', {
        "event": event,
        "comment_list": comments,
        "object_list": comments,
        "page_obj": comments,
        "page": page,
        "is_paginated": is_paginated,
        "key": key
    })

def Func ( arg_0 , arg_1 ) : arg_2 = get_object_or_404 ( Event , arg_1 = arg_1 ) arg_3 = arg_2 . all_comments arg_4 = int ( arg_0 . GET . get ( 'page' , 99999 ) ) arg_5 = False if arg_3 : arg_6 = Paginator ( arg_3 , 50 ) try : arg_3 = arg_6 . page ( arg_4 ) except EmptyPage : arg_3 = arg_6 . page ( arg_6 . num_pages ) arg_5 = arg_3 . has_other_pages ( ) return render ( arg_0 , 'happenings/event_comments.html' , { "event" : arg_2 , "comment_list" : arg_3 , "object_list" : arg_3 , "page_obj" : arg_3 , "page" : arg_4 , "is_paginated" : arg_5 , "key" : key } )

def Func(arg_0, arg_1):
    """
    Returns a list view of all comments for a given event.
    Combines event comments and update comments in one list.
    """
    arg_2 = get_object_or_404(Event, arg_1=arg_1)
    arg_3 = arg_2.all_comments
    arg_4 = int(arg_0.GET.get('page', 99999))  # feed empty page by default to push to last page
    arg_5 = False
    if arg_3:
        arg_6 = Paginator(arg_3, 50)  # Show 50 comments per page
        try:
            arg_3 = arg_6.page(arg_4)
        except EmptyPage:
            # If page is out of range (e.g. 9999), deliver last page of results.
            arg_3 = arg_6.page(arg_6.num_pages)
        arg_5 = arg_3.has_other_pages()

    return render(arg_0, 'happenings/event_comments.html', {
        "event": arg_2,
        "comment_list": arg_3,
        "object_list": arg_3,
        "page_obj": arg_3,
        "page": arg_4,
        "is_paginated": arg_5,
        "key": key
    })

Returns a list view of all comments for a given event . Combines event comments and update comments in one list .


def
Func
(
arg_0
)
:
@
wraps
(
arg_0
)
def
wrapper
(
arg_1
,
*
arg_2
,
**
arg_3
)
:
arg_4
=
arg_0
(
arg_1
,
*
arg_2
,
**
arg_3
)
arg_1
.
log
.
append
(
arg_0
.
__name__
+
' :: args={} kwargs={}'
.
format
(
arg_2
,
arg_3
)
)
return
arg_4
return
wrapper

def Func(arg_0):
    """
    Function for logging method calls and parameters
    """
    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        arg_4 = arg_0(arg_1, *arg_2, **arg_3)
        arg_1.log.append(arg_0.__name__ + ' :: args={} kwargs={}'.format(arg_2, arg_3))
        return arg_4
    return wrapper


(self, filename, tpm=True, grp_wise=False, reorder='as-is', notes=None)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False , arg_4 = 'as-is' , arg_5 = None ) : if arg_3 : arg_6 = arg_0 . probability . gname arg_7 = arg_0 . allelic_expression * arg_0 . grp_conv_mat else : arg_6 = arg_0 . probability . lname arg_7 = arg_0 . allelic_expression if arg_2 : arg_7 *= ( 1000000.0 / arg_7 . sum ( ) ) arg_8 = arg_7 . sum ( axis = 0 ) if arg_4 == 'decreasing' : arg_9 = np . argsort ( arg_8 . flatten ( ) ) arg_9 = arg_9 [ : : - 1 ] elif arg_4 == 'increasing' : arg_9 = np . argsort ( arg_8 . flatten ( ) ) elif arg_4 == 'as-is' : arg_9 = np . arange ( len ( arg_6 ) ) arg_10 = np . vstack ( ( arg_7 , arg_8 ) ) arg_11 = open ( arg_1 , 'w' ) arg_11 . write ( "locus\t" + "\t" . join ( arg_0 . probability . hname ) + "\ttotal" ) if arg_5 is not None : arg_11 . write ( "\tnotes" ) arg_11 . write ( "\n" ) for arg_12 in arg_9 : arg_13 = arg_6 [ arg_12 ] arg_11 . write ( "\t" . join ( [ arg_13 ] + map ( str , arg_10 [ : , arg_12 ] . ravel ( ) ) ) ) if arg_5 is not None : arg_11 . write ( "\t%s" % arg_5 [ arg_13 ] ) arg_11 . write ( "\n" ) arg_11 . close ( )

def Func(arg_0, arg_1, arg_2=True, arg_3=False, arg_4='as-is', arg_5=None):
        """
        Exports expected depths

        :param filename: File name for output
        :param grp_wise: whether the report is at isoform level or gene level
        :param reorder: whether the report should be either 'decreasing' or 'increasing' order or just 'as-is'
        :return: Nothing but the method writes a file
        """
        if arg_3:
            arg_6 = arg_0.probability.gname
            arg_7 = arg_0.allelic_expression * arg_0.grp_conv_mat
        else:
            arg_6 = arg_0.probability.lname
            arg_7 = arg_0.allelic_expression
        if arg_2:
            arg_7 *= (1000000.0 / arg_7.sum())
        arg_8 = arg_7.sum(axis=0)
        if arg_4 == 'decreasing':
            arg_9 = np.argsort(arg_8.flatten())
            arg_9 = arg_9[::-1]
        elif arg_4 == 'increasing':
            arg_9 = np.argsort(arg_8.flatten())
        elif arg_4 == 'as-is':
            arg_9 = np.arange(len(arg_6))  # report in the original locus order
        arg_10 = np.vstack((arg_7, arg_8))
        arg_11 = open(arg_1, 'w')
        arg_11.write("locus\t" + "\t".join(arg_0.probability.hname) + "\ttotal")
        if arg_5 is not None:
            arg_11.write("\tnotes")
        arg_11.write("\n")
        for arg_12 in arg_9:
            arg_13 = arg_6[arg_12]
            arg_11.write("\t".join([arg_13] + map(str, arg_10[:, arg_12].ravel())))
            if arg_5 is not None:
                arg_11.write("\t%s" % arg_5[arg_13])
            arg_11.write("\n")
        arg_11.close()


(
    port, adr, data_name, pNoteAttrib, callback, user_handle=None
)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
=
)
:
global
arg_21
if
NOTEFUNC
is
:
raise
TypeError
(
"Callback function type can't be None"
)
arg_6
=
_adsDLL
.
AdsSyncAddDeviceNotificationReqEx
arg_7
=
ctypes
.
pointer
(
arg_1
.
amsAddrStruct
(
)
)
arg_8
=
adsSyncReadWriteReqEx2
(
arg_0
,
arg_1
,
ADSIGRP_SYM_HNDBYNAME
,
0x0
,
PLCTYPE_UDINT
,
arg_2
,
PLCTYPE_STRING
)
arg_9
=
ctypes
.
c_ulong
(
ADSIGRP_SYM_VALBYHND
)
arg_10
=
ctypes
.
c_ulong
(
arg_8
)
arg_11
=
arg_3
.
notificationAttribStruct
(
)
arg_12
=
ctypes
.
c_ulong
(
)
arg_13
=
ctypes
.
c_ulong
(
arg_8
)
if
arg_5
is
not
:
arg_13
=
ctypes
.
c_ulong
(
arg_5
)
arg_6
.
argtypes
=
[
ctypes
.
c_ulong
,
ctypes
.
POINTER
(
SAmsAddr
)
,
ctypes
.
c_ulong
,
ctypes
.
c_ulong
,
ctypes
.
POINTER
(
SAdsNotificationAttrib
)
,
NOTEFUNC
,
ctypes
.
c_ulong
,
ctypes
.
POINTER
(
ctypes
.
c_ulong
)
,
]
arg_6
.
restype
=
ctypes
.
c_long
def
wrapper
(
arg_16
,
arg_17
,
arg_18
)
:
return
arg_4
(
arg_17
,
arg_2
)
arg_19
=
NOTEFUNC
(
wrapper
)
arg_20
=
arg_6
(
arg_0
,
arg_7
,
arg_9
,
arg_10
,
ctypes
.
byref
(
arg_11
)
,
arg_19
,
arg_13
,
ctypes
.
byref
(
arg_12
)
,
)
if
arg_20
:
raise
ADSError
(
arg_20
)
arg_21
[
arg_12
.
value
]
=
arg_19
return
(
arg_12
.
value
,
arg_8
)

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None
):
    # type: (int, AmsAddr, str, NotificationAttrib, Callable, int) -> Tuple[int, int]
    """Add a device notification.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr adr: local or remote AmsAddr
    :param string data_name: PLC storage address
    :param pyads.structs.NotificationAttrib pNoteAttrib: notification attributes
    :param callback: Callback function to handle notification
    :param user_handle: User Handle
    :rtype: (int, int)
    :returns: notification handle, user handle

    """
    global arg_21

    if NOTEFUNC is None:
        raise TypeError("Callback function type can't be None")

    arg_6 = _adsDLL.AdsSyncAddDeviceNotificationReqEx

    arg_7 = ctypes.pointer(arg_1.amsAddrStruct())
    arg_8 = adsSyncReadWriteReqEx2(
        arg_0, arg_1, ADSIGRP_SYM_HNDBYNAME, 0x0, PLCTYPE_UDINT, arg_2, PLCTYPE_STRING
    )

    arg_9 = ctypes.c_ulong(ADSIGRP_SYM_VALBYHND)
    arg_10 = ctypes.c_ulong(arg_8)
    arg_11 = arg_3.notificationAttribStruct()
    arg_12 = ctypes.c_ulong()

    arg_13 = ctypes.c_ulong(arg_8)
    if arg_5 is not None:
        arg_13 = ctypes.c_ulong(arg_5)

    arg_6.argtypes = [
        ctypes.c_ulong,
        ctypes.POINTER(SAmsAddr),
        ctypes.c_ulong,
        ctypes.c_ulong,
        ctypes.POINTER(SAdsNotificationAttrib),
        NOTEFUNC,
        ctypes.c_ulong,
        ctypes.POINTER(ctypes.c_ulong),
    ]
    arg_6.restype = ctypes.c_long

    def wrapper(arg_16, arg_17, arg_18):
        # type: (AmsAddr, SAdsNotificationHeader, int) -> Callable[[SAdsNotificationHeader, str], None]
        return arg_4(arg_17, arg_2)

    arg_19 = NOTEFUNC(wrapper)
    arg_20 = arg_6(
        arg_0,
        arg_7,
        arg_9,
        arg_10,
        ctypes.byref(arg_11),
        arg_19,
        arg_13,
        ctypes.byref(arg_12),
    )

    if arg_20:
        raise ADSError(arg_20)
    arg_21[arg_12.value] = arg_19
    return (arg_12.value, arg_8)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_0 . write ( * arg_1 , ** arg_2 ) arg_0 . flush ( )

def Func(arg_0, *arg_1, **arg_2):
        """Writes the passed chunk and flushes it to the client."""
        arg_0.write(*arg_1, **arg_2)
        arg_0.flush()

Writes the passed chunk and flushes it to the client .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . finditer ( arg_1 ) : arg_4 = arg_3 . end ( ) if arg_4 < len ( arg_2 ) : arg_2 [ arg_4 ] = SHOULD_SPLIT

def Func(arg_0, arg_1, arg_2):
    """
    Regex that adds a 'SHOULD_SPLIT' marker at the end
    location of each matching group of the given regex.

    Arguments
    ---------
        regex : re.Expression
        text : str, same length as split_locations
        split_locations : list<int>, split decisions.
    """
    for arg_3 in arg_0.finditer(arg_1):
        arg_4 = arg_3.end()
        if arg_4 < len(arg_2):
            arg_2[arg_4] = SHOULD_SPLIT

Regex that adds a SHOULD_SPLIT marker at the end location of each matching group of the given regex .


def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . pat . Func ( arg_1 , int ( arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        '''string is of course a py string'''
        return arg_0.pat.Func(arg_1, int(arg_2))


def Func ( arg_0 ) : arg_1 = H2OFrame . _expr ( expr = ExprNode ( "is.na" , arg_0 ) ) arg_1 . _ex . _cache . nrows = arg_0 . _ex . _cache . nrows arg_1 . _ex . _cache . ncols = arg_0 . _ex . _cache . ncols if arg_0 . _ex . _cache . names : arg_1 . _ex . _cache . names = [ "isNA(%s)" % n for n in arg_0 . _ex . _cache . names ] arg_1 . _ex . _cache . types = { "isNA(%s)" % n : "int" for n in arg_0 . _ex . _cache . names } return arg_1

def Func(arg_0):
        """
        For each element in an H2OFrame, determine if it is NA or not.

        :returns: an H2OFrame of 1s and 0s, where 1s mean the values were NAs.
        """
        arg_1 = H2OFrame._expr(expr=ExprNode("is.na", arg_0))
        arg_1._ex._cache.nrows = arg_0._ex._cache.nrows
        arg_1._ex._cache.ncols = arg_0._ex._cache.ncols
        if arg_0._ex._cache.names:
            arg_1._ex._cache.names = ["isNA(%s)" % n for n in arg_0._ex._cache.names]
            arg_1._ex._cache.types = {"isNA(%s)" % n: "int" for n in arg_0._ex._cache.names}
        return arg_1

For each element in an H2OFrame determine if it is NA or not .


(endpoint, route=None, pid_type=None, template=None,
                    permission_factory_imp=None, view_imp=None,
                    record_class=None, methods=None)

return dict(
        endpoint=endpoint,
        rule=route,
        view_func=view_func,
        methods=methods,
    )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                    arg_4=None, arg_5=None,
                    arg_6=None, arg_7=None):
    """Create Werkzeug URL rule for a specific endpoint.

    The method takes care of creating a persistent identifier resolver
    for the given persistent identifier type.

    :param endpoint: Name of endpoint.
    :param route: URL route (must include ``<pid_value>`` pattern). Required.
    :param pid_type: Persistent identifier type for endpoint. Required.
    :param template: Template to render.
        (Default: ``invenio_records_ui/detail.html``)
    :param permission_factory_imp: Import path to factory that creates a
        permission object for a given record.
    :param view_imp: Import path to view function. (Default: ``None``)
    :param record_class: Name of the record API class.
    :param methods: Method allowed for the endpoint.
    :returns: A dictionary that can be passed as keywords arguments to
        ``Blueprint.add_url_rule``.
    """
    assert arg_1
    assert arg_2

    arg_8 = import_string(arg_4) if \
        arg_4 else None
    arg_9 = import_string(arg_5) if arg_5 else default_view_method
    arg_6 = import_string(arg_6) if arg_6 else Record
    arg_7 = arg_7 or ['GET']

    arg_10 = partial(
        record_view,
        resolver=Resolver(arg_2=arg_2, object_type='rec',
                          getter=arg_6.get_record),
        arg_3=arg_3 or 'invenio_records_ui/detail.html',
        arg_8=arg_8,
        arg_9=arg_9)
    # Make view well-behaved for Flask-DebugToolbar
    arg_10.__module__ = record_view.__module__
    arg_10.__name__ = record_view.__name__

    return dict(
        arg_0=arg_0,
        rule=arg_1,
        arg_10=arg_10,
        arg_7=arg_7,
    )

Create Werkzeug URL rule for a specific endpoint .


def Func(arg_0):
        """Start collecting trace information."""
        if arg_0._collectors:
            arg_0._collectors[-1].pause()
        arg_0._collectors.append(arg_0)
        #print("Started: %r" % self._collectors, file=sys.stderr)

        # Check to see whether we had a fullcoverage tracer installed.
        arg_1 = []
        if hasattr(sys, "gettrace"):
            arg_2 = sys.gettrace()
            if arg_2:
                arg_3 = getattr(arg_2, '__self__', None)
                if arg_3:
                    arg_1 = getattr(arg_3, 'traces', [])

        # Install the tracer on this thread.
        arg_4 = arg_0._Func_tracer()

        for arg_5 in arg_1:
            (arg_6, arg_7, arg_8), arg_9 = arg_5
            try:
                arg_4(arg_6, arg_7, arg_8, arg_9=arg_9)
            except TypeError:
                raise Exception(
                    "fullcoverage must be run with the C trace function."
                )

        # Install our installation tracer in threading, to jump Func other
        # threads.
        threading.settrace(arg_0._installation_trace)


def Func(arg_0):
    """ Close the policy instance and its shared database connection. """
    arg_0._logger.info("Closing")
    if arg_0._conn is not None:
      arg_0._conn.Func()
      arg_0._conn = None
    else:
      arg_0._logger.warning(
        "Func() called, but connection policy was alredy Funcd")
    return

Close the policy instance and its shared database connection .


def Func(arg_0, **arg_1):
        """
        Get the TV credits for a specific person id.

        Args:
            language: (optional) ISO 639-1 code.
            append_to_response: (optional) Comma separated, any person method.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the TV credits for a specific person id .


(self, from_date=DEFAULT_DATETIME,
               offset=None, max_issues=MAX_ISSUES)

def Func(arg_0, arg_1=arg_2,
               arg_3=None, arg_4=arg_5):
        """Get the information of a list of Func.

        :param from_date: retrieve Func that where updated from that date;
            dates are converted to UTC
        :param offset: starting position for the search
        :param max_Func: maximum number of Func to reteurn per query
        """
        arg_6 = arg_0.RISSUES + arg_0.CJSON

        arg_7 = datetime_to_utc(arg_1)
        arg_7 = arg_7.strftime("%Y-%m-%dT%H:%M:%SZ")

        # By default, Redmine returns open Func only.
        # Parameter 'status_id' is set to get all the statuses.
        arg_8 = {
            arg_0.PSTATUS_ID: '*',
            arg_0.PSORT: arg_0.PUPDATED_ON,
            arg_0.PUPDATED_ON: '>=' + arg_7,
            arg_0.PLIMIT: arg_4
        }

        if arg_3 is not None:
            arg_8[arg_0.POFFSET] = arg_3

        arg_10 = arg_0._call(arg_6, arg_8)

        return arg_10

Get the information of a list of issues.

        :param from_date: retrieve issues that where updated from that date;
            dates are converted to UTC
        :param offset: starting position for the search
        :param max_issues: maximum number of issues to reteurn per query

Get the information of a list of issues .


def Func(arg_0, arg_1):
        '''Load a saved network from disk.

        Parameters
        ----------
        filename_or_handle : str or file handle
            Load the state of this network from a pickle file. If this parameter
            is a string, it names the file where the pickle will be saved. If it
            is a file-like object, this object will be used for reading the
            pickle. If the filename ends in ".gz" then the output will
            automatically be gunzipped.
        '''
        assert not isinstance(arg_0, Network), \
            'cannot Func an instance! say instead: net = Network.Func(source)'
        if isinstance(arg_1, util.basestring):
            arg_2 = gzip.open if arg_1.lower().endswith('.gz') else open
            arg_3 = arg_2(arg_1, 'rb')
        else:
            arg_3 = arg_1
        arg_4 = pickle.Func(arg_3)
        if isinstance(arg_1, util.basestring):
            arg_3.close()
        util.log('Funced model from {}', arg_1)
        return arg_4


def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = False ) : assert not arg_2 or not arg_3 arg_0 = arg_0 or { } arg_1 = arg_1 or { } arg_4 = set ( k for k in set ( arg_1 . iterkeys ( ) ) . intersection ( arg_0 . iterkeys ( ) ) if arg_1 [ k ] != arg_0 [ k ] ) if arg_4 and arg_2 : return True arg_5 = set ( arg_1 . iterkeys ( ) ) . difference ( arg_0 . iterkeys ( ) ) if arg_5 and arg_2 : return True if not arg_3 : arg_4 . update ( arg_5 ) arg_6 = set ( arg_0 . iterkeys ( ) ) . difference ( arg_1 . iterkeys ( ) ) if arg_6 and arg_2 : return True if arg_2 : return False if not arg_3 : arg_4 . update ( arg_6 ) if arg_3 : return arg_5 , arg_4 , arg_6 return arg_4

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
    """
    Returns a subset of the env dictionary keys that differ,
    either being added, deleted or changed between old and new.
    """

    assert not arg_2 or not arg_3

    arg_0 = arg_0 or {}
    arg_1 = arg_1 or {}

    arg_4 = set(k for k in set(arg_1.iterkeys()).intersection(arg_0.iterkeys()) if arg_1[k] != arg_0[k])
    if arg_4 and arg_2:
        return True

    arg_5 = set(arg_1.iterkeys()).difference(arg_0.iterkeys())
    if arg_5 and arg_2:
        return True
    if not arg_3:
        arg_4.update(arg_5)

    arg_6 = set(arg_0.iterkeys()).difference(arg_1.iterkeys())
    if arg_6 and arg_2:
        return True
    if arg_2:
        return False
    if not arg_3:
        arg_4.update(arg_6)

    if arg_3:
        return arg_5, arg_4, arg_6

    return arg_4

Returns a subset of the env dictionary keys that differ either being added deleted or changed between old and new .


def Func ( arg_0 : arg_1 , arg_2 : arg_3 = False ) : arg_4 = threading . BoundedSemaphore if arg_2 else threading . Semaphore arg_5 = arg_4 ( value = arg_0 ) return with_it ( arg_5 )

def Func(arg_0: arg_1, arg_2: arg_3=False):
    '''
    use `Semaphore` to keep func access thread-safety.

    example:

    ``` py
    @Func(3)
    def func(): pass
    ```
    '''

    arg_4 = threading.BoundedSemaphore if arg_2 else threading.Semaphore
    arg_5 = arg_4(value=arg_0)

    return with_it(arg_5)

use `Semaphore` to keep func access thread-safety.

    example:

    ``` py
    @semaphore(3)
    def func(): pass
    ```

use Semaphore to keep func access thread - safety .


return self._disassoc(
            self._forward_rel_name('success'), parent, child)

def Func(arg_0, arg_1, arg_2):
        """Remove success node.
        The resulatant 2 nodes will both become root nodes.

        =====API DOCS=====
        Remove success node.

        :param parent: Primary key of parent node to disassociate success node from.
        :type parent: int
        :param child: Primary key of child node to be disassociated.
        :type child: int
        :returns: Dictionary of only one key "changed", which indicates whether the disassociation succeeded.
        :rtype: dict

        =====API DOCS=====
        """
        return arg_0._disassoc(
            arg_0._forward_rel_name('success'), arg_1, arg_2)

Remove success node . The resulatant 2 nodes will both become root nodes .


def Func ( arg_0 ) : arg_0 . __update_common ( ) if arg_0 . __unknown_version == arg_0 . _V23 : arg_1 = [ ] for arg_2 in arg_0 . unknown_frames : try : arg_3 , arg_4 , arg_5 = unpack ( '>4sLH' , arg_2 [ : 10 ] ) arg_2 = BinaryFrame . fromData ( arg_0 , arg_5 , arg_2 [ 10 : ] ) except ( struct . error , error ) : continue arg_3 = arg_3 . decode ( 'ascii' ) arg_1 . append ( arg_0 . __save_frame ( arg_2 , arg_3 = arg_3 ) ) arg_0 . unknown_frames [ : ] = arg_1 arg_0 . __unknown_version = arg_0 . _V24 try : arg_8 = text_type ( arg_0 . get ( "TYER" , "" ) ) if arg_8 . strip ( u"\x00" ) : arg_0 . pop ( "TYER" ) arg_9 = text_type ( arg_0 . get ( "TDAT" , "" ) ) if arg_9 . strip ( "\x00" ) : arg_0 . pop ( "TDAT" ) arg_8 = "%s-%s-%s" % ( arg_8 , arg_9 [ 2 : ] , arg_9 [ : 2 ] ) arg_10 = text_type ( arg_0 . get ( "TIME" , "" ) ) if arg_10 . strip ( "\x00" ) : arg_0 . pop ( "TIME" ) arg_8 += "T%s:%s:00" % ( arg_10 [ : 2 ] , arg_10 [ 2 : ] ) if "TDRC" not in arg_0 : arg_0 . add ( TDRC ( encoding = 0 , text = arg_8 ) ) except UnicodeDecodeError : pass if "TORY" in arg_0 : arg_11 = arg_0 . pop ( "TORY" ) if "TDOR" not in arg_0 : try : arg_0 . add ( TDOR ( encoding = 0 , text = str ( arg_11 ) ) ) except UnicodeDecodeError : pass if "IPLS" in arg_0 : arg_11 = arg_0 . pop ( "IPLS" ) if "TIPL" not in arg_0 : arg_0 . add ( TIPL ( encoding = arg_11 . encoding , people = arg_11 . people ) ) for arg_12 in [ "RVAD" , "EQUA" , "TRDA" , "TSIZ" , "TDAT" , "TIME" , "CRM" ] : if arg_12 in arg_0 : del ( arg_0 [ arg_12 ] )

def Func(arg_0):
        """Convert older tags into an ID3v2.4 tag.

        This updates old ID3v2 frames to ID3v2.4 ones (e.g. TYER to
        TDRC). If you intend to save tags, you must call this function
        at some point; it is called by default when loading the tag.
        """

        arg_0.__update_common()

        if arg_0.__unknown_version == arg_0._V23:
            # convert unknown 2.3 frames (flags/size) to 2.4
            arg_1 = []
            for arg_2 in arg_0.unknown_frames:
                try:
                    arg_3, arg_4, arg_5 = unpack('>4sLH', arg_2[:10])
                    arg_2 = BinaryFrame.fromData(arg_0, arg_5, arg_2[10:])
                except (struct.error, error):
                    continue
                arg_3 = arg_3.decode('ascii')
                arg_1.append(arg_0.__save_frame(arg_2, arg_3=arg_3))
            arg_0.unknown_frames[:] = arg_1
            arg_0.__unknown_version = arg_0._V24

        # TDAT, TYER, and TIME have been turned into TDRC.
        try:
            arg_8 = text_type(arg_0.get("TYER", ""))
            if arg_8.strip(u"\x00"):
                arg_0.pop("TYER")
                arg_9 = text_type(arg_0.get("TDAT", ""))
                if arg_9.strip("\x00"):
                    arg_0.pop("TDAT")
                    arg_8 = "%s-%s-%s" % (arg_8, arg_9[2:], arg_9[:2])
                    arg_10 = text_type(arg_0.get("TIME", ""))
                    if arg_10.strip("\x00"):
                        arg_0.pop("TIME")
                        arg_8 += "T%s:%s:00" % (arg_10[:2], arg_10[2:])
                if "TDRC" not in arg_0:
                    arg_0.add(TDRC(encoding=0, text=arg_8))
        except UnicodeDecodeError:
            # Old ID3 tags have *lots* of Unicode problems, so if TYER
            # is bad, just chuck the frames.
            pass

        # TORY can be the first part of a TDOR.
        if "TORY" in arg_0:
            arg_11 = arg_0.pop("TORY")
            if "TDOR" not in arg_0:
                try:
                    arg_0.add(TDOR(encoding=0, text=str(arg_11)))
                except UnicodeDecodeError:
                    pass

        # IPLS is now TIPL.
        if "IPLS" in arg_0:
            arg_11 = arg_0.pop("IPLS")
            if "TIPL" not in arg_0:
                arg_0.add(TIPL(encoding=arg_11.encoding, people=arg_11.people))

        # These can't be trivially translated to any ID3v2.4 tags, or
        # should have been removed already.
        for arg_12 in ["RVAD", "EQUA", "TRDA", "TSIZ", "TDAT", "TIME", "CRM"]:
            if arg_12 in arg_0:
                del(arg_0[arg_12])

Convert older tags into an ID3v2 . 4 tag .


def Func(arg_0, arg_1=None, arg_2=arg_3.INFO):
        """Init the logger.

        Args:
            log_dir(str, optional): Log file directory. If not specified, no
                log file will be used.
            level (int or str): See the built-in python logging module.

        Returns:
            :obj:`~logging.Logger`: Python logger.
        """
        arg_3.basicConfig(
            format='%(asctime)s - %(levelname)s - %(message)s', arg_2=arg_2)
        arg_5 = arg_3.getLogger(__name__)
        if arg_1 and arg_0.rank == 0:
            arg_6 = '{}.log'.format(arg_0.timestamp)
            arg_7 = osp.join(arg_1, arg_6)
            arg_0._add_file_handler(arg_5, arg_7, arg_2=arg_2)
        return arg_5


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
arg_0
.
startswith
(
arg_1
)
:
return
arg_0
[
len
(
arg_1
)
:
]
elif
arg_2
:
raise
WimpyError
(
"string doesn't start with prefix"
)
return
arg_0

def Func(arg_0, arg_1, arg_2=False):
    """Removes the prefix, if it's there, otherwise returns input string unchanged.
    If strict is True, also ensures the prefix was present"""
    if arg_0.startswith(arg_1):
        return arg_0[len(arg_1) :]
    elif arg_2:
        raise WimpyError("string doesn't start with prefix")
    return arg_0

Removes the prefix if it s there otherwise returns input string unchanged . If strict is True also ensures the prefix was present


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
:
return
arg_2
=
ec2_connect
(
arg_1
)
log
(
"Starting instances {0}."
.
format
(
arg_0
)
)
arg_2
.
Func
(
arg_0
)
log
(
"Done"
)

def Func(arg_0, arg_1):
    '''Start all the instances given by its ids'''
    if not arg_0: return
    arg_2 = ec2_connect(arg_1)
    log("Starting instances {0}.".format(arg_0))
    arg_2.Func(arg_0)
    log("Done")


def Func ( arg_0 ) : arg_1 = arg_0 . get_conn ( ) arg_2 = ( arg_1 . projects ( ) . beginTransaction ( projectId = arg_0 . project_id , body = { } ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_2 [ 'transaction' ]

def Func(arg_0):
        """
        Begins a new transaction.

        .. seealso::
            https://cloud.google.com/datastore/docs/reference/rest/v1/projects/beginTransaction

        :return: a transaction handle.
        :rtype: str
        """
        arg_1 = arg_0.get_conn()

        arg_2 = (arg_1
                .projects()
                .beginTransaction(projectId=arg_0.project_id, body={})
                .execute(num_retries=arg_0.num_retries))

        return arg_2['transaction']


def Func ( arg_0 , arg_1 ) : arg_2 = defaultdict ( set ) for arg_3 in arg_1 : arg_4 = arg_0 . columnForCell ( arg_3 ) arg_2 [ arg_4 ] . add ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
    """
    Maps cells to the columns they belong to.

    :param cells: (set) Cells

    :returns: (dict) Mapping from columns to their cells in `cells`
    """
    arg_2 = defaultdict(set)

    for arg_3 in arg_1:
      arg_4 = arg_0.columnForCell(arg_3)
      arg_2[arg_4].add(arg_3)

    return arg_2

Maps cells to the columns they belong to .


def Func ( arg_0 , arg_1 , arg_2 ) : assert arg_1 in arg_0 . events current_queues . queues [ 'stats-{}' . format ( arg_1 ) ] . Func ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Publish events."""
        assert arg_1 in arg_0.events
        current_queues.queues['stats-{}'.format(arg_1)].Func(arg_2)


run enrichr for one sample gene list but multi-libraries

def Func(arg_0):
        """Func enrichr for one sample gene list but multi-libraries"""

        # set organism
        arg_0.get_organism()
        # read input file
        arg_1 = arg_0.parse_genelists()
        arg_2 = arg_0.parse_genesets()
        # if gmt
        arg_0._logger.info("Connecting to Enrichr Server to get latest library names")
        if len(arg_2) < 1:
            sys.stderr.write("Not validated Enrichr library name provided\n")
            sys.stdout.write("Hint: use get_library_name() to view full list of supported names")
            sys.exit(1)
        arg_0.results = pd.DataFrame()

        for arg_4 in arg_2:
            if isinstance(arg_4, dict):
                ## local mode
                arg_5 = arg_0.enrich(arg_4)
                arg_6, arg_0._gs = str(id(arg_4)), "CUSTOM%s"%id(arg_4)
                if arg_5 is None:
                    arg_0._logger.info("No hits return, for gene set: Custom%s"%arg_6)
                    continue
            else:
                ## online mode
                arg_0._gs = str(arg_4)
                arg_0._logger.debug("Start Enrichr using library: %s" % (arg_0._gs))
                arg_0._logger.info('Analysis name: %s, Enrichr Library: %s' % (arg_0.descriptions, arg_0._gs))
                arg_6, arg_5 = arg_0.get_results(arg_1)
                # Remember gene set library used
            arg_5.insert(0, "Gene_set", arg_0._gs)
            # Append to master dataframe
            arg_0.results = arg_0.results.append(arg_5, ignore_index=True, sort=True)
            arg_0.res2d = arg_5
            if arg_0._outdir is None: continue
            arg_0._logger.info('Save file of enrichment results: Job Id:' + str(arg_6))
            arg_9 = "%s/%s.%s.%s.reports.txt" % (arg_0.outdir, arg_0._gs, arg_0.descriptions, arg_0.module)
            arg_0.res2d.to_csv(arg_9, index=False, encoding='utf-8', sep="\t")
            # plotting
            if not arg_0.__no_plot:
                arg_10 = barplot(df=arg_5, cutoff=arg_0.cutoff, figsize=arg_0.figsize,
                              top_term=arg_0.__top_term, color='salmon',
                              title=arg_0._gs,
                              ofname=arg_9.replace("txt", arg_0.format))
                if arg_10 is not None : arg_0._logger.warning(arg_10)
            arg_0._logger.info('Done.\n')
        # clean up tmpdir
        if arg_0._outdir is None: arg_0._tmpdir.cleanup()

        return

run enrichr for one sample gene list but multi - libraries


def Func ( arg_0 , ** arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : arg_0 . _projections . append ( [ arg_2 , arg_3 ] ) return arg_0

def Func(arg_0, **arg_1):
        """
        Specify one or more projection expressions to add to each result

        ### Parameters

        - **kwexpr**: One or more key-value pairs for a projection. The key is
            the alias for the projection, and the value is the projection
            expression itself, for example `Func(square_root="sqrt(@foo)")`
        """
        for arg_2, arg_3 in arg_1.items():
            arg_0._projections.append([arg_2, arg_3])

        return arg_0

Specify one or more projection expressions to add to each result

        ### Parameters

        - **kwexpr**: One or more key-value pairs for a projection. The key is
            the alias for the projection, and the value is the projection
            expression itself, for example `apply(square_root="sqrt(@foo)")`


(self, username='', password='', organization='llnl',
        force=True, repo_type='public')

def Func(arg_0, arg_1='', arg_2='', arg_3='llnl',
        arg_4=True, arg_5='public'):
        """
        Retrieves the statistics from the given organization with the given
        credentials. Will not retreive data if file exists and force hasn't been
        set to True. This is to save GH API requests.
        """
        arg_6 = str(datetime.date.today())
        arg_7 =  ('../github_stats_output/' + arg_6[:4] + '/' + arg_6[:7] + '/'
            + arg_6 + '.csv')
        if arg_4 or not os.path.isfile(arg_7):
            my_github.login(arg_1, arg_2)
            arg_8 = arg_0.logged_in_gh.ratelimit_remaining + 1
            print 'Rate Limit: ' + str(arg_8)
            my_github.get_org(arg_3)
            arg_9 = my_github.get_mems_of_org()
            arg_10 = my_github.get_teams_of_org()
            my_github.repos(arg_5=arg_5, arg_3=arg_3)
            #Write JSON
            my_github.write_org_json(dict_to_write=arg_0.members_json,
                path_ending_type='members', is_list=True)
            my_github.write_org_json(dict_to_write=
                {'singleton': arg_0.org_retrieved.to_json()},
                path_ending_type='organization')
            my_github.write_org_json(dict_to_write=arg_0.teams_json,
                path_ending_type='teams', is_list=True)

            my_github.write_repo_json(dict_to_write=arg_0.repos_json,
                path_ending_type='repo')
            my_github.write_repo_json(dict_to_write=arg_0.contributors_json,
                path_ending_type='contributors', is_list=True)
            my_github.write_repo_json(dict_to_write=arg_0.pull_requests_json,
                path_ending_type='pull-requests', is_list=True)
            my_github.write_repo_json(dict_to_write=arg_0.issues_json,
                path_ending_type='issues', is_list=True)
            my_github.write_repo_json(dict_to_write=arg_0.languages_json,
                path_ending_type='languages', is_dict=True)
            my_github.write_repo_json(dict_to_write=arg_0.commits_json,
                path_ending_type='commits', is_list=True)
            #Write CSV
            my_github.write_to_file(arg_7,
                                    arg_6,
                                    arg_3,
                                    arg_9,
                                    arg_10)
            arg_11 = arg_0.logged_in_gh.ratelimit_remaining
            arg_12 = arg_8 - arg_11
            print ('Rate Limit Remaining: ' + str(arg_11) + '\nUsed '
                + str(arg_12) + ' API calls.')

Retrieves the statistics from the given organization with the given credentials . Will not retreive data if file exists and force hasn t been set to True . This is to save GH API requests .


return list(chain(*(types[t] for t in types)))

def Func ( arg_0 ) : arg_1 = defaultdict ( list ) arg_2 = { int , float , complex } for arg_3 in arg_0 : arg_4 = type ( arg_3 ) if arg_4 in arg_2 : arg_1 [ 'number' ] . append ( arg_3 ) else : arg_1 [ arg_4 ] . append ( arg_3 ) for arg_4 in arg_1 : arg_1 [ arg_4 ] = np . sort ( arg_1 [ arg_4 ] ) return list ( chain ( * ( arg_1 [ arg_4 ] for arg_4 in arg_1 ) ) )

def Func(arg_0):
    """
    Sort elements of multiple types

    x is assumed to contain elements of different types, such that
    plain sort would raise a `TypeError`.

    Parameters
    ----------
    a : array-like
        Array of items to be sorted

    Returns
    -------
    out : list
        Items sorted within their type groups.
    """
    arg_1 = defaultdict(list)
    arg_2 = {int, float, complex}

    for arg_3 in arg_0:
        arg_4 = type(arg_3)
        if arg_4 in arg_2:
            arg_1['number'].append(arg_3)
        else:
            arg_1[arg_4].append(arg_3)

    for arg_4 in arg_1:
        arg_1[arg_4] = np.sort(arg_1[arg_4])

    return list(chain(*(arg_1[arg_4] for arg_4 in arg_1)))