def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
get
(
arg_1
)
if
arg_3
is
:
raise
KeyError
(
'No section "%s"'
%
arg_1
)
if
arg_2
is
:
arg_2
=
type
(
arg_3
)
(
)
elif
arg_1
in
CLASS_SECTIONS
:
if
isinstance
(
arg_2
,
str
)
:
arg_2
=
{
'typename'
:
aliases
.
resolve
(
arg_2
)
}
elif
isinstance
(
arg_2
,
type
)
:
arg_2
=
{
'typename'
:
class_name
.
class_name
(
arg_2
)
}
elif
not
isinstance
(
arg_2
,
dict
)
:
raise
TypeError
(
'Expected dict, str or type, got "%s"'
%
arg_2
)
arg_4
=
arg_2
.
get
(
'typename'
)
if
arg_4
:
arg_5
=
's'
if
arg_1
==
'driver'
else
''
arg_6
=
'bibliopixel.'
+
arg_1
+
arg_5
importer
.
import_symbol
(
arg_4
,
arg_6
)
elif
arg_1
==
'shape'
:
if
not
isinstance
(
arg_2
,
(
list
,
int
,
tuple
,
str
)
)
:
raise
TypeError
(
'Expected shape, got "%s"'
%
arg_2
)
elif
type
(
arg_3
)
is
not
type
(
arg_2
)
:
raise
TypeError
(
'Expected %s but got "%s" of type %s'
%
(
type
(
arg_3
)
,
arg_2
,
type
(
arg_2
)
)
)
arg_0
[
arg_1
]
=
arg_2

def Func(arg_0, arg_1, arg_2):
    """Set one section in a Project description"""
    arg_3 = arg_0.get(arg_1)
    if arg_3 is None:
        raise KeyError('No section "%s"' % arg_1)

    if arg_2 is None:
        arg_2 = type(arg_3)()

    elif arg_1 in CLASS_SECTIONS:
        if isinstance(arg_2, str):
            arg_2 = {'typename': aliases.resolve(arg_2)}
        elif isinstance(arg_2, type):
            arg_2 = {'typename': class_name.class_name(arg_2)}
        elif not isinstance(arg_2, dict):
            raise TypeError('Expected dict, str or type, got "%s"' % arg_2)

        arg_4 = arg_2.get('typename')
        if arg_4:
            arg_5 = 's' if arg_1 == 'driver' else ''
            arg_6 = 'bibliopixel.' + arg_1 + arg_5
            importer.import_symbol(arg_4, arg_6)

    elif arg_1 == 'shape':
        if not isinstance(arg_2, (list, int, tuple, str)):
            raise TypeError('Expected shape, got "%s"' % arg_2)

    elif type(arg_3) is not type(arg_2):
        raise TypeError('Expected %s but got "%s" of type %s' %
                        (type(arg_3), arg_2, type(arg_2)))

    arg_0[arg_1] = arg_2


def Func ( arg_0 , arg_1 ) : if not arg_1 . endswith ( '/' ) : arg_0 . _Func = '{v}/' . format ( v = arg_1 ) else : arg_0 . _Func = arg_1

def Func(arg_0, arg_1):
		"""
		Setter for 'Func' property

		Args:
			value (str): Absolute Func to scan

		"""
		if not arg_1.endswith('/'):
			arg_0._Func = '{v}/'.format(v=arg_1)
		else:
			arg_0._Func = arg_1

Setter for 'path' property

		Args:
			value (str): Absolute path to scan


