def Func(arg_0, arg_1):
        """
        Find a config in our children so we can fill in variables in our other
        children with its data.
        """
        arg_2 = None
        arg_3 = None

        # first see if we got a kwarg named 'config', as this guy is special
        if 'config' in arg_1:
            if type(arg_1['config']) == str:
                arg_1['config'] = ConfigFile(arg_1['config'])
            elif isinstance(arg_1['config'], Config):
                arg_1['config'] = arg_1['config']
            elif type(arg_1['config']) == dict:
                arg_1['config'] = Config(data=arg_1['config'])
            else:
                raise TypeError("Don't know how to turn {} into a Config".format(type(arg_1['config'])))

            arg_2 = arg_1['config']

        # next check the other kwargs
        for arg_4 in arg_1:
            if isinstance(arg_1[arg_4], Config):
                arg_3 = arg_1[arg_4]

        # if we still don't have a config, see if there's a directory with one
        for arg_4 in arg_1:
            if isinstance(arg_1[arg_4], Directory):
                for arg_5 in arg_1[arg_4]._children:
                    if arg_5 == 'config' and not arg_2:
                        arg_2 = arg_1[arg_4]._children[arg_5]
                    if isinstance(arg_1[arg_4]._children[arg_5], Config):
                        arg_3 = arg_1[arg_4]._children[arg_5]

        if arg_2:
            return arg_2
        else:
            return arg_3

Find a config in our children so we can fill in variables in our other children with its data .


def Func(arg_0: arg_1, arg_2=None) -> types.ModuleType:
    """Create a new empty Basilisp Python module.
    Modules are created for each Namespace when it is created."""
    arg_3 = types.ModuleType(arg_0, arg_2=arg_2)
    arg_3.__loader__ = None
    arg_3.__package__ = None
    arg_3.__spec__ = None
    arg_3.__basilisp_bootstrapped__ = False  # type: ignore
    return arg_3

Create a new empty Basilisp Python module . Modules are created for each Namespace when it is created .


return render(request, "registrasion/manual_payment.html", data)

def Func ( arg_0 , arg_1 ) : arg_2 = "Func" arg_3 = InvoiceController . for_id_or_404 ( arg_1 ) arg_4 = forms . ManualPaymentForm ( arg_0 . POST or None , prefix = arg_2 , ) if arg_0 . POST and arg_4 . is_valid ( ) : arg_4 . instance . invoice = arg_3 . invoice arg_4 . instance . entered_by = arg_0 . user arg_4 . save ( ) arg_3 . update_status ( ) arg_4 = forms . ManualPaymentForm ( prefix = arg_2 ) arg_8 = { "invoice" : arg_3 . invoice , "form" : arg_4 , } return render ( arg_0 , "registrasion/Func.html" , arg_8 )

def Func(arg_0, arg_1):
    ''' Allows staff to make manual payments or refunds on an invoice.

    This form requires a login, and the logged in user needs to be staff.

    Arguments:
        invoice_id (castable to int): The invoice ID to be paid

    Returns:
        render:
            Renders ``registrasion/Func.html`` with the following
            data::

                {
                    "invoice": models.commerce.Invoice(),
                    "form": form,   # A form that saves a ``ManualPayment``
                                    # object.
                }

    '''

    arg_2 = "Func"

    arg_3 = InvoiceController.for_id_or_404(arg_1)

    arg_4 = forms.ManualPaymentForm(
        arg_0.POST or None,
        prefix=arg_2,
    )

    if arg_0.POST and arg_4.is_valid():
        arg_4.instance.invoice = arg_3.invoice
        arg_4.instance.entered_by = arg_0.user
        arg_4.save()
        arg_3.update_status()
        arg_4 = forms.ManualPaymentForm(prefix=arg_2)

    arg_8 = {
        "invoice": arg_3.invoice,
        "form": arg_4,
    }

    return render(arg_0, "registrasion/Func.html", arg_8)

Allows staff to make manual payments or refunds on an invoice.

    This form requires a login, and the logged in user needs to be staff.

    Arguments:
        invoice_id (castable to int): The invoice ID to be paid

    Returns:
        render:
            Renders ``registrasion/manual_payment.html`` with the following
            data::

                {
                    "invoice": models.commerce.Invoice(),
                    "form": form,   # A form that saves a ``ManualPayment``
                                    # object.
                }

Allows staff to make manual payments or refunds on an invoice .


return sent_tokenize(
        remove_dates(_remove_urls(text)),
        keep_whitespace,
        normalize_ascii
    )

def Func ( arg_0 , arg_1 = False , arg_2 = True ) : return sent_tokenize ( remove_dates ( _remove_urls ( arg_0 ) ) , arg_1 , arg_2 )

def Func(arg_0, arg_1=False, arg_2=True):
    """
    A generator to convert raw text segments, without xml to a
    list of words without any markup.
    Additionally dates are replaced by `7777` for normalization.

    Arguments
    ---------
        text: str, input text to tokenize, strip of markup.
        keep_whitespace : bool, should the output retain the
            whitespace of the input (so that char offsets in the
            output correspond to those in the input).

    Returns
    -------
        generator<list<list<str>>>, a generator for sentences, with
            within each sentence a list of the words separated.
    """
    return sent_tokenize(
        remove_dates(_remove_urls(arg_0)),
        arg_1,
        arg_2
    )

A generator to convert raw text segments without xml to a list of words without any markup . Additionally dates are replaced by 7777 for normalization .


(ipaddress,
                  event_type,
                  event_time=None,
                  start_time=None,
                  end_time=None)

def Func(arg_0,
                  arg_1,
                  arg_2=None,
                  arg_3=None,
                  arg_4=None):
    """Method builds a payload out of the passed arguments.

    Parameters:
        `ipaddress`: the models.IPAddress object
        `event_type`: USAGE,CREATE,DELETE,SUSPEND,or UNSUSPEND
        `start_time`: startTime for cloudfeeds
        `end_time`: endTime for cloudfeeds
    Returns a dictionary suitable to notify billing.
    Message types mapping to cloud feeds for references:
        ip.exists       - USAGE
        ip.add          - CREATE
        ip.delete       - DELETE
        ip.associate    - UP
        ip.disassociate  - DOWN
    Refer to: http://rax.io/cf-api for more details.
    """
    # This is the common part of all message types
    arg_5 = {
        'event_type': unicode(arg_1),
        'tenant_id': unicode(arg_0.used_by_tenant_id),
        'ip_address': unicode(arg_0.address_readable),
        'ip_version': int(arg_0.version),
        'ip_type': unicode(arg_0.address_type),
        'id': unicode(arg_0.id)
    }

    # Depending on the message type add the appropriate fields
    if arg_1 == IP_EXISTS:
        if arg_3 is None or arg_4 is None:
            raise ValueError('IP_BILL: {} start_time/end_time cannot be empty'
                             .format(arg_1))
        arg_5.update({
            'startTime': unicode(convert_timestamp(arg_3)),
            'endTime': unicode(convert_timestamp(arg_4))
        })
    elif arg_1 in [IP_ADD, IP_DEL, IP_ASSOC, IP_DISASSOC]:
        if arg_2 is None:
            raise ValueError('IP_BILL: {}: event_time cannot be NULL'
                             .format(arg_1))
        arg_5.update({
            'eventTime': unicode(convert_timestamp(arg_2)),
            'subnet_id': unicode(arg_0.subnet_id),
            'network_id': unicode(arg_0.network_id),
            'public': True if arg_0.network_id == PUBLIC_NETWORK_ID
            else False,
        })
    else:
        raise ValueError('IP_BILL: bad event_type: {}'.format(arg_1))

    return arg_5

Method builds a payload out of the passed arguments .


def Func ( arg_0 , arg_1 ) : arg_2 = QtCore . QSettings ( arg_1 , QtCore . QSettings . IniFormat ) for arg_3 in arg_2 . allKeys ( ) : arg_0 [ arg_3 ] = arg_2 . value ( arg_3 )

def Func(arg_0, arg_1):
    """
    Import settings from the given file system path to given settings instance.

    type settings: IDASettingsInterface
    type config_path: str
    """
    arg_2 = QtCore.QSettings(arg_1, QtCore.QSettings.IniFormat)
    for arg_3 in arg_2.allKeys():
        arg_0[arg_3] = arg_2.value(arg_3)

Import settings from the given file system path to given settings instance .


return long_exposures, short_exposures, gross_exposures, net_exposures

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : arg_4 = arg_2 . keys ( ) arg_5 = [ ] arg_6 = [ ] arg_7 = [ ] arg_8 = [ ] arg_9 = arg_0 . drop ( 'cash' , axis = 'columns' ) arg_10 = arg_9 [ arg_9 > 0 ] . sum ( axis = 'columns' ) arg_11 = arg_9 [ arg_9 < 0 ] . abs ( ) . sum ( axis = 'columns' ) arg_12 = arg_9 . abs ( ) . sum ( axis = 'columns' ) for arg_13 in arg_4 : arg_14 = arg_9 [ arg_1 == arg_13 ] arg_15 = arg_14 [ arg_14 > 0 ] . sum ( axis = 'columns' ) . divide ( arg_10 ) arg_16 = arg_14 [ arg_14 < 0 ] . sum ( axis = 'columns' ) . divide ( arg_11 ) arg_17 = arg_14 . abs ( ) . sum ( axis = 'columns' ) . divide ( arg_12 ) arg_18 = arg_15 . subtract ( arg_16 ) arg_5 . append ( arg_15 ) arg_6 . append ( arg_16 ) arg_7 . append ( arg_17 ) arg_8 . append ( arg_18 ) return arg_5 , arg_6 , arg_7 , arg_8

def Func(arg_0, arg_1, arg_2=arg_3):
    """
    Returns arrays of long, short and gross sector exposures of an algorithm's
    positions

    Parameters
    ----------
    positions : pd.DataFrame
        Daily equity positions of algorithm, in dollars.
        - See full explanation in compute_style_factor_exposures.

    sectors : pd.DataFrame
        Daily Morningstar sector code per asset
        - See full explanation in create_risk_tear_sheet

    sector_dict : dict or OrderedDict
        Dictionary of all sectors
        - Keys are sector codes (e.g. ints or strings) and values are sector
          names (which must be strings)
        - Defaults to Morningstar sectors
    """

    arg_4 = arg_2.keys()

    arg_5 = []
    arg_6 = []
    arg_7 = []
    arg_8 = []

    arg_9 = arg_0.drop('cash', axis='columns')
    arg_10 = arg_9[arg_9 > 0] \
        .sum(axis='columns')
    arg_11 = arg_9[arg_9 < 0] \
        .abs().sum(axis='columns')
    arg_12 = arg_9.abs().sum(axis='columns')

    for arg_13 in arg_4:
        arg_14 = arg_9[arg_1 == arg_13]

        arg_15 = arg_14[arg_14 > 0] \
            .sum(axis='columns').divide(arg_10)
        arg_16 = arg_14[arg_14 < 0] \
            .sum(axis='columns').divide(arg_11)
        arg_17 = arg_14.abs().sum(axis='columns') \
            .divide(arg_12)
        arg_18 = arg_15.subtract(arg_16)

        arg_5.append(arg_15)
        arg_6.append(arg_16)
        arg_7.append(arg_17)
        arg_8.append(arg_18)

    return arg_5, arg_6, arg_7, arg_8

Returns arrays of long short and gross sector exposures of an algorithm s positions


