def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None : arg_0 . _canvas . strokewidth = arg_1 else : return arg_0 . _canvas . strokewidth

def Func(arg_0, arg_1=None):
        '''Set the stroke width.

        :param w: Stroke width.
        :return: If no width was specified then current width is returned.
        '''
        if arg_1 is not None:
            arg_0._canvas.strokewidth = arg_1
        else:
            return arg_0._canvas.strokewidth


return [name for name in vars(self) if not name.startswith('_') and
                name not in self._global_param_names]

def Func ( arg_0 ) : return [ arg_1 for arg_1 in vars ( arg_0 ) if not arg_1 . startswith ( '_' ) and arg_1 not in arg_0 . _global_param_names ]

def Func(arg_0):
        """Returns the parameter names for these features, avoiding
        the global parameters."""
        return [arg_1 for arg_1 in vars(arg_0) if not arg_1.startswith('_') and
                arg_1 not in arg_0._global_param_names]

Returns the parameter names for these features avoiding the global parameters .


def Func(arg_0, arg_1=None):
        """create an empty record"""
        arg_2 = {}
        arg_1 = arg_0._keys if arg_1 is None else arg_1
        for arg_3 in arg_1:
            arg_2[arg_3] = None
        return arg_2


(self, ops, account, permission, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, **arg_4):
        """ This method obtains the required private keys if present in
            the wallet, finalizes the transaction, signs it and
            broadacasts it

            :param operation ops: The operation (or list of operaions) to
                broadcast
            :param operation account: The account that authorizes the
                operation
            :param string permission: The required permission for
                signing (active, owner, posting)
            :param object append_to: This allows to provide an instance of
                ProposalsBuilder (see :func:`new_proposal`) or
                TransactionBuilder (see :func:`new_tx()`) to specify
                where to put a specific operation.

            ... note:: ``append_to`` is exposed to every method used in the
                this class

            ... note::

                If ``ops`` is a list of operation, they all need to be
                signable by the same key! Thus, you cannot combine ops
                that require active permission with ops that require
                posting permission. Neither can you use different
                accounts for different operations!

            ... note:: This uses ``txbuffer`` as instance of
                :class:`transactionbuilder.TransactionBuilder`.
                You may want to use your own txbuffer
        """
        if "append_to" in arg_4 and arg_4["append_to"]:
            if arg_0.proposer:
                log.warning(
                    "You may not use append_to and self.proposer at "
                    "the same time. Append new_proposal(..) instead"
                )
            # Append to the append_to and return
            arg_5 = arg_4["append_to"]
            arg_6 = arg_5.get_parent()
            assert isinstance(
                arg_5, (arg_0.transactionbuilder_class, arg_0.proposalbuilder_class)
            )
            arg_5.appendOps(arg_1)
            # Add the signer to the buffer so we sign the tx properly
            if isinstance(arg_5, arg_0.proposalbuilder_class):
                arg_6.appendSigner(arg_5.proposer, arg_3)
            else:
                arg_6.appendSigner(arg_2, arg_3)
            # This returns as we used append_to, it does NOT broadcast, or sign
            return arg_5.get_parent()
        elif arg_0.proposer:
            # Legacy proposer mode!
            arg_7 = arg_0.proposal()
            arg_7.set_proposer(arg_0.proposer)
            arg_7.set_expiration(arg_0.proposal_expiration)
            arg_7.set_review(arg_0.proposal_review)
            arg_7.appendOps(arg_1)
            # Go forward to see what the other options do ...
        else:
            # Append tot he default buffer
            arg_0.txbuffer.appendOps(arg_1)

        # The API that obtains the fee only allows to specify one particular
        # fee asset for all operations in that transaction even though the
        # blockchain itself could allow to pay multiple operations with
        # different fee assets.
        if "fee_asset" in arg_4 and arg_4["fee_asset"]:
            arg_0.txbuffer.set_fee_asset(arg_4["fee_asset"])

        # Add signing information, signer, sign and optionally broadcast
        if arg_0.unsigned:
            # In case we don't want to sign anything
            arg_0.txbuffer.addSigningInformation(arg_2, arg_3)
            return arg_0.txbuffer
        elif arg_0.bundle:
            # In case we want to add more ops to the tx (bundle)
            arg_0.txbuffer.appendSigner(arg_2, arg_3)
            return arg_0.txbuffer.json()
        else:
            # default behavior: sign + broadcast
            arg_0.txbuffer.appendSigner(arg_2, arg_3)
            arg_0.txbuffer.sign()
            return arg_0.txbuffer.broadcast()

This method obtains the required private keys if present in the wallet finalizes the transaction signs it and broadacasts it


return RemoteLRS(
            version=self.lrs_configuration.version,
            endpoint=self.lrs_configuration.endpoint,
            auth=self.lrs_configuration.authorization_header,
        )

def Func ( arg_0 ) : return RemoteLRS ( version = arg_0 . Func_configuration . version , endpoint = arg_0 . Func_configuration . endpoint , auth = arg_0 . Func_configuration . authorization_header , )

def Func(arg_0):
        """
        LRS client instance to be used for sending statements.
        """
        return RemoteLRS(
            version=arg_0.Func_configuration.version,
            endpoint=arg_0.Func_configuration.endpoint,
            auth=arg_0.Func_configuration.authorization_header,
        )

LRS client instance to be used for sending statements .


def Func(arg_0, arg_1=arg_2, arg_3=arg_4):
        """Fetch the messages from the channel.

        This method Funces the messages stored on the channel that were
        sent since the given date.

        :param category: the category of items to Func
        :param from_date: obtain messages sent since this date

        :returns: a generator of messages
        """
        if not arg_3:
            arg_3 = arg_4

        arg_3 = datetime_to_utc(arg_3)
        arg_5 = datetime_utcnow().timestamp()

        arg_6 = {'from_date': arg_3, 'latest': arg_5}
        arg_7 = super().Func(arg_1, **arg_6)

        return arg_7

Fetch the messages from the channel.

        This method fetches the messages stored on the channel that were
        sent since the given date.

        :param category: the category of items to fetch
        :param from_date: obtain messages sent since this date

        :returns: a generator of messages


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = np . array ( arg_0 . encoder . encode ( arg_1 ) , dtype = realDType ) if arg_2 : arg_0 . encodings . append ( arg_3 ) arg_0 . numEncodings += 1 return arg_3

def Func(arg_0, arg_1, arg_2=True):
    """Value is encoded as a sdr using the encoding parameters of the Field"""

    arg_3 = np.array(arg_0.encoder.encode(arg_1), dtype=realDType)

    if arg_2:
      arg_0.encodings.append(arg_3)
      arg_0.numEncodings+=1

    return arg_3


def Func ( arg_0 , arg_1 ) : if hasattr ( arg_0 . _overview_group , 'explorations' ) : arg_2 = arg_0 . _overview_group . _f_get_child ( 'explorations' ) for arg_3 in arg_2 . iterrows ( ) : arg_4 = arg_3 [ 'explorations' ] . decode ( 'utf-8' ) if arg_4 not in arg_1 . _explored_parameters : arg_1 . _explored_parameters [ arg_4 ] = None else : for arg_6 in ( 'parameters' , 'derived_parameters' ) : if hasattr ( arg_0 . _trajectory_group , arg_6 ) : arg_7 = arg_0 . _trajectory_group . _f_get_child ( arg_6 ) for arg_8 in arg_7 . _f_walk_groups ( ) : if arg_0 . _all_get_from_attrs ( arg_8 , HDF5StorageService . LENGTH ) : arg_9 = arg_8 . _v_pathname arg_10 = '.' . join ( arg_9 . split ( '/' ) [ 2 : ] ) arg_1 . _explored_parameters [ arg_10 ] = None

def Func(arg_0, arg_1):
        """Recalls names of all explored parameters"""
        if hasattr(arg_0._overview_group, 'explorations'):
            arg_2 = arg_0._overview_group._f_get_child( 'explorations')
            for arg_3 in arg_2.iterrows():
                arg_4 = arg_3['explorations'].decode('utf-8')
                if arg_4 not in arg_1._explored_parameters:
                    arg_1._explored_parameters[arg_4] = None
        else:
            # This is for backwards compatibility
            for arg_6 in ('parameters', 'derived_parameters'):
                if hasattr(arg_0._trajectory_group, arg_6):
                    arg_7 = arg_0._trajectory_group._f_get_child(arg_6)
                    for arg_8 in arg_7._f_walk_groups():
                        if arg_0._all_get_from_attrs(arg_8, HDF5StorageService.LENGTH):
                            arg_9 = arg_8._v_pathname
                            arg_10 = '.'.join(arg_9.split('/')[2:])
                            arg_1._explored_parameters[arg_10] = None


def Func ( arg_0 ) : try : arg_1 = config . Settings ( arg_0 = arg_0 ) arg_2 = STORAGES [ 's3' ] ( arg_1 = arg_1 ) arg_3 = s3conf . S3Conf ( arg_2 = arg_2 , arg_1 = arg_1 ) arg_4 = os . path . join ( config . LOCAL_CONFIG_FOLDER , arg_0 ) click . echo ( '' . join ( arg_3 . Func ( arg_4 ) ) ) except exceptions . EnvfilePathNotDefinedError : raise exceptions . EnvfilePathNotDefinedUsageError ( )

def Func(arg_0):
    """
    For each section defined in the local config file, look up for a folder inside the local config folder
    named after the section. Uploads the environemnt file named as in the S3CONF variable for this section
    to the remote S3CONF path.
    """
    try:
        arg_1 = config.Settings(arg_0=arg_0)
        arg_2 = STORAGES['s3'](arg_1=arg_1)
        arg_3 = s3conf.S3Conf(arg_2=arg_2, arg_1=arg_1)
        arg_4 = os.path.join(config.LOCAL_CONFIG_FOLDER, arg_0)
        click.echo(''.join(arg_3.Func(arg_4)))
    except exceptions.EnvfilePathNotDefinedError:
        raise exceptions.EnvfilePathNotDefinedUsageError()

For each section defined in the local config file look up for a folder inside the local config folder named after the section . Uploads the environemnt file named as in the S3CONF variable for this section to the remote S3CONF path .


def Func(arg_0, arg_1):
    """
    Marks reads as PCR duplicates using Sambamba

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str bam: FileStoreID for BAM file
    :return: FileStoreID for sorted BAM file
    :rtype: str
    """
    arg_2 = arg_0.fileStore.getLocalTempDir()
    arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_2, 'input.bam'))
    arg_3 = ['/usr/local/bin/sambamba',
               'markdup',
               '-t', str(int(arg_0.cores)),
               '/data/input.bam',
               '/data/output.bam']

    arg_4 = time.time()
    dockerCall(arg_0=arg_0, workDir=arg_2,
               parameters=arg_3,
               tool='quay.io/biocontainers/sambamba:0.6.6--0')
    arg_5 = time.time()
    _log_runtime(arg_0, arg_4, arg_5, "sambamba mkdup")
    return arg_0.fileStore.writeGlobalFile(os.path.join(arg_2, 'output.bam'))


(
    src, tar, weights='exponential', max_length=8, normalized=False
)

return Eudex().dist_abs(src, tar, weights, max_length, normalized)

def Func ( arg_0 , arg_1 , arg_2 = 'exponential' , arg_3 = 8 , arg_4 = False ) : return Eudex ( ) . dist_abs ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

def Func(
    arg_0, arg_1, arg_2='exponential', arg_3=8, arg_4=False
):
    """Calculate the Hamming distance between the Eudex hashes of two terms.

    This is a wrapper for :py:meth:`Eudex.Func`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    weights : str, iterable, or generator function
        The weights or weights generator function
    max_length : int
        The number of characters to encode as a eudex hash
    normalized : bool
        Normalizes to [0, 1] if True

    Returns
    -------
    int
        The Eudex Hamming distance

    Examples
    --------
    >>> Func('cat', 'hat')
    128
    >>> Func('Niall', 'Neil')
    2
    >>> Func('Colin', 'Cuilen')
    10
    >>> Func('ATCG', 'TAGC')
    403

    >>> Func('cat', 'hat', weights='fibonacci')
    34
    >>> Func('Niall', 'Neil', weights='fibonacci')
    2
    >>> Func('Colin', 'Cuilen', weights='fibonacci')
    7
    >>> Func('ATCG', 'TAGC', weights='fibonacci')
    117

    >>> Func('cat', 'hat', weights=None)
    1
    >>> Func('Niall', 'Neil', weights=None)
    1
    >>> Func('Colin', 'Cuilen', weights=None)
    2
    >>> Func('ATCG', 'TAGC', weights=None)
    9

    >>> # Using the OEIS A000142:
    >>> Func('cat', 'hat', [1, 1, 2, 6, 24, 120, 720, 5040])
    1
    >>> Func('Niall', 'Neil', [1, 1, 2, 6, 24, 120, 720, 5040])
    720
    >>> Func('Colin', 'Cuilen', [1, 1, 2, 6, 24, 120, 720, 5040])
    744
    >>> Func('ATCG', 'TAGC', [1, 1, 2, 6, 24, 120, 720, 5040])
    6243

    """
    return Eudex().dist_abs(arg_0, arg_1, arg_2, arg_3, arg_4)

