def
Func
(
arg_0
)
:
if
arg_0
.
container
:
return
if
arg_0
.
width
:
if
arg_0
.
width
[
1
]
!=
'%'
:
arg_0
.
style
+=
'width:%spx;'
%
arg_0
.
width
else
:
arg_0
.
style
+=
'width:%s;'
%
arg_0
.
width
if
arg_0
.
height
:
if
arg_0
.
height
[
1
]
!=
'%'
:
arg_0
.
style
+=
'height:%spx;'
%
arg_0
.
height
else
:
arg_0
.
style
+=
'height:%s;'
%
arg_0
.
height
if
arg_0
.
style
:
arg_0
.
style
=
'style="%s"'
%
arg_0
.
style
arg_0
.
container
=
arg_0
.
containerheader
+
'
<svg %s></svg>
\n'
%
(
arg_0
.
name
,
arg_0
.
style
)

def Func(arg_0):
        """generate HTML div"""
        if arg_0.container:
            return

        # Create SVG div with style
        if arg_0.width:
            if arg_0.width[-1] != '%':
                arg_0.style += 'width:%spx;' % arg_0.width
            else:
                arg_0.style += 'width:%s;' % arg_0.width
        if arg_0.height:
            if arg_0.height[-1] != '%':
                arg_0.style += 'height:%spx;' % arg_0.height
            else:
                arg_0.style += 'height:%s;' % arg_0.height
        if arg_0.style:
            arg_0.style = 'style="%s"' % arg_0.style

        arg_0.container = arg_0.containerheader + \
            '
<svg %s></svg>
\n' % (arg_0.name, arg_0.style)


def Func(arg_0):
        ''' make some basic checks on the function to make sure it is valid'''
        # note, callable is valid for Python 2 and Python 3.2 onwards but
        # not inbetween
        if not callable(arg_0._function):
            raise RuntimeError(
                "provided function '{0}' is not callable".
                format(str(arg_0._function)))
        from inspect import getargspec
        arg_1 = getargspec(arg_0._function)
        if len(arg_1.args) != 1:
            print str(arg_1)
            raise RuntimeError(
                "provided function should have one argument but found "
                "{0}".format(len(arg_1.args)))


(self, start_s=None, duration_s=None, start_sample=None, num_samples=None, zero_pad=False)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=False):
        """
        Transforms the indicated slice of the AudioSegment into the frequency domain and returns the bins
        and the values.

        If neither `start_s` or `start_sample` is specified, the first sample of the slice will be the first sample
        of the AudioSegment.

        If neither `duration_s` or `num_samples` is specified, the slice will be from the specified start
        to the end of the segment.

        .. code-block:: python

            # Example for plotting the FFT using this function
            import matplotlib.pyplot as plt
            import numpy as np

            seg = audiosegment.from_file("furelise.wav")
            # Just take the first 3 seconds
            hist_bins, hist_vals = seg[1:3000].Func()
            hist_vals_real_normed = np.abs(hist_vals) / len(hist_vals)
            plt.plot(hist_bins / 1000, hist_vals_real_normed)
            plt.xlabel("kHz")
            plt.ylabel("dB")
            plt.show()

        .. image:: images/Func.png

        :param start_s: The start time in seconds. If this is specified, you cannot specify `start_sample`.
        :param duration_s: The duration of the slice in seconds. If this is specified, you cannot specify `num_samples`.
        :param start_sample: The zero-based index of the first sample to include in the slice.
                             If this is specified, you cannot specify `start_s`.
        :param num_samples: The number of samples to include in the slice. If this is specified, you cannot
                            specify `duration_s`.
        :param zero_pad: If True and the combination of start and duration result in running off the end of
                         the AudioSegment, the end is zero padded to prevent this.
        :returns: np.ndarray of frequencies in Hz, np.ndarray of amount of each frequency
        :raises: ValueError If `start_s` and `start_sample` are both specified and/or if both `duration_s` and
                            `num_samples` are specified.
        """
        if arg_1 is not None and arg_3 is not None:
            raise ValueError("Only one of start_s and start_sample can be specified.")
        if arg_2 is not None and arg_4 is not None:
            raise ValueError("Only one of duration_s and num_samples can be specified.")
        if arg_1 is None and arg_3 is None:
            arg_3 = 0
        if arg_2 is None and arg_4 is None:
            arg_4 = len(arg_0.get_array_of_samples()) - int(arg_3)

        if arg_2 is not None:
            arg_4 = int(round(arg_2 * arg_0.frame_rate))
        if arg_1 is not None:
            arg_3 = int(round(arg_1 * arg_0.frame_rate))

        arg_6 = arg_3 + arg_4  # end_sample is excluded
        if arg_6 > len(arg_0.get_array_of_samples()) and not arg_5:
            raise ValueError("The combination of start and duration will run off the end of the AudioSegment object.")
        elif arg_6 > len(arg_0.get_array_of_samples()) and arg_5:
            arg_7 = np.array(arg_0.get_array_of_samples())
            arg_8 = np.zeros(arg_6 - len(arg_7))
            arg_7 = np.append(arg_7, arg_8)
        else:
            arg_7 = np.array(arg_0.get_array_of_samples())

        arg_9 = np.array(arg_7[arg_3:arg_6])
        arg_10 = np.Func.Func(arg_9)[range(int(round(arg_4/2)) + 1)]
        arg_11 = arg_0.frame_rate / arg_4
        arg_12 = np.arange(0, int(round(arg_4/2)) + 1, 1.0) * arg_11
        return arg_12, arg_10

Transforms the indicated slice of the AudioSegment into the frequency domain and returns the bins
        and the values.

        If neither `start_s` or `start_sample` is specified, the first sample of the slice will be the first sample
        of the AudioSegment.

        If neither `duration_s` or `num_samples` is specified, the slice will be from the specified start
        to the end of the segment.

        .. code-block:: python

            # Example for plotting the FFT using this function
            import matplotlib.pyplot as plt
            import numpy as np

            seg = audiosegment.from_file("furelise.wav")
            # Just take the first 3 seconds
            hist_bins, hist_vals = seg[1:3000].fft()
            hist_vals_real_normed = np.abs(hist_vals) / len(hist_vals)
            plt.plot(hist_bins / 1000, hist_vals_real_normed)
            plt.xlabel("kHz")
            plt.ylabel("dB")
            plt.show()

        .. image:: images/fft.png

        :param start_s: The start time in seconds. If this is specified, you cannot specify `start_sample`.
        :param duration_s: The duration of the slice in seconds. If this is specified, you cannot specify `num_samples`.
        :param start_sample: The zero-based index of the first sample to include in the slice.
                             If this is specified, you cannot specify `start_s`.
        :param num_samples: The number of samples to include in the slice. If this is specified, you cannot
                            specify `duration_s`.
        :param zero_pad: If True and the combination of start and duration result in running off the end of
                         the AudioSegment, the end is zero padded to prevent this.
        :returns: np.ndarray of frequencies in Hz, np.ndarray of amount of each frequency
        :raises: ValueError If `start_s` and `start_sample` are both specified and/or if both `duration_s` and
                            `num_samples` are specified.