(self, op, qargs=None, cargs=None, condition=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """Apply an operation to the output of the circuit.

        Args:
            op (Instruction): the operation associated with the DAG node
            qargs (list[tuple]): qubits that op will be applied to
            cargs (list[tuple]): cbits that op will be applied to
            condition (tuple or None): optional condition (ClassicalRegister, int)

        Returns:
            DAGNode: the current max node

        Raises:
            DAGCircuitError: if a leaf node is connected to multiple outputs

        """
        arg_2 = arg_2 or []
        arg_3 = arg_3 or []

        arg_5 = arg_0._bits_in_condition(arg_4)
        arg_5.extend(arg_3)

        arg_0._check_condition(arg_1.name, arg_4)
        arg_0._check_bits(arg_2, arg_0.output_map)
        arg_0._check_bits(arg_5, arg_0.output_map)

        arg_0._add_op_node(arg_1, arg_2, arg_3, arg_4)

        # Add new in-edges from predecessors of the output nodes to the
        # operation node while deleting the old in-edges of the output nodes
        # and adding new edges from the operation node to each output node
        arg_6 = [arg_2, arg_5]
        for arg_7 in itertools.chain(*arg_6):
            arg_8 = list(arg_0._multi_graph.predecessors(arg_0.output_map[arg_7]))

            if len(arg_8) != 1:
                raise DAGCircuitError("output node has multiple in-edges")

            arg_0._multi_graph.add_edge(arg_8[0], arg_0._id_to_node[arg_0._max_node_id],
                                       name="%s[%s]" % (arg_7[0].name, arg_7[1]), wire=arg_7)
            arg_0._multi_graph.remove_edge(arg_8[0], arg_0.output_map[arg_7])
            arg_0._multi_graph.add_edge(arg_0._id_to_node[arg_0._max_node_id], arg_0.output_map[arg_7],
                                       name="%s[%s]" % (arg_7[0].name, arg_7[1]), wire=arg_7)

        return arg_0._id_to_node[arg_0._max_node_id]

Apply an operation to the output of the circuit .


def
Func
(
arg_0
)
:
arg_1
=
{
}
arg_2
=
[
]
Func
=
[
]
for
arg_4
in
arg_0
.
rows
:
arg_5
=
arg_4
.
rows_before
[
:
]
if
arg_5
:
arg_1
[
arg_4
]
=
arg_5
else
:
arg_2
.
append
(
arg_4
)
assert
arg_2
while
arg_2
:
arg_4
=
arg_2
.
pop
(
0
)
Func
.
append
(
arg_4
)
assert
arg_4
not
in
arg_1
for
arg_6
in
reversed
(
arg_4
.
rows_after
)
:
arg_7
=
arg_1
[
arg_6
]
arg_7
.
remove
(
arg_4
)
if
not
arg_7
:
del
arg_1
[
arg_6
]
arg_2
.
insert
(
0
,
arg_6
)
assert
not
arg_1
,
"everything is walked"
return
Func

def Func(arg_0):
    """Walk the knitting pattern in a right-to-left fashion.

    :return: an iterable to walk the rows
    :rtype: list
    :param knittingpattern.KnittingPattern.KnittingPattern knitting_pattern: a
      knitting pattern to take the rows from
    """
    arg_1 = {}  # key consumes from values
    arg_2 = []
    Func = []
    for arg_4 in arg_0.rows:
        arg_5 = arg_4.rows_before[:]
        if arg_5:
            arg_1[arg_4] = arg_5
        else:
            arg_2.append(arg_4)
    assert arg_2
    while arg_2:
        # print("free rows:", free_rows)
        arg_4 = arg_2.pop(0)
        Func.append(arg_4)
        assert arg_4 not in arg_1
        for arg_6 in reversed(arg_4.rows_after):
            arg_7 = arg_1[arg_6]
            # print("  freed:", freed_row, todo)
            arg_7.remove(arg_4)
            if not arg_7:
                del arg_1[arg_6]
                arg_2.insert(0, arg_6)
    assert not arg_1, "everything is walked"
    return Func

Walk the knitting pattern in a right - to - left fashion .


def Func ( arg_0 ) : try : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd ) except UnicodeDecodeError : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd , encoding = 'latin1' ) return arg_1

def Func(arg_0):
    '''
    This just reads a pickled fake LC.

    Parameters
    ----------

    fakelcfile : str
        The fake LC file to read.

    Returns
    -------

    dict
        This returns an lcdict.

    '''

    try:
        with open(arg_0,'rb') as infd:
            arg_1 = pickle.load(infd)
    except UnicodeDecodeError:
        with open(arg_0,'rb') as infd:
            arg_1 = pickle.load(infd, encoding='latin1')

    return arg_1


(backend, backend_args, qitems, task_id, category,
                         archive_args=None, max_retries=MAX_JOB_RETRIES)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                         arg_5=None, arg_6=arg_7):
    """Execute a Perceval job on RQ.

    The items fetched during the process will be stored in a
    Redis queue named `queue`.

    Setting the parameter `archive_path`, raw data will be stored
    with the archive manager. The contents from the archive can
    be retrieved setting the pameter `fetch_from_archive` to `True`,
    too. Take into account this behaviour will be only available
    when the backend supports the use of the archive. If archiving
    is not supported, an `AttributeError` exception will be raised.

    :param backend: backend to execute
    :param bakend_args: dict of arguments for running the backend
    :param qitems: name of the RQ queue used to store the items
    :param task_id: identifier of the task linked to this job
    :param category: category of the items to retrieve
    :param archive_args: archive arguments
    :param max_retries: maximum number of attempts this job can execute
        before failing

    :returns: a `JobResult` instance

    :raises NotFoundError: raised when the backend is not found
    :raises AttributeError: raised when archiving is not supported but
        any of the archive parameters were set
    """
    arg_8 = rq.get_current_job()

    arg_9 = PercevalJob(arg_8.id, arg_3, arg_0, arg_4,
                      arg_8.connection, arg_2)

    logger.debug("Running job #%s (task: %s) (%s) (cat:%s)",
                 arg_9.job_id, arg_3, arg_0, arg_4)

    if not arg_9.has_archiving() and arg_5:
        raise AttributeError("archive attributes set but archive is not supported")

    arg_10 = True
    arg_11 = False
    arg_12 = 0

    while arg_10:
        try:
            arg_9.run(arg_1, arg_5=arg_5, arg_11=arg_11)
        except AttributeError as e:
            raise e
        except Exception as e:
            logger.debug("Error running job %s (%s) - %s",
                         arg_9.job_id, arg_0, str(e))
            arg_12 += 1

            if not arg_9.has_resuming() or arg_12 >= arg_6:
                logger.error("Cancelling job #%s (task: %s) (%s)",
                             arg_9.job_id, arg_3, arg_0)
                raise e

            logger.warning("Resuming job #%s (task: %s) (%s) due to a failure (n %s, max %s)",
                           arg_9.job_id, arg_3, arg_0, arg_12, arg_6)
            arg_11 = True
        else:
            # No failure, do not retry
            arg_10 = False

    arg_13 = arg_9.result

    logger.debug("Job #%s (task: %s) completed (%s) - %s items (%s) fetched",
                 arg_13.job_id, arg_3, arg_13.backend, str(arg_13.nitems), arg_13.category)

    return arg_13


def Func(arg_0, arg_1):
    """For a 2D array and mask, map the values of all unmasked pixels to a 1D array.

    The pixel coordinate origin is at the top left corner of the 2D array and goes right-wards and downwards, such
    that for an array of shape (3,3) where all pixels are unmasked:

    - pixel [0,0] of the 2D array will correspond to index 0 of the 1D array.
    - pixel [0,1] of the 2D array will correspond to index 1 of the 1D array.
    - pixel [1,0] of the 2D array will correspond to index 4 of the 1D array.

    Parameters
     ----------
    mask : ndarray
        A 2D array of bools, where *False* values mean unmasked and are included in the mapping.
    array_2d : ndarray
        The 2D array of values which are mapped to a 1D array.

    Returns
    --------
    ndarray
        A 1D array of values mapped from the 2D array with dimensions (total_unmasked_pixels).

    Examples
    --------
    mask = np.array([[True, False, True],
                     [False, False, False]
                     [True, False, True]])

    array_2d = np.array([[1.0, 2.0, 3.0],
                          [4.0, 5.0, 6.0],
                          [7.0, 8.0, 9.0]])

    array_1d = Func(mask=mask, array_2d=array_2d)
    """

    arg_2 = mask_util.total_regular_pixels_from_mask(arg_0)

    arg_3 = np.zeros(shape=arg_2)
    arg_4 = 0

    for arg_5 in range(arg_0.shape[0]):
        for arg_6 in range(arg_0.shape[1]):
            if not arg_0[arg_5, arg_6]:
                arg_3[arg_4] = arg_1[arg_5, arg_6]
                arg_4 += 1

    return arg_3

For a 2D array and mask, map the values of all unmasked pixels to a 1D array.

    The pixel coordinate origin is at the top left corner of the 2D array and goes right-wards and downwards, such
    that for an array of shape (3,3) where all pixels are unmasked:

    - pixel [0,0] of the 2D array will correspond to index 0 of the 1D array.
    - pixel [0,1] of the 2D array will correspond to index 1 of the 1D array.
    - pixel [1,0] of the 2D array will correspond to index 4 of the 1D array.

    Parameters
     ----------
    mask : ndarray
        A 2D array of bools, where *False* values mean unmasked and are included in the mapping.
    array_2d : ndarray
        The 2D array of values which are mapped to a 1D array.

    Returns
    --------
    ndarray
        A 1D array of values mapped from the 2D array with dimensions (total_unmasked_pixels).

    Examples
    --------
    mask = np.array([[True, False, True],
                     [False, False, False]
                     [True, False, True]])

    array_2d = np.array([[1.0, 2.0, 3.0],
                          [4.0, 5.0, 6.0],
                          [7.0, 8.0, 9.0]])

    array_1d = map_2d_array_to_masked_1d_array_from_array_2d_and_mask(mask=mask, array_2d=array_2d)

For a 2D array and mask map the values of all unmasked pixels to a 1D array .


def Func ( arg_0 = True , arg_1 = True , arg_2 = False ) : def demo_body ( arg_3 ) : arg_3 ( ) h2o . init ( ) arg_3 ( ) arg_4 = h2o . load_dataset ( "prostate" ) arg_3 ( ) arg_4 . describe ( ) arg_3 ( ) arg_5 , arg_6 = arg_4 . split_frame ( ratios = [ 0.70 ] ) arg_3 ( ) arg_5 [ "CAPSULE" ] = arg_5 [ "CAPSULE" ] . asfactor ( ) arg_6 [ "CAPSULE" ] = arg_6 [ "CAPSULE" ] . asfactor ( ) arg_3 ( ) from h2o . estimators import H2OGradientBoostingEstimator arg_7 = H2OGradientBoostingEstimator ( distribution = "bernoulli" , ntrees = 10 , max_depth = 8 , min_rows = 10 , learn_rate = 0.2 ) arg_7 . train ( x = [ "AGE" , "RACE" , "PSA" , "VOL" , "GLEASON" ] , y = "CAPSULE" , training_frame = arg_5 ) arg_3 ( ) arg_7 . show ( ) arg_3 ( ) arg_8 = arg_7 . predict ( arg_6 ) arg_8 . show ( ) arg_3 ( ) from h2o . tree import H2OTree , H2ONode arg_9 = H2OTree ( arg_7 , 0 , "0" ) len ( arg_9 ) arg_9 . left_children arg_9 . right_children arg_9 . root_node . show ( ) arg_3 ( ) arg_10 = arg_7 . model_performance ( arg_6 ) arg_10 . show ( ) _run_demo ( demo_body , arg_0 , arg_1 , arg_2 )