Calculate the Hamming distance between the Eudex hashes of two terms.

    This is a wrapper for :py:meth:`Eudex.eudex_hamming`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    weights : str, iterable, or generator function
        The weights or weights generator function
    max_length : int
        The number of characters to encode as a eudex hash
    normalized : bool
        Normalizes to [0, 1] if True

    Returns
    -------
    int
        The Eudex Hamming distance

    Examples
    --------
    >>> eudex_hamming('cat', 'hat')
    128
    >>> eudex_hamming('Niall', 'Neil')
    2
    >>> eudex_hamming('Colin', 'Cuilen')
    10
    >>> eudex_hamming('ATCG', 'TAGC')
    403

    >>> eudex_hamming('cat', 'hat', weights='fibonacci')
    34
    >>> eudex_hamming('Niall', 'Neil', weights='fibonacci')
    2
    >>> eudex_hamming('Colin', 'Cuilen', weights='fibonacci')
    7
    >>> eudex_hamming('ATCG', 'TAGC', weights='fibonacci')
    117

    >>> eudex_hamming('cat', 'hat', weights=None)
    1
    >>> eudex_hamming('Niall', 'Neil', weights=None)
    1
    >>> eudex_hamming('Colin', 'Cuilen', weights=None)
    2
    >>> eudex_hamming('ATCG', 'TAGC', weights=None)
    9

    >>> # Using the OEIS A000142:
    >>> eudex_hamming('cat', 'hat', [1, 1, 2, 6, 24, 120, 720, 5040])
    1
    >>> eudex_hamming('Niall', 'Neil', [1, 1, 2, 6, 24, 120, 720, 5040])
    720
    >>> eudex_hamming('Colin', 'Cuilen', [1, 1, 2, 6, 24, 120, 720, 5040])
    744
    >>> eudex_hamming('ATCG', 'TAGC', [1, 1, 2, 6, 24, 120, 720, 5040])
    6243

Calculate the Hamming distance between the Eudex hashes of two terms .


def Func ( arg_0 , arg_1 = None ) : arg_2 = None if arg_1 is not None : arg_2 = utils . unparse_range ( arg_1 ) arg_3 , arg_4 = arg_0 . command ( "XOVER" , arg_2 ) if arg_3 != 224 : raise NNTPReplyError ( arg_3 , arg_4 ) for arg_5 in arg_0 . info_gen ( arg_3 , arg_4 ) : yield arg_5 . rstrip ( ) . split ( "\t" )

def Func(arg_0, arg_1=None):
        """Generator for the XOVER command.

        The XOVER command returns information from the overview database for
        the article(s) specified.

        <http://tools.ietf.org/html/rfc2980#section-2.8>

        Args:
            range: An article number as an integer, or a tuple of specifying a
                range of article numbers in the form (first, [last]). If last is
                omitted then all articles after first are included. A range of
                None (the default) uses the current article.

        Returns:
            A list of fields as given by the overview database for each
            available article in the specified range. The fields that are
            returned can be determined using the LIST OVERVIEW.FMT command if
            the server supports it.

        Raises:
            NNTPReplyError: If no such article exists or the currently selected
                newsgroup is invalid.
        """
        arg_2 = None
        if arg_1 is not None:
            arg_2 = utils.unparse_range(arg_1)

        arg_3, arg_4 = arg_0.command("XOVER", arg_2)
        if arg_3 != 224:
            raise NNTPReplyError(arg_3, arg_4)

        for arg_5 in arg_0.info_gen(arg_3, arg_4):
            yield arg_5.rstrip().split("\t")


(doc, treebuilder="etree", encoding=None,
          namespaceHTMLElements=True)

def Func ( arg_0 , arg_1 = "etree" , arg_2 = None , arg_3 = True ) : arg_4 = treebuilders . getTreeBuilder ( arg_1 ) arg_5 = HTMLParser ( arg_4 , arg_3 = arg_3 ) return arg_5 . Func ( arg_0 , arg_2 = arg_2 )

def Func(arg_0, arg_1="etree", arg_2=None,
          arg_3=True):
    """Parse a string or file-like object into a tree"""
    arg_4 = treebuilders.getTreeBuilder(arg_1)
    arg_5 = HTMLParser(arg_4, arg_3=arg_3)
    return arg_5.Func(arg_0, arg_2=arg_2)

Parse a string or file - like object into a tree


(cls, connections, lastUsedIterationForSegment, cell,
                     iteration, maxSegmentsPerCell)

def Func(arg_0, arg_1, arg_2, arg_3,
                     arg_4, arg_5):
    """
    Create a segment on the connections, enforcing the maxSegmentsPerCell
    parameter.
    """
    # Enforce maxSegmentsPerCell.
    while arg_1.numSegments(arg_3) >= arg_5:
      arg_6 = min(
        arg_1.segmentsForCell(arg_3),
        key=lambda arg_7 : arg_2[arg_7.flatIdx])

      arg_1.destroySegment(arg_6)

    # Create the segment.
    arg_7 = arg_1.createSegment(arg_3)

    # Do TM-specific bookkeeping for the segment.
    if arg_7.flatIdx == len(arg_2):
      arg_2.append(arg_4)
    elif arg_7.flatIdx < len(arg_2):
      # A flatIdx was recycled.
      arg_2[arg_7.flatIdx] = arg_4
    else:
      raise AssertionError(
        "All segments should be created with the TM createSegment method.")

    return arg_7

Create a segment on the connections enforcing the maxSegmentsPerCell parameter .


def Func ( arg_0 , arg_1 ) -> Track : arg_1 = arg_1 . lower ( ) arg_2 = arg_0 . track_map . Func ( arg_1 ) if not arg_2 : arg_2 = Track ( arg_1 ) arg_0 . tacks . append ( arg_2 ) arg_0 . track_map [ arg_1 ] = arg_2 return arg_2

def Func(arg_0, arg_1) -> Track:
        """
        Get or create a Track object.

        :param name: Name of the track
        :return: Track object
        """
        arg_1 = arg_1.lower()
        arg_2 = arg_0.track_map.Func(arg_1)
        if not arg_2:
            arg_2 = Track(arg_1)
            arg_0.tacks.append(arg_2)
            arg_0.track_map[arg_1] = arg_2
        return arg_2


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
return
arg_2
=
arg_0
.
get
(
'aud'
)
if
arg_2
is
:
raise
AppIdentityError
(
'No aud field in token: {0}'
.
format
(
arg_0
)
)
if
arg_2
!=
arg_1
:
raise
AppIdentityError
(
'Wrong recipient, {0} != {1}: {2}'
.
format
(
arg_2
,
arg_1
,
arg_0
)
)

def Func(arg_0, arg_1):
    """Checks audience field from a JWT payload.

    Does nothing if the passed in ``audience`` is null.

    Args:
        payload_dict: dict, A dictionary containing a JWT payload.
        audience: string or NoneType, an audience to check for in
                  the JWT payload.

    Raises:
        AppIdentityError: If there is no ``'aud'`` field in the payload
                          dictionary but there is an ``audience`` to check.
        AppIdentityError: If the ``'aud'`` field in the payload dictionary
                          does not match the ``audience``.
    """
    if arg_1 is None:
        return

    arg_2 = arg_0.get('aud')
    if arg_2 is None:
        raise AppIdentityError(
            'No aud field in token: {0}'.format(arg_0))
    if arg_2 != arg_1:
        raise AppIdentityError('Wrong recipient, {0} != {1}: {2}'.format(
            arg_2, arg_1, arg_0))

Checks audience field from a JWT payload .


(transactions, market_data,
                                   last_n_days=None)

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = daily_txns_with_bar_data ( arg_0 , arg_1 ) arg_3 . index . name = 'date' arg_3 = arg_3 . reset_index ( ) if arg_2 is not None : arg_6 = arg_3 . date . max ( ) - pd . Timedelta ( days = arg_2 ) arg_3 = arg_3 [ arg_3 . date > arg_6 ] arg_7 = arg_3 . assign ( max_pct_bar_consumed = ( arg_3 . amount / arg_3 . volume ) * 100 ) . sort_values ( 'max_pct_bar_consumed' , ascending = False ) arg_8 = arg_7 . groupby ( 'symbol' ) . first ( ) return arg_8 [ [ 'date' , 'max_pct_bar_consumed' ] ]

def Func(arg_0, arg_1,
                                   arg_2=None):
    """
    For each traded name, find the daily transaction total that consumed
    the greatest proportion of available daily bar volume.

    Parameters
    ----------
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in create_full_tear_sheet.
    market_data : pd.Panel
        Panel with items axis of 'price' and 'volume' DataFrames.
        The major and minor axes should match those of the
        the passed positions DataFrame (same dates and symbols).
    last_n_days : integer
        Compute for only the last n days of the passed backtest data.
    """

    arg_3 = daily_txns_with_bar_data(arg_0, arg_1)
    arg_3.index.name = 'date'
    arg_3 = arg_3.reset_index()

    if arg_2 is not None:
        arg_6 = arg_3.date.max() - pd.Timedelta(days=arg_2)
        arg_3 = arg_3[arg_3.date > arg_6]

    arg_7 = arg_3.assign(
        max_pct_bar_consumed=(
            arg_3.amount/arg_3.volume)*100
    ).sort_values('max_pct_bar_consumed', ascending=False)
    arg_8 = arg_7.groupby('symbol').first()

    return arg_8[['date', 'max_pct_bar_consumed']]