Transforms the indicated slice of the AudioSegment into the frequency domain and returns the bins and the values .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = csv . writer ( arg_1 , encoding = 'utf-8' , delimiter = arg_0 . field_delimiter ) arg_3 . writerow ( arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Configure a csv writer with the file_handle and write schema
        as headers for the new file.
        """
        arg_3 = csv.writer(arg_1, encoding='utf-8',
                                delimiter=arg_0.field_delimiter)
        arg_3.writerow(arg_2)
        return arg_3

Configure a csv writer with the file_handle and write schema as headers for the new file .


def
Func
(
arg_0
,
arg_1
=
5
)
:
arg_2
=
timeseries
.
gen_drawdown_table
(
arg_0
,
arg_1
=
arg_1
)
utils
.
print_table
(
arg_2
.
sort_values
(
'Net drawdown in %'
,
ascending
=
False
)
,
name
=
'Worst drawdown periods'
,
float_format
=
'{0:.2f}'
.
format
,
)

def Func(arg_0, arg_1=5):
    """
    Prints information about the worst drawdown periods.

    Prints peak dates, valley dates, recovery dates, and net
    drawdowns.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    top : int, optional
        Amount of top drawdowns periods to plot (default 5).
    """

    arg_2 = timeseries.gen_drawdown_table(arg_0, arg_1=arg_1)
    utils.print_table(
        arg_2.sort_values('Net drawdown in %', ascending=False),
        name='Worst drawdown periods',
        float_format='{0:.2f}'.format,
    )

Prints information about the worst drawdown periods .


(cond, true_vector, false_vector, name="pick_vector")

def Func(arg_0, arg_1, arg_2, arg_3="Func"):
  """Picks possibly different length row `Tensor`s based on condition.

  Value `Tensor`s should have exactly one dimension.

  If `cond` is a python Boolean or `tf.constant` then either `true_vector` or
  `false_vector` is immediately returned. I.e., no graph nodes are created and
  no validation happens.

  Args:
    cond: `Tensor`. Must have `dtype=tf.bool` and be scalar.
    true_vector: `Tensor` of one dimension. Returned when cond is `True`.
    false_vector: `Tensor` of one dimension. Returned when cond is `False`.
    name: Python `str`. The name to give this op.
  Example:  ```python Func(tf.less(0, 5), tf.range(10, 12), tf.range(15,
    18))  # [10, 11] Func(tf.less(5, 0), tf.range(10, 12), tf.range(15,
    18))  # [15, 16, 17] ```

  Returns:
    true_or_false_vector: `Tensor`.

  Raises:
    TypeError: if `cond.dtype != tf.bool`
    TypeError: if `cond` is not a constant and
      `true_vector.dtype != false_vector.dtype`
  """
  with tf.name_scope(arg_3):
    arg_0 = tf.convert_to_tensor(
        value=arg_0, dtype_hint=tf.bool, arg_3="cond")
    if arg_0.dtype != tf.bool:
      raise TypeError(
          "{}.dtype={} which is not {}".format(arg_0, arg_0.dtype, tf.bool))

    arg_1 = tf.convert_to_tensor(value=arg_1, arg_3="true_vector")
    arg_2 = tf.convert_to_tensor(value=arg_2, arg_3="false_vector")
    if arg_1.dtype != arg_2.dtype:
      raise TypeError(
          "{}.dtype={} does not match {}.dtype={}".format(
              arg_1, arg_1.dtype, arg_2, arg_2.dtype))

    arg_4 = tf.get_static_value(arg_0)
    if arg_4 is not None:
      return arg_1 if arg_4 else arg_2
    arg_5 = tf.shape(input=arg_1)[0]
    return tf.slice(
        tf.concat([arg_1, arg_2], 0), [tf.where(arg_0, 0, arg_5)],
        [tf.where(arg_0, arg_5, -1)])

Picks possibly different length row `Tensor`s based on condition.

  Value `Tensor`s should have exactly one dimension.

  If `cond` is a python Boolean or `tf.constant` then either `true_vector` or
  `false_vector` is immediately returned. I.e., no graph nodes are created and
  no validation happens.

  Args:
    cond: `Tensor`. Must have `dtype=tf.bool` and be scalar.
    true_vector: `Tensor` of one dimension. Returned when cond is `True`.
    false_vector: `Tensor` of one dimension. Returned when cond is `False`.
    name: Python `str`. The name to give this op.
  Example:  ```python pick_vector(tf.less(0, 5), tf.range(10, 12), tf.range(15,
    18))  # [10, 11] pick_vector(tf.less(5, 0), tf.range(10, 12), tf.range(15,
    18))  # [15, 16, 17] ```

  Returns:
    true_or_false_vector: `Tensor`.

  Raises:
    TypeError: if `cond.dtype != tf.bool`
    TypeError: if `cond` is not a constant and
      `true_vector.dtype != false_vector.dtype`

Picks possibly different length row Tensor s based on condition .


(log_prob, log_trans, log_p_init, state, value, ptr)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):  # pragma: no cover
    '''Core Viterbi algorithm.

    This is intended for internal use only.

    Parameters
    ----------
    log_prob : np.ndarray [shape=(T, m)]
        `log_prob[t, s]` is the conditional log-likelihood
        log P[X = X(t) | State(t) = s]

    log_trans : np.ndarray [shape=(m, m)]
        The log transition matrix
        `log_trans[i, j]` = log P[State(t+1) = j | State(t) = i]

    log_p_init : np.ndarray [shape=(m,)]
        log of the initial state distribution

    state : np.ndarray [shape=(T,), dtype=int]
        Pre-allocated state index array

    value : np.ndarray [shape=(T, m)] float
        Pre-allocated value array

    ptr : np.ndarray [shape=(T, m), dtype=int]
        Pre-allocated pointer array

    Returns
    -------
    None
        All computations are performed in-place on `state, value, ptr`.
    '''
    arg_6, arg_7 = arg_0.shape

    # factor in initial state distribution
    arg_4[0] = arg_0[0] + arg_2

    for arg_8 in range(1, arg_6):
        # Want V[t, j] <- p[t, j] * max_k V[t-1, k] * A[k, j]
        #    assume at time t-1 we were in state k
        #    transition k -> j

        # Broadcast over rows:
        #    Tout[k, j] = V[t-1, k] * A[k, j]
        #    then take the max over columns
        # We'll do this in log-space for stability

        arg_9 = arg_4[arg_8 - 1] + arg_1.T

        # Unroll the max/argmax loop to enable numba support
        for arg_10 in range(arg_7):
            arg_5[arg_8, arg_10] = np.argmax(arg_9[arg_10])
            # value[t, j] = log_prob[t, j] + np.max(trans_out[j])
            arg_4[arg_8, arg_10] = arg_0[arg_8, arg_10] + arg_9[arg_10, arg_5[arg_8][arg_10]]

    # Now roll backward

    # Get the last state
    arg_3[-1] = np.argmax(arg_4[-1])

    for arg_8 in range(arg_6 - 2, -1, -1):
        arg_3[arg_8] = arg_5[arg_8+1, arg_3[arg_8+1]]


def Func(arg_0, arg_1, arg_2, **arg_3):
        """Settle messages that have been previously deferred.

        :param settlement: How the messages are to be settled. This must be a string
         of one of the following values: 'completed', 'suspended', 'abandoned'.
        :type settlement: str
        :param messages: A list of deferred messages to be settled.
        :type messages: list[~azure.servicebus.common.message.DeferredMessage]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func_service_bus]
                :end-before: [END Func_service_bus]
                :language: python
                :dedent: 8
                :caption: Settle deferred messages.

        """
        if (arg_0.entity and arg_0.requires_session) or arg_3.get('session'):
            raise ValueError("Sessionful deferred messages can only be settled within a locked receive session.")
        if arg_1.lower() not in ['completed', 'suspended', 'abandoned']:
            raise ValueError("Settlement must be one of: 'completed', 'suspended', 'abandoned'")
        if not arg_2:
            raise ValueError("At least one message must be specified.")
        arg_4 = {
            'disposition-status': arg_1.lower(),
            'lock-tokens': types.AMQPArray([m.lock_token for m in arg_2])}

        with BaseHandler(arg_0.entity_uri, arg_0.auth_config, debug=arg_0.debug, **arg_3) as handler:
            return handler._mgmt_request_response(  # pylint: disable=protected-access
                REQUEST_RESPONSE_UPDATE_DISPOSTION_OPERATION,
                arg_4,
                mgmt_handlers.default)

Settle messages that have been previously deferred.

        :param settlement: How the messages are to be settled. This must be a string
         of one of the following values: 'completed', 'suspended', 'abandoned'.
        :type settlement: str
        :param messages: A list of deferred messages to be settled.
        :type messages: list[~azure.servicebus.common.message.DeferredMessage]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START settle_deferred_messages_service_bus]
                :end-before: [END settle_deferred_messages_service_bus]
                :language: python
                :dedent: 8
                :caption: Settle deferred messages.

Settle messages that have been previously deferred .


return {"id": self.id,
                "compile": self.compile,
                "position": self.position,
                "version": self.version}

def Func ( arg_0 ) : return { "id" : arg_0 . id , "compile" : arg_0 . compile , "position" : arg_0 . position , "version" : arg_0 . version }

def Func(arg_0):
        """Get a json dict of the attributes of this object."""
        return {"id": arg_0.id,
                "compile": arg_0.compile,
                "position": arg_0.position,
                "version": arg_0.version}

Get a json dict of the attributes of this object .


def Func(arg_0, arg_1):
        """Sends a delete request for the report JSON hash

        Parameters
        ----------
        report_id : str
            Hash of the report JSON as retrieved from :func:`~_get_report_hash`
        """

        logger.debug(
            "Closing connection and sending DELETE request to {}".format(
                arg_0.broadcast_address))

        try:
            arg_2 = requests.delete(arg_0.broadcast_address,
                                json={"run_id": arg_1})
            if arg_2.status_code != 202:
                logger.error(colored_print(
                    "ERROR: There was a problem sending data to the server"
                    "with reason: {}".format(arg_2.reason)))
        except requests.exceptions.ConnectionError:
            logger.error(colored_print(
                "ERROR: Could not establish connection with server. The server"
                " may be down or there is a problem with your internet "
                "connection.", "red_bold"))
            sys.exit(1)


def Func ( arg_0 ) : if arg_0 . data : arg_0 . document = arg_0 . _update_document ( arg_0 . document , arg_0 . data ) return arg_0 . document

def Func(arg_0):
        """Encodes the stored ``data`` to XML and returns
        an ``lxml.etree`` value.
        """
        if arg_0.data:
            arg_0.document = arg_0._update_document(arg_0.document, arg_0.data)

        return arg_0.document

Encodes the stored data to XML and returns an lxml . etree value .


return '%s%s%s' % (self.color_table.active_colors.header,h,
                           self.color_table.active_colors.normal)

def Func ( arg_0 , arg_1 ) : return '%s%s%s' % ( arg_0 . color_table . active_colors . header , arg_1 , arg_0 . color_table . active_colors . normal )

def Func(arg_0,arg_1):
        """Return a header string with proper colors."""
        return '%s%s%s' % (arg_0.color_table.active_colors.header,arg_1,
                           arg_0.color_table.active_colors.normal)

Return a header string with proper colors .


def Func ( arg_0 ) : if options [ 'handleUnrecognised' ] == UNRECOGNISED_ECHO : return arg_0 elif options [ 'handleUnrecognised' ] == UNRECOGNISED_SUBSTITUTE : return options [ 'substituteChar' ] else : raise ( KeyError , arg_0 )

def Func(arg_0):
    """ Handle unrecognised characters. """
    if options['handleUnrecognised'] == UNRECOGNISED_ECHO:
        return arg_0
    elif options['handleUnrecognised'] == UNRECOGNISED_SUBSTITUTE:
        return options['substituteChar']
    else:
        raise (KeyError, arg_0)


def Func(arg_0):
  """A decorator that maintains the attribute lock state of an object

  It coperates with the LockAttributesMetaclass (see bellow) that replaces
  the __setattr__ method with a custom one that checks the _canAddAttributes
  counter and allows setting new attributes only if _canAddAttributes > 0.

  New attributes can be set only from methods decorated
  with this decorator (should be only __init__ and __setstate__ normally)

  The decorator is reentrant (e.g. if from inside a decorated function another
  decorated function is invoked). Before invoking the target function it
  increments the counter (or sets it to 1). After invoking the target function
  it decrements the counter and if it's 0 it removed the counter.
  """
  def arg_7(arg_1, *arg_2, **arg_3):
    """The decorated function that replaces __init__() or __setstate__()

    """
    # Run the original function
    if not hasattr(arg_1, '_canAddAttributes'):
      arg_1.__dict__['_canAddAttributes'] = 1
    else:
      arg_1._canAddAttributes += 1
    assert arg_1._canAddAttributes >= 1

    # Save add attribute counter
    arg_5 = arg_1._canAddAttributes
    arg_0(arg_1, *arg_2, **arg_3)

    # Restore _CanAddAttributes if deleted from dict (can happen in __setstte__)
    if hasattr(arg_1, '_canAddAttributes'):
      arg_1._canAddAttributes -= 1
    else:
      arg_1._canAddAttributes = arg_5 - 1

    assert arg_1._canAddAttributes >= 0
    if arg_1._canAddAttributes == 0:
      del arg_1._canAddAttributes

  arg_7.__doc__ = arg_0.__doc__
  arg_7.__name__ = arg_0.__name__
  return arg_7


def
Func
(
arg_0
)
:
arg_1
=
"SWHLab %s "
%
str
(
swhlab
.
VERSION
)
arg_1
+=
"ID:%s "
%
arg_0
.
ID
arg_1
+=
"CH:%d "
%
arg_0
.
channel
arg_1
+=
"PROTOCOL:%s "
%
arg_0
.
protoComment
arg_1
+=
"COMMAND: %d%s "
%
(
arg_0
.
holding
,
arg_0
.
units
)
arg_1
+=
"GENERATED:%s "
%
'{0:%Y-%m-%d %H:%M:%S}'
.
format
(
datetime
.
datetime
.
now
(
)
)
pylab
.
Func
(
arg_1
,
(
.001
,
.001
)
,
xycoords
=
'figure fraction'
,
ha
=
'left'
,
va
=
'bottom'
,
color
=
'#999999'
,
family
=
'monospace'
,
size
=
8
,
weight
=
'bold'
)
if
arg_0
.
nADC
>
1
:
arg_1
=
"Ch %d/%d"
%
(
arg_0
.
channel
+
1
,
arg_0
.
nADC
)
pylab
.
Func
(
arg_1
,
(
.01
,
.99
)
,
xycoords
=
'figure fraction'
,
ha
=
'left'
,
va
=
'top'
,
color
=
'#FF0000'
,
family
=
'monospace'
,
size
=
12
,
weight
=
'bold'
)

def Func(arg_0):
    """stamp the bottom with file info."""
    arg_1="SWHLab %s "%str(swhlab.VERSION)
    arg_1+="ID:%s "%arg_0.ID
    arg_1+="CH:%d "%arg_0.channel
    arg_1+="PROTOCOL:%s "%arg_0.protoComment
    arg_1+="COMMAND: %d%s "%(arg_0.holding,arg_0.units)
    arg_1+="GENERATED:%s "%'{0:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now())
    pylab.Func(arg_1,(.001,.001),xycoords='figure fraction',ha='left',
                   va='bottom',color='#999999',family='monospace',size=8,
                   weight='bold')
    if arg_0.nADC>1:
        arg_1="Ch %d/%d"%(arg_0.channel+1,arg_0.nADC)
        pylab.Func(arg_1,(.01,.99),xycoords='figure fraction',ha='left',
                       va='top',color='#FF0000',family='monospace',size=12,
                       weight='bold')


def Func ( arg_0 , arg_1 ) : if arg_1 : arg_1 = set ( str ( i ) for i in arg_1 ) arg_2 = arg_0 . _api . ledgeraccounts . filter ( code__in = arg_1 ) arg_3 = dict ( ( str ( i [ 'Code' ] ) , i [ 'ID' ] ) for i in arg_2 ) arg_4 = set ( arg_3 . keys ( ) ) arg_5 = ( arg_1 - arg_4 ) if arg_5 : raise UnknownLedgerCodes ( arg_5 ) return arg_3 return { }

def Func(arg_0, arg_1):
        """
        Convert set of human codes and to a dict of code to exactonline
        guid mappings.

        Example::

            ret = inv.Func(['1234', '5555'])
            ret == {'1234': '<guid1_from_exactonline_ledgeraccounts>',
                    '5555': '<guid2_from_exactonline_ledgeraccounts>'}
        """
        if arg_1:
            arg_1 = set(str(i) for i in arg_1)
            arg_2 = arg_0._api.ledgeraccounts.filter(code__in=arg_1)
            arg_3 = dict((str(i['Code']), i['ID']) for i in arg_2)
            arg_4 = set(arg_3.keys())
            arg_5 = (arg_1 - arg_4)
            if arg_5:
                raise UnknownLedgerCodes(arg_5)
            return arg_3
        return {}

Convert set of human codes and to a dict of code to exactonline
        guid mappings.

        Example::

            ret = inv.get_ledger_code_to_guid_map(['1234', '5555'])
            ret == {'1234': '<guid1_from_exactonline_ledgeraccounts>',
                    '5555': '<guid2_from_exactonline_ledgeraccounts>'}

Convert set of human codes and to a dict of code to exactonline guid mappings .


def Func ( arg_0 , arg_1 ) : arg_0 . object_list = arg_1 . save ( ) return super ( ModelFormSetMixin , arg_0 ) . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        If the formset is valid, save the associated models.
        """
        arg_0.object_list = arg_1.save()
        return super(ModelFormSetMixin, arg_0).Func(arg_1)

If the formset is valid save the associated models .


def Func(arg_0, arg_1):
        """Constrain state.

        :param manticore.core.smtlib.Bool Funct: Constraint to add
        """
        arg_1 = arg_0.migrate_expression(arg_1)
        arg_0._Functs.add(arg_1)

Constrain state.

        :param manticore.core.smtlib.Bool constraint: Constraint to add


def Func():
    """
    Ensure that all necessary resources to render the view are present.
    """
    arg_0 = {
        'ProgramDataExtender': ProgramDataExtender,
    }

    for arg_1 in arg_0:
        if arg_0[arg_1] is None:
            raise NotConnectedToOpenEdX(
                _("The following method from the Open edX platform is necessary for this view but isn't available.")
                + "\nUnavailable: {method}".format(arg_1=arg_1)
            )