def Func(arg_0=True, arg_1=True, arg_2=False):
    """GBM model demo."""

    def demo_body(arg_3):
        """
        Demo of H2O's Gradient Boosting estimator.

        This demo uploads a dataset to h2o, parses it, and shows a description.
        Then it divides the dataset into training and test sets, builds a GLM
        from the training set, and makes predictions for the test set.
        Finally, default performance metrics are displayed.
        """
        arg_3()
        # Connect to H2O
        h2o.init()

        arg_3()
        # Upload the prostate dataset that comes included in the h2o python package
        arg_4 = h2o.load_dataset("prostate")

        arg_3()
        # Print a description of the prostate data
        arg_4.describe()

        arg_3()
        # Randomly split the dataset into ~70/30, training/test sets
        arg_5, arg_6 = arg_4.split_frame(ratios=[0.70])

        arg_3()
        # Convert the response columns to factors (for binary classification problems)
        arg_5["CAPSULE"] = arg_5["CAPSULE"].asfactor()
        arg_6["CAPSULE"] = arg_6["CAPSULE"].asfactor()

        arg_3()
        # Build a (classification) GLM
        from h2o.estimators import H2OGradientBoostingEstimator
        arg_7 = H2OGradientBoostingEstimator(distribution="bernoulli", ntrees=10, max_depth=8,
                                                    min_rows=10, learn_rate=0.2)
        arg_7.train(x=["AGE", "RACE", "PSA", "VOL", "GLEASON"],
                           y="CAPSULE", training_frame=arg_5)

        arg_3()
        # Show the model
        arg_7.show()

        arg_3()
        # Predict on the test set and show the first ten predictions
        arg_8 = arg_7.predict(arg_6)
        arg_8.show()

        arg_3()
        # Fetch a tree, print number of tree nodes, show root node description
        from h2o.tree import H2OTree, H2ONode
        arg_9 = H2OTree(arg_7, 0, "0")
        len(arg_9)
        arg_9.left_children
        arg_9.right_children
        arg_9.root_node.show()

        arg_3()
        # Show default performance metrics
        arg_10 = arg_7.model_performance(arg_6)
        arg_10.show()

    # Execute:
    _run_demo(demo_body, arg_0, arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : arg_0 . write ( struct . pack ( 'b3xI' , etypes [ 'miUINT32' ] [ 'n' ] , 8 ) ) arg_0 . write ( struct . pack ( 'b3x4x' , mclasses [ arg_1 [ 'mclass' ] ] ) ) write_elements ( arg_0 , 'miINT32' , arg_1 [ 'dims' ] ) write_elements ( arg_0 , 'miINT8' , asbytes ( arg_1 [ 'name' ] ) , is_name = True )

def Func(arg_0, arg_1):
    """Write variable header"""

    # write tag bytes,
    # and array flags + class and nzmax (null bytes)
    arg_0.write(struct.pack('b3xI', etypes['miUINT32']['n'], 8))
    arg_0.write(struct.pack('b3x4x', mclasses[arg_1['mclass']]))

    # write dimensions array
    write_elements(arg_0, 'miINT32', arg_1['dims'])

    # write var name
    write_elements(arg_0, 'miINT8', asbytes(arg_1['name']), is_name=True)


def Func(arg_0, arg_1=True):
    """Context manager to execute a code block in a directory.

    * The directory is created if it does not exist (unless
      create=False is set)
    * At the end or after an exception code always returns to
      the directory that was the current directory before entering
      the block.
    """
    arg_2 = os.getcwd()
    try:
        try:
            os.chdir(arg_0)
            logger.debug("Working in {directory!r}...".format(**vars()))
        except OSError as err:
            if arg_1 and err.errno == errno.ENOENT:
                os.makedirs(arg_0)
                os.chdir(arg_0)
                logger.info("Working in {directory!r} (newly created)...".format(**vars()))
            else:
                logger.exception("Failed to start working in {directory!r}.".format(**vars()))
                raise
        yield os.getcwd()
    finally:
        os.chdir(arg_2)

Context manager to execute a code block in a directory .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 : if arg_2 in arg_1 . data [ arg_0 . profile ] and arg_2 is not "auth" : arg_1 . data [ arg_0 . profile ] [ arg_2 ] = getattr ( arg_0 , arg_2 )

def Func(arg_0, arg_1):
    """
    Updates the profile's config entry with values set in each attr by the
    user.  This will overwrite existing values.

    Args:
        :msg: (Message class) an instance of a message class.
        :cfg: (jsonconfig.Config) config instance.
    """
    for arg_2 in arg_0:
        if arg_2 in arg_1.data[arg_0.profile] and arg_2 is not "auth":
            arg_1.data[arg_0.profile][arg_2] = getattr(arg_0, arg_2)

Updates the profile s config entry with values set in each attr by the user . This will overwrite existing values .


def Func ( arg_0 , arg_1 ) : arg_2 [ arg_1 ] = arg_0 arg_3 = sorted ( arg_2 . items ( ) , key = _key_func , reverse = True ) arg_4 [ : ] = [ k for ( k , v ) in arg_3 ] arg_5 [ : ] = [ k for ( k , v ) in arg_3 if v . _pyxmpp_sasl_secure ]

def Func(arg_0, arg_1):
    """Add a client authenticator class to `CLIENT_MECHANISMS_D`,
    `CLIENT_MECHANISMS` and, optionally, to `SECURE_CLIENT_MECHANISMS`
    """
    # pylint: disable-msg=W0212
    arg_2[arg_1] = arg_0
    arg_3 = sorted(arg_2.items(), key = _key_func, reverse = True)
    arg_4[:] = [k for (k, v) in arg_3 ]
    arg_5[:] = [k for (k, v) in arg_3
                                                    if v._pyxmpp_sasl_secure]

Add a client authenticator class to CLIENT_MECHANISMS_D CLIENT_MECHANISMS and optionally to SECURE_CLIENT_MECHANISMS


return _subprocess.call("type " + cmd,
                           shell=True,
                           stdout=_subprocess.PIPE,
                           stderr=_subprocess.PIPE) == 0

def
Func
(
arg_0
)
:
return
_subprocess
.
call
(
"type "
+
arg_0
,
shell
=
True
,
stdout
=
_subprocess
.
PIPE
,
stderr
=
_subprocess
.
PIPE
)
==
0

def Func(arg_0):
    """ check if dependency program is there """
    return _subprocess.call("type " + arg_0,
                           shell=True,
                           stdout=_subprocess.PIPE,
                           stderr=_subprocess.PIPE) == 0


def Func(arg_0, arg_1, arg_2):
        "Place the next queen at the given row."
        arg_3 = arg_1.index(None)
        arg_4 = arg_1[:]
        arg_4[arg_3] = arg_2
        return arg_4


async def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = not arg_0 . applications_accepting_frames arg_0 . applications_accepting_frames . add ( arg_2 ) if arg_3 : await arg_0 . accept ( )

async def Func(arg_0, arg_1, arg_2):
        """
        Intercept downstream `websocket.accept` message and thus allow this upsteam application to accept websocket
        frames.
        """
        arg_3 = not arg_0.applications_accepting_frames
        arg_0.applications_accepting_frames.add(arg_2)
        # accept the connection after the first upstream application accepts.
        if arg_3:
            await arg_0.accept()

Intercept downstream websocket . accept message and thus allow this upsteam application to accept websocket frames .


def Func(arg_0):
  """Validate that the name is a valid GCS bucket."""
  if not arg_0.startswith('gs://'):
    raise ValueError(
        'Invalid bucket path "%s". Must start with "gs://".' % arg_0)
  arg_1 = arg_0[len('gs://'):]
  if not re.search(r'^\w[\w_\.-]{1,61}\w$', arg_1):
    raise ValueError('Invalid bucket name: %s' % arg_0)

Validate that the name is a valid GCS bucket .


def Func ( arg_0 ) : Func = [ [ ] for _ in range ( arg_0 . pixels ) ] for arg_2 , arg_3 in enumerate ( arg_0 . sub_to_pix ) : Func [ arg_3 ] . append ( arg_2 ) return Func

def Func(arg_0):
        """Compute the mappings between a pixelization's pixels and the unmasked sub-grid pixels. These mappings \
        are determined after the regular-grid is used to determine the pixelization.

        The pixelization's pixels map to different number of sub-grid pixels, thus a list of lists is used to \
        represent these mappings"""
        Func = [[] for _ in range(arg_0.pixels)]

        for arg_2, arg_3 in enumerate(arg_0.sub_to_pix):
            Func[arg_3].append(arg_2)

        return Func

Compute the mappings between a pixelization s pixels and the unmasked sub - grid pixels . These mappings \ are determined after the regular - grid is used to determine the pixelization .


(script, size=1.0, x_segments=1, y_segments=1,
                      center=False, color=None)

def Func(arg_0, arg_1=1.0, arg_2=1, arg_3=1,
                      arg_4=False, arg_5=None):
    """ Creates a plane with a specified number of vertices
    on it sides, but no vertices on the interior.

    Currently used to create a simpler bottom for cube_hires.

    """
    arg_1 = util.make_list(arg_1, 2)

    grid(arg_0, arg_1=[arg_2 + arg_3 - 1, 1],
         arg_2=(arg_2 + arg_3 - 1), arg_3=1)
    if ml_script1.ml_version == '1.3.4BETA':
        arg_6 = 'and'
    else:
        arg_6 = '&&'

    if arg_0.ml_version == '1.3.4BETA': # muparser version: 1.3.2
        # Deform left side
        transform.vert_function(
            arg_0,
            x_func='if((y>0) and (x<%s),0,x)' % (arg_3),
            y_func='if((y>0) and (x<%s),(x+1)*%s,y)' % (
                arg_3, arg_1[1] / arg_3))
        # Deform top
        transform.vert_function(
            arg_0,
            x_func='if((y>0) and (x>=%s),(x-%s+1)*%s,x)' % (
                arg_3, arg_3, arg_1[0] / arg_2),
            y_func='if((y>0) and (x>=%s),%s,y)' % (arg_3, arg_1[1]))
        # Deform right side
        transform.vert_function(
            arg_0,
            x_func='if((y<.00001) and (x>%s),%s,x)' % (
                arg_2, arg_1[0]),
            y_func='if((y<.00001) and (x>%s),(x-%s)*%s,y)' % (
                arg_2, arg_2, arg_1[1] / arg_3))
        # Deform bottom
        transform.vert_function(
            arg_0,
            x_func='if((y<.00001) and (x<=%s) and (x>0),(x)*%s,x)' % (
                arg_2, arg_1[0] / arg_2),
            y_func='if((y<.00001) and (x<=%s) and (x>0),0,y)' % (arg_2))
    else: # muparser version: 2.2.5
        # Deform left side
        transform.vert_function(
            arg_0,
            x_func='((y>0) && (x<{yseg}) ? 0 : x)'.format(yseg=arg_3),
            y_func='((y>0) && (x<%s) ? (x+1)*%s : y)' % (
                arg_3, arg_1[1] / arg_3))
        # Deform top
        transform.vert_function(
            arg_0,
            x_func='((y>0) && (x>=%s) ? (x-%s+1)*%s : x)' % (
                arg_3, arg_3, arg_1[0] / arg_2),
            y_func='((y>0) && (x>=%s) ? %s : y)' % (arg_3, arg_1[1]))
        # Deform right side
        transform.vert_function(
            arg_0,
            x_func='((y<.00001) && (x>%s) ? %s : x)' % (
                arg_2, arg_1[0]),
            y_func='((y<.00001) && (x>%s) ? (x-%s)*%s : y)' % (
                arg_2, arg_2, arg_1[1] / arg_3))
        # Deform bottom
        transform.vert_function(
            arg_0,
            x_func='((y<.00001) && (x<=%s) && (x>0) ? (x)*%s : x)' % (
                arg_2, arg_1[0] / arg_2),
            y_func='((y<.00001) && (x<=%s) && (x>0) ? 0 : y)' % (arg_2))
    if arg_4:
        transform.translate(arg_0, [-arg_1[0] / 2, -arg_1[1] / 2])
    if arg_5 is not None:
        vert_color.function(arg_0, arg_5=arg_5)
    return None

Creates a plane with a specified number of vertices on it sides but no vertices on the interior .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = xml_generators . change_resource_record_set_writer ( connection = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 ) arg_4 = arg_0 . _send_request ( path = 'hostedzone/%s/rrset' % arg_1 . hosted_zone_id , data = arg_3 , method = 'POST' , ) arg_5 = arg_4 . find ( './{*}ChangeInfo' ) if arg_5 is None : arg_6 = arg_4 . find ( './{*}Error' ) . find ( './{*}Message' ) . text raise Route53Error ( arg_6 ) return parse_change_info ( arg_5 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Given a ChangeSet, POST it to the Route53 API.

        .. note:: You probably shouldn't be using this method directly,
            as there are convenience methods on the ResourceRecordSet
            sub-classes.

        :param change_set.ChangeSet change_set: The ChangeSet object to create
            the XML doc from.
        :keyword str comment: An optional comment to go along with the request.
        :rtype: dict
        :returns: A dict of change info, which contains some details about
            the request.
        """

        arg_3 = xml_generators.change_resource_record_set_writer(
            connection=arg_0,
            arg_1=arg_1,
            arg_2=arg_2
        )

        arg_4 = arg_0._send_request(
            path='hostedzone/%s/rrset' % arg_1.hosted_zone_id,
            data=arg_3,
            method='POST',
        )

        #print(prettyprint_xml(root))

        arg_5 = arg_4.find('./{*}ChangeInfo')
        if arg_5 is None:
            arg_6 = arg_4.find('./{*}Error').find('./{*}Message').text
            raise Route53Error(arg_6)
        return parse_change_info(arg_5)

Given a ChangeSet POST it to the Route53 API .


(self, expression, order_expression, binby=[], limits=None, shape=default_shape, selection=False, delay=False, edges=False, progress=None)

def Func(arg_0, arg_1, arg_2, arg_3=[], arg_4=None, arg_5=arg_6, arg_7=False, arg_8=False, arg_9=False, arg_10=None):
        """Return the Func element of a binned `expression`, where the values each bin are sorted by `order_expression`.

        Example:

        >>> import vaex
        >>> df = vaex.example()
        >>> df.Func(df.x, df.y, shape=8)
        >>> df.Func(df.x, df.y, shape=8, binby=[df.y])
        >>> df.Func(df.x, df.y, shape=8, binby=[df.y])
        array([-4.81883764, 11.65378   ,  9.70084476, -7.3025589 ,  4.84954977,
                8.47446537, -5.73602629, 10.18783   ])

        :param expression: The value to be placed in the bin.
        :param order_expression: Order the values in the bins by this expression.
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :param edges: {edges}
        :return: Ndarray containing the Func elements.
        :rtype: numpy.array
        """
        return arg_0._compute_agg('Func', arg_1, arg_3, arg_4, arg_5, arg_7, arg_8, arg_9, arg_10, extra_expressions=[arg_2])
        logger.debug("count(%r, binby=%r, limits=%r)", arg_1, arg_3, arg_4)
        logger.debug("count(%r, binby=%r, limits=%r)", arg_1, arg_3, arg_4)
        arg_1 = _ensure_strings_from_expressions(arg_1)
        arg_2 = _ensure_string_from_expression(arg_2)
        arg_3 = _ensure_strings_from_expressions(arg_3)
        arg_11, [arg_12,] = vaex.utils.listify(arg_1)
        @delayed
        def finish(*arg_13):
            arg_13 = np.asarray(arg_13)
            return vaex.utils.unlistify(arg_11, arg_13)
        arg_14 = vaex.utils.progressbars(arg_10)
        arg_4 = arg_0.limits(arg_3, arg_4, arg_8=True, arg_5=arg_5)
        arg_15 = [arg_0._Func_calculation(arg_1, arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_7=arg_7, arg_9=arg_9, arg_14=arg_14) for arg_1 in arg_12]
        arg_16 = finish(*arg_15)
        return arg_0._delay(arg_8, arg_16)

Return the first element of a binned `expression`, where the values each bin are sorted by `order_expression`.

        Example:

        >>> import vaex
        >>> df = vaex.example()
        >>> df.first(df.x, df.y, shape=8)
        >>> df.first(df.x, df.y, shape=8, binby=[df.y])
        >>> df.first(df.x, df.y, shape=8, binby=[df.y])
        array([-4.81883764, 11.65378   ,  9.70084476, -7.3025589 ,  4.84954977,
                8.47446537, -5.73602629, 10.18783   ])

        :param expression: The value to be placed in the bin.
        :param order_expression: Order the values in the bins by this expression.
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :param edges: {edges}
        :return: Ndarray containing the first elements.
        :rtype: numpy.array

Return the first element of a binned expression where the values each bin are sorted by order_expression .


def Func(arg_0, arg_1):
        """
        Makes a striplog of all Funcs.

        Args:
            Striplog. The striplog instance to Func with.

        Returns:
            Striplog. The result of the Func.
        """
        if not isinstance(arg_1, arg_0.__class__):
            arg_2 = "You can only Func striplogs with each other."
            raise StriplogError(arg_2)

        arg_3 = []
        for arg_4 in deepcopy(arg_0):
            for arg_5 in arg_1:
                if arg_4.any_overlaps(arg_5):
                    arg_4 = arg_4.Func(arg_5)
            arg_3.append(arg_4)
        return Striplog(arg_3)

Makes a striplog of all unions.

        Args:
            Striplog. The striplog instance to union with.

        Returns:
            Striplog. The result of the union.


return wheel_color((pos * len(_WHEEL) / length) + cycle_step)

def Func ( arg_0 , arg_1 , arg_2 ) : return wheel_color ( ( arg_0 * len ( _WHEEL ) / arg_1 ) + arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Helper for wheel_color that distributes colors over length and
    allows shifting position."""
    return wheel_color((arg_0 * len(_WHEEL) / arg_1) + arg_2)

Helper for wheel_color that distributes colors over length and allows shifting position .


return re.sub(find, replace, url).strip('_')

def Func ( arg_0 ) : arg_1 = r'https?://|[^\w]' arg_2 = '_' return re . sub ( arg_1 , arg_2 , arg_0 ) . strip ( '_' )

def Func(arg_0):
    """ Create a nice image name from the url. """

    arg_1 = r'https?://|[^\w]'
    arg_2 = '_'
    return re.sub(arg_1, arg_2, arg_0).strip('_')


return db_api.port_count_all(context, join_security_groups=True, **filters)

def
Func
(
arg_0
,
arg_1
=
)
:
LOG
.
info
(
"Func for tenant %s filters %s"
%
(
arg_0
.
tenant_id
,
arg_1
)
)
return
db_api
.
port_count_all
(
arg_0
,
join_security_groups
=
True
,
**
arg_1
)

def Func(arg_0, arg_1=None):
    """Return the number of ports.

    The result depends on the identity of the user making the request
    (as indicated by the context) as well as any filters.
    : param context: neutron api request context
    : param filters: a dictionary with keys that are valid keys for
        a port as listed in the RESOURCE_ATTRIBUTE_MAP object
        in neutron/api/v2/attributes.py.  Values in this dictionary
        are an iterable containing values that will be used for an exact
        match comparison for that value.  Each result returned by this
        function will have matched one of the values for each key in
        filters.

    NOTE: this method is optional, as it was not part of the originally
          defined plugin API.
    """
    LOG.info("Func for tenant %s filters %s" %
             (arg_0.tenant_id, arg_1))
    return db_api.port_count_all(arg_0, join_security_groups=True, **arg_1)


def
Func
(
arg_0
,
arg_1
=
'obj'
)
:
arg_2
=
(
'obj'
,
'array'
,
'plain'
)
if
arg_1
not
in
arg_2
:
eprint
(
"Error: '{}' not in {}"
.
format
(
arg_1
,
arg_2
)
)
return
def
stringify
(
arg_3
)
:
if
type
(
arg_3
)
in
(
list
,
tuple
)
:
return
', '
.
join
(
str
(
arg_4
)
for
arg_4
in
arg_3
)
return
arg_3
if
arg_1
==
'obj'
:
return
json
.
dumps
(
arg_0
.
answers
)
elif
arg_1
==
'array'
:
arg_5
=
[
[
k
,
v
]
for
k
,
v
in
arg_0
.
answers
.
items
(
)
]
return
json
.
dumps
(
arg_5
)
elif
arg_1
==
'plain'
:
arg_5
=
'\n'
.
join
(
'{}: {}'
.
format
(
k
,
stringify
(
v
)
)
for
k
,
v
in
arg_0
.
answers
.
items
(
)
)
return
arg_5

def Func(arg_0, arg_1='obj'):
        """Formats answers depending on `fmt`.
        """
        arg_2 = ('obj', 'array', 'plain')
        if arg_1 not in arg_2:
            eprint("Error: '{}' not in {}".format(arg_1, arg_2))
            return

        def stringify(arg_3):
            if type(arg_3) in (list, tuple):
                return ', '.join(str(arg_4) for arg_4 in arg_3)
            return arg_3

        if arg_1 == 'obj':
            return json.dumps(arg_0.answers)
        elif arg_1 == 'array':
            arg_5 = [[k, v] for k, v in arg_0.answers.items()]
            return json.dumps(arg_5)
        elif arg_1 == 'plain':
            arg_5 = '\n'.join('{}: {}'.format(k, stringify(v)) for k, v in arg_0.answers.items())
            return arg_5


def Func(arg_0, arg_1, arg_2):
        """Deletes the specified file from the given S3 bucket."""

        arg_3 = S3Connection(arg_0.access_key_id, arg_0.access_key_secret)
        arg_4 = arg_3.get_bucket(arg_2)

        if type(arg_1).__name__ == 'Key':
            arg_1 = '/' + arg_1.name

        arg_5 = arg_0._get_s3_path(arg_1)
        arg_6 = Key(arg_4)
        arg_6.key = arg_5

        try:
            arg_4.delete_key(arg_6)
        except S3ResponseError:
            pass

Deletes the specified file from the given S3 bucket .


(
    hmc_state: HamiltonianMonteCarloState,
    target_log_prob_fn: PotentialFn,
    step_size: Any,
    num_leapfrog_steps: IntTensor,
    momentum: State = None,
    kinetic_energy_fn: PotentialFn = None,
    momentum_sample_fn: MomentumSampleFn = None,
    leapfrog_trace_fn: Callable[[LeapFrogStepState, LeapFrogStepExtras],
                                TensorNest] = lambda *args: (),
    seed=None,
)

return hmc_state, HamiltonianMonteCarloExtra(
      is_accepted=is_accepted,
      proposed_hmc_state=proposed_state,
      log_accept_ratio=-energy_change,
      leapfrog_trace=leapfrog_trace)

def Func(
    arg_0: arg_1,
    arg_2: arg_3,
    arg_4: arg_5,
    arg_6: arg_7,
    arg_8: arg_9 = None,
    arg_10: arg_3 = None,
    arg_11: arg_12 = None,
    arg_13: arg_14[[arg_15, arg_16],
                                arg_17] = lambda *arg_18: (),
    arg_19=None,
) -> Tuple[arg_1, HamiltonianMonteCarloExtra]:
  """Hamiltonian Monte Carlo `TransitionOperator`.

  #### Example

  ```python
  step_size = 0.2
  num_steps = 2000
  num_leapfrog_steps = 10
  state = tf.ones([16, 2])

  base_mean = [1., 0]
  base_cov = [[1, 0.5], [0.5, 1]]

  bijector = tfb.Softplus()
  base_dist = tfd.MultivariateNormalFullCovariance(
      loc=base_mean, covariance_matrix=base_cov)
  target_dist = bijector(base_dist)

  def orig_target_log_prob_fn(x):
    return target_dist.log_prob(x), ()

  target_log_prob_fn, state = fun_mcmc.transform_log_prob_fn(
      orig_target_log_prob_fn, bijector, state)

  kernel = tf.function(lambda state: fun_mcmc.Func(
      state,
      step_size=step_size,
      num_leapfrog_steps=num_leapfrog_steps,
      target_log_prob_fn=target_log_prob_fn,
      seed=tfp_test_util.test_seed()))

  _, chain = fun_mcmc.trace(
      state=fun_mcmc.HamiltonianMonteCarloState(
          state=state,
          state_grads=None,
          target_log_prob=None,
          state_extra=None),
      fn=kernel,
      num_steps=num_steps,
      trace_fn=lambda state, extra: state.state_extra[0])
  ```

  Args:
    hmc_state: HamiltonianMonteCarloState.
    target_log_prob_fn: Target log prob fn.
    step_size: Step size, structure broadcastable to the `target_log_prob_fn`
      state.
    num_leapfrog_steps: Number of leapfrog steps to take.
    momentum: Initial momentum, passed to `momentum_sample_fn`. Default: zeroes.
    kinetic_energy_fn: Kinetic energy function.
    momentum_sample_fn: Sampler for the momentum.
    leapfrog_trace_fn: Trace function for the leapfrog integrator.
    seed: For reproducibility.

  Returns:
    hmc_state: HamiltonianMonteCarloState
    hmc_extra: HamiltonianMonteCarloExtra
  """
  arg_20 = arg_0.state
  arg_21 = arg_0.state_grads
  arg_22 = arg_0.target_log_prob
  arg_23 = arg_0.state_extra

  if arg_10 is None:

    # pylint: disable=function-redefined
    def arg_10(*arg_8):
      return tf.add_n([
          tf.reduce_sum(input_tensor=tf.square(arg_24), axis=-1) / 2.
          for arg_24 in tf.nest.flatten(arg_8)
      ]), ()

  if arg_11 is None:

    # pylint: disable=function-redefined
    def arg_11(*arg_8):
      arg_25 = tf.nest.map_structure(
          lambda arg_24: tf.random.normal(tf.shape(input=arg_24), dtype=arg_24.dtype),
          arg_8)
      if len(arg_25) == 1:
        return arg_25[0]
      else:
        return arg_25

  if arg_8 is None:
    arg_8 = call_fn(arg_11,
                       tf.nest.map_structure(tf.zeros_like, arg_20))
  if arg_22 is None:
    arg_22, arg_23, arg_21 = call_and_grads(
        arg_2, arg_20)

  arg_26, arg_27 = call_fn(arg_10, arg_8)
  arg_28 = -arg_22 + arg_26
  arg_29 = arg_1(
      arg_20=arg_20,
      arg_21=arg_21,
      arg_23=arg_23,
      arg_22=arg_22)

  def leapfrog_wrapper(arg_30, arg_22, arg_23):
    """Leapfrog wrapper that tracks extra state."""
    del arg_22
    del arg_23

    arg_30, arg_31 = leapfrog_step(
        arg_30,
        arg_4=arg_4,
        arg_2=arg_2,
        arg_10=arg_10)

    return [
        arg_30, arg_31.target_log_prob,
        arg_31.state_extra
    ], arg_31

  def leapfrog_trace_wrapper_fn(arg_18, arg_31):
    return arg_13(arg_18[0], arg_31)

  arg_32 = (arg_15(arg_20, arg_21, arg_8),
                            arg_22, arg_23)

  [[arg_30, arg_22, arg_23], arg_27], arg_33 = trace(
      arg_32,
      leapfrog_wrapper,
      arg_6,
      trace_fn=leapfrog_trace_wrapper_fn)

  arg_26, arg_27 = call_fn(arg_10, arg_30.momentum)
  arg_34 = -arg_22 + arg_26
  arg_35 = arg_1(
      arg_20=arg_30.state,
      arg_21=arg_30.state_grads,
      arg_22=arg_22,
      arg_23=arg_23)

  arg_36 = arg_34 - arg_28
  arg_0, arg_37, arg_27 = metropolis_hastings_step(
      arg_29, arg_35, arg_36, arg_19=arg_19)

  arg_0 = arg_0  # type: HamiltonianMonteCarloState
  return arg_0, HamiltonianMonteCarloExtra(
      arg_37=arg_37,
      proposed_hmc_state=arg_35,
      log_accept_ratio=-arg_36,
      arg_33=arg_33)

Hamiltonian Monte Carlo `TransitionOperator`.

  #### Example

  ```python
  step_size = 0.2
  num_steps = 2000
  num_leapfrog_steps = 10
  state = tf.ones([16, 2])

  base_mean = [1., 0]
  base_cov = [[1, 0.5], [0.5, 1]]

  bijector = tfb.Softplus()
  base_dist = tfd.MultivariateNormalFullCovariance(
      loc=base_mean, covariance_matrix=base_cov)
  target_dist = bijector(base_dist)

  def orig_target_log_prob_fn(x):
    return target_dist.log_prob(x), ()

  target_log_prob_fn, state = fun_mcmc.transform_log_prob_fn(
      orig_target_log_prob_fn, bijector, state)

  kernel = tf.function(lambda state: fun_mcmc.hamiltonian_monte_carlo(
      state,
      step_size=step_size,
      num_leapfrog_steps=num_leapfrog_steps,
      target_log_prob_fn=target_log_prob_fn,
      seed=tfp_test_util.test_seed()))

  _, chain = fun_mcmc.trace(
      state=fun_mcmc.HamiltonianMonteCarloState(
          state=state,
          state_grads=None,
          target_log_prob=None,
          state_extra=None),
      fn=kernel,
      num_steps=num_steps,
      trace_fn=lambda state, extra: state.state_extra[0])
  ```

  Args:
    hmc_state: HamiltonianMonteCarloState.
    target_log_prob_fn: Target log prob fn.
    step_size: Step size, structure broadcastable to the `target_log_prob_fn`
      state.
    num_leapfrog_steps: Number of leapfrog steps to take.
    momentum: Initial momentum, passed to `momentum_sample_fn`. Default: zeroes.
    kinetic_energy_fn: Kinetic energy function.
    momentum_sample_fn: Sampler for the momentum.
    leapfrog_trace_fn: Trace function for the leapfrog integrator.
    seed: For reproducibility.

  Returns:
    hmc_state: HamiltonianMonteCarloState
    hmc_extra: HamiltonianMonteCarloExtra

Hamiltonian Monte Carlo TransitionOperator .


def Func(arg_0, arg_1=False):
        """ Shrinks the trajectory and removes all exploration ranges from the parameters.
        Only possible if the trajectory has not been stored to disk before or was loaded as new.

        :param force:

            Usually you cannot shrink the trajectory if it has been stored to disk,
            because there's no guarantee that it is actually shrunk if there
            still exist explored parameters on disk. In case you are certain that
            you did not store explored parameters to disk set or you deleted all
            of them from disk set `force=True`.

        :raises: TypeError if the trajectory was stored before.

        """
        if arg_0._stored and not arg_1:
            raise TypeError('Your trajectory is already stored to disk or database, shrinking is '
                            'not allowed.')

        for arg_2 in arg_0._explored_parameters.values():
            arg_2.f_unlock()
            try:
                arg_2._shrink()
            except Exception as exc:
                arg_0._logger.error('Could not shrink `%s` because of:`%s`' %
                                   (arg_2.v_full_name, repr(exc)))

        # If we shrink, we do not have any explored parameters left and we can erase all
        # run information, and the length of the trajectory is 1 again.
        arg_0._explored_parameters = {}
        arg_0._run_information = {}
        arg_0._single_run_ids = {}
        arg_0._add_run_info(0)
        arg_0._test_run_addition(1)

Shrinks the trajectory and removes all exploration ranges from the parameters . Only possible if the trajectory has not been stored to disk before or was loaded as new .


def Func(arg_0,arg_1,**arg_2):
    '''
    Returns ON-OFF for all Stokes parameters given a cross_pols noise diode measurement
    '''
    #Get Stokes parameters, frequencies, and time sample length
    arg_3 = Waterfall(arg_0,max_load=150)
    arg_4 = arg_3.populate_freqs()
    arg_5 = arg_3.header['tsamp']
    arg_6 = arg_3.data
    arg_3 = None

    arg_7,arg_8,arg_9,arg_10 = get_stokes(arg_6,arg_1)

    #Fold noise diode data
    arg_11,arg_12 = foldcal(arg_7,arg_5,**arg_2)
    arg_13,arg_14 = foldcal(arg_8,arg_5,**arg_2)
    arg_15,arg_16 = foldcal(arg_9,arg_5,**arg_2)
    arg_17,arg_18 = foldcal(arg_10,arg_5,**arg_2)

    #Do ON-OFF subtraction
    arg_19 = arg_12-arg_11
    arg_20 = arg_14-arg_13
    arg_21 = arg_16-arg_15
    arg_22 = arg_18-arg_17

    return arg_19,arg_20,arg_21,arg_22,arg_4

Returns ON - OFF for all Stokes parameters given a cross_pols noise diode measurement


def Func ( arg_0 , arg_1 : arg_1 . Symbol ) -> Optional [ Var ] : arg_3 = arg_0 . interns . entry ( arg_1 , None ) if arg_3 is None : return arg_0 . refers . entry ( arg_1 , None ) return arg_3

def Func(arg_0, arg_1: arg_1.Symbol) -> Optional[Var]:
        """Find Vars mapped by the given Symbol input or None if no Vars are
        mapped by that Symbol."""
        arg_3 = arg_0.interns.entry(arg_1, None)
        if arg_3 is None:
            return arg_0.refers.entry(arg_1, None)
        return arg_3

Find Vars mapped by the given Symbol input or None if no Vars are mapped by that Symbol .


return Batch(
            images=images_unaug,
            heatmaps=nlib.normalize_heatmaps(
                self.heatmaps_unaug, shapes),
            segmentation_maps=nlib.normalize_segmentation_maps(
                self.segmentation_maps_unaug, shapes),
            keypoints=nlib.normalize_keypoints(
                self.keypoints_unaug, shapes),
            bounding_boxes=nlib.normalize_bounding_boxes(
                self.bounding_boxes_unaug, shapes),
            polygons=nlib.normalize_polygons(
                self.polygons_unaug, shapes),
            line_strings=nlib.normalize_line_strings(
                self.line_strings_unaug, shapes),
            data=self.data
        )

def Func(arg_0):
        """Convert this unnormalized batch to an instance of Batch.

        As this method is intended to be called before augmentation, it
        assumes that none of the ``*_aug`` attributes is yet set.
        It will produce an AssertionError otherwise.

        The newly created Batch's ``*_unaug`` attributes will match the ones
        in this batch, just in normalized form.

        Returns
        -------
        imgaug.augmentables.batches.Batch
            The batch, with ``*_unaug`` attributes being normalized.

        """
        assert all([
            arg_2 is None for arg_1, arg_2 in arg_0.__dict__.items()
            if arg_1.endswith("_aug")]), \
            "Expected UnnormalizedBatch to not contain any augmented data " \
            "before normalization, but at least one '*_aug' attribute was " \
            "already set."

        arg_3 = nlib.normalize_images(arg_0.images_unaug)
        arg_4 = None
        if arg_3 is not None:
            arg_4 = [image.shape for image in arg_3]

        return Batch(
            images=arg_3,
            heatmaps=nlib.normalize_heatmaps(
                arg_0.heatmaps_unaug, arg_4),
            segmentation_maps=nlib.normalize_segmentation_maps(
                arg_0.segmentation_maps_unaug, arg_4),
            keypoints=nlib.normalize_keypoints(
                arg_0.keypoints_unaug, arg_4),
            bounding_boxes=nlib.normalize_bounding_boxes(
                arg_0.bounding_boxes_unaug, arg_4),
            polygons=nlib.normalize_polygons(
                arg_0.polygons_unaug, arg_4),
            line_strings=nlib.normalize_line_strings(
                arg_0.line_strings_unaug, arg_4),
            data=arg_0.data
        )

Convert this unnormalized batch to an instance of Batch .


def Func(arg_0, arg_1):
    """
    Evaluate model on splitted 10 percent testing set
    """
    arg_2, arg_3, arg_4 = prepare_feature(arg_0, option='test')

    arg_5 = arg_1.predict([arg_2, arg_3])
    arg_5 = (arg_5.ravel() > 0.5).astype(int)

    arg_6 = f1_score(arg_4, arg_5)
    arg_7 = precision_score(arg_4, arg_5)
    arg_8 = recall_score(arg_4, arg_5)

    return arg_6, arg_7, arg_8


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 . get_data ( 'floating_ips/' , type = POST , params = { 'region' : arg_0 . region_slug } ) if arg_3 : arg_0 . ip = arg_3 [ 'floating_ip' ] [ 'ip' ] arg_0 . region = arg_3 [ 'floating_ip' ] [ 'region' ] return arg_0

def Func(arg_0, *arg_1, **arg_2):
        """
            Creates a FloatingIP in a region without assigning
            it to a specific Droplet.

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

            Args:
                region_slug: str - region's slug (e.g. 'nyc3')
        """
        arg_3 = arg_0.get_data('floating_ips/',
                             type=POST,
                             params={'region': arg_0.region_slug})

        if arg_3:
            arg_0.ip = arg_3['floating_ip']['ip']
            arg_0.region = arg_3['floating_ip']['region']

        return arg_0

Creates a FloatingIP in a region without assigning it to a specific Droplet .


(self, traj, network, network_dict, component_list, analyser_list)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """Runs a network in an experimental run.

        Called by a :class:`~pypet.brian2.network.NetworkManager`.

        A network run is divided into several subruns which are defined as
        :class:`~pypet.brian2.parameter.Brian2Parameter` instances.

        These subruns are extracted from the trajectory. All
        :class:`~pypet.brian2.parameter.Brian2Parameter` instances found under
        `traj.parameters.simulation.durations` (default, you can change the
        name of the group where to search for durations at runner initialisation).
        The order is determined from
        the `v_annotations.order` attributes. An error is thrown if no orders attribute
        can be found or if two parameters have the same order.

        There must be at least one subrun in the trajectory,
        otherwise an AttributeError is thrown. If two subruns equal in their order
        property a RuntimeError is thrown.

        For every subrun the following steps are executed:

        1.  Calling :func:`~pypet.brian2.network.NetworkComponent.add_to_network` for every
            every :class:`~pypet.brian2.network.NetworkComponent` in the order as
            they were passed to the :class:`~pypet.brian2.network.NetworkManager`.

        2.  Calling :func:`~pypet.brian2.network.NetworkComponent.add_to_network` for every
            every :class:`~pypet.brian2.network.NetworkAnalyser` in the order as
            they were passed to the :class:`~pypet.brian2.network.NetworkManager`.

        3.  Calling :func:`~pypet.brian2.network.NetworkComponent.add_to_network` of the
            NetworkRunner itself (usually the network runner should not add or remove
            anything from the network, but this step is executed for completeness).

        4.  Running the BRIAN2 network for the duration of the current subrun by calling
            the network's `run` function.

        5.  Calling :func:`~pypet.brian2.network.NetworkAnalyser.analyse` for every
            every :class:`~pypet.brian2.network.NetworkAnalyser` in the order as
            they were passed to the :class:`~pypet.brian2.network.NetworkManager`.

        6.  Calling :func:`~pypet.brian2.network.NetworkComponent.remove_from_network` of the
            NetworkRunner itself (usually the network runner should not add or remove
            anything from the network, but this step is executed for completeness).

        7.  Calling :func:`~pypet.brian2.network.NetworkComponent.remove_from_network` for every
            every :class:`~pypet.brian2.network.NetworkAnalyser` in the order as
            they were passed to the :class:`~pypet.brian2.network.NetworkManager`

        8.  Calling :func:`~pypet.brian2.network.NetworkComponent.remove_from_network` for every
            every :class:`~pypet.brian2.network.NetworkComponent` in the order as
            they were passed to the :class:`~pypet.brian2.network.NetworkManager`.

        These 8 steps are repeated for every subrun in the `subrun_list`.
        The `subrun_list` passed to all `add_to_network`, `analyse` and
        `remove_from_network` methods can be modified
        within these functions to potentially alter the order of execution or
        even erase or add upcoming subruns if necessary.

        For example, a NetworkAnalyser checks
        for epileptic pathological activity and cancels all coming subruns in case
        of undesired network dynamics.

        :param traj: Trajectory container

        :param network: BRIAN2 network

        :param network_dict: Dictionary of items shared among all components

        :param component_list: List of :class:`~pypet.brian2.network.NetworkComponent` objects

        :param analyser_list: List of :class:`~pypet.brian2.network.NetworkAnalyser` objects

        """
        arg_0._Func(arg_1, arg_2, arg_3, arg_4, arg_5,
                                  pre_run=False)


def Func ( arg_0 , arg_1 ) : if arg_0 . document != arg_1 : arg_0 . document = arg_1 for arg_3 in arg_0 . children : if not isinstance ( arg_3 , dom_tag ) : return arg_3 . Func ( arg_1 )

def Func(arg_0, arg_1):
    '''
    Creates a reference to the parent document to allow for partial-tree
    validation.
    '''
    # assume that a document is correct in the subtree
    if arg_0.document != arg_1:
      arg_0.document = arg_1
      for arg_3 in arg_0.children:
        if not isinstance(arg_3, dom_tag): return
        arg_3.Func(arg_1)

Creates a reference to the parent document to allow for partial - tree validation .


return dict(
        (k.lower().replace('cors_', ''), app_config.get(k))
        for k in CONFIG_OPTIONS
        if app_config.get(k) is not None
    )

def Func ( arg_0 ) : arg_1 = getattr ( arg_0 , 'config' , { } ) return dict ( ( arg_2 . lower ( ) . replace ( 'cors_' , '' ) , arg_1 . get ( arg_2 ) ) for arg_2 in CONFIG_OPTIONS if arg_1 . get ( arg_2 ) is not None )

def Func(arg_0):
    """Returns the dictionary of CORS specific app configurations."""
    # In order to support blueprints which do not have a config attribute
    arg_1 = getattr(arg_0, 'config', {})
    return dict(
        (arg_2.lower().replace('cors_', ''), arg_1.get(arg_2))
        for arg_2 in CONFIG_OPTIONS
        if arg_1.get(arg_2) is not None
    )

Returns the dictionary of CORS specific app configurations .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . rsplit ( ':' , 1 ) if xsrfutil . validate_token ( xsrf_secret_key ( ) , arg_3 , arg_1 . user_id ( ) , action_id = arg_2 ) : return arg_2 else : return None

def Func(arg_0, arg_1):
    """Parse the value of the 'state' parameter.

    Parses the value and validates the XSRF token in the state parameter.

    Args:
        state: string, The value of the state parameter.
        user: google.appengine.api.users.User, The current user.

    Returns:
        The redirect URI, or None if XSRF token is not valid.
    """
    arg_2, arg_3 = arg_0.rsplit(':', 1)
    if xsrfutil.validate_token(xsrf_secret_key(), arg_3, arg_1.user_id(),
                               action_id=arg_2):
        return arg_2
    else:
        return None

Parse the value of the state parameter .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
_get_project
(
)
bot
.
custom
(
'PROJECT'
,
arg_4
,
"CYAN"
)
bot
.
custom
(
'BUILD  '
,
arg_1
[
'steps'
]
[
0
]
[
'name'
]
,
"CYAN"
)
arg_5
=
arg_0
.
_build_service
.
projects
(
)
.
builds
(
)
.
create
(
body
=
arg_1
,
projectId
=
arg_4
)
.
execute
(
)
arg_6
=
arg_5
[
'metadata'
]
[
'build'
]
[
'id'
]
arg_7
=
arg_5
[
'metadata'
]
[
'build'
]
[
'status'
]
bot
.
log
(
"build %s: %s"
%
(
arg_6
,
arg_7
)
)
arg_8
=
time
.
time
(
)
while
arg_7
not
in
[
'COMPLETE'
,
'FAILURE'
,
'SUCCESS'
]
:
time
.
sleep
(
15
)
arg_5
=
arg_0
.
_build_service
.
projects
(
)
.
builds
(
)
.
get
(
id
=
arg_6
,
projectId
=
arg_4
)
.
execute
(
)
arg_6
=
arg_5
[
'id'
]
arg_7
=
arg_5
[
'status'
]
bot
.
log
(
"build %s: %s"
%
(
arg_6
,
arg_7
)
)
arg_9
=
time
.
time
(
)
bot
.
log
(
'Total build time: %s seconds'
%
(
round
(
arg_9
arg_8
,
2
)
)
)
if
arg_7
==
'SUCCESS'
:
arg_10
=
'SREGISTRY_GOOGLE_STORAGE_PRIVATE'
arg_11
=
arg_2
.
blob
(
arg_5
[
'artifacts'
]
[
'objects'
]
[
'paths'
]
[
0
]
)
if
arg_0
.
_get_and_update_setting
(
arg_10
)
==
:
arg_11
.
make_public
(
)
arg_5
[
'public_url'
]
=
arg_11
.
public_url
update_blob_metadata
(
arg_11
,
arg_5
,
arg_1
,
arg_2
,
arg_3
)
arg_5
[
'media_link'
]
=
arg_11
.
media_link
arg_5
[
'size'
]
=
arg_11
.
size
arg_5
[
'file_hash'
]
=
arg_11
.
md5_hash
return
arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
    '''run a build, meaning creating a build. Retry if there is failure
    '''

    arg_4 = arg_0._get_project()

    #          prefix,    message, color
    bot.custom('PROJECT', arg_4, "CYAN")
    bot.custom('BUILD  ', arg_1['steps'][0]['name'], "CYAN")

    arg_5 = arg_0._build_service.projects().builds().create(body=arg_1,
                                              projectId=arg_4).execute()

    arg_6 = arg_5['metadata']['build']['id']
    arg_7 = arg_5['metadata']['build']['status']
    bot.log("build %s: %s" % (arg_6, arg_7))

    arg_8 = time.time()
    while arg_7 not in ['COMPLETE', 'FAILURE', 'SUCCESS']:
        time.sleep(15)
        arg_5 = arg_0._build_service.projects().builds().get(id=arg_6,
                                                  projectId=arg_4).execute()

        arg_6 = arg_5['id']
        arg_7 = arg_5['status']
        bot.log("build %s: %s" % (arg_6, arg_7))

    arg_9 = time.time()
    bot.log('Total build time: %s seconds' % (round(arg_9 - arg_8, 2)))

    # If successful, update blob metadata and visibility
    if arg_7 == 'SUCCESS':

        # Does the user want to keep the container private?
        arg_10 = 'SREGISTRY_GOOGLE_STORAGE_PRIVATE'
        arg_11 = arg_2.blob(arg_5['artifacts']['objects']['paths'][0])

        # Make Public, if desired
        if arg_0._get_and_update_setting(arg_10) == None:
            arg_11.make_public()
            arg_5['public_url'] = arg_11.public_url

        # Add the metadata directly to the object
        update_blob_metadata(arg_11, arg_5, arg_1, arg_2, arg_3)
        arg_5['media_link'] = arg_11.media_link
        arg_5['size'] = arg_11.size
        arg_5['file_hash'] = arg_11.md5_hash

    return arg_5

run a build meaning creating a build . Retry if there is failure


def Func ( arg_0 , arg_1 = '0' ) : arg_2 = arg_0 . get_thing ( arg_1 ) if arg_2 is None : arg_0 . set_status ( 404 ) return try : arg_3 = json . loads ( arg_0 . request . body . decode ( ) ) except ValueError : arg_0 . set_status ( 400 ) return arg_4 = { } for arg_5 , arg_6 in arg_3 . items ( ) : arg_7 = None if 'input' in arg_6 : arg_7 = arg_6 [ 'input' ] arg_8 = arg_2 . perform_action ( arg_5 , arg_7 ) if arg_8 : arg_4 . update ( arg_8 . as_action_description ( ) ) tornado . ioloop . IOLoop . current ( ) . spawn_callback ( perform_action , arg_8 , ) arg_0 . set_status ( 201 ) arg_0 . write ( json . dumps ( arg_4 ) )

def Func(arg_0, arg_1='0'):
        """
        Handle a POST request.

        thing_id -- ID of the thing this request is for
        """
        arg_2 = arg_0.get_thing(arg_1)
        if arg_2 is None:
            arg_0.set_status(404)
            return

        try:
            arg_3 = json.loads(arg_0.request.body.decode())
        except ValueError:
            arg_0.set_status(400)
            return

        arg_4 = {}
        for arg_5, arg_6 in arg_3.items():
            arg_7 = None
            if 'input' in arg_6:
                arg_7 = arg_6['input']

            arg_8 = arg_2.perform_action(arg_5, arg_7)
            if arg_8:
                arg_4.update(arg_8.as_action_description())

                # Start the action
                tornado.ioloop.IOLoop.current().spawn_callback(
                    perform_action,
                    arg_8,
                )

        arg_0.set_status(201)
        arg_0.write(json.dumps(arg_4))


def Func(arg_0, arg_1: arg_2[arg_3, arg_4]) -> (arg_4, arg_4):
        """Return adjusted start and stop index as tuple.

        Used in  __setitem__ and __delitem__.
        """
        arg_5, arg_6 = arg_0._span
        if isinstance(arg_1, arg_4):
            if arg_1 < 0:
                arg_1 += arg_6 - arg_5
                if arg_1 < 0:
                    raise IndexError('index out of range')
            elif arg_1 >= arg_6 - arg_5:
                raise IndexError('index out of range')
            arg_7 = arg_5 + arg_1
            return arg_7, arg_7 + 1
        # isinstance(key, slice)
        if arg_1.step is not None:
            raise NotImplementedError(
                'step is not implemented for string setter.')
        arg_7, arg_8 = arg_1.start or 0, arg_1.stop
        if arg_7 < 0:
            arg_7 += arg_6 - arg_5
            if arg_7 < 0:
                raise IndexError('start index out of range')
        if arg_8 is None:
            arg_8 = arg_6 - arg_5
        elif arg_8 < 0:
            arg_8 += arg_6 - arg_5
        if arg_7 > arg_8:
            raise IndexError(
                'stop index out of range or start is after the stop')
        return arg_7 + arg_5, arg_8 + arg_5

Return adjusted start and stop index as tuple .


def Func(arg_0, arg_1):
        r"""Take pauli string to construct pauli.

        The qubit index of pauli label is q_{n-1} ... q_0.
        E.g., a pauli is $P_{n-1} \otimes ... \otimes P_0$

        Args:
            label (str): pauli label

        Returns:
            Pauli: the constructed pauli

        Raises:
            QiskitError: invalid character in the label
        """
        arg_2 = np.zeros(len(arg_1), dtype=np.bool)
        arg_3 = np.zeros(len(arg_1), dtype=np.bool)
        for arg_4, arg_5 in enumerate(arg_1):
            if arg_5 == 'X':
                arg_3[-arg_4 - 1] = True
            elif arg_5 == 'Z':
                arg_2[-arg_4 - 1] = True
            elif arg_5 == 'Y':
                arg_2[-arg_4 - 1] = True
                arg_3[-arg_4 - 1] = True
            elif arg_5 != 'I':
                raise QiskitError("Pauli string must be only consisted of 'I', 'X', "
                                  "'Y' or 'Z' but you have {}.".format(arg_5))
        return arg_0(arg_2=arg_2, arg_3=arg_3)

r Take pauli string to construct pauli .


def Func(arg_0):
        # type: () -> Generator[Text, None, None]
        """
        Creates a generator that does all the work.
        """
        # Group transactions by address to make it easier to iterate
        # over inputs.
        arg_1 = arg_0.bundle.group_transactions()

        # Define a few expected values.
        arg_2 = arg_0.bundle.hash
        arg_3 = len(arg_0.bundle) - 1

        # Track a few others as we go along.
        arg_4 = 0

        # Check indices and balance first.
        # Note that we use a counter to keep track of the current index,
        # since at this point we can't trust that the transactions have
        # correct ``current_index`` values.
        arg_5 = 0
        for arg_6 in arg_1:
            for arg_7 in arg_6:
                arg_4 += arg_7.value

                if arg_7.bundle_hash != arg_2:
                    yield 'Transaction {i} has invalid bundle hash.'.format(
                        i=arg_5,
                    )

                if arg_7.current_index != arg_5:
                    yield (
                        'Transaction {i} has invalid current index value '
                        '(expected {i}, actual {actual}).'.format(
                            actual=arg_7.current_index,
                            i=arg_5,
                        )
                    )

                if arg_7.last_index != arg_3:
                    yield (
                        'Transaction {i} has invalid last index value '
                        '(expected {expected}, actual {actual}).'.format(
                            actual=arg_7.last_index,
                            expected=arg_3,
                            i=arg_5,
                        )
                    )

                arg_5 += 1

        # Bundle must be balanced (spends must match inputs).
        if arg_4 != 0:
            yield (
                'Bundle has invalid balance '
                '(expected 0, actual {actual}).'.format(
                    actual=arg_4,
                )
            )

        # Signature validation is only meaningful if the transactions
        # are otherwise valid.
        if not arg_0._errors:
            arg_8 = []  # type: List[List[Transaction]]

            for arg_6 in arg_1:
                # Signature validation only applies to inputs.
                if arg_6[0].value >= 0:
                    continue

                arg_9 = True
                for arg_10, arg_7 in enumerate(arg_6):
                    if (arg_10 > 0) and (arg_7.value != 0):
                        # Input is malformed; signature fragments after
                        # the first should have zero value.
                        yield (
                            'Transaction {i} has invalid value '
                            '(expected 0, actual {actual}).'.format(
                                actual=arg_7.value,

                                # If we get to this point, we know that
                                # the ``current_index`` value for each
                                # transaction can be trusted.
                                i=arg_7.current_index,
                            )
                        )

                        # We won't be able to validate the signature,
                        # but continue anyway, so that we can check that
                        # the other transactions in the group have the
                        # correct ``value``.
                        arg_9 = False
                        continue

                # After collecting the signature fragment from each
                # transaction in the group, queue them up to run through
                # the validator.
                #
                # We have to perform signature validation separately so
                # that we can try different algorithms (for
                # backwards-compatibility).
                #
                # References:
                #
                # - https://github.com/iotaledger/kerl#kerl-integration-in-iota
                if arg_9:
                    arg_8.append(arg_6)

            # Once we've finished checking the attributes from each
            # transaction in the bundle, go back and validate
            # signatures.
            if arg_8:
                # ``yield from`` is an option here, but for
                # compatibility with Python 2 clients, we will do it the
                # old-fashioned way.
                for arg_11 in arg_0._get_bundle_signature_errors(
                        arg_8
                ):
                    yield arg_11

Creates a generator that does all the work .


def Func ( arg_0 = None , ** arg_1 ) : arg_2 = arg_0 . Func ( ** arg_1 ) if not arg_2 . get ( "Rules" ) : arg_2 . update ( { "Rules" : [ ] } ) return arg_2

def Func(arg_0=None, **arg_1):
    """
    NamePrefix='string'
    """
    arg_2 = arg_0.Func(**arg_1)
    if not arg_2.get("Rules"):
        arg_2.update({"Rules": []})

    return arg_2


def Func(arg_0, arg_1):
    """Process post-publication events coming out of the database."""
    arg_2, arg_3 = arg_0.module_ident, arg_0.ident_hash

    arg_4 = get_current_registry().celery_app

    # Check baking is not already queued.
    arg_1.execute('SELECT result_id::text '
                   'FROM document_baking_result_associations '
                   'WHERE module_ident = %s', (arg_2,))
    for arg_5 in arg_1.fetchall():
        arg_6 = arg_4.AsyncResult(arg_5[0]).state
        if arg_6 in ('QUEUED', 'STARTED', 'RETRY'):
            logger.debug('Already queued module_ident={} ident_hash={}'.format(
                arg_2, arg_3))
            return

    logger.debug('Queued for processing module_ident={} ident_hash={}'.format(
        arg_2, arg_3))
    arg_7 = _get_recipe_ids(arg_2, arg_1)
    update_module_state(arg_1, arg_2, 'processing', arg_7[0])
    # Commit the state change before preceding.
    arg_1.connection.commit()

    # Start of task
    # FIXME Looking up the task isn't the most clear usage here.
    arg_8 = 'cnxpublishing.subscribers.baking_processor'
    arg_9 = arg_4.tasks[arg_8]
    arg_5 = arg_9.delay(arg_2, arg_3)
    arg_9.backend.store_result(arg_5.id, None, 'QUEUED')

    # Save the mapping between a celery task and this event.
    track_baking_proc_state(arg_5, arg_2, arg_1)

Process post - publication events coming out of the database .


def Func ( arg_0 , arg_1 ) : arg_2 = set ( arg_0 . keys ( ) + arg_1 . keys ( ) ) arg_3 = { } for arg_4 in arg_2 : if arg_0 . get ( arg_4 ) != arg_1 . get ( arg_4 ) : arg_3 [ arg_4 ] = ( arg_0 . get ( arg_4 ) , arg_1 . get ( arg_4 ) ) return arg_3

def Func(arg_0, arg_1):
    """Return a dict of keys that differ with another config object."""
    arg_2 = set(arg_0.keys() + arg_1.keys())
    arg_3 = {}
    for arg_4 in arg_2:
        if arg_0.get(arg_4) != arg_1.get(arg_4):
            arg_3[arg_4] = (arg_0.get(arg_4), arg_1.get(arg_4))
    return arg_3

Return a dict of keys that differ with another config object .


def
Func
(
arg_0
)
:
try
:
try
:
arg_0
=
int
(
arg_0
)
except
ValueError
:
raise
X10InvalidUnitNumber
(
'%r not a valid unit number'
%
arg_0
)
except
TypeError
:
raise
X10InvalidUnitNumber
(
'%r not a valid unit number'
%
arg_0
)
if
not
(
1
<=
arg_0
<=
16
)
:
raise
X10InvalidUnitNumber
(
'%r not a valid unit number'
%
arg_0
)
return
arg_0

def Func(arg_0):
    """Returns a normalized unit number, i.e. integers
    Raises exception X10InvalidUnitNumber if unit number appears to be invalid
    """
    try:
        try:
            arg_0 = int(arg_0)
        except ValueError:
            raise X10InvalidUnitNumber('%r not a valid unit number' % arg_0)
    except TypeError:
        raise X10InvalidUnitNumber('%r not a valid unit number' % arg_0)
    if not (1 <= arg_0 <= 16):
        raise X10InvalidUnitNumber('%r not a valid unit number' % arg_0)
    return arg_0

Returns a normalized unit number i . e . integers Raises exception X10InvalidUnitNumber if unit number appears to be invalid


def Func(arg_0, arg_1, arg_2=0):
    """Checks the Scrabble score of a single word.

    Args:
        word: a string to check the Scrabble score of
        input_letters: the letters in our rack
        questions: integer of the tiles already on the board to build on

    Returns:
        an integer Scrabble score amount for the word
    """

    arg_3 = 0
    arg_4 = 0
    arg_5 = []
    arg_6 = list(arg_1)  # make a copy to speed up find_anagrams()
    for arg_7 in arg_0:
        if arg_7 in arg_6:
            arg_4 += 1
            arg_3 += letter_score(arg_7)
            arg_6.remove(arg_7)
        else:
            arg_5.append(letter_score(arg_7))

    # we can have both ?'s and _'s in the word. this will apply the ?s to the
    # highest scrabble score value letters and leave the blanks for low points.
    for arg_8 in sorted(arg_5, reverse=True):
        if arg_2 > 0:
            arg_3 += arg_8
            arg_2 -= 1

    # 50 bonus points for using all the tiles in your rack
    if arg_4 > 6:
        arg_3 += 50

    return arg_3

Checks the Scrabble score of a single word .


def Func(arg_0, arg_1: arg_2) -> list:
        """Returns the Message object for this message.

        :param str msgid_or_symbol: msgid_or_symbol may be either a numeric or symbolic id.
        :raises UnknownMessageError: if the message id is not defined.
        :rtype: List of MessageDefinition
        :return: A message definition corresponding to msgid_or_symbol
        """
        if arg_1[1:].isdigit():
            arg_1 = arg_1.upper()
        for arg_3 in (arg_0._alternative_names, arg_0._messages_definitions):
            try:
                return [arg_3[arg_1]]
            except KeyError:
                pass
        arg_4 = "No such message id or symbol '{msgid_or_symbol}'.".format(
            arg_1=arg_1
        )
        raise UnknownMessageError(arg_4)

Returns the Message object for this message .


def Func ( arg_0 , arg_1 ) : arg_2 = threading . enumerate ( ) arg_3 = threading . currentThread ( ) for arg_4 in arg_2 : if arg_4 != arg_3 : ctype_async_raise ( arg_4 , Mexcept . DebuggerQuit ) pass pass raise Mexcept . DebuggerQuit

def Func(arg_0, arg_1):
        """ quit command when several threads are involved. """
        arg_2 = threading.enumerate()
        arg_3 =  threading.currentThread()
        for arg_4 in arg_2:
            if arg_4 != arg_3:
                ctype_async_raise(arg_4, Mexcept.DebuggerQuit)
                pass
            pass
        raise Mexcept.DebuggerQuit

quit command when several threads are involved .


def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'printing profiler Func'
)
arg_0
.
prof
.
close
(
)
arg_2
=
stats
.
load
(
arg_0
.
pfile
)
arg_2
.
sort_stats
(
arg_0
.
sort
)
arg_3
=
hasattr
(
arg_2
,
'stream'
)
if
arg_3
:
arg_4
=
arg_2
.
stream
arg_2
.
stream
=
arg_1
else
:
arg_4
=
arg_5
.
stdout
arg_5
.
stdout
=
arg_1
try
:
if
arg_0
.
restrict
:
log
.
debug
(
'setting profiler restriction to %s'
,
arg_0
.
restrict
)
arg_2
.
print_stats
(
*
arg_0
.
restrict
)
else
:
arg_2
.
print_stats
(
)
finally
:
if
arg_3
:
arg_2
.
stream
=
arg_4
else
:
arg_5
.
stdout
=
arg_4

def Func(arg_0, arg_1):
        """Output profiler Func.
        """
        log.debug('printing profiler Func')
        arg_0.prof.close()
        arg_2 = stats.load(arg_0.pfile)
        arg_2.sort_stats(arg_0.sort)

        # 2.5 has completely different stream handling from 2.4 and earlier.
        # Before 2.5, stats objects have no stream attribute; in 2.5 and later
        # a reference sys.stdout is stored before we can tweak it.
        arg_3 = hasattr(arg_2, 'stream')
        if arg_3:
            arg_4 = arg_2.stream
            arg_2.stream = arg_1
        else:
            arg_4 = arg_5.stdout
            arg_5.stdout = arg_1
        try:
            if arg_0.restrict:
                log.debug('setting profiler restriction to %s', arg_0.restrict)
                arg_2.print_stats(*arg_0.restrict)
            else:
                arg_2.print_stats()
        finally:
            if arg_3:
                arg_2.stream = arg_4
            else:
                arg_5.stdout = arg_4


(self,
                   *,
                   encoding: Optional[str] = None,
                   errors: str = 'strict')

return await self._aws_text(encoding=encoding, errors=errors)

async def Func ( arg_0 , * , arg_1 : arg_2 [ arg_3 ] = None , arg_4 : arg_3 = 'strict' ) -> arg_3 : return await arg_0 . _aws_Func ( arg_1 = arg_1 , arg_4 = arg_4 )

async def Func(arg_0,
                   *,
                   arg_1: arg_2[arg_3] = None,
                   arg_4: arg_3 = 'strict') -> arg_3:
        """Read response payload and decode."""
        return await arg_0._aws_Func(arg_1=arg_1, arg_4=arg_4)


def Func ( arg_0 , arg_1 = 0 , arg_2 = None ) : arg_3 = arg_0 . htm_prediction_model . _getAnomalyClassifier ( ) arg_4 = arg_3 . getSelf ( ) . _knn arg_5 = numpy . array ( arg_3 . getSelf ( ) . getParameter ( 'categoryRecencyList' ) ) if arg_2 is None : arg_2 = arg_5 . max ( ) + 1 arg_6 = numpy . logical_and ( arg_5 >= arg_1 , arg_5 < arg_2 ) arg_7 = arg_5 [ arg_6 ] arg_8 = arg_4 . _numPatterns arg_4 . removeIds ( arg_7 . tolist ( ) ) assert arg_4 . _numPatterns == arg_8 - len ( arg_7 )

def Func(arg_0, arg_1=0, arg_2=None):
    """
    This method will remove any stored records within the range from start to
    end. Noninclusive of end.

    parameters
    ------------
    start - integer representing the ROWID of the start of the deletion range,
    end - integer representing the ROWID of the end of the deletion range,
      if None, it will default to end.
    """
    arg_3 = arg_0.htm_prediction_model._getAnomalyClassifier()
    arg_4 = arg_3.getSelf()._knn

    arg_5 = numpy.array(
      arg_3.getSelf().getParameter('categoryRecencyList'))

    if arg_2 is None:
      arg_2 = arg_5.max() + 1

    arg_6 = numpy.logical_and(arg_5 >= arg_1,
                                       arg_5 < arg_2)
    arg_7 = arg_5[arg_6]

    arg_8 = arg_4._numPatterns
    arg_4.removeIds(arg_7.tolist())
    assert arg_4._numPatterns == arg_8 - len(arg_7)

This method will remove any stored records within the range from start to end . Noninclusive of end .


def Func ( arg_0 , ** arg_1 ) : arg_0 . data . Func ( arg_0 . item_Func ( arg_0 . api , arg_0 . id , ** arg_1 ) ) return arg_0 . data

def Func(arg_0, **arg_1):
        """ Generic method for a resource's Update endpoint.

        Example endpoints:

        * `Update Device Details <https://m2x.att.com/developer/documentation/v2/device#Update-Device-Details>`_
        * `Update Distribution Details <https://m2x.att.com/developer/documentation/v2/distribution#Update-Distribution-Details>`_
        * `Update Collection Details <https://m2x.att.com/developer/documentation/v2/collections#Update-Collection-Details>`_

        :param attrs: Query parameters passed as keyword arguments. View M2X API Docs for listing of available parameters.

        :return: The API response, see M2X API docs for details
        :rtype: dict

        :raises: :class:`~requests.exceptions.HTTPError` if an error occurs when sending the HTTP request
        """
        arg_0.data.Func(arg_0.item_Func(arg_0.api, arg_0.id, **arg_1))
        return arg_0.data

Generic method for a resource s Update endpoint .


(obj, parent=None, parent_key=None, idx=None,
                siblings=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_5 = Node ( value = arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_4 = arg_4 , arg_3 = arg_3 ) if isinstance ( arg_0 , list ) : arg_6 = len ( arg_0 ) for arg_7 , arg_8 in enumerate ( arg_0 ) : for arg_9 in Func ( arg_8 , arg_5 , None , arg_7 + 1 , arg_6 ) : yield arg_9 elif isinstance ( arg_0 , collections . Mapping ) : for arg_10 in arg_0 : for arg_9 in Func ( arg_0 [ arg_10 ] , arg_5 , arg_10 ) : yield arg_9 yield arg_5

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                arg_4=None):
    """Yields each node of object graph in postorder."""

    arg_5 = Node(value=arg_0, arg_1=arg_1, arg_2=arg_2,
                arg_4=arg_4, arg_3=arg_3)

    if isinstance(arg_0, list):
        arg_6 = len(arg_0)
        for arg_7, arg_8 in enumerate(arg_0):
            for arg_9 in Func(arg_8, arg_5, None, arg_7 + 1, arg_6):
                yield arg_9
    elif isinstance(arg_0, collections.Mapping):
        for arg_10 in arg_0:
            for arg_9 in Func(arg_0[arg_10], arg_5, arg_10):
                yield arg_9
    yield arg_5

Yields each node of object graph in postorder .


(self, container, obj, contents, headers=None, query=None,
                   cdn=False)

return self.request(
            'PUT', path, contents, headers, query=query, cdn=cdn)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None,
                   arg_6=False):
        """
        PUTs the object and returns the results. This is used to
        create or overwrite objects. X-Object-Meta-xxx can optionally
        be sent to be stored with the object. Content-Type,
        Content-Encoding and other standard HTTP headers can often
        also be set, depending on the Swift cluster.

        Note that you can set the ETag header to the MD5 sum of the
        contents for extra verification the object was stored
        correctly.

        :param container: The name of the container.
        :param obj: The name of the object.
        :param contents: The contents of the object to store. This can
            be a simple str, or a file-like-object with at least a
            read function. If the file-like-object also has tell and
            seek functions, the PUT can be reattempted on any server
            error.
        :param headers: Additional headers to send with the request.
        :param query: Set to a dict of query values to send on the
            query string of the request.
        :param cdn: If set True, the CDN management interface will be
            used.
        :returns: A tuple of (status, reason, headers, contents).

            :status: is an int for the HTTP status code.
            :reason: is the str for the HTTP status (ex: "Ok").
            :headers: is a dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be a
                list.
            :contents: is the str for the HTTP body.
        """
        arg_7 = arg_0._object_path(arg_1, arg_2)
        return arg_0.request(
            'PUT', arg_7, arg_3, arg_4, arg_5=arg_5, arg_6=arg_6)