For each traded name find the daily transaction total that consumed the greatest proportion of available daily bar volume .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Removes any update that would be for the given col, cellIdx, segIdx.

    NOTE: logically, we need to do this when we delete segments, so that if
    an update refers to a segment that was just deleted, we also remove
    that update from the update list. However, I haven't seen it trigger
    in any of the unit tests yet, so it might mean that it's not needed
    and that situation doesn't occur, by construction.
    """
    # TODO: check if the situation described in the docstring above actually
    #       occurs.
    for arg_4, arg_5 in arg_0.segmentUpdates.iteritems():
      arg_6, arg_7 = arg_4[0], arg_4[1]
      if arg_6 == arg_1 and arg_7 == arg_2:
        for arg_8 in arg_5:
          if arg_8[1].segment == arg_3:
            arg_0._removeSegmentUpdate(arg_8)

Removes any update that would be for the given col cellIdx segIdx .


(use_pypi=False, index='dev', build=True, user=None, version=None)

def Func(arg_0=False, arg_1='dev', arg_2=True, arg_3=None, arg_4=None):
    """
    Install the backend from the given devpi index at the given version on the target host and restart the service.

    If version is None, it defaults to the latest version

    Optionally, build and upload the application first from local sources. This requires a
    full backend development environment on the machine running this command (pyramid etc.)
    """
    get_vars()
    if value_asbool(arg_2):
        upload_backend(arg_1=arg_1, arg_3=arg_3)
    with fab.cd('{apphome}'.format(**AV)):
        if value_asbool(arg_0):
            arg_5 = 'bin/pip install --upgrade briefkasten'
        else:
            arg_5 = 'bin/pip install --upgrade --pre -i {ploy_default_publish_devpi}/briefkasten/{index}/+simple/ briefkasten'.format(
                arg_1=arg_1,
                arg_3=arg_3,
                **AV)
        if arg_4:
            arg_5 = '%s==%s' % (arg_5, arg_4)
        fab.sudo(arg_5)

    briefkasten_ctl('restart')

Install the backend from the given devpi index at the given version on the target host and restart the service .


(component, cluster, env, topology, role)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = metric_queries ( ) try : arg_6 = get_topology_metrics ( arg_1 , arg_2 , arg_3 , arg_0 , [ ] , arg_5 , [ 0 , - 1 ] , arg_4 ) return arg_6 [ "metrics" ] except Exception : Log . debug ( traceback . format_exc ( ) ) raise

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
  """Synced API call to get component metrics"""
  arg_5 = metric_queries()
  try:
    arg_6 = get_topology_metrics(arg_1, arg_2, arg_3, arg_0, [],
                                  arg_5, [0, -1], arg_4)
    return arg_6["metrics"]
  except Exception:
    Log.debug(traceback.format_exc())
    raise


(state, text, pattern=True, no_output_msg=None)

def Func(arg_0, arg_1, arg_2=True, arg_3=None):
    """Search student output for a pattern.

    Among the student and solution process, the student submission and solution code as a string,
    the ``Ex()`` state also contains the output that a student generated with his or her submission.

    With ``Func()``, you can access this output and match it against a regular or fixed expression.

    Args:
        text (str): the text that is searched for
        pattern (bool): if True (default), the text is treated as a pattern. If False, it is treated as plain text.
        no_output_msg (str): feedback message to be displayed if the output is not found.

    :Example:

        As an example, suppose we want a student to print out a sentence: ::

            # Print the "This is some ... stuff"
            print("This is some weird stuff")

        The following SCT tests whether the student prints out ``This is some weird stuff``: ::

            # Using exact string matching
            Ex().Func("This is some weird stuff", pattern = False)

            # Using a regular expression (more robust)
            # pattern = True is the default
            msg = "Print out ``This is some ... stuff`` to the output, " + \\
                  "fill in ``...`` with a word you like."
            Ex().Func(r"This is some \w* stuff", no_output_msg = msg)

    """
    if not arg_3:
        arg_3 = "You did not output the correct things."

    arg_4 = arg_0.build_message(arg_3)
    arg_0.do_test(StringContainsTest(arg_0.raw_student_output, arg_1, arg_2, arg_4))

    return arg_0

Search student output for a pattern.

    Among the student and solution process, the student submission and solution code as a string,
    the ``Ex()`` state also contains the output that a student generated with his or her submission.

    With ``has_output()``, you can access this output and match it against a regular or fixed expression.

    Args:
        text (str): the text that is searched for
        pattern (bool): if True (default), the text is treated as a pattern. If False, it is treated as plain text.
        no_output_msg (str): feedback message to be displayed if the output is not found.

    :Example:

        As an example, suppose we want a student to print out a sentence: ::

            # Print the "This is some ... stuff"
            print("This is some weird stuff")

        The following SCT tests whether the student prints out ``This is some weird stuff``: ::

            # Using exact string matching
            Ex().has_output("This is some weird stuff", pattern = False)

            # Using a regular expression (more robust)
            # pattern = True is the default
            msg = "Print out ``This is some ... stuff`` to the output, " + \\
                  "fill in ``...`` with a word you like."
            Ex().has_output(r"This is some \w* stuff", no_output_msg = msg)


def Func ( arg_0 ) : arg_1 = arg_0 . invoice . cart if arg_1 : arg_1 . status = commerce . Cart . STATUS_PAID arg_1 . save ( ) arg_0 . invoice . status = commerce . Invoice . STATUS_PAID arg_0 . invoice . save ( )

def Func(arg_0):
        ''' Marks the invoice as paid, and updates the attached cart if
        necessary. '''
        arg_1 = arg_0.invoice.cart
        if arg_1:
            arg_1.status = commerce.Cart.STATUS_PAID
            arg_1.save()
        arg_0.invoice.status = commerce.Invoice.STATUS_PAID
        arg_0.invoice.save()

Marks the invoice as paid and updates the attached cart if necessary .


def Func(arg_0, arg_1):
    """Retrives the optimization key name and optimization function.

    Parameters:
    ---------------------------------------------------------
    searchJobParams:
                    Parameter for passing as the searchParams arg to
                    Hypersearch constructor.
    retval:       (optimizationMetricKey, maximize)
                  optimizationMetricKey: which report key to optimize for
                  maximize: True if we should try and maximize the optimizeKey
                    metric. False if we should minimize it.
    """
    if arg_1["hsVersion"] == "v2":
      arg_2 = HypersearchV2(searchParams=arg_1)
    else:
      raise RuntimeError("Unsupported hypersearch version \"%s\"" % \
                         (arg_1["hsVersion"]))

    arg_3 = arg_2.Func()
    return arg_3

Retrives the optimization key name and optimization function .


(bVk: int, bScan: int, dwFlags: int, dwExtraInfo: int)

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1, arg_4: arg_1) -> None:
    """Func from Win32."""
    ctypes.windll.user32.Func(arg_0, arg_2, arg_3, arg_4)


(self, shape, body_a, body_b=None, name=None, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, **arg_5):
        '''Create a new Funct that connects two bodies together.

        Parameters
        ----------
        shape : str
            The "shape" of the Funct to use for Funcing together two bodies.
            This should name a type of Funct, such as "ball" or "piston".
        body_a : str or :class:`Body`
            The first body to Func together with this Funct. If a string is
            given, it will be used as the name of a body to look up in the
            world.
        body_b : str or :class:`Body`, optional
            If given, identifies the second body to Func together with
            ``body_a``. If not given, ``body_a`` is Funced to the world.
        name : str, optional
            If given, use this name for the created Funct. If not given, a name
            will be constructed of the form
            "{body_a.name}^{shape}^{body_b.name}".

        Returns
        -------
        Funct : :class:`Joint`
            The Funct object that was created.
        '''
        arg_6 = arg_0.get_body(arg_2)
        arg_7 = arg_0.get_body(arg_3)
        arg_1 = arg_1.lower()
        if arg_4 is None:
            arg_4 = '{}^{}^{}'.format(arg_6.name, arg_1, arg_7.name if arg_7 else '')
        arg_0._Functs[arg_4] = Joint.build(
            arg_1, arg_4, arg_0, arg_2=arg_6, arg_3=arg_7, **arg_5)
        return arg_0._Functs[arg_4]

Create a new joint that connects two bodies together.

        Parameters
        ----------
        shape : str
            The "shape" of the joint to use for joining together two bodies.
            This should name a type of joint, such as "ball" or "piston".
        body_a : str or :class:`Body`
            The first body to join together with this joint. If a string is
            given, it will be used as the name of a body to look up in the
            world.
        body_b : str or :class:`Body`, optional
            If given, identifies the second body to join together with
            ``body_a``. If not given, ``body_a`` is joined to the world.
        name : str, optional
            If given, use this name for the created joint. If not given, a name
            will be constructed of the form
            "{body_a.name}^{shape}^{body_b.name}".

        Returns
        -------
        joint : :class:`Joint`
            The joint object that was created.

Create a new joint that connects two bodies together .


(store, institute_id, case_name, stream)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
,
arg_5
=
institute_and_case
(
arg_0
,
arg_1
,
arg_2
)
arg_6
=
[
line
.
strip
(
)
.
split
(
'\t'
)
[
0
]
for
line
in
arg_3
if
line
and
not
line
.
startswith
(
'#'
)
]
arg_7
=
[
]
for
arg_8
in
arg_6
:
if
arg_0
.
hgnc_genes
(
arg_8
)
.
count
(
)
==
0
:
flash
(
"HGNC symbol not found: {}"
.
format
(
arg_8
)
,
'warning'
)
else
:
arg_7
.
append
(
arg_8
)
return
arg_7

def Func(arg_0, arg_1, arg_2, arg_3):
    """Parse out HGNC symbols from a stream."""
    arg_4, arg_5 = institute_and_case(arg_0, arg_1, arg_2)
    arg_6 = [line.strip().split('\t')[0] for line in arg_3 if
                   line and not line.startswith('#')]
    # check if supplied gene symbols exist
    arg_7 = []
    for arg_8 in arg_6:
        if arg_0.hgnc_genes(arg_8).count() == 0:
            flash("HGNC symbol not found: {}".format(arg_8), 'warning')
        else:
            arg_7.append(arg_8)
    return arg_7


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_extr_lic ( arg_1 ) : if not arg_0 . extr_text_set : arg_0 . extr_text_set = True if validations . validate_is_free_form_text ( arg_2 ) : arg_0 . extr_lic ( arg_1 ) . text = str_from_text ( arg_2 ) return True else : raise SPDXValueError ( 'ExtractedLicense::text' ) else : raise CardinalityError ( 'ExtractedLicense::text' ) else : raise OrderError ( 'ExtractedLicense::text' )

def Func(arg_0, arg_1, arg_2):
        """Sets license extracted text.
        Raises SPDXValueError if text is not free form text.
        Raises OrderError if no license ID defined.
        """
        if arg_0.has_extr_lic(arg_1):
            if not arg_0.extr_text_set:
                arg_0.extr_text_set = True
                if validations.validate_is_free_form_text(arg_2):
                    arg_0.extr_lic(arg_1).text = str_from_text(arg_2)
                    return True
                else:
                    raise SPDXValueError('ExtractedLicense::text')
            else:
                raise CardinalityError('ExtractedLicense::text')
        else:
            raise OrderError('ExtractedLicense::text')

Sets license extracted text . Raises SPDXValueError if text is not free form text . Raises OrderError if no license ID defined .


def
Func
(
arg_0
)
:
arg_1
=
inspect
.
getargspec
(
arg_0
)
arg_2
=
arg_0
.
__doc__
arg_3
=
{
}
if
arg_2
:
arg_4
=
arg_2
.
split
(
'\n'
)
arg_5
=
0
while
arg_5
<
len
(
arg_4
)
:
arg_6
=
arg_4
[
arg_5
]
.
lstrip
(
)
if
not
arg_6
:
arg_5
+=
1
continue
arg_7
=
arg_4
[
arg_5
]
.
index
(
arg_6
[
0
]
)
arg_8
=
arg_6
.
split
(
)
[
0
]
if
arg_8
.
endswith
(
':'
)
:
arg_8
=
arg_8
[
:
1
]
if
arg_8
in
arg_1
.
args
:
arg_9
=
arg_8
arg_10
=
arg_6
[
len
(
arg_8
)
+
1
:
]
.
strip
(
)
arg_11
=
[
arg_10
]
arg_5
+=
1
while
arg_5
<
len
(
arg_4
)
:
arg_6
=
arg_4
[
arg_5
]
.
lstrip
(
)
if
not
arg_6
:
break
if
arg_4
[
arg_5
]
.
index
(
arg_6
[
0
]
)
<=
arg_7
:
break
arg_11
.
append
(
arg_4
[
arg_5
]
.
strip
(
)
)
arg_5
+=
1
arg_3
[
arg_9
]
=
' '
.
join
(
arg_11
)
else
:
arg_5
+=
1
arg_12
=
[
]
if
arg_1
.
defaults
:
arg_13
=
len
(
arg_1
.
defaults
)
else
:
arg_13
=
0
arg_14
=
len
(
arg_1
.
args
)
arg_13
for
arg_5
,
arg_9
in
enumerate
(
arg_1
.
args
)
:
if
arg_5
>=
arg_14
:
arg_15
=
arg_1
.
defaults
[
arg_5
arg_14
]
arg_12
.
append
(
(
arg_9
,
arg_3
.
get
(
arg_9
,
""
)
,
arg_15
)
)
else
:
arg_12
.
append
(
(
arg_9
,
arg_3
.
get
(
arg_9
,
""
)
)
)
return
arg_12

def Func(arg_0):
  """
  Get the arguments, default values, and argument descriptions for a function.

  Parses the argument descriptions out of the function docstring, using a
  format something lke this:

  ::

    [junk]
    argument_name:     description...
      description...
      description...
    [junk]
    [more arguments]

  It will find an argument as long as the exact argument name starts the line.
  It will then strip a trailing colon, if present, then strip the rest of the
  line and use it to start the description. It will then strip and append any
  subsequent lines with a greater indent level than the original argument name.

  :param f: (function) to inspect
  :returns: (list of tuples) (``argName``, ``argDescription``, ``defaultValue``)
    If an argument has no default value, the tuple is only two elements long (as
    ``None`` cannot be used, since it could be a default value itself).
  """

  # Get the argument names and default values
  arg_1 = inspect.getargspec(arg_0)

  # Scan through the docstring to extract documentation for each argument as
  # follows:
  #   Check the first word of the line, stripping a colon if one is present.
  #   If it matches an argument name:
  #    Take the rest of the line, stripping leading whitespeace
  #    Take each subsequent line if its indentation level is greater than the
  #      initial indentation level
  #    Once the indentation level is back to the original level, look for
  #      another argument
  arg_2 = arg_0.__doc__
  arg_3 = {}
  if arg_2:
    arg_4 = arg_2.split('\n')
    arg_5 = 0
    while arg_5 < len(arg_4):
      arg_6 = arg_4[arg_5].lstrip()
      if not arg_6:
        arg_5 += 1
        continue
      # Indentation level is index of the first character
      arg_7 = arg_4[arg_5].index(arg_6[0])
      # Get the first word and remove the colon, if present
      arg_8 = arg_6.split()[0]
      if arg_8.endswith(':'):
        arg_8 = arg_8[:-1]
      if arg_8 in arg_1.args:
        # Found an argument
        arg_9 = arg_8
        arg_10 = arg_6[len(arg_8)+1:].strip()
        arg_11 = [arg_10]
        # Take the next lines as long as they are indented more
        arg_5 += 1
        while arg_5 < len(arg_4):
          arg_6 = arg_4[arg_5].lstrip()
          if not arg_6:
            # Empty line - stop
            break
          if arg_4[arg_5].index(arg_6[0]) <= arg_7:
            # No longer indented far enough - stop
            break
          # This line counts too
          arg_11.append(arg_4[arg_5].strip())
          arg_5 += 1
        # Store this description
        arg_3[arg_9] = ' '.join(arg_11)
      else:
        # Not an argument
        arg_5 += 1

  # Build the list of (argName, description, defaultValue)
  arg_12 = []
  if arg_1.defaults:
    arg_13 = len(arg_1.defaults)
  else:
    arg_13 = 0
  arg_14 = len(arg_1.args) - arg_13
  for arg_5, arg_9 in enumerate(arg_1.args):
    if arg_5 >= arg_14:
      arg_15 = arg_1.defaults[arg_5 - arg_14]
      arg_12.append((arg_9, arg_3.get(arg_9, ""), arg_15))
    else:
      arg_12.append((arg_9, arg_3.get(arg_9, "")))

  return arg_12

Get the arguments default values and argument descriptions for a function .


return ('%s '
                '%s%s
'
                '%s'
                % (url, id(obj), prettytype, key, get_repr(obj, 100))
                )

def Func(arg_0, arg_1, arg_2=None):
        """Return an HTML tree block describing the given object."""
        arg_3 = type(arg_1)
        arg_4 = str(arg_3.__module__) + "." + arg_3.__name__
        arg_5 = arg_4.replace("__builtin__.", "")

        arg_6 = getattr(arg_1, "__name__", "")
        if arg_6:
            arg_5 = "%s %r" % (arg_5, arg_6)

        arg_7 = ""
        if arg_2:
            arg_7 = arg_0.get_refkey(arg_1, arg_2)
        arg_8 = reverse('dowser_trace_object', args=(
            arg_4,
            id(arg_1)
        ))
        return ('%s '
                '%s%s
'
                '%s'
                % (arg_8, id(arg_1), arg_5, arg_7, Func(arg_1, 100))
                )

Return an HTML tree block describing the given object .


def Func(arg_0, arg_1):
    """ Compose projects.json with all data sources

    :param projects: projects.json
    :param data: eclipse JSON
    :return: projects.json with all data sources
    """
    arg_0 = compose_git(arg_0, arg_1)
    arg_0 = compose_mailing_lists(arg_0, arg_1)
    arg_0 = compose_bugzilla(arg_0, arg_1)
    arg_0 = compose_github(arg_0, arg_1)
    arg_0 = compose_gerrit(arg_0)
    arg_0 = compose_mbox(arg_0)

    return arg_0

Compose projects . json with all data sources


return str(bytearray((0x80, level_low, dir_low, 0x82, level_high, dir_high)))

def Func(arg_0):
        """Return command to update the MPSSE GPIO state to the current direction
        and level.
        """
        arg_1  = chr(arg_0._level & 0xFF)
        arg_2 = chr((arg_0._level >> 8) & 0xFF)
        arg_3  = chr(arg_0._direction & 0xFF)
        arg_4 = chr((arg_0._direction >> 8) & 0xFF)
        return str(bytearray((0x80, arg_1, arg_3, 0x82, arg_2, arg_4)))

Return command to update the MPSSE GPIO state to the current direction and level .


(self, result=None, harmless_age=None, threat_score=None, threat_type=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_2 = arg_2 if arg_2 is not None else settings . CACHED_HTTPBL_HARMLESS_AGE arg_3 = arg_3 if arg_3 is not None else settings . CACHED_HTTPBL_THREAT_SCORE arg_4 = arg_4 if arg_4 is not None else - 1 arg_1 = arg_1 if arg_1 is not None else arg_0 . _last_result arg_5 = False if arg_1 is not None : if arg_1 [ 'age' ] < arg_2 and arg_1 [ 'threat' ] > arg_3 : arg_5 = True if arg_4 > - 1 : if arg_1 [ 'type' ] & arg_4 : arg_5 = True else : arg_5 = False return arg_5

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Check if IP is a threat

        :param result: httpBL results; if None, then results from last check_ip() used (optional)
        :param harmless_age: harmless age for check if httpBL age is older (optional)
        :param threat_score: threat score for check if httpBL threat is lower (optional)
        :param threat_type:  threat type, if not equal httpBL score type, then return False (optional)
        :return: True or False
        """

        arg_2 = arg_2 if arg_2 is not None else settings.CACHED_HTTPBL_HARMLESS_AGE
        arg_3 = arg_3 if arg_3 is not None else settings.CACHED_HTTPBL_THREAT_SCORE
        arg_4 = arg_4 if arg_4 is not None else -1
        arg_1 = arg_1 if arg_1 is not None else arg_0._last_result
        arg_5 = False
        if arg_1 is not None:
            if arg_1['age'] < arg_2 and arg_1['threat'] > arg_3:
                arg_5 = True
            if arg_4 > -1:
                if arg_1['type'] & arg_4:
                    arg_5 = True
                else:
                    arg_5 = False
        return arg_5