Ensure that all necessary resources to render the view are present .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = False if arg_0 . ndim == 2 : arg_3 = True arg_0 = arg_0 [ : , : , np . newaxis ] do_assert ( len ( arg_0 . shape ) == 3 , arg_0 . shape ) arg_4 = imresize_many_images ( arg_0 [ np . newaxis , : , : , : ] , arg_1 , arg_2 = arg_2 ) if arg_3 : return np . squeeze ( arg_4 [ 0 , : , : , 0 ] ) else : return arg_4 [ 0 , ... ]

def Func(arg_0, arg_1, arg_2=None):
    """
    Resizes a single image.

    dtype support::

        See :func:`imgaug.imgaug.imresize_many_images`.

    Parameters
    ----------
    image : (H,W,C) ndarray or (H,W) ndarray
        Array of the image to resize.
        Usually recommended to be of dtype uint8.

    sizes : float or iterable of int or iterable of float
        See :func:`imgaug.imgaug.imresize_many_images`.

    interpolation : None or str or int, optional
        See :func:`imgaug.imgaug.imresize_many_images`.

    Returns
    -------
    out : (H',W',C) ndarray or (H',W') ndarray
        The resized image.

    """
    arg_3 = False
    if arg_0.ndim == 2:
        arg_3 = True
        arg_0 = arg_0[:, :, np.newaxis]
    do_assert(len(arg_0.shape) == 3, arg_0.shape)
    arg_4 = imresize_many_images(arg_0[np.newaxis, :, :, :], arg_1, arg_2=arg_2)
    if arg_3:
        return np.squeeze(arg_4[0, :, :, 0])
    else:
        return arg_4[0, ...]


def Func(arg_0):
		"""
		Calculate the margin in pixels below the plot area, setting
		border_bottom.
		"""
		arg_1 = 7
		if arg_0.key and arg_0.key_position == 'bottom':
			arg_1 += len(arg_0.data) * (arg_0.font_size + 5)
			arg_1 += 10
		if arg_0.show_x_labels:
			arg_2 = arg_0.x_label_font_size
			if arg_0.rotate_x_labels:
				arg_3 = map(len, arg_0.get_x_labels())
				arg_4 = functools.reduce(max, arg_3)
				arg_2 *= 0.6 * arg_4
			arg_1 += arg_2
			if arg_0.stagger_x_labels:
				arg_1 += arg_2 + 10
		if arg_0.show_x_title:
			arg_1 += arg_0.x_title_font_size + 5
		arg_0.border_bottom = arg_1

Calculate the margin in pixels below the plot area setting border_bottom .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
'prod'
)
:
arg_3
=
RequestBuilder
.
request
(
arg_2
)
.
to_service
(
arg_0
.
SERVICE_NAME
,
arg_0
.
SERVICE_VERSION
)
.
throw
(
StorageForbiddenException
,
lambda
resp
:
'You are forbidden to do this.'
if
resp
.
status_code
==
403
else
)
.
throw
(
StorageNotFoundException
,
lambda
resp
:
'The entity is not found'
if
resp
.
status_code
==
404
else
)
.
throw
(
StorageException
,
lambda
resp
:
'Server response: {0} - {1}'
.
format
(
resp
.
status_code
,
resp
.
text
)
if
not
resp
.
ok
else
)
arg_4
=
arg_3
.
with_token
(
arg_1
)
return
arg_0
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2='prod'):
        '''Create a Func storage service REST client.

            Arguments:
                environment: The service environment to be used for the client
                access_token: The access token used to authenticate with the
                    service

            Returns:
                A storage_service.api.ApiClient instance

            Example:
                >>> storage_client = ApiClient.Func(my_access_token)

        '''
        arg_3 = RequestBuilder \
            .request(arg_2) \
            .to_service(arg_0.SERVICE_NAME, arg_0.SERVICE_VERSION) \
            .throw(
                StorageForbiddenException,
                lambda resp: 'You are forbidden to do this.'
                if resp.status_code == 403 else None
            ) \
            .throw(
                StorageNotFoundException,
                lambda resp: 'The entity is not found'
                if resp.status_code == 404 else None
            ) \
            .throw(
                StorageException,
                lambda resp: 'Server response: {0} - {1}'.format(resp.status_code, resp.text)
                if not resp.ok else None
            )

        arg_4 = arg_3.with_token(arg_1)

        return arg_0(arg_3, arg_4)

Create a new storage service REST client.

            Arguments:
                environment: The service environment to be used for the client
                access_token: The access token used to authenticate with the
                    service

            Returns:
                A storage_service.api.ApiClient instance

            Example:
                >>> storage_client = ApiClient.new(my_access_token)

Create a new storage service REST client .


(func, num_args=0, max_attempts=100, cache=None)

def Func(arg_0, arg_1=0, arg_2=100, arg_3=None):
    """
    wraps a function so that produce Func results

    :param func:
    :param num_args:

    >>> import random
    >>> choices = [1,2]
    >>> a = Func(random.choice, 1)
    >>> a,b = a(choices), a(choices)
    >>> a == b
    False
    """
    if arg_3 is None:
        arg_3 = _cache_Func

    @wraps(arg_0)
    def wrapper(*arg_4):
        arg_5 = "%s_%s" % (str(arg_0.__name__), str(arg_4[:arg_1]))
        arg_6 = 0
        while arg_6 < arg_2:
            arg_6 += 1
            arg_7 = arg_3.get(arg_5, [])
            arg_8 = arg_0(*arg_4)
            if arg_8 not in arg_7:
                arg_7.append(arg_8)
                arg_3[arg_5] = arg_7
                return arg_8

        raise MaxAttemptException()

    return wrapper

wraps a function so that produce unique results

    :param func:
    :param num_args:

    >>> import random
    >>> choices = [1,2]
    >>> a = unique(random.choice, 1)
    >>> a,b = a(choices), a(choices)
    >>> a == b
    False


(lrs_configuration, user, course_overview, course_grade)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = LearnerInfoSerializer ( arg_1 ) arg_5 = CourseInfoSerializer ( arg_2 ) arg_6 = LearnerCourseCompletionStatement ( arg_1 , arg_2 , arg_4 . data , arg_5 . data , arg_3 , ) EnterpriseXAPIClient ( arg_0 ) . save_statement ( arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Send xAPI statement for course completion.

    Arguments:
         lrs_configuration (XAPILRSConfiguration): XAPILRSConfiguration instance where to send statements.
         user (User): Django User object.
         course_overview (CourseOverview): Course over view object containing course details.
         course_grade (CourseGrade): course grade object.
    """
    arg_4 = LearnerInfoSerializer(arg_1)
    arg_5 = CourseInfoSerializer(arg_2)

    arg_6 = LearnerCourseCompletionStatement(
        arg_1,
        arg_2,
        arg_4.data,
        arg_5.data,
        arg_3,
    )
    EnterpriseXAPIClient(arg_0).save_statement(arg_6)

Send xAPI statement for course completion .


def Func ( arg_0 , arg_1 ) : arg_2 = BibRecordPackage ( arg_1 ) arg_2 . parse ( ) for arg_3 in arg_2 . get_records ( ) : yield arg_0 ( arg_3 )

def Func(arg_0, arg_1):
        """Yield single conversion objects from a MARCXML file or string.

        >>> from harvestingkit.inspire_cds_package import Inspire2CDS
        >>> for record in Inspire2CDS.Func("inspire.xml"):
        >>>     xml = record.convert()

        """
        arg_2 = BibRecordPackage(arg_1)
        arg_2.parse()
        for arg_3 in arg_2.get_records():
            yield arg_0(arg_3)

Yield single conversion objects from a MARCXML file or string.

        >>> from harvestingkit.inspire_cds_package import Inspire2CDS
        >>> for record in Inspire2CDS.from_source("inspire.xml"):
        >>>     xml = record.convert()

Yield single conversion objects from a MARCXML file or string .


return SETTINGS['returns_func'](symbol,
                                    start=start,
                                    end=end)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return SETTINGS [ 'returns_func' ] ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=None):
    """
    Calls the currently registered 'returns_func'

    Parameters
    ----------
    symbol : object
        An identifier for the asset whose return
        series is desired.
        e.g. ticker symbol or database ID
    start : date, optional
        Earliest date to fetch data for.
        Defaults to earliest date available.
    end : date, optional
        Latest date to fetch data for.
        Defaults to latest date available.

    Returns
    -------
    pandas.Series
        Returned by the current 'returns_func'
    """

    return SETTINGS['returns_func'](arg_0,
                                    arg_1=arg_1,
                                    arg_2=arg_2)

Calls the currently registered returns_func


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is not None and arg_2 is None : arg_2 = arg_0 . get_nonce ( arg_1 ) Func = arg_0 . calculate_new_address ( arg_1 , arg_2 ) if arg_1 is None and Func in arg_0 : return arg_0 . new_address ( arg_1 , arg_2 ) return Func

def Func(arg_0, arg_1=None, arg_2=None):
        """Create a fresh 160bit address"""
        if arg_1 is not None and arg_2 is None:
            arg_2 = arg_0.get_nonce(arg_1)

        Func = arg_0.calculate_new_address(arg_1, arg_2)
        if arg_1 is None and Func in arg_0:
            return arg_0.new_address(arg_1, arg_2)
        return Func


def Func(arg_0, arg_1=None, **arg_2):
        """List teams to which the authenticated user belongs.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all teams returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the teams returned by the Webex Teams query.

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

        """
        check_type(arg_1, int)

        arg_3 = dict_from_items_with_values(
            arg_2,
            arg_1=arg_1,
        )

        # API request - get items
        arg_4 = arg_0._session.get_items(API_ENDPOINT, arg_3=arg_3)

        # Yield team objects created from the returned items JSON objects
        for arg_5 in arg_4:
            yield arg_0._object_factory(OBJECT_TYPE, arg_5)

List teams to which the authenticated user belongs .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
DEVICE_URL
%
arg_0
if
"mode"
in
arg_1
:
arg_2
=
MODES_URL
%
arg_0
arg_3
=
requests
.
put
(
arg_2
,
headers
=
HEADERS
,
data
=
json
.
dumps
(
arg_1
)
)
arg_4
=
str
(
arg_3
.
status_code
)
if
arg_4
!=
'202'
:
_LOGGER
.
error
(
"State not accepted. "
+
arg_4
)
return
False

def Func(arg_0, arg_1):
        """
        Set a devices state.
        """
        arg_2 = DEVICE_URL % arg_0
        if "mode" in arg_1:
            arg_2 = MODES_URL % arg_0
        arg_3 = requests.put(arg_2, headers=HEADERS, data=json.dumps(arg_1))
        arg_4 = str(arg_3.status_code)
        if arg_4 != '202':
            _LOGGER.error("State not accepted. " + arg_4)
            return False


def Func ( arg_0 ) : assert callable ( arg_0 . blockchain . Func_account ) return arg_0 . blockchain . Func_account ( account = arg_0 )

def Func(arg_0):  # pragma: no cover
        """ Upgrade account to life time member
        """
        assert callable(arg_0.blockchain.Func_account)
        return arg_0.blockchain.Func_account(account=arg_0)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = Func_object_or_404 ( EnrollmentNotificationEmailTemplate , pk = arg_2 ) if arg_3 not in arg_0 . view_type_contexts : return HttpResponse ( status = 404 ) arg_5 = arg_0 . view_type_contexts [ arg_3 ] . copy ( ) arg_5 . update ( { 'user_name' : arg_0 . Func_user_name ( arg_1 ) } ) return HttpResponse ( arg_4 . render_html_template ( arg_5 ) , content_type = 'text/html' )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Render the given template with the stock data.
        """
        arg_4 = Func_object_or_404(EnrollmentNotificationEmailTemplate, pk=arg_2)
        if arg_3 not in arg_0.view_type_contexts:
            return HttpResponse(status=404)
        arg_5 = arg_0.view_type_contexts[arg_3].copy()
        arg_5.update({'user_name': arg_0.Func_user_name(arg_1)})
        return HttpResponse(arg_4.render_html_template(arg_5), content_type='text/html')

Render the given template with the stock data .


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
False
)
:
load_economic_data
(
)
arg_3
=
CAS2int
(
arg_0
)
def
list_methods
(
)
:
arg_4
=
[
]
arg_4
.
append
(
'Combined'
)
if
arg_0
in
_EPACDRDict
:
arg_4
.
append
(
EPACDR
)
if
arg_0
in
_ECHATonnageDict
:
arg_4
.
append
(
ECHA
)
if
arg_3
in
HPV_data
.
index
:
arg_4
.
append
(
OECD
)
arg_4
.
append
(
)
return
arg_4
if
arg_2
:
return
list_methods
(
)
if
not
arg_1
:
arg_1
=
list_methods
(
)
[
0
]
if
arg_1
==
EPACDR
:
arg_5
=
'US public: '
+
str
(
_EPACDRDict
[
arg_0
]
)
elif
arg_1
==
ECHA
:
arg_5
=
_ECHATonnageDict
[
arg_0
]
elif
arg_1
==
OECD
:
arg_5
=
'OECD HPV Chemicals'
elif
arg_1
==
'Combined'
:
arg_5
=
[
]
if
arg_0
in
_EPACDRDict
:
arg_5
+=
[
'US public: '
+
str
(
_EPACDRDict
[
arg_0
]
)
]
if
arg_0
in
_ECHATonnageDict
:
arg_5
+=
_ECHATonnageDict
[
arg_0
]
if
arg_3
in
HPV_data
.
index
:
arg_5
+=
[
'OECD HPV Chemicals'
]
elif
arg_1
==
:
arg_5
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_5