(onset_envelope, bpm, fft_res, tightness, trim)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Internal function that tracks beats in an onset strength envelope.

    Parameters
    ----------
    onset_envelope : np.ndarray [shape=(n,)]
        onset strength envelope

    bpm : float [scalar]
        tempo estimate

    fft_res  : float [scalar]
        resolution of the fft (sr / hop_length)

    tightness: float [scalar]
        how closely do we adhere to bpm?

    trim : bool [scalar]
        trim leading/trailing beats with weak onsets?

    Returns
    -------
    beats : np.ndarray [shape=(n,)]
        frame numbers of beat events
    """

    if arg_1 <= 0:
        raise ParameterError('bpm must be strictly positive')

    # convert bpm to a sample period for searching
    arg_5 = round(60.0 * arg_2 / arg_1)

    # localscore is a smoothed version of AGC'd onset envelope
    arg_6 = __beat_local_score(arg_0, arg_5)

    # run the DP
    arg_7, arg_8 = __beat_track_dp(arg_6, arg_5, arg_3)

    # get the position of the last beat
    arg_9 = [__last_beat(arg_8)]

    # Reconstruct the beat path from backlinks
    while arg_7[arg_9[-1]] >= 0:
        arg_9.append(arg_7[arg_9[-1]])

    # Put the beats in ascending order
    # Convert into an array of frame numbers
    arg_9 = np.array(arg_9[::-1], dtype=int)

    # Discard spurious trailing beats
    arg_9 = __trim_beats(arg_6, arg_9, arg_4)

    return arg_9

Internal function that tracks beats in an onset strength envelope .


Objective and gradient for the rosenbrock function

def Func(arg_0):
    """Objective and gradient for the Func function"""
    arg_1, arg_2 = arg_0
    arg_3 = (1 - arg_1)**2 + 100 * (arg_2 - arg_1**2)**2

    arg_4 = np.zeros(2)
    arg_4[0] = 2 * arg_1 - 400 * (arg_1 * arg_2 - arg_1**3) - 2
    arg_4[1] = 200 * (arg_2 - arg_1**2)
    return arg_3, arg_4


def Func ( arg_0 : arg_1 ) -> Mapping [ str , Mapping [ str , Any ] ] : import bio2bel_hgnc from bio2bel_hgnc . models import HumanGene arg_0 : arg_1 = arg_0 . copy ( ) enrich_protein_and_rna_origins ( arg_0 ) collapse_all_variants ( arg_0 ) arg_2 : Set [ Gene ] = get_nodes_by_function ( arg_0 , GENE ) arg_3 = { gene . name for gene in arg_2 if gene . namespace . lower ( ) == 'hgnc' } arg_4 = { } arg_5 = bio2bel_hgnc . Manager ( ) arg_6 = ( arg_5 . session . query ( HumanGene . symbol , HumanGene . location ) . filter ( HumanGene . symbol . in_ ( arg_3 ) ) . all ( ) ) for arg_7 in arg_6 : arg_4 [ arg_7 . symbol ] = { 'name' : arg_7 . symbol , 'chr' : ( arg_7 . location . split ( 'q' ) [ 0 ] if 'q' in arg_7 . location else arg_7 . location . split ( 'p' ) [ 0 ] ) , } arg_9 = get_df ( ) for arg_10 , ( arg_11 , arg_8 , arg_12 , arg_13 ) in arg_9 [ arg_9 [ 'Symbol' ] . isin ( arg_3 ) ] . iterrows ( ) : arg_4 [ arg_8 ] [ 'start' ] = arg_12 arg_4 [ arg_8 ] [ 'stop' ] = arg_13 return arg_4

def Func(arg_0: arg_1) -> Mapping[str, Mapping[str, Any]]:
    """Generate the annotations JSON for Ideogram."""
    import bio2bel_hgnc
    from bio2bel_hgnc.models import HumanGene

    arg_0: arg_1 = arg_0.copy()
    enrich_protein_and_rna_origins(arg_0)
    collapse_all_variants(arg_0)
    arg_2: Set[Gene] = get_nodes_by_function(arg_0, GENE)
    arg_3 = {
        gene.name
        for gene in arg_2
        if gene.namespace.lower() == 'hgnc'
    }

    arg_4 = {}

    arg_5 = bio2bel_hgnc.Manager()
    arg_6 = (
        arg_5.session
            .query(HumanGene.symbol, HumanGene.location)
            .filter(HumanGene.symbol.in_(arg_3))
            .all()
    )
    for arg_7 in arg_6:
        arg_4[arg_7.symbol] = {
            'name': arg_7.symbol,
            'chr': (
                arg_7.location.split('q')[0]
                if 'q' in arg_7.location else
                arg_7.location.split('p')[0]
            ),
        }

    arg_9 = get_df()

    for arg_10, (arg_11, arg_8, arg_12, arg_13) in arg_9[arg_9['Symbol'].isin(arg_3)].iterrows():
        arg_4[arg_8]['start'] = arg_12
        arg_4[arg_8]['stop'] = arg_13

    return arg_4

Generate the annotations JSON for Ideogram .


async def Func ( arg_0 , arg_1 ) : try : await asyncio . wait ( arg_0 . application_futures . values ( ) , return_when = asyncio . ALL_COMPLETED , timeout = arg_0 . application_close_timeout ) except asyncio . TimeoutError : pass

async def Func(arg_0, arg_1):
        """
        default is to wait for the child applications to close.
        """
        try:
            await asyncio.wait(
                arg_0.application_futures.values(),
                return_when=asyncio.ALL_COMPLETED,
                timeout=arg_0.application_close_timeout
            )
        except asyncio.TimeoutError:
            pass

default is to wait for the child applications to close .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . post ( arg_1 . return_url , arg_3 = arg_3 , files = { "submission[file]" : ( 'submission.zip' , arg_2 ) } , data = { "commit" : "Submit" } ) return arg_0 . _to_json ( arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Send zipfile to TMC for given exercise
        """

        arg_4 = arg_0.post(
            arg_1.return_url,
            arg_3=arg_3,
            files={
                "submission[file]": ('submission.zip', arg_2)
            },
            data={
                "commit": "Submit"
            }
        )
        return arg_0._to_json(arg_4)


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_2_0):
        """
        Read the data stream and decode the AttributeReference structure into
        its parts.

        Args:
            input_buffer (stream): A data stream containing encoded object
                data, supporting a Func method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidKmipEncoding: Raised if the vendor identification or
                attribute name is missing from the encoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the AttributeReference structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the AttributeReference "
                "object.".format(
                    arg_2.value
                )
            )

        super(AttributeReference, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.VENDOR_IDENTIFICATION, arg_6):
            arg_0._vendor_identification = primitives.TextString(
                tag=arg_3.Tags.VENDOR_IDENTIFICATION
            )
            arg_0._vendor_identification.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The AttributeReference encoding is missing the vendor "
                "identification string."
            )

        if arg_0.is_tag_next(arg_3.Tags.ATTRIBUTE_NAME, arg_6):
            arg_0._attribute_name = primitives.TextString(
                tag=arg_3.Tags.ATTRIBUTE_NAME
            )
            arg_0._attribute_name.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The AttributeReference encoding is missing the attribute "
                "name string."
            )

        arg_0.is_oversized(arg_6)

Read the data stream and decode the AttributeReference structure into
        its parts.

        Args:
            input_buffer (stream): A data stream containing encoded object
                data, supporting a read method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidKmipEncoding: Raised if the vendor identification or
                attribute name is missing from the encoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the AttributeReference structure.

Read the data stream and decode the AttributeReference structure into its parts .


def
Func
(
arg_0
)
:
if
'epub'
not
in
arg_0
.
POST
:
raise
httpexceptions
.
HTTPBadRequest
(
"Missing EPUB in POST body."
)
arg_1
=
asbool
(
arg_0
.
POST
.
get
(
'pre-publication'
)
)
arg_2
=
arg_0
.
POST
[
'epub'
]
.
file
try
:
arg_3
=
cnxepub
.
EPUB
.
from_file
(
arg_2
)
except
:
raise
httpexceptions
.
HTTPBadRequest
(
'Format not recognized.'
)
with
db_connect
(
)
as
db_conn
:
with
db_conn
.
cursor
(
)
as
cursor
:
arg_2
.
seek
(
0
)
arg_4
,
arg_5
=
add_publication
(
cursor
,
arg_3
,
arg_2
,
arg_1
)
arg_6
,
arg_7
=
poke_publication_state
(
arg_4
)
arg_8
=
{
'publication'
:
arg_4
,
'mapping'
:
arg_5
,
'state'
:
arg_6
,
'messages'
:
arg_7
,
}
return
arg_8

def Func(arg_0):
    """Accept a publication request at form value 'epub'"""
    if 'epub' not in arg_0.POST:
        raise httpexceptions.HTTPBadRequest("Missing EPUB in POST body.")

    arg_1 = asbool(arg_0.POST.get('pre-publication'))
    arg_2 = arg_0.POST['epub'].file
    try:
        arg_3 = cnxepub.EPUB.from_file(arg_2)
    except:  # noqa: E722
        raise httpexceptions.HTTPBadRequest('Format not recognized.')

    # Make a publication entry in the database for status checking
    # the publication. This also creates publication entries for all
    # of the content in the EPUB.
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            arg_2.seek(0)
            arg_4, arg_5 = add_publication(
                cursor, arg_3, arg_2, arg_1)

    # Poke at the publication & lookup its state.
    arg_6, arg_7 = poke_publication_state(arg_4)

    arg_8 = {
        'publication': arg_4,
        'mapping': arg_5,
        'state': arg_6,
        'messages': arg_7,
    }
    return arg_8

Accept a publication request at form value epub


def Func ( arg_0 ) : arg_1 = [ ] for ( arg_2 , arg_3 ) in arg_0 . hostportlist : arg_4 = arg_0 . pick_unused_port ( ) arg_0 . tunnel . append ( subprocess . Popen ( ( 'ssh' , arg_0 . tunnelhost , '-NL127.0.0.1:%d:%s:%d' % ( arg_4 , arg_2 , arg_3 ) ) ) ) arg_1 . append ( ( '127.0.0.1' , arg_4 ) ) return arg_1

def Func(arg_0):
    """
    Establish an ssh tunnel for each local host and port
    that can be used to communicate with the state host.
    """
    arg_1 = []
    for (arg_2, arg_3) in arg_0.hostportlist:
      arg_4 = arg_0.pick_unused_port()
      arg_0.tunnel.append(subprocess.Popen(
          ('ssh', arg_0.tunnelhost, '-NL127.0.0.1:%d:%s:%d' % (arg_4, arg_2, arg_3))))
      arg_1.append(('127.0.0.1', arg_4))
    return arg_1

Establish an ssh tunnel for each local host and port that can be used to communicate with the state host .


def Func(arg_0):
    """
    Decorator for rruleset methods which may invalidate the
    cached length.
    """

    def inner_func(arg_1, *arg_2, **arg_3):
        arg_4 = arg_0(arg_1, *arg_2, **arg_3)
        arg_1._invalidate_cache()
        return arg_4

    return inner_func

Decorator for rruleset methods which may invalidate the cached length .


def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 ) : arg_4 = [ 'policy' ] if arg_1 is not None : arg_4 . append ( arg_1 ) with arg_0 . _executor . Func ( '.' . join ( arg_4 ) , arg_2 ) as policy_context : yield policy_context

def Func(arg_0, arg_1=None, arg_2=arg_3):
        """ Policy shared context dictionary """
        arg_4 = ['policy']
        if arg_1 is not None:
            arg_4.append(arg_1)
        with arg_0._executor.Func('.'.join(arg_4), arg_2) as policy_context:
            yield policy_context


def Func ( arg_0 ) : arg_1 = False arg_2 = arg_0 . callback if arg_0 . is_class ( ) : return False arg_1 = not inspect . isfunction ( arg_2 ) and not inspect . ismethod ( arg_2 ) return arg_1

def Func(arg_0):
        """return True if callback is an instance of a class"""
        arg_1 = False
        arg_2 = arg_0.callback
        if arg_0.is_class(): return False

        arg_1 = not inspect.isfunction(arg_2) and not inspect.ismethod(arg_2)
#         if is_py2:
#             ret = isinstance(val, types.InstanceType) or hasattr(val, '__dict__') \
#                 and not (hasattr(val, 'func_name') or hasattr(val, 'im_func'))
#
#         else:
#             ret = not inspect.isfunction(val) and not inspect.ismethod(val)

        return arg_1


All keys in DB, or all keys matching a glob

return [self._normalized(p) for p in files if p.isfile()]

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_2 = arg_0 . root . walkfiles ( ) else : arg_2 = [ Path ( arg_3 ) for arg_3 in glob . glob ( arg_0 . root / arg_1 ) ] return [ arg_0 . _normalized ( arg_3 ) for arg_3 in arg_2 if arg_3 . isfile ( ) ]

def Func(arg_0, arg_1 = None):
        """ All Func in DB, or all Func matching a glob"""

        if arg_1 is None:
            arg_2 = arg_0.root.walkfiles()
        else:
            arg_2 = [Path(arg_3) for arg_3 in glob.glob(arg_0.root/arg_1)]
        return [arg_0._normalized(arg_3) for arg_3 in arg_2 if arg_3.isfile()]

All keys in DB or all keys matching a glob


def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = pd . DataFrame ( sectorPerformance ( arg_0 , arg_1 ) ) _toDatetime ( arg_2 ) _reindex ( arg_2 , 'name' ) return arg_2

def Func(arg_0='', arg_1=''):
    '''This returns an array of each sector and performance for the current trading day. Performance is based on each sector ETF.

    https://iexcloud.io/docs/api/#sector-performance
    8am-5pm ET Mon-Fri

    Args:
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result
    '''
    arg_2 = pd.DataFrame(sectorPerformance(arg_0, arg_1))
    _toDatetime(arg_2)
    _reindex(arg_2, 'name')
    return arg_2

This returns an array of each sector and performance for the current trading day . Performance is based on each sector ETF .


return nodes[:operands_lbound] + \
         [OptreeNode(operator_node, tuple(nodes[operands_lbound:i]))] + \
         nodes[i+1:]

def Func(arg_0):
  """Finds the first operator in the list, converts it and its operands to a OptreeNode, then
  returns a new list with the operator and operands replaced by the new OptreeNode.
  """
  arg_1 = 0
  while arg_1 < len(arg_0):
    if isinstance(arg_0[arg_1], OperatorNode):
      break
    else:
      arg_1 += 1

  if arg_1 == len(arg_0):
    raise OperatorError("No operator found")

  arg_2 = arg_0[arg_1]
  arg_3 = arg_2.operator
  arg_4 = arg_1 - arg_3.cardinality

  if arg_4 < 0:
    raise OperatorError("Insufficient operands for operator {0}".format(arg_3.symbol))

  return arg_0[:arg_4] + \
         [OptreeNode(arg_2, tuple(arg_0[arg_4:arg_1]))] + \
         arg_0[arg_1+1:]

Finds the first operator in the list converts it and its operands to a OptreeNode then returns a new list with the operator and operands replaced by the new OptreeNode .


def Func(arg_0, arg_1=0):
    """Convert a long integer to a byte string.

    If optional blocksize is given and greater than zero, pad the front
    of the byte string with binary zeros so that the length is a multiple
    of blocksize.
    """

    # After much testing, this algorithm was deemed to be the fastest.
    arg_2 = b''
    arg_3 = struct.pack
    while arg_0 > 0:
        arg_2 = arg_3('>I', arg_0 & 0xffffffff) + arg_2
        arg_0 = arg_0 >> 32

    # Strip off leading zeros.
    for arg_4 in range(len(arg_2)):
        if arg_2[arg_4] != '\000':
            break
    else:
        # Only happens when n == 0.
        arg_2 = '\000'
        arg_4 = 0

    arg_2 = arg_2[arg_4:]

    # Add back some pad bytes. This could be done more efficiently
    # w.r.t. the de-padding being done above, but sigh...
    if arg_1 > 0 and len(arg_2) % arg_1:
        arg_2 = (arg_1 - len(arg_2) % arg_1) * '\000' + arg_2

    return arg_2

Convert a long integer to a byte string .


def Func ( arg_0 ) : def _Func ( arg_1 ) : arg_2 = Node ( length = arg_0 . _length_formatter ( arg_0 . _length_parser ( '0' ) ) ) while len ( arg_1 . descendants ) > 1 : arg_2 . add_descendant ( arg_1 . descendants . pop ( ) ) arg_1 . descendants . append ( arg_2 ) arg_0 . visit ( _Func , lambda arg_1 : len ( arg_1 . descendants ) > 2 )

def Func(arg_0):
        """
        Insert additional nodes with length=0 into the subtree in such a way
        that all non-leaf nodes have only 2 descendants, i.e. the tree becomes
        a fully resolved binary tree.
        """
        def _Func(arg_1):
            arg_2 = Node(length=arg_0._length_formatter(arg_0._length_parser('0')))
            while len(arg_1.descendants) > 1:
                arg_2.add_descendant(arg_1.descendants.pop())
            arg_1.descendants.append(arg_2)

        arg_0.visit(_Func, lambda arg_1: len(arg_1.descendants) > 2)

Insert additional nodes with length = 0 into the subtree in such a way that all non - leaf nodes have only 2 descendants i . e . the tree becomes a fully resolved binary tree .


def Func ( arg_0 : arg_1 , * arg_2 , ** arg_3 ) : arg_4 = None for arg_5 in reversed ( arg_0 ) : arg_4 = arg_5 ( * arg_2 , ** arg_3 ) return arg_4

def Func(arg_0: arg_1, *arg_2, **arg_3):
    '''
    call each func from reversed func list.

    return the last func value or None if func list is empty.
    '''
    arg_4 = None
    for arg_5 in reversed(arg_0):
        arg_4 = arg_5(*arg_2, **arg_3)
    return arg_4

call each func from reversed func list .


def Func(arg_0):
        """Validates API Root information. Raises errors for required
        properties."""
        if not arg_0._title:
            arg_1 = "No 'title' in API Root for request '{}'"
            raise ValidationError(arg_1.format(arg_0.url))

        if not arg_0._versions:
            arg_1 = "No 'versions' in API Root for request '{}'"
            raise ValidationError(arg_1.format(arg_0.url))

        if arg_0._max_content_length is None:
            arg_1 = "No 'max_content_length' in API Root for request '{}'"
            raise ValidationError(arg_1.format(arg_0.url))

Validates API Root information . Raises errors for required properties .


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        This method schedules the tasks for a single DAG by looking at the
        active DAG runs and adding task instances that should run to the
        queue.
        """

        # update the state of the previously active dag runs
        arg_4 = DagRun.find(dag_id=arg_1.dag_id, state=State.RUNNING, arg_3=arg_3)
        arg_5 = []
        for arg_6 in arg_4:
            arg_0.log.info("Examining DAG run %s", arg_6)
            # don't consider runs that are executed in the future
            if arg_6.execution_date > timezone.utcnow():
                arg_0.log.error(
                    "Execution date is in future: %s",
                    arg_6.execution_date
                )
                continue

            if len(arg_5) >= arg_1.max_active_runs:
                arg_0.log.info("Number of active dag runs reached max_active_run.")
                break

            # skip backfill dagruns for now as long as they are not really scheduled
            if arg_6.is_backfill:
                continue

            # todo: run.dag is transient but needs to be set
            arg_6.dag = arg_1
            # todo: preferably the integrity check happens at dag collection time
            arg_6.verify_integrity(arg_3=arg_3)
            arg_6.update_state(arg_3=arg_3)
            if arg_6.state == State.RUNNING:
                make_transient(arg_6)
                arg_5.append(arg_6)

        for arg_6 in arg_5:
            arg_0.log.debug("Examining active DAG run: %s", arg_6)
            # this needs a fresh session sometimes tis get detached
            arg_7 = arg_6.get_task_instances(state=(State.NONE,
                                                State.UP_FOR_RETRY,
                                                State.UP_FOR_RESCHEDULE))

            # this loop is quite slow as it uses are_dependencies_met for
            # every task (in ti.is_runnable). This is also called in
            # update_state above which has already checked these tasks
            for arg_8 in arg_7:
                arg_9 = arg_1.get_task(arg_8.task_id)

                # fixme: ti.task is transient but needs to be set
                arg_8.task = arg_9

                if arg_8.are_dependencies_met(
                        dep_context=DepContext(flag_upstream_failed=True),
                        arg_3=arg_3):
                    arg_0.log.debug('Queuing task: %s', arg_8)
                    arg_2.append(arg_8.key)

This method schedules the tasks for a single DAG by looking at the active DAG runs and adding task instances that should run to the queue .


def Func ( arg_0 , * arg_1 ) : print ( arg_0 % arg_1 , file = sys . stderr ) sys . exit ( 1 )

def Func(arg_0, *arg_1):
    """
    Print an error message and exit.

    :param msg: A message to print
    :type msg: str

    """
    print(arg_0 % arg_1, file=sys.stderr)
    sys.exit(1)


def Func(arg_0, arg_1):
        """
        Add a new store to your MailChimp account.

        Error checking on the currency code verifies that it is in the correct
        three-letter, all-caps format as specified by ISO 4217 but does not
        check that it is a valid code as the list of valid codes changes over
        time.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "id": string*,
            "list_id": string*,
            "name": string*,
            "currency_code": string*
        }
        """
        if 'id' not in arg_1:
            raise KeyError('The store must have an id')
        if 'list_id' not in arg_1:
            raise KeyError('The store must have a list_id')
        if 'name' not in arg_1:
            raise KeyError('The store must have a name')
        if 'currency_code' not in arg_1:
            raise KeyError('The store must have a currency_code')
        if not re.match(r"^[A-Z]{3}$", arg_1['currency_code']):
            raise ValueError('The currency_code must be a valid 3-letter ISO 4217 currency code')
        arg_2 = arg_0._mc_client._post(url=arg_0._build_path(), arg_1=arg_1)
        if arg_2 is not None:
            arg_0.store_id = arg_2['id']
        else:
            arg_0.store_id = None
        return arg_2

Add a new store to your MailChimp account .