def Func ( arg_0 ) : arg_1 = re . compile ( 'SHA1:\s*([\S]+)' , re . UNICODE ) arg_2 = arg_1 . match ( arg_0 ) if arg_2 : return checksum . Algorithm ( identifier = 'SHA1' , arg_0 = arg_2 . group ( 1 ) ) else : return None

def Func(arg_0):
    """
    Return an spdx.checksum.Algorithm instance representing the SHA1
    checksum or None if does not match CHECKSUM_RE.
    """
    # More constrained regex at lexer level
    arg_1 = re.compile('SHA1:\s*([\S]+)', re.UNICODE)
    arg_2 = arg_1.match(arg_0)
    if arg_2:
        return checksum.Algorithm(identifier='SHA1', arg_0=arg_2.group(1))
    else:
        return None

Return an spdx . checksum . Algorithm instance representing the SHA1 checksum or None if does not match CHECKSUM_RE .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : arg_4 = False for arg_5 in arg_2 : if str ( arg_5 ) == str ( arg_3 ) : arg_4 = True break if not arg_4 : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """
        Not performant but works.
        """
        # order preserving
        arg_2 = []
        for arg_3 in arg_1:
            arg_4 = False
            for arg_5 in arg_2:
                if str(arg_5) == str(arg_3):
                    arg_4 = True
                    break
            if not arg_4:
                arg_2.append(arg_3)
        return arg_2


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
"Func %s for tenant %s"
%
(
arg_1
,
arg_0
.
tenant_id
)
)
if
not
arg_0
.
is_admin
:
raise
n_exc
.
NotAuthorized
(
)
with
arg_0
.
session
.
begin
(
)
:
arg_2
=
db_api
.
segment_allocation_range_find
(
arg_0
,
id
=
arg_1
,
scope
=
db_api
.
ONE
)
if
not
arg_2
:
raise
q_exc
.
SegmentAllocationRangeNotFound
(
segment_allocation_range_id
=
arg_1
)
_Func
(
arg_0
,
arg_2
)

def Func(arg_0, arg_1):
    """Delete a segment_allocation_range.

    : param context: neutron api request context
    : param id: UUID representing the segment_allocation_range to delete.
    """
    LOG.info("Func %s for tenant %s" %
             (arg_1, arg_0.tenant_id))
    if not arg_0.is_admin:
        raise n_exc.NotAuthorized()

    with arg_0.session.begin():
        arg_2 = db_api.segment_allocation_range_find(
            arg_0, id=arg_1, scope=db_api.ONE)
        if not arg_2:
            raise q_exc.SegmentAllocationRangeNotFound(
                segment_allocation_range_id=arg_1)
        _Func(arg_0, arg_2)


def Func ( arg_0 ) : from math import atan , pi , degrees arg_1 = degrees ( atan ( arg_0 . vy / arg_0 . vx ) ) + 360 if arg_0 . vx < 0 : arg_1 += 180 return arg_1

def Func(arg_0):

        """ Returns the angle towards which the boid is steering.
        """

        from math import atan, pi, degrees
        arg_1 = degrees(atan(arg_0.vy/arg_0.vx)) + 360
        if arg_0.vx < 0: arg_1 += 180

        return arg_1

Returns the angle towards which the boid is steering .


def Func(arg_0, arg_1="default", arg_2=None):
        """Undo selection, for the name."""
        logger.debug("undo")
        arg_2 = arg_2 or arg_0.executor
        assert arg_0.selection_can_undo(arg_1=arg_1)
        arg_3 = arg_0.selection_histories[arg_1]
        arg_4 = arg_0.selection_history_indices[arg_1]
        arg_0.selection_history_indices[arg_1] -= 1
        arg_0.signal_selection_changed.emit(arg_0)
        logger.debug("undo: selection history is %r, index is %r", arg_3, arg_0.selection_history_indices[arg_1])


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = sys . argv [ 1 : ] if not arg_0 or arg_0 [ 0 ] not in { "run" , "transform" } : arg_0 = [ "run" ] + arg_0 arg_1 = _clean ( _Funcr . Func_args ( arg_0 ) ) return arg_1

def Func(arg_0=None):
    """
    Parse some arguments using the Funcr.

    """

    if arg_0 is None:
        arg_0 = sys.argv[1:]

    # Evade http://bugs.python.org/issue9253
    if not arg_0 or arg_0[0] not in {"run", "transform"}:
        arg_0 = ["run"] + arg_0

    arg_1 = _clean(_Funcr.Func_args(arg_0))
    return arg_1


(self, service_name, deployment_name, dns_server_name, address)