def Func(arg_0, arg_1=None, arg_2=False):  # pragma: no cover
    '''Look up the economic status of a chemical.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> pprint(Func(CASRN='98-00-0'))
    ["US public: {'Manufactured': 0.0, 'Imported': 10272.711, 'Exported': 184.127}",
     u'10,000 - 100,000 tonnes per annum',
     'OECD HPV Chemicals']

    >>> Func(CASRN='13775-50-3')  # SODIUM SESQUISULPHATE
    []
    >>> Func(CASRN='98-00-0', Method='OECD high production volume chemicals')
    'OECD HPV Chemicals'
    >>> Func(CASRN='98-01-1', Method='European Chemicals Agency Total Tonnage Bands')
    [u'10,000 - 100,000 tonnes per annum']
    '''
    load_economic_data()
    arg_3 = CAS2int(arg_0)

    def list_methods():
        arg_4 = []
        arg_4.append('Combined')
        if arg_0 in _EPACDRDict:
            arg_4.append(EPACDR)
        if arg_0 in _ECHATonnageDict:
            arg_4.append(ECHA)
        if arg_3 in HPV_data.index:
            arg_4.append(OECD)
        arg_4.append(NONE)
        return arg_4
    if arg_2:
        return list_methods()
    if not arg_1:
        arg_1 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_1 == EPACDR:
        arg_5 = 'US public: ' + str(_EPACDRDict[arg_0])
    elif arg_1 == ECHA:
        arg_5 = _ECHATonnageDict[arg_0]
    elif arg_1 == OECD:
        arg_5 = 'OECD HPV Chemicals'
    elif arg_1 == 'Combined':
        arg_5 = []
        if arg_0 in _EPACDRDict:
            arg_5 += ['US public: ' + str(_EPACDRDict[arg_0])]
        if arg_0 in _ECHATonnageDict:
            arg_5 += _ECHATonnageDict[arg_0]
        if arg_3 in HPV_data.index:
            arg_5 += ['OECD HPV Chemicals']
    elif arg_1 == NONE:
        arg_5 = None
    else:
        raise Exception('Failure in in function')
    return arg_5

Look up the economic status of a chemical.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> pprint(economic_status(CASRN='98-00-0'))
    ["US public: {'Manufactured': 0.0, 'Imported': 10272.711, 'Exported': 184.127}",
     u'10,000 - 100,000 tonnes per annum',
     'OECD HPV Chemicals']

    >>> economic_status(CASRN='13775-50-3')  # SODIUM SESQUISULPHATE
    []
    >>> economic_status(CASRN='98-00-0', Method='OECD high production volume chemicals')
    'OECD HPV Chemicals'
    >>> economic_status(CASRN='98-01-1', Method='European Chemicals Agency Total Tonnage Bands')
    [u'10,000 - 100,000 tonnes per annum']

Look up the economic status of a chemical .


def Func ( arg_0 , arg_1 , arg_2 ) : try : return round ( 100 * float ( arg_0 [ arg_1 ] ) / float ( arg_0 [ arg_2 ] ) , 1 ) except ZeroDivisionError : return 0