PUTs the object and returns the results . This is used to create or overwrite objects . X - Object - Meta - xxx can optionally be sent to be stored with the object . Content - Type Content - Encoding and other standard HTTP headers can often also be set depending on the Swift cluster .


def
Func
(
arg_0
)
:
if
arg_0
.
is_empty
(
)
:
raise
ValueError
(
"Tree is empty"
)
arg_1
=
arg_0
.
_root
while
arg_1
.
left
is
not
:
arg_1
=
arg_1
.
left
return
arg_1
.
key
,
arg_1
.
value

def Func(arg_0):
        """Get item with min key of tree, raises ValueError if tree is empty."""
        if arg_0.is_empty():
            raise ValueError("Tree is empty")
        arg_1 = arg_0._root
        while arg_1.left is not None:
            arg_1 = arg_1.left
        return arg_1.key, arg_1.value

Get item with min key of tree raises ValueError if tree is empty .


def Func ( arg_0 , arg_1 ) : arg_2 = OrderedDict ( ) arg_3 = [ x for x in arg_1 ] for arg_4 , arg_5 in arg_0 : arg_6 = arg_4 . split ( '-' ) [ 0 ] arg_7 = [ '%{}|{}%' . format ( arg_3 [ i ] . name , v ) for i , v in enumerate ( arg_6 . split ( '.' ) ) ] arg_8 ( arg_2 , arg_7 [ : - 1 ] ) [ arg_5 ] = arg_4 return arg_2