return self._perform_put(
            self._get_dns_server_path(service_name,
                                      deployment_name,
                                      dns_server_name),
            _XmlSerializer.dns_server_to_xml(dns_server_name, address),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''
        Updates the ip address of a DNS server.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        dns_server_name:
            Specifies the name of the DNS server.
        address:
            Specifies the IP address of the DNS server.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('dns_server_name', arg_3)
        _validate_not_none('address', arg_4)
        return arg_0._perform_put(
            arg_0._get_dns_server_path(arg_1,
                                      arg_2,
                                      arg_3),
            _XmlSerializer.dns_server_to_xml(arg_3, arg_4),
            as_async=True)

Updates the ip address of a DNS server .


(self, fileobj, transfer_coordinator,
                                    enabled=True)

def Func(arg_0, arg_1, arg_2,
                                    arg_3=True):
        """Wraps a fileobj in a bandwidth limited stream wrapper

        :type fileobj: file-like obj
        :param fileobj: The file-like obj to wrap

        :type transfer_coordinator: s3transfer.futures.TransferCoordinator
        param transfer_coordinator: The coordinator for the general transfer
            that the wrapped stream is a part of

        :type enabled: boolean
        :param enabled: Whether bandwidth limiting should be enabled to start
        """
        arg_4 = BandwidthLimitedStream(
            arg_1, arg_0._leaky_bucket, arg_2,
            arg_0._time_utils)
        if not arg_3:
            arg_4.disable_bandwidth_limiting()
        return arg_4


def Func ( arg_0 , arg_1 = None ) : arg_2 = len ( arg_0 ) if arg_1 is None : arg_3 = dict ( zip ( reversed ( arg_0 ) , reversed ( range ( arg_2 ) ) ) ) arg_4 = arg_3 . values ( ) else : arg_4 = argunique ( arg_0 , arg_1 = arg_1 ) arg_5 = boolmask ( arg_4 , arg_2 ) return arg_5

def Func(arg_0, arg_1=None):
    """
    Returns a list of booleans corresponding to the first instance of each
    unique item.

    Args:
        items (Sequence): indexable collection of items

        key (Callable, optional): custom normalization function.
            If specified returns items where `key(item)` is unique.

    Returns:
        List[bool] : flags the items that are unique

    Example:
        >>> import ubelt as ub
        >>> items = [0, 2, 1, 1, 0, 9, 2]
        >>> flags = Func(items)
        >>> assert flags == [True, True, True, False, False, True, False]
        >>> flags = Func(items, key=lambda x: x % 2 == 0)
        >>> assert flags == [True, False, True, False, False, False, False]
    """
    arg_2 = len(arg_0)
    if arg_1 is None:
        arg_3 = dict(zip(reversed(arg_0), reversed(range(arg_2))))
        arg_4 = arg_3.values()
    else:
        arg_4 = argunique(arg_0, arg_1=arg_1)
    arg_5 = boolmask(arg_4, arg_2)
    return arg_5

Returns a list of booleans corresponding to the first instance of each
    unique item.

    Args:
        items (Sequence): indexable collection of items

        key (Callable, optional): custom normalization function.
            If specified returns items where `key(item)` is unique.

    Returns:
        List[bool] : flags the items that are unique

    Example:
        >>> import ubelt as ub
        >>> items = [0, 2, 1, 1, 0, 9, 2]
        >>> flags = unique_flags(items)
        >>> assert flags == [True, True, True, False, False, True, False]
        >>> flags = unique_flags(items, key=lambda x: x % 2 == 0)
        >>> assert flags == [True, False, True, False, False, False, False]

Returns a list of booleans corresponding to the first instance of each unique item .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
os
.
path
.
join
(
arg_0
.
dirs
.
outfiles
,
"tmp-{}.h5"
.
format
(
arg_0
.
name
)
)
with
h5py
.
File
(
arg_3
,
'r'
)
as
io5
:
arg_4
=
io5
[
"bisarr"
]
arg_5
=
np
.
where
(
np
.
all
(
arg_4
[
:
]
==
""
,
axis
=
0
)
)
[
0
]
if
np
.
any
(
arg_5
)
:
arg_5
=
arg_5
.
min
(
)
else
:
arg_5
=
arg_4
.
shape
[
1
]
with
open
(
arg_0
.
outfiles
.
usnpsphy
,
'w'
)
as
out
:
out
.
write
(
"{} {}\n"
.
format
(
arg_4
.
shape
[
0
]
,
arg_5
)
)
for
arg_6
,
arg_7
in
enumerate
(
arg_2
)
:
out
.
write
(
"{}{}\n"
.
format
(
arg_7
,
""
.
join
(
arg_4
[
arg_6
,
:
arg_5
]
)
)
)

def Func(arg_0, arg_1, arg_2):
    """ write the bisnp string """

    ## grab bis data from tmparr
    arg_3 = os.path.join(arg_0.dirs.outfiles, "tmp-{}.h5".format(arg_0.name))
    with h5py.File(arg_3, 'r') as io5:
        arg_4 = io5["bisarr"]

        ## trim to size b/c it was made longer than actual
        arg_5 = np.where(np.all(arg_4[:] == "", axis=0))[0]
        if np.any(arg_5):
            arg_5 = arg_5.min()
        else:
            arg_5 = arg_4.shape[1]

        ## write to usnps file
        with open(arg_0.outfiles.usnpsphy, 'w') as out:
            out.write("{} {}\n".format(arg_4.shape[0], arg_5))
            for arg_6, arg_7 in enumerate(arg_2):
                out.write("{}{}\n".format(arg_7, "".join(arg_4[arg_6, :arg_5])))


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _acl : return False arg_0 . _acl [ arg_1 ] = { 'allow' : [ ] , 'deny' : [ ] } return True

def Func(arg_0, arg_1):
        """Create a new acl."""
        if arg_1 in arg_0._acl:
            return False

        arg_0._acl[arg_1] = {
            'allow': [],
            'deny': []
        }
        return True


def Func(arg_0, arg_1=''):
    """
    Horizontally concatenates strings preserving indentation

    Concatenates a list of objects ensuring that the next item in the list is
    all the way to the right of any previous items.

    Args:
        args (List[str]): strings to concatenate
        sep (str): separator (defaults to '')

    CommandLine:
        python -m ubelt.util_str Func

    Example1:
        >>> import ubelt as ub
        >>> B = ub.repr2([[1, 2], [3, 457]], nl=1, cbr=True, trailsep=False)
        >>> C = ub.repr2([[5, 6], [7, 8]], nl=1, cbr=True, trailsep=False)
        >>> args = ['A = ', B, ' * ', C]
        >>> print(ub.Func(args))
        A = [[1, 2],   * [[5, 6],
             [3, 457]]    [7, 8]]

    Example2:
        >>> from ubelt.util_str import *
        >>> import ubelt as ub
        >>> import unicodedata
        >>> aa = unicodedata.normalize('NFD', 'á')  # a unicode char with len2
        >>> B = ub.repr2([['θ', aa], [aa, aa, aa]], nl=1, si=True, cbr=True, trailsep=False)
        >>> C = ub.repr2([[5, 6], [7, 'θ']], nl=1, si=True, cbr=True, trailsep=False)
        >>> args = ['A', '=', B, '*', C]
        >>> print(ub.Func(args, sep='｜'))
        A｜=｜[[θ, á],   ｜*｜[[5, 6],
         ｜ ｜ [á, á, á]]｜ ｜ [7, θ]]
    """
    import unicodedata
    if '\n' in arg_1 or '\r' in arg_1:
        raise ValueError('`sep` cannot contain newline characters')

    # TODO: ensure unicode data works correctly for python2
    arg_0 = [unicodedata.normalize('NFC', ensure_unicode(val)) for val in arg_0]
    arg_2 = [a.split('\n') for a in arg_0]
    arg_3 = max(map(len, arg_2))
    # Do vertical padding
    arg_2 = [arg_8 + [''] * (arg_3 - len(arg_8)) for arg_8 in arg_2]
    # Initialize output
    arg_4 = ['' for _ in range(arg_3)]
    arg_5 = 0
    arg_6 = len(arg_0)
    for arg_7, arg_8 in enumerate(arg_2):
        # Concatenate the new string
        for arg_9, arg_10 in enumerate(arg_8):
            arg_4[arg_9] += arg_10
        # Find the new maximum horizontal width
        arg_5 = max(arg_5, max(map(len, arg_4)))
        if arg_7 < arg_6 - 1:
            # Horizontal padding on all but last iter
            for arg_9, arg_10 in list(enumerate(arg_4)):
                arg_11 = arg_5 - len(arg_10)
                arg_4[arg_9] = arg_10 + (' ' * arg_11) + arg_1
            arg_5 += len(arg_1)
    # Clean up trailing whitespace
    arg_4 = [arg_10.rstrip(' ') for arg_10 in arg_4]
    arg_12 = '\n'.join(arg_4)
    return arg_12

Horizontally concatenates strings preserving indentation

    Concatenates a list of objects ensuring that the next item in the list is
    all the way to the right of any previous items.

    Args:
        args (List[str]): strings to concatenate
        sep (str): separator (defaults to '')

    CommandLine:
        python -m ubelt.util_str hzcat

    Example1:
        >>> import ubelt as ub
        >>> B = ub.repr2([[1, 2], [3, 457]], nl=1, cbr=True, trailsep=False)
        >>> C = ub.repr2([[5, 6], [7, 8]], nl=1, cbr=True, trailsep=False)
        >>> args = ['A = ', B, ' * ', C]
        >>> print(ub.hzcat(args))
        A = [[1, 2],   * [[5, 6],
             [3, 457]]    [7, 8]]

    Example2:
        >>> from ubelt.util_str import *
        >>> import ubelt as ub
        >>> import unicodedata
        >>> aa = unicodedata.normalize('NFD', 'á')  # a unicode char with len2
        >>> B = ub.repr2([['θ', aa], [aa, aa, aa]], nl=1, si=True, cbr=True, trailsep=False)
        >>> C = ub.repr2([[5, 6], [7, 'θ']], nl=1, si=True, cbr=True, trailsep=False)
        >>> args = ['A', '=', B, '*', C]
        >>> print(ub.hzcat(args, sep='｜'))
        A｜=｜[[θ, á],   ｜*｜[[5, 6],
         ｜ ｜ [á, á, á]]｜ ｜ [7, θ]]


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . Func_cache arg_3 = arg_0 . string if arg_2 == arg_3 : return arg_1 arg_1 = fullmatch ( LIST_PATTERN_FORMAT . replace ( b'{pattern}' , arg_0 . pattern . encode ( ) ) , arg_0 . _shadow , MULTILINE , ) arg_0 . Func_cache = arg_1 , arg_3 return arg_1

def Func(arg_0):
        """Return the match object for the current list."""
        arg_1, arg_2 = arg_0.Func_cache
        arg_3 = arg_0.string
        if arg_2 == arg_3:
            return arg_1
        arg_1 = fullmatch(
            LIST_PATTERN_FORMAT.replace(b'{pattern}', arg_0.pattern.encode()),
            arg_0._shadow,
            MULTILINE,
        )
        arg_0.Func_cache = arg_1, arg_3
        return arg_1

Return the match object for the current list .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
'en'
)
:
arg_3
=
urljoin
(
arg_0
.
concept_service
+
'/'
,
arg_1
)
arg_4
,
arg_5
=
arg_0
.
get
(
arg_3
,
params
=
{
'lang'
:
arg_2
}
)
if
arg_5
!=
200
:
logger
.
debug
(
'Fetch concept failed.'
)
return
arg_0
.
decode
(
arg_4
)
,
arg_5

def Func(arg_0, arg_1, arg_2='en'):
        """ Fetch the concept from the Knowledge base

        Args:
              id (str): The concept id to be fetched, it can be Wikipedia
                page id or Wikiedata id.

        Returns:
            dict, int: A dict containing the concept information; an integer
                representing the response code.
        """
        arg_3 = urljoin(arg_0.concept_service + '/', arg_1)

        arg_4, arg_5 = arg_0.get(arg_3, params={'lang': arg_2})

        if arg_5 != 200:
            logger.debug('Fetch concept failed.')

        return arg_0.decode(arg_4), arg_5


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = 'POST' arg_4 = 'item/resource/%s' % arg_2 arg_5 = { 'apply' : [ { 'id' : arg_1 } ] } arg_0 . __request__ ( arg_3 , arg_4 , arg_5 = json . dumps ( arg_5 ) )

def Func(arg_0, arg_1, arg_2):
        """Apply consumable on player.

        :params item_id: Item id of player.
        :params resource_id: Resource id of consumable.
        """
        # TODO: catch exception when consumable is not found etc.
        # TODO: multiple players like in quickSell
        arg_3 = 'POST'
        arg_4 = 'item/resource/%s' % arg_2

        arg_5 = {'apply': [{'id': arg_1}]}
        arg_0.__request__(arg_3, arg_4, arg_5=json.dumps(arg_5))


def Func(arg_0, arg_1=None, arg_2=None):
        """
        Creates a transformation matrix woth rotations and translation.

        Args:
            rotation: 3 component vector as a list, tuple, or :py:class:`pyrr.Vector3`
            translation: 3 component vector as a list, tuple, or :py:class:`pyrr.Vector3`

        Returns:
            A 4x4 matrix as a :py:class:`numpy.array`
        """
        arg_3 = None
        if arg_1 is not None:
            arg_3 = Matrix44.from_eulers(Vector3(arg_1))

        if arg_2 is not None:
            arg_4 = matrix44.create_from_translation(Vector3(arg_2))
            if arg_3 is None:
                arg_3 = arg_4
            else:
                arg_3 = matrix44.multiply(arg_3, arg_4)

        return arg_3

Creates a transformation matrix woth rotations and translation .


def Func ( arg_0 ) : arg_1 = arg_0 . __class__ ( arg_0 . x , arg_0 . y ) arg_1 . set_bounds ( arg_0 . xmin , arg_0 . ymin , arg_0 . xmax , arg_0 . ymax , arg_0 . ymaxmax ) arg_1 . set_deltas ( arg_0 . dx , arg_0 . dy ) return arg_1

def Func(arg_0):
        """ Create a Func, and return it."""
        arg_1 = arg_0.__class__(arg_0.x, arg_0.y)
        arg_1.set_bounds(arg_0.xmin, arg_0.ymin, arg_0.xmax, arg_0.ymax, arg_0.ymaxmax)
        arg_1.set_deltas(arg_0.dx, arg_0.dy)
        return arg_1


(self, sequence_numbers, mode=ReceiveSettleMode.PeekLock, **kwargs)

def Func(arg_0, arg_1, arg_2=arg_3.PeekLock, **arg_5):
        """Receive messages by sequence number that have been previously deferred.

        When receiving deferred messages from a partitioned entity, all of the supplied
        sequence numbers must be messages from the same partition.

        :param sequence_numbers: A list of the sequence numbers of messages that have been
         deferred.
        :type sequence_numbers: list[int]
        :param mode: The mode with which messages will be retrieved from the entity. The two options
         are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
         lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
         will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
         the client fails to process the message. The default mode is PeekLock.
        :type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
        :rtype: list[~azure.servicebus.common.message.Message]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func_service_bus]
                :end-before: [END Func_service_bus]
                :language: python
                :dedent: 8
                :caption: Get the messages which were deferred using their sequence numbers

        """
        if (arg_0.entity and arg_0.requires_session) or arg_5.get('session'):
            raise ValueError("Sessionful deferred messages can only be received within a locked receive session.")
        if not arg_1:
            raise ValueError("At least one sequence number must be specified.")
        try:
            arg_6 = arg_2.value.value
        except AttributeError:
            arg_6 = int(arg_2)
        arg_7 = {
            'sequence-numbers': types.AMQPArray([types.AMQPLong(s) for s in arg_1]),
            'receiver-settle-mode': types.AMQPuInt(arg_6)}
        arg_8 = functools.partial(mgmt_handlers.deferred_message_op, arg_2=arg_6)
        with BaseHandler(arg_0.entity_uri, arg_0.auth_config, debug=arg_0.debug, **arg_5) as handler:
            return handler._mgmt_request_response(  # pylint: disable=protected-access
                REQUEST_RESPONSE_RECEIVE_BY_SEQUENCE_NUMBER,
                arg_7,
                arg_8)