def Func(arg_0, arg_1, arg_2):
    """
    Calculate a percentage.
    """
    try:
        return round(100 * float(arg_0[arg_1]) / float(arg_0[arg_2]), 1)
    except ZeroDivisionError:
        return 0


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Creates a new database inside a Cloud SQL instance.

        :param instance: Database instance ID. This does not include the project ID.
        :type instance: str
        :param body: The request body, as described in
            https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/databases/insert#request-body.
        :type body: dict
        :param project_id: Project ID of the project that contains the instance. If set
            to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """
        arg_4 = arg_0.get_conn().databases().insert(
            project=arg_3,
            arg_1=arg_1,
            arg_2=arg_2
        ).execute(num_retries=arg_0.num_retries)
        arg_5 = arg_4["name"]
        arg_0._wait_for_operation_to_complete(arg_3=arg_3,
                                             arg_5=arg_5)

Creates a new database inside a Cloud SQL instance .


def Func ( arg_0 , arg_1 ) : arg_2 = { 'days' : 0 , 'hours' : 0 , 'microseconds' : 0 , 'milliseconds' : 0 , 'minutes' : 0 , 'months' : 0 , 'seconds' : 0 , 'weeks' : 0 , 'years' : 0 , } arg_3 = { } if 'aggregation' in arg_1 [ 'streamDef' ] : for arg_4 in arg_2 . keys ( ) : if arg_4 in arg_1 [ 'streamDef' ] [ 'aggregation' ] : arg_2 [ arg_4 ] = arg_1 [ 'streamDef' ] [ 'aggregation' ] [ arg_4 ] if 'fields' in arg_1 [ 'streamDef' ] [ 'aggregation' ] : for ( arg_5 , arg_6 ) in arg_1 [ 'streamDef' ] [ 'aggregation' ] [ 'fields' ] : arg_3 [ arg_5 ] = str ( arg_6 ) arg_7 = False for arg_8 in arg_2 . values ( ) : if arg_8 != 0 : arg_7 = True break arg_9 = arg_3 . items ( ) arg_10 = dict ( arg_2 ) arg_10 [ 'fields' ] = arg_9 arg_11 = copy . deepcopy ( arg_1 [ 'streamDef' ] ) arg_11 [ 'aggregation' ] = copy . deepcopy ( arg_10 ) return arg_11

def Func(arg_0, arg_1):
    """
    Generate stream definition based on
    """
    #--------------------------------------------------------------------------
    # Generate the string containing the aggregation settings.
    arg_2 = {
        'days': 0,
        'hours': 0,
        'microseconds': 0,
        'milliseconds': 0,
        'minutes': 0,
        'months': 0,
        'seconds': 0,
        'weeks': 0,
        'years': 0,
    }

    # Honor any overrides provided in the stream definition
    arg_3 = {}
    if 'aggregation' in arg_1['streamDef']:
      for arg_4 in arg_2.keys():
        if arg_4 in arg_1['streamDef']['aggregation']:
          arg_2[arg_4] = arg_1['streamDef']['aggregation'][arg_4]
      if 'fields' in arg_1['streamDef']['aggregation']:
        for (arg_5, arg_6) in arg_1['streamDef']['aggregation']['fields']:
          arg_3[arg_5] = str(arg_6)

    # Do we have any aggregation at all?
    arg_7 = False
    for arg_8 in arg_2.values():
      if arg_8 != 0:
        arg_7 = True
        break

    # Convert the aggFunctionsDict to a list
    arg_9 = arg_3.items()
    arg_10 = dict(arg_2)
    arg_10['fields'] = arg_9

    arg_11 = copy.deepcopy(arg_1['streamDef'])
    arg_11['aggregation'] = copy.deepcopy(arg_10)
    return arg_11


return policy in [cls.PUBLIC, cls.MEMBERS, cls.ADMINS]

def Func ( arg_0 , arg_1 ) : return arg_1 in [ arg_0 . PUBLIC , arg_0 . MEMBERS , arg_0 . ADMINS ]

def Func(arg_0, arg_1):
        """Validate privacy policy value."""
        return arg_1 in [arg_0.PUBLIC, arg_0.MEMBERS, arg_0.ADMINS]


return [x * st / r, y * st / r, z * st / r, ct]

def Func(arg_0, *arg_1):
    '''Given an angle and an axis, create a quaternion.'''
    arg_2, arg_3, arg_4 = arg_1
    arg_5 = np.sqrt(arg_2 * arg_2 + arg_3 * arg_3 + arg_4 * arg_4)
    arg_6 = np.sin(arg_0 / 2.)
    arg_7 = np.cos(arg_0 / 2.)
    return [arg_2 * arg_6 / arg_5, arg_3 * arg_6 / arg_5, arg_4 * arg_6 / arg_5, arg_7]

Given an angle and an axis create a quaternion .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
)
:
arg_2
=
get_pager_cmd
(
arg_2
)
arg_2
+=
' '
+
get_pager_start
(
arg_2
,
arg_1
)
try
:
if
os
.
environ
[
'TERM'
]
in
[
'emacs'
,
'dumb'
]
:
raise
EnvironmentError
system
(
arg_2
+
' '
+
arg_0
)
except
:
try
:
if
arg_1
>
0
:
arg_1
-=
1
page
(
open
(
arg_0
)
.
read
(
)
,
arg_1
)
except
:
print
'Unable to show file'
,
`fname`

def Func(arg_0, arg_1=0, arg_2=None):
    """Page a file, using an optional pager command and starting line.
    """

    arg_2 = get_pager_cmd(arg_2)
    arg_2 += ' ' + get_pager_start(arg_2,arg_1)

    try:
        if os.environ['TERM'] in ['emacs','dumb']:
            raise EnvironmentError
        system(arg_2 + ' ' + arg_0)
    except:
        try:
            if arg_1 > 0:
                arg_1 -= 1
            page(open(arg_0).read(),arg_1)
        except:
            print 'Unable to show file',`fname`

Page a file using an optional pager command and starting line .


Computes the accuracy over the k top predictions for the specified values of k

def Func ( arg_0 , arg_1 , arg_2 = ( 1 , ) ) : with torch . no_grad ( ) : arg_3 = max ( arg_2 ) arg_4 = arg_1 . size ( 0 ) arg_5 , arg_6 = arg_0 . topk ( arg_3 , 1 , True , True ) arg_6 = arg_6 . t ( ) arg_7 = arg_6 . eq ( arg_1 [ None ] ) arg_8 = [ ] for arg_9 in arg_2 : arg_10 = arg_7 [ : arg_9 ] . flatten ( ) . sum ( dtype = torch . float32 ) arg_8 . append ( arg_10 * ( 100.0 / arg_4 ) ) return arg_8

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

        arg_5, arg_6 = arg_0.topk(arg_3, 1, True, True)
        arg_6 = arg_6.t()
        arg_7 = arg_6.eq(arg_1[None])

        arg_8 = []
        for arg_9 in arg_2:
            arg_10 = arg_7[:arg_9].flatten().sum(dtype=torch.float32)
            arg_8.append(arg_10 * (100.0 / arg_4))
        return arg_8


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . __class__ . __name__ . lower ( ) arg_3 = arg_0 . visit_events . get ( arg_2 , ( ) ) arg_4 = arg_0 . leave_events . get ( arg_2 , ( ) ) if arg_1 . is_statement : arg_0 . nbstatements += 1 for arg_5 in arg_3 or ( ) : arg_5 ( arg_1 ) for arg_6 in arg_1 . get_children ( ) : arg_0 . Func ( arg_6 ) for arg_5 in arg_4 or ( ) : arg_5 ( arg_1 )

def Func(arg_0, arg_1):
        """call visit events of astroid checkers for the given node, recurse on
        its children, then leave events.
        """
        arg_2 = arg_1.__class__.__name__.lower()

        # Detect if the node is a new name for a deprecated alias.
        # In this case, favour the methods for the deprecated
        # alias if any,  in order to maintain backwards
        # compatibility.
        arg_3 = arg_0.visit_events.get(arg_2, ())
        arg_4 = arg_0.leave_events.get(arg_2, ())

        if arg_1.is_statement:
            arg_0.nbstatements += 1
        # generate events for this node on each checker
        for arg_5 in arg_3 or ():
            arg_5(arg_1)
        # recurse on children
        for arg_6 in arg_1.get_children():
            arg_0.Func(arg_6)
        for arg_5 in arg_4 or ():
            arg_5(arg_1)

call visit events of astroid checkers for the given node recurse on its children then leave events .


def Func(arg_0, arg_1):
        """
        Check if the attribute is allowed to have multiple instances.

        Args:
            attribute (string): The name of the attribute
                (e.g., 'State'). Required.
        """
        # TODO (peterhamilton) Handle multivalue swap between certificate types
        arg_2 = arg_0._attribute_rule_sets.get(arg_1)
        return arg_2.multiple_instances_permitted

Check if the attribute is allowed to have multiple instances .


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) >= arg_0 . num_proxies : return arg_1 [ - 1 * arg_0 . num_proxies ]

def Func(arg_0, arg_1):
        """Selects the new remote addr from the given list of ips in
        X-Forwarded-For.  By default it picks the one that the `num_proxies`
        proxy server provides.  Before 0.9 it would always pick the first.

        .. versionadded:: 0.8
        """
        if len(arg_1) >= arg_0.num_proxies:
            return arg_1[-1 * arg_0.num_proxies]

Selects the new remote addr from the given list of ips in X - Forwarded - For . By default it picks the one that the num_proxies proxy server provides . Before 0 . 9 it would always pick the first .


def
Func
(
arg_0
)
:
if
len
(
arg_0
)
==
0
:
return
False
arg_1
=
VProCRC
.
get
(
arg_0
)
if
arg_1
:
log
.
info
(
"CRC Bad"
)
else
:
log
.
debug
(
"CRC OK"
)
return
not
arg_1

def Func(arg_0):
        '''
        perform CRC check on raw serial data, return true if valid.
        a valid CRC == 0.
        '''
        if len(arg_0) == 0:
            return False
        arg_1 = VProCRC.get(arg_0)
        if arg_1:
            log.info("CRC Bad")
        else:
            log.debug("CRC OK")
        return not arg_1

perform CRC check on raw serial data return true if valid . a valid CRC == 0 .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 , arg_3 in arg_0 : arg_4 , arg_5 , arg_6 , arg_7 , arg_8 = ExtendedPathMask . Split ( arg_3 ) _AssertIsLocal ( arg_6 ) arg_9 = FindFiles ( arg_6 , arg_7 , arg_8 , arg_4 ) for arg_10 in arg_9 : if os . path . isdir ( arg_10 ) : continue arg_11 = arg_10 [ len ( arg_6 ) + 1 : ] if arg_5 : arg_11 = os . path . basename ( arg_11 ) arg_11 = os . path . join ( arg_2 , arg_11 ) arg_1 . append ( ( StandardizePath ( arg_10 ) , StandardizePath ( arg_11 ) ) ) for arg_10 , arg_11 in arg_1 : arg_12 = os . path . dirname ( arg_11 ) CreateDirectory ( arg_12 ) CopyFile ( arg_10 , arg_11 ) return arg_1

def Func(arg_0):
    '''
    Copies files into directories, according to a file mapping

    :param list(tuple(unicode,unicode)) file_mapping:
        A list of mappings between the directory in the target and the source.
        For syntax, @see: ExtendedPathMask

    :rtype: list(tuple(unicode,unicode))
    :returns:
        List of files copied. (source_filename, target_filename)

    .. seealso:: FTP LIMITATIONS at this module's doc for performance issues information
    '''
    # List files that match the mapping
    arg_1 = []
    for arg_2, arg_3 in arg_0:
        arg_4, arg_5, arg_6, arg_7, arg_8 = ExtendedPathMask.Split(arg_3)

        _AssertIsLocal(arg_6)

        arg_9 = FindFiles(arg_6, arg_7, arg_8, arg_4)
        for arg_10 in arg_9:
            if os.path.isdir(arg_10):
                continue  # Do not copy dirs

            arg_11 = arg_10[len(arg_6) + 1:]
            if arg_5:
                arg_11 = os.path.basename(arg_11)
            arg_11 = os.path.join(arg_2, arg_11)

            arg_1.append((
                StandardizePath(arg_10),
                StandardizePath(arg_11)
            ))

    # Copy files
    for arg_10, arg_11 in arg_1:
        # Create target dir if necessary
        arg_12 = os.path.dirname(arg_11)
        CreateDirectory(arg_12)

        CopyFile(arg_10, arg_11)

    return arg_1

Copies files into directories according to a file mapping


def Func(arg_0, arg_1, **arg_2):
        """Fetch the pages

        :param category: the category of items to fetch
        :param kwargs: backend arguments

        :returns: a generator of items
        """
        arg_3 = arg_2['from_date']
        arg_4 = arg_2['reviews_api']

        arg_5 = arg_0.client.get_version()
        logger.info("MediaWiki version: %s", arg_5)

        if arg_4:
            if ((arg_5[0] == 1 and arg_5[1] >= 27) or arg_5[0] > 1):
                arg_6 = arg_0.__fetch_1_27(arg_3)
            else:
                logger.warning("Reviews API only available in MediaWiki >= 1.27")
                logger.warning("Using the Pages API instead")
                arg_6 = arg_0.__fetch_pre1_27(arg_3)
        else:
            arg_6 = arg_0.__fetch_pre1_27(arg_3)

        for arg_7 in arg_6:
            yield arg_7


(separator='\n\n', wrap_start='', wrap_end='',
              html=False, sentences_quantity=3)

return paragraphs(quantity=1, separator=separator, wrap_start=wrap_start,
                      wrap_end=wrap_end, html=html,
                      sentences_quantity=sentences_quantity)

def Func ( arg_0 = '\n\n' , arg_1 = '' , arg_2 = '' , arg_3 = False , arg_4 = 3 ) : return Funcs ( quantity = 1 , arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0='\n\n', arg_1='', arg_2='',
              arg_3=False, arg_4=3):
    """Return a random Func."""
    return Funcs(quantity=1, arg_0=arg_0, arg_1=arg_1,
                      arg_2=arg_2, arg_3=arg_3,
                      arg_4=arg_4)


def Func(arg_0, arg_1):
        """
        Initialize dictionaries with the textual inputs in the PredictorSet object
        p_set - PredictorSet object that has had data fed in
        """
        arg_2 = False
        if not (hasattr(arg_1, '_type')):
            arg_3 = "needs to be an essay set of the train type."
            log.exception(arg_3)
            raise util_functions.InputError(arg_1, arg_3)

        if not (arg_1._type == "train"):
            arg_3 = "needs to be an essay set of the train type."
            log.exception(arg_3)
            raise util_functions.InputError(arg_1, arg_3)

        arg_4=len(arg_1._essay_sets)
        if arg_4==0:
            arg_4=1

        #Ensures that even with a large amount of input textual features, training time stays reasonable
        arg_5 = int(math.floor(200/arg_4))
        for arg_6 in xrange(0,len(arg_1._essay_sets)):
            arg_0._extractors.append(FeatureExtractor())
            arg_0._extractors[arg_6].Func(arg_1._essay_sets[arg_6], arg_5=arg_5)
            arg_0._initialized = True
            arg_2 = True
        return arg_2


def Func(arg_0):
        '''init_ cliends will obtain the tranfer and access tokens, and then
           use them to create a transfer client.
        '''

        arg_0._client = globus_sdk.NativeAppAuthClient(arg_0._client_id)
        arg_0._load_secrets()

init_ cliends will obtain the tranfer and access tokens and then use them to create a transfer client .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : if isinstance ( arg_3 , dict ) and arg_2 in arg_0 and isinstance ( arg_1 [ arg_2 ] , dict ) : Func ( arg_0 [ arg_2 ] , arg_3 ) else : arg_0 [ arg_2 ] = arg_3

def Func(arg_0, arg_1):
    """
    Recursively merge values from a nested dictionary into another nested
    dictionary.

    For example:

    >>> target = {
    ...     'thing': 123,
    ...     'thang': {
    ...         'a': 1,
    ...         'b': 2
    ...     }
    ... }
    >>> source = {
    ...     'thang': {
    ...         'a': 666,
    ...         'c': 777
    ...     }
    ... }
    >>> Func(target, source)
    >>> target
    {
        'thing': 123,
        'thang': {
            'a': 666,
            'b': 2,
            'c': 777
        }
    }
    """
    for arg_2,arg_3 in arg_1.items():
        if isinstance(arg_3, dict) and arg_2 in arg_0 and isinstance(arg_1[arg_2], dict):
            Func(arg_0[arg_2], arg_3)
        else:
            arg_0[arg_2] = arg_3

Recursively merge values from a nested dictionary into another nested
    dictionary.

    For example:

    >>> target = {
    ...     'thing': 123,
    ...     'thang': {
    ...         'a': 1,
    ...         'b': 2
    ...     }
    ... }
    >>> source = {
    ...     'thang': {
    ...         'a': 666,
    ...         'c': 777
    ...     }
    ... }
    >>> update_dict(target, source)
    >>> target
    {
        'thing': 123,
        'thang': {
            'a': 666,
            'b': 2,
            'c': 777
        }
    }

Recursively merge values from a nested dictionary into another nested dictionary .


(data: Union[List[Tuple[str, int]], Mapping[str, int]],
               y_axis_label: str = 'y',
               x_axis_label: str = 'x',
               )

return json.dumps([
        [x_axis_label] + list(labels),
        [y_axis_label] + list(values),
    ])

def Func(arg_0: arg_1[arg_2[arg_3[arg_4, arg_5]], arg_6[arg_4, arg_5]],
               arg_7: arg_4 = 'y',
               arg_8: arg_4 = 'x',
               ) -> arg_4:
    """Prepares C3 JSON for making a bar chart from a Counter

    :param data: A dictionary of {str: int} to display as bar chart
    :param y_axis_label: The Y axis label
    :param x_axis_label: X axis internal label. Should be left as default 'x')
    :return: A JSON dictionary for making a C3 bar chart
    """
    if not isinstance(arg_0, list):
        arg_0 = sorted(arg_0.items(), key=itemgetter(1), reverse=True)

    try:
        arg_9, arg_10 = zip(*arg_0)
    except ValueError:
        log.info(f'no values found for {x_axis_label}, {y_axis_label}')
        arg_9, arg_10 = [], []

    return json.dumps([
        [arg_8] + list(arg_9),
        [arg_7] + list(arg_10),
    ])


(request, uid=None, days_back=0, cumulative=True,
    frequency=settings.STATISTIC_FREQUENCY_DAILY, min_val=0, max_val=100,
    chart_type='standard', percentage='show', sort=False)

return {
        'days_back'  : int(request.GET.get('daysback', days_back)),
        'uid'        : request.GET.get('uid', uid),
        'uids'       : get_GET_array(request, 'uids[]'),
        'cumulative' : get_GET_bool(request, 'cumulative', cumulative),
        'frequency'  : request.GET.get('frequency', frequency),
        'min'        : request.GET.get('min', min_val),
        'max'        : request.GET.get('max', max_val),
        'type'       : request.GET.get('type', chart_type),
        'percentage' : request.GET.get('percentage', percentage),
        'sort'       : get_GET_bool(request, 'sort', sort),
    }

def Func ( arg_0 , arg_1 = None , arg_2 = 0 , arg_3 = True , arg_4 = arg_5 . STATISTIC_FREQUENCY_DAILY , arg_7 = 0 , arg_8 = 100 , arg_9 = 'standard' , arg_10 = 'show' , arg_11 = False ) : return { 'days_back' : int ( arg_0 . GET . get ( 'daysback' , arg_2 ) ) , 'uid' : arg_0 . GET . get ( 'uid' , arg_1 ) , 'uids' : get_GET_array ( arg_0 , 'uids[]' ) , 'cumulative' : get_GET_bool ( arg_0 , 'cumulative' , arg_3 ) , 'frequency' : arg_0 . GET . get ( 'frequency' , arg_4 ) , 'min' : arg_0 . GET . get ( 'min' , arg_7 ) , 'max' : arg_0 . GET . get ( 'max' , arg_8 ) , 'type' : arg_0 . GET . get ( 'type' , arg_9 ) , 'percentage' : arg_0 . GET . get ( 'percentage' , arg_10 ) , 'sort' : get_GET_bool ( arg_0 , 'sort' , arg_11 ) , }

def Func(arg_0, arg_1=None, arg_2=0, arg_3=True,
    arg_4=arg_5.STATISTIC_FREQUENCY_DAILY, arg_7=0, arg_8=100,
    arg_9='standard', arg_10='show', arg_11=False):
    """
    Returns the default GET parameters for a particular Geckoboard
    view request.
    """

    return {
        'days_back'  : int(arg_0.GET.get('daysback', arg_2)),
        'uid'        : arg_0.GET.get('uid', arg_1),
        'uids'       : get_GET_array(arg_0, 'uids[]'),
        'cumulative' : get_GET_bool(arg_0, 'cumulative', arg_3),
        'frequency'  : arg_0.GET.get('frequency', arg_4),
        'min'        : arg_0.GET.get('min', arg_7),
        'max'        : arg_0.GET.get('max', arg_8),
        'type'       : arg_0.GET.get('type', arg_9),
        'percentage' : arg_0.GET.get('percentage', arg_10),
        'sort'       : get_GET_bool(arg_0, 'sort', arg_11),
    }

Returns the default GET parameters for a particular Geckoboard view request .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
show_x_guidelines
:
return
for
arg_2
in
range
(
1
,
arg_2
)
:
arg_3
=
'M {start} 0 v{stop}'
.
format
(
start
=
arg_1
*
arg_2
,
stop
=
arg_0
.
graph_height
,
)
arg_4
=
{
'd'
:
arg_3
,
'class'
:
'guideLines'
}
etree
.
SubElement
(
arg_0
.
graph
,
'path'
,
arg_4
)

def Func(arg_0, arg_1, arg_2):
		"Draw the X-axis guidelines"
		if not arg_0.show_x_guidelines:
			return
		# skip the first one
		for arg_2 in range(1, arg_2):
			arg_3 = 'M {start} 0 v{stop}'.format(
				start=arg_1 * arg_2,
				stop=arg_0.graph_height,
			)
			arg_4 = {'d': arg_3, 'class': 'guideLines'}
			etree.SubElement(arg_0.graph, 'path', arg_4)


(self, request=None, text=None, format=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if isinstance ( arg_0 , Resource ) : if not arg_1 : arg_1 = arg_0 . _request arg_4 = None if arg_3 : arg_4 = arg_0 . meta . Funcrs [ arg_3 ] if not arg_4 : arg_5 = arg_1 . get ( 'Content-Type' ) if arg_5 : arg_6 = six . iterkeys ( arg_0 . _Funcr_map ) arg_7 = mimeparse . best_match ( arg_6 , arg_5 ) if arg_7 : arg_3 = arg_0 . _Funcr_map [ arg_7 ] arg_4 = arg_0 . meta . Funcrs [ arg_3 ] else : pass if arg_4 : try : arg_8 = arg_4 ( ) arg_9 = arg_8 . Func ( arg_1 = arg_1 , arg_2 = arg_2 ) return arg_9 , arg_8 except ValueError : pass raise http . exceptions . UnsupportedMediaType ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Deserializes the text using a determined Funcr.

        @param[in] request
            The request object to pull information from; normally used to
            determine the deserialization format (when `format` is
            not provided).

        @param[in] text
            The text to be Funcd. Can be left blank and the
            request will be read.

        @param[in] format
            A specific format to Func in; if provided, no detection is
            done. If not provided, the content-type header is looked at to
            determine an appropriate Funcr.

        @returns
            A tuple of the Funcd data and an instance of the
            Funcr used.
        """
        if isinstance(arg_0, Resource):
            if not arg_1:
                # Ensure we have a response object.
                arg_1 = arg_0._request

        arg_4 = None
        if arg_3:
            # An explicit format was given; do not attempt to auto-detect
            # a Funcr.
            arg_4 = arg_0.meta.Funcrs[arg_3]

        if not arg_4:
            # Determine an appropriate Funcr to use by
            # introspecting the request object and looking at
            # the `Content-Type` header.
            arg_5 = arg_1.get('Content-Type')
            if arg_5:
                # Parse the media ranges and determine the Funcr
                # that is the closest match.
                arg_6 = six.iterkeys(arg_0._Funcr_map)
                arg_7 = mimeparse.best_match(arg_6, arg_5)
                if arg_7:
                    arg_3 = arg_0._Funcr_map[arg_7]
                    arg_4 = arg_0.meta.Funcrs[arg_3]

            else:
                # Client didn't provide a content-type; we're supposed
                # to auto-detect.
                # TODO: Implement this.
                pass

        if arg_4:
            try:
                # Attempt to Func the data using the determined
                # Funcr.
                arg_8 = arg_4()
                arg_9 = arg_8.Func(arg_1=arg_1, arg_2=arg_2)
                return arg_9, arg_8

            except ValueError:
                # Failed to Func the data.
                pass

        # Failed to determine a Funcr; or failed to Func.
        raise http.exceptions.UnsupportedMediaType()

