return render_template(
        "zenodo_accessrequests/settings/index.html",
        links_pagination=links.paginate(page, per_page=per_page),
        requests=requests,
        query=query,
        order=ordering,
        get_record=get_record,
        form=DeleteForm(),
    )

def Func():
    """List pending access requests and shared links."""
    arg_0 = request.args.get('query', '')
    arg_1 = request.args.get('sort', '-created')
    try:
        arg_2 = int(request.args.get('page', 1))
        arg_3 = int(request.args.get('per_page', 20))
    except (TypeError, ValueError):
        abort(404)

    # Delete form
    arg_4 = DeleteForm(request.form)
    if arg_4.validate_on_submit():
        arg_5 = SecretLink.query_by_owner(current_user).filter_by(
            id=arg_4.link.data).first()
        if arg_5.revoke():
            flash(_("Shared link revoked."), category='success')
        db.session.commit()

    # Links
    arg_6 = SecretLink.query_by_owner(current_user).filter(
        SecretLink.revoked_at.is_(None)
    )

    # Querying
    if arg_0:
        arg_7 = "%{0}%".format(arg_0)
        arg_6 = arg_6.filter(
            SecretLink.title.like(arg_7) | SecretLink.description.like(arg_7)
        )

    # Ordering
    arg_8 = QueryOrdering(arg_6, ['title', 'created', 'expires_at'], arg_1)
    arg_6 = arg_8.items()

    # Pending access requests
    arg_9 = AccessRequest.query_by_receiver(current_user).filter_by(
        status=RequestStatus.PENDING).order_by('created')

    return render_template(
        "zenodo_accessrequests/settings/Func.html",
        links_pagination=arg_6.paginate(arg_2, arg_3=arg_3),
        arg_9=arg_9,
        arg_0=arg_0,
        arg_1=arg_8,
        get_record=get_record,
        arg_4=DeleteForm(),
    )

List pending access requests and shared links .