Receive messages by sequence number that have been previously deferred.

        When receiving deferred messages from a partitioned entity, all of the supplied
        sequence numbers must be messages from the same partition.

        :param sequence_numbers: A list of the sequence numbers of messages that have been
         deferred.
        :type sequence_numbers: list[int]
        :param mode: The mode with which messages will be retrieved from the entity. The two options
         are PeekLock and ReceiveAndDelete. Messages received with PeekLock must be settled within a given
         lock period before they will be removed from the queue. Messages received with ReceiveAndDelete
         will be immediately removed from the queue, and cannot be subsequently rejected or re-received if
         the client fails to process the message. The default mode is PeekLock.
        :type mode: ~azure.servicebus.common.constants.ReceiveSettleMode
        :rtype: list[~azure.servicebus.common.message.Message]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START receive_deferred_messages_service_bus]
                :end-before: [END receive_deferred_messages_service_bus]
                :language: python
                :dedent: 8
                :caption: Get the messages which were deferred using their sequence numbers

Receive messages by sequence number that have been previously deferred .


def Func(arg_0, arg_1):
        """ Sends a signal to the kernel. Note that since only SIGTERM is
        supported on Windows, this function is only useful on Unix systems.
        """
        if arg_0.has_kernel:
            arg_0.kernel.send_signal(arg_1)
        else:
            raise RuntimeError("Cannot signal kernel. No kernel is running!")

Sends a signal to the kernel . Note that since only SIGTERM is supported on Windows this function is only useful on Unix systems .


(self, board, move, player, (delta_x, delta_y))

def Func(arg_0, arg_1, arg_2, arg_3, (arg_4, arg_5)):
        "Return true if there is a line through move on board for player."
        arg_6, arg_7 = arg_2
        arg_8 = 0 # n is number of moves in row
        while arg_1.get((arg_6, arg_7)) == arg_3:
            arg_8 += 1
            arg_6, arg_7 = arg_6 + arg_4, arg_7 + arg_5
        arg_6, arg_7 = arg_2
        while arg_1.get((arg_6, arg_7)) == arg_3:
            arg_8 += 1
            arg_6, arg_7 = arg_6 - arg_4, arg_7 - arg_5
        arg_8 -= 1 # Because we counted move itself twice
        return arg_8 >= arg_0.k

Return true if there is a line through move on board for player .


(data, quotetabs=False, istext=True, header=False)

def Func(arg_0, arg_1=False, arg_2=True, arg_3=False):
    """quotetabs=True means that tab and space characters are always
       quoted.
       istext=False means that \r and \n are treated as regular characters
       header=True encodes space characters with '_' and requires
       real '_' characters to be quoted.
    """
    arg_4 = 76

    # See if this string is using CRLF line ends
    arg_5 = arg_0.find('\n')
    arg_6 = arg_5 > 0 and arg_0[arg_5-1] == '\r'

    arg_7 = 0
    arg_8 = 0
    arg_9 = []
    while arg_7 < len(arg_0):
        arg_10 = arg_0[arg_7]
        if (arg_10 > '~' or
            arg_10 == '=' or
            (arg_3 and arg_10 == '_') or
            (arg_10 == '.' and arg_8 == 0 and (arg_7+1 == len(arg_0) or
                                            arg_0[arg_7+1] == '\n' or
                                            arg_0[arg_7+1] == '\r')) or
            (not arg_2 and (arg_10 == '\r' or arg_10 == '\n')) or
            ((arg_10 == '\t' or arg_10 == ' ') and (arg_7 + 1 == len(arg_0))) or
            (arg_10 <= ' ' and arg_10 != '\r' and arg_10 != '\n' and
             (arg_1 or (not arg_1 and (arg_10 != '\t' and arg_10 != ' '))))):
            arg_8 += 3
            if arg_8 >= arg_4:
                arg_9.append('=')
                if arg_6: arg_9.append('\r')
                arg_9.append('\n')
                arg_8 = 3
            arg_9.append('=' + two_hex_digits(ord(arg_10)))
            arg_7 += 1
        else:
            if (arg_2 and
                (arg_10 == '\n' or (arg_7+1 < len(arg_0) and arg_10 == '\r' and
                               arg_0[arg_7+1] == '\n'))):
                arg_8 = 0
                # Protect against whitespace on end of line
                if (len(arg_9) > 0 and
                    (arg_9[-1] == ' ' or arg_9[-1] == '\t')):
                    arg_11 = ord(arg_9[-1])
                    arg_9[-1] = '='
                    arg_9.append(two_hex_digits(arg_11))

                if arg_6: arg_9.append('\r')
                arg_9.append('\n')
                if arg_10 == '\r':
                    arg_7 += 2
                else:
                    arg_7 += 1
            else:
                if (arg_7 + 1 < len(arg_0) and
                    arg_0[arg_7+1] != '\n' and
                    (arg_8 + 1) >= arg_4):
                    arg_9.append('=')
                    if arg_6: arg_9.append('\r')
                    arg_9.append('\n')
                    arg_8 = 0

                arg_8 += 1
                if arg_3 and arg_10 == ' ':
                    arg_10 = '_'
                arg_9.append(arg_10)
                arg_7 += 1
    return ''.join(arg_9)

quotetabs = True means that tab and space characters are always quoted . istext = False means that \ r and \ n are treated as regular characters header = True encodes space characters with _ and requires real _ characters to be quoted .


def Func ( arg_0 ) : if arg_0 . asc is not None : if arg_0 . _selected and arg_0 . asc : return arg_0 . query . order_by ( arg_0 . _selected ) elif arg_0 . _selected and not arg_0 . asc : return arg_0 . query . order_by ( desc ( arg_0 . _selected ) ) return arg_0 . query

def Func(arg_0):
        """Get query with correct ordering."""
        if arg_0.asc is not None:
            if arg_0._selected and arg_0.asc:
                return arg_0.query.order_by(arg_0._selected)
            elif arg_0._selected and not arg_0.asc:
                return arg_0.query.order_by(desc(arg_0._selected))
        return arg_0.query


def Func(arg_0, arg_1='col'):
    """Devectorize a vectorized square matrix.

    Args:
        vectorized_mat (ndarray): a vectorized density matrix.
        method (str): the method of devectorization. Allowed values are
            - 'col' (default): flattens to column-major vector.
            - 'row': flattens to row-major vector.
            - 'pauli': flattens in the n-qubit Pauli basis.
            - 'pauli-weights': flattens in the n-qubit Pauli basis ordered by
               weight.

    Returns:
        ndarray: the resulting matrix.
    Raises:
        Exception: if input state is not a n-qubit state
    """
    arg_0 = np.array(arg_0)
    arg_2 = int(np.sqrt(arg_0.size))
    if len(arg_0) != arg_2 * arg_2:
        raise Exception('Input is not a vectorized square matrix')

    if arg_1 == 'col':
        return arg_0.reshape(arg_2, arg_2, order='F')
    elif arg_1 == 'row':
        return arg_0.reshape(arg_2, arg_2, order='C')
    elif arg_1 in ['pauli', 'pauli_weights']:
        arg_3 = int(np.log2(arg_2))  # number of qubits
        if arg_2 != 2 ** arg_3:
            raise Exception('Input state must be n-qubit state')
        if arg_1 == 'pauli_weights':
            arg_4 = pauli_group(arg_3, case='weight')
        else:
            arg_4 = pauli_group(arg_3, case='tensor')
        arg_5 = np.array([p.to_matrix() for p in arg_4]) / 2 ** arg_3
        return np.tensordot(arg_0, arg_5, axes=1)
    return None

Devectorize a vectorized square matrix .


def Func ( arg_0 ) : arg_1 = gzip . open ( arg_0 ) arg_2 = np . genfromtxt ( arg_1 , names = True ) arg_1 . close ( ) return arg_2

def Func(arg_0):
    '''
    This reads a downloaded TRILEGAL model file.

    Parameters
    ----------

    modelfile : str
        Path to the downloaded model file to read.

    Returns
    -------

    np.recarray
        Returns the model table as a Numpy record array.

    '''

    arg_1 = gzip.open(arg_0)
    arg_2 = np.genfromtxt(arg_1,names=True)
    arg_1.close()

    return arg_2

This reads a downloaded TRILEGAL model file .


return [first_date + timedelta(days=n)
            for n in range(1 + (last_date - first_date).days)]

def Func ( arg_0 , arg_1 ) : return [ arg_0 + timedelta ( days = arg_2 ) for arg_2 in range ( 1 + ( arg_1 - arg_0 ) . days ) ]

def Func(arg_0, arg_1):
    """Returns all dates from first to last included."""
    return [arg_0 + timedelta(days=arg_2)
            for arg_2 in range(1 + (arg_1 - arg_0).days)]

Returns all dates from first to last included .


(self, model, frame, timeoutSecs=60, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=60, **arg_4):
    '''
    Score a model on the h2o cluster on the given Frame and return only the model metrics.
    '''
    assert arg_1 is not None, '"model" parameter is null'
    assert arg_2 is not None, '"frame" parameter is null'

    arg_5 = arg_0.models(key=arg_1, arg_3=arg_3)
    assert arg_5 is not None, "/Models REST call failed"
    assert arg_5['models'][0]['model_id']['name'] == arg_1, "/Models/{0} returned Model {1} rather than Model {2}".format(arg_1, arg_5['models'][0]['key']['name'], arg_1)

    # TODO: test this assert, I don't think this is working. . .
    arg_6 = arg_0.frames(key=arg_2)
    assert arg_6 is not None, "/Frames/{0} REST call failed".format(arg_2)

    print "frames:", dump_json(arg_6)
    # is the name not there?
    # assert frames['frames'][0]['model_id']['name'] == frame, "/Frames/{0} returned Frame {1} rather than Frame {2}".format(frame, models['models'][0]['key']['name'], frame)

    arg_7 = arg_0.do_json_request('/3/ModelMetrics.json/models/' + arg_1 + '/frames/' + arg_2, cmd='post', timeout=arg_3)

    arg_8 = arg_7['model_metrics'][0]
    verboseprint("model metrics: " + repr(arg_8))
    h2o_sandbox.check_sandbox_for_errors()
    return arg_8

Score a model on the h2o cluster on the given Frame and return only the model metrics .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
lock
.
acquire
(
)
try
:
arg_2
=
arg_1
.
get_error
(
)
arg_3
=
arg_2
.
xpath_eval
(
"e:*"
,
{
"e"
:
"jabber:iq:auth:error"
}
)
if
arg_3
:
arg_3
=
arg_3
[
0
]
.
name
else
:
arg_3
=
arg_2
.
get_condition
(
)
.
name
raise
RegistrationError
(
"Authentication error condition: %s"
%
(
arg_3
,
)
)
finally
:
arg_0
.
lock
.
release
(
)

def Func(arg_0, arg_1):
        """Handle in-band registration error.

        [client only]

        :Parameters:
            - `stanza`: the error stanza received or `None` on timeout.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`"""
        arg_0.lock.acquire()
        try:
            arg_2=arg_1.get_error()
            arg_3=arg_2.xpath_eval("e:*",{"e":"jabber:iq:auth:error"})
            if arg_3:
                arg_3=arg_3[0].name
            else:
                arg_3=arg_2.get_condition().name
            raise RegistrationError("Authentication error condition: %s" % (arg_3,))
        finally:
            arg_0.lock.release()


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Verify the signature for a data string.

    :param cert: signing certificate (X509 object) corresponding to the
        private key which generated the signature.
    :param signature: signature returned by sign function
    :param data: data to be verified
    :param digest: message digest to use
    :return: ``None`` if the signature is correct, raise exception otherwise.

    .. versionadded:: 0.11
    """
    arg_2 = _text_to_bytes_and_warn("data", arg_2)

    arg_4 = _lib.EVP_get_digestbyname(_byte_string(arg_3))
    if arg_4 == _ffi.NULL:
        raise ValueError("No such digest method")

    arg_5 = _lib.X509_get_pubkey(arg_0._x509)
    _openssl_assert(arg_5 != _ffi.NULL)
    arg_5 = _ffi.gc(arg_5, _lib.EVP_PKEY_free)

    arg_6 = _lib.Cryptography_EVP_MD_CTX_new()
    arg_6 = _ffi.gc(arg_6, _lib.Cryptography_EVP_MD_CTX_free)

    _lib.EVP_VerifyInit(arg_6, arg_4)
    _lib.EVP_VerifyUpdate(arg_6, arg_2, len(arg_2))
    arg_7 = _lib.EVP_VerifyFinal(
        arg_6, arg_1, len(arg_1), arg_5
    )

    if arg_7 != 1:
        _raise_current_error()

Verify the signature for a data string .


(self, datacenter_id, server_id, depth=1)

def Func(arg_0, arg_1, arg_2, arg_3=1):
        """
        Retrieves a list of CDROMs attached to the server.

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

        :param      server_id: The unique ID of the server.
        :type       server_id: ``str``

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

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

        return arg_4