def Func(arg_0, arg_1):
    """ A function to construct a hierarchical dictionary representing the different citation layers of a text

    :param reffs: passage references with human-readable equivalent
    :type reffs: [(str, str)]
    :param citation: Main Citation
    :type citation: Citation
    :return: nested dictionary representing where keys represent the names of the levels and the final values represent the passage reference
    :rtype: OrderedDict
    """
    arg_2 = OrderedDict()
    arg_3 = [x for x in arg_1]
    for arg_4, arg_5 in arg_0:
        arg_6 = arg_4.split('-')[0]
        arg_7 = ['%{}|{}%'.format(arg_3[i].name, v) for i, v in enumerate(arg_6.split('.'))]
        arg_8(arg_2, arg_7[:-1])[arg_5] = arg_4
    return arg_2


def Func(arg_0, arg_1={}):
        """
        Creates a shift

        http://dev.wheniwork.com/#create/update-shift
        """
        arg_2 = "/2/shifts/"
        arg_3 = arg_1

        arg_4 = arg_0._post_resource(arg_2, arg_3)
        arg_5 = arg_0.shift_from_json(arg_4["shift"])

        return arg_5


def Func ( arg_0 , arg_1 = None , arg_2 = True ) : arg_1 = arg_1 or [ ] arg_3 = boto . connect_dynamodb ( * arg_1 ) Func = arg_3 . get_table ( arg_0 ) return Table ( Func = Func , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=True):
    """Returns a given table for the given user."""
    arg_1 = arg_1 or []
    arg_3 = boto.connect_dynamodb(*arg_1)

    Func = arg_3.get_table(arg_0)
    return Table(Func=Func, arg_2=arg_2)

