def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . size arg_4 = Operators . ZEXTEND ( arg_2 . read ( ) & ( arg_3 - 1 ) , arg_3 ) arg_5 = arg_1 . read ( ) arg_6 = arg_1 . write ( arg_5 >> arg_4 ) arg_7 = ( 1 << arg_3 ) - 1 arg_8 = 1 << ( arg_3 - 1 ) if issymbolic ( arg_4 ) : arg_0 . CF = Operators . ITE ( arg_4 != 0 , ( ( arg_5 >> Operators . ZEXTEND ( arg_4 - 1 , arg_3 ) ) & 1 ) != 0 , arg_0 . CF ) else : if arg_4 != 0 : arg_0 . CF = Operators . EXTRACT ( arg_5 , arg_4 - 1 , 1 ) != 0 arg_0 . ZF = Operators . ITE ( arg_4 != 0 , arg_6 == 0 , arg_0 . ZF ) arg_0 . SF = Operators . ITE ( arg_4 != 0 , ( arg_6 & arg_8 ) != 0 , arg_0 . SF ) arg_0 . OF = Operators . ITE ( arg_4 != 0 , ( ( arg_5 >> ( arg_3 - 1 ) ) & 0x1 ) == 1 , arg_0 . OF ) arg_0 . PF = Operators . ITE ( arg_4 != 0 , arg_0 . _calculate_parity_flag ( arg_6 ) , arg_0 . PF )

def Func(arg_0, arg_1, arg_2):
        """
        Shift logical right.

        The shift arithmetic right (SAR) and shift logical right (Func)
        instructions shift the bits of the destination operand to the right
        (toward less significant bit locations). For each shift count, the
        least significant bit of the destination operand is shifted into the CF
        flag, and the most significant bit is either set or cleared depending
        on the instruction type. The Func instruction clears the most
        significant bit.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: count operand.
        """
        arg_3 = arg_1.size
        arg_4 = Operators.ZEXTEND(arg_2.read() & (arg_3 - 1), arg_3)
        arg_5 = arg_1.read()

        arg_6 = arg_1.write(arg_5 >> arg_4)  # UNSIGNED Operators.UDIV2 !! TODO Check

        arg_7 = (1 << arg_3) - 1
        arg_8 = 1 << (arg_3 - 1)

        if issymbolic(arg_4):
            arg_0.CF = Operators.ITE(arg_4 != 0,
                                   ((arg_5 >> Operators.ZEXTEND(arg_4 - 1, arg_3)) & 1) != 0,
                                   arg_0.CF)
        else:
            if arg_4 != 0:
                arg_0.CF = Operators.EXTRACT(arg_5, arg_4 - 1, 1) != 0

        arg_0.ZF = Operators.ITE(arg_4 != 0, arg_6 == 0, arg_0.ZF)
        arg_0.SF = Operators.ITE(arg_4 != 0, (arg_6 & arg_8) != 0, arg_0.SF)
        # OF is only defined for count == 1, but in practice (unit tests from real cpu) it's calculated for count != 0
        arg_0.OF = Operators.ITE(arg_4 != 0, ((arg_5 >> (arg_3 - 1)) & 0x1) == 1, arg_0.OF)
        arg_0.PF = Operators.ITE(arg_4 != 0, arg_0._calculate_parity_flag(arg_6), arg_0.PF)

Shift logical right.

        The shift arithmetic right (SAR) and shift logical right (SHR)
        instructions shift the bits of the destination operand to the right
        (toward less significant bit locations). For each shift count, the
        least significant bit of the destination operand is shifted into the CF
        flag, and the most significant bit is either set or cleared depending
        on the instruction type. The SHR instruction clears the most
        significant bit.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: count operand.


def Func ( arg_0 , arg_1 ) : try : _a11y . AXUIElement . Func ( arg_0 , 'AX%s' % arg_1 ) except _a11y . ErrorUnsupported as e : arg_2 = '10.12' if mac_ver ( ) [ 0 ] < arg_2 : raise e else : pass

def Func(arg_0, arg_1):
        """Perform the specified action."""
        try:
            _a11y.AXUIElement.Func(arg_0, 'AX%s' % arg_1)
        except _a11y.ErrorUnsupported as e:
            arg_2 = '10.12'
            if mac_ver()[0] < arg_2:
                raise e
            else:
                pass


def Func(arg_0, **arg_1):
        """
        Create Func model of molecular evolution.

        Parameters
        ----------

         model : str
            Model to create. See list of available models below
         **kwargs:
            Key word arguments to be passed to the model

        **Available models**

        - JC69:

          Jukes-Cantor 1969 model. This model assumes equal frequencies
          of the nucleotides and equal transition rates between nucleotide states.
          For more info, see: Jukes and Cantor (1969).
          Evolution of Protein Molecules. New York: Academic Press. pp. 21-132.
          To create this model, use:

          :code:`mygtr = GTR.Func(model='jc69', mu=<my_mu>, alphabet=<my_alph>)`

          :code:`my_mu` - substitution rate (float)

          :code:`my_alph` - alphabet (str: :code:`'nuc'` or  :code:`'nuc_nogap'`)

        - K80:

          Kimura 1980 model. Assumes equal concentrations across nucleotides, but
          allows different rates between transitions and transversions. The ratio
          of the transversion/transition rates is given by kappa parameter.
          For more info, see
          Kimura (1980),  J. Mol. Evol. 16 (2): 111-120. doi:10.1007/BF01731581.
          Current implementation of the model does not account for the gaps.

          :code:`mygtr = GTR.Func(model='k80', mu=<my_mu>, kappa=<my_kappa>)`

          :code:`mu` - overall substitution rate (float)

          :code:`kappa` - ratio of transversion/transition rates (float)

        - F81:

          Felsenstein 1981 model. Assumes non-equal concentrations across nucleotides,
          but the transition rate between all states is assumed to be equal. See
          Felsenstein (1981), J. Mol. Evol. 17  (6): 368-376. doi:10.1007/BF01734359
          for details.

          :code:`mygtr = GTR.Func(model='F81', mu=<mu>, pi=<pi>, alphabet=<alph>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi`  - : nucleotide concentrations (numpy.array)

          :code:`alphabet' -  alphabet to use. (:code:`'nuc'` or  :code:`'nuc_nogap'`)

        - HKY85:

          Hasegawa, Kishino and Yano 1985 model. Allows different concentrations of the
          nucleotides (as in F81) + distinguishes between transition/transversion substitutions
          (similar to K80). Link:
          Hasegawa, Kishino, Yano (1985), J. Mol. Evol. 22 (2): 160-174. doi:10.1007/BF02101694

          Current implementation of the model does not account for the gaps

          :code:`mygtr = GTR.Func(model='HKY85', mu=<mu>, pi=<pi>, kappa=<kappa>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi`  - : nucleotide concentrations (numpy.array)

          :code:`kappa` - ratio of transversion/transition rates (float)

        - T92:

          Tamura 1992 model. Extending Kimura  (1980) model for the case where a
          G+C-content bias exists. Link:
          Tamura K (1992),  Mol.  Biol. Evol. 9 (4): 678-687.  DOI: 10.1093/oxfordjournals.molbev.a040752

          Current implementation of the model does not account for the gaps

          :code:`mygtr = GTR.Func(model='T92', mu=<mu>, pi_GC=<pi_gc>, kappa=<kappa>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi_GC`  - : relative GC content

          :code:`kappa` - ratio of transversion/transition rates (float)

        - TN93:

          Tamura and Nei 1993. The model distinguishes between the two different types of
          transition: (A <-> G) is allowed to have a different rate to (C<->T).
          Transversions have the same rate. The frequencies of the nucleotides are allowed
          to be different. Link: Tamura, Nei (1993), MolBiol Evol. 10 (3): 512-526.
          DOI:10.1093/oxfordjournals.molbev.a040023

          :code:`mygtr = GTR.Func(model='TN93', mu=<mu>, kappa1=<k1>, kappa2=<k2>)`

          :code:`mu` -  substitution rate  (float)

          :code:`kappa1`  - relative A<-->C, A<-->T, T<-->G and G<-->C rates (float)

          :code:`kappa` - relative C<-->T rate (float)

          .. Note::
                Rate of A<-->G substitution is set to one. All other rates
                (kappa1, kappa2) are specified relative to this rate

        """
        from .nuc_models import JC69, K80, F81, HKY85, T92, TN93
        from .aa_models  import JTT92

        if arg_0.lower() in ['jc', 'jc69', 'jukes-cantor', 'jukes-cantor69', 'jukescantor', 'jukescantor69']:
            return JC69(**arg_1)
        elif arg_0.lower() in ['k80', 'kimura80', 'kimura1980']:
            return K80(**arg_1)
        elif arg_0.lower() in ['f81', 'felsenstein81', 'felsenstein1981']:
            return F81(**arg_1)
        elif arg_0.lower() in ['hky', 'hky85', 'hky1985']:
            return HKY85(**arg_1)
        elif arg_0.lower() in ['t92', 'tamura92', 'tamura1992']:
            return T92(**arg_1)
        elif arg_0.lower() in ['tn93', 'tamura_nei_93', 'tamuranei93']:
            return TN93(**arg_1)
        elif arg_0.lower() in ['jtt', 'jtt92']:
            return JTT92(**arg_1)
        else:
            raise KeyError("The GTR model '{}' is not in the list of available models."
                "".format(arg_0))