def Func(arg_0, arg_1, arg_2='scipy'):
    """Solve linear system `AX=B` using Func method.

    :param A: an input Hermitian matrix
    :param B: an array
    :param str method: a choice of method in [numpy, scipy, numpy_solver]

        * `numpy_solver` relies entirely on numpy.solver (no cholesky decomposition)
        * `numpy` relies on the numpy.linalg.cholesky for the decomposition and
          numpy.linalg.solve for the inversion.
        * `scipy` uses scipy.linalg.cholesky for the decomposition and
          scipy.linalg.cho_solve for the inversion.

    .. rubric:: Description

    When a matrix is square and Hermitian (symmetric with lower part being
    the complex conjugate of the upper one), then the usual triangular
    factorization takes on the special form:

    .. math:: A = R R^H

    where :math:`R` is a lower triangular matrix with nonzero real principal
    diagonal element. The input matrix can be made of complex data. Then, the
    inversion to find :math:`x` is made as follows:

    .. math::  Ry = B

    and

    .. math::   Rx = y

    .. doctest::

        >>> import numpy
        >>> from spectrum import Func
        >>> A = numpy.array([[ 2.0+0.j ,  0.5-0.5j, -0.2+0.1j],
        ...    [ 0.5+0.5j,  1.0+0.j ,  0.3-0.2j],
        ...    [-0.2-0.1j,  0.3+0.2j,  0.5+0.j ]])
        >>> B = numpy.array([ 1.0+3.j ,  2.0-1.j ,  0.5+0.8j])
        >>> Func(A, B)
        array([ 0.95945946+5.25675676j,  4.41891892-7.04054054j,
               -5.13513514+6.35135135j])

    """
    if arg_2 == 'numpy_solver':
        arg_3 = _numpy_solver(arg_0,arg_1)
        return arg_3
    elif arg_2 == 'numpy':
        arg_3, arg_4 = _numpy_cholesky(arg_0, arg_1)
        return arg_3
    elif arg_2 == 'scipy':
        import scipy.linalg
        arg_5 = scipy.linalg.cholesky(arg_0)
        arg_3 = scipy.linalg.cho_solve((arg_5, False), arg_1)
    else:
        raise ValueError('method must be numpy_solver, numpy_cholesky or cholesky_inplace')
    return arg_3

Solve linear system `AX=B` using CHOLESKY method.

    :param A: an input Hermitian matrix
    :param B: an array
    :param str method: a choice of method in [numpy, scipy, numpy_solver]

        * `numpy_solver` relies entirely on numpy.solver (no cholesky decomposition)
        * `numpy` relies on the numpy.linalg.cholesky for the decomposition and
          numpy.linalg.solve for the inversion.
        * `scipy` uses scipy.linalg.cholesky for the decomposition and
          scipy.linalg.cho_solve for the inversion.

    .. rubric:: Description

    When a matrix is square and Hermitian (symmetric with lower part being
    the complex conjugate of the upper one), then the usual triangular
    factorization takes on the special form:

    .. math:: A = R R^H

    where :math:`R` is a lower triangular matrix with nonzero real principal
    diagonal element. The input matrix can be made of complex data. Then, the
    inversion to find :math:`x` is made as follows:

    .. math::  Ry = B

    and

    .. math::   Rx = y

    .. doctest::

        >>> import numpy
        >>> from spectrum import CHOLESKY
        >>> A = numpy.array([[ 2.0+0.j ,  0.5-0.5j, -0.2+0.1j],
        ...    [ 0.5+0.5j,  1.0+0.j ,  0.3-0.2j],
        ...    [-0.2-0.1j,  0.3+0.2j,  0.5+0.j ]])
        >>> B = numpy.array([ 1.0+3.j ,  2.0-1.j ,  0.5+0.8j])
        >>> CHOLESKY(A, B)
        array([ 0.95945946+5.25675676j,  4.41891892-7.04054054j,
               -5.13513514+6.35135135j])

Solve linear system AX = B using CHOLESKY method .


return callBigDlFunc(self.bigdl_type, "summarySetTrigger", self.value,
                             name, trigger)