Deserializes the text using a determined deserializer.

        @param[in] request
            The request object to pull information from; normally used to
            determine the deserialization format (when `format` is
            not provided).

        @param[in] text
            The text to be deserialized. Can be left blank and the
            request will be read.

        @param[in] format
            A specific format to deserialize in; if provided, no detection is
            done. If not provided, the content-type header is looked at to
            determine an appropriate deserializer.

        @returns
            A tuple of the deserialized data and an instance of the
            deserializer used.

Deserializes the text using a determined deserializer .


(self,
                  filename,
                  key,
                  bucket_name=None,
                  replace=False,
                  encrypt=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
False
,
arg_5
=
False
)
:
if
not
arg_3
:
(
arg_3
,
arg_2
)
=
arg_0
.
parse_s3_url
(
arg_2
)
if
not
arg_4
and
arg_0
.
check_for_key
(
arg_2
,
arg_3
)
:
raise
ValueError
(
"The key {key} already exists."
.
format
(
arg_2
=
arg_2
)
)
arg_6
=
{
}
if
arg_5
:
arg_6
[
'ServerSideEncryption'
]
=
"AES256"
arg_7
=
arg_0
.
get_conn
(
)
arg_7
.
upFunc
(
arg_1
,
arg_3
,
arg_2
,
ExtraArgs
=
arg_6
)

def Func(arg_0,
                  arg_1,
                  arg_2,
                  arg_3=None,
                  arg_4=False,
                  arg_5=False):
        """
        Loads a local file to S3

        :param filename: name of the file to load.
        :type filename: str
        :param key: S3 key that will point to the file
        :type key: str
        :param bucket_name: Name of the bucket in which to store the file
        :type bucket_name: str
        :param replace: A flag to decide whether or not to overwrite the key
            if it already exists. If replace is False and the key exists, an
            error will be raised.
        :type replace: bool
        :param encrypt: If True, the file will be encrypted on the server-side
            by S3 and will be stored in an encrypted form while at rest in S3.
        :type encrypt: bool
        """
        if not arg_3:
            (arg_3, arg_2) = arg_0.parse_s3_url(arg_2)

        if not arg_4 and arg_0.check_for_key(arg_2, arg_3):
            raise ValueError("The key {key} already exists.".format(arg_2=arg_2))

        arg_6 = {}
        if arg_5:
            arg_6['ServerSideEncryption'] = "AES256"

        arg_7 = arg_0.get_conn()
        arg_7.upFunc(arg_1, arg_3, arg_2, ExtraArgs=arg_6)


Load all variants in a region to a existing case

(context, hgnc_id, case_id, chromosome, start, end)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Load all variants in a Func to a existing case"""
    arg_6 = arg_0.obj['adapter']
    load_Func(
        arg_6=arg_6, arg_2=arg_2, arg_1=arg_1, chrom=arg_3, arg_4=arg_4, arg_5=arg_5
    )


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
v_locked
:
raise
pex
.
ParameterLockedException
(
'Parameter `%s` is locked!'
%
arg_0
.
v_full_name
)
try
:
arg_0
.
_data
=
arg_1
[
'data'
+
ArrayParameter
.
IDENTIFIER
]
if
'explored_data'
+
ArrayParameter
.
IDENTIFIER
in
arg_1
:
arg_3
=
arg_1
[
'explored_data'
+
ArrayParameter
.
IDENTIFIER
]
arg_4
=
arg_3
[
'idx'
]
arg_5
=
[
]
for
arg_6
in
arg_4
:
arg_7
=
arg_0
.
_build_name
(
arg_6
)
arg_5
.
append
(
arg_1
[
arg_7
]
)
arg_0
.
_explored_range
=
[
x
for
x
in
arg_5
]
arg_0
.
_explored
=
True
except
KeyError
:
super
(
ArrayParameter
,
arg_0
)
.
Func
(
arg_1
)
arg_0
.
_default
=
arg_0
.
_data
arg_0
.
_locked
=
True

def Func(arg_0, arg_1):
        """Reconstructs the data and exploration array.

        Checks if it can find the array identifier in the `load_dict`, i.e. '__rr__'.
        If not calls :class:`~pypet.parameter.Parameter.Func` of the parent class.

        If the parameter is explored, the exploration range of arrays is reconstructed
        as it was stored in :func:`~pypet.parameter.ArrayParameter._store`.

        """
        if arg_0.v_locked:
            raise pex.ParameterLockedException('Parameter `%s` is locked!' % arg_0.v_full_name)

        try:
            arg_0._data = arg_1['data' + ArrayParameter.IDENTIFIER]

            if 'explored_data' + ArrayParameter.IDENTIFIER in arg_1:
                arg_3 = arg_1['explored_data' + ArrayParameter.IDENTIFIER]

                arg_4 = arg_3['idx']

                arg_5 = []

                # Recall the arrays in the order stored in the ObjectTable 'explored_data__rr__'
                for arg_6 in arg_4:
                    arg_7 = arg_0._build_name(arg_6)
                    arg_5.append(arg_1[arg_7])

                arg_0._explored_range = [x for x in arg_5]
                arg_0._explored = True

        except KeyError:
            super(ArrayParameter, arg_0).Func(arg_1)

        arg_0._default = arg_0._data
        arg_0._locked = True

Reconstructs the data and exploration array.

        Checks if it can find the array identifier in the `load_dict`, i.e. '__rr__'.
        If not calls :class:`~pypet.parameter.Parameter._load` of the parent class.

        If the parameter is explored, the exploration range of arrays is reconstructed
        as it was stored in :func:`~pypet.parameter.ArrayParameter._store`.

Reconstructs the data and exploration array .


return self._x10_command(house_code, unit_number, state)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Send X10 command to ??? unit.

        @param house_code (A-P) - example='A'
        @param unit_number (1-16)- example=1 (or None to impact entire house code)
        @param state - Mochad command/state, See
                https://sourceforge.net/p/mochad/code/ci/master/tree/README
                examples=OFF, 'OFF', 'ON', ALL_OFF, 'all_units_off', 'xdim 128', etc.

        Examples:
            Func('A', '1', ON)
            Func('A', '1', OFF)
            Func('A', '1', 'ON')
            Func('A', '1', 'OFF')
            Func('A', None, ON)
            Func('A', None, OFF)
            Func('A', None, 'all_lights_off')
            Func('A', None, 'all_units_off')
            Func('A', None, ALL_OFF)
            Func('A', None, 'all_lights_on')
            Func('A', 1, 'xdim 128')
        """

        arg_1 = normalize_housecode(arg_1)
        if arg_2 is not None:
            arg_2 = normalize_unitnumber(arg_2)
        # else command is intended for the entire house code, not a single unit number
        # TODO normalize/validate state

        return arg_0._Func(arg_1, arg_2, arg_3)

Send X10 command to ??? unit.

        @param house_code (A-P) - example='A'
        @param unit_number (1-16)- example=1 (or None to impact entire house code)
        @param state - Mochad command/state, See
                https://sourceforge.net/p/mochad/code/ci/master/tree/README
                examples=OFF, 'OFF', 'ON', ALL_OFF, 'all_units_off', 'xdim 128', etc.

        Examples:
            x10_command('A', '1', ON)
            x10_command('A', '1', OFF)
            x10_command('A', '1', 'ON')
            x10_command('A', '1', 'OFF')
            x10_command('A', None, ON)
            x10_command('A', None, OFF)
            x10_command('A', None, 'all_lights_off')
            x10_command('A', None, 'all_units_off')
            x10_command('A', None, ALL_OFF)
            x10_command('A', None, 'all_lights_on')
            x10_command('A', 1, 'xdim 128')


(duration: int, amp: complex, sigma: float,
                    risefall: int, name: str = None)

return _sampled_gaussian_square_pulse(duration, amp, center, width, sigma,
                                          zeroed_width=zeroed_width, name=name)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5,
                    arg_6: arg_1, arg_7: arg_8 = None) -> SamplePulse:
    """Generates gaussian square `SamplePulse`.

    Centered at `duration/2` and zeroed at `t=-1` and `t=duration+1` to prevent
    large initial/final discontinuities.

    Applies `left` sampling strategy to generate discrete pulse from continuous function.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        amp: Pulse amplitude.
        sigma: Width (standard deviation) of gaussian rise/fall portion of the pulse.
        risefall: Number of samples over which pulse rise and fall happen. Width of
            square portion of pulse will be `duration-2*risefall`.
        name: Name of pulse.
    """
    arg_9 = arg_0/2
    arg_10 = arg_0-2*arg_6
    arg_11 = arg_0 + 2
    return _sampled_Func_pulse(arg_0, arg_2, arg_9, arg_10, arg_4,
                                          arg_11=arg_11, arg_7=arg_7)


def Func ( arg_0 , arg_1 ) : arg_1 = arg_1 . replace ( "\r\n" , "\n" ) for arg_2 in _REPLACERS [ arg_0 . level ] : arg_1 = re . compile ( arg_2 [ 0 ] , re . MULTILINE | re . UNICODE | re . DOTALL ) . sub ( arg_2 [ 1 ] , arg_1 ) return arg_1