Create standard model of molecular evolution.

        Parameters
        ----------

         model : str
            Model to create. See list of available models below
         **kwargs:
            Key word arguments to be passed to the model

        **Available models**

        - JC69:

          Jukes-Cantor 1969 model. This model assumes equal frequencies
          of the nucleotides and equal transition rates between nucleotide states.
          For more info, see: Jukes and Cantor (1969).
          Evolution of Protein Molecules. New York: Academic Press. pp. 21-132.
          To create this model, use:

          :code:`mygtr = GTR.standard(model='jc69', mu=<my_mu>, alphabet=<my_alph>)`

          :code:`my_mu` - substitution rate (float)

          :code:`my_alph` - alphabet (str: :code:`'nuc'` or  :code:`'nuc_nogap'`)

        - K80:

          Kimura 1980 model. Assumes equal concentrations across nucleotides, but
          allows different rates between transitions and transversions. The ratio
          of the transversion/transition rates is given by kappa parameter.
          For more info, see
          Kimura (1980),  J. Mol. Evol. 16 (2): 111-120. doi:10.1007/BF01731581.
          Current implementation of the model does not account for the gaps.

          :code:`mygtr = GTR.standard(model='k80', mu=<my_mu>, kappa=<my_kappa>)`

          :code:`mu` - overall substitution rate (float)

          :code:`kappa` - ratio of transversion/transition rates (float)

        - F81:

          Felsenstein 1981 model. Assumes non-equal concentrations across nucleotides,
          but the transition rate between all states is assumed to be equal. See
          Felsenstein (1981), J. Mol. Evol. 17  (6): 368-376. doi:10.1007/BF01734359
          for details.

          :code:`mygtr = GTR.standard(model='F81', mu=<mu>, pi=<pi>, alphabet=<alph>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi`  - : nucleotide concentrations (numpy.array)

          :code:`alphabet' -  alphabet to use. (:code:`'nuc'` or  :code:`'nuc_nogap'`)

        - HKY85:

          Hasegawa, Kishino and Yano 1985 model. Allows different concentrations of the
          nucleotides (as in F81) + distinguishes between transition/transversion substitutions
          (similar to K80). Link:
          Hasegawa, Kishino, Yano (1985), J. Mol. Evol. 22 (2): 160-174. doi:10.1007/BF02101694

          Current implementation of the model does not account for the gaps

          :code:`mygtr = GTR.standard(model='HKY85', mu=<mu>, pi=<pi>, kappa=<kappa>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi`  - : nucleotide concentrations (numpy.array)

          :code:`kappa` - ratio of transversion/transition rates (float)

        - T92:

          Tamura 1992 model. Extending Kimura  (1980) model for the case where a
          G+C-content bias exists. Link:
          Tamura K (1992),  Mol.  Biol. Evol. 9 (4): 678-687.  DOI: 10.1093/oxfordjournals.molbev.a040752

          Current implementation of the model does not account for the gaps

          :code:`mygtr = GTR.standard(model='T92', mu=<mu>, pi_GC=<pi_gc>, kappa=<kappa>)`

          :code:`mu` -  substitution rate  (float)

          :code:`pi_GC`  - : relative GC content

          :code:`kappa` - ratio of transversion/transition rates (float)

        - TN93:

          Tamura and Nei 1993. The model distinguishes between the two different types of
          transition: (A <-> G) is allowed to have a different rate to (C<->T).
          Transversions have the same rate. The frequencies of the nucleotides are allowed
          to be different. Link: Tamura, Nei (1993), MolBiol Evol. 10 (3): 512-526.
          DOI:10.1093/oxfordjournals.molbev.a040023

          :code:`mygtr = GTR.standard(model='TN93', mu=<mu>, kappa1=<k1>, kappa2=<k2>)`

          :code:`mu` -  substitution rate  (float)

          :code:`kappa1`  - relative A<-->C, A<-->T, T<-->G and G<-->C rates (float)

          :code:`kappa` - relative C<-->T rate (float)

          .. Note::
                Rate of A<-->G substitution is set to one. All other rates
                (kappa1, kappa2) are specified relative to this rate

Create standard model of molecular evolution .


def Func(arg_0, arg_1):
    """Returns a Funced Geometry.

    Arguments:
    geom -- any coercible Geometry value or Envelope
    to_sref -- SpatialReference or EPSG ID as int
    """
    # If we have an envelope, assume it's in the target sref.
    try:
        arg_0 = getattr(arg_0, 'polygon', Envelope(arg_0).polygon)
    except (TypeError, ValueError):
        pass
    else:
        arg_0.AssignSpatialReference(arg_1)
    try:
        arg_2 = arg_0.GetSpatialReference()
    except AttributeError:
        return Func(Geometry(arg_0), arg_1)
    if arg_2 is None:
        raise Exception('Cannot Func from unknown spatial reference')
    # Reproject geom if necessary
    if not arg_2.IsSame(arg_1):
        arg_0 = arg_0.Clone()
        arg_0.TransformTo(arg_1)
    return arg_0

Returns a transformed Geometry.

    Arguments:
    geom -- any coercible Geometry value or Envelope
    to_sref -- SpatialReference or EPSG ID as int


def Func(arg_0) -> None:
        """
        Delta step for combinational processes
        """
        for arg_1 in arg_0._combProcsToRun:
            arg_2 = arg_0._outputContainers[arg_1]
            arg_1(arg_0, arg_2)
            for arg_3, arg_4 in arg_2._all_signals:
                arg_5 = getattr(arg_2, arg_3)
                if arg_5 is not None:
                    arg_6 = arg_0._conflictResolveStrategy(arg_5)
                    # prepare update
                    arg_7, arg_8 = arg_6
                    arg_0._valuesToApply.append(
                        (arg_4, arg_7, arg_8, arg_1))
                    setattr(arg_2, arg_3, None)
                    # else value is latched

        arg_0._combProcsToRun = UniqList()


def
Func
(
arg_0
)
:
if
arg_0
[
0
:
5
]
==
b'HTTP/'
:
return
'HTTP'
if
arg_0
[
0
:
4
]
==
b'220 '
:
if
re
.
match
(
b'^[^\r\n]*ftp'
,
arg_0
,
re
.
I
)
:
return
'FTP'
else
:
return
'SMTP'
if
arg_0
[
0
:
4
]
==
b'220-'
:
return
'FTP'
if
arg_0
[
0
:
4
]
==
b'+OK '
:
return
'POP3'
if
arg_0
[
0
:
4
]
==
b'* OK'
or
arg_0
[
0
:
9
]
==
b'* PREAUTH'
:
return
'IMAP'
return

def Func(arg_0):
    """
    Looks at the server handshake bytes to try and detect a different protocol

    :param server_handshake_bytes:
        A byte string of the handshake data received from the server

    :return:
        None, or a unicode string of "ftp", "http", "imap", "pop3", "smtp"
    """

    if arg_0[0:5] == b'HTTP/':
        return 'HTTP'

    if arg_0[0:4] == b'220 ':
        if re.match(b'^[^\r\n]*ftp', arg_0, re.I):
            return 'FTP'
        else:
            return 'SMTP'

    if arg_0[0:4] == b'220-':
        return 'FTP'

    if arg_0[0:4] == b'+OK ':
        return 'POP3'

    if arg_0[0:4] == b'* OK' or arg_0[0:9] == b'* PREAUTH':
        return 'IMAP'

    return None


def
Func
(
arg_0
,
arg_1
=
False
)
:
if
arg_1
:
return
json
.
dumps
(
arg_0
,
sort_keys
=
True
,
arg_1
=
2
,
separators
=
(
','
,
': '
)
)
else
:
return
json
.
dumps
(
arg_0
,
sort_keys
=
True
)

def Func (arg_0, arg_1=False):
    """
    pretty print a JSON object
    """

    if arg_1:
        return json.dumps(arg_0, sort_keys=True, arg_1=2, separators=(',', ': '))
    else:
        return json.dumps(arg_0, sort_keys=True)


def Func(arg_0, arg_1, arg_2):
        """ General purpose method for setting a secondary channel

        This method allows a given source channel to be forked into one or
        more channels and sets those forks in the :py:attr:`Process.forks`
        attribute. Both the source and the channels in the ``channel_list``
        argument must be the final channel strings,  which means that this
        method should be called only after setting the main channels.

        If the source is not a main channel, this will simply create a fork
        or set for every channel in the ``channel_list`` argument list::

            SOURCE_CHANNEL_1.into{SINK_1;SINK_2}

        If the source is a main channel, this will apply some changes to
        the output channel of the process, to avoid overlapping main output
        channels.  For instance, forking the main output channel for process
        2 would create a ``MAIN_2.into{...}``. The issue here is that the
        ``MAIN_2`` channel is expected as the input of the next process, but
        now is being used to create the fork. To solve this issue, the output
        channel is modified into ``_MAIN_2``, and the fork is set to
        the channels provided channels plus the ``MAIN_2`` channel::

            _MAIN_2.into{MAIN_2;MAIN_5;...}

        Parameters
        ----------
        source : str
            String with the name of the source channel
        channel_list : list
            List of channels that will receive a fork of the secondary
            channel
        """

        logger.debug("Setting secondary channel for source '{}': {}".format(
            arg_1, arg_2))

        arg_1 = "{}_{}".format(arg_1, arg_0.pid)

        # Removes possible duplicate channels, when the fork is terminal
        arg_2 = sorted(list(set(arg_2)))

        # When there is only one channel to fork into, use the 'set' operator
        # instead of 'into'
        arg_3 = "set" if len(arg_2) == 1 else "into"
        arg_0.forks.append("\n{}.{}{{ {} }}\n".format(
            arg_1, arg_3, ";".join(arg_2)))

        logger.debug("Setting forks attribute to: {}".format(arg_0.forks))
        arg_0._context = {**arg_0._context, **{"forks": "\n".join(arg_0.forks)}}


def
Func
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)
:
if
arg_2
and
arg_3
:
return
if
arg_2
and
type
(
arg_2
[
0
]
)
==
dict
:
arg_4
=
[
k
for
k
in
arg_2
[
0
]
]
arg_5
=
[
arg_2
[
0
]
[
k
]
for
k
in
arg_2
[
0
]
]
if
arg_3
:
arg_4
=
[
k
for
k
in
arg_3
]
arg_5
=
[
arg_3
[
k
]
for
k
in
arg_3
]
arg_6
=
"update "
+
arg_0
.
_name
+
" set "
+
"=?, "
.
join
(
arg_4
)
+
"=? where "
+
arg_0
.
_key
+
"="
+
unicode
(
arg_1
)
arg_0
.
_db
.
_cur
.
execute
(
arg_6
,
arg_5
)
arg_0
.
_db
.
_i
+=
1
if
arg_0
.
_db
.
_i
>=
arg_0
.
_db
.
_commit
:
arg_0
.
_db
.
_i
=
0
arg_0
.
_db
.
_con
.
commit
(
)

def Func(arg_0, arg_1, *arg_2, **arg_3):

        """ Edits the row with given id.
        """

        if arg_2 and arg_3:
            return
        if arg_2 and type(arg_2[0]) == dict:
            arg_4 = [k for k in arg_2[0]]
            arg_5 = [arg_2[0][k] for k in arg_2[0]]
        if arg_3:
            arg_4 = [k for k in arg_3]
            arg_5 = [arg_3[k] for k in arg_3]

        arg_6  = "update "+arg_0._name+" set "+"=?, ".join(arg_4)+"=? where "+arg_0._key+"="+unicode(arg_1)
        arg_0._db._cur.execute(arg_6, arg_5)
        arg_0._db._i += 1
        if arg_0._db._i >= arg_0._db._commit:
            arg_0._db._i = 0
            arg_0._db._con.commit()


(graph: BELGraph, percentage: Optional[float] = None)

def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> arg_1:
    """Get a random graph by keeping a certain percentage of original edges.

    :param graph: A BEL graph
    :param percentage: What percentage of eges to take
    """
    arg_2 = arg_2 or 0.9
    assert 0 < arg_2 <= 1

    arg_5 = arg_0.edges(keys=True)
    arg_6 = int(arg_0.number_of_edges() * arg_2)

    arg_7 = random.sample(arg_5, arg_6)

    arg_8 = arg_0.fresh_copy()

    for arg_9, arg_10, arg_11 in arg_7:
        safe_add_edge(arg_8, arg_9, arg_10, arg_11, arg_0[arg_9][arg_10][arg_11])

    update_node_helper(arg_0, arg_8)

    return arg_8

Get a random graph by keeping a certain percentage of original edges .


return self.dag_id, self.task_id, self.execution_date, self.try_number

def Func(arg_0):
        """
        Returns a tuple that identifies the task instance uniquely
        """
        return arg_0.dag_id, arg_0.task_id, arg_0.execution_date, arg_0.try_number


def Func ( arg_0 ) : arg_1 = { "id" : arg_0 . get ( 'id' ) , "action" : arg_0 . get ( 'action' ) , "completed" : arg_0 . get ( 'completed' ) , "tenant_id" : arg_0 . get ( 'tenant_id' ) , "created_at" : arg_0 . get ( 'created_at' ) , "transaction_id" : arg_0 . get ( 'transaction_id' ) , "parent_id" : arg_0 . get ( 'parent_id' , None ) } if not arg_1 [ 'transaction_id' ] : arg_1 [ 'transaction_id' ] = arg_0 . get ( 'id' ) arg_2 = 0 for arg_3 in arg_0 . subtransactions : if arg_3 . get ( 'completed' ) : arg_2 += 1 arg_4 = 100 if arg_0 . get ( 'completed' ) else 0 if len ( arg_0 . subtransactions ) > 0 : arg_4 = float ( arg_2 ) / len ( arg_0 . subtransactions ) * 100.0 arg_1 [ 'transaction_percent' ] = int ( arg_4 ) arg_1 [ 'completed_subtransactions' ] = arg_2 arg_1 [ 'subtransactions' ] = len ( arg_0 . subtransactions ) return arg_1

def Func(arg_0):
    """Creates the view for a job while calculating progress.

    Since a root job does not have a transaction id (TID) it will return its
    id as the TID.
    """
    arg_1 = {"id": arg_0.get('id'),
            "action": arg_0.get('action'),
            "completed": arg_0.get('completed'),
            "tenant_id": arg_0.get('tenant_id'),
            "created_at": arg_0.get('created_at'),
            "transaction_id": arg_0.get('transaction_id'),
            "parent_id": arg_0.get('parent_id', None)}
    if not arg_1['transaction_id']:
        arg_1['transaction_id'] = arg_0.get('id')
    arg_2 = 0
    for arg_3 in arg_0.subtransactions:
        if arg_3.get('completed'):
            arg_2 += 1
    arg_4 = 100 if arg_0.get('completed') else 0
    if len(arg_0.subtransactions) > 0:
        arg_4 = float(arg_2) / len(arg_0.subtransactions) * 100.0
    arg_1['transaction_percent'] = int(arg_4)
    arg_1['completed_subtransactions'] = arg_2
    arg_1['subtransactions'] = len(arg_0.subtransactions)
    return arg_1

Creates the view for a job while calculating progress .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 , arg_5 in os . walk ( arg_1 ) : for arg_6 in arg_5 : arg_2 . append ( os . path . join ( arg_3 , arg_6 ) ) return arg_2

def Func(arg_0, arg_1):
    '''Walk through local directories from root basedir'''
    arg_2 = []

    for arg_3, arg_4, arg_5 in os.walk(arg_1):
      for arg_6 in arg_5:
        arg_2.append(os.path.join(arg_3, arg_6))
    return arg_2


return {
            host.get('name'): [
                log.get('key')
                for log
                in host.get('logs')]
            for host
            in response.json().get('list')
        }

def
Func
(
arg_0
)
:
arg_1
=
requests
.
get
(
arg_0
.
base_url
)
if
not
arg_1
.
ok
:
raise
ServerException
(
'{}: {}'
.
format
(
arg_1
.
status_code
,
arg_1
.
text
)
)
return
{
arg_3
.
get
(
'name'
)
:
[
arg_2
.
get
(
'key'
)
for
arg_2
in
arg_3
.
get
(
'logs'
)
]
for
arg_3
in
arg_1
.
json
(
)
.
get
(
'Func'
)
}

def Func(arg_0):
        """
        Get all log sets

        :return: Returns a dictionary where the key is the hostname or log set,
            and the value is a Func of the log keys
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_1 = requests.get(arg_0.base_url)

        if not arg_1.ok:
            raise ServerException(
                '{}: {}'.format(arg_1.status_code, arg_1.text))

        return {
            arg_3.get('name'): [
                arg_2.get('key')
                for arg_2
                in arg_3.get('logs')]
            for arg_3
            in arg_1.json().get('Func')
        }

Get all log sets

        :return: Returns a dictionary where the key is the hostname or log set,
            and the value is a list of the log keys
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries


def
Func
(
arg_0
,
arg_1
)
:
lg
.
info
(
'Reading water scattering from file'
)
try
:
arg_0
.
b_water
=
arg_0
.
_read_iop_from_file
(
arg_1
)
except
:
lg
.
exception
(
'Problem reading file :: '
+
arg_1
)

def Func(arg_0, arg_1):
        """Read the pure water scattering from a csv formatted file

        :param file_name: filename and path of the csv file
        """
        lg.info('Reading water scattering from file')
        try:
            arg_0.b_water = arg_0._read_iop_from_file(arg_1)
        except:
            lg.exception('Problem reading file :: ' + arg_1)


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = { 'typ' : 'JWT' , 'alg' : 'RS256' } if arg_2 is not None : arg_3 [ 'kid' ] = arg_2 arg_4 = [ _helpers . _urlsafe_b64encode ( _helpers . _json_encode ( arg_3 ) ) , _helpers . _urlsafe_b64encode ( _helpers . _json_encode ( arg_1 ) ) , ] arg_5 = b'.' . join ( arg_4 ) arg_6 = arg_0 . sign ( arg_5 ) arg_4 . append ( _helpers . _urlsafe_b64encode ( arg_6 ) ) logger . debug ( str ( arg_4 ) ) return b'.' . join ( arg_4 )

def Func(arg_0, arg_1, arg_2=None):
    """Make a signed JWT.

    See http://self-issued.info/docs/draft-jones-json-web-token.html.

    Args:
        signer: crypt.Signer, Cryptographic signer.
        payload: dict, Dictionary of data to convert to JSON and then sign.
        key_id: string, (Optional) Key ID header.

    Returns:
        string, The JWT for the payload.
    """
    arg_3 = {'typ': 'JWT', 'alg': 'RS256'}
    if arg_2 is not None:
        arg_3['kid'] = arg_2

    arg_4 = [
        _helpers._urlsafe_b64encode(_helpers._json_encode(arg_3)),
        _helpers._urlsafe_b64encode(_helpers._json_encode(arg_1)),
    ]
    arg_5 = b'.'.join(arg_4)

    arg_6 = arg_0.sign(arg_5)
    arg_4.append(_helpers._urlsafe_b64encode(arg_6))

    logger.debug(str(arg_4))

    return b'.'.join(arg_4)


def
Func
(
arg_0
,
arg_1
=
arg_2
.
stdout
)
:
arg_4
=
(
'    name | value     \n'
+
'---------+-----------\n'
)
for
arg_5
,
arg_6
in
list
(
arg_0
.
constants
.
items
(
)
)
:
arg_4
+=
'{!s:>8} | {:<10}\n'
.
format
(
arg_5
,
arg_6
)
print
(
prefix_indent
(
'constants: '
,
arg_4
)
,
file
=
arg_1
)

def Func(arg_0, arg_1=arg_2.stdout):
        """Print constants information in human readble format."""
        arg_4 = ('    name | value     \n' +
                 '---------+-----------\n')
        for arg_5, arg_6 in list(arg_0.constants.items()):
            arg_4 += '{!s:>8} | {:<10}\n'.format(arg_5, arg_6)
        print(prefix_indent('constants: ', arg_4), file=arg_1)

Print constants information in human readble format .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ list ( ) for i in range ( arg_2 [ 'dims' ] [ 0 ] ) ] for arg_4 in range ( arg_2 [ 'dims' ] [ 0 ] ) : for arg_5 in range ( arg_2 [ 'dims' ] [ 1 ] ) : arg_6 , arg_7 , arg_8 = read_var_header ( arg_0 , arg_1 ) arg_9 = read_var_array ( arg_8 , arg_1 , arg_6 ) arg_3 [ arg_4 ] . append ( arg_9 ) arg_0 . seek ( arg_7 ) if arg_2 [ 'dims' ] [ 0 ] == 1 : return squeeze ( arg_3 [ 0 ] ) return squeeze ( arg_3 )

def Func(arg_0, arg_1, arg_2):
    """Read a cell array.
    Returns an array with rows of the cell array.
    """
    arg_3 = [list() for i in range(arg_2['dims'][0])]
    for arg_4 in range(arg_2['dims'][0]):
        for arg_5 in range(arg_2['dims'][1]):
            # read the matrix header and array
            arg_6, arg_7, arg_8 = read_var_header(arg_0, arg_1)
            arg_9 = read_var_array(arg_8, arg_1, arg_6)
            arg_3[arg_4].append(arg_9)
            # move on to next field
            arg_0.seek(arg_7)
    # pack and return the array
    if arg_2['dims'][0] == 1:
        return squeeze(arg_3[0])
    return squeeze(arg_3)

Read a cell array . Returns an array with rows of the cell array .


def Func ( arg_0 , arg_1 = '' ) : for arg_2 in '()' : if arg_2 in arg_0 : return True if arg_0 . lstrip ( ) . startswith ( '>' ) : return True return multiline_statement ( arg_0 , arg_1 )

def Func(arg_0, arg_1=''):
    """Return True if import is spans multiples lines."""
    for arg_2 in '()':
        if arg_2 in arg_0:
            return True

    # Ignore doctests.
    if arg_0.lstrip().startswith('>'):
        return True

    return multiline_statement(arg_0, arg_1)

Return True if import is spans multiples lines .


def Func ( arg_0 ) : arg_1 = Window ( ) arg_2 = QtCore . QUrl . fromLocalFile ( os . path . join ( os . getcwd ( ) , './docs/_build/html/index.html' ) ) arg_1 . view . load ( arg_2 ) arg_1 . show ( ) arg_1 . exec_ ( )

def Func(arg_0):
        """
        The following opens the documentation file.
        """
        """
        TO DO.
        """
        # webbrowser.open('https://marrabld.github.io/planarradpy/')

        arg_1 = Window()
        arg_2 = QtCore.QUrl.fromLocalFile(os.path.join(os.getcwd(), './docs/_build/html/index.html')) #open('./docs/_build/html/index.html').read()
        #window.show()
        arg_1.view.load(arg_2)
        arg_1.show()
        arg_1.exec_()

The following opens the documentation file .


def Func(arg_0, arg_1, arg_2=True):
        """
        Recursively compute Func of data. For dictionaries, items
        for specific keys will be reduced to unique items. For lists, items
        will be reduced to unique items. This method is meant to be analogous
        to set.Func for composite objects.

        Args:
            other (composite): Other composite object to intersect with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.
        """
        if not isinstance(arg_1, composite):
            raise AssertionError('Cannot intersect composite and {} types'.format(type(arg_1)))

        if arg_0.meta_type != arg_1.meta_type:
            return composite({})

        if arg_0.meta_type == 'list':
            arg_3 = []
            for arg_4 in arg_0._list:
                if arg_4 in arg_1._list:
                    if arg_2 and isinstance(arg_4, composite):
                        arg_3.extend(arg_4.Func(arg_1.index(arg_4), arg_2=True))
                    else:
                        arg_3.append(arg_4)
            return composite(arg_3)
        elif arg_0.meta_type == 'dict':
            arg_3 = {}
            for arg_5 in arg_0._dict:
                arg_4 = arg_0._dict[arg_5]
                if arg_5 in arg_1._dict:
                    if arg_2 and \
                       isinstance(arg_4, composite) and \
                       isinstance(arg_1.get(arg_5), composite):
                       arg_3[arg_5] = arg_4.Func(arg_1.get(arg_5), arg_2=True)
                    elif arg_4 == arg_1[arg_5]:
                        arg_3[arg_5] = arg_4
            return composite(arg_3)
        return

Recursively compute intersection of data. For dictionaries, items
        for specific keys will be reduced to unique items. For lists, items
        will be reduced to unique items. This method is meant to be analogous
        to set.intersection for composite objects.

        Args:
            other (composite): Other composite object to intersect with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.

Recursively compute intersection of data . For dictionaries items for specific keys will be reduced to unique items . For lists items will be reduced to unique items . This method is meant to be analogous to set . intersection for composite objects .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 , arg_4 = Func_modified_recids ( arg_1 ) arg_3 = arg_3 . union ( Func_modified_bibdoc_recids ( arg_1 ) ) if arg_0 : arg_3 = arg_3 . intersection ( set ( arg_4 ( p = arg_0 . encode ( 'utf-8' ) ) ) ) return len ( arg_3 ) , arg_3

def Func(arg_0, arg_1, **arg_2):
    """Get recids matching query and with changes."""
    arg_3, arg_4 = Func_modified_recids(arg_1)
    arg_3 = arg_3.union(Func_modified_bibdoc_recids(arg_1))

    if arg_0:
        arg_3 = arg_3.intersection(
            set(arg_4(p=arg_0.encode('utf-8'))))

    return len(arg_3), arg_3

Get recids matching query and with changes .


def Func(arg_0, arg_1):
    """Performs distributional transform of the mixture samples.

    Distributional transform removes the parameters from samples of a
    multivariate distribution by applying conditional CDFs:
      (F(x_1), F(x_2 | x1_), ..., F(x_d | x_1, ..., x_d-1))
    (the indexing is over the "flattened" event dimensions).
    The result is a sample of product of Uniform[0, 1] distributions.

    We assume that the components are factorized, so the conditional CDFs become
      F(x_i | x_1, ..., x_i-1) = sum_k w_i^k F_k (x_i),
    where w_i^k is the posterior mixture weight: for i > 0
      w_i^k = w_k prob_k(x_1, ..., x_i-1) / sum_k' w_k' prob_k'(x_1, ..., x_i-1)
    and w_0^k = w_k is the mixture probability of the k-th component.

    Arguments:
      x: Sample of mixture distribution

    Returns:
      Result of the distributional transform
    """

    if tensorshape_util.rank(arg_1.shape) is None:
      # tf.nn.softmax raises an error when applied to inputs of undefined rank.
      raise ValueError("Distributional transform does not support inputs of "
                       "undefined rank.")

    # Obtain factorized components distribution and assert that it's
    # a scalar distribution.
    if isinstance(arg_0._components_distribution, independent.Independent):
      arg_2 = arg_0._components_distribution.distribution
    else:
      arg_2 = arg_0._components_distribution

    with tf.control_dependencies([
        assert_util.assert_equal(
            arg_2.is_scalar_event(),
            True,
            message="`univariate_components` must have scalar event")
    ]):
      arg_3 = arg_0._pad_sample_dims(arg_1)  # [S, B, 1, E]
      arg_4 = arg_2.log_prob(arg_3)  # [S, B, k, E]
      arg_5 = arg_2.cdf(arg_3)  # [S, B, k, E]

      # log prob_k (x_1, ..., x_i-1)
      arg_6 = tf.reshape(
          tf.math.cumsum(
              # [S*prod(B)*k, prod(E)]
              tf.reshape(arg_4, [-1, arg_0._event_size]),
              exclusive=True,
              axis=-1),
          tf.shape(input=arg_4))  # [S, B, k, E]

      arg_7 = distribution_utils.pad_mixture_dimensions(
          arg_0.mixture_distribution.logits, arg_0, arg_0.mixture_distribution,
          arg_0._event_ndims)  # [B, k, 1]

      # Logits of the posterior weights: log w_k + log prob_k (x_1, ..., x_i-1)
      arg_8 = arg_7 + arg_6

      arg_9 = tensorshape_util.rank(arg_1.shape) - arg_0._event_ndims
      arg_10 = tf.nn.softmax(arg_8,
                                          axis=arg_9)
      return tf.reduce_sum(
          input_tensor=arg_10 * arg_5, axis=arg_9)

Performs distributional transform of the mixture samples .


def Func ( arg_0 = None ) : arg_1 = get_status ( arg_0 ) arg_2 = ( len ( arg_1 . strip ( ) ) == 0 ) return arg_2

def Func(arg_0=None):
    """
    Returns whether there are uncommitted changes in the working dir.
    """
    arg_1 = get_status(arg_0)
    arg_2 = (len(arg_1.strip()) == 0)
    return arg_2

Returns whether there are uncommitted changes in the working dir .


def Func ( arg_0 , arg_1 = None ) : if not arg_1 : return arg_0 , [ ] arg_2 = re . compile ( "|" . join ( pattern for pattern in arg_1 ) ) arg_3 = [ ] arg_4 = [ ] for arg_5 in arg_0 : if arg_1 and arg_2 . search ( arg_5 ) : arg_4 . append ( arg_5 ) else : arg_3 . append ( arg_5 ) return arg_3 , arg_4

def Func(arg_0, arg_1=None):
	"""Exclude file paths based on regex patterns.

	Parameters:
		filepaths (list or str): Filepath(s) to check.

		exclude_patterns (list): Python regex patterns to check filepaths against.

	Returns:
		A list of filepaths to include and a list of filepaths to exclude.
	"""

	if not arg_1:
		return arg_0, []

	arg_2 = re.compile("|".join(pattern for pattern in arg_1))

	arg_3 = []
	arg_4 = []

	for arg_5 in arg_0:
		if arg_1 and arg_2.search(arg_5):
			arg_4.append(arg_5)
		else:
			arg_3.append(arg_5)

	return arg_3, arg_4

Exclude file paths based on regex patterns .


return checkplot_pickle_to_png(checkplotin, outfile, extrarows=extrarows)

def Func(arg_0, arg_1=None):
    '''This is just a shortened form of the function above for convenience.

    This only handles pickle files as input.

    Parameters
    ----------

    checkplotin : str
        File name of a checkplot pickle file to convert to a PNG.

    extrarows : list of tuples
        This is a list of 4-element tuples containing paths to PNG files that
        will be added to the end of the rows generated from the checkplotin
        pickle/dict. Each tuple represents a row in the final output PNG
        file. If there are less than 4 elements per tuple, the missing elements
        will be filled in with white-space. If there are more than 4 elements
        per tuple, only the first four will be used.

        The purpose of this kwarg is to incorporate periodograms and phased LC
        plots (in the form of PNGs) generated from an external period-finding
        function or program (like VARTOOLS) to allow for comparison with
        astrobase results.

        NOTE: the PNG files specified in `extrarows` here will be added to those
        already present in the input `checkplotdict['externalplots']` if that is
        None because you passed in a similar list of external plots to the
        :py:func:`astrobase.checkplot.pkl.checkplot_pickle` function earlier. In
        this case, `extrarows` can be used to add even more external plots if
        desired.

        Each external plot PNG will be resized to 750 x 480 pixels to fit into
        an output image cell.

        By convention, each 4-element tuple should contain:

        - a periodiogram PNG
        - phased LC PNG with 1st best peak period from periodogram
        - phased LC PNG with 2nd best peak period from periodogram
        - phased LC PNG with 3rd best peak period from periodogram

        Example of extrarows::

            [('/path/to/external/bls-periodogram.png',
              '/path/to/external/bls-phasedlc-plot-bestpeak.png',
              '/path/to/external/bls-phasedlc-plot-peak2.png',
              '/path/to/external/bls-phasedlc-plot-peak3.png'),
             ('/path/to/external/pdm-periodogram.png',
              '/path/to/external/pdm-phasedlc-plot-bestpeak.png',
              '/path/to/external/pdm-phasedlc-plot-peak2.png',
              '/path/to/external/pdm-phasedlc-plot-peak3.png'),
            ...]

    Returns
    -------

    str
        The absolute path to the generated checkplot PNG.

    '''

    if arg_0.endswith('.gz'):
        arg_2 = arg_0.replace('.pkl.gz','.png')
    else:
        arg_2 = arg_0.replace('.pkl','.png')

    return checkplot_pickle_to_png(arg_0, arg_2, arg_1=arg_1)

This is just a shortened form of the function above for convenience .


def Func ( arg_0 ) : arg_1 = arg_0 . name or '' if arg_0 . _length : arg_1 += ':' + arg_0 . _length arg_2 = ',' . join ( [ n . Func for n in arg_0 . descendants ] ) if arg_2 : arg_2 = '(' + arg_2 + ')' return arg_2 + arg_1

def Func(arg_0):
        """The representation of the Node in Newick format."""
        arg_1 = arg_0.name or ''
        if arg_0._length:
            arg_1 += ':' + arg_0._length
        arg_2 = ','.join([n.Func for n in arg_0.descendants])
        if arg_2:
            arg_2 = '(' + arg_2 + ')'
        return arg_2 + arg_1

The representation of the Node in Newick format .


def Func(arg_0):
        """Open the working area

        Returns
        -------
        None
        """

        arg_0.path = arg_0._prepare_dir(arg_0.topdir)
        arg_0._copy_executable(area_path=arg_0.path)
        arg_0._save_logging_levels(area_path=arg_0.path)
        arg_0._put_python_modules(modules=arg_0.python_modules, area_path=arg_0.path)


def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
,
list
)
:
arg_0
=
[
arg_0
]
for
arg_1
in
arg_0
:
if
os
.
path
.
exists
(
arg_1
)
:
bot
.
verbose3
(
"Cleaning up %s"
%
arg_1
)
os
.
remove
(
arg_1
)

def Func(arg_0):
    '''clean up will delete a list of files, only if they exist
    '''
    if not isinstance(arg_0, list):
        arg_0 = [arg_0]

    for arg_1 in arg_0:
        if os.path.exists(arg_1):
            bot.verbose3("Cleaning up %s" % arg_1)
            os.remove(arg_1)

clean up will delete a list of files only if they exist


def Func ( arg_0 ) : if arg_0 . _context is not None : if arg_0 . _socket is not None : arg_0 . _close_socket ( confused = False ) arg_0 . _context . term ( ) arg_0 . _context = None arg_0 . _poll = None

def Func(arg_0):
        """Closes socket and terminates context

        NO-OP if already closed.

        """
        if arg_0._context is not None:
            if arg_0._socket is not None:
                arg_0._close_socket(confused=False)
            arg_0._context.term()
            arg_0._context = None
            arg_0._poll = None


Update the database with model schema. Shorthand for `paver manage syncdb`.

def
Func
(
arg_0
)
:
arg_1
=
arg_0
and
'Func %s'
%
' '
.
join
(
options
.
args
)
or
'Func --noinput'
call_manage
(
arg_1
)
for
arg_2
in
options
.
paved
.
django
.
Func
.
fixtures
:
call_manage
(
"loaddata %s"
%
arg_2
)

def Func(arg_0):
    """Update the database with model schema. Shorthand for `paver manage Func`.
    """
    arg_1 = arg_0 and 'Func %s' % ' '.join(options.args) or 'Func --noinput'
    call_manage(arg_1)
    for arg_2 in options.paved.django.Func.fixtures:
        call_manage("loaddata %s" % arg_2)

Update the database with model schema . Shorthand for paver manage syncdb .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or QuietProgress ( ) arg_2 . on_start ( ) arg_3 = SyncManager ( ) arg_3 . start ( ) arg_4 = 0 arg_5 = arg_3 . Queue ( ) for arg_6 , arg_7 in iteritems ( get_tools ( ) ) : if arg_0 [ arg_6 ] [ 'use' ] and arg_7 . can_be_used ( ) : arg_4 += 1 arg_5 . put ( { 'name' : arg_6 , 'config' : arg_0 [ arg_6 ] , } ) arg_8 = Collector ( arg_0 ) if not arg_4 : arg_2 . on_finish ( ) return arg_8 arg_9 = arg_3 . Queue ( ) arg_10 = arg_3 . dict ( { 'finder' : Finder ( arg_1 , arg_0 ) , } ) arg_11 = [ ] for arg_12 in range ( arg_0 [ 'workers' ] ) : arg_13 = Worker ( args = ( arg_5 , arg_9 , arg_10 , ) , ) arg_13 . start ( ) arg_11 . append ( arg_13 ) while arg_4 : try : arg_14 = arg_9 . get ( True , 0.25 ) except Empty : pass else : if arg_14 [ 'type' ] == 'start' : arg_2 . on_tool_start ( arg_14 [ 'tool' ] ) elif arg_14 [ 'type' ] == 'complete' : arg_8 . add_issues ( arg_14 [ 'issues' ] ) arg_2 . on_tool_finish ( arg_14 [ 'tool' ] ) arg_4 -= 1 arg_2 . on_finish ( ) return arg_8

def Func(arg_0, arg_1, arg_2=None):
    """
    Executes the suite of TidyPy tools upon the project and returns the
    issues that are found.

    :param config: the TidyPy configuration to use
    :type config: dict
    :param path: that path to the project to analyze
    :type path: str
    :param progress:
        the progress reporter object that will receive callbacks during the
        execution of the tool suite. If not specified, not progress
        notifications will occur.
    :type progress: tidypy.Progress
    :rtype: tidypy.Collector
    """

    arg_2 = arg_2 or QuietProgress()
    arg_2.on_start()

    arg_3 = SyncManager()
    arg_3.start()

    arg_4 = 0
    arg_5 = arg_3.Queue()
    for arg_6, arg_7 in iteritems(get_tools()):
        if arg_0[arg_6]['use'] and arg_7.can_be_used():
            arg_4 += 1
            arg_5.put({
                'name': arg_6,
                'config': arg_0[arg_6],
            })

    arg_8 = Collector(arg_0)
    if not arg_4:
        arg_2.on_finish()
        return arg_8

    arg_9 = arg_3.Queue()
    arg_10 = arg_3.dict({
        'finder': Finder(arg_1, arg_0),
    })

    arg_11 = []
    for arg_12 in range(arg_0['workers']):
        arg_13 = Worker(
            args=(
                arg_5,
                arg_9,
                arg_10,
            ),
        )
        arg_13.start()
        arg_11.append(arg_13)

    while arg_4:
        try:
            arg_14 = arg_9.get(True, 0.25)
        except Empty:
            pass
        else:
            if arg_14['type'] == 'start':
                arg_2.on_tool_start(arg_14['tool'])
            elif arg_14['type'] == 'complete':
                arg_8.add_issues(arg_14['issues'])
                arg_2.on_tool_finish(arg_14['tool'])
                arg_4 -= 1

    arg_2.on_finish()

    return arg_8

Executes the suite of TidyPy tools upon the project and returns the issues that are found .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
hasattr
(
arg_1
.
sandbox
,
'muda'
)
:
raise
RuntimeError
(
'No muda state found in jams sandbox.'
)
arg_3
=
copy
.
deepcopy
(
arg_1
)
arg_3
.
sandbox
.
muda
[
'history'
]
.
append
(
{
'transformer'
:
arg_0
.
__serialize__
,
'state'
:
arg_2
}
)
if
hasattr
(
arg_0
,
'audio'
)
:
arg_0
.
audio
(
arg_3
.
sandbox
.
muda
,
arg_2
)
if
hasattr
(
arg_0
,
'metadata'
)
:
arg_0
.
metadata
(
arg_3
.
file_metadata
,
arg_2
)
for
arg_4
,
arg_5
in
six
.
iteritems
(
arg_0
.
dispatch
)
:
arg_6
=
getattr
(
arg_0
,
arg_5
)
for
arg_7
in
arg_3
.
search
(
namespace
=
arg_4
)
:
arg_6
(
arg_7
,
arg_2
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
        '''Apply the transformation to audio and annotations.

        The input jam is copied and modified, and returned
        contained in a list.

        Parameters
        ----------
        jam : jams.JAMS
            A single jam object to modify

        Returns
        -------
        jam_list : list
            A length-1 list containing `jam` after transformation

        See also
        --------
        core.load_jam_audio
        '''

        if not hasattr(arg_1.sandbox, 'muda'):
            raise RuntimeError('No muda state found in jams sandbox.')

        # We'll need a working copy of this object for modification purposes
        arg_3 = copy.deepcopy(arg_1)

        # Push our reconstructor onto the history stack
        arg_3.sandbox.muda['history'].append({'transformer': arg_0.__serialize__,
                                              'state': arg_2})

        if hasattr(arg_0, 'audio'):
            arg_0.audio(arg_3.sandbox.muda, arg_2)

        if hasattr(arg_0, 'metadata'):
            arg_0.metadata(arg_3.file_metadata, arg_2)

        # Walk over the list of deformers
        for arg_4, arg_5 in six.iteritems(arg_0.dispatch):
            arg_6 = getattr(arg_0, arg_5)
            for arg_7 in arg_3.search(namespace=arg_4):
                arg_6(arg_7, arg_2)

        return arg_3

Apply the transformation to audio and annotations .


def Func(arg_0, arg_1):
    """Read a Nifti file nii_file and a mask Nifti file.
    Returns the voxels in nii_file that are within the mask, the mask indices
    and the mask shape.

    Parameters
    ----------
    image: img-like object or boyle.nifti.NeuroImage or str
        Can either be:
        - a file path to a Nifti image
        - any object with get_data() and get_affine() methods, e.g., nibabel.Nifti1Image.
        If niimg is a string, consider it as a path to Nifti image and
        call nibabel.load on it. If it is an object, check if get_data()
        and get_affine() methods are present, raise TypeError otherwise.

    mask_img: img-like object or boyle.nifti.NeuroImage or str
        3D mask array: True where a voxel should be used.
        See img description.

    Returns
    -------
    vol[mask_indices], mask_indices

    Note
    ----
    nii_file and mask_file must have the same shape.

    Raises
    ------
    NiftiFilesNotCompatible, ValueError
    """
    arg_2  = check_img(arg_0)
    arg_3 = check_img(arg_1)
    check_img_compatibility(arg_2, arg_3)

    arg_4          = arg_2.get_data()
    arg_5, arg_6 = load_mask_data(arg_3)

    return arg_4[arg_5], arg_5

Read a Nifti file nii_file and a mask Nifti file . Returns the voxels in nii_file that are within the mask the mask indices and the mask shape .


return sorted(
            line_samples.items(), key=lambda v: v[1], reverse=True)

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . live_data_copy ( ) arg_3 = { } for arg_2 , arg_4 in arg_1 . items ( ) : for arg_5 , arg_6 in arg_4 . items ( ) : arg_3 . setdefault ( arg_5 , 0 ) arg_3 [ arg_5 ] += arg_6 return sorted ( arg_3 . items ( ) , arg_5 = lambda v : v [ 1 ] , reverse = True )

def Func(arg_0):
        '''
        Get lines sampled accross all threads, in order
        from most to least sampled.
        '''
        arg_1, arg_2 = arg_0.live_data_copy()
        arg_3 = {}
        for arg_2, arg_4 in arg_1.items():
            for arg_5, arg_6 in arg_4.items():
                arg_3.setdefault(arg_5, 0)
                arg_3[arg_5] += arg_6
        return sorted(
            arg_3.items(), arg_5=lambda v: v[1], reverse=True)

Get lines sampled accross all threads in order from most to least sampled .


def Func ( arg_0 , arg_1 = None ) : arg_2 = time . time ( ) while True : arg_3 = arg_0 . get_task ( ) if not arg_3 or arg_3 . status not in ( FINISHED , FAILED ) : if not arg_1 : continue elif time . time ( ) - arg_2 < arg_1 : continue else : raise TimeoutError ( ) if arg_3 . status == FAILED : raise arg_3 . Func return arg_3 . Func

def Func(arg_0, arg_1=None):
        """Gets the Func of the task.

        Arguments:
            timeout: Maximum seconds to wait for a Func before raising a
                TimeoutError. If set to None, this will wait forever. If the
                queue doesn't store Funcs and timeout is None, this call will
                never return.
        """
        arg_2 = time.time()
        while True:
            arg_3 = arg_0.get_task()
            if not arg_3 or arg_3.status not in (FINISHED, FAILED):
                if not arg_1:
                    continue
                elif time.time() - arg_2 < arg_1:
                    continue
                else:
                    raise TimeoutError()

            if arg_3.status == FAILED:
                raise arg_3.Func

            return arg_3.Func

Gets the result of the task.

        Arguments:
            timeout: Maximum seconds to wait for a result before raising a
                TimeoutError. If set to None, this will wait forever. If the
                queue doesn't store results and timeout is None, this call will
                never return.


def Func(arg_0, arg_1, arg_2):
        """Asserts that val is numeric and is between low and high."""
        arg_3 = type(arg_0.val)
        arg_0._validate_between_args(arg_3, arg_1, arg_2)

        if arg_0.val < arg_1 or arg_0.val > arg_2:
            if arg_3 is datetime.datetime:
                arg_0._err('Expected <%s> to be between <%s> and <%s>, but was not.' % (arg_0.val.strftime('%Y-%m-%d %H:%M:%S'), arg_1.strftime('%Y-%m-%d %H:%M:%S'), arg_2.strftime('%Y-%m-%d %H:%M:%S')))
            else:
                arg_0._err('Expected <%s> to be between <%s> and <%s>, but was not.' % (arg_0.val, arg_1, arg_2))
        return arg_0

Asserts that val is numeric and is between low and high .


def Func(arg_0):
  """
  This method finds the time range which covers all the Run_Steps

  :param run_steps: list of Run_Step objects
  :return: tuple of start and end timestamps
  """
  arg_1 = get_standardized_timestamp('now', None)
  arg_2 = arg_1
  arg_3 = '0'
  for arg_4 in arg_0:
    if arg_4.ts_start and arg_4.ts_end:
      if arg_4.ts_start < arg_2:
        arg_2 = arg_4.ts_start
      if arg_4.ts_end > arg_3:
        arg_3 = arg_4.ts_end
  if arg_3 == '0':
    arg_3 = None
  if arg_2 == arg_1:
    arg_2 = None
  logger.info('Func range returned ' + str(arg_2) + ' to ' + str(arg_3))
  return arg_2, arg_3


def Func ( arg_0 ) : Func = [ ] for arg_2 in arg_0 . produced_meshes : if arg_2 . is_consumed ( ) : arg_3 = arg_2 . consuming_row if Func not in Func : Func . append ( arg_3 ) return Func

def Func(arg_0):
        """The rows that consume meshes from this row.

        :rtype: list
        :return: a list of rows that consume meshes from this row. Each row
          occurs only once. They are sorted by the first occurrence in the
          instructions.
        """
        Func = []
        for arg_2 in arg_0.produced_meshes:
            if arg_2.is_consumed():
                arg_3 = arg_2.consuming_row
                if Func not in Func:
                    Func.append(arg_3)
        return Func

The rows that consume meshes from this row .


(mdr_instance, X, y, n=[2], feature_names=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = [ 2 ] , arg_4 = None ) : if arg_4 is None : arg_4 = list ( range ( arg_1 . shape [ 1 ] ) ) for arg_5 in arg_3 : for arg_6 in itertools . combinations ( range ( arg_1 . shape [ 1 ] ) , arg_5 ) : arg_7 = copy . deepcopy ( arg_0 ) arg_7 . fit ( arg_1 [ : , arg_6 ] , arg_2 ) arg_8 = arg_7 . score ( arg_1 [ : , arg_6 ] , arg_2 ) arg_9 = [ arg_4 [ feature ] for feature in arg_6 ] yield arg_7 , arg_8 , arg_9

def Func(arg_0, arg_1, arg_2, arg_3=[2], arg_4=None):
    """Fits a MDR model to all n-way combinations of the features in X.

    Note that this function performs an exhaustive search through all feature combinations and can be computationally expensive.

    Parameters
    ----------
    mdr_instance: object
        An instance of the MDR type to use.
    X: array-like (# rows, # features)
        NumPy matrix containing the features
    y: array-like (# rows, 1)
        NumPy matrix containing the target values
    n: list (default: [2])
        The maximum size(s) of the MDR model to generate.
        e.g., if n == [3], all 3-way models will be generated.
    feature_names: list (default: None)
        The corresponding names of the features in X.
        If None, then the features will be named according to their order.

    Returns
    ----------
    (fitted_model, fitted_model_score, fitted_model_features): tuple of (list, list, list)
        fitted_model contains the MDR model fitted to the data.
        fitted_model_score contains the training scores corresponding to the fitted MDR model.
        fitted_model_features contains a list of the names of the features that were used in the corresponding model.

    """
    if arg_4 is None:
        arg_4 = list(range(arg_1.shape[1]))

    for arg_5 in arg_3:
        for arg_6 in itertools.combinations(range(arg_1.shape[1]), arg_5):
            arg_7 = copy.deepcopy(arg_0)
            arg_7.fit(arg_1[:, arg_6], arg_2)
            arg_8 = arg_7.score(arg_1[:, arg_6], arg_2)
            arg_9 = [arg_4[feature] for feature in arg_6]
            yield arg_7, arg_8, arg_9

Fits a MDR model to all n - way combinations of the features in X .


def Func ( arg_0 , arg_1 ) : with arg_0 . engine . begin ( ) as db : delete_remote_checkpoints ( db , arg_0 . user_id , arg_1 )

def Func(arg_0, arg_1):
        """Delete all checkpoints for the given path."""
        with arg_0.engine.begin() as db:
            delete_remote_checkpoints(db, arg_0.user_id, arg_1)

Delete all checkpoints for the given path .


(self, min_time=0, max_time=ts_2100,
                        recursive=True)

def Func ( arg_0 , arg_1 = 0 , arg_2 = arg_3 , arg_4 = True ) : def filters ( arg_5 ) : return arg_1 <= arg_5 . mtime <= arg_2 return arg_0 . select_file ( filters , arg_4 )

def Func(arg_0, arg_1=0, arg_2=arg_3,
                        arg_4=True):
        """
        Select file path by modify time.

        :param min_time: lower bound timestamp
        :param max_time: upper bound timestamp

        **中文文档**

        选择所有 :attr:`pathlib_mate.pathlib2.Path.mtime` 在一定范围内的文件。
        """

        def filters(arg_5): return arg_1 <= arg_5.mtime <= arg_2

        return arg_0.select_file(filters, arg_4)


def Func(arg_0, arg_1):
    """
    Converts the file associated with the file_name passed into a MP3 file.

    :param str file_name: Filename of the original file in local storage
    :param Queue delete_queue: Delete queue to add the original file to after conversion is done
    :return str: Filename of the new file in local storage
    """

    arg_2 = os.path.splitext(arg_0)

    if arg_2[1] == '.mp3':
        log.info(f"{file_name} is already a MP3 file, no conversion needed.")
        return arg_0

    arg_3 = arg_2[0] + '.mp3'

    arg_4 = FFmpeg(
        inputs={arg_0: None},
        outputs={arg_3: None}
    )

    log.info(f"Conversion for {file_name} has started")
    arg_5 = time()
    try:
        arg_4.run(stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
    except FFRuntimeError:
        os.remove(arg_3)
        arg_4.run(stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
    arg_6 = time()
    log.info(f"Conversion for {file_name} has finished in {end_time - start_time} seconds")

    arg_1.put(arg_0)
    return arg_3

Converts the file associated with the file_name passed into a MP3 file .


def Func(*arg_0, **arg_1):
    """Run ``gromacs.grompp`` and return the total charge of the  system.

    :Arguments:
       The arguments are the ones one would pass to :func:`gromacs.grompp`.
    :Returns:
       The total charge as reported

    Some things to keep in mind:

    * The stdout output of grompp is only shown when an error occurs. For
      debugging, look at the log file or screen output and try running the
      normal :func:`gromacs.grompp` command and analyze the output if the
      debugging messages are not sufficient.

    * Check that ``qtot`` is correct. Because the function is based on pattern
      matching of the informative output of :program:`grompp` it can break when
      the output format changes. This version recognizes lines like ::

            '  System has non-zero total charge: -4.000001e+00'

      using the regular expression
      :regexp:`System has non-zero total charge: *(?P<qtot>[-+]?\d*\.\d+([eE][-+]\d+)?)`.

    """
    arg_2 = re.compile('System has non-zero total charge: *(?P<qtot>[-+]?\d*\.\d+([eE][-+]\d+)?)')
    # make sure to capture ALL output
    arg_1['stdout'] = False
    arg_1['stderr'] = False
    arg_3, arg_4, arg_5 = grompp_warnonly(*arg_0, **arg_1)
    arg_6 = "\n".join([x for x in [arg_4, arg_5] if x is not None])
    if arg_3 != 0:
        # error occured and we want to see the whole output for debugging
        arg_7 = "Func() failed. See warning and screen output for clues."
        logger.error(arg_7)
        import sys
        sys.stderr.write("=========== grompp (stdout/stderr) ============\n")
        sys.stderr.write(arg_6)
        sys.stderr.write("===============================================\n")
        sys.stderr.flush()
        raise GromacsError(arg_3, arg_7)
    arg_8 = 0
    for arg_9 in arg_6.split('\n'):
        arg_10 = arg_2.search(arg_9)
        if arg_10:
            arg_8 = float(arg_10.group('qtot'))
            break
    logger.info("system total charge qtot = {qtot!r}".format(**vars()))
    return arg_8

Run gromacs . grompp and return the total charge of the system .


def Func ( arg_0 , arg_1 = "from" , arg_2 = True ) : arg_3 = None arg_4 = [ x for x in arg_0 . split ( '\n' ) if "%s:" % arg_1 in x . lower ( ) ] if len ( arg_4 ) == 0 : return "" if len ( arg_4 ) > 0 : arg_4 = arg_4 [ 0 ] arg_3 = arg_4 . strip ( ) if arg_2 is True : arg_3 = arg_4 . split ( ':' , 1 ) [ - 1 ] . strip ( ) return arg_3

def Func(arg_0, arg_1="from", arg_2=True):
    '''take a recipe, and return the complete header, line. If
       remove_header is True, only return the value.

       Parameters
       ==========
       recipe: the recipe file
       headers: the header key to find and parse
       remove_header: if true, remove the key

    '''
    arg_3 = None
    arg_4 = [x for x in arg_0.split('\n') if "%s:" %arg_1 in x.lower()]

    # Case 1: We did not find the fromline
    if len(arg_4) == 0:
        return ""

    # Case 2: We found it!
    if len(arg_4) > 0:
        arg_4 = arg_4[0]
        arg_3 = arg_4.strip()

    # Does the user want to clean it up?
    if arg_2 is True:
        arg_3 = arg_4.split(':', 1)[-1].strip()
    return arg_3

take a recipe and return the complete header line . If remove_header is True only return the value .


def Func ( arg_0 ) : arg_1 = arg_0 . local_renderer arg_1 . env . wsgi_server_memory_gb = 8 arg_4 = arg_0 . verbose arg_5 = list ( arg_0 . iter_sites ( site = ALL , setter = arg_0 . set_site_specifics ) )

def Func(arg_0):
        """
        Based on the number of sites per server and the number of resources on the server,
        calculates the optimal number of processes that should be allocated for each WSGI site.
        """
        arg_1 = arg_0.local_renderer
        #r.env.wsgi_processes = 5
        arg_1.env.wsgi_server_memory_gb = 8

        arg_4 = arg_0.verbose

        arg_5 = list(arg_0.iter_sites(site=ALL, setter=arg_0.set_site_specifics))

Based on the number of sites per server and the number of resources on the server calculates the optimal number of processes that should be allocated for each WSGI site .


def Func(arg_0, arg_1=True, arg_2=False):
    '''Convert one or more MIDI numbers to note strings.

    MIDI numbers will be rounded to the nearest integer.

    Notes will be of the format 'C0', 'C#0', 'D0', ...

    Examples
    --------
    >>> librosa.Func(0)
    'C-1'
    >>> librosa.Func(37)
    'C#2'
    >>> librosa.Func(-2)
    'A#-2'
    >>> librosa.Func(104.7)
    'A7'
    >>> librosa.Func(104.7, cents=True)
    'A7-30'
    >>> librosa.Func(list(range(12, 24)))
    ['C0', 'C#0', 'D0', 'D#0', 'E0', 'F0', 'F#0', 'G0', 'G#0', 'A0', 'A#0', 'B0']

    Parameters
    ----------
    midi : int or iterable of int
        Midi numbers to convert.

    octave: bool
        If True, include the octave number

    cents: bool
        If true, cent markers will be appended for fractional notes.
        Eg, `Func(69.3, cents=True)` == `A4+03`

    Returns
    -------
    notes : str or iterable of str
        Strings describing each midi note.

    Raises
    ------
    ParameterError
        if `cents` is True and `octave` is False

    See Also
    --------
    midi_to_hz
    note_to_midi
    hz_to_note
    '''

    if arg_2 and not arg_1:
        raise ParameterError('Cannot encode cents without octave information.')

    if not np.isscalar(arg_0):
        return [Func(arg_3, arg_1=arg_1, arg_2=arg_2) for arg_3 in arg_0]

    arg_4 = ['C', 'C#', 'D', 'D#',
                'E', 'F', 'F#', 'G',
                'G#', 'A', 'A#', 'B']

    arg_5 = int(np.round(arg_0))
    arg_6 = int(100 * np.around(arg_0 - arg_5, 2))

    arg_7 = arg_4[arg_5 % 12]

    if arg_1:
        arg_7 = '{:s}{:0d}'.format(arg_7, int(arg_5 / 12) - 1)
    if arg_2:
        arg_7 = '{:s}{:+02d}'.format(arg_7, arg_6)

    return arg_7

Convert one or more MIDI numbers to note strings.

    MIDI numbers will be rounded to the nearest integer.

    Notes will be of the format 'C0', 'C#0', 'D0', ...

    Examples
    --------
    >>> librosa.midi_to_note(0)
    'C-1'
    >>> librosa.midi_to_note(37)
    'C#2'
    >>> librosa.midi_to_note(-2)
    'A#-2'
    >>> librosa.midi_to_note(104.7)
    'A7'
    >>> librosa.midi_to_note(104.7, cents=True)
    'A7-30'
    >>> librosa.midi_to_note(list(range(12, 24)))
    ['C0', 'C#0', 'D0', 'D#0', 'E0', 'F0', 'F#0', 'G0', 'G#0', 'A0', 'A#0', 'B0']

    Parameters
    ----------
    midi : int or iterable of int
        Midi numbers to convert.

    octave: bool
        If True, include the octave number

    cents: bool
        If true, cent markers will be appended for fractional notes.
        Eg, `midi_to_note(69.3, cents=True)` == `A4+03`

    Returns
    -------
    notes : str or iterable of str
        Strings describing each midi note.

    Raises
    ------
    ParameterError
        if `cents` is True and `octave` is False

    See Also
    --------
    midi_to_hz
    note_to_midi
    hz_to_note

Convert one or more MIDI numbers to note strings .


def Func ( arg_0 , arg_1 = False ) : if isinstance ( arg_0 , PyFunc ) : return arg_0 elif arg_0 is None : return undefined elif isinstance ( arg_0 , basestring ) : return PyFuncString ( arg_0 , StringPrototype ) elif isinstance ( arg_0 , bool ) : return true if arg_0 else false elif isinstance ( arg_0 , float ) or isinstance ( arg_0 , int ) or isinstance ( arg_0 , long ) or ( NUMPY_AVAILABLE and isinstance ( arg_0 , ( numpy . int8 , numpy . uint8 , numpy . int16 , numpy . uint16 , numpy . int32 , numpy . uint32 , numpy . float32 , numpy . float64 ) ) ) : if arg_0 in NUM_BANK : return NUM_BANK [ arg_0 ] return PyFuncNumber ( float ( arg_0 ) , NumberPrototype ) elif isinstance ( arg_0 , FunctionType ) : return PyFuncFunction ( arg_0 , FunctionPrototype ) elif isinstance ( arg_0 , dict ) : arg_2 = PyFuncObject ( { } , ObjectPrototype ) for arg_3 , arg_4 in six . iteritems ( arg_0 ) : arg_2 . put ( Func ( arg_3 ) , Func ( arg_4 ) ) return arg_2 elif isinstance ( arg_0 , ( list , tuple ) ) : return PyFuncArray ( arg_0 , ArrayPrototype ) elif isinstance ( arg_0 , FuncObjectWrapper ) : return arg_0 . __dict__ [ '_obj' ] elif NUMPY_AVAILABLE and isinstance ( arg_0 , numpy . ndarray ) : if arg_0 . dtype == numpy . int8 : return PyFuncInt8Array ( arg_0 , Int8ArrayPrototype ) elif arg_0 . dtype == numpy . uint8 and not arg_1 : return PyFuncUint8Array ( arg_0 , Uint8ArrayPrototype ) elif arg_0 . dtype == numpy . uint8 and arg_1 : return PyFuncUint8ClampedArray ( arg_0 , Uint8ClampedArrayPrototype ) elif arg_0 . dtype == numpy . int16 : return PyFuncInt16Array ( arg_0 , Int16ArrayPrototype ) elif arg_0 . dtype == numpy . uint16 : return PyFuncUint16Array ( arg_0 , Uint16ArrayPrototype ) elif arg_0 . dtype == numpy . int32 : return PyFuncInt32Array ( arg_0 , Int32ArrayPrototype ) elif arg_0 . dtype == numpy . uint32 : return PyFuncUint16Array ( arg_0 , Uint32ArrayPrototype ) elif arg_0 . dtype == numpy . float32 : return PyFuncFloat32Array ( arg_0 , Float32ArrayPrototype ) elif arg_0 . dtype == numpy . float64 : return PyFuncFloat64Array ( arg_0 , Float64ArrayPrototype ) else : return py_wrap ( arg_0 )

def Func(arg_0, arg_1=False):
    '''Converts Py type to PyFunc type'''
    if isinstance(arg_0, PyFunc):
        return arg_0
    elif arg_0 is None:
        return undefined
    elif isinstance(arg_0, basestring):
        return PyFuncString(arg_0, StringPrototype)
    elif isinstance(arg_0, bool):
        return true if arg_0 else false
    elif isinstance(arg_0, float) or isinstance(arg_0, int) or isinstance(
            arg_0, long) or (NUMPY_AVAILABLE and isinstance(
                arg_0,
                (numpy.int8, numpy.uint8, numpy.int16, numpy.uint16,
                 numpy.int32, numpy.uint32, numpy.float32, numpy.float64))):
        # This is supposed to speed things up. may not be the case
        if arg_0 in NUM_BANK:
            return NUM_BANK[arg_0]
        return PyFuncNumber(float(arg_0), NumberPrototype)
    elif isinstance(arg_0, FunctionType):
        return PyFuncFunction(arg_0, FunctionPrototype)
    #elif isinstance(val, ModuleType):
    #    mod = {}
    #    for name in dir(val):
    #        value = getattr(val, name)
    #        if isinstance(value, ModuleType):
    #            continue  # prevent recursive module conversion
    #        try:
    #            jsval = HFunc(value)
    #        except RuntimeError:
    #            print 'Could not convert %s to PyFunc object!' % name
    #            continue
    #        mod[name] = jsval
    #    return Func(mod)
    #elif isintance(val, ClassType):

    elif isinstance(arg_0, dict):  # convert to object
        arg_2 = PyFuncObject({}, ObjectPrototype)
        for arg_3, arg_4 in six.iteritems(arg_0):
            arg_2.put(Func(arg_3), Func(arg_4))
        return arg_2
    elif isinstance(arg_0, (list, tuple)):  #Convert to array
        return PyFuncArray(arg_0, ArrayPrototype)
    # convert to typedarray
    elif isinstance(arg_0, FuncObjectWrapper):
        return arg_0.__dict__['_obj']
    elif NUMPY_AVAILABLE and isinstance(arg_0, numpy.ndarray):
        if arg_0.dtype == numpy.int8:
            return PyFuncInt8Array(arg_0, Int8ArrayPrototype)
        elif arg_0.dtype == numpy.uint8 and not arg_1:
            return PyFuncUint8Array(arg_0, Uint8ArrayPrototype)
        elif arg_0.dtype == numpy.uint8 and arg_1:
            return PyFuncUint8ClampedArray(arg_0, Uint8ClampedArrayPrototype)
        elif arg_0.dtype == numpy.int16:
            return PyFuncInt16Array(arg_0, Int16ArrayPrototype)
        elif arg_0.dtype == numpy.uint16:
            return PyFuncUint16Array(arg_0, Uint16ArrayPrototype)

        elif arg_0.dtype == numpy.int32:
            return PyFuncInt32Array(arg_0, Int32ArrayPrototype)
        elif arg_0.dtype == numpy.uint32:
            return PyFuncUint16Array(arg_0, Uint32ArrayPrototype)

        elif arg_0.dtype == numpy.float32:
            return PyFuncFloat32Array(arg_0, Float32ArrayPrototype)
        elif arg_0.dtype == numpy.float64:
            return PyFuncFloat64Array(arg_0, Float64ArrayPrototype)
    else:  # try to convert to js object
        return py_wrap(arg_0)


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 . get_data ( 'volumes/' , type = POST , params = { 'name' : arg_0 . name , 'snapshot_id' : arg_0 . snapshot_id , 'region' : arg_0 . region , 'size_gigabytes' : arg_0 . size_gigabytes , 'description' : arg_0 . description , 'filesystem_type' : arg_0 . filesystem_type , 'filesystem_label' : arg_0 . filesystem_label } ) if arg_3 : arg_0 . id = arg_3 [ 'volume' ] [ 'id' ] arg_0 . created_at = arg_3 [ 'volume' ] [ 'created_at' ] return arg_0

def Func(arg_0, *arg_1, **arg_2):
        """
        Creates a Block Storage volume

        Note: Every argument and parameter given to this method will be
        assigned to the object.

        Args:
            name: string - a name for the volume
            snapshot_id: string - unique identifier for the volume snapshot
            size_gigabytes: int - size of the Block Storage volume in GiB
            filesystem_type: string, optional - name of the filesystem type the
                volume will be formated with ('ext4' or 'xfs')
            filesystem_label: string, optional - the label to be applied to the
                filesystem, only used in conjunction with filesystem_type

        Optional Args:
            description: string - text field to describe a volume
        """
        arg_3 = arg_0.get_data('volumes/',
                             type=POST,
                             params={'name': arg_0.name,
                                     'snapshot_id': arg_0.snapshot_id,
                                     'region': arg_0.region,
                                     'size_gigabytes': arg_0.size_gigabytes,
                                     'description': arg_0.description,
                                     'filesystem_type': arg_0.filesystem_type,
                                     'filesystem_label': arg_0.filesystem_label
                                     })

        if arg_3:
            arg_0.id = arg_3['volume']['id']
            arg_0.created_at = arg_3['volume']['created_at']

        return arg_0


def Func(arg_0, arg_1):
        ''' Cancels the jobs specified by a list of job ids

        Args:
        job_ids : [<job_id> ...]

        Returns :
        [True/False...] : If the Func operation fails the entire list will be False.
        '''
        for arg_2 in arg_1:
            logger.debug("Terminating job/proc_id: {0}".format(arg_2))
            # Here we are assuming that for local, the job_ids are the process id's
            if arg_0.resources[arg_2]['proc']:
                arg_3 = arg_0.resources[arg_2]['proc']
                os.killpg(os.getpgid(arg_3.pid), signal.SIGTERM)
                arg_0.resources[arg_2]['status'] = 'CANCELLED'

            elif arg_0.resources[arg_2]['remote_pid']:
                arg_5 = "kill -- -$(ps -o pgid={} | grep -o '[0-9]*')".format(arg_0.resources[arg_2]['remote_pid'])
                arg_6, arg_7, arg_8 = arg_0.channel.execute_wait(arg_5, arg_0.cmd_timeout)
                if arg_6 != 0:
                    logger.warning("Failed to kill PID: {} and child processes on {}".format(arg_0.resources[arg_2]['remote_pid'],
                                                                                arg_0.label))

        arg_9 = [True for i in arg_1]
        return arg_9

Cancels the jobs specified by a list of job ids

        Args:
        job_ids : [<job_id> ...]

        Returns :
        [True/False...] : If the cancel operation fails the entire list will be False.


def Func(arg_0, arg_1):
        """Uses a union find to find segment."""

        arg_2 = arg_0.UnionFind(arg_0._ent_id)
        arg_3 = arg_0.UnionFind(arg_0._rel_id)

        for arg_4 in arg_1:
            arg_2.add(arg_4.head)
            arg_2.add(arg_4.tail)
            arg_3.add(arg_4.relation)

        for arg_5, arg_4 in enumerate(arg_1):
            arg_6 = arg_2.find(arg_4.head)
            arg_7 = arg_3.find(arg_4.relation)
            arg_4 = arg_2.find(arg_4.tail)
            arg_1[arg_5] = kgedata.TripleIndex(arg_6, arg_7, arg_4)

        arg_8 = bidict()
        arg_9 = 0
        for arg_10, arg_11 in enumerate(arg_2.roots()):
            if not arg_11:
                arg_0._ents.inverse.pop(arg_10)
            else:
                arg_8[arg_0._ents.inverse[arg_10]] = arg_9
            arg_9 += 1
        arg_14 = bidict()
        arg_15 = 0
        for arg_10, arg_16 in enumerate(arg_3.roots()):
            if not arg_16:
                arg_0._rels.inverse.pop(arg_10)
            else:
                arg_14[arg_0._rels.inverse[arg_10]] = arg_15
            arg_15 += 1
        arg_0._ents = arg_8
        arg_0._rels = arg_14
        arg_0._ent_id = arg_9
        arg_0._rel_id = arg_15


(self, gain, gain_type='amplitude', limiter_gain=None)

def Func(arg_0, arg_1, arg_2='amplitude', arg_3=None):
        '''Apply an amplification or an attenuation to the audio signal.

        Parameters
        ----------
        gain : float
            Interpreted according to the given `gain_type`.
            If `gain_type' = 'amplitude', `gain' is a positive amplitude ratio.
            If `gain_type' = 'power', `gain' is a power (Functage squared).
            If `gain_type' = 'db', `gain' is in decibels.
        gain_type : string, default='amplitude'
            Type of gain. One of:
                - 'amplitude'
                - 'power'
                - 'db'
        limiter_gain : float or None, default=None
            If specified, a limiter is invoked on peaks greater than
            `limiter_gain' to prevent clipping.
            `limiter_gain` should be a positive value much less than 1.

        See Also
        --------
        gain, compand

        '''
        if not is_number(arg_1):
            raise ValueError('gain must be a number.')
        if arg_3 is not None:
            if (not is_number(arg_3) or
                    arg_3 <= 0 or arg_3 >= 1):
                raise ValueError(
                    'limiter gain must be a positive number less than 1'
                )
        if arg_2 in ['amplitude', 'power'] and arg_1 < 0:
            raise ValueError(
                "If gain_type = amplitude or power, gain must be positive."
            )

        arg_4 = ['Func']

        arg_4.append('{:f}'.format(arg_1))

        if arg_2 == 'amplitude':
            arg_4.append('amplitude')
        elif arg_2 == 'power':
            arg_4.append('power')
        elif arg_2 == 'db':
            arg_4.append('dB')
        else:
            raise ValueError('gain_type must be one of amplitude power or db')

        if arg_3 is not None:
            if arg_2 in ['amplitude', 'power'] and arg_1 > 1:
                arg_4.append('{:f}'.format(arg_3))
            elif arg_2 == 'db' and arg_1 > 0:
                arg_4.append('{:f}'.format(arg_3))

        arg_0.effects.extend(arg_4)
        arg_0.effects_log.append('Func')

        return arg_0

Apply an amplification or an attenuation to the audio signal.

        Parameters
        ----------
        gain : float
            Interpreted according to the given `gain_type`.
            If `gain_type' = 'amplitude', `gain' is a positive amplitude ratio.
            If `gain_type' = 'power', `gain' is a power (voltage squared).
            If `gain_type' = 'db', `gain' is in decibels.
        gain_type : string, default='amplitude'
            Type of gain. One of:
                - 'amplitude'
                - 'power'
                - 'db'
        limiter_gain : float or None, default=None
            If specified, a limiter is invoked on peaks greater than
            `limiter_gain' to prevent clipping.
            `limiter_gain` should be a positive value much less than 1.

        See Also
        --------
        gain, compand

Apply an amplification or an attenuation to the audio signal .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Get response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the object type, unique identifier, or
                secret attributes are missing from the payload struct.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0.object_type:
            arg_0._object_type.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError("Payload is missing the object type field.")

        if arg_0.unique_identifier:
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Payload is missing the unique identifier field."
            )

        if arg_0.secret:
            arg_0._secret.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError("Payload is missing the secret field.")

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

Write the data encoding the Get response payload to a stream.

        Args:
            output_stream (stream): A data stream in which to encode object
                data, supporting a write method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the object type, unique identifier, or
                secret attributes are missing from the payload struct.

Write the data encoding the Get response payload to a stream .


def Func ( arg_0 ) : try : os . mkdir ( arg_0 ) except OSError as err : if err . errno != errno . EEXIST : raise err

def Func(arg_0):
    '''Try to create a directory. Pass without error if it already exists.
    '''
    try:
        os.mkdir(arg_0)
    except OSError as err:
        if err.errno != errno.EEXIST:
            raise err

Try to create a directory . Pass without error if it already exists .


(self, encoding=None, errors='strict', retain=True)

def Func ( arg_0 , arg_1 = None , arg_2 = 'strict' , arg_3 = True ) : if arg_1 is None and arg_3 : arg_4 = arg_0 . open ( 'U' ) try : return arg_4 . readFunc ( ) finally : arg_4 . close ( ) else : return arg_0 . text ( arg_1 , arg_2 ) . splitFunc ( arg_3 )

def Func(arg_0, arg_1=None, arg_2='strict', arg_3=True):
        r""" Open this file, read all Func, return them in a list.

        Optional arguments:
            encoding - The Unicode encoding (or character set) of
                the file.  The default is None, meaning the content
                of the file is read as 8-bit characters and returned
                as a list of (non-Unicode) str objects.
            errors - How to handle Unicode errors; see help(str.decode)
                for the options.  Default is 'strict'
            retain - If true, retain newline characters; but all newline
                character combinations ('\r', '\n', '\r\n') are
                translated to '\n'.  If false, newline characters are
                stripped off.  Default is True.

        This uses 'U' mode in Python 2.3 and later.
        """
        if arg_1 is None and arg_3:
            arg_4 = arg_0.open('U')
            try:
                return arg_4.readFunc()
            finally:
                arg_4.close()
        else:
            return arg_0.text(arg_1, arg_2).splitFunc(arg_3)

r""" Open this file, read all lines, return them in a list.

        Optional arguments:
            encoding - The Unicode encoding (or character set) of
                the file.  The default is None, meaning the content
                of the file is read as 8-bit characters and returned
                as a list of (non-Unicode) str objects.
            errors - How to handle Unicode errors; see help(str.decode)
                for the options.  Default is 'strict'
            retain - If true, retain newline characters; but all newline
                character combinations ('\r', '\n', '\r\n') are
                translated to '\n'.  If false, newline characters are
                stripped off.  Default is True.

        This uses 'U' mode in Python 2.3 and later.

r Open this file read all lines return them in a list .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) try : arg_3 = arg_2 . describe_clusters ( ClusterIdentifier = arg_1 ) [ 'Clusters' ] return arg_3 [ 0 ] [ 'ClusterStatus' ] if arg_3 else None except arg_2 . exceptions . ClusterNotFoundFault : return 'cluster_not_found'

def Func(arg_0, arg_1):
        """
        Return status of a cluster

        :param cluster_identifier: unique identifier of a cluster
        :type cluster_identifier: str
        """
        arg_2 = arg_0.get_conn()
        try:
            arg_3 = arg_2.describe_clusters(
                ClusterIdentifier=arg_1)['Clusters']
            return arg_3[0]['ClusterStatus'] if arg_3 else None
        except arg_2.exceptions.ClusterNotFoundFault:
            return 'cluster_not_found'


(
            self,
            bundles=None,  # type: Optional[Iterable[BundleHash]]
            addresses=None,  # type: Optional[Iterable[Address]]
            tags=None,  # type: Optional[Iterable[Tag]]
            approvees=None,  # type: Optional[Iterable[TransactionHash]]
    )

return core.FindTransactionsCommand(self.adapter)(
            bundles=bundles,
            addresses=addresses,
            tags=tags,
            approvees=approvees,
        )

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , ) : return core . FindTransactionsCommand ( arg_0 . adapter ) ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , )

def Func(
            arg_0,
            arg_1=None,  # type: Optional[Iterable[BundleHash]]
            arg_2=None,  # type: Optional[Iterable[Address]]
            arg_3=None,  # type: Optional[Iterable[Tag]]
            arg_4=None,  # type: Optional[Iterable[TransactionHash]]
    ):
        # type: (...) -> dict
        """
        Find the transactions which match the specified input and
        return.

        All input values are lists, for which a list of return values
        (transaction hashes), in the same order, is returned for all
        individual elements.

        Using multiple of these input fields returns the intersection of
        the values.

        :param bundles:
          List of bundle IDs.

        :param addresses:
            List of addresses.

        :param tags:
            List of tags.

        :param approvees:
            List of approvee transaction IDs.

        References:

        - https://iota.readme.io/docs/findtransactions
        """
        return core.FindTransactionsCommand(arg_0.adapter)(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
        )

Find the transactions which match the specified input and return .


return lststr0[s:s + index], chr(char), lststr0[s + index + 1:e]

def Func(arg_0, arg_1: arg_2) -> Tuple[str, str, str]:
        """Partition self.string where `char`'s not in atomic sub-spans."""
        arg_3, arg_4 = arg_0._span
        arg_5 = arg_0._shadow.find(arg_1)
        if arg_5 == -1:
            return arg_0._lststr[0][arg_3:arg_4], '', ''
        arg_6 = arg_0._lststr[0]
        return arg_6[arg_3:arg_3 + arg_5], chr(arg_1), arg_6[arg_3 + arg_5 + 1:arg_4]

Partition self . string where char s not in atomic sub - spans .


def Func ( ) : if not os . path . isfile ( 'MANIFEST.in' ) : return with open ( 'MANIFEST.in' ) as manifest : arg_0 = manifest . read ( ) arg_1 , arg_2 = _get_ignore_from_manifest ( arg_0 ) IGNORE . extend ( arg_1 ) IGNORE_REGEXPS . extend ( arg_2 )

def Func():
    """Read existing configuration from MANIFEST.in.

    We use that to ignore anything the MANIFEST.in ignores.
    """
    # XXX modifies global state, which is kind of evil
    if not os.path.isfile('MANIFEST.in'):
        return
    with open('MANIFEST.in') as manifest:
        arg_0 = manifest.read()
    arg_1, arg_2 = _get_ignore_from_manifest(arg_0)
    IGNORE.extend(arg_1)
    IGNORE_REGEXPS.extend(arg_2)

Read existing configuration from MANIFEST . in .


(self, template, script_filename, job_name, configs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
try
:
arg_5
=
Template
(
arg_1
)
.
substitute
(
jobname
=
arg_3
,
**
arg_4
)
with
open
(
arg_2
,
'w'
)
as
f
:
f
.
write
(
arg_5
)
except
KeyError
as
e
:
logger
.
error
(
"Missing keys for submit script : %s"
,
e
)
raise
(
SchedulerMissingArgs
(
e
.
args
,
arg_0
.
sitename
)
)
except
IOError
as
e
:
logger
.
error
(
"Failed writing to submit script: %s"
,
arg_2
)
raise
(
ScriptPathError
(
arg_2
,
e
)
)
except
Exception
as
e
:
print
(
"Template : "
,
arg_1
)
print
(
"Args : "
,
arg_3
)
print
(
"Kwargs : "
,
arg_4
)
logger
.
error
(
"Uncategorized error: %s"
,
e
)
raise
(
e
)
return
True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Generate submit script and write it to a file.

        Args:
              - template (string) : The template string to be used for the writing submit script
              - script_filename (string) : Name of the submit script
              - job_name (string) : job name
              - configs (dict) : configs that get pushed into the template

        Returns:
              - True: on success

        Raises:
              SchedulerMissingArgs : If template is missing args
              ScriptPathError : Unable to write submit script out
        """

        try:
            arg_5 = Template(arg_1).substitute(jobname=arg_3, **arg_4)
            # submit_script = Template(template).safe_substitute(jobname=job_name, **configs)
            with open(arg_2, 'w') as f:
                f.write(arg_5)

        except KeyError as e:
            logger.error("Missing keys for submit script : %s", e)
            raise (SchedulerMissingArgs(e.args, arg_0.sitename))

        except IOError as e:
            logger.error("Failed writing to submit script: %s", arg_2)
            raise (ScriptPathError(arg_2, e))
        except Exception as e:
            print("Template : ", arg_1)
            print("Args : ", arg_3)
            print("Kwargs : ", arg_4)
            logger.error("Uncategorized error: %s", e)
            raise (e)

        return True

Generate submit script and write it to a file .


def Func(arg_0, arg_1, arg_2, arg_3=1):
        """
        Retrieves a single LAN by ID.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      lan_id: The unique ID of the LAN.
        :type       lan_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_4 = arg_0._perform_request(
            '/datacenters/%s/lans/%s?depth=%s' % (
                arg_1,
                arg_2,
                str(arg_3)))

        return arg_4


return (
            self.get_conn()
            .transferJobs()
            .get(jobName=job_name, projectId=project_id)
            .execute(num_retries=self.num_retries)
        )

def Func ( arg_0 , arg_1 , arg_2 = None ) : return ( arg_0 . get_conn ( ) . transferJobs ( ) . get ( jobName = arg_1 , projectId = arg_2 ) . execute ( num_retries = arg_0 . num_retries ) )

def Func(arg_0, arg_1, arg_2=None):
        """
        Gets the latest state of a long-running operation in Google Storage
        Transfer Service.

        :param job_name: (Required) Name of the job to be fetched
        :type job_name: str
        :param project_id: (Optional) the ID of the project that owns the Transfer
            Job. If set to None or missing, the default project_id from the GCP
            connection is used.
        :type project_id: str
        :return: Transfer Job
        :rtype: dict
        """
        return (
            arg_0.get_conn()
            .transferJobs()
            .get(jobName=arg_1, projectId=arg_2)
            .execute(num_retries=arg_0.num_retries)
        )

Gets the latest state of a long - running operation in Google Storage Transfer Service .


return HttpResponse(json.dumps(response_data), content_type="text/html; charset=utf-8")

def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
method
!=
'POST'
:
raise
Http404
if
arg_1
.
is_ajax
(
)
:
try
:
arg_2
=
arg_1
.
GET
[
'quillUploadFile'
]
arg_3
=
arg_1
arg_4
=
True
except
KeyError
:
return
HttpResponseBadRequest
(
"Invalid file upload."
)
else
:
if
len
(
arg_1
.
FILES
)
!=
1
:
return
HttpResponseBadRequest
(
"Can only upload 1 file at a time."
)
try
:
arg_3
=
arg_1
.
FILES
[
'quillUploadFile'
]
arg_2
=
arg_3
.
name
arg_4
=
False
except
KeyError
:
return
HttpResponseBadRequest
(
'Missing image `quillUploadFile`.'
)
arg_5
=
save_file
(
arg_3
,
arg_2
,
arg_4
,
default_storage
)
arg_6
=
{
}
arg_6
[
'url'
]
=
arg_5
return
HttpResponse
(
json
.
dumps
(
arg_6
)
,
content_type
=
"text/html; charset=utf-8"
)

def Func(arg_0, arg_1):
        """Handle file uploads from WYSIWYG."""
        if arg_1.method != 'POST':
            raise Http404

        if arg_1.is_ajax():
            try:
                arg_2 = arg_1.GET['quillUploadFile']
                arg_3 = arg_1
                arg_4 = True
            except KeyError:
                return HttpResponseBadRequest("Invalid file upload.")
        else:
            if len(arg_1.FILES) != 1:
                return HttpResponseBadRequest("Can only upload 1 file at a time.")
            try:
                arg_3 = arg_1.FILES['quillUploadFile']
                arg_2 = arg_3.name
                arg_4 = False
            except KeyError:
                return HttpResponseBadRequest('Missing image `quillUploadFile`.')

        arg_5 = save_file(arg_3, arg_2, arg_4, default_storage)
        arg_6 = {}
        arg_6['url'] = arg_5

        # Response content type needs to be text/html here or else
        # IE will try to download the file.
        return HttpResponse(json.dumps(arg_6), content_type="text/html; charset=utf-8")


def Func(arg_0, arg_1, arg_2=None):
    """Primitive text file stream editor.

    This function can be used to edit free-form text files such as the
    topology file. By default it does an **in-place edit** of
    *filename*. If *newname* is supplied then the edited
    file is written to *newname*.

    :Arguments:
       *filename*
           input text file
       *substitutions*
           substitution commands (see below for format)
       *newname*
           output filename; if ``None`` then *filename* is changed in
           place [``None``]

    *substitutions* is a list of triplets; the first two elements are regular
    expression strings, the last is the substitution value. It mimics
    ``sed`` search and replace. The rules for *substitutions*:

    .. productionlist::
       substitutions: "[" search_replace_tuple, ... "]"
       search_replace_tuple: "(" line_match_RE "," search_RE "," replacement ")"
       line_match_RE: regular expression that selects the line (uses match)
       search_RE: regular expression that is searched in the line
       replacement: replacement string for search_RE

    Running :func:`Func` does pretty much what a simple ::

         sed /line_match_RE/s/search_RE/replacement/

    with repeated substitution commands does.

    Special replacement values:
    - ``None``: the rule is ignored
    - ``False``: the line is deleted (even if other rules match)

    .. note::

       * No sanity checks are performed and the substitutions must be supplied
         exactly as shown.
       * All substitutions are applied to a line; thus the order of the substitution
         commands may matter when one substitution generates a match for a subsequent rule.
       * If replacement is set to ``None`` then the whole expression is ignored and
         whatever is in the template is used. To unset values you must provided an
         empty string or similar.
       * Delete a matching line if replacement=``False``.
    """
    if arg_2 is None:
        arg_2 = arg_0

    # No sanity checks (figure out later how to give decent diagnostics).
    # Filter out any rules that have None in replacement.
    arg_3 = [{'lRE': re.compile(str(lRE)),
                       'sRE': re.compile(str(sRE)),
                       'repl': repl}
                      for lRE,sRE,repl in arg_1 if repl is not None]

    with tempfile.TemporaryFile() as target:
        with open(arg_0, 'rb') as src:
            logger.info("editing txt = {0!r} ({1:d} substitutions)".format(arg_0, len(arg_1)))
            for arg_4 in src:
                arg_4 = arg_4.decode("utf-8")
                arg_5 = True
                for arg_6 in arg_3:
                    arg_7 = arg_6['lRE'].match(arg_4)
                    if arg_7:              # apply substition to this line?
                        logger.debug('match:    '+arg_4.rstrip())
                        if arg_6['repl'] is False:   # special rule: delete line
                            arg_5 = False
                        else:                        # standard replacement
                            arg_4 = arg_6['sRE'].sub(str(arg_6['repl']), arg_4)
                            logger.debug('replaced: '+arg_4.rstrip())
                if arg_5:
                    target.write(arg_4.encode('utf-8'))
                else:
                    logger.debug("Deleting line %r", arg_4)

        target.seek(0)
        with open(arg_2, 'wb') as final:
            shutil.copyfileobj(target, final)
    logger.info("edited txt = {newname!r}".format(**vars()))

Primitive text file stream editor.

    This function can be used to edit free-form text files such as the
    topology file. By default it does an **in-place edit** of
    *filename*. If *newname* is supplied then the edited
    file is written to *newname*.

    :Arguments:
       *filename*
           input text file
       *substitutions*
           substitution commands (see below for format)
       *newname*
           output filename; if ``None`` then *filename* is changed in
           place [``None``]

    *substitutions* is a list of triplets; the first two elements are regular
    expression strings, the last is the substitution value. It mimics
    ``sed`` search and replace. The rules for *substitutions*:

    .. productionlist::
       substitutions: "[" search_replace_tuple, ... "]"
       search_replace_tuple: "(" line_match_RE "," search_RE "," replacement ")"
       line_match_RE: regular expression that selects the line (uses match)
       search_RE: regular expression that is searched in the line
       replacement: replacement string for search_RE

    Running :func:`edit_txt` does pretty much what a simple ::

         sed /line_match_RE/s/search_RE/replacement/

    with repeated substitution commands does.

    Special replacement values:
    - ``None``: the rule is ignored
    - ``False``: the line is deleted (even if other rules match)

    .. note::

       * No sanity checks are performed and the substitutions must be supplied
         exactly as shown.
       * All substitutions are applied to a line; thus the order of the substitution
         commands may matter when one substitution generates a match for a subsequent rule.
       * If replacement is set to ``None`` then the whole expression is ignored and
         whatever is in the template is used. To unset values you must provided an
         empty string or similar.
       * Delete a matching line if replacement=``False``.


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
logger
.
info
(
'server ping: %s'
%
arg_1
)
arg_0
.
send
(
'PONG %s'
%
arg_1
,
True
)

def Func(arg_0, arg_1):
        """\
        Respond to periodic PING messages from server
        """
        arg_0.logger.info('server ping: %s' % arg_1)
        arg_0.send('PONG %s' % arg_1, True)


def Func(arg_0, arg_1, arg_2):
    """Checks if a given stream_id and tuple matches with the output schema

    :type stream_id: str
    :param stream_id: stream id into which tuple is sent
    :type tup: list
    :param tup: tuple that is going to be sent
    """
    # do some checking to make sure that the number of fields match what's expected
    arg_3 = arg_0._output_schema.get(arg_1, None)
    if arg_3 is None:
      raise RuntimeError("%s emitting to stream %s but was not declared in output fields"
                         % (arg_0.my_component_name, arg_1))
    elif arg_3 != len(arg_2):
      raise RuntimeError("Number of fields emitted in stream %s does not match what's expected. "
                         "Expected: %s, Observed: %s" % (arg_1, arg_3, len(arg_2)))