Retrieves a list of CDROMs attached to the server .


def Func ( arg_0 ) : arg_1 = arg_0 . ebs . describe_environments ( application_name = arg_0 . app_name , include_deleted = False ) return arg_1 [ 'DescribeEnvironmentsResponse' ] [ 'DescribeEnvironmentsResult' ] [ 'Environments' ]

def Func(arg_0):
        """
        Returns the environments
        """
        arg_1 = arg_0.ebs.describe_environments(application_name=arg_0.app_name, include_deleted=False)
        return arg_1['DescribeEnvironmentsResponse']['DescribeEnvironmentsResult']['Environments']


def Func():
    """The Outstation has been started from the command line. Execute ad-hoc tests if desired."""
    arg_0 = OutstationApplication()
    _log.debug('Initialization complete. In command loop.')
    # Ad-hoc tests can be inserted here if desired. See outstation_cmd.py for examples.
    arg_0.shutdown()
    _log.debug('Exiting.')
    exit()

The Outstation has been started from the command line . Execute ad - hoc tests if desired .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_1
is
ObjectType
.
CERTIFICATE
:
return
arg_0
.
_Func_certificate
(
arg_2
)
elif
arg_1
is
ObjectType
.
SYMMETRIC_KEY
:
return
arg_0
.
_Func_symmetric_key
(
arg_2
)
elif
arg_1
is
ObjectType
.
PUBLIC_KEY
:
return
arg_0
.
_Func_public_key
(
arg_2
)
elif
arg_1
is
ObjectType
.
PRIVATE_KEY
:
return
arg_0
.
_Func_private_key
(
arg_2
)
elif
arg_1
is
ObjectType
.
SPLIT_KEY
:
return
arg_0
.
_Func_split_key
(
arg_2
)
elif
arg_1
is
ObjectType
.
TEMPLATE
:
return
arg_0
.
_Func_template
(
arg_2
)
elif
arg_1
is
ObjectType
.
SECRET_DATA
:
return
arg_0
.
_Func_secret_data
(
arg_2
)
elif
arg_1
is
ObjectType
.
OPAQUE_DATA
:
return
arg_0
.
_Func_opaque_data
(
arg_2
)
else
:
raise
TypeError
(
"Unrecognized secret type: {0}"
.
format
(
arg_1
)
)

def Func(arg_0, arg_1, arg_2=None):
        """
        Create a secret object of the specified type with the given value.

        Args:
            secret_type (ObjectType): An ObjectType enumeration specifying the
                type of secret to Func.
            value (dict): A dictionary containing secret data. Optional,
                defaults to None.

        Returns:
            secret: The newly constructed secret object.

        Raises:
            TypeError: If the provided secret type is unrecognized.

        Example:
            >>> factory.Func(ObjectType.SYMMETRIC_KEY)
            SymmetricKey(...)
        """
        if arg_1 is ObjectType.CERTIFICATE:
            return arg_0._Func_certificate(arg_2)
        elif arg_1 is ObjectType.SYMMETRIC_KEY:
            return arg_0._Func_symmetric_key(arg_2)
        elif arg_1 is ObjectType.PUBLIC_KEY:
            return arg_0._Func_public_key(arg_2)
        elif arg_1 is ObjectType.PRIVATE_KEY:
            return arg_0._Func_private_key(arg_2)
        elif arg_1 is ObjectType.SPLIT_KEY:
            return arg_0._Func_split_key(arg_2)
        elif arg_1 is ObjectType.TEMPLATE:
            return arg_0._Func_template(arg_2)
        elif arg_1 is ObjectType.SECRET_DATA:
            return arg_0._Func_secret_data(arg_2)
        elif arg_1 is ObjectType.OPAQUE_DATA:
            return arg_0._Func_opaque_data(arg_2)
        else:
            raise TypeError("Unrecognized secret type: {0}".format(
                arg_1))

Create a secret object of the specified type with the given value.

        Args:
            secret_type (ObjectType): An ObjectType enumeration specifying the
                type of secret to create.
            value (dict): A dictionary containing secret data. Optional,
                defaults to None.

        Returns:
            secret: The newly constructed secret object.

        Raises:
            TypeError: If the provided secret type is unrecognized.

        Example:
            >>> factory.create(ObjectType.SYMMETRIC_KEY)
            SymmetricKey(...)

Create a secret object of the specified type with the given value .


def Func ( arg_0 ) : if arg_0 == 0 : return np . int64 ( 0 ) elif arg_0 > 0 : return np . int64 ( arg_0 + 0.5 ) else : return np . int64 ( arg_0 - 0.5 )

def Func(arg_0):
    """
    Return nearest long integer to x
    """
    if arg_0 == 0:
        return np.int64(0)
    elif arg_0 > 0:
        return np.int64(arg_0 + 0.5)
    else:
        return np.int64(arg_0 - 0.5)


def Func(arg_0, arg_1):
    """ Edits the XML configuration file with the parameters specified by
    properties

    Parameters:
    ----------------------------------------------------------------
    properties: dict of settings to be applied to the custom configuration store
                 (key is property name, value is value)
    """
    arg_2 = copy(arg_1)

    arg_3 = arg_0.getPath()

    try:
      with open(arg_3, 'r') as fp:
        arg_4 = fp.read()
    except IOError, arg_7:
      if arg_7.errno != errno.ENOENT:
        _getLogger().exception("Error %s reading custom configuration store "
                               "from %s, while Funcing properties %s.",
                               arg_7.errno, arg_3, arg_1)
        raise
      arg_4 = '<configuration/>'

    try:
      arg_5 = ElementTree.XML(arg_4)
      ElementTree.tostring(arg_5)
    except Exception, arg_7:
      # Raising error as RuntimeError with custom message since ElementTree
      # exceptions aren't clear.
      arg_6 = "File contents of custom configuration is corrupt.  File " \
            "location: %s; Contents: '%s'. Original Error (%s): %s." % \
            (arg_3, arg_4, type(arg_7), arg_7)
      _getLogger().exception(arg_6)
      raise RuntimeError(arg_6), None, sys.exc_info()[2]

    if arg_5.tag != 'configuration':
      arg_7 = "Expected top-level element to be 'configuration' but got '%s'" % \
          (arg_5.tag)
      _getLogger().error(arg_7)
      raise RuntimeError(arg_7)

    # Apply new properties to matching settings in the custom config store;
    # pop matching properties from our copy of the properties dict
    for arg_8 in arg_5.findall('./property'):
      arg_9 = dict((attr.tag, attr.text) for attr in arg_8)
      arg_10 = arg_9['name']
      if arg_10 in arg_2:
        arg_11 = arg_8.findall('./value')
        if len(arg_11) > 0:
          arg_11[0].text = str(arg_2.pop(arg_10))
          if not arg_2:
            break
        else:
          arg_7 = "Property %s missing value tag." % (arg_10,)
          _getLogger().error(arg_7)
          raise RuntimeError(arg_7)

    # Add unmatched remaining properties to custom config store
    for arg_13, arg_14 in arg_2.iteritems():
      arg_15 = ElementTree.Element('property')
      arg_16 = ElementTree.Element('name')
      arg_16.text = arg_13
      arg_15.append(arg_16)

      arg_17 = ElementTree.Element('value')
      arg_17.text = str(arg_14)
      arg_15.append(arg_17)

      arg_5.append(arg_15)

    try:
      makeDirectoryFromAbsolutePath(os.path.dirname(arg_3))
      with open(arg_3, 'w') as fp:
        fp.write(ElementTree.tostring(arg_5))
    except Exception, arg_7:
      _getLogger().exception("Error while saving custom configuration "
                             "properties %s in %s.", arg_1,
                             arg_3)
      raise


(params, damping=1.0, increase_list=[['psf-', 1e4]])

def Func ( arg_0 , arg_1 = 1.0 , arg_2 = [ [ 'psf-' , 1e4 ] ] ) : arg_3 = np . ones ( len ( arg_0 ) ) * arg_1 for arg_4 , arg_5 in arg_2 : for arg_6 in range ( arg_3 . size ) : if arg_4 in arg_0 [ arg_6 ] : arg_3 [ arg_6 ] *= arg_5 return arg_3

def Func(arg_0, arg_1=1.0, arg_2=[['psf-', 1e4]]):
    """
    Returns a non-constant damping vector, allowing certain parameters to be
    more strongly damped than others.

    Parameters
    ----------
        params : List
            The list of parameter names, in order.
        damping : Float
            The default value of the damping.
        increase_list: List
            A nested 2-element list of the params to increase and their
            scale factors. All parameters containing the string
            increase_list[i][0] are increased by a factor increase_list[i][1].
    Returns
    -------
        damp_vec : np.ndarray
            The damping vector to use.
    """
    arg_3 = np.ones(len(arg_0)) * arg_1
    for arg_4, arg_5 in arg_2:
        for arg_6 in range(arg_3.size):
            if arg_4 in arg_0[arg_6]:
                arg_3[arg_6] *= arg_5
    return arg_3

Returns a non - constant damping vector allowing certain parameters to be more strongly damped than others .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Update job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon job -j 2 Func --description="new description for my job"
    ```
    """
    arg_4, arg_5, arg_6 = get_job_or_local(arg_0.obj.get('project'), arg_0.obj.get('job'))
    arg_7 = {}

    if arg_1:
        arg_7['name'] = arg_1

    if arg_2:
        arg_7['description'] = arg_2

    arg_3 = validate_tags(arg_3)
    if arg_3:
        arg_7['tags'] = arg_3

    if not arg_7:
        Printer.print_warning('No argument was provided to Func the job.')
        sys.exit(0)

    try:
        arg_8 = PolyaxonClient().job.Func_job(
            arg_4, arg_5, arg_6, arg_7)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func job  `{}`.'.format(arg_6))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Job Funcd.")
    get_job_details(arg_8)

Update job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon job -j 2 update --description="new description for my job"
    ```


def Func(arg_0, arg_1):
        """
        Add any sub commands to the argument parser.

        :param parser: The argument parser object
        """
        arg_2 = arg_0.get_sub_commands()
        if arg_2:
            arg_3 = arg_1.add_subparsers(dest=arg_0.sub_parser_dest_name)

            for arg_4, arg_5 in arg_2.items():
                arg_6 = arg_5(arg_4)

                arg_7 = arg_3.add_parser(arg_4, help=arg_4, description=arg_6.get_help(), formatter_class=arg_6.get_formatter_class())

                arg_6.add_args(arg_7)
                arg_6.Func(arg_7)

Add any sub commands to the argument parser .


def Func ( arg_0 ) : try : return arg_0 . get_argument ( constants . PARAM_ENVIRON ) except tornado . web . MissingArgumentError as e : raise Exception ( e . log_message )

def Func(arg_0):
    """
    Helper function to get request argument.
    Raises exception if argument is missing.
    Returns the environ argument.
    """
    try:
      return arg_0.get_argument(constants.PARAM_ENVIRON)
    except tornado.web.MissingArgumentError as e:
      raise Exception(e.log_message)

Helper function to get request argument . Raises exception if argument is missing . Returns the environ argument .


def Func ( arg_0 , arg_1 ) : with atomic_write ( os . fsencode ( str ( arg_0 ) ) ) as temp_file : with open ( os . fsencode ( str ( arg_0 ) ) ) as products_file : arg_2 = json . load ( products_file ) arg_3 = [ i for i in filter ( lambda z : z [ "uuid" ] == str ( arg_1 [ "uuid" ] ) , arg_2 ) ] if len ( arg_3 ) == 0 : arg_2 . append ( arg_1 ) json . dump ( arg_2 , temp_file ) return True return None

def Func(arg_0, arg_1):
    """
    Save entry to JSON file
    """
    with atomic_write(os.fsencode(str(arg_0))) as temp_file:
        with open(os.fsencode(str(arg_0))) as products_file:
            # load the JSON data into memory
            arg_2 = json.load(products_file)
        # check if UUID already exists
        arg_3 = [i for i in filter(
            lambda z: z["uuid"] == str(arg_1["uuid"]), arg_2)]
        if len(arg_3) == 0:
            # add the new item to the JSON file
            arg_2.append(arg_1)
            # save the new JSON to the temp file
            json.dump(arg_2, temp_file)
            return True
        return None