def Func ( arg_0 , arg_1 , arg_2 ) : return callBigDlFunc ( arg_0 . bigdl_type , "summarySetTrigger" , arg_0 . value , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Set the interval of recording for each indicator.

        :param tag: tag name. Supported tag names are "LearningRate", "Loss","Throughput", "Parameters". "Parameters" is an umbrella tag thatincludes weight, bias, gradWeight, gradBias, and some running status(eg. runningMean and runningVar in BatchNormalization). If youdidn't set any triggers, we will by default record Loss and Throughputin each iteration, while *NOT* recording LearningRate and Parameters,as recording parameters may introduce substantial overhead when themodel is very big, LearningRate is not a public attribute for allOptimMethod.
        :param trigger: trigger
        """
        return callBigDlFunc(arg_0.bigdl_type, "summarySetTrigger", arg_0.value,
                             arg_1, arg_2)

Set the interval of recording for each indicator .


def Func(arg_0, arg_1=None, arg_2=None):
    """Initialize an object from dict.

    The dict must contain the key "type", which indicates the object type, it
    can be either a string or type, such as "list" or ``list``. Remaining
    fields are treated as the arguments for constructing the object.

    Args:
        info (dict): Object types and arguments.
        parent (:class:`module`): Module which may containing expected object
            classes.
        default_args (dict, optional): Default arguments for initializing the
            object.

    Returns:
        any type: Object built from the dict.
    """
    assert isinstance(arg_0, dict) and 'type' in arg_0
    assert isinstance(arg_2, dict) or arg_2 is None
    arg_3 = arg_0.copy()
    arg_4 = arg_3.pop('type')
    if mmcv.is_str(arg_4):
        if arg_1 is not None:
            arg_4 = getattr(arg_1, arg_4)
        else:
            arg_4 = sys.modules[arg_4]
    elif not isinstance(arg_4, type):
        raise TypeError('type must be a str or valid type, but got {}'.format(
            type(arg_4)))
    if arg_2 is not None:
        for arg_5, arg_6 in arg_2.items():
            arg_3.setdefault(arg_5, arg_6)
    return arg_4(**arg_3)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
while
True
:
try
:
arg_0
.
write_Func
(
arg_1
,
arg_2
)
arg_3
=
arg_0
.
readline
(
''
)
.
strip
(
)
.
lower
(
)
except
EOFError
:
return
arg_2
if
arg_3
in
(
'y'
,
'yes'
)
:
return
True
elif
arg_3
in
(
'n'
,
'no'
)
:
return
False
else
:
arg_0
.
msg
(
"Please answer y or n."
)
pass
pass
return
arg_2

def Func(arg_0, arg_1, arg_2):
        """ Called when a dangerous action is about to be done to make sure
        it's okay. `prompt' is printed; user response is returned."""
        while True:
            try:
                arg_0.write_Func(arg_1, arg_2)
                arg_3 = arg_0.readline('').strip().lower()
            except EOFError:
                return arg_2
            if arg_3 in ('y', 'yes'):
                return True
            elif arg_3 in ('n', 'no'):
                return False
            else:
                arg_0.msg("Please answer y or n.")
                pass
            pass
        return arg_2

Called when a dangerous action is about to be done to make sure it s okay . prompt is printed ; user response is returned .


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 , "savedmodels" ) arg_1 = os . path . abspath ( arg_1 ) return arg_1

def Func(arg_0):
  """Get checkpoint parent dir.

  Returns: absolute path to the base serialization directory within which
      model checkpoints for this experiment are created
  """
  arg_1 = os.path.join(arg_0, "savedmodels")
  arg_1 = os.path.abspath(arg_1)

  return arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _get_prompt_cursor ( ) if arg_0 . _get_cursor ( ) . blockNumber ( ) == arg_2 . blockNumber ( ) : if arg_0 . _history_locked ( ) and not arg_1 : return False arg_3 = arg_0 . _get_input_buffer_cursor_column ( ) arg_4 = arg_0 . input_buffer if arg_0 . _history_index == len ( arg_0 . _history ) or ( arg_0 . _history_prefix and arg_3 != len ( arg_0 . _history_prefix ) ) : arg_0 . _history_index = len ( arg_0 . _history ) arg_0 . _history_prefix = arg_4 [ : arg_3 ] arg_0 . history_previous ( arg_0 . _history_prefix , as_prefix = not arg_1 ) arg_7 = arg_0 . _get_prompt_cursor ( ) if arg_0 . _history_prefix : arg_7 . movePosition ( QtGui . QTextCursor . Right , n = len ( arg_0 . _history_prefix ) ) else : arg_7 . movePosition ( QtGui . QTextCursor . EndOfLine ) arg_0 . _set_cursor ( arg_7 ) return False return True

def Func(arg_0, arg_1):
        """ Called when the up key is pressed. Returns whether to continue
            processing the event.
        """
        arg_2 = arg_0._get_prompt_cursor()
        if arg_0._get_cursor().blockNumber() == arg_2.blockNumber():
            # Bail out if we're locked.
            if arg_0._history_locked() and not arg_1:
                return False

            # Set a search prefix based on the cursor position.
            arg_3 = arg_0._get_input_buffer_cursor_column()
            arg_4 = arg_0.input_buffer
            if arg_0._history_index == len(arg_0._history) or \
                    (arg_0._history_prefix and arg_3 != len(arg_0._history_prefix)):
                arg_0._history_index = len(arg_0._history)
                arg_0._history_prefix = arg_4[:arg_3]

            # Perform the search.
            arg_0.history_previous(arg_0._history_prefix,
                                    as_prefix=not arg_1)

            # Go to the first line of the prompt for seemless history scrolling.
            # Emulate readline: keep the cursor position fixed for a prefix
            # search.
            arg_7 = arg_0._get_prompt_cursor()
            if arg_0._history_prefix:
                arg_7.movePosition(QtGui.QTextCursor.Right,
                                    n=len(arg_0._history_prefix))
            else:
                arg_7.movePosition(QtGui.QTextCursor.EndOfLine)
            arg_0._set_cursor(arg_7)

            return False

        return True

Called when the up key is pressed . Returns whether to continue processing the event .


(s, max_mem=1e9, desc='', min_rad='calc',
        max_rad='calc', invert='guess', rz_order=0, do_polish=True)

def Func(arg_0, arg_1=1e9, arg_2='', arg_3='calc',
        arg_4='calc', arg_5='guess', arg_6=0, arg_7=True):
    """
    Workhorse for translating particles. See get_particles_featuring for docs.
    """
    if arg_2 is not None:
        arg_8 = arg_2 + 'translate-particles'
        arg_9 = arg_2 + 'addsub_burn'
        arg_10 = arg_2 + 'addsub_polish'
    else:
        arg_8, arg_9, arg_10 = [None]*3
    RLOG.info('Translate Particles:')
    opt.burn(arg_0, mode='do-particles', n_loop=4, fractol=0.1, arg_2=arg_8,
            arg_1=arg_1, include_rad=False, dowarn=False)
    opt.burn(arg_0, mode='do-particles', n_loop=4, fractol=0.05, arg_2=arg_8,
            arg_1=arg_1, include_rad=True, dowarn=False)

    RLOG.info('Start add-subtract')
    addsub.add_subtract(arg_0, tries=30, arg_3=arg_3, arg_4=arg_4,
        arg_5=arg_5)
    if arg_2 is not None:
        states.save(arg_0, arg_2=arg_2 + 'translate-addsub')

    if arg_7:
        RLOG.info('Final Burn:')
        opt.burn(arg_0, mode='burn', n_loop=3, fractol=3e-4, arg_2=arg_9,
                arg_1=arg_1, arg_6=arg_6,dowarn=False)
        RLOG.info('Final Polish:')
        arg_11 = opt.burn(arg_0, mode='polish', n_loop=4, fractol=3e-4, arg_2=arg_10,
                arg_1=arg_1, arg_6=arg_6, dowarn=False)
        if not arg_11['converged']:
            RLOG.warn('Optimization did not converge; consider re-running')

Workhorse for translating particles . See get_particles_featuring for docs .


def
Func
(
arg_0
)
:
if
arg_0
is
:
raise
ValueError
(
'Not a valid key'
)
arg_1
=
re
.
match
(
PATTERN
,
arg_0
)
if
not
arg_1
:
arg_1
=
re
.
match
(
PATTERN_S0
,
arg_0
)
if
not
arg_1
:
raise
ValueError
(
'Not a valid key'
)
return
dict
(
map
(
normalise_part
,
zip
(
[
arg_2
for
arg_2
in
PARTS_S0
.
keys
(
)
]
,
arg_1
.
groups
(
)
)
)
)
return
dict
(
zip
(
PARTS
.
keys
(
)
,
arg_1
.
groups
(
)
)
)

def Func(arg_0):
    """Parse a hub key into a dictionary of component parts

    :param key: str, a hub key
    :returns: dict, hub key split into parts
    :raises: ValueError
    """
    if arg_0 is None:
        raise ValueError('Not a valid key')

    arg_1 = re.match(PATTERN, arg_0)
    if not arg_1:
        arg_1 = re.match(PATTERN_S0, arg_0)
        if not arg_1:
            raise ValueError('Not a valid key')

        return dict(map(normalise_part, zip([arg_2 for arg_2 in PARTS_S0.keys()], arg_1.groups())))

    return dict(zip(PARTS.keys(), arg_1.groups()))


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ ] if arg_2 : arg_4 = arg_0 . case_collection . find_one ( { "_id" : arg_2 } ) arg_3 = [ causative for causative in arg_4 [ 'causatives' ] ] elif arg_1 : arg_5 = arg_0 . case_collection . aggregate ( [ { '$match' : { 'collaborators' : arg_1 , 'causatives' : { '$exists' : True } } } , { '$unwind' : '$causatives' } , { '$group' : { '_id' : '$causatives' } } ] ) arg_3 = [ item [ '_id' ] for item in arg_5 ] return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """Return all causative variants for an institute

            Args:
                institute_id(str)
                case_id(str)

            Yields:
                str: variant document id
        """

        arg_3 = []

        if arg_2:

            arg_4 = arg_0.case_collection.find_one(
                    {"_id": arg_2}
                )
            arg_3 = [causative for causative in arg_4['causatives']]

        elif arg_1:

            arg_5 = arg_0.case_collection.aggregate([
                {'$match': {'collaborators': arg_1, 'causatives': {'$exists': True}}},
                {'$unwind': '$causatives'},
                {'$group': {'_id': '$causatives'}}
            ])
            arg_3 = [item['_id'] for item in arg_5]

        return arg_3


def Func(arg_0, arg_1):
    """
    Returns the indices of cells that belong to a column.

    :param column: (int) Column index

    :returns: (list) Cell indices
    """
    arg_0._validateColumn(arg_1)

    arg_2 = arg_0.cellsPerColumn * arg_1
    arg_3 = arg_2 + arg_0.cellsPerColumn
    return range(arg_2, arg_3)

Returns the indices of cells that belong to a column .


def
Func
(
arg_0
)
:
arg_1
=
{
}
for
arg_2
in
arg_0
.
processes
:
logger
.
debug
(
"[{}] Adding parameters: {}"
.
format
(
arg_2
.
template
,
arg_2
.
params
)
)
for
arg_3
,
arg_4
in
arg_2
.
params
.
items
(
)
:
arg_1
[
arg_3
]
=
arg_4
[
"default"
]
arg_5
=
"\n\t"
+
"\n\t"
.
join
(
[
"{} = {}"
.
format
(
arg_3
,
arg_4
)
for
arg_3
,
arg_4
in
arg_1
.
items
(
)
]
)
return
arg_5

def Func(arg_0):
        """Returns the merged nextflow params string from a dictionary object.

        The params dict should be a set of key:value pairs with the
        parameter name, and the default parameter value::

            self.params = {
                "genomeSize": 2.1,
                "minCoverage": 15
            }

        The values are then added to the string as they are. For instance,
        a ``2.1`` float will appear as ``param = 2.1`` and a
        ``"'teste'" string will appear as ``param = 'teste'`` (Note the
        string).

        Identical parameters in multiple processes will be merged into the same
        param.

        Returns
        -------
        str
            Nextflow params configuration string
        """

        arg_1 = {}

        for arg_2 in arg_0.processes:

            logger.debug("[{}] Adding parameters: {}".format(arg_2.template,
                                                             arg_2.params))
            for arg_3, arg_4 in arg_2.params.items():

                arg_1[arg_3] = arg_4["default"]

        arg_5 = "\n\t" + "\n\t".join([
            "{} = {}".format(arg_3, arg_4) for arg_3, arg_4 in arg_1.items()
        ])

        return arg_5

Returns the merged nextflow params string from a dictionary object .


def Func(arg_0, arg_1):
    """Return a valid docker_path for a local file path."""
    arg_1 = directory_fmt(arg_1)
    arg_2, arg_3 = _local_uri_rewriter(arg_1)
    arg_4 = arg_3[len('file'):]
    arg_5 = os.path.join(arg_0._relative_path, arg_3)
    return arg_4, arg_5

Return a valid docker_path for a local file path .


(omegas, zs, CASRNs=None, Method=None,
                  AvailableMethods=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
False
)
:
def
list_methods
(
)
:
arg_5
=
[
]
if
none_and_length_check
(
[
arg_1
,
arg_0
]
)
:
arg_5
.
append
(
'SIMPLE'
)
arg_5
.
append
(
'NONE'
)
return
arg_5
if
arg_4
:
return
list_methods
(
)
if
not
arg_3
:
arg_3
=
list_methods
(
)
[
0
]
if
arg_3
==
'SIMPLE'
:
arg_6
=
mixing_simple
(
arg_1
,
arg_0
)
elif
arg_3
==
'NONE'
:
arg_6
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_6

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                  arg_4=False):
    r'''This function handles the calculation of a mixture's acentric factor.
    Calculation is based on the omegas provided for each pure component. Will
    automatically select a method to use if no Method is provided;
    returns None if insufficient data is available.

    Examples
    --------
    >>> Func([0.025, 0.12], [0.3, 0.7])
    0.0915

    Parameters
    ----------
    omegas : array-like
        acentric factors of each component, [-]
    zs : array-like
        mole fractions of each component, [-]
    CASRNs: list of strings
        CASRNs, not currently used [-]

    Returns
    -------
    omega : float
        acentric factor of the mixture, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain omega with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Only 'SIMPLE' is accepted so far.
        All valid values are also held in the list Func_methods.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        omega for the desired chemical, and will return methods instead of
        omega

    Notes
    -----
    The only data used in the methods implemented to date are mole fractions
    and pure-component omegas. An alternate definition could be based on
    the dew point or bubble point of a multicomponent mixture, but this has
    not been done to date.

    References
    ----------
    .. [1] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition.
       New York: McGraw-Hill Professional, 2000.
    '''
    def list_methods():
        arg_5 = []
        if none_and_length_check([arg_1, arg_0]):
            arg_5.append('SIMPLE')
        arg_5.append('NONE')
        return arg_5
    if arg_4:
        return list_methods()
    if not arg_3:
        arg_3 = list_methods()[0]

    if arg_3 == 'SIMPLE':
        arg_6 = mixing_simple(arg_1, arg_0)
    elif arg_3 == 'NONE':
        arg_6 = None
    else:
        raise Exception('Failure in in function')
    return arg_6

r'''This function handles the calculation of a mixture's acentric factor.
    Calculation is based on the omegas provided for each pure component. Will
    automatically select a method to use if no Method is provided;
    returns None if insufficient data is available.

    Examples
    --------
    >>> omega_mixture([0.025, 0.12], [0.3, 0.7])
    0.0915

    Parameters
    ----------
    omegas : array-like
        acentric factors of each component, [-]
    zs : array-like
        mole fractions of each component, [-]
    CASRNs: list of strings
        CASRNs, not currently used [-]

    Returns
    -------
    omega : float
        acentric factor of the mixture, [-]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain omega with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Only 'SIMPLE' is accepted so far.
        All valid values are also held in the list omega_mixture_methods.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        omega for the desired chemical, and will return methods instead of
        omega

    Notes
    -----
    The only data used in the methods implemented to date are mole fractions
    and pure-component omegas. An alternate definition could be based on
    the dew point or bubble point of a multicomponent mixture, but this has
    not been done to date.

    References
    ----------
    .. [1] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition.
       New York: McGraw-Hill Professional, 2000.

r This function handles the calculation of a mixture s acentric factor . Calculation is based on the omegas provided for each pure component . Will automatically select a method to use if no Method is provided ; returns None if insufficient data is available .


def Func ( arg_0 , arg_1 : arg_2 ) : arg_3 = getattr ( logging , arg_1 ) arg_4 = ( 'aiohttp.access' , 'aiohttp.internal' , 'aiohttp.server' , 'aiohttp.web' , arg_0 . name ) for arg_5 in arg_4 : setup_logger ( arg_5 = arg_5 , stream = sys . stderr , arg_3 = arg_3 )

def Func(arg_0, arg_1: arg_2):
        """Setup logging for the application and aiohttp."""
        arg_3 = getattr(logging, arg_1)
        arg_4 = (
            'aiohttp.access', 'aiohttp.internal', 'aiohttp.server',
            'aiohttp.web', arg_0.name)
        for arg_5 in arg_4:
            setup_logger(arg_5=arg_5, stream=sys.stderr, arg_3=arg_3)

Setup logging for the application and aiohttp .


def Func ( arg_0 , arg_1 ) : if not arg_0 . _beating : arg_0 . _kernel_alive = True def ping_or_dead ( ) : arg_0 . hb_stream . flush ( ) if arg_0 . _kernel_alive : arg_0 . _kernel_alive = False arg_0 . hb_stream . send ( b'ping' ) arg_0 . hb_stream . flush ( ) else : try : arg_1 ( ) except : pass finally : arg_0 . stop_hb ( ) def beat_received ( arg_3 ) : arg_0 . _kernel_alive = True arg_0 . hb_stream . on_recv ( beat_received ) arg_4 = ioloop . IOLoop . instance ( ) arg_0 . _hb_periodic_callback = ioloop . PeriodicCallback ( ping_or_dead , arg_0 . time_to_dead * 1000 , arg_4 ) arg_4 . add_timeout ( time . time ( ) + arg_0 . first_beat , arg_0 . _really_Func ) arg_0 . _beating = True

def Func(arg_0, arg_1):
        """Start the heartbeating and call the callback if the kernel dies."""
        if not arg_0._beating:
            arg_0._kernel_alive = True

            def ping_or_dead():
                arg_0.hb_stream.flush()
                if arg_0._kernel_alive:
                    arg_0._kernel_alive = False
                    arg_0.hb_stream.send(b'ping')
                    # flush stream to force immediate socket send
                    arg_0.hb_stream.flush()
                else:
                    try:
                        arg_1()
                    except:
                        pass
                    finally:
                        arg_0.stop_hb()

            def beat_received(arg_3):
                arg_0._kernel_alive = True

            arg_0.hb_stream.on_recv(beat_received)
            arg_4 = ioloop.IOLoop.instance()
            arg_0._hb_periodic_callback = ioloop.PeriodicCallback(ping_or_dead, arg_0.time_to_dead*1000, arg_4)
            arg_4.add_timeout(time.time()+arg_0.first_beat, arg_0._really_Func)
            arg_0._beating= True

Start the heartbeating and call the callback if the kernel dies .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = dict ( ) arg_4 [ 'name' ] = arg_1 arg_4 [ 'folderId' ] = arg_2 if arg_3 : arg_4 [ 'token' ] = arg_3 arg_5 = arg_0 . request ( 'midas.item.searchbynameandfolder' , arg_4 ) return arg_5 [ 'items' ]

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Return all items with a given name and parent folder id.

        :param name: The name of the item to search by.
        :type name: string
        :param folder_id: The id of the parent folder to search by.
        :type folder_id: int | long
        :param token: (optional) A valid token for the user in question.
        :type token: None | string
        :returns: A list of all items with the given name and parent folder id.
        :rtype: list[dict]
        """
        arg_4 = dict()
        arg_4['name'] = arg_1
        arg_4['folderId'] = arg_2
        if arg_3:
            arg_4['token'] = arg_3
        arg_5 = arg_0.request('midas.item.searchbynameandfolder', arg_4)
        return arg_5['items']

Return all items with a given name and parent folder id .


(self, route, data, headers=None, failure_message=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_3 = arg_0 . _get_headers ( arg_3 ) arg_5 = ( lambda : requests . patch ( arg_0 . _get_qualified_route ( arg_1 ) , arg_3 = arg_3 , arg_2 = arg_2 , verify = False , proxies = arg_0 . proxies ) ) arg_6 = check_for_rate_limiting ( arg_5 ( ) , arg_5 ) return arg_0 . _handle_response ( arg_6 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """
        Execute a patch request and return the result
        """
        arg_3 = arg_0._get_headers(arg_3)
        arg_5 = (
            lambda: requests.patch(
                arg_0._get_qualified_route(arg_1), arg_3=arg_3, arg_2=arg_2, verify=False, proxies=arg_0.proxies
            )
        )
        arg_6 = check_for_rate_limiting(arg_5(), arg_5)
        return arg_0._handle_response(arg_6, arg_4)


(query,
                     corpus,
                     step=4,
                     flex=3,
                     case_sensitive=False)

return corpus[pos_left: pos_right].strip(), match_value

def Func(arg_0,
                     arg_1,
                     arg_2=4,
                     arg_3=3,
                     arg_4=False):
    """Return best matching substring of corpus.

    Parameters
    ----------
    query : str
    corpus : str
    step : int
        Step size of first match-value scan through corpus. Can be thought of
        as a sort of "scan resolution". Should not exceed length of query.
    flex : int
        Max. left/right substring position adjustment value. Should not
        exceed length of query / 2.

    Outputs
    -------
    output0 : str
        Best matching substring.
    output1 : float
        Match ratio of best matching substring. 1 is perfect match.

    """

    def ratio(arg_5, arg_6):
        """Compact alias for SequenceMatcher."""
        return SequenceMatcher(None, arg_5, arg_6).ratio()

    def scan_corpus(arg_2):
        """Return list of match values from corpus-wide scan."""
        arg_7 = []
        arg_8 = 0
        while arg_8 + arg_21 - arg_2 <= len(arg_1):
            arg_7.append(ratio(arg_0, arg_1[arg_8 : arg_8-1+arg_21]))
            arg_8 += arg_2
        return arg_7

    def index_max(arg_9):
        """Return index of max value."""
        return max(range(len(arg_9)), key=arg_9.__getitem__)

    def adjust_left_right_positions():
        """Return left/right positions for best string match."""
        # bp_* is synonym for 'Best Position Left/Right' and are adjusted
        # to optimize bmv_*
        arg_10, arg_11 = [arg_22] * 2
        arg_12, arg_13 = [arg_22 + arg_21] * 2

        # bmv_* are declared here in case they are untouched in optimization
        arg_14 = arg_7[round_decimal(arg_10 / arg_2)]
        arg_15 = arg_7[round_decimal(arg_12 / arg_2)]

        for arg_16 in range(arg_3):
            arg_17 = ratio(arg_0, arg_1[arg_10 - arg_16: arg_12])
            if arg_17 > arg_14:
                arg_14 = arg_17
                arg_11 = arg_10 - arg_16

            arg_18 = ratio(arg_0, arg_1[arg_10 + arg_16: arg_12])
            if arg_18 > arg_14:
                arg_14 = arg_18
                arg_11 = arg_10 + arg_16

            arg_19 = ratio(arg_0, arg_1[arg_10: arg_12 - arg_16])
            if arg_19 > arg_15:
                arg_15 = arg_19
                arg_13 = arg_12 - arg_16

            arg_20 = ratio(arg_0, arg_1[arg_10: arg_12 + arg_16])
            if arg_20 > arg_15:
                arg_15 = arg_20
                arg_13 = arg_12 + arg_16

        return arg_11, arg_13, ratio(arg_0, arg_1[arg_11 : arg_13])

    if not arg_4:
        arg_0 = arg_0.lower()
        arg_1 = arg_1.lower()

    arg_21 = len(arg_0)

    if arg_3 >= arg_21/2:
        print("Warning: flex exceeds length of query / 2. Setting to default.")
        arg_3 = 3

    arg_7 = scan_corpus(arg_2)
    arg_22 = index_max(arg_7) * arg_2

    arg_23, arg_24, arg_25 = adjust_left_right_positions()

    return arg_1[arg_23: arg_24].strip(), arg_25

Return best matching substring of corpus .


def Func ( arg_0 ) : arg_1 = [ ] while arg_0 : arg_1 . append ( _BYTES_TO_BITS [ arg_0 & 255 ] ) arg_0 >>= 8 arg_1 . reverse ( ) return '' . join ( arg_1 ) or 32 * '0'

def Func(arg_0):
    """Decimal to binary conversion."""
    arg_1 = []
    while arg_0:
        arg_1.append(_BYTES_TO_BITS[arg_0 & 255])
        arg_0 >>= 8
    arg_1.reverse()
    return ''.join(arg_1) or 32*'0'


Return the primary control channel of this qubit.

def
Func
(
arg_0
)
->
ControlChannel
:
if
arg_0
.
_Funcs
:
return
arg_0
.
_Funcs
[
0
]
else
:
raise
PulseError
(
"No Func channels in q[%d]"
%
arg_0
.
_index
)

def Func(arg_0) -> ControlChannel:
        """Return the primary Func channel of this qubit."""
        if arg_0._Funcs:
            return arg_0._Funcs[0]
        else:
            raise PulseError("No Func channels in q[%d]" % arg_0._index)

Return the primary control channel of this qubit .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if six . PY3 : arg_3 = time . perf_counter ( ) else : arg_3 = time . time ( ) yield if six . PY3 : arg_4 = time . perf_counter ( ) else : arg_4 = time . time ( ) arg_5 = arg_4 - arg_3 arg_0 . timing ( arg_1 , value = arg_5 * 1000.0 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """Contextmanager for easily computing timings.

        :arg string stat: A period delimited alphanumeric key.

        :arg list-of-strings tags: Each string in the tag consists of a key and
            a value separated by a colon. Tags can make it easier to break down
            metrics for analysis.

            For example ``['env:stage', 'compressed:yes']``.

        For example:

        >>> mymetrics = get_metrics(__name__)

        >>> def long_function():
        ...     with mymetrics.Func('long_function'):
        ...         # perform some thing we want to keep metrics on
        ...         pass

        .. Note::

           All timings generated with this are in milliseconds.

        """
        if six.PY3:
            arg_3 = time.perf_counter()
        else:
            arg_3 = time.time()

        yield

        if six.PY3:
            arg_4 = time.perf_counter()
        else:
            arg_4 = time.time()

        arg_5 = arg_4 - arg_3
        arg_0.timing(arg_1, value=arg_5 * 1000.0, arg_2=arg_2)

Contextmanager for easily computing timings.

        :arg string stat: A period delimited alphanumeric key.

        :arg list-of-strings tags: Each string in the tag consists of a key and
            a value separated by a colon. Tags can make it easier to break down
            metrics for analysis.

            For example ``['env:stage', 'compressed:yes']``.

        For example:

        >>> mymetrics = get_metrics(__name__)

        >>> def long_function():
        ...     with mymetrics.timer('long_function'):
        ...         # perform some thing we want to keep metrics on
        ...         pass

        .. Note::

           All timings generated with this are in milliseconds.

Contextmanager for easily computing timings .


(owner, attrname, distance_threshold, max_choices)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] arg_5 = _node_names ( arg_0 ) for arg_6 in arg_5 : if arg_6 == arg_1 : continue arg_7 = _string_distance ( arg_1 , arg_6 ) if arg_7 <= arg_2 : arg_4 . append ( ( arg_6 , arg_7 ) ) arg_8 = [ arg_6 for ( arg_6 , _ ) in heapq . nsmallest ( arg_3 , arg_4 , key = operator . itemgetter ( 1 ) ) ] return sorted ( arg_8 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Given an owner and a name, try to find similar names

    The similar names are searched given a distance metric and only
    a given number of choices will be returned.
    """
    arg_4 = []
    arg_5 = _node_names(arg_0)

    for arg_6 in arg_5:
        if arg_6 == arg_1:
            continue

        arg_7 = _string_distance(arg_1, arg_6)
        if arg_7 <= arg_2:
            arg_4.append((arg_6, arg_7))

    # Now get back the values with a minimum, up to the given
    # limit or choices.
    arg_8 = [
        arg_6
        for (arg_6, _) in heapq.nsmallest(
            arg_3, arg_4, key=operator.itemgetter(1)
        )
    ]
    return sorted(arg_8)

Given an owner and a name try to find similar names


def Func(arg_0, arg_1):
        '''Record Func records for a single document.

        Which Funces this creates depends on the parameters to the
        constructor.  This records all of the requested Funces for
        a single document.

        '''
        if not arg_1.body.clean_visible:
            logger.warn('stream item %s has no clean_visible part, '
                        'skipping keyword Funcing', arg_1.stream_id)
            return

        # Count tokens in si.clean_visible
        # We will recycle hash==0 for "# of documents"
        arg_2 = defaultdict(int)
        arg_2[arg_3] = 1
        arg_4 = defaultdict(int)
        arg_5 = arg_0.collect_words(arg_1)
        for arg_6, arg_7 in arg_5.iteritems():
            (arg_6, arg_8) = arg_0.make_hash_kw(arg_6)
            arg_2[arg_8] += arg_7
            arg_4[arg_6] = arg_8

        # Convert this and write it out
        if arg_0.hash_docs:
            (arg_9, arg_10) = key_for_stream_item(arg_1)
            arg_11 = [((h, arg_9, arg_10), n) for (h, n) in arg_2.iteritems()
                    if h != arg_3]
            arg_0.client.put(HASH_TF_INDEX_TABLE, *arg_11)

        if arg_0.hash_frequencies:
            arg_11 = [((h,), 1) for h in arg_2.iterkeys()]
            arg_0.client.increment(HASH_FREQUENCY_TABLE, *arg_11)

        if arg_0.hash_keywords:
            arg_11 = [((h, t), 1) for (t, h) in arg_4.iteritems()]
            arg_0.client.increment(HASH_KEYWORD_INDEX_TABLE, *arg_11)

Record index records for a single document.

        Which indexes this creates depends on the parameters to the
        constructor.  This records all of the requested indexes for
        a single document.

Record index records for a single document .


Just validates the given signed value.  Returns `True` if the
        signature exists and is valid, `False` otherwise.

def Func ( arg_0 , arg_1 , arg_2 = None ) : try : arg_0 . unsign ( arg_1 , arg_2 = arg_2 ) return True except BadSignature : return False

def Func(arg_0, arg_1, arg_2=None):
        """Just Funcs the given signed value.  Returns `True` if the
        signature exists and is valid, `False` otherwise."""
        try:
            arg_0.unsign(arg_1, arg_2=arg_2)
            return True
        except BadSignature:
            return False

Just validates the given signed value . Returns True if the signature exists and is valid False otherwise .


def
Func
(
arg_0
)
:
if
isinstance
(
arg_0
,
primitive_types
)
:
return
(
'primitive'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
sequence_types
)
:
return
(
'sequence'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
array_types
)
:
return
(
'array'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
key_value_types
)
:
return
(
'key-value'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
types
.
ModuleType
)
:
return
(
'module'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
(
types
.
FunctionType
,
types
.
MethodType
)
)
:
return
(
'function'
,
type
(
arg_0
)
.
__name__
)
if
isinstance
(
arg_0
,
type
)
:
if
hasattr
(
arg_0
,
'__dict__'
)
:
return
(
'class'
,
arg_0
.
__name__
)
if
isinstance
(
type
(
arg_0
)
,
type
)
:
if
hasattr
(
arg_0
,
'__dict__'
)
:
arg_1
=
type
(
arg_0
)
.
__name__
if
arg_1
==
'classobj'
:
arg_1
=
arg_0
.
__name__
return
(
'class'
,
'{}'
.
format
(
arg_1
)
)
if
arg_1
==
'instance'
:
arg_1
=
arg_0
.
__class__
.
__name__
return
(
'instance'
,
'{} instance'
.
format
(
arg_1
)
)
return
(
'unknown'
,
type
(
arg_0
)
.
__name__
)

def Func(arg_0):
    """Get type information for a Python object

    Args:
        obj: The Python object

    Returns:
        tuple: (object type "catagory", object type name)
    """
    if isinstance(arg_0, primitive_types):
        return ('primitive', type(arg_0).__name__)
    if isinstance(arg_0, sequence_types):
        return ('sequence', type(arg_0).__name__)
    if isinstance(arg_0, array_types):
        return ('array', type(arg_0).__name__)
    if isinstance(arg_0, key_value_types):
        return ('key-value', type(arg_0).__name__)
    if isinstance(arg_0, types.ModuleType):
        return ('module', type(arg_0).__name__)
    if isinstance(arg_0, (types.FunctionType, types.MethodType)):
        return ('function', type(arg_0).__name__)
    if isinstance(arg_0, type):
        if hasattr(arg_0, '__dict__'):
            return ('class', arg_0.__name__)
    if isinstance(type(arg_0), type):
        if hasattr(arg_0, '__dict__'):
            arg_1 = type(arg_0).__name__
            if arg_1 == 'classobj':
                arg_1 = arg_0.__name__
                return ('class', '{}'.format(arg_1))
            if arg_1 == 'instance':
                arg_1 = arg_0.__class__.__name__
            return ('instance', '{} instance'.format(arg_1))

    return ('unknown', type(arg_0).__name__)


return etree.tostring(self.to_xml(),
                              encoding=self.encoding,
                              xml_declaration=declaration,
                              pretty_print=indent
                              )

def Func ( arg_0 , arg_1 = True , arg_2 = True ) : return etree . tostring ( arg_0 . to_xml ( ) , encoding = arg_0 . encoding , xml_declaration = arg_2 , pretty_print = arg_1 )

def Func(arg_0, arg_1=True, arg_2=True):
        """Encodes the stored ``data`` to XML and returns a
        ``string``.

        Setting ``indent`` to ``False`` will forego any pretty-printing
        and return a condensed value.

        Setting ``declaration`` to ``False`` will skip inserting the
        XML declaration.
        """
        return etree.tostring(arg_0.to_xml(),
                              encoding=arg_0.encoding,
                              xml_declaration=arg_2,
                              pretty_print=arg_1
                              )

Encodes the stored data to XML and returns a string .


def Func ( arg_0 , arg_1 ) : while True : try : if not arg_0 ( arg_1 . peek ( ) ) : break yield next ( arg_1 ) except StopIteration : break

def Func(arg_0, arg_1):
	"""
	Like takewhile, but takes a peekable iterable and doesn't
	consume the non-matching item.

	>>> items = Peekable(range(10))
	>>> is_small = lambda n: n < 4

	>>> small_items = Func(is_small, items)

	>>> list(small_items)
	[0, 1, 2, 3]

	>>> list(items)
	[4, 5, 6, 7, 8, 9]

	>>> empty = Func(is_small, Peekable([]))
	>>> list(empty)
	[]

	>>> items = Peekable([3])
	>>> small_items = Func(is_small, items)
	>>> list(small_items)
	[3]
	>>> list(items)
	[]

	>>> items = Peekable([4])
	>>> small_items = Func(is_small, items)
	>>> list(small_items)
	[]
	>>> list(items)
	[4]
	"""
	while True:
		try:
			if not arg_0(arg_1.peek()):
				break
			yield next(arg_1)
		except StopIteration:
			break

Like takewhile, but takes a peekable iterable and doesn't
	consume the non-matching item.

	>>> items = Peekable(range(10))
	>>> is_small = lambda n: n < 4

	>>> small_items = takewhile_peek(is_small, items)

	>>> list(small_items)
	[0, 1, 2, 3]

	>>> list(items)
	[4, 5, 6, 7, 8, 9]

	>>> empty = takewhile_peek(is_small, Peekable([]))
	>>> list(empty)
	[]

	>>> items = Peekable([3])
	>>> small_items = takewhile_peek(is_small, items)
	>>> list(small_items)
	[3]
	>>> list(items)
	[]

	>>> items = Peekable([4])
	>>> small_items = takewhile_peek(is_small, items)
	>>> list(small_items)
	[]
	>>> list(items)
	[4]

Like takewhile but takes a peekable iterable and doesn t consume the non - matching item .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Perform an ADC read with the provided mux, gain, data_rate, and mode
        values.  Returns the signed integer result of the read.
        """
        arg_5 = ADS1x15_CONFIG_OS_SINGLE  # Go out of power-down mode for conversion.
        # Specify mux value.
        arg_5 |= (arg_1 & 0x07) << ADS1x15_CONFIG_MUX_OFFSET
        # Validate the passed in gain and then set it in the config.
        if arg_2 not in ADS1x15_CONFIG_GAIN:
            raise ValueError('Gain must be one of: 2/3, 1, 2, 4, 8, 16')
        arg_5 |= ADS1x15_CONFIG_GAIN[arg_2]
        # Set the mode (continuous or single shot).
        arg_5 |= arg_4
        # Get the default data rate if none is specified (default differs between
        # ADS1015 and ADS1115).
        if arg_3 is None:
            arg_3 = arg_0._data_rate_default()
        # Set the data rate (this is controlled by the subclass as it differs
        # between ADS1015 and ADS1115).
        arg_5 |= arg_0._data_rate_config(arg_3)
        arg_5 |= ADS1x15_CONFIG_COMP_QUE_DISABLE  # Disble comparator mode.
        # Send the config value to start the ADC conversion.
        # Explicitly break the 16-bit value down to a big endian pair of bytes.
        arg_0._device.writeList(ADS1x15_POINTER_CONFIG, [(arg_5 >> 8) & 0xFF, arg_5 & 0xFF])
        # Wait for the ADC sample to finish based on the sample rate plus a
        # small offset to be sure (0.1 millisecond).
        time.sleep(1.0/arg_3+0.0001)
        # Retrieve the result.
        arg_6 = arg_0._device.readList(ADS1x15_POINTER_CONVERSION, 2)
        return arg_0._conversion_value(arg_6[1], arg_6[0])

Perform an ADC read with the provided mux gain data_rate and mode values . Returns the signed integer result of the read .


def Func(arg_0, arg_1):
  """Convert field value pairs into regular message.

  Args:
    js: A JSON object to convert the field value pairs.
    message: A regular protocol message to record the data.

  Raises:
    ParseError: In case of problems converting.
  """
  arg_2 = []
  arg_3 = arg_1.DESCRIPTOR
  for arg_4 in arg_0:
    try:
      arg_5 = arg_3.fields_by_camelcase_name.get(arg_4, None)
      if not arg_5:
        raise ParseError(
            'Message type "{0}" has no field named "{1}".'.format(
                arg_3.full_name, arg_4))
      if arg_4 in arg_2:
        raise ParseError(
            'Message type "{0}" should not have multiple "{1}" fields.'.format(
                arg_1.DESCRIPTOR.full_name, arg_4))
      arg_2.append(arg_4)
      # Check no other oneof field is parsed.
      if arg_5.containing_oneof is not None:
        arg_6 = arg_5.containing_oneof.name
        if arg_6 in arg_2:
          raise ParseError('Message type "{0}" should not have multiple "{1}" '
                           'oneof fields.'.format(
                               arg_1.DESCRIPTOR.full_name, arg_6))
        arg_2.append(arg_6)

      arg_7 = arg_0[arg_4]
      if arg_7 is None:
        arg_1.ClearField(arg_5.name)
        continue

      # Parse field value.
      if _IsMapEntry(arg_5):
        arg_1.ClearField(arg_5.name)
        _ConvertMapFieldValue(arg_7, arg_1, arg_5)
      elif arg_5.label == descriptor.FieldDescriptor.LABEL_REPEATED:
        arg_1.ClearField(arg_5.name)
        if not isinstance(arg_7, list):
          raise ParseError('repeated field {0} must be in [] which is '
                           '{1}.'.format(arg_4, arg_7))
        if arg_5.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE:
          # Repeated message field.
          for arg_8 in arg_7:
            arg_9 = getattr(arg_1, arg_5.name).add()
            # None is a null_value in Value.
            if (arg_8 is None and
                arg_9.DESCRIPTOR.full_name != 'google.protobuf.Value'):
              raise ParseError('null is not allowed to be used as an element'
                               ' in a repeated field.')
            _ConvertMessage(arg_8, arg_9)
        else:
          # Repeated scalar field.
          for arg_8 in arg_7:
            if arg_8 is None:
              raise ParseError('null is not allowed to be used as an element'
                               ' in a repeated field.')
            getattr(arg_1, arg_5.name).append(
                _ConvertScalarFieldValue(arg_8, arg_5))
      elif arg_5.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE:
        arg_9 = getattr(arg_1, arg_5.name)
        _ConvertMessage(arg_7, arg_9)
      else:
        setattr(arg_1, arg_5.name, _ConvertScalarFieldValue(arg_7, arg_5))
    except ParseError as e:
      if arg_5 and arg_5.containing_oneof is None:
        raise ParseError('Failed to parse {0} field: {1}'.format(arg_4, e))
      else:
        raise ParseError(str(e))
    except ValueError as e:
      raise ParseError('Failed to parse {0} field: {1}.'.format(arg_4, e))
    except TypeError as e:
      raise ParseError('Failed to parse {0} field: {1}.'.format(arg_4, e))

Convert field value pairs into regular message .


return dict([
            (
                part.split('; ')[1][5:-1],
                part.split('; ')[0][1:-1],
            ) for part in field.split(', ')
        ])

def
Func
(
arg_0
)
:
if
not
arg_0
:
return
dict
(
)
return
dict
(
[
(
arg_1
.
split
(
'; '
)
[
1
]
[
5
:
1
]
,
arg_1
.
split
(
'; '
)
[
0
]
[
1
:
1
]
,
)
for
arg_1
in
arg_0
.
split
(
', '
)
]
)

def Func(arg_0):
        """ Utility for ripping apart github's Link header field.
        It's kind of ugly.
        """

        if not arg_0:
            return dict()

        return dict([
            (
                arg_1.split('; ')[1][5:-1],
                arg_1.split('; ')[0][1:-1],
            ) for arg_1 in arg_0.split(', ')
        ])

Utility for ripping apart github s Link header field . It s kind of ugly .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_hashes ( ) for arg_3 , arg_4 in arg_1 . items ( ) : arg_5 = arg_0 . get_hash ( arg_4 [ 'path' ] ) if arg_5 != arg_2 [ arg_4 [ 'path' ] ] : return False return True

def Func(arg_0, arg_1):
        """
        Compares the app deptree file hashes with the hashes stored in the
        cache.
        """
        arg_2 = arg_0.get_hashes()
        for arg_3, arg_4 in arg_1.items():
            arg_5 = arg_0.get_hash(arg_4['path'])
            if arg_5 != arg_2[arg_4['path']]:
                return False
        return True

Compares the app deptree file hashes with the hashes stored in the cache .


def Func ( arg_0 ) : class FuncCommand ( BaseCommand ) : def run ( arg_1 ) : arg_0 ( ) update_package_data ( arg_1 . distribution ) return FuncCommand

def Func(arg_0):
    """Create a command that calls the given function."""

    class FuncCommand(BaseCommand):

        def run(arg_1):
            arg_0()
            update_package_data(arg_1.distribution)

    return FuncCommand

Create a command that calls the given function .


def Func ( arg_0 , arg_1 , arg_2 ) : assert ( arg_2 in [ 'active' , 'completing' , 'completed' , 'killed' ] ) arg_3 = arg_0 . _state [ 'swarms' ] [ arg_1 ] if arg_3 [ 'status' ] == arg_2 : return if arg_3 [ 'status' ] == 'completed' and arg_2 == 'completing' : return arg_0 . _dirty = True arg_3 [ 'status' ] = arg_2 if arg_2 == 'completed' : ( arg_5 , arg_6 ) = arg_0 . _hsObj . _resultsDB . bestModelIdAndErrScore ( arg_1 ) arg_3 [ 'bestModelId' ] = arg_5 arg_3 [ 'bestErrScore' ] = arg_6 if arg_2 != 'active' and arg_1 in arg_0 . _state [ 'activeSwarms' ] : arg_0 . _state [ 'activeSwarms' ] . remove ( arg_1 ) if arg_2 == 'killed' : arg_0 . _hsObj . killSwarmParticles ( arg_1 ) arg_7 = arg_3 [ 'sprintIdx' ] arg_0 . isSprintActive ( arg_7 ) arg_8 = arg_0 . _state [ 'sprints' ] [ arg_7 ] arg_9 = dict ( active = 0 , completing = 0 , completed = 0 , killed = 0 ) arg_10 = [ ] arg_11 = [ ] for arg_12 in arg_0 . _state [ 'swarms' ] . itervalues ( ) : if arg_12 [ 'sprintIdx' ] != arg_7 : continue arg_9 [ arg_12 [ 'status' ] ] += 1 if arg_12 [ 'status' ] == 'completed' : arg_10 . append ( arg_12 [ 'bestModelId' ] ) arg_11 . append ( arg_12 [ 'bestErrScore' ] ) if arg_9 [ 'active' ] > 0 : arg_13 = 'active' elif arg_9 [ 'completing' ] > 0 : arg_13 = 'completing' else : arg_13 = 'completed' arg_8 [ 'status' ] = arg_13 if arg_13 == 'completed' : if len ( arg_11 ) > 0 : arg_14 = numpy . array ( arg_11 ) . argmin ( ) arg_8 [ 'bestModelId' ] = arg_10 [ arg_14 ] arg_8 [ 'bestErrScore' ] = arg_11 [ arg_14 ] else : arg_8 [ 'bestModelId' ] = 0 arg_8 [ 'bestErrScore' ] = numpy . inf arg_15 = numpy . inf for arg_16 in range ( arg_7 ) : if arg_0 . _state [ 'sprints' ] [ arg_16 ] [ 'status' ] == 'completed' : ( arg_17 , arg_6 ) = arg_0 . bestModelInCompletedSprint ( arg_16 ) if arg_6 is None : arg_6 = numpy . inf else : arg_6 = numpy . inf if arg_6 < arg_15 : arg_15 = arg_6 if arg_8 [ 'bestErrScore' ] >= arg_15 : arg_0 . _state [ 'lastGoodSprint' ] = arg_7 - 1 if arg_0 . _state [ 'lastGoodSprint' ] is not None and not arg_0 . anyGoodSprintsActive ( ) : arg_0 . _state [ 'searchOver' ] = True

def Func(arg_0, arg_1, arg_2):
    """Change the given swarm's state to 'newState'. If 'newState' is
    'completed', then bestModelId and bestErrScore must be provided.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:      swarm Id
    newStatus:    new status, either 'active', 'completing', 'completed', or
                    'killed'
    """
    assert (arg_2 in ['active', 'completing', 'completed', 'killed'])

    # Set the swarm status
    arg_3 = arg_0._state['swarms'][arg_1]
    if arg_3['status'] == arg_2:
      return

    # If some other worker noticed it as completed, setting it to completing
    #  is obviously old information....
    if arg_3['status'] == 'completed' and arg_2 == 'completing':
      return

    arg_0._dirty = True
    arg_3['status'] = arg_2
    if arg_2 == 'completed':
      (arg_5, arg_6) = arg_0._hsObj._resultsDB.bestModelIdAndErrScore(arg_1)
      arg_3['bestModelId'] = arg_5
      arg_3['bestErrScore'] = arg_6

    # If no longer active, remove it from the activeSwarms entry
    if arg_2 != 'active' and arg_1 in arg_0._state['activeSwarms']:
      arg_0._state['activeSwarms'].remove(arg_1)

    # If new status is 'killed', kill off any running particles in that swarm
    if arg_2=='killed':
      arg_0._hsObj.killSwarmParticles(arg_1)

    # In case speculative particles are enabled, make sure we generate a new
    #  swarm at this time if all of the swarms in the current sprint have
    #  completed. This will insure that we don't mark the sprint as completed
    #  before we've created all the possible swarms.
    arg_7 = arg_3['sprintIdx']
    arg_0.isSprintActive(arg_7)

    # Update the sprint status. Check all the swarms that belong to this sprint.
    #  If they are all completed, the sprint is completed.
    arg_8 = arg_0._state['sprints'][arg_7]

    arg_9 = dict(active=0, completing=0, completed=0, killed=0)
    arg_10 = []
    arg_11 = []
    for arg_12 in arg_0._state['swarms'].itervalues():
      if arg_12['sprintIdx'] != arg_7:
        continue
      arg_9[arg_12['status']] += 1
      if arg_12['status'] == 'completed':
        arg_10.append(arg_12['bestModelId'])
        arg_11.append(arg_12['bestErrScore'])

    if arg_9['active'] > 0:
      arg_13 = 'active'
    elif arg_9['completing'] > 0:
      arg_13 = 'completing'
    else:
      arg_13 = 'completed'
    arg_8['status'] = arg_13

    # If the sprint is complete, get the best model from all of its swarms and
    #  store that as the sprint best
    if arg_13 == 'completed':
      if len(arg_11) > 0:
        arg_14 = numpy.array(arg_11).argmin()
        arg_8['bestModelId'] = arg_10[arg_14]
        arg_8['bestErrScore'] = arg_11[arg_14]
      else:
        # This sprint was empty, most likely because all particles were
        #  killed. Give it a huge error score
        arg_8['bestModelId'] = 0
        arg_8['bestErrScore'] = numpy.inf

      # See if our best err score got NO BETTER as compared to a previous
      #  sprint. If so, stop exploring subsequent sprints (lastGoodSprint
      #  is no longer None).
      arg_15 = numpy.inf
      for arg_16 in range(arg_7):
        if arg_0._state['sprints'][arg_16]['status'] == 'completed':
          (arg_17, arg_6) = arg_0.bestModelInCompletedSprint(arg_16)
          if arg_6 is None:
            arg_6 = numpy.inf
        else:
          arg_6 = numpy.inf
        if arg_6 < arg_15:
          arg_15 = arg_6

      if arg_8['bestErrScore'] >= arg_15:
        arg_0._state['lastGoodSprint'] = arg_7-1

      # If ALL sprints up to the last good one are done, the search is now over
      if arg_0._state['lastGoodSprint'] is not None \
            and not arg_0.anyGoodSprintsActive():
        arg_0._state['searchOver'] = True

Change the given swarm s state to newState . If newState is completed then bestModelId and bestErrScore must be provided .


(model, filename, sort=False, pretty=False, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
**
arg_4
)
:
arg_5
=
model_to_dict
(
arg_0
,
arg_2
=
arg_2
)
arg_5
[
u"version"
]
=
JSON_SPEC
if
arg_3
:
arg_6
=
{
"indent"
:
4
,
"separators"
:
(
","
,
": "
)
,
"sort_keys"
:
True
,
"allow_nan"
:
False
}
else
:
arg_6
=
{
"indent"
:
0
,
"separators"
:
(
","
,
":"
)
,
"sort_keys"
:
False
,
"allow_nan"
:
False
}
arg_6
.
update
(
**
arg_4
)
if
isinstance
(
arg_1
,
string_types
)
:
with
open
(
arg_1
,
"w"
)
as
file_handle
:
json
.
dump
(
arg_5
,
file_handle
,
**
arg_6
)
else
:
json
.
dump
(
arg_5
,
arg_1
,
**
arg_6
)

def Func(arg_0, arg_1, arg_2=False, arg_3=False, **arg_4):
    """
    Write the cobra model to a file in JSON format.

    ``kwargs`` are passed on to ``json.dump``.

    Parameters
    ----------
    model : cobra.Model
        The cobra model to represent.
    filename : str or file-like
        File path or descriptor that the JSON representation should be
        written to.
    sort : bool, optional
        Whether to sort the metabolites, reactions, and genes or maintain the
        order defined in the model.
    pretty : bool, optional
        Whether to format the JSON more compactly (default) or in a more
        verbose but easier to read fashion. Can be partially overwritten by the
        ``kwargs``.

    See Also
    --------
    to_json : Return a string representation.
    json.dump : Base function.
    """
    arg_5 = model_to_dict(arg_0, arg_2=arg_2)
    arg_5[u"version"] = JSON_SPEC

    if arg_3:
        arg_6 = {
            "indent": 4, "separators": (",", ": "), "sort_keys": True,
            "allow_nan": False}
    else:
        arg_6 = {
            "indent": 0, "separators": (",", ":"), "sort_keys": False,
            "allow_nan": False}
    arg_6.update(**arg_4)

    if isinstance(arg_1, string_types):
        with open(arg_1, "w") as file_handle:
            json.dump(arg_5, file_handle, **arg_6)
    else:
        json.dump(arg_5, arg_1, **arg_6)

Write the cobra model to a file in JSON format .


(self, year, month, category=None, tag=None,
                         loc=False, cncl=False)

return self.model.objects.filter(
            # only events that are still repeating
            r & (dstart_mo | dend_mo) |  # yearly repeat
            (~Q(repeat="NEVER")) |  # all other repeats
            ((dstart_yr | dend_yr) & (dstart_mo | dend_yr)),  # non-repeating
            Q(end_repeat=None) | Q(end_repeat__gte=ym_first),
            start_date__lte=ym_last  # no events that haven't started yet
        ).filter(**kwargs).prefetch_related(*pref).order_by('start_date').distinct()

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = False , arg_6 = False ) : arg_7 = arg_0 . _get_kwargs ( arg_3 , arg_4 ) arg_8 , arg_9 = arg_0 . get_first_and_last ( arg_1 , arg_2 ) arg_10 = [ ] if arg_5 : arg_10 . append ( "location" ) if arg_6 : arg_10 . append ( "cancellations" ) arg_11 = Q ( repeat = "YEARLY" ) arg_12 = Q ( start_date__month = arg_2 ) arg_13 = Q ( end_date__month = arg_2 ) arg_14 = Q ( start_date__year = arg_1 ) arg_15 = Q ( end_date__year = arg_1 ) return arg_0 . model . objects . filter ( arg_11 & ( arg_12 | arg_13 ) | ( ~ Q ( repeat = "NEVER" ) ) | ( ( arg_14 | arg_15 ) & ( arg_12 | arg_15 ) ) , Q ( end_repeat = None ) | Q ( end_repeat__gte = arg_8 ) , start_date__lte = arg_9 ) . filter ( ** arg_7 ) . prefetch_related ( * arg_10 ) . order_by ( 'start_date' ) . distinct ( )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
                         arg_5=False, arg_6=False):
        """
        Returns all events that have an occurrence within the given
        month & year.
        """
        arg_7 = arg_0._get_kwargs(arg_3, arg_4)
        arg_8, arg_9 = arg_0.get_first_and_last(arg_1, arg_2)

        arg_10 = []
        if arg_5:
            arg_10.append("location")
        if arg_6:
            arg_10.append("cancellations")

        # for yearly repeat, we need to check the start and end date months
        # b/c yearly events should occur every year in the same month
        arg_11 = Q(repeat="YEARLY")
        arg_12 = Q(start_date__month=arg_2)
        arg_13 = Q(end_date__month=arg_2)

        arg_14 = Q(start_date__year=arg_1)
        arg_15 = Q(end_date__year=arg_1)

        return arg_0.model.objects.filter(
            # only events that are still repeating
            arg_11 & (arg_12 | arg_13) |  # yearly repeat
            (~Q(repeat="NEVER")) |  # all other repeats
            ((arg_14 | arg_15) & (arg_12 | arg_15)),  # non-repeating
            Q(end_repeat=None) | Q(end_repeat__gte=arg_8),
            start_date__lte=arg_9  # no events that haven't started yet
        ).filter(**arg_7).prefetch_related(*arg_10).order_by('start_date').distinct()

Returns all events that have an occurrence within the given month & year .


(max_simultaneous_processes, process_name,
                            filenames)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] while len ( arg_2 ) > 0 : while len ( arg_2 ) > 0 and len ( arg_3 ) < arg_0 : arg_4 = arg_2 . pop ( ) arg_3 . append ( service_start ( service = arg_1 , param = [ '-f' , arg_4 , '-d' , imported_day ] ) ) while len ( arg_3 ) == arg_0 : time . sleep ( sleep_timer ) arg_3 = update_running_pids ( arg_3 ) while len ( arg_3 ) > 0 : time . sleep ( sleep_timer ) arg_3 = update_running_pids ( arg_3 )

def Func(arg_0, arg_1,
                            arg_2):
    """
        Run processes which push the routing dump of the RIPE in a redis
        database.
        The dump has been splitted in multiple files and each process run
        on one of this files.
    """
    arg_3 = []
    while len(arg_2) > 0:
        while len(arg_2) > 0 and len(arg_3) < arg_0:
            arg_4 = arg_2.pop()
            arg_3.append(service_start(service=arg_1,
                                      param=['-f', arg_4, '-d',
                                             imported_day]))
        while len(arg_3) == arg_0:
            time.sleep(sleep_timer)
            arg_3 = update_running_pids(arg_3)
    while len(arg_3) > 0:
        # Wait until all the processes are finished
        time.sleep(sleep_timer)
        arg_3 = update_running_pids(arg_3)

Run processes which push the routing dump of the RIPE in a redis database . The dump has been splitted in multiple files and each process run on one of this files .


def Func ( arg_0 , * arg_1 ) : if len ( arg_1 ) == 0 : arg_2 = arange ( arg_0 . ndim - 1 , - 1 , - 1 ) else : arg_2 = asarray ( argpack ( arg_1 ) ) isFuncable ( arg_2 , range ( arg_0 . ndim ) ) arg_3 = arg_0 . split arg_4 , arg_5 = arg_2 [ : arg_3 ] , arg_2 [ arg_3 : ] arg_6 = sort ( arg_5 [ arg_5 < arg_3 ] ) arg_7 = sort ( arg_4 [ arg_4 >= arg_3 ] ) arg_8 = sort ( arg_4 [ arg_4 < arg_3 ] ) arg_9 = sort ( arg_5 [ arg_5 >= arg_3 ] ) arg_10 = r_ [ arg_8 , arg_7 , arg_6 , arg_9 ] arg_11 = argsort ( arg_10 ) arg_12 = arg_11 [ arg_2 ] arg_13 , arg_14 = arg_12 [ : arg_3 ] , arg_12 [ arg_3 : ] - arg_3 arg_15 = arg_0 . swap ( arg_6 , arg_7 - arg_3 ) arg_15 = arg_15 . keys . Func ( tuple ( arg_13 . tolist ( ) ) ) arg_15 = arg_15 . values . Func ( tuple ( arg_14 . tolist ( ) ) ) return arg_15

def Func(arg_0, *arg_1):
        """
        Return an array with the axes Funcd.

        This operation will incur a swap unless the
        desiured permutation can be obtained
        only by transpoing the keys or the values.

        Parameters
        ----------
        axes : None, tuple of ints, or n ints
            If None, will reverse axis order.
        """
        if len(arg_1) == 0:
            arg_2 = arange(arg_0.ndim-1, -1, -1)
        else:
            arg_2 = asarray(argpack(arg_1))

        isFuncable(arg_2, range(arg_0.ndim))

        arg_3 = arg_0.split

        # compute the keys/value axes that need to be swapped
        arg_4, arg_5 = arg_2[:arg_3], arg_2[arg_3:]
        arg_6 = sort(arg_5[arg_5 < arg_3])
        arg_7 = sort(arg_4[arg_4 >= arg_3])
        arg_8 = sort(arg_4[arg_4 < arg_3])
        arg_9 = sort(arg_5[arg_5 >= arg_3])

        # compute the permutation that the swap causes
        arg_10 = r_[arg_8, arg_7, arg_6, arg_9]

        # compute the extra permutation (p_x)  on top of this that
        # needs to happen to get the full permutation desired
        arg_11 = argsort(arg_10)
        arg_12 = arg_11[arg_2]
        arg_13, arg_14 = arg_12[:arg_3], arg_12[arg_3:]-arg_3

        # perform the swap and the the within key/value permutations
        arg_15 = arg_0.swap(arg_6, arg_7-arg_3)
        arg_15 = arg_15.keys.Func(tuple(arg_13.tolist()))
        arg_15 = arg_15.values.Func(tuple(arg_14.tolist()))

        return arg_15

Return an array with the axes transposed.

        This operation will incur a swap unless the
        desiured permutation can be obtained
        only by transpoing the keys or the values.

        Parameters
        ----------
        axes : None, tuple of ints, or n ints
            If None, will reverse axis order.

Return an array with the axes transposed .


def
Func
(
arg_0
,
arg_1
=
''
)
:
arg_2
=
arg_0
.
_ftp
.
pwd
(
)
arg_0
.
cd
(
arg_1
)
arg_3
=
[
]
arg_0
.
_ftp
.
retrlines
(
'LIST'
,
lambda
a
:
arg_3
.
append
(
a
)
)
arg_4
=
filter
(
lambda
a
:
a
.
split
(
)
[
0
]
.
startswith
(
'-'
)
,
arg_3
)
arg_5
=
filter
(
lambda
a
:
a
.
split
(
)
[
0
]
.
startswith
(
'd'
)
,
arg_3
)
arg_4
=
map
(
lambda
a
:
' '
.
join
(
a
.
split
(
)
[
8
:
]
)
,
arg_4
)
arg_5
=
map
(
lambda
a
:
' '
.
join
(
a
.
split
(
)
[
8
:
]
)
,
arg_5
)
arg_0
.
_ftp
.
cwd
(
arg_2
)
return
arg_4
,
arg_5

def Func(arg_0, arg_1=''):
        """ Lists the files and folders of a specific directory
        default is the current working directory.

        :param folder: the folder to be listed.
        :type folder: string

        :returns: a tuple with the list of files in the folder
                  and the list of subfolders in the folder.
        """
        arg_2 = arg_0._ftp.pwd()
        arg_0.cd(arg_1)
        arg_3 = []
        arg_0._ftp.retrlines('LIST', lambda a: arg_3.append(a))
        arg_4 = filter(lambda a: a.split()[0].startswith('-'), arg_3)
        arg_5 = filter(lambda a: a.split()[0].startswith('d'), arg_3)
        arg_4 = map(lambda a: ' '.join(a.split()[8:]), arg_4)
        arg_5 = map(lambda a: ' '.join(a.split()[8:]), arg_5)
        arg_0._ftp.cwd(arg_2)
        return arg_4, arg_5

Lists the files and folders of a specific directory default is the current working directory .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . concat ( [ arg_0 [ : arg_1 ] , tf . expand_dims ( arg_2 , axis = 0 ) , arg_0 [ ( arg_1 + 1 ) : ] ] , axis = 0 ) return arg_3

def Func(arg_0, arg_1, arg_2):
  """Replaces an element at supplied index."""
  arg_3 = tf.concat([arg_0[:arg_1], tf.expand_dims(arg_2, axis=0),
                     arg_0[(arg_1 + 1):]], axis=0)
  return arg_3


def
Func
(
arg_0
,
arg_1
:
arg_2
[
arg_3
.
Map
]
)
:
if
not
isinstance
(
arg_1
,
arg_3
.
Map
)
:
raise
TypeError
(
"meta must be a map"
)
if
inspect
.
iscoroutinefunction
(
arg_0
)
:
@
functools
.
wraps
(
arg_0
)
async
def
arg_7
(
*
arg_5
,
**
arg_6
)
:
return
await
arg_0
(
*
arg_5
,
**
arg_6
)
else
:
@
functools
.
wraps
(
arg_0
)
def
arg_7
(
*
arg_5
,
**
arg_6
)
:
return
arg_0
(
*
arg_5
,
**
arg_6
)
arg_7
.
meta
=
(
arg_0
.
meta
.
update
(
arg_1
)
if
hasattr
(
arg_0
,
"meta"
)
and
isinstance
(
arg_0
.
meta
,
arg_3
.
Map
)
else
arg_1
)
arg_7
.
with_meta
=
partial
(
Func
,
arg_7
)
return
arg_7

def Func(arg_0, arg_1: arg_2[arg_3.Map]):
    """Return a new function with the given meta. If the function f already
    has a meta map, then merge the """

    if not isinstance(arg_1, arg_3.Map):
        raise TypeError("meta must be a map")

    if inspect.iscoroutinefunction(arg_0):

        @functools.wraps(arg_0)
        async def arg_7(*arg_5, **arg_6):
            return await arg_0(*arg_5, **arg_6)

    else:

        @functools.wraps(arg_0)  # type: ignore
        def arg_7(*arg_5, **arg_6):
            return arg_0(*arg_5, **arg_6)

    arg_7.meta = (  # type: ignore
        arg_0.meta.update(arg_1)
        if hasattr(arg_0, "meta") and isinstance(arg_0.meta, arg_3.Map)
        else arg_1
    )
    arg_7.with_meta = partial(Func, arg_7)  # type: ignore
    return arg_7

Return a new function with the given meta . If the function f already has a meta map then merge the


def Func(arg_0, arg_1='json'):
    """
    Coerces content or all values of content if it is a dict to a string. The
    function will throw if content contains non-string or non-numeric types.

    The reason why we have this function is because the ``self.json`` field must be a
    dict with only string values. This is because ``render_template`` will fail
    for numerical values.
    """
    arg_2 = Func
    if isinstance(arg_0, six.string_types):
        return arg_0
    elif isinstance(arg_0, six.integer_types + (float,)):
        # Databricks can tolerate either numeric or string types in the API backend.
        return str(arg_0)
    elif isinstance(arg_0, (list, tuple)):
        return [arg_2(arg_4, '{0}[{1}]'.format(arg_1, arg_3)) for arg_3, arg_4 in enumerate(arg_0)]
    elif isinstance(arg_0, dict):
        return {arg_5: arg_2(arg_6, '{0}[{1}]'.format(arg_1, arg_5))
                for arg_5, arg_6 in list(arg_0.items())}
    else:
        arg_7 = type(arg_0)
        arg_8 = 'Type {0} used for parameter {1} is not a number or a string' \
            .format(arg_7, arg_1)
        raise AirflowException(arg_8)

Coerces content or all values of content if it is a dict to a string . The function will throw if content contains non - string or non - numeric types .


def
Func
(
arg_0
,
arg_1
=
True
)
:
raise
NotImplementedError
(
'To be implemented'
)
arg_0
.
filfile
.
seek
(
int
(
arg_0
.
datastart
)
)
arg_2
=
np
.
fromfile
(
arg_0
.
filfile
,
dtype
=
arg_0
.
dtype
)
.
reshape
(
arg_0
.
blocksize
,
arg_0
.
channels
)
if
arg_1
:
arg_2
=
arg_2
[
:
,
:
:
1
]
return
arg_2

def Func(arg_0,arg_1=True):
        """ read all the data.
            If reverse=True the x axis is flipped.
        """
        raise NotImplementedError('To be implemented')

        # go to start of the data
        arg_0.filfile.seek(int(arg_0.datastart))
        # read data into 2-D numpy array
#        data=np.fromfile(self.filfile,dtype=self.dtype).reshape(self.channels,self.blocksize,order='F')
        arg_2=np.fromfile(arg_0.filfile,dtype=arg_0.dtype).reshape(arg_0.blocksize, arg_0.channels)
        if arg_1:
            arg_2 = arg_2[:,::-1]
        return arg_2

read all the data . If reverse = True the x axis is flipped .


def
Func
(
arg_0
,
arg_1
=
"output"
)
:
arg_2
=
arg_0
[
"aggregate_reports"
]
arg_3
=
arg_0
[
"forensic_reports"
]
if
os
.
path
.
exists
(
arg_1
)
:
if
not
os
.
path
.
isdir
(
arg_1
)
:
raise
ValueError
(
"{0} is not a directory"
.
format
(
arg_1
)
)
else
:
os
.
makedirs
(
arg_1
)
with
open
(
"{0}"
.
format
(
os
.
path
.
join
(
arg_1
,
"aggregate.json"
)
)
,
"w"
,
newline
=
"\n"
,
encoding
=
"utf-8"
)
as
agg_json
:
agg_json
.
write
(
json
.
dumps
(
arg_2
,
ensure_ascii
=
False
,
indent
=
2
)
)
with
open
(
"{0}"
.
format
(
os
.
path
.
join
(
arg_1
,
"aggregate.csv"
)
)
,
"w"
,
newline
=
"\n"
,
encoding
=
"utf-8"
)
as
agg_csv
:
arg_4
=
parsed_aggregate_reports_to_csv
(
arg_2
)
agg_csv
.
write
(
arg_4
)
with
open
(
"{0}"
.
format
(
os
.
path
.
join
(
arg_1
,
"forensic.json"
)
)
,
"w"
,
newline
=
"\n"
,
encoding
=
"utf-8"
)
as
for_json
:
for_json
.
write
(
json
.
dumps
(
arg_3
,
ensure_ascii
=
False
,
indent
=
2
)
)
with
open
(
"{0}"
.
format
(
os
.
path
.
join
(
arg_1
,
"forensic.csv"
)
)
,
"w"
,
newline
=
"\n"
,
encoding
=
"utf-8"
)
as
for_csv
:
arg_4
=
parsed_forensic_reports_to_csv
(
arg_3
)
for_csv
.
write
(
arg_4
)
arg_5
=
os
.
path
.
join
(
arg_1
,
"samples"
)
if
not
os
.
path
.
exists
(
arg_5
)
:
os
.
makedirs
(
arg_5
)
arg_6
=
[
]
for
arg_7
in
arg_3
:
arg_8
=
arg_7
[
"sample"
]
arg_9
=
0
arg_10
=
arg_7
[
"parsed_sample"
]
arg_11
=
arg_10
[
"filename_safe_subject"
]
arg_12
=
arg_11
while
arg_12
in
arg_6
:
arg_9
+=
1
arg_12
=
"{0} ({1})"
.
format
(
arg_11
,
arg_9
)
arg_6
.
append
(
arg_12
)
arg_12
=
"{0}.eml"
.
format
(
arg_12
)
arg_13
=
os
.
path
.
join
(
arg_5
,
arg_12
)
with
open
(
arg_13
,
"w"
,
newline
=
"\n"
,
encoding
=
"utf-8"
)
as
sample_file
:
sample_file
.
write
(
arg_8
)

def Func(arg_0, arg_1="output"):
    """
    Save report data in the given directory

    Args:
        results (OrderedDict): Parsing results
        output_directory: The patch to the directory to save in
    """

    arg_2 = arg_0["aggregate_reports"]
    arg_3 = arg_0["forensic_reports"]

    if os.path.exists(arg_1):
        if not os.path.isdir(arg_1):
            raise ValueError("{0} is not a directory".format(arg_1))
    else:
        os.makedirs(arg_1)

    with open("{0}".format(os.path.join(arg_1, "aggregate.json")),
              "w", newline="\n", encoding="utf-8") as agg_json:
        agg_json.write(json.dumps(arg_2, ensure_ascii=False,
                                  indent=2))

    with open("{0}".format(os.path.join(arg_1, "aggregate.csv")),
              "w", newline="\n", encoding="utf-8") as agg_csv:
        arg_4 = parsed_aggregate_reports_to_csv(arg_2)
        agg_csv.write(arg_4)

    with open("{0}".format(os.path.join(arg_1, "forensic.json")),
              "w", newline="\n", encoding="utf-8") as for_json:
        for_json.write(json.dumps(arg_3, ensure_ascii=False,
                                  indent=2))

    with open("{0}".format(os.path.join(arg_1, "forensic.csv")),
              "w", newline="\n", encoding="utf-8") as for_csv:
        arg_4 = parsed_forensic_reports_to_csv(arg_3)
        for_csv.write(arg_4)

    arg_5 = os.path.join(arg_1, "samples")
    if not os.path.exists(arg_5):
        os.makedirs(arg_5)

    arg_6 = []
    for arg_7 in arg_3:
        arg_8 = arg_7["sample"]
        arg_9 = 0
        arg_10 = arg_7["parsed_sample"]
        arg_11 = arg_10["filename_safe_subject"]
        arg_12 = arg_11

        while arg_12 in arg_6:
            arg_9 += 1
            arg_12 = "{0} ({1})".format(arg_11, arg_9)

        arg_6.append(arg_12)

        arg_12 = "{0}.eml".format(arg_12)
        arg_13 = os.path.join(arg_5, arg_12)
        with open(arg_13, "w", newline="\n", encoding="utf-8") as sample_file:
            sample_file.write(arg_8)


return from_arrays(**{k: np.array([v]) for k, v in kwargs.items()})

def Func ( ** arg_0 ) : import numpy as np return from_arrays ( ** { arg_1 : np . array ( [ arg_2 ] ) for arg_1 , arg_2 in arg_0 . items ( ) } )

def Func(**arg_0):
    """Similar to from_arrays, but convenient for a DataFrame of length 1.

    Example:

    >>> import vaex
    >>> df = vaex.Func(x=1, y=2)

    :rtype: DataFrame
    """
    import numpy as np
    return from_arrays(**{arg_1: np.array([arg_2]) for arg_1, arg_2 in arg_0.items()})

Similar to from_arrays, but convenient for a DataFrame of length 1.

    Example:

    >>> import vaex
    >>> df = vaex.from_scalars(x=1, y=2)

    :rtype: DataFrame

Similar to from_arrays but convenient for a DataFrame of length 1 .


def Func ( arg_0 ) : if arg_0 . _Func_to_value is None : arg_0 . _Func_to_value = { str ( d ) : v for d , v in zip ( arg_0 . _descriptors , arg_0 . _values ) } return GetValueByName ( arg_0 . _Func_to_value )

def Func(arg_0):
        r"""Access descriptor value by descriptor Func or instance.

        >>> from mordred import Calculator, descriptors
        >>> from rdkit import Chem
        >>> result = Calculator(descriptors)(Chem.MolFromSmiles("C1CCCCC1"))
        >>> result.Func["C2SP3"]
        6

        """
        if arg_0._Func_to_value is None:
            arg_0._Func_to_value = {str(d): v for d, v in zip(arg_0._descriptors, arg_0._values)}

        return GetValueByName(arg_0._Func_to_value)

r"""Access descriptor value by descriptor name or instance.

        >>> from mordred import Calculator, descriptors
        >>> from rdkit import Chem
        >>> result = Calculator(descriptors)(Chem.MolFromSmiles("C1CCCCC1"))
        >>> result.name["C2SP3"]
        6

r Access descriptor value by descriptor name or instance .


def Func(arg_0, arg_1, arg_2):
        """
        This internal helper does the common work for
        ``set_ocsp_server_callback`` and ``set_ocsp_client_callback``, which is
        almost all of it.
        """
        arg_0._ocsp_helper = arg_1
        arg_0._ocsp_callback = arg_1.callback
        if arg_2 is None:
            arg_0._ocsp_data = _ffi.NULL
        else:
            arg_0._ocsp_data = _ffi.new_handle(arg_2)

        arg_6 = _lib.SSL_CTX_set_tlsext_status_cb(
            arg_0._context, arg_0._ocsp_callback
        )
        _openssl_assert(arg_6 == 1)
        arg_6 = _lib.SSL_CTX_set_tlsext_status_arg(arg_0._context, arg_0._ocsp_data)
        _openssl_assert(arg_6 == 1)

This internal helper does the common work for set_ocsp_server_callback and set_ocsp_client_callback which is almost all of it .


def Func(arg_0, arg_1):
        """
        Return a ConfigNode object representing a child node with the specified
        relative path.
        """
        if arg_0._path:
            arg_1 = '{}.{}'.format(arg_0._path, arg_1)
        return ConfigNode(root=arg_0._root, arg_1=arg_1)

Return a ConfigNode object representing a child node with the specified relative path .