def Func(arg_0, arg_1):
      """Tries to minimize the length of CSS code passed as parameter. Returns string."""
      arg_1 = arg_1.replace("\r\n", "\n") # get rid of Windows line endings, if they exist
      for arg_2 in _REPLACERS[arg_0.level]:
          arg_1 = re.compile(arg_2[0], re.MULTILINE|re.UNICODE|re.DOTALL).sub(arg_2[1], arg_1)
      return arg_1

Tries to minimize the length of CSS code passed as parameter . Returns string .


def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return arg_0 . text or "" arg_1 = compat . StringIO ( ) for arg_2 in arg_0 : arg_1 . write ( xml_to_bytes ( arg_2 , pretty_print = False ) + "\n" ) arg_3 = arg_1 . getvalue ( ) arg_1 . close ( ) return arg_3

def Func(arg_0):
    """Serialize etree.Element.

    Note: element may contain more than one child or only text (i.e. no child
          at all). Therefore the resulting string may raise an exception, when
          passed back to etree.XML().
    """
    if len(arg_0) == 0:
        return arg_0.text or ""  # Make sure, None is returned as ''
    arg_1 = compat.StringIO()
    for arg_2 in arg_0:
        arg_1.write(xml_to_bytes(arg_2, pretty_print=False) + "\n")
        # print(xml_to_bytes(childnode, pretty_print=False), file=stream)
    arg_3 = arg_1.getvalue()
    arg_1.close()
    return arg_3


def
Func
(
arg_0
)
->
Namespace
:
arg_1
=
Namespace
(
name
=
arg_0
.
_get_namespace_name
(
)
,
keyword
=
arg_0
.
_get_namespace_keyword
(
)
,
url
=
arg_0
.
_get_namespace_url
(
)
,
version
=
str
(
time
.
asctime
(
)
)
,
)
arg_0
.
session
.
add
(
arg_1
)
arg_2
=
arg_0
.
_get_namespace_entries
(
arg_1
)
arg_0
.
session
.
add_all
(
arg_2
)
arg_3
=
time
.
time
(
)
log
.
info
(
'committing models'
)
arg_0
.
session
.
commit
(
)
log
.
info
(
'committed models in %.2f seconds'
,
time
.
time
(
)
arg_3
)
return
arg_1

def Func(arg_0) -> Namespace:
        """Make a namespace."""
        arg_1 = Namespace(
            name=arg_0._get_namespace_name(),
            keyword=arg_0._get_namespace_keyword(),
            url=arg_0._get_namespace_url(),
            version=str(time.asctime()),
        )
        arg_0.session.add(arg_1)

        arg_2 = arg_0._get_namespace_entries(arg_1)
        arg_0.session.add_all(arg_2)

        arg_3 = time.time()
        log.info('committing models')
        arg_0.session.commit()
        log.info('committed models in %.2f seconds', time.time() - arg_3)

        return arg_1


def Func(arg_0, arg_1, arg_2, (arg_3, arg_4, arg_5, arg_6)):
        "Called by SelectionTag"
        # calculate the pos (minus the offset, not in a panel like rw!)
        arg_7 = arg_2.ScreenToClient(wx.GetMousePosition())
        arg_8, arg_9 = arg_7
        if arg_1.ShiftDown():     # snap to grid:
            arg_8 = arg_8 / GRID_SIZE[0] * GRID_SIZE[0]
            arg_9 = arg_9 / GRID_SIZE[1] * GRID_SIZE[1]
        arg_7 = wx.Point(arg_8, arg_9)
        if not arg_0.resizing or arg_0.resizing != (arg_2, (arg_3, arg_4, arg_5, arg_6)):
            arg_0.pos = list(arg_7)                        # store starting point
            arg_0.resizing = (arg_2, (arg_3, arg_4, arg_5, arg_6))      # track obj and handle
        else:
            arg_11 = arg_7 - arg_0.pos
            if DEBUG: print "RESIZING: n, w, s, e", arg_3, arg_4, arg_5, arg_6
            if arg_3 or arg_4 or arg_5 or arg_6:
                # resize according the direction (n, w, s, e)
                arg_8 = arg_2.Position[0] + arg_6 * arg_11[0]
                arg_9 = arg_2.Position[1] + arg_3 * arg_11[1]
                if arg_4 or arg_6:
                    if not isinstance(arg_2, wx.TopLevelWindow):
                        arg_12 = arg_2.Size[0] + (arg_4 - arg_6) * arg_11[0]
                    else:
                        arg_12 = arg_2.ClientSize[0] + (arg_4 - arg_6) * arg_11[0]
                else:
                    arg_12 = None
                if arg_3 or arg_5:
                    arg_13 = arg_2.Size[1] + (arg_5 - arg_3) * arg_11[1]
                else:
                    arg_13 = None
            else:
                # just move
                arg_8 = arg_2.Position[0] + arg_11[0]
                arg_9 = arg_2.Position[1] + arg_11[1]
                arg_12 = arg_13 = None
            arg_14 = (arg_8, arg_9)
            arg_15 = (arg_12, arg_13)
            if arg_15 != arg_2.GetSize() or arg_14 != arg_2.GetPosition():
                # reset margins (TODO: avoid resizing recursion)
                arg_2.obj.margin_left = 0
                arg_2.obj.margin_right = 0
                arg_2.obj.margin_top = 0
                arg_2.obj.margin_bottom = 0
                arg_2.obj.pos = arg_14      # update gui specs (position)
                # update gui specs (size), but do not alter default value
                if arg_12 is not None and arg_13 is not None:
                    arg_2.obj.width = arg_12
                    arg_2.obj.height = arg_13
                elif arg_12 is not None:
                    arg_2.obj.width = arg_12
                elif arg_13 is not None:
                    arg_2.obj.height = arg_13
                # only update on sw for a smooth resize
                if arg_4:
                    arg_0.pos[0] = arg_7[0]        # store new starting point
                if arg_5:
                    arg_0.pos[1] = arg_7[1]


def Func ( arg_0 , arg_1 , arg_2 = True ) : for arg_3 , arg_4 in arg_1 . items ( ) : if arg_3 not in arg_0 . def_ : continue if not arg_2 or arg_0 . def_ [ arg_3 ] . conf_arg : arg_0 [ arg_3 ] = arg_4

def Func(arg_0, arg_1, arg_2=True):
        """Update values of configuration section with dict.

        Args:
            sct_dict (dict): dict indexed with option names. Undefined
                options are discarded.
            conf_arg (bool): if True, only options that can be set in a config
                file are updated.
        """
        for arg_3, arg_4 in arg_1.items():
            if arg_3 not in arg_0.def_:
                continue
            if not arg_2 or arg_0.def_[arg_3].conf_arg:
                arg_0[arg_3] = arg_4

Update values of configuration section with dict .


def Func ( arg_0 , arg_1 ) : if not arg_1 . endswith ( PyFunceble . directory_separator ) : arg_2 = parsed = arg_1 + PyFunceble . directory_separator else : arg_2 = parsed = arg_1 parsed += PyFunceble . CONFIGURATION_FILENAME arg_2 += PyFunceble . DEFAULT_CONFIGURATION_FILENAME return ( parsed , arg_2 )

def Func(arg_0, arg_1):
        """
        Set the paths to the configuration files.

        :param path_to_config: The possible path to the config to load.
        :type path_to_config: str

        :return:
            The path to the config to read (0), the path to the default
            configuration to read as fallback.(1)
        :rtype: tuple
        """

        if not arg_1.endswith(PyFunceble.directory_separator):
            # The path to the config does not ends with the directory separator.

            # We initiate the default and the parsed variable with the directory separator.
            arg_2 = parsed = arg_1 + PyFunceble.directory_separator
        else:
            # The path to the config does ends with the directory separator.

            # We initiate the default and the parsed variable.
            arg_2 = parsed = arg_1

        # We append the `CONFIGURATION_FILENAME` to the parsed variable.
        parsed += PyFunceble.CONFIGURATION_FILENAME
        # And we append the `DEFAULT_CONFIGURATION_FILENAME` to the default variable.
        arg_2 += PyFunceble.DEFAULT_CONFIGURATION_FILENAME

        # We finaly return a tuple which contain both informations.
        return (parsed, arg_2)

Set the paths to the configuration files .


(self, name, analytes, method, samples=None,
                       subset=None, filt=True, sort_by=0, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None,
                       arg_5=None, arg_6=True, arg_7=0, **arg_8):
        """
        Create a clustering classifier based on all samples, or a subset.

        Parameters
        ----------
        name : str
            The name of the classifier.
        analytes : str or iterable
            Which analytes the clustering algorithm should consider.
        method : str
            Which clustering algorithm to use. Can be:

            'meanshift'
                The `sklearn.cluster.MeanShift` algorithm.
                Automatically determines number of clusters
                in data based on the `bandwidth` of expected
                variation.
            'kmeans'
                The `sklearn.cluster.KMeans` algorithm. Determines
                the characteristics of a known number of clusters
                within the data. Must provide `n_clusters` to specify
                the expected number of clusters.
        samples : iterable
            list of samples to consider. Overrides 'subset'.
        subset : str
            The subset of samples used to fit the classifier. Ignored if
            'samples' is specified.
        sort_by : int
            Which analyte the resulting clusters should be sorted
            by - defaults to 0, which is the first analyte.
        **kwargs :
            method-specific keyword parameters - see below.
        Meanshift Parameters
            bandwidth : str or float
                The bandwith (float) or bandwidth method ('scott' or 'silverman')
                used to estimate the data bandwidth.
            bin_seeding : bool
                Modifies the behaviour of the meanshift algorithm. Refer to
                sklearn.cluster.meanshift documentation.
        K - Means Parameters
            n_clusters : int
                The number of clusters expected in the data.

        Returns
        -------
        name : str
        """
        # isolate data
        if arg_4 is not None:
            arg_5 = arg_0.make_subset(arg_4)

        arg_0.get_focus(arg_5=arg_5, arg_6=arg_6)

        # create classifer
        arg_9 = classifier(arg_2,
                       arg_7)
        # fit classifier
        arg_9.fit(data=arg_0.focus,
              arg_3=arg_3,
              **arg_8)

        arg_0.classifiers[arg_1] = arg_9

        return arg_1

Create a clustering classifier based on all samples or a subset .


def Func ( arg_0 , arg_1 ) : arg_2 = json . loads ( arg_1 . decode ( "utf-8" ) ) arg_0 . _worker . response_received ( arg_2 )

def Func(arg_0, arg_1):
        """
        Called when a complete line is found from the remote worker. Decodes
        a response object from the line, then passes it to the worker object.
        """

        arg_2 = json.loads(arg_1.decode("utf-8"))
        arg_0._worker.response_received(arg_2)

Called when a complete line is found from the remote worker . Decodes a response object from the line then passes it to the worker object .


return self._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(entity_type, entity_id)) \
            .return_body() \
            .get()

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
is_valid_uuid
(
arg_2
)
:
raise
StorageArgumentException
(
'Invalid UUID for entity_id: {0}'
.
format
(
arg_2
)
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'{}/{}/metadata/'
.
format
(
arg_1
,
arg_2
)
)
.
return_body
(
)
.
get
(
)