Returns a given table for the given user .


def Func ( ) : global RedisPools global _redisManagedConnectionParams for arg_0 in RedisPools . values ( ) : try : arg_0 . disconnect ( ) except : pass for arg_1 in _redisManagedConnectionParams . values ( ) : for arg_2 in arg_1 : if 'connection_pool' in arg_2 : del arg_2 [ 'connection_pool' ] RedisPools . clear ( ) _redisManagedConnectionParams . clear ( )

def Func():
	'''
		Func - Disconnect all managed connection pools,
		   and clear the connectiobn_pool attribute on all stored managed connection pools.

		   A "managed" connection pool is one where REDIS_CONNECTION_PARAMS does not define the "connection_pool" attribute.
		   If you define your own pools, IndexedRedis will use them and leave them alone.

		  This method will be called automatically after calling setDefaultRedisConnectionParams.

		  Otherwise, you shouldn't have to call it.. Maybe as some sort of disaster-recovery call..
	'''
	global RedisPools
	global _redisManagedConnectionParams

	for arg_0 in RedisPools.values():
		try:
			arg_0.disconnect()
		except:
			pass

	for arg_1 in _redisManagedConnectionParams.values():
		for arg_2 in arg_1:
			if 'connection_pool' in arg_2:
				del arg_2['connection_pool']

	RedisPools.clear()
	_redisManagedConnectionParams.clear()