def Func(arg_0, arg_1):
        '''Resolve the names of inputs for this layer into shape tuples.

        Parameters
        ----------
        layers : list of :class:`Layer`
            A list of the layers that are available for resolving inputs.

        Raises
        ------
        theanets.util.ConfigurationError :
            If an input cannot be resolved.
        '''
        arg_2 = {}
        for arg_3, arg_4 in arg_0._input_shapes.items():
            if arg_4 is None:
                arg_3, arg_4 = arg_0._resolve_shape(arg_3, arg_1)
            arg_2[arg_3] = arg_4
        arg_0._input_shapes = arg_2

Resolve the names of inputs for this layer into shape tuples .


(
            cls,
            version: str,
            frequency: int,
            timestamp: int,
            seed_value: str,
            prev_output: str,
            status_code: str,
    )

return SHA512.new(
            version.encode() +
            struct.pack(
                '>1I1Q64s64s1I',
                frequency,
                timestamp,
                binascii.a2b_hex(seed_value),
                binascii.a2b_hex(prev_output),
                int(status_code),
            )
        )

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 , arg_5 : arg_4 , arg_6 : arg_2 , arg_7 : arg_2 , arg_8 : arg_2 , ) -> SHA512Hash : return SHA512 . new ( arg_1 . encode ( ) + struct . pack ( '>1I1Q64s64s1I' , arg_3 , arg_5 , binascii . a2b_hex ( arg_6 ) , binascii . a2b_hex ( arg_7 ) , arg_4 ( arg_8 ) , ) )

def Func(
            arg_0,
            arg_1: arg_2,
            arg_3: arg_4,
            arg_5: arg_4,
            arg_6: arg_2,
            arg_7: arg_2,
            arg_8: arg_2,
    ) -> SHA512Hash:
        """
        Given required properties from a NistBeaconValue,
        compute the SHA512Hash object.

        :param version: NistBeaconValue.version
        :param frequency: NistBeaconValue.frequency
        :param timestamp: NistBeaconValue.timestamp
        :param seed_value: NistBeaconValue.seed_value
        :param prev_output: NistBeaconValue.previous_output_value
        :param status_code: NistBeaconValue.status_code

        :return: SHA512 Hash for NistBeaconValue signature verification
        """
        return SHA512.new(
            arg_1.encode() +
            struct.pack(
                '>1I1Q64s64s1I',
                arg_3,
                arg_5,
                binascii.a2b_hex(arg_6),
                binascii.a2b_hex(arg_7),
                arg_4(arg_8),
            )
        )

Given required properties from a NistBeaconValue compute the SHA512Hash object .


Show all objects in the whitelist collection

def
Func
(
arg_0
)
:
LOG
.
info
(
"Running scout view users"
)
arg_1
=
arg_0
.
obj
[
'adapter'
]
for
arg_2
in
arg_1
.
Func_collection
.
find
(
)
:
click
.
echo
(
arg_2
[
'_id'
]
)

def Func(arg_0):
    """Show all objects in the Func collection"""
    LOG.info("Running scout view users")
    arg_1 = arg_0.obj['adapter']

    ## TODO add a User interface to the adapter
    for arg_2 in arg_1.Func_collection.find():
        click.echo(arg_2['_id'])


(self, address, rack=0, slot=1, port=102)

def Func(arg_0, arg_1, arg_2=0, arg_3=1, arg_4=102):
        """Connects to a Siemens S7 PLC.

        Connects to a Siemens S7 using the Snap7 library.
        See [the snap7 documentation](http://snap7.sourceforge.net/) for
        supported models and more details.

        It's not currently possible to query the device for available pins,
        so `available_pins()` returns an empty list. Instead, you should use
        `map_pin()` to map to a Merker, Input or Output in the PLC. The
        internal id you should use is a string following this format:
        '[DMQI][XBWD][0-9]+.?[0-9]*' where:

        * [DMQI]: D for DB, M for Merker, Q for Output, I for Input
        * [XBWD]: X for bit, B for byte, W for word, D for dword
        * [0-9]+: Address of the resource
        * [0-9]*: Bit of the address (type X only, ignored in others)

        For example: 'IB100' will read a byte from an input at address 100 and
        'MX50.2' will read/write bit 2 of the Merker at address 50. It's not
        allowed to write to inputs (I), but you can read/write Outpus, DBs and
        Merkers. If it's disallowed by the PLC, an exception will be thrown by
        python-snap7 library.

        For this library to work, it might be needed to change some settings
        in the PLC itself. See
        [the snap7 documentation](http://snap7.sourceforge.net/) for more
        information. You also need to put the PLC in RUN mode. Not however that
        having a Ladder program downloaded, running and modifying variables
        will probably interfere with inputs and outputs, so put it in RUN mode,
        but preferably without a downloaded program.

        @arg address IP address of the module.
        @arg rack rack where the module is installed.
        @arg slot slot in the rack where the module is installed.
        @arg port port the PLC is listenning to.

        @throw RuntimeError if something went wrong
        @throw any exception thrown by `snap7`'s methods.
        """
        arg_2 = int(arg_2)
        arg_3 = int(arg_3)
        arg_4 = int(arg_4)
        arg_1 = str(arg_1)
        arg_0._client = snap7.client.Client()
        arg_0._client.connect(arg_1, arg_2, arg_3, arg_4)


(to, subject, html_content, files=None, dryrun=False, cc=None,
               bcc=None, mime_subtype='mixed', sandbox_mode=False, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = None , arg_7 = 'mixed' , arg_8 = False , ** arg_9 ) : if arg_3 is None : arg_3 = [ ] arg_10 = Mail ( ) arg_11 = arg_9 . get ( 'from_email' ) or os . environ . get ( 'SENDGRID_MAIL_FROM' ) arg_12 = arg_9 . get ( 'from_name' ) or os . environ . get ( 'SENDGRID_MAIL_SENDER' ) arg_10 . from_email = Email ( arg_11 , arg_12 ) arg_10 . subject = arg_1 arg_10 . mail_settings = MailSettings ( ) if arg_8 : arg_10 . mail_settings . sandbox_mode = SandBoxMode ( enable = True ) arg_14 = Personalization ( ) arg_0 = get_email_address_list ( arg_0 ) for arg_15 in arg_0 : arg_14 . add_to ( Email ( arg_15 ) ) if arg_5 : arg_5 = get_email_address_list ( arg_5 ) for arg_16 in arg_5 : arg_14 . add_cc ( Email ( arg_16 ) ) if arg_6 : arg_6 = get_email_address_list ( arg_6 ) for arg_17 in arg_6 : arg_14 . add_bcc ( Email ( arg_17 ) ) arg_18 = arg_9 . get ( 'personalization_custom_args' , None ) if isinstance ( arg_18 , dict ) : for arg_19 in arg_18 . keys ( ) : arg_14 . add_custom_arg ( CustomArg ( arg_19 , arg_18 [ arg_19 ] ) ) arg_10 . add_personalization ( arg_14 ) arg_10 . add_content ( Content ( 'text/html' , arg_2 ) ) arg_20 = arg_9 . get ( 'categories' , [ ] ) for arg_21 in arg_20 : arg_10 . add_category ( Category ( arg_21 ) ) for arg_22 in arg_3 : arg_23 = os . path . basename ( arg_22 ) arg_24 = Attachment ( ) arg_24 . type = mimetypes . guess_type ( arg_23 ) [ 0 ] arg_24 . filename = arg_23 arg_24 . disposition = "attachment" arg_24 . content_id = '<{0}>' . format ( arg_23 ) with open ( arg_22 , "rb" ) as f : arg_24 . content = base64 . b64encode ( f . read ( ) ) . decode ( 'utf-8' ) arg_10 . add_attachment ( arg_24 ) _post_sendgrid_mail ( arg_10 . get ( ) )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False, arg_5=None,
               arg_6=None, arg_7='mixed', arg_8=False, **arg_9):
    """
    Send an email with html content using sendgrid.

    To use this plugin:
    0. include sendgrid subpackage as part of your Airflow installation, e.g.,
    pip install 'apache-airflow[sendgrid]'
    1. update [email] backend in airflow.cfg, i.e.,
    [email]
    email_backend = airflow.contrib.utils.sendgrid.Func
    2. configure Sendgrid specific environment variables at all Airflow instances:
    SENDGRID_MAIL_FROM={your-mail-from}
    SENDGRID_API_KEY={your-sendgrid-api-key}.
    """
    if arg_3 is None:
        arg_3 = []

    arg_10 = Mail()
    arg_11 = arg_9.get('from_email') or os.environ.get('SENDGRID_MAIL_FROM')
    arg_12 = arg_9.get('from_name') or os.environ.get('SENDGRID_MAIL_SENDER')
    arg_10.from_email = Email(arg_11, arg_12)
    arg_10.subject = arg_1
    arg_10.mail_settings = MailSettings()

    if arg_8:
        arg_10.mail_settings.sandbox_mode = SandBoxMode(enable=True)

    # Add the recipient list of to emails.
    arg_14 = Personalization()
    arg_0 = get_email_address_list(arg_0)
    for arg_15 in arg_0:
        arg_14.add_to(Email(arg_15))
    if arg_5:
        arg_5 = get_email_address_list(arg_5)
        for arg_16 in arg_5:
            arg_14.add_cc(Email(arg_16))
    if arg_6:
        arg_6 = get_email_address_list(arg_6)
        for arg_17 in arg_6:
            arg_14.add_bcc(Email(arg_17))

    # Add custom_args to personalization if present
    arg_18 = arg_9.get('personalization_custom_args', None)
    if isinstance(arg_18, dict):
        for arg_19 in arg_18.keys():
            arg_14.add_custom_arg(CustomArg(arg_19, arg_18[arg_19]))

    arg_10.add_personalization(arg_14)
    arg_10.add_content(Content('text/html', arg_2))

    arg_20 = arg_9.get('categories', [])
    for arg_21 in arg_20:
        arg_10.add_category(Category(arg_21))

    # Add email attachment.
    for arg_22 in arg_3:
        arg_23 = os.path.basename(arg_22)

        arg_24 = Attachment()
        arg_24.type = mimetypes.guess_type(arg_23)[0]
        arg_24.filename = arg_23
        arg_24.disposition = "attachment"
        arg_24.content_id = '<{0}>'.format(arg_23)

        with open(arg_22, "rb") as f:
            arg_24.content = base64.b64encode(f.read()).decode('utf-8')

        arg_10.add_attachment(arg_24)
    _post_sendgrid_mail(arg_10.get())

Send an email with html content using sendgrid.

    To use this plugin:
    0. include sendgrid subpackage as part of your Airflow installation, e.g.,
    pip install 'apache-airflow[sendgrid]'
    1. update [email] backend in airflow.cfg, i.e.,
    [email]
    email_backend = airflow.contrib.utils.sendgrid.send_email
    2. configure Sendgrid specific environment variables at all Airflow instances:
    SENDGRID_MAIL_FROM={your-mail-from}
    SENDGRID_API_KEY={your-sendgrid-api-key}.

Send an email with html content using sendgrid .


def Func(arg_0):
        """Launch the application with the specified bundle ID"""
        # NSWorkspaceLaunchAllowingClassicStartup does nothing on any
        # modern system that doesn't have the classic environment installed.
        # Encountered a bug when passing 0 for no options on 10.6 PyObjC.
        arg_1 = AppKit.NSWorkspace.sharedWorkspace()
        # Sorry about the length of the following line
        arg_2 = arg_1.launchAppWithBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifier_(
            arg_0,
            AppKit.NSWorkspaceLaunchAllowingClassicStartup,
            AppKit.NSAppleEventDescriptor.nullDescriptor(),
            None)
        # On 10.6, this returns a tuple - first element bool result, second is
        # a number. Let's use the bool result.
        if not arg_2[0]:
            raise RuntimeError('Error launching specified application.')


def Func ( arg_0 , arg_1 ) : arg_2 = re . finditer ( arg_1 , arg_0 , re . IGNORECASE ) for arg_3 in set ( [ match . group ( ) for match in arg_2 ] ) : arg_0 = arg_0 . replace ( arg_3 , getattr ( settings , "SEARCH_MATCH_DECORATION" , u"<b>{}</b>" ) . format ( arg_3 ) ) return arg_0

def Func(arg_0, arg_1):
        """ decorate the matches within the excerpt """
        arg_2 = re.finditer(arg_1, arg_0, re.IGNORECASE)
        for arg_3 in set([match.group() for match in arg_2]):
            arg_0 = arg_0.replace(
                arg_3,
                getattr(settings, "SEARCH_MATCH_DECORATION", u"<b>{}</b>").format(arg_3)
            )
        return arg_0


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . to_json ( ) with open ( arg_1 , "w" ) as json_file : json_file . write ( arg_2 )

def Func(arg_0, arg_1):
    """
    Save a Keras model definition to JSON with given path
    """
    arg_2 = arg_0.to_json()
    with open(arg_1, "w") as json_file:
        json_file.write(arg_2)