def Func(arg_0, arg_1, arg_2):
        '''Get metadata of an entity.

        Args:
            entity_type (str): Type of the entity. Admitted values: ['project',
                'folder', 'file'].
            entity_id (str): The UUID of the entity to be modified.

        Returns:
            A dictionary of the metadata::

                {
                    u'bar': u'200',
                    u'foo': u'100'
                }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_2):
            raise StorageArgumentException(
                'Invalid UUID for entity_id: {0}'.format(arg_2))

        return arg_0._authenticated_request \
            .to_endpoint('{}/{}/metadata/'.format(arg_1, arg_2)) \
            .return_body() \
            .get()


def
Func
(
arg_0
)
:
arg_1
=
email
.
parser
.
Parser
(
)
.
parsestr
(
arg_0
)
arg_2
=
chardet
.
detect
(
bytearray
(
arg_0
,
"utf-8"
)
)
arg_3
=
arg_2
[
"encoding"
]
print
(
">>> encoding {}"
.
format
(
arg_3
)
)
for
arg_4
in
arg_1
.
walk
(
)
:
if
arg_4
.
get_content_maintype
(
)
==
'multipart'
:
continue
arg_4
.
set_charset
(
arg_3
)
arg_5
=
email
.
utils
.
getaddresses
(
arg_1
.
get_all
(
"TO"
,
[
]
)
)
+
email
.
utils
.
getaddresses
(
arg_1
.
get_all
(
"CC"
,
[
]
)
)
+
email
.
utils
.
getaddresses
(
arg_1
.
get_all
(
"BCC"
,
[
]
)
)
arg_6
=
[
x
[
1
]
for
x
in
arg_5
]
arg_1
.
__delitem__
(
"bcc"
)
arg_1
.
__setitem__
(
'Date'
,
email
.
utils
.
formatdate
(
)
)
arg_7
=
arg_1
[
"from"
]
return
(
arg_1
,
arg_7
,
arg_6
)

def Func(arg_0):
    """Parse message headers, then remove BCC header."""
    arg_1 = email.parser.Parser().parsestr(arg_0)

    # Detect encoding
    arg_2 = chardet.detect(bytearray(arg_0, "utf-8"))
    arg_3 = arg_2["encoding"]
    print(">>> encoding {}".format(arg_3))
    for arg_4 in arg_1.walk():
        if arg_4.get_content_maintype() == 'multipart':
            continue
        arg_4.set_charset(arg_3)

    # Extract recipients
    arg_5 = email.utils.getaddresses(arg_1.get_all("TO", [])) + \
        email.utils.getaddresses(arg_1.get_all("CC", [])) + \
        email.utils.getaddresses(arg_1.get_all("BCC", []))
    arg_6 = [x[1] for x in arg_5]
    arg_1.__delitem__("bcc")
    arg_1.__setitem__('Date', email.utils.formatdate())
    arg_7 = arg_1["from"]

    return (arg_1, arg_7, arg_6)

Parse message headers then remove BCC header .


return {compound: n[compound]/n_total for compound in n.keys()}

def Func ( arg_0 ) : arg_1 = amounts ( arg_0 ) arg_2 = sum ( arg_1 . values ( ) ) return { arg_3 : arg_1 [ arg_3 ] / arg_2 for arg_3 in arg_1 . keys ( ) }

def Func(arg_0):
    """
    Calculate the mole fractions from the specified compound masses.

    :param masses: [kg] dictionary, e.g. {'SiO2': 3.0, 'FeO': 1.5}

    :returns: [mole fractions] dictionary
    """

    arg_1 = amounts(arg_0)
    arg_2 = sum(arg_1.values())
    return {arg_3: arg_1[arg_3]/arg_2 for arg_3 in arg_1.keys()}

Calculate the mole fractions from the specified compound masses .


(
            self, large_face_list_id, image, user_data=None, target_face=None, custom_headers=None, raw=False, callback=None, **operation_config)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = False , arg_7 = None , ** arg_8 ) : arg_9 = arg_0 . Func . metadata [ 'url' ] arg_10 = { 'Endpoint' : arg_0 . _serialize . url ( "self.config.endpoint" , arg_0 . config . endpoint , 'str' , skip_quote = True ) , 'largeFaceListId' : arg_0 . _serialize . url ( "large_face_list_id" , arg_1 , 'str' , max_length = 64 , pattern = r'^[a-z0-9-_]+$' ) } arg_9 = arg_0 . _client . format_url ( arg_9 , ** arg_10 ) arg_11 = { } if arg_3 is not None : arg_11 [ 'userData' ] = arg_0 . _serialize . query ( "user_data" , arg_3 , 'str' , max_length = 1024 ) if arg_4 is not None : arg_11 [ 'targetFace' ] = arg_0 . _serialize . query ( "target_face" , arg_4 , '[int]' , div = ',' ) arg_12 = { } arg_12 [ 'Accept' ] = 'application/json' arg_12 [ 'Content-Type' ] = 'application/octet-stream' if arg_5 : arg_12 . update ( arg_5 ) arg_13 = arg_0 . _client . stream_upload ( arg_2 , arg_7 ) arg_14 = arg_0 . _client . post ( arg_9 , arg_11 , arg_12 , arg_13 ) arg_15 = arg_0 . _client . send ( arg_14 , stream = False , ** arg_8 ) if arg_15 . status_code not in [ 200 ] : raise models . APIErrorException ( arg_0 . _deserialize , arg_15 ) arg_16 = None if arg_15 . status_code == 200 : arg_16 = arg_0 . _deserialize ( 'PersistedFace' , arg_15 ) if arg_6 : arg_17 = ClientRawResponse ( arg_16 , arg_15 ) return arg_17 return arg_16

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=False, arg_7=None, **arg_8):
        """Add a face to a large face list. The input face is specified as an
        image with a targetFace rectangle. It returns a persistedFaceId
        representing the added face, and persistedFaceId will not expire.

        :param large_face_list_id: Id referencing a particular large face
         list.
        :type large_face_list_id: str
        :param image: An image stream.
        :type image: Generator
        :param user_data: User-specified data about the face for any purpose.
         The maximum length is 1KB.
        :type user_data: str
        :param target_face: A face rectangle to specify the target face to be
         added to a person in the format of "targetFace=left,top,width,height".
         E.g. "targetFace=10,10,100,100". If there is more than one face in the
         image, targetFace is required to specify which face to add. No
         targetFace means there is only one face detected in the entire image.
        :type target_face: list[int]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param callback: When specified, will be called with each chunk of
         data that is streamed. The callback should take two arguments, the
         bytes of the current chunk of data and the response object. If the
         data is uploading, response will be None.
        :type callback: Callable[Bytes, response=None]
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: PersistedFace or ClientRawResponse if raw=true
        :rtype: ~azure.cognitiveservices.vision.face.models.PersistedFace or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`APIErrorException<azure.cognitiveservices.vision.face.models.APIErrorException>`
        """
        # Construct URL
        arg_9 = arg_0.Func.metadata['url']
        arg_10 = {
            'Endpoint': arg_0._serialize.url("self.config.endpoint", arg_0.config.endpoint, 'str', skip_quote=True),
            'largeFaceListId': arg_0._serialize.url("large_face_list_id", arg_1, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$')
        }
        arg_9 = arg_0._client.format_url(arg_9, **arg_10)

        # Construct parameters
        arg_11 = {}
        if arg_3 is not None:
            arg_11['userData'] = arg_0._serialize.query("user_data", arg_3, 'str', max_length=1024)
        if arg_4 is not None:
            arg_11['targetFace'] = arg_0._serialize.query("target_face", arg_4, '[int]', div=',')

        # Construct headers
        arg_12 = {}
        arg_12['Accept'] = 'application/json'
        arg_12['Content-Type'] = 'application/octet-stream'
        if arg_5:
            arg_12.update(arg_5)

        # Construct body
        arg_13 = arg_0._client.stream_upload(arg_2, arg_7)

        # Construct and send request
        arg_14 = arg_0._client.post(arg_9, arg_11, arg_12, arg_13)
        arg_15 = arg_0._client.send(arg_14, stream=False, **arg_8)

        if arg_15.status_code not in [200]:
            raise models.APIErrorException(arg_0._deserialize, arg_15)

        arg_16 = None

        if arg_15.status_code == 200:
            arg_16 = arg_0._deserialize('PersistedFace', arg_15)

        if arg_6:
            arg_17 = ClientRawResponse(arg_16, arg_15)
            return arg_17

        return arg_16

Add a face to a large face list . The input face is specified as an image with a targetFace rectangle . It returns a persistedFaceId representing the added face and persistedFaceId will not expire .


(
        self, realm, user_name, method, uri, nonce, cnonce, qop, nc, environ
    )

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9
    ):
        """Computes digest hash.

        Calculation of the A1 (HA1) part is delegated to the dc interface method
        `digest_auth_user()`.

        Args:
            realm (str):
            user_name (str):
            method (str): WebDAV Request Method
            uri (str):
            nonce (str): server generated nonce value
            cnonce (str): client generated cnonce value
            qop (str): quality of protection
            nc (str) (number), nonce counter incremented by client
        Returns:
            MD5 hash string
            or False if user rejected by domain controller
        """

        def md5h(arg_10):
            return md5(compat.to_bytes(arg_10)).hexdigest()

        def md5kd(arg_11, arg_10):
            return md5h(arg_11 + ":" + arg_10)

        arg_12 = arg_0.domain_controller.digest_auth_user(arg_1, arg_2, arg_9)
        if not arg_12:
            return False

        arg_13 = arg_3 + ":" + arg_4

        if arg_7:
            arg_14 = md5kd(
                arg_12, arg_5 + ":" + arg_8 + ":" + arg_6 + ":" + arg_7 + ":" + md5h(arg_13)
            )
        else:
            arg_14 = md5kd(arg_12, arg_5 + ":" + md5h(arg_13))

        return arg_14


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . children arg_3 = [ ] while arg_2 : if arg_2 . type != "element" or arg_2 . ns ( ) . content != DATAFORM_NS : pass elif arg_2 . name == "field" : arg_3 . append ( Field . Func ( arg_2 ) ) arg_2 = arg_2 . next return arg_0 ( arg_3 )

def Func(arg_0, arg_1):
        """Create a new `Item` object from an XML element.

        :Parameters:
            - `xmlnode`: the XML element.
        :Types:
            - `xmlnode`: `libxml2.xmlNode`

        :return: the object created.
        :returntype: `Item`
        """
        arg_2 = arg_1.children
        arg_3 = []
        while arg_2:
            if arg_2.type != "element" or arg_2.ns().content != DATAFORM_NS:
                pass
            elif arg_2.name == "field":
                arg_3.append(Field.Func(arg_2))
            arg_2 = arg_2.next
        return arg_0(arg_3)

Create a new Item object from an XML element .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Decide to serialize only first obj of it's class

    :param priv: private data for this function
        (first object with class == obj.__class__)

    :return: tuple (do serialize this object, next priv)
        where priv is private data for this function
        (first object with class == obj.__class__)
    """
    arg_4 = arg_0.__class__.__name__

    if arg_2:
        arg_1.name = arg_4

    if arg_3 is None:
        arg_3 = arg_0
    elif arg_2:
        # prepare entity which will not be serialized
        prepareEntity(arg_1, arg_4, arg_0)

    arg_6 = arg_3 is arg_0

    return arg_6, arg_3

Decide to serialize only first obj of it s class


def Func ( arg_0 , arg_1 ) : arg_0 . sort ( key = lambda conv_button : conv_button . last_modified , reverse = True )

def Func(arg_0, arg_1):
        """Re-order the conversations when an event occurs."""
        # TODO: handle adding new conversations
        arg_0.sort(key=lambda conv_button: conv_button.last_modified,
                  reverse=True)

Re - order the conversations when an event occurs .


def Func(arg_0):
    """Print a JSON list of JSON objects in CSV format."""
    if type(arg_0) is not list:
        raise TypeError("output not able to be displayed as CSV.")
    arg_1 = arg_0[0]
    arg_2 = csv.DictWriter(sys.stdout, fieldnames=sorted(arg_1.keys()))
    arg_2.writeheader()
    for arg_3 in arg_0:
        arg_2.writerow(arg_3)

Print a JSON list of JSON objects in CSV format .


(self, x86_file, x64_file, payload_file)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = open ( os . path . join ( arg_0 . datadir , arg_1 ) , 'rb' ) . read ( ) arg_5 = open ( os . path . join ( arg_0 . datadir , arg_2 ) , 'rb' ) . read ( ) arg_6 = open ( os . path . join ( arg_0 . datadir , arg_3 ) , 'wb' ) arg_6 . write ( b'\x31\xc0\x40\x0f\x84' + pack ( '<I' , len ( arg_4 ) ) ) arg_6 . write ( arg_4 ) arg_6 . write ( arg_5 ) arg_6 . close ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
            Creates the final payload based on the x86 and x64 meterpreters.
        """
        arg_4 = open(os.path.join(arg_0.datadir, arg_1), 'rb').read()
        arg_5 = open(os.path.join(arg_0.datadir, arg_2), 'rb').read()

        arg_6 = open(os.path.join(arg_0.datadir, arg_3), 'wb')
        arg_6.write(b'\x31\xc0\x40\x0f\x84' + pack('<I', len(arg_4)))
        arg_6.write(arg_4)
        arg_6.write(arg_5)
        arg_6.close()

Creates the final payload based on the x86 and x64 meterpreters .


def Func ( arg_0 ) : arg_0 . receiver = arg_0 . Receiver ( arg_0 . read , arg_0 . write , arg_0 . send_lock , arg_0 . senders , arg_0 . frames_received , callback = arg_0 . receive_callback , fcs_nack = arg_0 . fcs_nack , ) arg_0 . receiver . Func ( )

def Func(arg_0):
        """
        Starts HDLC controller's threads.
        """

        arg_0.receiver = arg_0.Receiver(
            arg_0.read,
            arg_0.write,
            arg_0.send_lock,
            arg_0.senders,
            arg_0.frames_received,
            callback=arg_0.receive_callback,
            fcs_nack=arg_0.fcs_nack,
        )

        arg_0.receiver.Func()