clearRedisPools - Disconnect all managed connection pools,
		   and clear the connectiobn_pool attribute on all stored managed connection pools.

		   A "managed" connection pool is one where REDIS_CONNECTION_PARAMS does not define the "connection_pool" attribute.
		   If you define your own pools, IndexedRedis will use them and leave them alone.

		  This method will be called automatically after calling setDefaultRedisConnectionParams.

		  Otherwise, you shouldn't have to call it.. Maybe as some sort of disaster-recovery call..

clearRedisPools - Disconnect all managed connection pools and clear the connectiobn_pool attribute on all stored managed connection pools .


def
Func
(
arg_0
)
:
with
arg_0
.
AUTHENTICATION_LOCK
:
log
.
info
(
'Starting authentication for %s'
,
arg_0
.
target
)
arg_1
=
oauth2client
.
file
.
Storage
(
arg_0
.
credentials_path
)
arg_2
=
arg_1
.
get
(
)
if
not
arg_2
or
arg_2
.
invalid
:
log
.
info
(
"No valid login. Starting OAUTH flow."
)
arg_3
=
oauth2client
.
client
.
flow_from_clientsecrets
(
arg_0
.
client_secret_path
,
arg_0
.
SCOPES
)
arg_3
.
user_agent
=
arg_0
.
APPLICATION_NAME
arg_5
=
oauth2client
.
tools
.
argparser
.
parse_args
(
[
]
)
arg_2
=
oauth2client
.
tools
.
run_flow
(
arg_3
,
arg_1
,
arg_5
)
log
.
info
(
'Storing credentials to %r'
,
arg_0
.
credentials_path
)
return
arg_2