def Func(arg_0, arg_1):
        """Remove an operation node n.

        Add edges from predecessors to successors.
        """
        if isinstance(arg_1, int):
            warnings.warn('Calling Func() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            arg_1 = arg_0._id_to_node[arg_1]

        if arg_1.type != 'op':
            raise DAGCircuitError('The method Func only works on op node types. An "%s" '
                                  'node type was wrongly provided.' % arg_1.type)

        arg_2, arg_3 = arg_0._make_pred_succ_maps(arg_1)

        # remove from graph and map
        arg_0._multi_graph.remove_node(arg_1)

        for arg_4 in arg_2.keys():
            arg_0._multi_graph.add_edge(arg_2[arg_4], arg_3[arg_4],
                                       name="%s[%s]" % (arg_4[0].name, arg_4[1]), wire=arg_4)


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
Form
(
"submit"
)
for
arg_3
in
arg_0
.
fields
:
if
arg_3
.
type
==
"fixed"
:
continue
if
not
arg_3
.
values
:
if
arg_3
.
required
:
raise
ValueError
(
"Required field with no value!"
)
continue
if
arg_1
:
arg_2
.
add_field
(
arg_3
.
name
,
arg_3
.
values
,
arg_3
.
type
)
else
:
arg_2
.
add_field
(
arg_3
.
name
,
arg_3
.
values
)
return
arg_2

def Func(arg_0, arg_1 = False):
        """Make a "submit" form using data in `self`.

        Remove uneeded information from the form. The information removed
        includes: title, instructions, field labels, fixed fields etc.

        :raise ValueError: when any required field has no value.

        :Parameters:
            - `keep_types`: when `True` field type information will be included
              in the result form. That is usually not needed.
        :Types:
            - `keep_types`: `bool`

        :return: the form created.
        :returntype: `Form`"""
        arg_2 = Form("submit")
        for arg_3 in arg_0.fields:
            if arg_3.type == "fixed":
                continue
            if not arg_3.values:
                if arg_3.required:
                    raise ValueError("Required field with no value!")
                continue
            if arg_1:
                arg_2.add_field(arg_3.name, arg_3.values, arg_3.type)
            else:
                arg_2.add_field(arg_3.name, arg_3.values)
        return arg_2


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
_pop_none
(
arg_1
)
arg_2
=
{
}
for
arg_3
in
Resource
.
config_fields
:
if
arg_3
in
arg_1
:
arg_2
[
arg_3
]
=
arg_1
.
pop
(
arg_3
)
if
arg_3
in
Resource
.
json_fields
:
if
not
isinstance
(
arg_2
[
arg_3
]
,
six
.
string_types
)
:
continue
try
:
arg_4
=
json
.
loads
(
arg_2
[
arg_3
]
)
arg_2
[
arg_3
]
=
arg_4
except
ValueError
:
raise
exc
.
TowerCLIError
(
'Provided json file format '
'invalid. Please recheck.'
)
return
arg_2

def Func(arg_0, arg_1):
        """Remove None-valued and configuration-related keyworded arguments
        """
        arg_0._pop_none(arg_1)
        arg_2 = {}
        for arg_3 in Resource.config_fields:
            if arg_3 in arg_1:
                arg_2[arg_3] = arg_1.pop(arg_3)
                if arg_3 in Resource.json_fields:

                    # If result[field] is not a string we can continue on
                    if not isinstance(arg_2[arg_3], six.string_types):
                        continue

                    try:
                        arg_4 = json.loads(arg_2[arg_3])
                        arg_2[arg_3] = arg_4
                    except ValueError:
                        raise exc.TowerCLIError('Provided json file format '
                                                'invalid. Please recheck.')
        return arg_2

Remove None - valued and configuration - related keyworded arguments


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = json . dumps ( arg_0 . _Func_dict ( arg_3 ) ) arg_5 = arg_0 . _perform_request ( url = '/datacenters/%s/servers/%s/nics' % ( arg_1 , arg_2 ) , method = 'POST' , arg_4 = arg_4 ) return arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Creates a NIC on the specified 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      nic: A NIC dict.
        :type       nic: ``dict``

        """

        arg_4 = json.dumps(arg_0._Func_dict(arg_3))

        arg_5 = arg_0._perform_request(
            url='/datacenters/%s/servers/%s/nics' % (
                arg_1,
                arg_2),
            method='POST',
            arg_4=arg_4)

        return arg_5


def Func(arg_0, arg_1, arg_2):
        '''return Chunk object full of records
        bucket_name may be None'''
        arg_3 = get_bucket(arg_0.config, arg_1=arg_1)
        arg_4 = arg_3.get_key(arg_2)
        if arg_4 is None:
            raise FailedExtraction('Key "%s" does not exist.' % arg_2)

        arg_5 = StringIO()
        arg_4.get_contents_to_file(arg_5)
        arg_6 = arg_5.getvalue()
        if not arg_6:
            raise FailedExtraction('%s: no data (does the key exist?)'
                                   % arg_4.key)

        arg_7, arg_8, arg_9 = parse_file_extensions(arg_2)
        if arg_9 == 'gpg':
            if not arg_0.gpg_decryption_key_path:
                raise FailedExtraction('%s ends with ".gpg" but gpg_decryption_key_path=%s'
                                       % (arg_4.key, arg_0.gpg_decryption_key_path))

        arg_10 = []
        if arg_8 or arg_9:
            arg_10, arg_6 = decrypt_and_uncompress(
                arg_6,
                arg_0.gpg_decryption_key_path,
                tmp_dir=arg_0.config.get('tmp_dir_path'),
                arg_8=arg_8,
                )
            if not arg_6:
                arg_11 = 'decrypt_and_uncompress got no data for {0!r}, from {1} bytes' \
                    + ' downloaded, errors: {2}' \
                        .format(arg_2, len(arg_6), '\n'.join(arg_10))
                logger.error(arg_11)
                raise FailedExtraction(arg_11)
            logger.info( '\n'.join(arg_10) )

        if not arg_0.config['compare_md5_in_file_name']:
            logger.warn('not checking md5 in file name, consider setting '
                        'from_s3_chunks:compare_md5_in_file_name')
        else:
            logger.info('Verifying md5 for "%s"...' % arg_4.key)

            # The regex hammer.
            arg_12 = re.search('([a-z0-9]{32})(?:\.|$)', arg_4.key)
            if arg_12 is None:
                raise FailedExtraction(
                    'Could not extract md5 from key "%s". '
                    'Perhaps you should disable compare_md5_in_file_name?'
                    % arg_4.key)

            arg_13 = arg_12.group(1)
            #import pdb; pdb.set_trace()
            verify_md5(arg_13, arg_6, other_errors=arg_10)
        return arg_0._decode(arg_6)


def Func ( arg_0 , arg_1 , arg_2 ) : with arg_0 . save_stream ( arg_1 ) as s : s . write ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Save an arbitrary, serializable `value` under `key`.

        :param str key: A string identifier under which to store the value.
        :param value: A serializable value
        :return:
        """
        with arg_0.save_stream(arg_1) as s:
            s.write(arg_2)

Save an arbitrary serializable value under key .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_0 . tasks . put ( ( arg_1 , 0 , arg_2 , arg_3 ) )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    '''Utility function to add a single task into task queue'''
    arg_0.tasks.put((arg_1, 0, arg_2, arg_3))


def Func ( arg_0 , arg_1 = 2 , arg_2 = None ) : arg_3 = defaultdict ( list ) if arg_2 is None : for arg_4 , arg_5 in enumerate ( arg_0 ) : arg_3 [ arg_5 ] . append ( arg_4 ) else : for arg_4 , arg_5 in enumerate ( arg_0 ) : arg_3 [ arg_2 ( arg_5 ) ] . append ( arg_4 ) for arg_2 in list ( arg_3 . keys ( ) ) : if len ( arg_3 [ arg_2 ] ) < arg_1 : del arg_3 [ arg_2 ] arg_3 = dict ( arg_3 ) return arg_3

def Func(arg_0, arg_1=2, arg_2=None):
    """
    Find all duplicate items in a list.

    Search for all items that appear more than `k` times and return a mapping
    from each (k)-duplicate item to the positions it appeared in.

    Args:
        items (Iterable): hashable items possibly containing duplicates
        k (int): only return items that appear at least `k` times (default=2)
        key (Callable, optional): Returns indices where `key(items[i])`
            maps to a particular value at least k times.

    Returns:
        dict: maps each duplicate item to the indices at which it appears

    CommandLine:
        python -m ubelt.util_dict Func

    Example:
        >>> import ubelt as ub
        >>> items = [0, 0, 1, 2, 3, 3, 0, 12, 2, 9]
        >>> duplicates = ub.Func(items)
        >>> print('items = %r' % (items,))
        >>> print('duplicates = %r' % (duplicates,))
        >>> assert duplicates == {0: [0, 1, 6], 2: [3, 8], 3: [4, 5]}
        >>> assert ub.Func(items, 3) == {0: [0, 1, 6]}

    Example:
        >>> import ubelt as ub
        >>> items = [0, 0, 1, 2, 3, 3, 0, 12, 2, 9]
        >>> # note: k can be 0
        >>> duplicates = ub.Func(items, k=0)
        >>> print(ub.repr2(duplicates, nl=0))
        {0: [0, 1, 6], 1: [2], 2: [3, 8], 3: [4, 5], 9: [9], 12: [7]}

    Example:
        >>> import ubelt as ub
        >>> items = [10, 11, 12, 13, 14, 15, 16]
        >>> duplicates = ub.Func(items, key=lambda x: x // 2)
        >>> print(ub.repr2(duplicates, nl=0))
        {5: [0, 1], 6: [2, 3], 7: [4, 5]}
    """
    # Build mapping from items to the indices at which they appear
    # if key is not None:
    #     items = map(key, items)
    arg_3 = defaultdict(list)
    if arg_2 is None:
        for arg_4, arg_5 in enumerate(arg_0):
            arg_3[arg_5].append(arg_4)
    else:
        for arg_4, arg_5 in enumerate(arg_0):
            arg_3[arg_2(arg_5)].append(arg_4)
    # remove items seen fewer than k times.
    for arg_2 in list(arg_3.keys()):
        if len(arg_3[arg_2]) < arg_1:
            del arg_3[arg_2]
    arg_3 = dict(arg_3)
    return arg_3

Find all duplicate items in a list.

    Search for all items that appear more than `k` times and return a mapping
    from each (k)-duplicate item to the positions it appeared in.

    Args:
        items (Iterable): hashable items possibly containing duplicates
        k (int): only return items that appear at least `k` times (default=2)
        key (Callable, optional): Returns indices where `key(items[i])`
            maps to a particular value at least k times.

    Returns:
        dict: maps each duplicate item to the indices at which it appears

    CommandLine:
        python -m ubelt.util_dict find_duplicates

    Example:
        >>> import ubelt as ub
        >>> items = [0, 0, 1, 2, 3, 3, 0, 12, 2, 9]
        >>> duplicates = ub.find_duplicates(items)
        >>> print('items = %r' % (items,))
        >>> print('duplicates = %r' % (duplicates,))
        >>> assert duplicates == {0: [0, 1, 6], 2: [3, 8], 3: [4, 5]}
        >>> assert ub.find_duplicates(items, 3) == {0: [0, 1, 6]}

    Example:
        >>> import ubelt as ub
        >>> items = [0, 0, 1, 2, 3, 3, 0, 12, 2, 9]
        >>> # note: k can be 0
        >>> duplicates = ub.find_duplicates(items, k=0)
        >>> print(ub.repr2(duplicates, nl=0))
        {0: [0, 1, 6], 1: [2], 2: [3, 8], 3: [4, 5], 9: [9], 12: [7]}

    Example:
        >>> import ubelt as ub
        >>> items = [10, 11, 12, 13, 14, 15, 16]
        >>> duplicates = ub.find_duplicates(items, key=lambda x: x // 2)
        >>> print(ub.repr2(duplicates, nl=0))
        {5: [0, 1], 6: [2, 3], 7: [4, 5]}


def Func(arg_0, arg_1):
        """
        Load a certificate chain from a file.

        :param certfile: The name of the certificate chain file (``bytes`` or
            ``unicode``).  Must be PEM encoded.

        :return: None
        """
        arg_1 = _path_string(arg_1)

        arg_2 = _lib.SSL_CTX_Func(
            arg_0._context, arg_1
        )
        if not arg_2:
            _raise_current_error()


def Func ( arg_0 ) : arg_0 . namespace = 'tag_open' arg_2 = arg_0 . pop_data ( ) for arg_3 in arg_2 : arg_0 . append ( time = arg_3 . time , duration = arg_3 . duration , confidence = arg_3 . confidence , value = arg_3 . value [ 'label' ] ) return arg_0

def Func(arg_0):
    '''Convert scaper annotations to tag_open'''

    arg_0.namespace = 'tag_open'

    arg_2 = arg_0.pop_data()
    for arg_3 in arg_2:
        arg_0.append(time=arg_3.time, duration=arg_3.duration,
                          confidence=arg_3.confidence, value=arg_3.value['label'])

    return arg_0


def Func(arg_0):
    """ Get a map from all daemon services' name to the command to start them """
    arg_1 = {}

    arg_1[arg_0.heron_shell_ids[arg_0.shard]] = Command([
        '%s' % arg_0.heron_shell_binary,
        '--port=%s' % arg_0.shell_port,
        '--log_file_prefix=%s/heron-shell-%s.log' % (arg_0.log_dir, arg_0.shard),
        '--secret=%s' % arg_0.topology_id], arg_0.shell_env)

    return arg_1

Get a map from all daemon services name to the command to start them


def Func ( arg_0 , arg_1 ) : assert arg_1 is None or isinstance ( arg_1 , list ) arg_2 = [ ] for arg_3 in arg_1 : try : arg_4 = User . query . filter_by ( arg_3 = arg_3 ) . one ( ) arg_2 . append ( arg_0 . invite ( arg_4 ) ) except NoResultFound : arg_2 . append ( None ) return arg_2

def Func(arg_0, arg_1):
        """Invite users to a group by emails.

        :param list emails: Emails of users that shall be invited.
        :returns list: Newly created Memberships or Nones.
        """
        assert arg_1 is None or isinstance(arg_1, list)

        arg_2 = []

        for arg_3 in arg_1:
            try:
                arg_4 = User.query.filter_by(arg_3=arg_3).one()
                arg_2.append(arg_0.invite(arg_4))
            except NoResultFound:
                arg_2.append(None)

        return arg_2


async def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 in arg_0 . applications_accepting_frames : arg_0 . applications_accepting_frames . remove ( arg_2 ) if arg_0 . closing : return if not arg_0 . applications_accepting_frames : await arg_0 . close ( arg_1 . get ( "code" ) )

async def Func(arg_0, arg_1, arg_2):
        """
        Handle downstream `websocket.close` message.

        Will disconnect this upstream application from receiving any new frames.

        If there are not more upstream applications accepting messages it will then call `close`.
        """
        if arg_2 in arg_0.applications_accepting_frames:
            # remove from set of upsteams steams than can receive new messages
            arg_0.applications_accepting_frames.remove(arg_2)

        # we are already closing due to an upstream websocket.disconnect command

        if arg_0.closing:
            return
        # if none of the upstream applications are listing we need to close.
        if not arg_0.applications_accepting_frames:
            await arg_0.close(arg_1.get("code"))

Handle downstream websocket . close message .


def Func ( arg_0 , arg_1 = arg_2 ( 'nan' ) , arg_3 = None ) : arg_0 . solver . optimize ( ) if arg_0 . solver . status == optlang . interface . OPTIMAL : return arg_0 . solver . objective . value elif arg_1 is not None : return arg_1 else : assert_optimal ( arg_0 , arg_3 )

def Func(arg_0, arg_1=arg_2('nan'), arg_3=None):
        """Optimize model without creating a solution object.

        Creating a full solution object implies fetching shadow prices and
        flux values for all reactions and metabolites from the solver
        object. This necessarily takes some time and in cases where only one
        or two values are of interest, it is recommended to instead use this
        function which does not create a solution object returning only the
        value of the objective. Note however that the `optimize()` function
        uses efficient means to fetch values so if you need fluxes/shadow
        prices for more than say 4 reactions/metabolites, then the total
        speed increase of `Func` versus `optimize` is  expected to
        be small or even negative depending on how you fetch the values
        after optimization.

        Parameters
        ----------
        error_value : float, None
           The value to return if optimization failed due to e.g.
           infeasibility. If None, raise `OptimizationError` if the
           optimization fails.
        message : string
           Error message to use if the model optimization did not succeed.

        Returns
        -------
        float
            The objective value.
        """
        arg_0.solver.optimize()
        if arg_0.solver.status == optlang.interface.OPTIMAL:
            return arg_0.solver.objective.value
        elif arg_1 is not None:
            return arg_1
        else:
            assert_optimal(arg_0, arg_3)

Optimize model without creating a solution object.

        Creating a full solution object implies fetching shadow prices and
        flux values for all reactions and metabolites from the solver
        object. This necessarily takes some time and in cases where only one
        or two values are of interest, it is recommended to instead use this
        function which does not create a solution object returning only the
        value of the objective. Note however that the `optimize()` function
        uses efficient means to fetch values so if you need fluxes/shadow
        prices for more than say 4 reactions/metabolites, then the total
        speed increase of `slim_optimize` versus `optimize` is  expected to
        be small or even negative depending on how you fetch the values
        after optimization.

        Parameters
        ----------
        error_value : float, None
           The value to return if optimization failed due to e.g.
           infeasibility. If None, raise `OptimizationError` if the
           optimization fails.
        message : string
           Error message to use if the model optimization did not succeed.

        Returns
        -------
        float
            The objective value.

Optimize model without creating a solution object .


return self.n(wavelength) - (wavelength*1.e-9)*self.nDer1(wavelength)

def Func ( arg_0 , arg_1 ) : return arg_0 . n ( arg_1 ) - ( arg_1 * 1.e-9 ) * arg_0 . nDer1 ( arg_1 )

def Func(arg_0, arg_1):
        '''
        The group index with respect to waveleFuncth.

        Args:
            waveleFuncth (float, list, None): The waveleFuncth(s) the group
                index will be evaluated at.

        Returns:
            float, list: The group index at the target waveleFuncth(s).
        '''
        return arg_0.n(arg_1) - (arg_1*1.e-9)*arg_0.nDer1(arg_1)

The group index with respect to wavelength.

        Args:
            wavelength (float, list, None): The wavelength(s) the group
                index will be evaluated at.

        Returns:
            float, list: The group index at the target wavelength(s).

The group index with respect to wavelength .


def Func ( arg_0 ) : arg_1 = tf . train . NewCheckpointReader ( arg_0 ) arg_2 = filter ( lambda n : n != 'global_step' , arg_1 . get_variable_to_shape_map ( ) . keys ( ) ) arg_3 = { } for arg_4 in arg_2 : arg_3 [ arg_4 ] = arg_1 . get_tensor ( arg_4 ) return arg_3

def Func(arg_0):
    """
    Export variable tensors from the checkpoint files.

    :param checkpoint_path: tensorflow checkpoint path
    :return: dictionary of tensor. The key is the variable name and the value is the numpy
    """
    arg_1 = tf.train.NewCheckpointReader(arg_0)

    # Get tensor name list
    arg_2 = filter(lambda n: n!='global_step',
                          arg_1.get_variable_to_shape_map().keys())
    # Prepare key-value dictionary
    arg_3 = {}
    for arg_4 in arg_2:
        arg_3[arg_4] = arg_1.get_tensor(arg_4)

    return arg_3

Export variable tensors from the checkpoint files .


def Func(arg_0=None, arg_1=1.0):
    """Sample an index from a probability array.

    Parameters
    ----------
    a : list of float
        List of probabilities.
    temperature : float or None
        The higher the more uniform. When a = [0.1, 0.2, 0.7],
            - temperature = 0.7, the distribution will be sharpen [0.05048273,  0.13588945,  0.81362782]
            - temperature = 1.0, the distribution will be the same [0.1,    0.2,    0.7]
            - temperature = 1.5, the distribution will be filtered [0.16008435,  0.25411807,  0.58579758]
            - If None, it will be ``np.argmax(a)``

    Notes
    ------
    - No matter what is the temperature and input list, the sum of all probabilities will be one. Even if input list = [1, 100, 200], the sum of all probabilities will still be one.
    - For large vocabulary size, choice a higher temperature or ``tl.nlp.Func_top`` to avoid error.

    """
    if arg_0 is None:
        raise Exception("a : list of float")
    arg_2 = np.copy(arg_0)
    try:
        if arg_1 == 1:
            return np.argmax(np.random.multinomial(1, arg_0, 1))
        if arg_1 is None:
            return np.argmax(arg_0)
        else:
            arg_0 = np.log(arg_0) / arg_1
            arg_0 = np.exp(arg_0) / np.sum(np.exp(arg_0))
            return np.argmax(np.random.multinomial(1, arg_0, 1))
    except Exception:
        # np.set_printoptions(threshold=np.nan)
        # tl.logging.info(a)
        # tl.logging.info(np.sum(a))
        # tl.logging.info(np.max(a))
        # tl.logging.info(np.min(a))
        # exit()
        arg_3 = "For large vocabulary_size, choice a higher temperature\
         to avoid log error. Hint : use ``Func_top``. "

        warnings.warn(arg_3, Warning)
        # tl.logging.info(a)
        # tl.logging.info(b)
        return np.argmax(np.random.multinomial(1, arg_2, 1))

Sample an index from a probability array.

    Parameters
    ----------
    a : list of float
        List of probabilities.
    temperature : float or None
        The higher the more uniform. When a = [0.1, 0.2, 0.7],
            - temperature = 0.7, the distribution will be sharpen [0.05048273,  0.13588945,  0.81362782]
            - temperature = 1.0, the distribution will be the same [0.1,    0.2,    0.7]
            - temperature = 1.5, the distribution will be filtered [0.16008435,  0.25411807,  0.58579758]
            - If None, it will be ``np.argmax(a)``

    Notes
    ------
    - No matter what is the temperature and input list, the sum of all probabilities will be one. Even if input list = [1, 100, 200], the sum of all probabilities will still be one.
    - For large vocabulary size, choice a higher temperature or ``tl.nlp.sample_top`` to avoid error.

Sample an index from a probability array .


def Func ( arg_0 , arg_1 ) : assert arg_0 . shape [ - 1 ] % 4 == 0 arg_2 = np . empty_like ( arg_0 , dtype = arg_0 . dtype ) arg_2 [ ... , 0 : : 2 ] = np . maximum ( np . minimum ( arg_0 [ ... , 0 : : 2 ] , arg_1 [ 1 ] - 1 ) , 0 ) arg_2 [ ... , 1 : : 2 ] = np . maximum ( np . minimum ( arg_0 [ ... , 1 : : 2 ] , arg_1 [ 0 ] - 1 ) , 0 ) return arg_2

def Func(arg_0, arg_1):
    """Clip bboxes to fit the image shape.

    Args:
        bboxes (ndarray): Shape (..., 4*k)
        img_shape (tuple): (height, width) of the image.

    Returns:
        ndarray: Clipped bboxes.
    """
    assert arg_0.shape[-1] % 4 == 0
    arg_2 = np.empty_like(arg_0, dtype=arg_0.dtype)
    arg_2[..., 0::2] = np.maximum(
        np.minimum(arg_0[..., 0::2], arg_1[1] - 1), 0)
    arg_2[..., 1::2] = np.maximum(
        np.minimum(arg_0[..., 1::2], arg_1[0] - 1), 0)
    return arg_2


return set(text.strip() for text in string.split(',') if text.strip())

def Func ( arg_0 ) : return set ( arg_1 . strip ( ) for arg_1 in arg_0 . split ( ',' ) if arg_1 . strip ( ) )

def Func(arg_0):
    """Return a set of strings."""
    return set(arg_1.strip() for arg_1 in arg_0.split(',') if arg_1.strip())


(graph: BELGraph, func: str, namespace: Strings)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5) -> None:
    """Remove nodes with the given function and namespace.

    This might be useful to exclude information learned about distant species, such as excluding all information
    from MGI and RGD in diseases where mice and rats don't give much insight to the human disease mechanism.
    """
    remove_filtered_nodes(arg_0, function_namespace_inclusion_builder(arg_2, arg_4))

Remove nodes with the given function and namespace .


def Func(arg_0=None, arg_1=None):
    """
    Deletes and recreates one or more VM instances.
    """

    if arg_0 is None:
        arg_0 = get_name()

    delete(arg_0=arg_0, arg_1=arg_1)
    arg_2 = get_or_create(arg_0=arg_0, arg_1=arg_1)
    arg_3.host_string = arg_2.public_dns_name

Deletes and recreates one or more VM instances .


(self, device=None, profile=None, native=None, attrs=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : if arg_4 is None : arg_4 = arg_0 . elements ( ) . values ( ) for arg_5 in arg_4 : arg_6 = Parser ( arg_5 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , is_config = False ) arg_6 . parse ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Parse native state and load it into the corresponding models. Only models
        that have been added to the root object will be parsed.

        If ``native`` is passed to the method that's what we will parse, otherwise, we will use the
        ``device`` to retrieve it.

        Args:
            device (NetworkDriver): Device to load the configuration from.
            profile (list): Profiles that the device supports. If no ``profile`` is passed it will
              be read from ``device``.
            native (list string): Native output to parse.

        Examples:

            >>> # Load from device
            >>> state = napalm_yang.base.Root()
            >>> state.add_model(napalm_yang.models.openconfig_interfaces)
            >>> state.parse_config(device=d)

            >>> # Load from file
            >>> with open("junos.state", "r") as f:
            >>>     state_data = f.read()
            >>>
            >>> state = napalm_yang.base.Root()
            >>> state.add_model(napalm_yang.models.openconfig_interfaces)
            >>> state.parse_config(native=[state_data], profile="junos")
        """
        if arg_4 is None:
            arg_4 = arg_0.elements().values()

        for arg_5 in arg_4:
            arg_6 = Parser(
                arg_5, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, is_config=False
            )
            arg_6.parse()

Parse native state and load it into the corresponding models . Only models that have been added to the root object will be parsed .


return ConstructLocal._wrap(ones, shape, dtype, order)

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = 'C' ) : from numpy import Func return ConstructLocal . _wrap ( Func , arg_0 , arg_1 , arg_3 )

def Func(arg_0, arg_1=arg_2, arg_3='C'):
        """
        Create a local bolt array of Func.

        Parameters
        ----------
        shape : tuple
            Dimensions of the desired array

        dtype : data-type, optional, default=float64
            The desired data-type for the array. (see numpy)

        order : {'C', 'F', 'A'}, optional, default='C'
            The order of the array. (see numpy)

        Returns
        -------
        BoltArrayLocal
        """
        from numpy import Func
        return ConstructLocal._wrap(Func, arg_0, arg_1, arg_3)

Create a local bolt array of ones.

        Parameters
        ----------
        shape : tuple
            Dimensions of the desired array

        dtype : data-type, optional, default=float64
            The desired data-type for the array. (see numpy)

        order : {'C', 'F', 'A'}, optional, default='C'
            The order of the array. (see numpy)

        Returns
        -------
        BoltArrayLocal


(df, column: str, type: str, new_column=None)

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4=None):
    """
    Convert column's type into type

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column to convert
    - `type` (*str*): output type. It can be :
        - `"int"` : integer type
        - `"float"` : general number type
        - `"str"` : text type

    *optional :*
    - `new_column` (*str*): name of the output column.
       By default the `column` arguments is modified.

    ---

    ### Example

    **Input**

    | Column 1 |  Column 2   |  Column 3  |
    |:-------:|:--------:|:--------:|
    |  'one'  |  '2014'  |   30.0   |
    |  'two'  |  2015.0  |    '1'   |
    |   3.1   |   2016   |    450   |

    ```cson
    postprocess: [
      Func:
        column: 'Column 1'
        type: 'str'
      Func:
        column: 'Column 2'
        type: 'int'
      Func:
        column: 'Column 3'
        type: 'float'
    ]
    ```

    **Output**

    | Column 1 |  Column 2  |  Column 3  |
    |:-------:|:------:|:--------:|
    |  'one'  |  2014  |   30.0   |
    |  'two'  |  2015  |    1.0   |
    |  '3.1'  |  2016  |  450.0   |
    """
    arg_4 = arg_4 or arg_1
    arg_0[arg_4] = arg_0[arg_1].astype(arg_3)
    return arg_0

Convert column's type into type

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column to convert
    - `type` (*str*): output type. It can be :
        - `"int"` : integer type
        - `"float"` : general number type
        - `"str"` : text type

    *optional :*
    - `new_column` (*str*): name of the output column.
       By default the `column` arguments is modified.

    ---

    ### Example

    **Input**

    | Column 1 |  Column 2   |  Column 3  |
    |:-------:|:--------:|:--------:|
    |  'one'  |  '2014'  |   30.0   |
    |  'two'  |  2015.0  |    '1'   |
    |   3.1   |   2016   |    450   |

    ```cson
    postprocess: [
      cast:
        column: 'Column 1'
        type: 'str'
      cast:
        column: 'Column 2'
        type: 'int'
      cast:
        column: 'Column 3'
        type: 'float'
    ]
    ```

    **Output**

    | Column 1 |  Column 2  |  Column 3  |
    |:-------:|:------:|:--------:|
    |  'one'  |  2014  |   30.0   |
    |  'two'  |  2015  |    1.0   |
    |  '3.1'  |  2016  |  450.0   |


def Func ( arg_0 = None ) : if arg_0 is None or arg_0 == 'default' : return _DEFAULT_PALETTE if isinstance ( arg_0 , str ) : return PROJECT_PALETTES . Func ( arg_0 ) or BUILT_IN_PALETTES . Func ( arg_0 )

def Func(arg_0=None):
    """
    Return a named Palette, or None if no such name exists.

    If ``name`` is omitted, the default value is used.
    """
    if arg_0 is None or arg_0 == 'default':
        return _DEFAULT_PALETTE

    if isinstance(arg_0, str):
        return PROJECT_PALETTES.Func(arg_0) or BUILT_IN_PALETTES.Func(arg_0)

Return a named Palette or None if no such name exists .


def Func ( arg_0 , arg_1 ) : arg_2 = FileInfo ( arg_0 ) if not arg_2 . Extension ( ) . lstrip ( '.' ) in GetNonHeaderExtensions ( ) : return ( False , '' ) arg_3 = FileInfo ( arg_1 ) if not arg_3 . Extension ( ) . lstrip ( '.' ) in GetHeaderExtensions ( ) : return ( False , '' ) arg_0 = arg_0 [ : - ( len ( arg_2 . Extension ( ) ) ) ] arg_4 = Search ( _TEST_FILE_SUFFIX , arg_2 . BaseName ( ) ) if arg_4 : arg_0 = arg_0 [ : - len ( arg_4 . group ( 1 ) ) ] arg_0 = arg_0 . replace ( '/public/' , '/' ) arg_0 = arg_0 . replace ( '/internal/' , '/' ) arg_1 = arg_1 [ : - ( len ( arg_3 . Extension ( ) ) ) ] if arg_1 . endswith ( '-inl' ) : arg_1 = arg_1 [ : - len ( '-inl' ) ] arg_1 = arg_1 . replace ( '/public/' , '/' ) arg_1 = arg_1 . replace ( '/internal/' , '/' ) arg_5 = arg_0 . endswith ( arg_1 ) arg_6 = '' if arg_5 : arg_6 = arg_0 [ : - len ( arg_1 ) ] return arg_5 , arg_6

def Func(arg_0, arg_1):
  """Check if these two filenames belong to the same module.

  The concept of a 'module' here is a as follows:
  foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
  same 'module' if they are in the same directory.
  some/path/public/xyzzy and some/path/internal/xyzzy are also considered
  to belong to the same module here.

  If the filename_cc contains a longer path than the filename_h, for example,
  '/absolute/path/to/base/sysinfo.cc', and this file would include
  'base/sysinfo.h', this function also produces the prefix needed to open the
  header. This is used by the caller of this function to more robustly open the
  header file. We don't have access to the real include paths in this context,
  so we need this guesswork here.

  Known bugs: tools/base/bar.cc and base/bar.h belong to the same module
  according to this implementation. Because of this, this function gives
  some false positives. This should be sufficiently rare in practice.

  Args:
    filename_cc: is the path for the source (e.g. .cc) file
    filename_h: is the path for the header path

  Returns:
    Tuple with a bool and a string:
    bool: True if filename_cc and filename_h belong to the same module.
    string: the additional prefix needed to open the header file.
  """
  arg_2 = FileInfo(arg_0)
  if not arg_2.Extension().lstrip('.') in GetNonHeaderExtensions():
    return (False, '')

  arg_3 = FileInfo(arg_1)
  if not arg_3.Extension().lstrip('.') in GetHeaderExtensions():
    return (False, '')

  arg_0 = arg_0[:-(len(arg_2.Extension()))]
  arg_4 = Search(_TEST_FILE_SUFFIX, arg_2.BaseName())
  if arg_4:
    arg_0 = arg_0[:-len(arg_4.group(1))]

  arg_0 = arg_0.replace('/public/', '/')
  arg_0 = arg_0.replace('/internal/', '/')

  arg_1 = arg_1[:-(len(arg_3.Extension()))]
  if arg_1.endswith('-inl'):
    arg_1 = arg_1[:-len('-inl')]
  arg_1 = arg_1.replace('/public/', '/')
  arg_1 = arg_1.replace('/internal/', '/')

  arg_5 = arg_0.endswith(arg_1)
  arg_6 = ''
  if arg_5:
    arg_6 = arg_0[:-len(arg_1)]
  return arg_5, arg_6

Check if these two filenames belong to the same module .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_2
[
'name'
]
:
raise
ValueError
(
"Model name must be provided and "
"could not be an empty string"
)
arg_3
=
'projects/{}'
.
format
(
arg_1
)
arg_4
=
arg_0
.
_mlengine
.
projects
(
)
.
models
(
)
.
create
(
parent
=
arg_3
,
body
=
arg_2
)
return
arg_4
.
execute
(
)

def Func(arg_0, arg_1, arg_2):
        """
        Create a Model. Blocks until finished.
        """
        if not arg_2['name']:
            raise ValueError("Model name must be provided and "
                             "could not be an empty string")
        arg_3 = 'projects/{}'.format(arg_1)

        arg_4 = arg_0._mlengine.projects().models().create(
            parent=arg_3, body=arg_2)
        return arg_4.execute()

Create a Model . Blocks until finished .


return has_true and not has_another_true

def Func ( arg_0 ) : arg_1 = iter ( arg_0 ) arg_2 = any ( arg_1 ) arg_3 = any ( arg_1 ) return arg_2 and not arg_3

def Func(arg_0):
    '''This returns True if only one True-ish element exists in `iterable`.

    Parameters
    ----------

    iterable : iterable

    Returns
    -------

    bool
        True if only one True-ish element exists in `iterable`. False otherwise.

    '''

    # return True if exactly one true found
    arg_1 = iter(arg_0)

    # consume from "i" until first true or it's exhausted
    arg_2 = any(arg_1)

    # carry on consuming until another true value / exhausted
    arg_3 = any(arg_1)

    return arg_2 and not arg_3

This returns True if only one True - ish element exists in iterable .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in enumerate ( arg_1 ) : arg_5 = re . search ( r'(?P<start>-?\d*):(?P<end>\d*)' , arg_4 ) if arg_5 : if arg_3 > 0 : arg_2 . append ( arg_0 . separator ) arg_6 = group_val ( arg_5 . group ( 'start' ) ) arg_7 = group_val ( arg_5 . group ( 'end' ) ) if arg_6 and arg_7 : arg_2 . extend ( arg_0 . _extendrange ( arg_6 , arg_7 + 1 ) ) elif arg_5 . group ( 'start' ) : arg_2 . append ( [ arg_6 ] ) else : arg_2 . extend ( arg_0 . _extendrange ( 1 , arg_7 + 1 ) ) else : arg_2 . append ( arg_1 [ arg_3 ] ) try : if int ( arg_4 ) and int ( arg_1 [ arg_3 + 1 ] ) : arg_2 . append ( arg_0 . separator ) except ( ValueError , IndexError ) : pass return arg_2

def Func(arg_0, arg_1):
        """Processes positions to account for ranges

        Arguments:
            positions -     list of positions and/or ranges to process
        """
        arg_2 = []

        for arg_3, arg_4 in enumerate(arg_1):
            arg_5 = re.search(r'(?P<start>-?\d*):(?P<end>\d*)', arg_4)

            if arg_5:
                if arg_3 > 0:
                    arg_2.append(arg_0.separator)
                arg_6 = group_val(arg_5.group('start'))
                arg_7 = group_val(arg_5.group('end'))

                if arg_6 and arg_7:
                    arg_2.extend(arg_0._extendrange(arg_6, arg_7 + 1))
                # Since the number of positions on a line is unknown,
                # send input to cause exception that can be caught and call
                # _cut_range helper function
                elif arg_5.group('start'):
                    arg_2.append([arg_6])
                else:
                    arg_2.extend(arg_0._extendrange(1, arg_7 + 1))
            else:
                arg_2.append(arg_1[arg_3])
                try:
                    if int(arg_4) and int(arg_1[arg_3+1]):
                        arg_2.append(arg_0.separator)
                except (ValueError, IndexError):
                    pass

        return arg_2


def Func(arg_0) -> bool:
        """Pop context variable that store rule nodes"""
        arg_0.rule_nodes = arg_0.rule_nodes.parents
        arg_0.tag_cache = arg_0.tag_cache.parents
        arg_0.id_cache = arg_0.id_cache.parents
        return True


def Func(arg_0, arg_1, arg_2=False):
        """Removes parameters, results or groups from the trajectory.

        This function ONLY removes items from your current trajectory and does not delete
        data stored to disk. If you want to delete data from disk, take a look at
        :func:`~pypet.trajectory.Trajectory.f_delete_items`.

        This will also remove all links if items are linked.

        :param iterator:

            A sequence of items you want to remove. Either the instances themselves
            or strings with the names of the items.

        :param recursive:

            In case you want to remove group nodes, if the children should be removed, too.

        """

        # Will format the request in a form that is understood by the storage service
        # aka (msg, item, args, kwargs)
        arg_3 = arg_0._nn_interface._fetch_items(REMOVE, arg_1, (), {})

        if arg_3:
            for arg_4, arg_5, arg_6, arg_7 in arg_3:
                arg_0._nn_interface._remove_node_or_leaf(arg_5, arg_2=arg_2)

        else:
            arg_0._logger.warning('Your removal was not successful, could not find a single '
                                 'item to remove.')

Removes parameters results or groups from the trajectory .


(self, key, data, group, fullname, flag, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, **arg_6):
        """Stores a pandas DataFrame into hdf5.

        :param key:

            Name of data item to store

        :param data:

            Pandas Data to Store

        :param group:

            Group node where to store data in hdf5 file

        :param fullname:

            Full name of the `data_to_store`s original container, only needed for throwing errors.

        :param flag:

            If it is a series, frame or panel

        """
        try:
            if 'filters' not in arg_6:
                arg_7 = arg_0._all_get_filters(arg_6)
                arg_6['filters'] = arg_7
            if 'format' not in arg_6:
                arg_6['format'] = arg_0.pandas_format
            if 'encoding' not in arg_6:
                arg_6['encoding'] = arg_0.encoding

            arg_8 = arg_6.pop('overwrite', False)

            if arg_1 in arg_3 and not (arg_8 or arg_6.get('append', False)):
                raise ValueError(
                    'DataFrame `%s` already exists in `%s`. '
                    'To append pass ``append=`True```.' % (arg_1, arg_4))
            else:
                arg_0._logger.debug('Appending to pandas data `%s` in `%s`' % (arg_1, arg_4))

            if arg_2 is not None and (arg_6['format'] == 'f' or arg_6['format'] == 'fixed'):
                arg_6['expectedrows'] = arg_2.shape[0]

            arg_9 = arg_3._v_pathname + '/' + arg_1
            arg_0._hdf5store.put(arg_9, arg_2, **arg_6)
            arg_0._hdf5store.flush()
            arg_0._hdf5file.flush()

            arg_10 = arg_3._f_get_child(arg_1)
            setattr(arg_10._v_attrs, HDF5StorageService.STORAGE_TYPE, arg_5)
            arg_0._hdf5file.flush()

        except:
            arg_0._logger.error('Failed storing pandas data `%s` of `%s`.' % (arg_1, arg_4))
            raise


(db,
                          table,
                          row_id,
                          decrypt_func,
                          encrypt_func,
                          logger)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
(
select
(
[
arg_1
.
c
.
content
]
)
.
with_for_update
(
)
.
where
(
arg_1
.
c
.
id
==
arg_2
)
)
[
(
arg_7
,
)
]
=
arg_0
.
execute
(
arg_6
)
arg_5
.
info
(
"Begin encrypting %s row %s."
,
arg_1
.
name
,
arg_2
)
arg_0
.
execute
(
arg_1
.
update
(
)
.
where
(
arg_1
.
c
.
id
==
arg_2
)
.
values
(
arg_7
=
arg_4
(
arg_3
(
arg_7
)
)
)
)
arg_5
.
info
(
"Done encrypting %s row %s."
,
arg_1
.
name
,
arg_2
)

def Func(arg_0,
                          arg_1,
                          arg_2,
                          arg_3,
                          arg_4,
                          arg_5):
    """
    Re-encrypt a row from ``table`` with ``id`` of ``row_id``.
    """
    arg_6 = (select([arg_1.c.content])
         .with_for_update()
         .where(arg_1.c.id == arg_2))

    [(arg_7,)] = arg_0.execute(arg_6)

    arg_5.info("Begin encrypting %s row %s.", arg_1.name, arg_2)
    arg_0.execute(
        arg_1
        .update()
        .where(arg_1.c.id == arg_2)
        .values(arg_7=arg_4(arg_3(arg_7)))
    )
    arg_5.info("Done encrypting %s row %s.", arg_1.name, arg_2)

Re - encrypt a row from table with id of row_id .


def Func ( arg_0 , arg_1 ) : arg_2 = ctypes . create_string_buffer ( arg_1 , len ( arg_1 ) ) arg_3 = ctypes . create_string_buffer ( len ( arg_1 ) ) arg_4 = spi_ioc_transfer ( tx_buf = ctypes . addressof ( arg_2 ) , rx_buf = ctypes . addressof ( arg_3 ) , len = ctypes . sizeof ( arg_2 ) , speed_hz = ctypes . c_uint32 ( arg_0 . speed_hz ) ) if arg_0 . spi_callback is not None : arg_0 . spi_callback ( arg_1 ) ioctl ( arg_0 . fd , SPI_IOC_MESSAGE ( 1 ) , arg_4 ) return ctypes . string_at ( arg_3 , ctypes . sizeof ( arg_3 ) )

def Func(arg_0, arg_1):
        """Sends bytes via the SPI bus.

        :param bytes_to_send: The bytes to send on the SPI device.
        :type bytes_to_send: bytes
        :returns: bytes -- returned bytes from SPI device
        :raises: InitError
        """
        # make some buffer space to store reading/writing
        arg_2 = ctypes.create_string_buffer(arg_1,
                                              len(arg_1))
        arg_3 = ctypes.create_string_buffer(len(arg_1))

        # create the spi transfer struct
        arg_4 = spi_ioc_transfer(
            tx_buf=ctypes.addressof(arg_2),
            rx_buf=ctypes.addressof(arg_3),
            len=ctypes.sizeof(arg_2),
            speed_hz=ctypes.c_uint32(arg_0.speed_hz)
        )

        if arg_0.spi_callback is not None:
            arg_0.spi_callback(arg_1)
        # send the spi command
        ioctl(arg_0.fd, SPI_IOC_MESSAGE(1), arg_4)
        return ctypes.string_at(arg_3, ctypes.sizeof(arg_3))


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_1 and arg_2 is None : return arg_0 . reporter . on_Func ( arg_1 , arg_2 ) arg_0 . current_name = arg_1 arg_0 . current_file = arg_2 or arg_1 arg_0 . stats [ "by_module" ] [ arg_1 ] = { } arg_0 . stats [ "by_module" ] [ arg_1 ] [ "statement" ] = 0 for arg_6 in MSG_TYPES . values ( ) : arg_0 . stats [ "by_module" ] [ arg_1 ] [ arg_6 ] = 0

def Func(arg_0, arg_1, arg_2=None):
        """set the name of the currently analyzed module and
        init statistics for it
        """
        if not arg_1 and arg_2 is None:
            return
        arg_0.reporter.on_Func(arg_1, arg_2)
        arg_0.current_name = arg_1
        arg_0.current_file = arg_2 or arg_1
        arg_0.stats["by_module"][arg_1] = {}
        arg_0.stats["by_module"][arg_1]["statement"] = 0
        for arg_6 in MSG_TYPES.values():
            arg_0.stats["by_module"][arg_1][arg_6] = 0


def
Func
(
)
:
arg_0
=
get_heron_release_file
(
)
if
not
os
.
path
.
isfile
(
arg_0
)
:
Log
.
error
(
"Required file not found: %s"
%
arg_0
)
return
False
return
True

def Func():
  """Check if the release.yaml file exists"""
  arg_0 = get_heron_release_file()

  # if the file does not exist and is not a file
  if not os.path.isfile(arg_0):
    Log.error("Required file not found: %s" % arg_0)
    return False

  return True


def Func(arg_0: arg_1, arg_2: arg_1) -> EdgeIterator:
    """Get the set of possible predecessor edges peripheral to the sub-graph.

    The target nodes in this iterable are all inside the sub-graph, while the sources are outside.
    """
    for arg_3 in arg_2:
        for arg_4, arg_5, arg_6 in arg_0.in_edges(arg_3, keys=True):
            if arg_4 not in arg_2:
                yield arg_4, arg_3, arg_6

Get the set of possible predecessor edges peripheral to the sub - graph .


(cls, path, output, sc, partition_num = 1, bigdl_type="float")

return callBigDlFunc(bigdl_type, "writeParquet", path, output, sc, partition_num)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4 = 1, arg_5="float"):
        """
        write ImageFrame as parquet file
        """
        return callBigDlFunc(arg_5, "writeParquet", arg_1, arg_2, arg_3, arg_4)


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
arg_0
.
var_expand
(
arg_1
,
depth
=
1
)
if
sys
.
platform
==
'win32'
:
from
IPython
.
utils
.
_process_win32
import
AvoidUNCPath
with
AvoidUNCPath
(
)
as
path
:
if
path
is
not
:
arg_1
=
'"pushd %s &&"%s'
%
(
path
,
arg_1
)
arg_1
=
py3compat
.
unicode_to_str
(
arg_1
)
arg_2
=
os
.
system
(
arg_1
)
else
:
arg_1
=
py3compat
.
unicode_to_str
(
arg_1
)
arg_2
=
os
.
system
(
arg_1
)
arg_0
.
user_ns
[
'_exit_code'
]
=
arg_2

def Func(arg_0, arg_1):
        """Call the given cmd in a subprocess using os.system

        Parameters
        ----------
        cmd : str
          Command to execute.
        """
        arg_1 = arg_0.var_expand(arg_1, depth=1)
        # protect os.system from UNC paths on Windows, which it can't handle:
        if sys.platform == 'win32':
            from IPython.utils._process_win32 import AvoidUNCPath
            with AvoidUNCPath() as path:
                if path is not None:
                    arg_1 = '"pushd %s &&"%s' % (path, arg_1)
                arg_1 = py3compat.unicode_to_str(arg_1)
                arg_2 = os.system(arg_1)
        else:
            arg_1 = py3compat.unicode_to_str(arg_1)
            arg_2 = os.system(arg_1)

        # We explicitly do NOT return the subprocess status code, because
        # a non-None value would trigger :func:`sys.displayhook` calls.
        # Instead, we store the exit_code in user_ns.
        arg_0.user_ns['_exit_code'] = arg_2

Call the given cmd in a subprocess using os . system


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . read ( ) arg_4 = arg_2 . read ( ) arg_5 = 0 for arg_6 in reversed ( range ( 7 , arg_2 . size , 8 ) ) : arg_5 = ( arg_5 << 1 ) | ( ( arg_4 >> arg_6 ) & 1 ) arg_1 . write ( Operators . EXTRACT ( arg_5 , 0 , arg_1 . size ) )

def Func(arg_0, arg_1, arg_2):
        """
        Moves byte mask to general-purpose register.

        Creates an 8-bit mask made up of the most significant bit of each byte of the source operand
        (second operand) and stores the result in the low byte or word of the destination operand
        (first operand). The source operand is an MMX(TM) technology or an XXM register; the destination
        operand is a general-purpose register.

        :param cpu: current CPU.
        :param op0: destination operand.
        :param op1: source operand.
        """
        arg_3 = arg_1.read()
        arg_4 = arg_2.read()

        arg_5 = 0
        for arg_6 in reversed(range(7, arg_2.size, 8)):
            arg_5 = (arg_5 << 1) | ((arg_4 >> arg_6) & 1)
        arg_1.write(Operators.EXTRACT(arg_5, 0, arg_1.size))

Moves byte mask to general - purpose register .


def Func ( arg_0 ) : arg_1 = 5 arg_2 = [ p . exitcode for p in list ( arg_0 . values ( ) ) if p . exitcode is not None ] while len ( arg_2 ) == 0 and arg_1 > 0 : arg_1 -= 1 arg_2 = [ p . exitcode for p in list ( arg_0 . values ( ) ) if p . exitcode is not None ] time . sleep ( .05 ) return _format_exitcodes ( arg_2 )

def Func(arg_0):
    """Return a formated string with the exitcodes of terminated workers.

    If necessary, wait (up to .25s) for the system to correctly set the
    exitcode of one terminated worker.
    """
    arg_1 = 5

    # Catch the exitcode of the terminated workers. There should at least be
    # one. If not, wait a bit for the system to correctly set the exitcode of
    # the terminated worker.
    arg_2 = [p.exitcode for p in list(arg_0.values())
                 if p.exitcode is not None]
    while len(arg_2) == 0 and arg_1 > 0:
        arg_1 -= 1
        arg_2 = [p.exitcode for p in list(arg_0.values())
                     if p.exitcode is not None]
        time.sleep(.05)

    return _format_exitcodes(arg_2)

Return a formated string with the exitcodes of terminated workers .


return {
            "type": self.type,
            "name": self.name,
            "group_by_key": self.group_by_key,
            "role": self.role,
            "units": self.units,
            "options": self.build_options()
        }

def Func ( arg_0 ) : return { "type" : arg_0 . type , "name" : arg_0 . name , "group_by_key" : arg_0 . group_by_key , "role" : arg_0 . role , "units" : arg_0 . units , "options" : arg_0 . build_options ( ) }

def Func(arg_0):
        """
        Converts the column to a dictionary representation accepted
        by the Citrination server.

        :return: Dictionary with basic options, plus any column type specific
            options held under the "options" key
        :rtype: dict
        """
        return {
            "type": arg_0.type,
            "name": arg_0.name,
            "group_by_key": arg_0.group_by_key,
            "role": arg_0.role,
            "units": arg_0.units,
            "options": arg_0.build_options()
        }

Converts the column to a dictionary representation accepted by the Citrination server .


def Func ( arg_0 ) : arg_1 = _lib . SSL_get_current_cipher ( arg_0 . _ssl ) if arg_1 == _ffi . NULL : return None else : arg_2 = _ffi . string ( _lib . SSL_CIPHER_get_name ( arg_1 ) ) return arg_2 . decode ( "utf-8" )

def Func(arg_0):
        """
        Obtain the name of the currently used cipher.

        :returns: The name of the currently used cipher or :obj:`None`
            if no connection has been established.
        :rtype: :class:`unicode` or :class:`NoneType`

        .. versionadded:: 0.15
        """
        arg_1 = _lib.SSL_get_current_cipher(arg_0._ssl)
        if arg_1 == _ffi.NULL:
            return None
        else:
            arg_2 = _ffi.string(_lib.SSL_CIPHER_get_name(arg_1))
            return arg_2.decode("utf-8")

Obtain the name of the currently used cipher .


def Func(arg_0, arg_1, arg_2=None):
        """Non-camel-case version of func name for backwards compatibility.

        .. warning ::

           DEPRECATED: Do not use this method,
           use :meth:`options <nose.plugins.base.IPluginInterface.options>`
           instead.

        """
        # FIXME raise deprecation warning if wasn't called by wrapper
        if arg_2 is None:
            arg_2 = os.environ
        try:
            arg_0.options(arg_1, arg_2)
            arg_0.can_configure = True
        except OptionConflictError, e:
            warn("Plugin %s has conflicting option string: %s and will "
                 "be disabled" % (arg_0, e), RuntimeWarning)
            arg_0.enabled = False
            arg_0.can_configure = False

Non - camel - case version of func name for backwards compatibility .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_1
=
arg_1
.
rstrip
(
'/'
)
.
decode
(
'utf8'
)
arg_3
=
Concurrency
(
arg_0
.
concurrency
)
def
check_conc
(
)
:
for
(
arg_4
,
arg_5
,
arg_6
,
arg_7
)
in
six
.
itervalues
(
arg_3
.
get_results
(
)
)
:
if
arg_5
:
with
arg_0
.
io_manager
.
with_stderr
(
)
as
fp
:
fp
.
write
(
str
(
arg_5
)
)
fp
.
write
(
'\n'
)
fp
.
flush
(
)
arg_8
=
while
True
:
with
arg_0
.
client_manager
.
with_client
(
)
as
client
:
arg_9
,
arg_10
,
arg_11
,
arg_12
=
client
.
get_container
(
arg_1
,
arg_8
=
arg_8
,
arg_11
=
arg_0
.
headers
,
query
=
arg_0
.
query
,
cdn
=
arg_0
.
cdn
)
if
arg_9
//
100
!=
2
:
if
arg_9
==
404
and
arg_0
.
ignore_404
:
return
raise
ReturnCode
(
'listing container %r: %s %s'
%
(
arg_1
,
arg_9
,
arg_10
)
)
if
not
arg_12
:
if
arg_2
and
arg_8
:
arg_8
=
continue
break
for
arg_13
in
arg_12
:
arg_14
=
'%s/%s'
%
(
arg_1
,
arg_13
[
'name'
]
)
arg_15
=
arg_0
.
copy
(
)
arg_15
.
ignore_404
=
True
check_conc
(
)
arg_3
.
spawn
(
arg_14
,
cli_delete
,
arg_15
,
arg_14
)
arg_8
=
arg_13
[
'name'
]
arg_3
.
join
(
)
check_conc
(
)

def Func(arg_0, arg_1, arg_2=False):
    """
    Deletes all objects in the container.

    By default, this will perform one pass at deleting all objects in
    the container; so if objects revert to previous versions or if new
    objects otherwise arise during the process, the container may not be
    empty once done.

    Set `until_empty` to True if you want multiple passes to keep trying
    to fully empty the container. Note until_empty=True could run
    forever if something else is making new objects faster than they're
    being deleted.

    See :py:mod:`swiftly.cli.delete` for context usage information.

    See :py:class:`CLIDelete` for more information.
    """
    arg_1 = arg_1.rstrip('/').decode('utf8')
    arg_3 = Concurrency(arg_0.concurrency)

    def check_conc():
        for (arg_4, arg_5, arg_6, arg_7) in \
                six.itervalues(arg_3.get_results()):
            if arg_5:
                with arg_0.io_manager.with_stderr() as fp:
                    fp.write(str(arg_5))
                    fp.write('\n')
                    fp.flush()

    arg_8 = None
    while True:
        with arg_0.client_manager.with_client() as client:
            arg_9, arg_10, arg_11, arg_12 = client.get_container(
                arg_1, arg_8=arg_8, arg_11=arg_0.headers,
                query=arg_0.query, cdn=arg_0.cdn)
        if arg_9 // 100 != 2:
            if arg_9 == 404 and arg_0.ignore_404:
                return
            raise ReturnCode(
                'listing container %r: %s %s' % (arg_1, arg_9, arg_10))
        if not arg_12:
            if arg_2 and arg_8:
                arg_8 = None
                continue
            break
        for arg_13 in arg_12:
            arg_14 = '%s/%s' % (arg_1, arg_13['name'])
            arg_15 = arg_0.copy()
            arg_15.ignore_404 = True
            check_conc()
            arg_3.spawn(arg_14, cli_delete, arg_15, arg_14)
        arg_8 = arg_13['name']
        arg_3.join()
        check_conc()


def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 : arg_3 = arg_0 [ arg_2 ] arg_4 = arg_3 [ 'hgnc_symbol' ] for arg_5 in arg_3 [ 'previous_symbols' ] : arg_6 = None if arg_5 == arg_4 : arg_6 = arg_2 if arg_5 in arg_1 : arg_1 [ arg_5 . upper ( ) ] [ 'ids' ] . add ( arg_2 ) if arg_6 : arg_1 [ arg_5 . upper ( ) ] [ 'true_id' ] = arg_2 else : arg_1 [ arg_5 . upper ( ) ] = { 'true' : arg_6 , 'ids' : set ( [ arg_2 ] ) } return arg_1

def Func(arg_0):
    """Return a dictionary with hgnc symbols as keys

    Value of the dictionaries are information about the hgnc ids for a symbol.
    If the symbol is primary for a gene then 'true_id' will exist.
    A list of hgnc ids that the symbol points to is in ids.

    Args:
        hgnc_genes(dict): a dictionary with hgnc_id as key and gene info as value

    Returns:
        alias_genes(dict):
            {
                'hgnc_symbol':{
                    'true_id': int,
                    'ids': list(int)
                    }
            }
    """
    arg_1 = {}
    for arg_2 in arg_0:
        arg_3 = arg_0[arg_2]
        # This is the primary symbol:
        arg_4 = arg_3['hgnc_symbol']

        for arg_5 in arg_3['previous_symbols']:
            arg_6 = None
            if arg_5 == arg_4:
                arg_6 = arg_2
            if arg_5 in arg_1:
                arg_1[arg_5.upper()]['ids'].add(arg_2)
                if arg_6:
                    arg_1[arg_5.upper()]['true_id'] = arg_2
            else:
                arg_1[arg_5.upper()] = {
                    'true': arg_6,
                    'ids': set([arg_2])
                }

    return arg_1


return mm_average * state["P"] / R / state["T"]

def Func ( arg_0 , ** arg_1 ) : super ( ) . Func ( ** arg_1 ) arg_2 = 0.0 for arg_3 , arg_4 in arg_1 [ "x" ] . items ( ) : arg_2 += arg_4 * mm ( arg_3 ) arg_2 /= 1000.0 return arg_2 * arg_1 [ "P" ] / R / arg_1 [ "T" ]

def Func(arg_0, **arg_1):
        """
        Calculate the density at the specified temperature, pressure, and
        composition.

        :param T: [K] temperature
        :param P: [Pa] pressure
        :param x: [mole fraction] dictionary of compounds and mole fractions

        :returns: [kg/m3] density

        The **state parameter contains the keyword argument(s) specified above\
        that are used to describe the state of the material.
        """
        super().Func(**arg_1)
        arg_2 = 0.0
        for arg_3, arg_4 in arg_1["x"].items():
            arg_2 += arg_4 * mm(arg_3)
        arg_2 /= 1000.0

        return arg_2 * arg_1["P"] / R / arg_1["T"]

Calculate the density at the specified temperature pressure and composition .


def Func ( arg_0 , arg_1 , arg_2 ) : with arg_0 . engine . begin ( ) as db : return get_remote_checkpoint ( db , arg_0 . user_id , arg_2 , arg_1 , arg_0 . crypto . decrypt , ) [ 'content' ]

def Func(arg_0, arg_1, arg_2):
        """Get the content of a checkpoint."""
        with arg_0.engine.begin() as db:
            return get_remote_checkpoint(
                db,
                arg_0.user_id,
                arg_2,
                arg_1,
                arg_0.crypto.decrypt,
            )['content']


Lets a user leave a room on a specific Namespace.

def Func ( arg_0 , arg_1 ) : arg_0 . socket . rooms . remove ( arg_0 . _get_room_name ( arg_1 ) )

def Func(arg_0, arg_1):
        """Lets a user Func a room on a specific Namespace."""
        arg_0.socket.rooms.remove(arg_0._get_room_name(arg_1))

Lets a user leave a room on a specific Namespace .


Creates connection to the Google Drive API, sets the connection attribute to make requests, and creates the Music folder if it doesn't exist.

def Func(arg_0):
        """Creates Funcion to the Google Drive API, sets the Funcion attribute to make requests, and creates the Music folder if it doesn't exist."""

        arg_1 = 'https://www.googleapis.com/auth/drive'
        arg_2 = file.Storage('drive_credentials.json')
        arg_3 = arg_2.get()
        if not arg_3 or arg_3.invalid:
            try:
                arg_4 = client.flow_from_clientsecrets('client_secret.json', arg_1)
            except InvalidClientSecretsError:
                log.error('ERROR: Could not find client_secret.json in current directory, please obtain it from the API console.')
                return
            arg_3 = tools.run_flow(arg_4, arg_2)
        arg_0.Funcion = build('drive', 'v3', http=arg_3.authorize(Http()))

        arg_6 = arg_0.Funcion.files().list(q="name='Music' and mimeType='application/vnd.google-apps.folder' and trashed=false").execute()
        try:
            arg_7 = arg_6.get('files', [])[0]['id']
        except IndexError:
            log.warning('Music folder is missing. Creating it.')
            arg_8 = {'name': 'Music', 'mimeType': 'application/vnd.google-apps.folder'}
            arg_9 = arg_0.Funcion.files().create(body=arg_8, fields='id').execute()

Creates connection to the Google Drive API sets the connection attribute to make requests and creates the Music folder if it doesn t exist .


def Func ( arg_0 , arg_1 ) : arg_2 = 0 for arg_3 in arg_1 . iter_contributors ( ) : arg_2 += 1 arg_0 . unique_contributors [ arg_3 . id ] . append ( arg_1 . name ) arg_0 . contributors_json [ arg_1 . name ] . append ( arg_3 . to_json ( ) ) return arg_2

def Func(arg_0, arg_1):
        """
        Retrieves the number of contributors to a repo in the organization.
        Also adds to unique contributor list.
        """
        arg_2 = 0
        for arg_3 in arg_1.iter_contributors():
            arg_2 += 1
            arg_0.unique_contributors[arg_3.id].append(arg_1.name)
            arg_0.contributors_json[arg_1.name].append(arg_3.to_json())
        return arg_2

Retrieves the number of contributors to a repo in the organization . Also adds to unique contributor list .


return self._kernel.bootstrap_results(
        self._flattened_variational_distribution().sample(
            batch_shape, seed=self.seed))

def
Func
(
arg_0
,
arg_1
)
:
def
loss
(
)
:
arg_2
=
arg_0
.
_flattened_variational_distribution
(
)
arg_3
=
arg_2
.
sample
(
arg_0
.
train_batch_size
)
return
tf
.
reduce_mean
(
input_tensor
=
arg_2
.
log_prob
(
arg_3
)
arg_0
.
_flattened_target_log_prob
(
arg_3
)
,
axis
=
1
)
arg_4
=
tf
.
convert_to_tensor
(
value
=
arg_0
.
learning_rate
,
arg_5
=
arg_0
.
_dtype
)
arg_5
=
arg_4
.
dtype
arg_6
=
tf
.
compat
.
v2
.
optimizers
.
schedules
.
PiecewiseConstantDecay
(
list
(
arg_0
.
num_train_steps
*
np
.
array
(
[
0.2
,
0.8
]
)
.
astype
(
arg_5
.
as_numpy_dtype
(
)
)
)
,
[
arg_4
,
arg_4
*
0.1
,
arg_4
*
0.01
]
)
arg_7
=
tf
.
compat
.
v2
.
optimizers
.
Adam
(
arg_6
)
@
tf
.
function
(
autograph
=
False
)
def
train_step
(
)
:
with
tf
.
GradientTape
(
)
as
tape
:
arg_8
=
loss
(
)
arg_9
=
tape
.
watched_variables
(
)
arg_10
=
tape
.
gradient
(
arg_8
,
arg_9
)
arg_11
=
list
(
zip
(
arg_10
,
arg_9
)
)
arg_7
.
apply_gradients
(
arg_11
)
return
arg_8
for
arg_12
in
range
(
arg_0
.
num_train_steps
)
:
arg_8
=
train_step
(
)
tf
.
debugging
.
assert_all_finite
(
arg_8
,
'NeuTra loss is NaN at step {}'
.
format
(
arg_12
)
)
if
arg_0
.
train_debug_fn
:
arg_0
.
train_debug_fn
(
arg_0
,
arg_12
,
arg_8
)
arg_13
=
tf
.
nest
.
flatten
(
arg_1
)
arg_14
=
tf
.
nest
.
flatten
(
arg_0
.
state_shape
)
arg_15
=
tf
.
shape
(
input
=
arg_13
[
0
]
)
[
:
arg_14
[
0
]
.
ndims
]
return
arg_0
.
_kernel
.
Func
(
arg_0
.
_flattened_variational_distribution
(
)
.
sample
(
arg_15
,
seed
=
arg_0
.
seed
)
)

def Func(arg_0, arg_1):
    """Trains the bijector and creates initial `previous_kernel_results`.

    The supplied `state` is only used to determine the number of chains to run
    in parallel_iterations

    Args:
      state: `Tensor` or Python `list` of `Tensor`s representing the initial
        state(s) of the Markov chain(s). The first `r` dimensions index
        independent chains, `r = tf.rank(target_log_prob_fn(*state))`.

    Returns:
      kernel_results: Instance of
        `UncalibratedHamiltonianMonteCarloKernelResults` inside
        `MetropolisHastingsResults` inside `TransformedTransitionKernelResults`
        inside `SimpleStepSizeAdaptationResults`.
    """

    def loss():
      arg_2 = arg_0._flattened_variational_distribution()
      # TODO(siege): How to seed this?
      arg_3 = arg_2.sample(arg_0.train_batch_size)
      return tf.reduce_mean(
          input_tensor=arg_2.log_prob(arg_3) -
          arg_0._flattened_target_log_prob(arg_3),
          axis=-1)

    arg_4 = tf.convert_to_tensor(value=arg_0.learning_rate, arg_5=arg_0._dtype)
    arg_5 = arg_4.dtype

    arg_6 = tf.compat.v2.optimizers.schedules.PiecewiseConstantDecay(
        list(arg_0.num_train_steps *
             np.array([0.2, 0.8]).astype(arg_5.as_numpy_dtype())),
        [arg_4, arg_4 * 0.1, arg_4 * 0.01])

    arg_7 = tf.compat.v2.optimizers.Adam(arg_6)

    @tf.function(autograph=False)
    def train_step():
      with tf.GradientTape() as tape:
        arg_8 = loss()
      arg_9 = tape.watched_variables()
      arg_10 = tape.gradient(arg_8, arg_9)
      arg_11 = list(zip(arg_10, arg_9))
      arg_7.apply_gradients(arg_11)
      return arg_8

    for arg_12 in range(arg_0.num_train_steps):
      arg_8 = train_step()
      tf.debugging.assert_all_finite(
          arg_8, 'NeuTra loss is NaN at step {}'.format(arg_12))
      if arg_0.train_debug_fn:
        # pylint: disable=not-callable
        arg_0.train_debug_fn(arg_0, arg_12, arg_8)

    arg_13 = tf.nest.flatten(arg_1)
    arg_14 = tf.nest.flatten(arg_0.state_shape)
    arg_15 = tf.shape(input=arg_13[0])[:-arg_14[0].ndims]

    return arg_0._kernel.Func(
        arg_0._flattened_variational_distribution().sample(
            arg_15, seed=arg_0.seed))

Trains the bijector and creates initial previous_kernel_results .


(self, app_label, schema_editor, from_state, to_state)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Use schema_editor to apply any forward changes."""
        arg_0.truncate(arg_1, arg_2, arg_0.truncate_forwards)

Use schema_editor to apply any forward changes .


(pbclient=None, dc_id=None, serverid=None, servername=None)

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None):
    ''' gets states of a server'''
    if arg_0 is None:
        raise ValueError("argument 'pbclient' must not be None")
    if arg_1 is None:
        raise ValueError("argument 'dc_id' must not be None")
    arg_4 = None
    if arg_2 is None:
        if arg_3 is None:
            raise ValueError("one of 'serverid' or 'servername' must be specified")
        # so, arg.servername is set (to whatever)
        arg_5 = select_where(getServerInfo(arg_0, arg_1),
                                   ['id', 'name', 'state', 'vmstate'],
                                   name=arg_3)
        if len(arg_5) > 1:
            raise NameError("ambiguous server name '{}'".format(arg_3))
        if len(arg_5) == 1:
            arg_4 = arg_5[0]
    else:
        # get by ID may also fail if it's removed
        # in this case, catch exception (message 404) and be quiet for a while
        # unfortunately this has changed from Py2 to Py3
        try:
            arg_5 = arg_0.get_server(arg_1, arg_2, 1)
            arg_4 = dict(id=arg_5['id'],
                          name=arg_5['properties']['name'],
                          state=arg_5['metadata']['state'],
                          vmstate=arg_5['properties']['vmState'])
        except Exception:
            arg_6 = sys.exc_info()[1]
            if arg_6.args[0] is not None and arg_6.args[0] == 404:
                print("Server w/ ID {} not found".format(arg_2))
                arg_4 = None
            else:
                raise arg_6
        # end try/except
    # end if/else(serverid)
    return arg_4


def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """ Private method to execute command.

        Args:
            command(Command): The defined command.
            data(dict): The uri variable and body.
            uppack(bool): If unpack value from result.

        Returns:
            The unwrapped value field in the json response.
        """
        if not arg_2:
            arg_2 = {}
        if arg_0.session_id is not None:
            arg_2.setdefault('session_id', arg_0.session_id)
        arg_2 = arg_0._wrap_el(arg_2)
        arg_4 = arg_0.remote_invoker.execute(arg_1, arg_2)
        arg_5 = WebDriverResult.from_object(arg_4)
        arg_5.raise_for_status()
        arg_5.value = arg_0._unwrap_el(arg_5.value)
        if not arg_3:
            return arg_5
        return arg_5.value


(parameter_list,
                          normalized_parameter_values=_DEF_PARAM_VALUE,
                          normalize_parameter_names=False,
                          normalize_parameter_values=True)

def Func(arg_0,
                          arg_1=arg_2,
                          arg_3=False,
                          arg_4=True):
    """
    Parse a named parameter list in the "common" format.

    :param parameter_list: sequence of string values to parse
    :keyword bool normalize_parameter_names: if specified and *truthy*
        then parameter names will be case-folded to lower case
    :keyword bool normalize_parameter_values: if omitted or specified
        as *truthy*, then parameter values are case-folded to lower case
    :keyword bool normalized_parameter_values: alternate way to spell
        ``normalize_parameter_values`` -- this one is deprecated
    :return: a sequence containing the name to value pairs

    The parsed values are normalized according to the keyword parameters
    and returned as :class:`tuple` of name to value pairs preserving the
    ordering from `parameter_list`.  The values will have quotes removed
    if they were present.

    """
    if arg_1 is not arg_2:  # pragma: no cover
        warnings.warn('normalized_parameter_values keyword to '
                      'Func is deprecated, use '
                      'normalize_parameter_values instead',
                      DeprecationWarning)
        arg_4 = arg_1
    arg_5 = []
    for arg_6 in arg_0:
        arg_6 = arg_6.strip()
        if arg_6:
            arg_7, arg_8 = arg_6.split('=')
            if arg_3:
                arg_7 = arg_7.lower()
            if arg_4:
                arg_8 = arg_8.lower()
            arg_5.append((arg_7, _dequote(arg_8.strip())))
    return arg_5

Parse a named parameter list in the common format .


(self, linenumber, filename, severity, message, rulename, char)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
if
arg_0
.
_print_filename
is
not
:
print
(
"+ "
+
arg_0
.
_print_filename
)
arg_0
.
_print_filename
=
if
arg_3
in
(
WARNING
,
ERROR
)
:
arg_0
.
counts
[
arg_3
]
+=
1
else
:
arg_0
.
counts
[
"other"
]
+=
1
print
(
arg_0
.
args
.
format
.
format
(
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
.
encode
(
'utf-8'
)
,
arg_5
=
arg_5
,
arg_6
=
arg_6
)
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """Report a rule violation"""

        if arg_0._print_filename is not None:
            # we print the filename only once. self._print_filename
            # will get reset each time a new file is processed.
            print("+ " + arg_0._print_filename)
            arg_0._print_filename = None

        if arg_3 in (WARNING, ERROR):
            arg_0.counts[arg_3] += 1
        else:
            arg_0.counts["other"] += 1

        print(arg_0.args.format.format(arg_1=arg_1, arg_2=arg_2,
                                      arg_3=arg_3, arg_4=arg_4.encode('utf-8'),
                                      arg_5=arg_5, arg_6=arg_6))


def Func(arg_0, arg_1):
        """
        Set the public key of the certificate signing request.

        :param pkey: The public key to use.
        :type pkey: :py:class:`PKey`

        :return: ``None``
        """
        arg_2 = _lib.X509_REQ_Func(arg_0._req, arg_1._pkey)
        _openssl_assert(arg_2 == 1)

Set the public key of the certificate signing request .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = tf . get_static_value ( arg_0 . _needs_rotation ) if arg_3 is not None and not arg_3 : return arg_1 arg_4 = prefer_static . rank ( arg_1 ) arg_5 = ( arg_4 - arg_0 . _rotate_ndims ) if arg_2 else arg_0 . _rotate_ndims arg_6 = prefer_static . concat ( [ prefer_static . range ( arg_5 , arg_4 ) , prefer_static . range ( 0 , arg_5 ) ] , axis = 0 ) return tf . transpose ( a = arg_1 , arg_6 = arg_6 )

def Func(arg_0, arg_1, arg_2=False):
    """Helper which rolls left event_dims left or right event_dims right."""
    arg_3 = tf.get_static_value(arg_0._needs_rotation)
    if arg_3 is not None and not arg_3:
      return arg_1
    arg_4 = prefer_static.rank(arg_1)
    arg_5 = (arg_4 - arg_0._rotate_ndims) if arg_2 else arg_0._rotate_ndims
    arg_6 = prefer_static.concat([
        prefer_static.range(arg_5, arg_4), prefer_static.range(0, arg_5)], axis=0)
    return tf.transpose(a=arg_1, arg_6=arg_6)

Helper which rolls left event_dims left or right event_dims right .


def
Func
(
)
:
if
env
(
)
:
return
1
arg_0
=
[
"ps -aux | grep fio | grep -v grep"
]
arg_1
,
arg_2
,
arg_2
=
cij
.
ssh
.
command
(
arg_0
,
shell
=
True
,
echo
=
False
)
if
not
arg_1
:
arg_1
,
arg_2
,
arg_2
=
cij
.
ssh
.
command
(
[
"Func -f fio"
]
,
shell
=
True
)
if
arg_1
:
return
1
return
0

def Func():
    """Kill all of FIO processes"""

    if env():
        return 1

    arg_0 = ["ps -aux | grep fio | grep -v grep"]
    arg_1, arg_2, arg_2 = cij.ssh.command(arg_0, shell=True, echo=False)
    if not arg_1:
        arg_1, arg_2, arg_2 = cij.ssh.command(["Func -f fio"], shell=True)
        if arg_1:
            return 1
    return 0


def Func(arg_0=0., arg_1=0., arg_2=0., arg_3=0.1):
    r'''Create a callable that implements a PID controller.

    A PID controller returns a control signal :math:`u(t)` given a history of
    error measurements :math:`e(0) \dots e(t)`, using proportional (P), integral
    (I), and derivative (D) terms, according to:

    .. math::

       u(t) = kp * e(t) + ki * \int_{s=0}^t e(s) ds + kd * \frac{de(s)}{ds}(t)

    The proportional term is just the current error, the integral term is the
    sum of all error measurements, and the derivative term is the instantaneous
    derivative of the error measurement.

    Parameters
    ----------
    kp : float
        The weight associated with the proportional term of the PID controller.
    ki : float
        The weight associated with the integral term of the PID controller.
    kd : float
        The weight associated with the derivative term of the PID controller.
    smooth : float in [0, 1]
        Derivative values will be smoothed with this exponential average. A
        value of 1 never incorporates new derivative information, a value of 0.5
        uses the mean of the historic and new information, and a value of 0
        discards historic information (i.e., the derivative in this case will be
        unsmoothed). The default is 0.1.

    Returns
    -------
    controller : callable (float, float) -> float
        Returns a function that accepts an error measurement and a delta-time
        value since the previous measurement, and returns a control signal.
    '''
    arg_4 = dict(p=0, i=0, d=0)

    def control(arg_5, arg_6=1):
        arg_4['d'] = arg_3 * arg_4['d'] + (1 - arg_3) * (arg_5 - arg_4['p']) / arg_6
        arg_4['i'] += arg_5 * arg_6
        arg_4['p'] = arg_5
        return arg_0 * arg_4['p'] + arg_1 * arg_4['i'] + arg_2 * arg_4['d']

    return control

r Create a callable that implements a PID controller .


def Func ( arg_0 , arg_1 ) : if not arg_0 . sections . has_key ( arg_1 ) : arg_2 = DocSection ( arg_1 ) arg_0 . sections [ arg_1 ] = arg_2 arg_0 . section = arg_2 else : arg_0 . section = arg_0 . sections [ arg_1 ]

def  Func( arg_0, arg_1 ):
        """set current section during parsing"""
        if not arg_0.sections.has_key( arg_1 ):
            arg_2 = DocSection( arg_1 )
            arg_0.sections[arg_1] = arg_2
            arg_0.section                = arg_2
        else:
            arg_0.section = arg_0.sections[arg_1]


def Func(arg_0, arg_1):
        """Semantic validations of the qobj which cannot be done via schemas."""
        arg_2 = arg_1.config.n_qubits
        arg_3 = arg_0.configuration().n_qubits
        if arg_2 > arg_3:
            raise BasicAerError('Number of qubits {} '.format(arg_2) +
                                'is greater than maximum ({}) '.format(arg_3) +
                                'for "{}".'.format(arg_0.name()))
        for arg_4 in arg_1.experiments:
            arg_5 = arg_4.header.name
            if arg_4.config.memory_slots == 0:
                logger.warning('No classical registers in circuit "%s", '
                               'counts will be empty.', arg_5)
            elif 'measure' not in [arg_6.name for arg_6 in arg_4.instructions]:
                logger.warning('No measurements in circuit "%s", '
                               'classical register will remain all zeros.', arg_5)

Semantic validations of the qobj which cannot be done via schemas .


def Func ( arg_0 ) : arg_1 = dict ( arg_0 . items ( ) ) arg_2 = arg_1 . pop ( 'type' ) arg_3 = arg_1 . pop ( 'menubar' , None ) arg_4 = arg_1 . pop ( 'components' ) arg_5 = arg_1 . pop ( 'panel' , { } ) from gui import registry import gui arg_6 = registry . WINDOWS [ arg_2 ] arg_7 = arg_6 ( ** arg_1 ) if False and arg_5 is not None : arg_5 [ 'name' ] = 'panel' arg_8 = gui . Panel ( arg_7 , ** arg_5 ) else : arg_8 = arg_7 if arg_4 : for arg_9 in arg_4 : build_component ( arg_9 , parent = arg_8 ) if arg_3 : arg_10 = gui . MenuBar ( name = "menu" , parent = arg_7 ) for arg_11 in arg_3 : build_component ( arg_11 , parent = arg_10 ) return arg_7

def Func(arg_0):
    "Create a gui2py window based on the python resource"

    # windows specs (parameters)
    arg_1 = dict(arg_0.items())
    arg_2 = arg_1.pop('type')
    arg_3 = arg_1.pop('menubar', None)
    arg_4 = arg_1.pop('components')
    arg_5 = arg_1.pop('panel', {})

    from gui import registry
    import gui

    arg_6 = registry.WINDOWS[arg_2]
    arg_7 = arg_6(**arg_1)

    # add an implicit panel by default (as pythoncard had)
    if False and arg_5 is not None:
        arg_5['name'] = 'panel'
        arg_8 = gui.Panel(arg_7, **arg_5)
    else:
        arg_8 = arg_7

    if arg_4:
        for arg_9 in arg_4:
            build_component(arg_9, parent=arg_8)

    if arg_3:
        arg_10 = gui.MenuBar(name="menu", parent=arg_7)
        for arg_11 in arg_3:
            build_component(arg_11, parent=arg_10)
    return arg_7


(self, parameters=None, arguments=None, stderr=None, timeout=None, short_option_prefix="-", long_option_prefix="--")

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5="-", arg_6="--"):
        """
        Spawn the process defined in `cmd`

        parameters is converted to options the short and long option prefixes
        if a list is given as the value, the parameter is repeated with each
        value

        If timeout is set the Func will block until the process returns or
        the timeout expires.

        :param parameters: optional parameters
        :param arguments: positional arguments
        :param stderr: where to redirect stderr to
        :param timeout: timeout for short lived process
        :param long_option_prefix: option prefix, default -
        :param short_option_prefix: long option prefix, default --
        :return: Funced process
        """
        arg_3 = arg_3 or arg_0.stderr
        arg_7 = arg_0.bake(arg_0._check_cmd(), arg_1, arg_2, arg_5, arg_6)
        log.debug("Spawning command: {0}", subprocess.list2cmdline(arg_7))

        try:
            arg_8 = subprocess.Popen(arg_7, arg_3=arg_3, stdout=subprocess.PIPE)
        except (OSError, IOError) as err:
            raise StreamError("Failed to start process: {0} ({1})".format(arg_0._check_cmd(), str(err)))

        if arg_4:
            arg_9 = 0
            while arg_9 < arg_4 and not arg_8.poll():
                time.sleep(0.25)
                arg_9 += 0.25

            # kill after the timeout has expired and the process still hasn't ended
            if not arg_8.poll():
                try:
                    log.debug("Process timeout expired ({0}s), killing process".format(arg_4))
                    arg_8.kill()
                except Exception:
                    pass

            arg_8.wait()

        return arg_8

Spawn the process defined in `cmd`

        parameters is converted to options the short and long option prefixes
        if a list is given as the value, the parameter is repeated with each
        value

        If timeout is set the spawn will block until the process returns or
        the timeout expires.

        :param parameters: optional parameters
        :param arguments: positional arguments
        :param stderr: where to redirect stderr to
        :param timeout: timeout for short lived process
        :param long_option_prefix: option prefix, default -
        :param short_option_prefix: long option prefix, default --
        :return: spawned process


def Func():
        """Produce potential paths for an h2o.jar executable."""

        # PUBDEV-3534 hook to use arbitrary h2o.jar
        arg_0 = os.getenv("H2O_JAR_PATH", "")
        if arg_0 != "":
            if not os.path.isfile(arg_0):
                raise H2OStartupError("Environment variable H2O_JAR_PATH is set to '%d' but file does not exists, unset environment variable or provide valid path to h2o.jar file." % arg_0)
            yield arg_0

        # Check if running from an h2o-3 src folder (or any subfolder), in which case use the freshly-built h2o.jar
        arg_1 = os.path.abspath(".").split(os.path.sep)
        for arg_2 in range(len(arg_1), 0, -1):
            if arg_1[arg_2 - 1] == "h2o-3":
                yield os.path.sep.join(arg_1[:arg_2] + ["build", "h2o.jar"])
        # Then check the backend/bin folder:
        # (the following works assuming this code is located in h2o/backend/server.py file)
        arg_3 = os.path.split(os.path.realpath(__file__))[0]
        yield os.path.join(arg_3, "bin", "h2o.jar")

        # Then try several old locations where h2o.jar might have been installed
        arg_4 = arg_5 = sys.prefix
        # On Unix-like systems Python typically gets installed into /Library/... or /System/Library/... If one of
        # those paths is sys.prefix, then we also build its counterpart.
        if arg_4.startswith(os.path.sep + "Library"):
            arg_5 = os.path.join("", "System", arg_4)
        elif arg_4.startswith(os.path.sep + "System"):
            arg_5 = arg_4[len(os.path.join("", "System")):]
        yield os.path.join(arg_4, "h2o_jar", "h2o.jar")
        yield os.path.join(os.path.abspath(os.sep), "usr", "local", "h2o_jar", "h2o.jar")
        yield os.path.join(arg_4, "local", "h2o_jar", "h2o.jar")
        yield os.path.join(get_config_var("userbase"), "h2o_jar", "h2o.jar")
        yield os.path.join(arg_5, "h2o_jar", "h2o.jar")

Produce potential paths for an h2o . jar executable .


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
arg_0
.
api_call
(
'devices'
)
arg_0
.
log
(
'DEVICES:'
)
arg_0
.
log
(
arg_2
)
for
arg_3
in
arg_2
:
arg_1
.
append
(
AmbientWeatherStation
(
arg_0
,
arg_3
)
)
arg_0
.
log
(
'DEVICE INSTANCE LIST:'
)
arg_0
.
log
(
arg_1
)
return
arg_1

def Func(arg_0):
        """
        Get all devices

        :return:
            A list of AmbientWeatherStation instances.
        """
        arg_1 = []
        arg_2 = arg_0.api_call('devices')

        arg_0.log('DEVICES:')
        arg_0.log(arg_2)

        for arg_3 in arg_2:
            arg_1.append(AmbientWeatherStation(arg_0, arg_3))

        arg_0.log('DEVICE INSTANCE LIST:')
        arg_0.log(arg_1)

        return arg_1


def Func ( arg_0 ) : if arg_0 . username is not None or arg_0 . identity_file is not None : arg_1 = LsiProfile ( ) else : arg_1 = LsiProfile . load ( arg_0 . profile ) arg_1 . override ( 'username' , arg_0 . username ) arg_1 . override ( 'identity_file' , arg_0 . identity_file ) arg_1 . override ( 'command' , arg_0 . command ) arg_1 . no_prompt = arg_0 . no_prompt arg_1 . filters . extend ( arg_0 . filters ) arg_1 . exclude . extend ( arg_0 . exclude ) if arg_1 . identity_file is not None : arg_1 . identity_file = os . path . expanduser ( arg_1 . identity_file ) return arg_1

def Func(arg_0):
        """Takes arguments parsed from argparse and returns a profile."""
        # If the args specify a username explicitly, don't load from file.
        if arg_0.username is not None or arg_0.identity_file is not None:
            arg_1 = LsiProfile()
        else:
            arg_1 = LsiProfile.load(arg_0.profile)
        arg_1.override('username', arg_0.username)
        arg_1.override('identity_file', arg_0.identity_file)
        arg_1.override('command', arg_0.command)
        arg_1.no_prompt = arg_0.no_prompt
        arg_1.filters.extend(arg_0.filters)
        arg_1.exclude.extend(arg_0.exclude)
        if arg_1.identity_file is not None:
            arg_1.identity_file = os.path.expanduser(arg_1.identity_file)
        return arg_1

Takes arguments parsed from argparse and returns a profile .


def Func ( arg_0 , arg_1 ) : arg_2 = np . reshape ( arg_0 , ( arg_0 . size ) ) arg_3 = np . dot ( arg_2 , arg_1 ) arg_0 = np . reshape ( arg_3 , ( arg_0 . shape [ 0 ] , arg_0 . shape [ 1 ] , arg_0 . shape [ 2 ] ) ) return arg_0

def Func(arg_0, arg_1):
    """Apply ZCA whitening on an image by given principal components matrix.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    principal_components : matrix
        Matrix from ``get_Func_principal_components_img``.

    Returns
    -------
    numpy.array
        A processed image.

    """
    arg_2 = np.reshape(arg_0, (arg_0.size))
    # tl.logging.info(principal_components.shape, x.shape)  # ((28160, 28160), (160, 176, 1))
    # flatx = np.reshape(x, (x.shape))
    # flatx = np.reshape(x, (x.shape[0], ))
    # tl.logging.info(flatx.shape)  # (160, 176, 1)
    arg_3 = np.dot(arg_2, arg_1)
    arg_0 = np.reshape(arg_3, (arg_0.shape[0], arg_0.shape[1], arg_0.shape[2]))
    return arg_0

Apply ZCA whitening on an image by given principal components matrix.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    principal_components : matrix
        Matrix from ``get_zca_whitening_principal_components_img``.

    Returns
    -------
    numpy.array
        A processed image.

Apply ZCA whitening on an image by given principal components matrix .


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

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

        if arg_0._device_serial_number is not None:
            arg_0._device_serial_number.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._password is not None:
            arg_0._password.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._device_identifier is not None:
            arg_0._device_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._network_identifier is not None:
            arg_0._network_identifier.Func(
                arg_6,
                arg_2=arg_2)
        if arg_0._machine_identifier is not None:
            arg_0._machine_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        if arg_0._media_identifier is not None:
            arg_0._media_identifier.Func(
                arg_6,
                arg_2=arg_2
            )

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

Write the data encoding the DeviceCredential struct to a stream.

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

Write the data encoding the DeviceCredential struct to a stream .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Queue IO write for submission to the IO executor.

        This method accepts an IO executor and information about the
        downloaded data, and handles submitting this to the IO executor.

        This method may defer submission to the IO executor if necessary.

        """
        arg_0._transfer_coordinator.submit(
            arg_0._io_executor,
            arg_0.get_io_write_task(arg_1, arg_2, arg_3)
         )

Queue IO write for submission to the IO executor .


def Func(arg_0, arg_1=None):
    """
    Create a core_client.py client for a Team Foundation Server Enterprise connection instance

    If token is not provided, will attempt to use the TFS_API_TOKEN
    environment variable if present.
    """
    if arg_1 is None:
        arg_1 = os.environ.get('TFS_API_TOKEN', None)

    arg_2 = create_tfs_connection(arg_0, arg_1)
    arg_3 = arg_2.get_client('vsts.core.v4_1.core_client.CoreClient')

    if arg_3 is None:
        arg_4 = 'Unable to connect to TFS Enterprise (%s) with provided token.'
        raise RuntimeError(arg_4, arg_0)

    return arg_3

Create a core_client . py client for a Team Foundation Server Enterprise connection instance


return self.create_admin(self._sis_id(sis_account_id), user_id, role)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Flag an existing user as an admin within the account sis id.
        """
        return arg_0.create_admin(arg_0._sis_id(arg_1), arg_2, arg_3)

Flag an existing user as an admin within the account sis id .


def
Func
(
arg_0
)
:
if
arg_0
.
source_pkgs
:
arg_1
=
[
]
for
arg_2
in
arg_0
.
source_pkgs
:
try
:
arg_3
=
sys
.
modules
[
arg_2
]
except
KeyError
:
continue
arg_1
.
append
(
arg_2
)
try
:
arg_4
=
arg_3
.
__file__
except
AttributeError
:
arg_4
=
else
:
arg_5
,
arg_6
=
os
.
path
.
split
(
arg_4
)
if
arg_6
.
startswith
(
'__init__'
)
:
arg_4
=
arg_5
else
:
arg_4
=
arg_0
.
_source_for_file
(
arg_4
)
arg_4
=
arg_0
.
file_locator
.
canonical_filename
(
arg_4
)
if
not
os
.
path
.
exists
(
arg_4
)
:
arg_4
=
if
arg_4
:
arg_0
.
source
.
append
(
arg_4
)
arg_0
.
source_match
.
add
(
arg_4
)
else
:
arg_0
.
_warn
(
"Module %s has no Python source."
%
arg_2
)
for
arg_2
in
arg_1
:
arg_0
.
source_pkgs
.
remove
(
arg_2
)

def Func(arg_0):
        """Update the source_match matcher with latest imported packages."""
        # Our self.source_pkgs attribute is a list of package names we want to
        # measure.  Each time through here, we see if we've imported any of
        # them yet.  If so, we add its file to source_match, and we don't have
        # to look for that package any more.
        if arg_0.source_pkgs:
            arg_1 = []
            for arg_2 in arg_0.source_pkgs:
                try:
                    arg_3 = sys.modules[arg_2]
                except KeyError:
                    continue

                arg_1.append(arg_2)

                try:
                    arg_4 = arg_3.__file__
                except AttributeError:
                    arg_4 = None
                else:
                    arg_5, arg_6 = os.path.split(arg_4)
                    if arg_6.startswith('__init__'):
                        # This is actually a package, return the directory.
                        arg_4 = arg_5
                    else:
                        arg_4 = arg_0._source_for_file(arg_4)
                    arg_4 = arg_0.file_locator.canonical_filename(arg_4)
                    if not os.path.exists(arg_4):
                        arg_4 = None

                if arg_4:
                    arg_0.source.append(arg_4)
                    arg_0.source_match.add(arg_4)
                else:
                    arg_0._warn("Module %s has no Python source." % arg_2)

            for arg_2 in arg_1:
                arg_0.source_pkgs.remove(arg_2)

Update the source_match matcher with latest imported packages .


def Func ( arg_0 , arg_1 ) : arg_2 = Arithmetic ( ) arg_2 . set_probs ( arg_1 ) return arg_2 . encode ( arg_0 )

def Func(arg_0, arg_1):
    """Encode a text using arithmetic coding with the provided probabilities.

    This is a wrapper for :py:meth:`Arithmetic.encode`.

    Parameters
    ----------
    text : str
        A string to encode
    probs : dict
        A probability statistics dictionary generated by
        :py:meth:`Arithmetic.train`

    Returns
    -------
    tuple
        The arithmetically coded text

    Example
    -------
    >>> pr = ac_train('the quick brown fox jumped over the lazy dog')
    >>> Func('align', pr)
    (16720586181, 34)

    """
    arg_2 = Arithmetic()
    arg_2.set_probs(arg_1)
    return arg_2.encode(arg_0)

Encode a text using arithmetic coding with the provided probabilities.

    This is a wrapper for :py:meth:`Arithmetic.encode`.

    Parameters
    ----------
    text : str
        A string to encode
    probs : dict
        A probability statistics dictionary generated by
        :py:meth:`Arithmetic.train`

    Returns
    -------
    tuple
        The arithmetically coded text

    Example
    -------
    >>> pr = ac_train('the quick brown fox jumped over the lazy dog')
    >>> ac_encode('align', pr)
    (16720586181, 34)

Encode a text using arithmetic coding with the provided probabilities .


def Func ( arg_0 , arg_1 = "Func" ) : with tf . name_scope ( arg_1 ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_1 = "x" ) arg_2 = - np . log ( 2. ) + arg_0 arg_3 = tf . exp ( - tf . abs ( arg_0 ) ) arg_4 = tf . math . log1p ( - 0.5 * arg_3 ) return tf . where ( arg_0 < 0. , arg_2 , arg_4 )

def Func(arg_0, arg_1="Func"):
  """Log Laplace distribution function.

  This function calculates `Log[L(x)]`, where `L(x)` is the cumulative
  distribution function of the Laplace distribution, i.e.

  ```L(x) := 0.5 * int_{-infty}^x e^{-|t|} dt```

  For numerical accuracy, `L(x)` is computed in different ways depending on `x`,

  ```
  x <= 0:
    Log[L(x)] = Log[0.5] + x, which is exact

  0 < x:
    Log[L(x)] = Log[1 - 0.5 * e^{-x}], which is exact
  ```

  Args:
    x: `Tensor` of type `float32`, `float64`.
    name: Python string. A name for the operation (default="log_ndtr").

  Returns:
    `Tensor` with `dtype=x.dtype`.

  Raises:
    TypeError: if `x.dtype` is not handled.
  """

  with tf.name_scope(arg_1):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1="x")

    # For x < 0, L(x) = 0.5 * exp{x} exactly, so Log[L(x)] = log(0.5) + x.
    arg_2 = -np.log(2.) + arg_0

    # safe_exp_neg_x = exp{-x} for x > 0, but is
    # bounded above by 1, which avoids
    #   log[1 - 1] = -inf for x = log(1/2), AND
    #   exp{-x} --> inf, for x << -1
    arg_3 = tf.exp(-tf.abs(arg_0))

    # log1p(z) = log(1 + z) approx z for |z| << 1. This approxmation is used
    # internally by log1p, rather than being done explicitly here.
    arg_4 = tf.math.log1p(-0.5 * arg_3)

    return tf.where(arg_0 < 0., arg_2, arg_4)


def Func(arg_0, arg_1, arg_2):
    """From the pixel-neighbors, setup the regularization matrix using the constant regularization scheme.

    Parameters
    ----------
    coefficients : tuple
        The regularization coefficients which controls the degree of smoothing of the inversion reconstruction.
    pixel_neighbors : ndarray
        An array of length (total_pixels) which provides the index of all neighbors of every pixel in \
        the Voronoi grid (entries of -1 correspond to no neighbor).
    pixel_neighbors_size : ndarrayy
        An array of length (total_pixels) which gives the number of neighbors of every pixel in the \
        Voronoi grid.
    """

    arg_3 = len(arg_1)

    arg_4 = np.zeros(shape=(arg_3, arg_3))

    arg_5 = arg_0[0] ** 2.0

    for arg_6 in range(arg_3):
        arg_4[arg_6, arg_6] += 1e-8
        for arg_7 in range(arg_2[arg_6]):
            arg_8 = arg_1[arg_6, arg_7]
            arg_4[arg_6, arg_6] += arg_5
            arg_4[arg_6, arg_8] -= arg_5

    return arg_4

From the pixel - neighbors setup the regularization matrix using the constant regularization scheme .


def Func ( arg_0 ) : arg_1 = '' while 1 : arg_2 , arg_3 , arg_4 = select . select ( [ arg_0 . sock ] , [ ] , [ ] , 0.5 ) if arg_0 . _stop : break if not arg_2 : continue arg_5 = arg_2 [ 0 ] . recv ( 1 ) if arg_5 == '\n' : break arg_1 += unicode ( arg_5 , arg_0 . encoding ) return arg_1

def Func(arg_0):
        """Read a line from the server. Data is read from the socket until a character ``\n`` is found

        :return: the read line
        :rtype: string

        """
        arg_1 = ''
        while 1:
            arg_2, arg_3, arg_4 = select.select([arg_0.sock], [], [], 0.5)
            if arg_0._stop:
                break
            if not arg_2:
                continue
            arg_5 = arg_2[0].recv(1)
            if arg_5 == '\n':
                break
            arg_1 += unicode(arg_5, arg_0.encoding)
        return arg_1

Read a line from the server . Data is read from the socket until a character \ n is found