def Func(arg_0):
        """Gets valid user credentials from storage.

        If nothing has been stored, or if the stored credentials are invalid,
        the OAuth2 flow is completed to obtain the new credentials.

        Returns:
            Credentials, the obtained credential.
        """
        with arg_0.AUTHENTICATION_LOCK:
            log.info('Starting authentication for %s', arg_0.target)
            arg_1 = oauth2client.file.Storage(arg_0.credentials_path)
            arg_2 = arg_1.get()
            if not arg_2 or arg_2.invalid:
                log.info("No valid login. Starting OAUTH flow.")
                arg_3 = oauth2client.client.flow_from_clientsecrets(arg_0.client_secret_path, arg_0.SCOPES)
                arg_3.user_agent = arg_0.APPLICATION_NAME
                arg_5 = oauth2client.tools.argparser.parse_args([])
                arg_2 = oauth2client.tools.run_flow(arg_3, arg_1, arg_5)
                log.info('Storing credentials to %r', arg_0.credentials_path)
            return arg_2

Gets valid user credentials from storage .


def Func(arg_0):
    """
    Propagate "clk" clock and reset "rst" signal to all subcomponents
    """
    arg_1 = arg_0.clk
    arg_2 = arg_0.rst

    for arg_3 in arg_0._units:
        _tryConnect(arg_1, arg_3, 'clk')
        _tryConnect(~arg_2, arg_3, 'rst_n')
        _tryConnect(arg_2, arg_3, 'rst')

Propagate clk clock and reset rst signal to all subcomponents


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Set callback, which will be called when new service appeared online
        and sent Hi message

        typesFilter and scopesFilter might be list of types and scopes.
        If filter is set, callback is called only for Hello messages,
        which match filter

        Set None to disable callback
        """
        arg_0._remoteServiceHelloCallback = arg_1
        arg_0._remoteServiceHelloCallbackTypesFilter = arg_2
        arg_0._remoteServiceHelloCallbackScopesFilter = arg_3

Set callback which will be called when new service appeared online and sent Hi message


def Func(arg_0):
        """
        Init project.
        """
        return [
            (('--yes',), dict(action='store_true', help='clean .git repo')),
            (('--variable', '-s'),
             dict(nargs='+', help='set extra variable,format is name:value')),
            (('--skip-builtin',),
             dict(action='store_true', help='skip replace builtin variable')),
        ]


(self, image, color=(0, 255, 0), alpha=1.0, size=1,
                      copy=True, raise_if_out_of_image=False, thickness=None)

def Func(arg_0, arg_1, arg_2=(0, 255, 0), arg_3=1.0, arg_4=1,
                      arg_5=True, arg_6=False, arg_7=None):
        """
        Draw all bounding boxes onto a given image.

        Parameters
        ----------
        image : (H,W,3) ndarray
            The image onto which to draw the bounding boxes.
            This image should usually have the same shape as
            set in BoundingBoxesOnImage.shape.

        color : int or list of int or tuple of int or (3,) ndarray, optional
            The RGB color of all bounding boxes. If a single int ``C``, then
            that is equivalent to ``(C,C,C)``.

        alpha : float, optional
            Alpha/transparency of the bounding box.

        size : int, optional
            Thickness in pixels.

        copy : bool, optional
            Whether to copy the image before drawing the bounding boxes.

        raise_if_out_of_image : bool, optional
            Whether to raise an exception if any bounding box is outside of the
            image.

        thickness : None or int, optional
            Deprecated.

        Returns
        -------
        image : (H,W,3) ndarray
            Image with drawn bounding boxes.

        """
        arg_1 = np.copy(arg_1) if arg_5 else arg_1

        for arg_8 in arg_0.bounding_boxes:
            arg_1 = arg_8.Func(
                arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
                arg_4=arg_4,
                arg_5=False,
                arg_6=arg_6,
                arg_7=arg_7
            )

        return arg_1

Draw all bounding boxes onto a given image .


def Func():
    """Initialize and run command line interface."""
    # Create and populate parser
    arg_0 = create_parser()

    # Parse given arguments
    arg_1 = arg_0.parse_args()

    # Checking arguments
    check_arguments(arg_1, arg_0)

    # BUSINESS LOGIC IS FOLLOWING
    run(arg_0, arg_1)

Initialize and run command line interface .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
supports_autocommit
and
arg_2
:
arg_0
.
log
.
warn
(
(
"%s connection doesn't support "
"autocommit but autocommit activated."
)
,
getattr
(
arg_0
,
arg_0
.
conn_name_attr
)
)
arg_1
.
autocommit
=
arg_2

def Func(arg_0, arg_1, arg_2):
        """
        Sets the autocommit flag on the connection
        """
        if not arg_0.supports_autocommit and arg_2:
            arg_0.log.warn(
                ("%s connection doesn't support "
                 "autocommit but autocommit activated."),
                getattr(arg_0, arg_0.conn_name_attr))
        arg_1.autocommit = arg_2


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , arg_0 . RCX == 0 , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if RCX register is 0.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, arg_0.RCX == 0, arg_1.read(), arg_0.PC)