def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
)
:
from
ubelt
import
util_cmd
if
os
.
path
.
isdir
(
arg_0
)
:
if
arg_2
:
print
(
'... as directory symlink'
)
arg_3
=
'mklink /D "{}" "{}"'
.
format
(
arg_1
,
arg_0
)
else
:
if
arg_2
:
print
(
'... as file symlink'
)
arg_3
=
'mklink "{}" "{}"'
.
format
(
arg_1
,
arg_0
)
if
arg_3
is
not
:
arg_4
=
util_cmd
.
cmd
(
arg_3
,
shell
=
True
)
if
arg_4
[
'ret'
]
!=
0
:
from
ubelt
import
util_format
arg_5
=
'You do not have sufficient privledges'
if
arg_5
not
in
arg_4
[
'err'
]
:
print
(
'Failed command:'
)
print
(
arg_4
[
'command'
]
)
print
(
util_format
.
repr2
(
arg_4
,
nl
=
1
)
)
raise
OSError
(
str
(
arg_4
)
)
return
arg_1

def Func(arg_0, arg_1, arg_2=0):
    """
    Creates real symlink. This will only work in versions greater than Windows
    Vista. Creating real symlinks requires admin permissions or at least
    specially enabled symlink permissions. On Windows 10 enabling developer
    mode should give you these permissions.
    """
    from ubelt import util_cmd
    if os.path.isdir(arg_0):
        # directory symbolic link
        if arg_2:
            print('... as directory symlink')
        arg_3 = 'mklink /D "{}" "{}"'.format(arg_1, arg_0)
        # Using the win32 API seems to result in privilege errors
        # but using shell commands does not have this problem. Weird.
        # jwfs.symlink(path, link, target_is_directory=True)
        # TODO: what do we need to do to use the windows api instead of shell?
    else:
        # file symbolic link
        if arg_2:
            print('... as file symlink')
        arg_3 = 'mklink "{}" "{}"'.format(arg_1, arg_0)

    if arg_3 is not None:
        arg_4 = util_cmd.cmd(arg_3, shell=True)
        if arg_4['ret'] != 0:
            from ubelt import util_format
            arg_5 = 'You do not have sufficient privledges'
            if arg_5 not in arg_4['err']:
                print('Failed command:')
                print(arg_4['command'])
                print(util_format.repr2(arg_4, nl=1))
            raise OSError(str(arg_4))
    return arg_1

Creates real symlink . This will only work in versions greater than Windows Vista . Creating real symlinks requires admin permissions or at least specially enabled symlink permissions . On Windows 10 enabling developer mode should give you these permissions .


def Func(arg_0):
    """Initialize base logger named 'wsgidav'.

    The base logger is filtered by the `verbose` configuration option.
    Log entries will have a time stamp and thread id.

    :Parameters:
        verbose : int
            Verbosity configuration (0..5)
        enable_loggers : string list
            List of module logger names, that will be switched to DEBUG level.

    Module loggers
    ~~~~~~~~~~~~~~
    Module loggers (e.g 'wsgidav.lock_manager') are named loggers, that can be
    independently switched to DEBUG mode.

    Except for verbosity, they will inherit settings from the base logger.

    They will suppress DEBUG level messages, unless they are enabled by passing
    their name to util.Func().

    If enabled, module loggers will print DEBUG messages, even if verbose == 3.

    Example initialize and use a module logger, that will generate output,
    if enabled (and verbose >= 2)::

        _logger = util.get_module_logger(__name__)
        [..]
        _logger.debug("foo: '{}'".format(s))

    This logger would be enabled by passing its name to Func()::

        enable_loggers = ["lock_manager",
                          "property_manager",
                         ]
        util.Func(2, enable_loggers)

    Log Level Matrix
    ~~~~~~~~~~~~~~~~

    +---------+--------+---------------------------------------------------------------+
    | Verbose | Option |                       Log level                               |
    | level   |        +-------------+------------------------+------------------------+
    |         |        | base logger | module logger(default) | module logger(enabled) |
    +=========+========+=============+========================+========================+
    |    0    | -qqq   | CRITICAL    | CRITICAL               | CRITICAL               |
    +---------+--------+-------------+------------------------+------------------------+
    |    1    | -qq    | ERROR       | ERROR                  | ERROR                  |
    +---------+--------+-------------+------------------------+------------------------+
    |    2    | -q     | WARN        | WARN                   | WARN                   |
    +---------+--------+-------------+------------------------+------------------------+
    |    3    |        | INFO        | INFO                   | **DEBUG**              |
    +---------+--------+-------------+------------------------+------------------------+
    |    4    | -v     | DEBUG       | DEBUG                  | DEBUG                  |
    +---------+--------+-------------+------------------------+------------------------+
    |    5    | -vv    | DEBUG       | DEBUG                  | DEBUG                  |
    +---------+--------+-------------+------------------------+------------------------+

    """
    arg_1 = arg_0.get("verbose", 3)

    arg_2 = arg_0.get("enable_loggers", [])
    if arg_2 is None:
        arg_2 = []

    arg_3 = arg_0.get("logger_date_format", "%Y-%m-%d %H:%M:%S")
    arg_4 = arg_0.get(
        "logger_format",
        "%(asctime)s.%(msecs)03d - <%(thread)d> %(name)-27s %(levelname)-8s:  %(message)s",
    )

    arg_5 = logging.Formatter(arg_4, arg_3)

    # Define handlers
    arg_6 = logging.StreamHandler(sys.stdout)
    #    consoleHandler = logging.StreamHandler(sys.stderr)
    arg_6.setFormatter(arg_5)
    # consoleHandler.setLevel(logging.DEBUG)

    # Add the handlers to the base logger
    arg_7 = logging.getLogger(BASE_LOGGER_NAME)

    if arg_1 >= 4:  # --verbose
        arg_7.setLevel(logging.DEBUG)
    elif arg_1 == 3:  # default
        arg_7.setLevel(logging.INFO)
    elif arg_1 == 2:  # --quiet
        arg_7.setLevel(logging.WARN)
        # consoleHandler.setLevel(logging.WARN)
    elif arg_1 == 1:  # -qq
        arg_7.setLevel(logging.ERROR)
        # consoleHandler.setLevel(logging.WARN)
    else:  # -qqq
        arg_7.setLevel(logging.CRITICAL)
        # consoleHandler.setLevel(logging.ERROR)

    # Don't call the root's handlers after our custom handlers
    arg_7.propagate = False

    # Remove previous handlers
    for arg_9 in arg_7.handlers[:]:  # Must iterate an array copy
        try:
            arg_9.flush()
            arg_9.close()
        except Exception:
            pass
        arg_7.removeHandler(arg_9)

    arg_7.addHandler(arg_6)

    if arg_1 >= 3:
        for arg_10 in arg_2:
            if not arg_10.startswith(BASE_LOGGER_NAME + "."):
                arg_10 = BASE_LOGGER_NAME + "." + arg_10
            arg_11 = logging.getLogger(arg_10.strip())
            arg_11.setLevel(logging.DEBUG)

Initialize base logger named 'wsgidav'.

    The base logger is filtered by the `verbose` configuration option.
    Log entries will have a time stamp and thread id.

    :Parameters:
        verbose : int
            Verbosity configuration (0..5)
        enable_loggers : string list
            List of module logger names, that will be switched to DEBUG level.

    Module loggers
    ~~~~~~~~~~~~~~
    Module loggers (e.g 'wsgidav.lock_manager') are named loggers, that can be
    independently switched to DEBUG mode.

    Except for verbosity, they will inherit settings from the base logger.

    They will suppress DEBUG level messages, unless they are enabled by passing
    their name to util.init_logging().

    If enabled, module loggers will print DEBUG messages, even if verbose == 3.

    Example initialize and use a module logger, that will generate output,
    if enabled (and verbose >= 2)::

        _logger = util.get_module_logger(__name__)
        [..]
        _logger.debug("foo: '{}'".format(s))

    This logger would be enabled by passing its name to init_logging()::

        enable_loggers = ["lock_manager",
                          "property_manager",
                         ]
        util.init_logging(2, enable_loggers)

    Log Level Matrix
    ~~~~~~~~~~~~~~~~

    +---------+--------+---------------------------------------------------------------+
    | Verbose | Option |                       Log level                               |
    | level   |        +-------------+------------------------+------------------------+
    |         |        | base logger | module logger(default) | module logger(enabled) |
    +=========+========+=============+========================+========================+
    |    0    | -qqq   | CRITICAL    | CRITICAL               | CRITICAL               |
    +---------+--------+-------------+------------------------+------------------------+
    |    1    | -qq    | ERROR       | ERROR                  | ERROR                  |
    +---------+--------+-------------+------------------------+------------------------+
    |    2    | -q     | WARN        | WARN                   | WARN                   |
    +---------+--------+-------------+------------------------+------------------------+
    |    3    |        | INFO        | INFO                   | **DEBUG**              |
    +---------+--------+-------------+------------------------+------------------------+
    |    4    | -v     | DEBUG       | DEBUG                  | DEBUG                  |
    +---------+--------+-------------+------------------------+------------------------+
    |    5    | -vv    | DEBUG       | DEBUG                  | DEBUG                  |
    +---------+--------+-------------+------------------------+------------------------+


def Func(arg_0, arg_1):
        """
        deletes NetJSON address keys
        """
        for arg_2 in arg_0._address_keys:
            if arg_2 in arg_1:
                del arg_1[arg_2]
        return arg_1


def Func(arg_0, arg_1):
    """computes the autocorrelation coefficients, R based
    on the prediction polynomial A and the final prediction error Efinal,
    using the stepdown algorithm.

    Works for real or complex data

    :param a:
    :param efinal:

    :return:
        * R, the autocorrelation
        * U  prediction coefficient
        * kr reflection coefficients
        * e errors

    A should be a minimum phase polynomial and A(1) is assumed to be unity.

    :returns: (P+1) by (P+1) upper triangular matrix, U,
        that holds the i'th order prediction polynomials
        Ai, i=1:P, where P is the order of the input
        polynomial, A.

             [ 1  a1(1)*  a2(2)* ..... aP(P)  * ]
             [ 0  1       a2(1)* ..... aP(P-1)* ]
       U  =  [ .................................]
             [ 0  0       0      ..... 1        ]

    from which the i'th order prediction polynomial can be extracted
    using Ai=U(i+1:-1:1,i+1)'. The first row of U contains the
    conjugates of the reflection coefficients, and the K's may be
    extracted using, K=conj(U(1,2:end)).

    .. todo:: remove the conjugate when data is real data, clean up the code
       test and doc.

    """
    arg_0 = numpy.array(arg_0)
    arg_2 = numpy.isrealobj(arg_0)

    assert arg_0[0] == 1, 'First coefficient of the prediction polynomial must be unity'

    arg_3 = len(arg_0)

    if arg_3 < 2:
        raise ValueError('Polynomial should have at least two coefficients')

    if arg_2 == True:
        arg_4 = numpy.zeros((arg_3, arg_3)) # This matrix will have the prediction
                                # polynomials of orders 1:p
    else:
        arg_4 = numpy.zeros((arg_3, arg_3), dtype=complex)
    arg_4[:, arg_3-1] = numpy.conj(arg_0[-1::-1]) # Prediction coefficients of order p

    arg_3 = arg_3 -1
    arg_5 = numpy.zeros(arg_3)

    # First we find the prediction coefficients of smaller orders and form the
    # Matrix U

    # Initialize the step down

    arg_5[-1] = arg_1 # Prediction error of order p

    # Step down
    for arg_6 in range(arg_3-1, 0, -1):
        [arg_0, arg_5[arg_6-1]] = levdown(arg_0, arg_5[arg_6])
        arg_4[:, arg_6] = numpy.concatenate((numpy.conj(arg_0[-1::-1].transpose()) ,
                                      [0]*(arg_3-arg_6) ))

    arg_7 = arg_5[0]/(1.-abs(arg_0[1]**2)) #% Because a[1]=1 (true polynomial)
    arg_4[0,0] = 1                #% Prediction coefficient of zeroth order
    arg_8 = numpy.conj(arg_4[0,1:])     #% The reflection coefficients
    arg_8 = arg_8.transpose()                 #% To make it into a column vector

    #   % Once we have the matrix U and the prediction error at various orders, we can
    #  % use this information to find the autocorrelation coefficients.

    arg_9 = numpy.zeros(1, dtype=complex)
    #% Initialize recursion
    arg_6 = 1
    arg_10 = arg_7 # To take care of the zero indexing problem
    arg_9[0] = -numpy.conj(arg_4[0,1])*arg_10   # R[1]=-a1[1]*R[0]

    # Actual recursion
    for arg_6 in range(1,arg_3):
        arg_11 = -sum(numpy.conj(arg_4[arg_6-1::-1,arg_6])*arg_9[-1::-1]) - arg_8[arg_6]*arg_5[arg_6-1]
        arg_9 = numpy.insert(arg_9, len(arg_9), arg_11)

    # Include R(0) and make it a column vector. Note the dot transpose

    #R = [R0 R].';
    arg_9 = numpy.insert(arg_9, 0, arg_7)
    return arg_9, arg_4, arg_8, arg_5

computes the autocorrelation coefficients R based on the prediction polynomial A and the final prediction error Efinal using the stepdown algorithm .


def Func ( arg_0 , arg_1 ) : super ( CallTipWidget , arg_0 ) . Func ( arg_1 ) arg_0 . _hide_timer . stop ( )

def Func(arg_0, arg_1):
        """ Reimplemented to cancel the hide timer.
        """
        super(CallTipWidget, arg_0).Func(arg_1)
        arg_0._hide_timer.stop()

Reimplemented to cancel the hide timer .


def Func(arg_0, arg_1=None):
    """
    Issues commands for each item in an account or container listing.

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

    See :py:class:`CLIForDo` for more information.
    """
    arg_1 = arg_1.lstrip('/') if arg_1 else None
    if arg_1 and '/' in arg_1:
        raise ReturnCode(
            'path must be an empty string or a container name; was %r' % arg_1)
    arg_2 = arg_0.query.get('limit')
    arg_3 = arg_0.query.get('delimiter')
    arg_4 = arg_0.query.get('prefix')
    arg_5 = arg_0.query.get('marker')
    arg_6 = arg_0.query.get('end_marker')
    arg_7 = Concurrency(arg_0.concurrency)
    while True:
        with arg_0.client_manager.with_client() as client:
            if not arg_1:
                arg_8, arg_9, arg_10, arg_11 = client.get_account(
                    arg_10=arg_0.headers, arg_4=arg_4,
                    arg_3=arg_3, arg_5=arg_5, arg_6=arg_6,
                    arg_2=arg_2, query=arg_0.query, cdn=arg_0.cdn)
            else:
                arg_8, arg_9, arg_10, arg_11 = client.get_container(
                    arg_1, arg_10=arg_0.headers, arg_4=arg_4,
                    arg_3=arg_3, arg_5=arg_5, arg_6=arg_6,
                    arg_2=arg_2, query=arg_0.query, cdn=arg_0.cdn)
            if arg_8 // 100 != 2:
                if arg_8 == 404 and arg_0.ignore_404:
                    return
                if hasattr(arg_11, 'read'):
                    arg_11.read()
                if not arg_1:
                    raise ReturnCode(
                        'listing account: %s %s' % (arg_8, arg_9))
                else:
                    raise ReturnCode(
                        'listing container %r: %s %s' % (arg_1, arg_8, arg_9))
        if not arg_11:
            break
        for arg_12 in arg_11:
            arg_13 = (arg_1 + '/' if arg_1 else '') + arg_12.get(
                'name', arg_12.get('subdir'))
            arg_14 = list(arg_0.remaining_args)
            try:
                arg_15 = arg_14.index('<item>')
            except ValueError:
                raise ReturnCode(
                    'No "<item>" designation found in the "do" clause.')
            arg_14[arg_15] = arg_13
            for (arg_16, arg_17, arg_18, arg_19) in \
                    six.itervalues(arg_7.get_results()):
                if arg_17:
                    arg_7.join()
                    raise arg_17
            arg_7.spawn(arg_13, _cli_call, arg_0, arg_13, arg_14)
        arg_5 = arg_11[-1]['name']
        if arg_2:
            break
    arg_7.join()
    for (arg_16, arg_17, arg_18, arg_19) in \
            six.itervalues(arg_7.get_results()):
        if arg_17:
            arg_7.join()
            raise arg_17

Issues commands for each item in an account or container listing .


def
Func
(
arg_0
,
arg_1
)
:
if
is_img
(
arg_1
)
:
return
arg_0
.
get_data
(
)
/
arg_1
.
get_data
(
)
elif
isinstance
(
arg_1
,
(
float
,
int
)
)
:
return
arg_0
.
get_data
(
)
/
arg_1
else
:
raise
NotImplementedError
(
'Cannot divide {}({}) by '
'{}({})'
.
format
(
type
(
arg_0
)
,
arg_0
,
type
(
arg_1
)
,
arg_1
)
)

def Func(arg_0, arg_1):
    """ Pixelwise division or divide by a number """
    if is_img(arg_1):
        return arg_0.get_data()/arg_1.get_data()
    elif isinstance(arg_1, (float, int)):
        return arg_0.get_data()/arg_1
    else:
        raise NotImplementedError('Cannot divide {}({}) by '
                                  '{}({})'.format(type(arg_0),
                                                  arg_0,
                                                  type(arg_1),
                                                  arg_1))


def Func ( arg_0 , arg_1 ) : print ( arg_1 ) arg_2 = arg_0 . get ( arg_1 ) if arg_2 is not None : arg_3 = arg_2 . collection . name arg_4 = arg_2 . __dict__ . copy ( ) arg_4 [ 'collection' ] = arg_3 arg_4 [ 'metrics' ] = json . loads ( arg_4 [ 'metrics' ] ) del arg_4 [ '_sa_instance_state' ] arg_4 [ 'created_at' ] = str ( arg_4 [ 'created_at' ] ) print ( json . dumps ( arg_4 , indent = 4 , sort_keys = True ) ) return arg_4

def Func(arg_0, arg_1):
    '''Inspect a local image in the database, which typically includes the
       basic fields in the model.

    '''
    print(arg_1)
    arg_2 = arg_0.get(arg_1)
    if arg_2 is not None:
        arg_3 = arg_2.collection.name
        arg_4 = arg_2.__dict__.copy()
        arg_4['collection'] = arg_3
        arg_4['metrics'] = json.loads(arg_4['metrics'])
        del arg_4['_sa_instance_state']
        arg_4['created_at'] = str(arg_4['created_at'])
        print(json.dumps(arg_4, indent=4, sort_keys=True))
        return arg_4

Inspect a local image in the database which typically includes the basic fields in the model .


def Func ( arg_0 , arg_1 ) : return os . path . split ( CodeUnit ( arg_1 , arg_0 . file_locator ) . filename ) [ 0 ]

def Func(arg_0, arg_1):
        """Return the canonical directory of the module or file `morf`."""
        return os.path.split(CodeUnit(arg_1, arg_0.file_locator).filename)[0]

Return the canonical directory of the module or file morf .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
code
.
append
(
" "
*
arg_0
.
indent_amount
)
arg_0
.
code
.
append
(
arg_1
)
arg_0
.
code
.
append
(
"\n"
)

def Func(arg_0, arg_1):
        """Add a line of source to the code.

        Don't include indentations or newlines.

        """
        arg_0.code.append(" " * arg_0.indent_amount)
        arg_0.code.append(arg_1)
        arg_0.code.append("\n")


(self, output_folder, rename_files=True,
                                   mkdir=True, verbose=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
True
,
arg_4
=
False
)
:
import
shutil
if
not
os
.
path
.
exists
(
arg_1
)
:
os
.
mkdir
(
arg_1
)
if
not
arg_2
:
for
arg_5
in
arg_0
.
items
:
arg_6
=
os
.
path
.
join
(
arg_1
,
os
.
path
.
basename
(
arg_5
)
)
if
arg_4
:
print
(
'{} -> {}'
.
format
(
arg_5
,
arg_6
)
)
shutil
.
copyfile
(
arg_5
,
arg_6
)
else
:
arg_7
=
len
(
arg_0
.
items
)
+
2
for
arg_8
,
arg_5
in
enumerate
(
arg_0
.
items
)
:
arg_6
=
'{number:0{width}d}.dcm'
.
format
(
width
=
arg_7
,
number
=
arg_8
)
arg_6
=
os
.
path
.
join
(
arg_1
,
arg_6
)
if
arg_4
:
print
(
'{} -> {}'
.
format
(
arg_5
,
arg_6
)
)
shutil
.
copyfile
(
arg_5
,
arg_6
)

def Func(arg_0, arg_1, arg_2=True,
                                   arg_3=True, arg_4=False):
        """
        Copies all files within this set to the output_folder

        Parameters
        ----------
        output_folder: str
        Path of the destination folder of the files

        rename_files: bool
        Whether or not rename the files to a sequential format

        mkdir: bool
        Whether to make the folder if it does not exist

        verbose: bool
        Whether to print to stdout the files that are beind copied
        """
        import shutil

        if not os.path.exists(arg_1):
            os.mkdir(arg_1)

        if not arg_2:
            for arg_5 in arg_0.items:
                arg_6 = os.path.join(arg_1, os.path.basename(arg_5))
                if arg_4:
                    print('{} -> {}'.format(arg_5, arg_6))
                shutil.copyfile(arg_5, arg_6)
        else:
            arg_7 = len(arg_0.items)+2
            for arg_8, arg_5 in enumerate(arg_0.items):
                arg_6 = '{number:0{width}d}.dcm'.format(width=arg_7, number=arg_8)
                arg_6 = os.path.join(arg_1, arg_6)
                if arg_4:
                    print('{} -> {}'.format(arg_5, arg_6))
                shutil.copyfile(arg_5, arg_6)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . copy ( ) for arg_3 , arg_4 in arg_1 . items ( ) : if isinstance ( arg_4 , list ) and isinstance ( arg_2 . get ( arg_3 ) , list ) : arg_2 [ arg_3 ] += arg_4 else : arg_2 [ arg_3 ] = arg_4 return arg_2

def Func(arg_0, arg_1):
    """
    Given two dicts, x and y, merge them into a new dict as a shallow copy.

    The result only differs from `x.update(y)` in the way that it handles list
    values when both x and y have list values for the same key. In which case
    the returned dictionary, z, has a value according to:
      z[key] = x[key] + z[key]

    :param x: The first dictionary
    :type x: :py:class:`dict`
    :param y: The second dictionary
    :type y: :py:class:`dict`
    :returns: The merged dictionary
    :rtype: :py:class:`dict`
    """
    arg_2 = arg_0.copy()
    for arg_3, arg_4 in arg_1.items():
        if isinstance(arg_4, list) and isinstance(arg_2.get(arg_3), list):
            arg_2[arg_3] += arg_4
        else:
            arg_2[arg_3] = arg_4
    return arg_2

Given two dicts x and y merge them into a new dict as a shallow copy .


def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = marketYesterday ( arg_0 , arg_1 ) arg_3 = [ ] for arg_4 in arg_2 : arg_3 . append ( arg_2 [ arg_4 ] ) arg_3 [ - 1 ] [ 'symbol' ] = arg_4 arg_5 = pd . DataFrame ( arg_3 ) _toDatetime ( arg_5 ) _reindex ( arg_5 , 'symbol' ) return arg_5

def Func(arg_0='', arg_1=''):
    '''This returns previous day adjusted price data for whole market

    https://iexcloud.io/docs/api/#previous-day-prices
    Available after 4am ET Tue-Sat

    Args:
        symbol (string); Ticker to request
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result
    '''
    arg_2 = marketYesterday(arg_0, arg_1)
    arg_3 = []
    for arg_4 in arg_2:
        arg_3.append(arg_2[arg_4])
        arg_3[-1]['symbol'] = arg_4
    arg_5 = pd.DataFrame(arg_3)
    _toDatetime(arg_5)
    _reindex(arg_5, 'symbol')
    return arg_5


(
    call_node: astroid.Call, position: int = None, keyword: str = None
)

def Func(
    arg_0: arg_1.Call, arg_3: arg_4 = None, arg_5: arg_6 = None
) -> arg_1.Name:
    """Returns the specified argument from a function call.

    :param astroid.Call call_node: Node representing a function call to check.
    :param int position: position of the argument.
    :param str keyword: the keyword of the argument.

    :returns: The node representing the argument, None if the argument is not found.
    :rtype: astroid.Name
    :raises ValueError: if both position and keyword are None.
    :raises NoSuchArgumentError: if no argument at the provided position or with
    the provided keyword.
    """
    if arg_3 is None and arg_5 is None:
        raise ValueError("Must specify at least one of: position or keyword.")
    if arg_3 is not None:
        try:
            return arg_0.args[arg_3]
        except IndexError:
            pass
    if arg_5 and arg_0.keywords:
        for arg_7 in arg_0.keywords:
            if arg_7.arg == arg_5:
                return arg_7.value

    raise NoSuchArgumentError

Returns the specified argument from a function call .


def Func(arg_0, arg_1, arg_2=12):
    """
    Encode a position given in float arguments latitude, longitude to
    a geohash which will have the character count precision.
    """
    arg_3, arg_4 = (-90.0, 90.0), (-180.0, 180.0)
    arg_5 = []
    arg_6 = [ 16, 8, 4, 2, 1 ]
    arg_7 = 0
    arg_8 = 0
    arg_9 = True
    while len(arg_5) < arg_2:
        if arg_9:
            arg_10 = (arg_4[0] + arg_4[1]) / 2
            if arg_1 > arg_10:
                arg_8 |= arg_6[arg_7]
                arg_4 = (arg_10, arg_4[1])
            else:
                arg_4 = (arg_4[0], arg_10)
        else:
            arg_10 = (arg_3[0] + arg_3[1]) / 2
            if arg_0 > arg_10:
                arg_8 |= arg_6[arg_7]
                arg_3 = (arg_10, arg_3[1])
            else:
                arg_3 = (arg_3[0], arg_10)
        arg_9 = not arg_9
        if arg_7 < 4:
            arg_7 += 1
        else:
            arg_5 += __base32[arg_8]
            arg_7 = 0
            arg_8 = 0
    return ''.join(arg_5)

Encode a position given in float arguments latitude longitude to a geohash which will have the character count precision .


def Func ( arg_0 ) : return arg_0 . DXclasses [ arg_0 . type ] ( arg_0 . id , ** arg_0 . args )

def Func(arg_0):
        """Initialize the corresponding DXclass from the data.

        class = DXInitObject.Func()
        """
        return arg_0.DXclasses[arg_0.type](arg_0.id,**arg_0.args)

Initialize the corresponding DXclass from the data.

        class = DXInitObject.initialize()

Initialize the corresponding DXclass from the data .


def Func ( arg_0 ) : arg_1 = os . path . splitext ( arg_0 . img . name ) [ 1 ] if arg_1 : return arg_1 [ 1 : ] return arg_1

def Func(arg_0):
        """Returns the file extension."""
        arg_1 = os.path.splitext(arg_0.img.name)[1]
        if arg_1:
            # Remove period from extension
            return arg_1[1:]
        return arg_1


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . items ( ) : if isinstance ( arg_2 , CommentedMap ) : Func ( arg_2 ) elif isinstance ( arg_2 , list ) : for arg_3 in arg_2 : Func ( arg_3 ) else : arg_4 = type ( arg_2 ) if isinstance ( arg_2 , ScalarFloat ) : arg_4 = float arg_5 = click . prompt ( arg_1 , type = arg_4 , default = arg_2 ) arg_0 [ arg_1 ] = arg_5 return arg_0

def Func(arg_0):
    """Update the descriptive metadata interactively.

    Uses values entered by the user. Note that the function keeps recursing
    whenever a value is another ``CommentedMap`` or a ``list``. The
    function works as passing dictionaries and lists into a function edits
    the values in place.
    """
    for arg_1, arg_2 in arg_0.items():
        if isinstance(arg_2, CommentedMap):
            Func(arg_2)
        elif isinstance(arg_2, list):
            for arg_3 in arg_2:
                Func(arg_3)
        else:
            arg_4 = type(arg_2)

            if isinstance(arg_2, ScalarFloat):  # Deal with ruamel.yaml floats.
                arg_4 = float

            arg_5 = click.prompt(arg_1, type=arg_4, default=arg_2)
            arg_0[arg_1] = arg_5
    return arg_0

Update the descriptive metadata interactively .


return prefer_static.cond(tf.equal(num_elements, 0),
                            (lambda: -state.objective_gradient),
                            _two_loop_algorithm)

def Func(arg_0):
  """Computes the search direction to follow at the current state.

  On the `k`-th iteration of the main L-BFGS algorithm, the state has collected
  the most recent `m` correction pairs in position_deltas and gradient_deltas,
  where `k = state.num_iterations` and `m = min(k, num_correction_pairs)`.

  Assuming these, the code below is an implementation of the L-BFGS two-loop
  recursion algorithm given by [Nocedal and Wright(2006)][1]:

  ```None
    q_direction = objective_gradient
    for i in reversed(range(m)):  # First loop.
      inv_rho[i] = gradient_deltas[i]^T * position_deltas[i]
      alpha[i] = position_deltas[i]^T * q_direction / inv_rho[i]
      q_direction = q_direction - alpha[i] * gradient_deltas[i]

    kth_inv_hessian_factor = (gradient_deltas[-1]^T * position_deltas[-1] /
                              gradient_deltas[-1]^T * gradient_deltas[-1])
    r_direction = kth_inv_hessian_factor * I * q_direction

    for i in range(m):  # Second loop.
      beta = gradient_deltas[i]^T * r_direction / inv_rho[i]
      r_direction = r_direction + position_deltas[i] * (alpha[i] - beta)

    return -r_direction  # Approximates - H_k * objective_gradient.
  ```

  Args:
    state: A `LBfgsOptimizerResults` tuple with the current state of the
      search procedure.

  Returns:
    A real `Tensor` of the same shape as the `state.position`. The direction
    along which to perform line search.
  """
  # The number of correction pairs that have been collected so far.
  arg_1 = tf.minimum(
      arg_0.num_iterations,
      distribution_util.prefer_static_shape(arg_0.position_deltas)[0])

  def _two_loop_algorithm():
    """L-BFGS two-loop algorithm."""
    # Correction pairs are always appended to the end, so only the latest
    # `num_elements` vectors have valid position/gradient deltas.
    arg_2 = arg_0.position_deltas[-arg_1:]
    arg_3 = arg_0.gradient_deltas[-arg_1:]

    # Pre-compute all `inv_rho[i]`s.
    arg_4 = tf.reduce_sum(
        input_tensor=arg_3 * arg_2, axis=-1)

    def first_loop(arg_5, arg_6):
      arg_7, arg_8 = arg_5
      arg_9, arg_10, arg_11 = arg_6
      arg_12 = tf.reduce_sum(
          input_tensor=arg_9 * arg_8, axis=-1) / arg_11
      arg_13 = tf.expand_dims(arg_12, axis=-1) * arg_10
      return (arg_12, arg_8 - arg_13)

    # Run first loop body computing and collecting `alpha[i]`s, while also
    # computing the updated `q_direction` at each step.
    arg_14 = tf.zeros_like(arg_4[0])
    arg_15, arg_16 = tf.scan(
        first_loop, [arg_2, arg_3, arg_4],
        initializer=(arg_14, arg_0.objective_gradient), reverse=True)

    # We use `H^0_k = gamma_k * I` as an estimate for the initial inverse
    # hessian for the k-th iteration; then `r_direction = H^0_k * q_direction`.
    arg_17 = arg_4[-1] / tf.reduce_sum(
        input_tensor=arg_3[-1] * arg_3[-1], axis=-1)
    arg_18 = tf.expand_dims(arg_17, axis=-1) * arg_16[0]

    def second_loop(arg_18, arg_6):
      arg_12, arg_9, arg_10, arg_11 = arg_6
      arg_19 = tf.reduce_sum(
          input_tensor=arg_10 * arg_18, axis=-1) / arg_11
      arg_13 = tf.expand_dims(arg_12 - arg_19, axis=-1) * arg_9
      return arg_18 + arg_13

    # Finally, run second loop body computing the updated `r_direction` at each
    # step.
    arg_20 = tf.scan(
        second_loop, [arg_15, arg_2, arg_3, arg_4],
        initializer=arg_18)
    return -arg_20[-1]

  return prefer_static.cond(tf.equal(arg_1, 0),
                            (lambda: -arg_0.objective_gradient),
                            _two_loop_algorithm)

Computes the search direction to follow at the current state .


def Func ( arg_0 ) : arg_1 = _user_key ( arg_0 ) arg_2 = cache . get ( arg_1 ) if arg_2 : cache . delete ( arg_1 ) return arg_2 return None

def Func(arg_0):
    """
    Fetch messages for given user.  Returns None if no such message exists.

    :param user: User instance
    """
    arg_1 = _user_key(arg_0)
    arg_2 = cache.get(arg_1)
    if arg_2:
        cache.delete(arg_1)
        return arg_2
    return None

Fetch messages for given user . Returns None if no such message exists .


def Func(arg_0, arg_1, arg_2=None):
        """
        Register form field data function.

        Could be used as decorator
        """
        def _wrapper(arg_3):
            arg_0.registry[arg_1] = arg_3
            return arg_3

        if arg_2:
            return _wrapper(arg_2)
        return _wrapper

Register form field data function . Could be used as decorator


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_1 [ VARIANT . PERSONAL ] arg_4 = { 'productSkuId' : arg_3 [ 'productSkuId' ] , 'quantity' : arg_2 , 'ComplimentaryItems' : [ ] } return arg_0 . __post ( '/Basket/AddProduct' , json = arg_4 )

def Func(arg_0, arg_1, arg_2=1):
        '''
        Add a side to the current basket.

        :param Item item: Item from menu.
        :param int quantity: The quantity of side to be added.
        :return: A response having added a side to the current basket.
        :rtype: requests.Response
        '''
        arg_3 = arg_1[VARIANT.PERSONAL]

        arg_4 = {
            'productSkuId': arg_3['productSkuId'],
            'quantity': arg_2,
            'ComplimentaryItems': []
        }

        return arg_0.__post('/Basket/AddProduct', json=arg_4)


def Func ( arg_0 , arg_1 ) : arg_2 = SkyCoord ( arg_0 * u . degree , arg_0 * u . degree , frame = 'galactic' ) arg_3 = arg_2 . transform_to ( 'icrs' ) return arg_3 . ra . degree , arg_3 . dec . degree

def Func(arg_0, arg_1):
    '''This converts from galactic coords to equatorial coordinates.

    Parameters
    ----------

    gl : float or array-like
        Galactic longitude values(s) in decimal degrees.

    gb : float or array-like
        Galactic latitude value(s) in decimal degrees.

    Returns
    -------

    tuple of (float, float) or tuple of (np.array, np.array)
        The equatorial coordinates (RA, DEC) for each element of the input
        (`gl`, `gb`) in decimal degrees. These are reported in the ICRS frame.

    '''

    arg_2 = SkyCoord(arg_0*u.degree, arg_0*u.degree, frame='galactic')

    arg_3 = arg_2.transform_to('icrs')

    return arg_3.ra.degree, arg_3.dec.degree

This converts from galactic coords to equatorial coordinates .


return dict(panel_groups=panel_groups, panel_names=panel_names,
                panel_versions=panel_versions, institutes=institutes)

def Func():
    """Show all Func for a case."""
    if request.method == 'POST':
        # update an existing panel
        arg_0 = request.files['csv_file']
        arg_1 = arg_0.stream.read()
        arg_2 = None
        try:
            if b'\n' in arg_1:
                arg_2 = arg_1.decode('utf-8', 'ignore').split('\n')
            else:
                arg_2 = arg_1.decode('windows-1252').split('\r')
        except Exception as err:
            flash('Something went wrong while parsing the panel CSV file! ({})'.format(err), 'danger')
            return redirect(request.referrer)

        arg_3 = request.form.get('new_panel_name')
        if arg_3: #create a new panel
            arg_4 = controllers.new_panel(
                store=store,
                institute_id=request.form['institute'],
                panel_name=arg_3,
                display_name=request.form['display_name'],
                csv_lines=arg_2,
            )
            if arg_4 is None:
                flash('Something went wrong and the panel list was not updated!','warning')
                return redirect(request.referrer)
            else:
                flash("new gene panel added, {}!".format(arg_3),'success')
            return redirect(url_for('Func.panel', panel_id=arg_4))

        else: # modify an existing panel
            arg_5 = request.form['modify_option']
            arg_6= controllers.update_panel(
                                   store=store,
                                   panel_name=request.form['panel_name'],
                                   csv_lines=arg_2,
                                   option=arg_5
             )
            if arg_6 is None:
                return abort(404, "gene panel not found: {}".format(request.form['panel_name']))
            else:
                return redirect(url_for('Func.panel', panel_id=arg_6['_id']))

    arg_7 = list(user_institutes(store, current_user))
    arg_8 = [arg_10
                   for institute in arg_7
                   for arg_10 in
                   store.gene_Func(institute_id=institute['_id']).distinct('panel_name')]

    arg_9 = {}
    for arg_10 in arg_8:
        arg_9[arg_10]=store.gene_Func(panel_id=arg_10)

    arg_11 = []
    for arg_12 in arg_7:
         arg_13 = store.latest_Func(arg_12['_id'])
         arg_11.append((arg_12, arg_13))

    return dict(arg_11=arg_11, arg_8=arg_8,
                arg_9=arg_9, arg_7=arg_7)


return os.path.join(java_home, BIN_DIR, "java")

def Func ( ) : arg_0 = os . environ . get ( "JAVA_HOME" ) return os . path . join ( arg_0 , BIN_DIR , "java" )

def Func():
  """Get the path of java executable"""
  arg_0 = os.environ.get("JAVA_HOME")
  return os.path.join(arg_0, BIN_DIR, "java")


def
Func
(
arg_0
)
:
if
arg_0
.
args
.
logLevel
is
not
:
logging
.
basicConfig
(
level
=
arg_0
.
levels
[
arg_0
.
args
.
logLevel
]
)
logging
.
info
(
"Set logging level to {0}"
.
format
(
arg_0
.
args
.
logLevel
)
)

def Func(arg_0):
        """
        Configure logging based on command line options
        """
        if arg_0.args.logLevel is not None:
            logging.basicConfig(level=arg_0.levels[arg_0.args.logLevel])
        logging.info("Set logging level to {0}".format(arg_0.args.logLevel))


return {self.type_key: typename, self.state_key: state}

def Func ( arg_0 , arg_1 : arg_2 , arg_3 ) -> Dict [ arg_2 , Any ] : return { arg_0 . type_key : arg_1 , arg_0 . state_key : arg_3 }

def Func(arg_0, arg_1: arg_2, arg_3) -> Dict[arg_2, Any]:
        """
        Wrap the marshalled state in a dictionary.

        The returned dictionary has two keys, corresponding to the ``type_key`` and ``state_key``
        options. The former holds the type name and the latter holds the marshalled state.

        :param typename: registered name of the custom type
        :param state: the marshalled state of the object
        :return: an object serializable by the serializer

        """
        return {arg_0.type_key: arg_1, arg_0.state_key: arg_3}

Wrap the marshalled state in a dictionary .


def Func(arg_0, arg_1, arg_2):
        """ hidden wrapped function to start step 1 """

        ## check input data files
        arg_3 = arg_0.paramsdict["sorted_fastq_path"]
        arg_4 = arg_0.paramsdict["raw_fastq_path"]

        ## do not allow both a sorted_fastq_path and a raw_fastq
        if arg_3 and arg_4:
            raise IPyradWarningExit(NOT_TWO_PATHS)

        ## but also require that at least one exists
        if not (arg_3 or arg_4):
            raise IPyradWarningExit(NO_SEQ_PATH_FOUND)

        ## print headers
        if arg_0._headers:
            if arg_3:
                print("\n{}Step 1: Loading sorted fastq data to Samples"\
                      .format(arg_0._spacer))
            else:
                print("\n{}Step 1: Demultiplexing fastq data to Samples"\
                    .format(arg_0._spacer))

        ## if Samples already exist then no demultiplexing
        if arg_0.samples:
            if not arg_1:
                print(SAMPLES_EXIST.format(len(arg_0.samples), arg_0.name))
            else:
                ## overwrite existing data else do demux
                if glob.glob(arg_3):
                    arg_0._link_fastqs(arg_2=arg_2, arg_1=arg_1)
                else:
                    assemble.demultiplex.run2(arg_0, arg_2, arg_1)

        ## Creating new Samples
        else:
            ## first check if demultiplexed files exist in sorted path
            if glob.glob(arg_3):
                arg_0._link_fastqs(arg_2=arg_2)

            ## otherwise do the demultiplexing
            else:
                assemble.demultiplex.run2(arg_0, arg_2, arg_1)


def Func(arg_0):
        """Handle legacy authentication timeout.

        [client only]"""
        arg_0.lock.acquire()
        try:
            arg_0.__logger.debug("Timeout while waiting for jabber:iq:auth result")
            if arg_0._auth_methods_left:
                arg_0._auth_methods_left.pop(0)
        finally:
            arg_0.lock.release()


def Func(arg_0):
    """Create a client for Service Fabric APIs."""

    arg_1 = client_endpoint()

    if not arg_1:
        raise CLIError("Connection endpoint not found. "
                       "Before running sfctl commands, connect to a cluster using "
                       "the 'sfctl cluster select' command.")

    arg_2 = no_verify_setting()

    if security_type() == 'aad':
        arg_3 = AdalAuthentication(arg_2)
    else:
        arg_4 = cert_info()
        arg_5 = ca_cert_info()
        arg_3 = ClientCertAuthentication(arg_4, arg_5, arg_2)

    return ServiceFabricClientAPIs(arg_3, base_url=arg_1)

Create a client for Service Fabric APIs .


def Func ( arg_0 , arg_1 = False ) : arg_0 . _check ( arg_1 ) for arg_2 in reversed ( arg_0 . db . applied_patches ( ) ) : arg_0 . _unapply_patch ( arg_2 ) arg_0 . db . save ( ) arg_0 . unapplied ( arg_0 . db . top_patch ( ) )

def Func(arg_0, arg_1=False):
        """ Unapply all patches """
        arg_0._check(arg_1)

        for arg_2 in reversed(arg_0.db.applied_patches()):
            arg_0._unapply_patch(arg_2)

        arg_0.db.save()

        arg_0.unapplied(arg_0.db.top_patch())


def Func ( arg_0 ) : if arg_0 . _beating and not arg_0 . hb_stream . closed ( ) : arg_0 . _hb_periodic_callback . start ( )

def Func(arg_0):
        """callback for delayed heartbeat start

        Only start the hb loop if we haven't been closed during the wait.
        """
        if arg_0._beating and not arg_0.hb_stream.closed():
            arg_0._hb_periodic_callback.start()

callback for delayed heartbeat start Only start the hb loop if we haven t been closed during the wait .


return sorted(table.items(), key=operator.itemgetter(1), reverse=True)

def Func ( arg_0 ) : arg_1 = set ( [ arg_3 . primary for arg_3 in arg_0 ] ) arg_2 = { r : 0 for r in arg_1 } for arg_3 in arg_0 : arg_2 [ arg_3 . primary ] += arg_3 . thickness return sorted ( arg_2 . items ( ) , key = operator . itemgetter ( 1 ) , reverse = True )

def Func(arg_0):
        """
        Property. Summarize a Striplog with some statistics.

        Returns:
            List. A list of (Component, total thickness thickness) tuples.
        """
        arg_1 = set([arg_3.primary for arg_3 in arg_0])
        arg_2 = {r: 0 for r in arg_1}
        for arg_3 in arg_0:
            arg_2[arg_3.primary] += arg_3.thickness

        return sorted(arg_2.items(), key=operator.itemgetter(1), reverse=True)

Property . Summarize a Striplog with some statistics .


def
Func
(
)
:
arg_0
=
settings
.
Session
(
)
arg_1
=
arg_0
.
query
(
DagRun
)
.
filter
(
DagRun
.
dag_id
.
in_
(
DAG_IDS
)
,
)
.
all
(
)
for
arg_2
in
arg_1
:
logging
.
info
(
'Deleting DagRun :: {}'
.
format
(
arg_2
)
)
arg_0
.
delete
(
arg_2
)

def Func():
    """
    Remove any existing DAG runs for the perf test DAGs.
    """
    arg_0 = settings.Session()
    arg_1 = arg_0.query(DagRun).filter(
        DagRun.dag_id.in_(DAG_IDS),
    ).all()
    for arg_2 in arg_1:
        logging.info('Deleting DagRun :: {}'.format(arg_2))
        arg_0.delete(arg_2)

Remove any existing DAG runs for the perf test DAGs .


def Func ( arg_0 ) : arg_0 . _future = False arg_0 . _job . poll ( ) arg_0 . _job = None

def Func(arg_0):
        """Wait until grid finishes computing."""
        arg_0._future = False
        arg_0._job.poll()
        arg_0._job = None


(script, hole_num=50, target_layer=None, sample_layer=None, thickness=0.5, backward=True)

def Func(arg_0, arg_1=50, arg_2=None, arg_3=None, arg_4=0.5, arg_5=True):
    """ Turn a model into a surface with Voronoi style holes in it

    References:
    http://meshlabstuff.blogspot.com/2009/03/creating-Func-sphere.html
    http://meshlabstuff.blogspot.com/2009/04/creating-Func-sphere-2.html

    Requires FilterScript object

    Args:
        script: the FilterScript object to write the filter to. Does not
            work with a script filename.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """

    if arg_2 is None:
        arg_2 = arg_0.current_layer()
    if arg_3 is None:
        # Current layer is currently not changed after poisson_disk is run
        sampling.poisson_disk(arg_0, sample_num=arg_1)
        arg_3 = arg_0.last_layer()

    vert_color.Func(arg_0, arg_2=arg_2, source_layer=arg_3, arg_5=arg_5)
    select.vert_quality(arg_0, min_quality=0.0, max_quality=arg_4)
    if arg_5:
        select.invert(arg_0)
    delete.selected(arg_0)
    smooth.laplacian(arg_0, iterations=3)

    return None

Turn a model into a surface with Voronoi style holes in it

    References:
    http://meshlabstuff.blogspot.com/2009/03/creating-voronoi-sphere.html
    http://meshlabstuff.blogspot.com/2009/04/creating-voronoi-sphere-2.html

    Requires FilterScript object

    Args:
        script: the FilterScript object to write the filter to. Does not
            work with a script filename.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA


def Func(arg_0, arg_1, arg_2=None):
        '''Returns the height of a string of text according to the current
        font settings.

        :param txt: string to measure
        :param width: width of a line of text in a block
        '''
        arg_3 = arg_2
        return arg_0.textmetrics(arg_1, arg_2=arg_3)[1]

Returns the height of a string of text according to the current font settings .


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . get_params ( arg_1 ) arg_3 = [ p . value for p in arg_2 ] return np . array ( arg_3 )

def Func(arg_0, arg_1=None):
        """ Return an array with the parameter values

        Parameters
        ----------

        pname : list or None
           If a list, get the values of the `Parameter` objects with those names

           If none, get all values of all the `Parameter` objects

        Returns
        -------

        values : `np.array`
            Parameter values

        """
        arg_2 = arg_0.get_params(arg_1)
        arg_3 = [p.value for p in arg_2]
        return np.array(arg_3)


def Func ( arg_0 , arg_1 ) : from airflow . models . taskinstance import TaskInstance as TI arg_2 = arg_1 . query ( func . count ( ) ) . filter ( TI . pool == arg_0 . pool ) . filter ( TI . state . in_ ( [ State . RUNNING , State . QUEUED ] ) ) . scalar ( ) return arg_0 . slots - arg_2

def Func(arg_0, arg_1):
        """
        Returns the number of slots open at the moment
        """
        from airflow.models.taskinstance import \
            TaskInstance as TI  # Avoid circular import

        arg_2 = arg_1.query(func.count()).filter(TI.pool == arg_0.pool).filter(
            TI.state.in_([State.RUNNING, State.QUEUED])).scalar()
        return arg_0.slots - arg_2


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if validations . validate_file_lics_in_file ( arg_2 ) : arg_0 . file ( arg_1 ) . add_lics ( arg_2 ) return True else : raise SPDXValueError ( 'File::LicenseInFile' ) else : raise OrderError ( 'File::LicenseInFile' )

def Func(arg_0, arg_1, arg_2):
        """
        Raises OrderError if no package or file defined.
        Raises SPDXValueError if malformed value.
        """
        if arg_0.has_package(arg_1) and arg_0.has_file(arg_1):
            if validations.validate_file_lics_in_file(arg_2):
                arg_0.file(arg_1).add_lics(arg_2)
                return True
            else:
                raise SPDXValueError('File::LicenseInFile')
        else:
            raise OrderError('File::LicenseInFile')

Raises OrderError if no package or file defined . Raises SPDXValueError if malformed value .


def Func ( ) : try : arg_0 = pkg_resources . get_distribution ( "nupic.bindings" ) if pkg_resources . parse_version ( arg_0 . version ) . is_prerelease : return True except pkg_resources . DistributionNotFound : pass return False

def Func():
  """
  Make an attempt to determine if a pre-release version of nupic.bindings is
  installed already.

  @return: boolean
  """
  try:
    arg_0 = pkg_resources.get_distribution("nupic.bindings")
    if pkg_resources.parse_version(arg_0.version).is_prerelease:
      # A pre-release dev version of nupic.bindings is installed.
      return True
  except pkg_resources.DistributionNotFound:
    pass  # Silently ignore.  The absence of nupic.bindings will be handled by
    # setuptools by default

  return False

Make an attempt to determine if a pre - release version of nupic . bindings is installed already .


def Func(arg_0=None, arg_1=False):
    """Return Credentials and default SubscriptionID of current loaded profile of the CLI.

    Credentials will be the "az login" command:
    https://docs.microsoft.com/cli/azure/authenticate-azure-cli

    Default subscription ID is either the only one you have, or you can define it:
    https://docs.microsoft.com/cli/azure/manage-azure-subscriptions-azure-cli

    .. versionadded:: 1.1.6

    :param str resource: The alternative resource for credentials if not ARM (GraphRBac, etc.)
    :param bool with_tenant: If True, return a three-tuple with last as tenant ID
    :return: tuple of Credentials and SubscriptionID (and tenant ID if with_tenant)
    :rtype: tuple
    """
    arg_2 = get_cli_profile()
    arg_3, arg_4, arg_5 = arg_2.get_login_credentials(arg_0=arg_0)
    if arg_1:
        return arg_3, arg_4, arg_5
    else:
        return arg_3, arg_4

Return Credentials and default SubscriptionID of current loaded profile of the CLI .


return server.post(
            'challenge_admin',
            self.as_payload(),
            replacements={'slug': self.slug})

def Func ( arg_0 , arg_1 ) : return arg_1 . post ( 'challenge_admin' , arg_0 . as_payload ( ) , replacements = { 'slug' : arg_0 . slug } )

def Func(arg_0, arg_1):
        """Create the challenge on the server"""

        return arg_1.post(
            'challenge_admin',
            arg_0.as_payload(),
            replacements={'slug': arg_0.slug})


def Func(arg_0, arg_1, arg_2):
        """ Build the execution environment. """
        # Grab the request line
        arg_3 = arg_0.read_request_line(arg_1)

        # Copy the Base Environment
        arg_4 = arg_0.base_environ.copy()

        # Grab the headers
        for arg_5, arg_6 in arg_0.read_headers(arg_1).items():
            arg_4[arg_7('HTTP_'+arg_5)] = arg_6

        # Add CGI Variables
        arg_4['REQUEST_METHOD'] = arg_3['method']
        arg_4['PATH_INFO'] = arg_3['path']
        arg_4['SERVER_PROTOCOL'] = arg_3['protocol']
        arg_4['SERVER_PORT'] = arg_7(arg_2.server_port)
        arg_4['REMOTE_PORT'] = arg_7(arg_2.client_port)
        arg_4['REMOTE_ADDR'] = arg_7(arg_2.client_addr)
        arg_4['QUERY_STRING'] = arg_3['query_string']
        if 'HTTP_CONTENT_LENGTH' in arg_4:
            arg_4['CONTENT_LENGTH'] = arg_4['HTTP_CONTENT_LENGTH']
        if 'HTTP_CONTENT_TYPE' in arg_4:
            arg_4['CONTENT_TYPE'] = arg_4['HTTP_CONTENT_TYPE']

        # Save the request method for later
        arg_0.request_method = arg_4['REQUEST_METHOD']

        # Add Dynamic WSGI Variables
        if arg_2.ssl:
            arg_4['wsgi.url_scheme'] = 'https'
            arg_4['HTTPS'] = 'on'
        else:
            arg_4['wsgi.url_scheme'] = 'http'

        if arg_4.get('HTTP_TRANSFER_ENCODING', '') == 'chunked':
            arg_4['wsgi.input'] = ChunkedReader(arg_1)
        else:
            arg_4['wsgi.input'] = arg_1

        return arg_4


(dicom_files, field_weights=None,
                             dist_method_cls=None, **kwargs)

def Func(arg_0, arg_1=None,
                             arg_2=None, **arg_3):
    """
    Calculates the DicomFileDistance between all files in dicom_files, using an
    weighted Levenshtein measure between all field names in field_weights and
    their corresponding weights.

    Parameters
    ----------
    dicom_files: iterable of str
        Dicom file paths

    field_weights: dict of str to float
        A dict with header field names to float scalar values, that
        indicate a distance measure ratio for the levenshtein distance
        averaging of all the header field names in it. e.g., {'PatientID': 1}

    dist_method_cls: DicomFileDistance class
        Distance method object to compare the files.
        If None, the default DicomFileDistance method using Levenshtein
        distance between the field_wieghts will be used.

    kwargs: DicomFileDistance instantiation named arguments
        Apart from the field_weitghts argument.

    Returns
    -------
    file_dists: np.ndarray or scipy.sparse.lil_matrix of shape NxN
        Levenshtein distances between each of the N items in dicom_files.
    """
    if arg_2 is None:
        arg_4 = LevenshteinDicomFileDistance(arg_1)
    else:
        try:
            arg_4 = arg_2(arg_1=arg_1, **arg_3)
        except:
            log.exception('Could not instantiate {} object with field_weights '
                          'and {}'.format(arg_2, arg_3))

    arg_5 = np.float16
    arg_6 = len(arg_0)

    try:
        arg_7 = np.zeros((arg_6, arg_6), dtype=arg_5)
    except MemoryError as mee:
        import scipy.sparse
        arg_7 = scipy.sparse.lil_matrix((arg_6, arg_6),
                                             dtype=arg_5)

    for arg_8 in range(arg_6):
        arg_4.set_dicom_file1(arg_0[arg_8])

        for arg_9 in range(arg_8+1, arg_6):
            arg_4.set_dicom_file2(arg_0[arg_9])

            if arg_8 != arg_9:
                arg_7[arg_8, arg_9] = arg_4.transform()

    return arg_7

Calculates the DicomFileDistance between all files in dicom_files using an weighted Levenshtein measure between all field names in field_weights and their corresponding weights .


def Func ( arg_0 , arg_1 , arg_2 = 0 ) : for arg_3 in range ( arg_0 . BEGIN , arg_0 . END + 1 ) : arg_4 = arg_0 . index ( arg_3 , len ( arg_1 ) ) yield arg_2 if arg_4 is None else arg_1 [ arg_4 ]

def Func(arg_0, arg_1, arg_2=0):
        """
        Returns a generator with the elements "data" taken by offset, restricted
        by self.begin and self.end, and padded on either end by `pad` to get
        back to the original length of `data`
        """
        for arg_3 in range(arg_0.BEGIN, arg_0.END + 1):
            arg_4 = arg_0.index(arg_3, len(arg_1))
            yield arg_2 if arg_4 is None else arg_1[arg_4]

Returns a generator with the elements data taken by offset restricted by self . begin and self . end and padded on either end by pad to get back to the original length of data


def Func(arg_0, arg_1):
        """Handle a JSON AMP dialect request.

        First, the JSON is parsed. Then, all JSON dialect specific
        values in the request are turned into the correct objects.
        Then, finds the correct responder function, calls it, and
        serializes the result (or error).

        """
        arg_2 = loads(arg_1)

        arg_3 = arg_2.pop("_ask")
        arg_4 = arg_2.pop("_command")
        arg_5, arg_6 = arg_0._getCommandAndResponder(arg_4)

        arg_0._parseRequestValues(arg_2, arg_5)
        arg_7 = arg_0._runResponder(arg_6, arg_2, arg_5, arg_3)
        arg_7.addCallback(arg_0._writeResponse)


def Func ( arg_0 , arg_1 = { } ) : arg_2 = [ ( k , arg_1 [ k ] ) for k in sorted ( arg_1 ) ] arg_3 = "/2/users/?%s" % urlencode ( arg_2 ) arg_4 = arg_0 . _get_resource ( arg_3 ) arg_5 = [ ] for arg_6 in arg_4 [ "users" ] : arg_5 . append ( arg_0 . user_from_json ( arg_6 ) ) return arg_5

def Func(arg_0, arg_1={}):
        """
        Returns a list of users.

        http://dev.wheniwork.com/#listing-users
        """
        arg_2 = [(k, arg_1[k]) for k in sorted(arg_1)]
        arg_3 = "/2/users/?%s" % urlencode(arg_2)

        arg_4 = arg_0._get_resource(arg_3)
        arg_5 = []
        for arg_6 in arg_4["users"]:
            arg_5.append(arg_0.user_from_json(arg_6))

        return arg_5


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if ( arg_3 and not arg_5 . CONFIGURATION [ "simple" ] and arg_5 . INTERN [ "file_to_test" ] ) : arg_0 . mining . process ( ) arg_0 . mining . remove ( ) if ( arg_3 . lower ( ) in arg_5 . STATUS [ "list" ] [ "up" ] or arg_3 . lower ( ) in arg_5 . STATUS [ "list" ] [ "valid" ] ) : if arg_0 . inactive_database . is_present ( ) : Generate ( arg_5 . STATUS [ "official" ] [ "up" ] ) . analytic_file ( "suspicious" ) arg_0 . inactive_database . remove ( ) else : arg_0 . inactive_database . add ( ) arg_0 . auto_continue . backup ( ) if arg_1 != arg_2 : AutoSave ( ) else : ExecutionTime ( "stop" , arg_2 = True ) arg_0 . percentage . log ( ) arg_0 . reset_counters ( ) arg_0 . auto_continue . backup ( ) arg_0 . colorify_logo ( ) AutoSave ( True ) for arg_4 in [ "http_code" , "referer" ] : if arg_4 in arg_5 . INTERN : arg_5 . INTERN [ arg_4 ] = ""

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Manage the database, autosave and autocontinue systems for the case that we are reading
        a file.

        :param current: The currently tested element.
        :type current: str

        :param last: The last element of the list.
        :type last: str

        :param status: The status of the currently tested element.
        :type status: str
        """

        if (
            arg_3
            and not arg_5.CONFIGURATION["simple"]
            and arg_5.INTERN["file_to_test"]
        ):
            # * The status is given.
            # and
            # * The simple mode is deactivated.
            # and
            # * A file to test is set.

            # We run the mining logic.
            arg_0.mining.process()

            # We delete the currently tested element from the mining
            # database.
            # Indeed, as it is tested, it is already in our
            # testing process which means that we don't need it into
            # the mining database.
            arg_0.mining.remove()

            if (
                arg_3.lower() in arg_5.STATUS["list"]["up"]
                or arg_3.lower() in arg_5.STATUS["list"]["valid"]
            ):
                # The status is in the list of up status.

                if arg_0.inactive_database.is_present():
                    # The currently tested element is in the database.

                    # We generate the suspicious file(s).
                    Generate(arg_5.STATUS["official"]["up"]).analytic_file(
                        "suspicious"
                    )

                    # We remove the currently tested element from the
                    # database.
                    arg_0.inactive_database.remove()

            else:
                # The status is not in the list of up status.

                # We add the currently tested element to the
                # database.
                arg_0.inactive_database.add()

            # We backup the current state of the file reading
            # for the case that we need to continue later.
            arg_0.auto_continue.backup()

            if arg_1 != arg_2:
                # The current element is not the last one.

                # We run the autosave logic.
                AutoSave()
            else:
                # The current element is the last one.

                # We stop and log the execution time.
                ExecutionTime("stop", arg_2=True)

                # We show/log the percentage.
                arg_0.percentage.log()

                # We reset the counters as we end the process.
                arg_0.reset_counters()

                # We backup the current state of the file reading
                # for the case that we need to continue later.
                arg_0.auto_continue.backup()

                # We show the colored logo.
                arg_0.colorify_logo()

                # We save and stop the script if we are under
                # Travis CI.
                AutoSave(True)

        for arg_4 in ["http_code", "referer"]:
            # We loop through some configuration index we have to empty.

            if arg_4 in arg_5.INTERN:
                # The index is in the configuration.

                # We empty the configuration index.
                arg_5.INTERN[arg_4] = ""

Manage the database autosave and autocontinue systems for the case that we are reading a file .


def Func ( arg_0 , arg_1 ) : arg_0 . config . update ( arg_1 ) arg_0 . config . setdefault ( 'LDAP_PORT' , 389 ) arg_0 . config . setdefault ( 'LDAP_HOST' , None ) arg_0 . config . setdefault ( 'LDAP_USE_SSL' , False ) arg_0 . config . setdefault ( 'LDAP_READONLY' , True ) arg_0 . config . setdefault ( 'LDAP_CHECK_NAMES' , True ) arg_0 . config . setdefault ( 'LDAP_BIND_DIRECT_CREDENTIALS' , False ) arg_0 . config . setdefault ( 'LDAP_BIND_DIRECT_PREFIX' , '' ) arg_0 . config . setdefault ( 'LDAP_BIND_DIRECT_SUFFIX' , '' ) arg_0 . config . setdefault ( 'LDAP_BIND_DIRECT_GET_USER_INFO' , True ) arg_0 . config . setdefault ( 'LDAP_ALWAYS_SEARCH_BIND' , False ) arg_0 . config . setdefault ( 'LDAP_BASE_DN' , '' ) arg_0 . config . setdefault ( 'LDAP_BIND_USER_DN' , None ) arg_0 . config . setdefault ( 'LDAP_BIND_USER_PASSWORD' , None ) arg_0 . config . setdefault ( 'LDAP_SEARCH_FOR_GROUPS' , True ) arg_0 . config . setdefault ( 'LDAP_FAIL_AUTH_ON_MULTIPLE_FOUND' , False ) arg_0 . config . setdefault ( 'LDAP_USER_DN' , '' ) arg_0 . config . setdefault ( 'LDAP_GROUP_DN' , '' ) arg_0 . config . setdefault ( 'LDAP_BIND_AUTHENTICATION_TYPE' , 'SIMPLE' ) arg_0 . config . setdefault ( 'LDAP_USER_SEARCH_SCOPE' , 'LEVEL' ) arg_0 . config . setdefault ( 'LDAP_USER_OBJECT_FILTER' , '(objectclass=person)' ) arg_0 . config . setdefault ( 'LDAP_USER_LOGIN_ATTR' , 'uid' ) arg_0 . config . setdefault ( 'LDAP_USER_RDN_ATTR' , 'uid' ) arg_0 . config . setdefault ( 'LDAP_GET_USER_ATTRIBUTES' , ldap3 . ALL_ATTRIBUTES ) arg_0 . config . setdefault ( 'LDAP_GROUP_SEARCH_SCOPE' , 'LEVEL' ) arg_0 . config . setdefault ( 'LDAP_GROUP_OBJECT_FILTER' , '(objectclass=group)' ) arg_0 . config . setdefault ( 'LDAP_GROUP_MEMBERS_ATTR' , 'uniqueMember' ) arg_0 . config . setdefault ( 'LDAP_GET_GROUP_ATTRIBUTES' , ldap3 . ALL_ATTRIBUTES ) arg_0 . config . setdefault ( 'LDAP_ADD_SERVER' , True ) if arg_0 . config [ 'LDAP_ADD_SERVER' ] : arg_0 . add_server ( hostname = arg_0 . config [ 'LDAP_HOST' ] , port = arg_0 . config [ 'LDAP_PORT' ] , use_ssl = arg_0 . config [ 'LDAP_USE_SSL' ] )

def Func(arg_0, arg_1):
        '''
        Configures this extension with a given configuration dictionary.
        This allows use of this extension without a flask app.

        Args:
            config (dict): A dictionary with configuration keys
        '''

        arg_0.config.update(arg_1)

        arg_0.config.setdefault('LDAP_PORT', 389)
        arg_0.config.setdefault('LDAP_HOST', None)
        arg_0.config.setdefault('LDAP_USE_SSL', False)
        arg_0.config.setdefault('LDAP_READONLY', True)
        arg_0.config.setdefault('LDAP_CHECK_NAMES', True)
        arg_0.config.setdefault('LDAP_BIND_DIRECT_CREDENTIALS', False)
        arg_0.config.setdefault('LDAP_BIND_DIRECT_PREFIX', '')
        arg_0.config.setdefault('LDAP_BIND_DIRECT_SUFFIX', '')
        arg_0.config.setdefault('LDAP_BIND_DIRECT_GET_USER_INFO', True)
        arg_0.config.setdefault('LDAP_ALWAYS_SEARCH_BIND', False)
        arg_0.config.setdefault('LDAP_BASE_DN', '')
        arg_0.config.setdefault('LDAP_BIND_USER_DN', None)
        arg_0.config.setdefault('LDAP_BIND_USER_PASSWORD', None)
        arg_0.config.setdefault('LDAP_SEARCH_FOR_GROUPS', True)
        arg_0.config.setdefault('LDAP_FAIL_AUTH_ON_MULTIPLE_FOUND', False)

        # Prepended to the Base DN to limit scope when searching for
        # Users/Groups.
        arg_0.config.setdefault('LDAP_USER_DN', '')
        arg_0.config.setdefault('LDAP_GROUP_DN', '')

        arg_0.config.setdefault('LDAP_BIND_AUTHENTICATION_TYPE', 'SIMPLE')

        # Ldap Filters
        arg_0.config.setdefault('LDAP_USER_SEARCH_SCOPE',
                               'LEVEL')
        arg_0.config.setdefault('LDAP_USER_OBJECT_FILTER',
                               '(objectclass=person)')
        arg_0.config.setdefault('LDAP_USER_LOGIN_ATTR', 'uid')
        arg_0.config.setdefault('LDAP_USER_RDN_ATTR', 'uid')
        arg_0.config.setdefault(
            'LDAP_GET_USER_ATTRIBUTES', ldap3.ALL_ATTRIBUTES)

        arg_0.config.setdefault('LDAP_GROUP_SEARCH_SCOPE',
                               'LEVEL')
        arg_0.config.setdefault(
            'LDAP_GROUP_OBJECT_FILTER', '(objectclass=group)')
        arg_0.config.setdefault('LDAP_GROUP_MEMBERS_ATTR', 'uniqueMember')
        arg_0.config.setdefault(
            'LDAP_GET_GROUP_ATTRIBUTES', ldap3.ALL_ATTRIBUTES)
        arg_0.config.setdefault('LDAP_ADD_SERVER', True)

        if arg_0.config['LDAP_ADD_SERVER']:
            arg_0.add_server(
                hostname=arg_0.config['LDAP_HOST'],
                port=arg_0.config['LDAP_PORT'],
                use_ssl=arg_0.config['LDAP_USE_SSL']
            )

Configures this extension with a given configuration dictionary . This allows use of this extension without a flask app .


def Func ( arg_0 , arg_1 ) : arg_0 . _lock . acquire ( ) try : arg_2 = arg_1 . update_state ( ) arg_0 . _items_list . sort ( ) if arg_1 . state == 'purged' : arg_0 . _purged += 1 if arg_0 . _purged > 0.25 * arg_0 . max_items : arg_0 . purge_items ( ) return arg_2 finally : arg_0 . _lock . release ( )

def Func(arg_0, arg_1):
        """Update state of an item in the cache.

        Update item's state and remove the item from the cache
        if its new state is 'purged'

        :Parameters:
            - `item`: item to update.
        :Types:
            - `item`: `CacheItem`

        :return: new state of the item.
        :returntype: `str`"""

        arg_0._lock.acquire()
        try:
            arg_2 = arg_1.update_state()
            arg_0._items_list.sort()
            if arg_1.state == 'purged':
                arg_0._purged += 1
                if arg_0._purged > 0.25*arg_0.max_items:
                    arg_0.purge_items()
            return arg_2
        finally:
            arg_0._lock.release()


def Func(arg_0, arg_1, arg_2):
        """Save the submission of a task."""
        arg_3 = arg_1[0]

        try:
            arg_2 = arg_0.session.unserialize(arg_2)
        except Exception:
            arg_0.log.error("task::client %r sent invalid task message: %r",
                    arg_3, arg_2, exc_info=True)
            return
        arg_4 = init_record(arg_2)

        arg_4['client_uuid'] = arg_3.decode('ascii')
        arg_4['queue'] = 'task'
        arg_5 = arg_2['header']
        arg_6 = arg_5['msg_id']
        arg_0.pending.add(arg_6)
        arg_0.unassigned.add(arg_6)
        try:
            # it's posible iopub arrived first:
            arg_7 = arg_0.db.get_record(arg_6)
            if arg_7['resubmitted']:
                for arg_8 in ('submitted', 'client_uuid', 'buffers'):
                    # don't clobber these keys on resubmit
                    # submitted and client_uuid should be different
                    # and buffers might be big, and shouldn't have changed
                    arg_4.pop(arg_8)
                    # still check content,header which should not change
                    # but are not expensive to compare as buffers

            for arg_8,arg_9 in arg_7.iteritems():
                if arg_8.endswith('buffers'):
                    # don't compare buffers
                    continue
                arg_10 = arg_4.get(arg_8, None)
                if arg_9 and arg_10 and arg_9 != arg_10:
                    arg_0.log.warn("conflicting initial state for record: %r:%r <%r> %r", arg_6, arg_10, arg_8, arg_9)
                elif arg_9 and not arg_10:
                    arg_4[arg_8] = arg_9
            try:
                arg_0.db.update_record(arg_6, arg_4)
            except Exception:
                arg_0.log.error("DB Error updating record %r", arg_6, exc_info=True)
        except KeyError:
            try:
                arg_0.db.add_record(arg_6, arg_4)
            except Exception:
                arg_0.log.error("DB Error adding record %r", arg_6, exc_info=True)
        except Exception:
            arg_0.log.error("DB Error saving task request %r", arg_6, exc_info=True)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
dictDiff
(
arg_0
,
arg_1
)
if
not
arg_2
:
return
arg_2
if
arg_2
[
'inAButNotInB'
]
:
print
">>> inAButNotInB: %s"
%
arg_2
[
'inAButNotInB'
]
if
arg_2
[
'inBButNotInA'
]
:
print
">>> inBButNotInA: %s"
%
arg_2
[
'inBButNotInA'
]
for
arg_3
in
arg_2
[
'differentValues'
]
:
print
">>> da[%s] != db[%s]"
%
(
arg_3
,
arg_3
)
print
"da[%s] = %r"
%
(
arg_3
,
arg_0
[
arg_3
]
)
print
"db[%s] = %r"
%
(
arg_3
,
arg_1
[
arg_3
]
)
return
arg_2

def Func(arg_0, arg_1):
  """ Compares two python dictionaries at the top level and report differences,
  if any, to stdout

  da:             first dictionary
  db:             second dictionary

  Returns:        The same value as returned by dictDiff() for the given args
  """
  arg_2 = dictDiff(arg_0, arg_1)

  if not arg_2:
    return arg_2

  if arg_2['inAButNotInB']:
    print ">>> inAButNotInB: %s" % arg_2['inAButNotInB']

  if arg_2['inBButNotInA']:
    print ">>> inBButNotInA: %s" % arg_2['inBButNotInA']

  for arg_3 in arg_2['differentValues']:
    print ">>> da[%s] != db[%s]" % (arg_3, arg_3)
    print "da[%s] = %r" % (arg_3, arg_0[arg_3])
    print "db[%s] = %r" % (arg_3, arg_1[arg_3])

  return arg_2

Compares two python dictionaries at the top level and report differences if any to stdout


(self, case_id=None, institute_id=None, display_name=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Fetches a single Func from database

        Use either the _id or combination of institute_id and display_name

        Args:
            Func_id(str): _id for a caes
            institute_id(str):
            display_name(str)

        Yields:
            A single Case
        """
        arg_4 = {}
        if arg_1:
            arg_4['_id'] = arg_1
            LOG.info("Fetching Func %s", arg_1)
        else:
            if not (arg_2 and arg_3):
                raise ValueError("Have to provide both institute_id and display_name")
            LOG.info("Fetching Func %s institute %s", arg_3, arg_2)
            arg_4['owner'] = arg_2
            arg_4['display_name'] = arg_3

        return arg_0.Func_collection.find_one(arg_4)

Fetches a single case from database

        Use either the _id or combination of institute_id and display_name

        Args:
            case_id(str): _id for a caes
            institute_id(str):
            display_name(str)

        Yields:
            A single Case


def Func(arg_0, arg_1, arg_2=False):
        """ Add record class to record store for retrieval at record load time.

            Can be used as a class decorator
        """
        arg_3 = get_full_name(arg_1)
        arg_4 = '.' in arg_3
        arg_0._force_add(arg_3, arg_1, arg_2, _raise_on_existing=arg_4)
        if arg_4 and arg_1.__name__ not in arg_0._schema_map:
            arg_0._force_add(arg_1.__name__, arg_1, arg_2)
        return arg_1

Add record class to record store for retrieval at record load time .


def Func ( arg_0 , arg_1 , arg_2 = ( ) ) : arg_3 = arg_0 . extraction_path or get_default_cache ( ) arg_4 = os . path . join ( arg_3 , arg_1 + '-tmp' , * arg_2 ) try : _bypass_ensure_directory ( arg_4 ) except : arg_0 . extraction_error ( ) arg_0 . cached_files [ arg_4 ] = 1 return arg_4

def Func(arg_0, arg_1, arg_2=()):
        """Return absolute location in cache for `archive_name` and `names`

        The parent directory of the resulting path will be created if it does
        not already exist.  `archive_name` should be the base filename of the
        enclosing egg (which may not be the name of the enclosing zipfile!),
        including its ".egg" extension.  `names`, if provided, should be a
        sequence of path name parts "under" the egg's extraction location.

        This method should only be called by resource providers that need to
        obtain an extraction location, and only for names they intend to
        extract, as it tracks the generated names for possible cleanup later.
        """
        arg_3 = arg_0.extraction_path or get_default_cache()
        arg_4 = os.path.join(arg_3, arg_1+'-tmp', *arg_2)
        try:
            _bypass_ensure_directory(arg_4)
        except:
            arg_0.extraction_error()

        arg_0.cached_files[arg_4] = 1
        return arg_4

Return absolute location in cache for archive_name and names


def Func ( arg_0 ) : arg_0 . metadata = arg_0 . db . read ( arg_0 . path ) . json ( )

def Func(arg_0):
        """Refresh reloads data from the server. It raises an error if it fails to get the object's metadata"""
        arg_0.metadata = arg_0.db.read(arg_0.path).json()

Refresh reloads data from the server . It raises an error if it fails to get the object s metadata


return mapping_util.map_unmasked_1d_array_to_2d_array_from_array_1d_and_shape(array_1d=padded_array_1d,
                                                                                shape=self.mask.shape)

def Func(arg_0, arg_1):
        """ Map a padded 1D array of values to its padded 2D array.

        Parameters
        -----------
        padded_array_1d : ndarray
            A 1D array of values which were computed using the *PaddedRegularGrid*.
        """
        return mapping_util.map_unmasked_1d_array_to_2d_array_from_array_1d_and_shape(array_1d=arg_1,
                                                                                shape=arg_0.mask.shape)

Map a padded 1D array of values to its padded 2D array .


def Func ( arg_0 , arg_1 ) : try : with open ( arg_1 , "w" ) as file : dump ( arg_0 . main_dictionnary , file , ensure_ascii = False , indent = 4 , sort_keys = True , ) except UnicodeEncodeError : with open ( arg_1 , "w" , encoding = "utf-8" ) as file : dump ( arg_0 . main_dictionnary , file , ensure_ascii = False , indent = 4 , sort_keys = True , )

def Func(arg_0, arg_1):
        """
        Save a dictionnary into a JSON file.

        :param destination:
            A path to a file where we're going to
            write the converted dict into a JSON format.
        :type destination: str
        """

        try:
            with open(arg_1, "w") as file:
                # We open the file we are going to write.
                # Note: We always overwrite the destination.

                # We save the current dictionnary into a json format.
                dump(
                    arg_0.main_dictionnary,
                    file,
                    ensure_ascii=False,
                    indent=4,
                    sort_keys=True,
                )
        except UnicodeEncodeError:  # pragma: no cover
            with open(arg_1, "w", encoding="utf-8") as file:
                # We open the file we are going to write.
                # Note: We always overwrite the destination.

                # We save the current dictionnary into a json format.
                dump(
                    arg_0.main_dictionnary,
                    file,
                    ensure_ascii=False,
                    indent=4,
                    sort_keys=True,
                )


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = { } if 'create_datacenter' in arg_2 : arg_2 [ 'create_data_center' ] = arg_2 . pop ( 'create_datacenter' ) for arg_4 , arg_5 in arg_2 . items ( ) : arg_3 [ arg_0 . _underscore_to_camelcase ( arg_4 ) ] = arg_5 arg_7 = { "properties" : arg_3 } arg_8 = arg_0 . _perform_request ( url = '/um/groups/%s' % arg_1 , method = 'PUT' , arg_7 = json . dumps ( arg_7 ) ) return arg_8

def Func(arg_0, arg_1, **arg_2):
        """
        Updates a group.

        :param      group_id: The unique ID of the group.
        :type       group_id: ``str``

        """
        arg_3 = {}

        # make the key camel-case transformable
        if 'create_datacenter' in arg_2:
            arg_2['create_data_center'] = arg_2.pop('create_datacenter')

        for arg_4, arg_5 in arg_2.items():
            arg_3[arg_0._underscore_to_camelcase(arg_4)] = arg_5

        arg_7 = {
            "properties": arg_3
        }

        arg_8 = arg_0._perform_request(
            url='/um/groups/%s' % arg_1,
            method='PUT',
            arg_7=json.dumps(arg_7))

        return arg_8


def Func(arg_0):
    '''Returns the number of sequences in a file'''
    arg_1 = sequences.file_reader(arg_0)
    arg_2 = 0
    for arg_3 in arg_1:
        arg_2 += 1
    return arg_2


def Func ( arg_0 , arg_1 = None ) : arg_0 . ui . pushbuffer ( ) commands . log ( arg_0 . ui , arg_0 . repo , arg_1 = arg_1 , date = None , rev = None , user = None ) arg_2 = arg_0 . ui . popbuffer ( ) . strip ( ) arg_3 = [ ] for arg_4 in arg_2 . split ( "\n\n" ) : arg_5 = { } arg_3 . append ( arg_5 ) for arg_6 in arg_4 . split ( "\n" ) : arg_7 , arg_8 = arg_6 . split ( ":" , 1 ) assert arg_7 in ( "changeset" , "tag" , "user" , "date" , "summary" ) arg_5 [ arg_7 . strip ( ) ] = arg_8 . strip ( ) arg_5 [ "parsed_date" ] = util . parse_time_string ( arg_5 [ "date" ] ) arg_10 , arg_11 = arg_5 [ "changeset" ] . split ( ":" ) arg_5 [ "local_id" ] = int ( arg_10 ) arg_5 [ "unid" ] = arg_11 return arg_3

def Func(arg_0, arg_1=None):
        """Read log entries into a list of dictionaries."""
        arg_0.ui.pushbuffer()
        commands.log(arg_0.ui, arg_0.repo, arg_1=arg_1, date=None, rev=None, user=None)
        arg_2 = arg_0.ui.popbuffer().strip()

        arg_3 = []
        for arg_4 in arg_2.split("\n\n"):
            arg_5 = {}
            arg_3.append(arg_5)
            for arg_6 in arg_4.split("\n"):
                arg_7, arg_8 = arg_6.split(":", 1)
                assert arg_7 in ("changeset", "tag", "user", "date", "summary")
                arg_5[arg_7.strip()] = arg_8.strip()
            arg_5["parsed_date"] = util.parse_time_string(arg_5["date"])
            arg_10, arg_11 = arg_5["changeset"].split(":")
            arg_5["local_id"] = int(arg_10)
            arg_5["unid"] = arg_11
        #        pprint(logList)
        return arg_3

Read log entries into a list of dictionaries .


def Func ( arg_0 , arg_1 ) : arg_2 = None if isinstance ( arg_1 , ValueRange ) : arg_3 = { } if arg_1 . lower : arg_3 . update ( { "gte" : arg_1 . lower_string } ) if arg_1 . upper : arg_3 . update ( { "lte" : arg_1 . upper_string } ) arg_2 = { "range" : { arg_0 : arg_3 } } elif _is_iterable ( arg_1 ) : arg_2 = { "terms" : { arg_0 : arg_1 } } else : arg_2 = { "term" : { arg_0 : arg_1 } } return arg_2

def Func(arg_0, arg_1):
    """ Return field to apply into filter, if an array then use a range, otherwise look for a term match """
    arg_2 = None
    if isinstance(arg_1, ValueRange):
        arg_3 = {}
        if arg_1.lower:
            arg_3.update({"gte": arg_1.lower_string})
        if arg_1.upper:
            arg_3.update({"lte": arg_1.upper_string})
        arg_2 = {
            "range": {
                arg_0: arg_3
            }
        }
    elif _is_iterable(arg_1):
        arg_2 = {
            "terms": {
                arg_0: arg_1
            }
        }
    else:
        arg_2 = {
            "term": {
                arg_0: arg_1
            }
        }
    return arg_2

Return field to apply into filter if an array then use a range otherwise look for a term match


def Func ( arg_0 ) : if not os . path . exists ( arg_0 ) : return None with open ( arg_0 ) as fh : return fh . readlines ( )

def Func(arg_0):
        """Method used to retrieve the contents of a log file into a list.

        Parameters
        ----------
        path

        Returns
        -------
        list or None
            Contents of the provided file, each line as a list entry
        """

        if not os.path.exists(arg_0):
            return None

        with open(arg_0) as fh:
            return fh.readlines()

Method used to retrieve the contents of a log file into a list .


(cvec, parallax, radial_velocity, radial_velocity_error)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Take the astrometric parameter standard uncertainties and the uncertainty correlations as quoted in
    the Gaia catalogue and construct the covariance matrix.

    Parameters
    ----------

    cvec : array_like
        Array of shape (15,) (1 source) or (n,15) (n sources) for the astrometric parameter standard
        uncertainties and their correlations, as listed in the Gaia catalogue [ra_error, dec_error,
        parallax_error, pmra_error, pmdec_error, ra_dec_corr, ra_parallax_corr, ra_pmra_corr,
        ra_pmdec_corr, dec_parallax_corr, dec_pmra_corr, dec_pmdec_corr, parallax_pmra_corr,
        parallax_pmdec_corr, pmra_pmdec_corr]. Units are (mas^2, mas^2/yr, mas^2/yr^2).

    parallax : array_like (n elements)
        Source parallax (mas).

    radial_velocity : array_like (n elements)
        Source radial velocity (km/s, does not have to be from Gaia RVS!). If the radial velocity is not
        known it can be set to zero.

    radial_velocity_error : array_like (n elements)
        Source radial velocity  uncertainty (km/s). If the radial velocity is not know this can be set to
        the radial velocity dispersion for the population the source was drawn from.

    Returns
    -------

    Covariance matrix as a 6x6 array.
    """

    if np.ndim(arg_0)==1:
        arg_4 = np.zeros((1,6,6))
        arg_5 = 1
        arg_6 = np.atleast_2d(arg_0)
    else:
        arg_5 = arg_0.shape[0]
        arg_4 = np.zeros((arg_5,6,6))
        arg_6 = arg_0
    for arg_7 in range(arg_5):
        arg_4[arg_7,0:5,0:5] = arg_6[arg_7,0:5]**2

    arg_8 = np.triu_indices(5,arg_7=1)
    for arg_7 in range(10):
        arg_9 = arg_8[0][arg_7]
        arg_10 = arg_8[1][arg_7]
        arg_4[:,arg_9,arg_10] = arg_6[:,arg_9]*arg_6[:,arg_10]*arg_6[:,arg_7+5]
        arg_4[:,arg_10,arg_9] = arg_4[:,arg_9,arg_10]

    for arg_7 in range(arg_5):
        arg_4[arg_7,0:5,5] = arg_4[arg_7,0:5,2]*np.atleast_1d(arg_2)[arg_7]/auKmYearPerSec
    arg_4[:,5,0:5] = arg_4[:,0:5,5]
    arg_4[:,5,5] = arg_4[:,2,2]*(arg_2**2 + arg_3**2)/auKmYearPerSec**2 + \
            (arg_1*arg_3/auKmYearPerSec)**2

    return np.squeeze(arg_4)

Take the astrometric parameter standard uncertainties and the uncertainty correlations as quoted in the Gaia catalogue and construct the covariance matrix .


(self,
                             pull_requests,
                             issues,
                             newer_tag,
                             older_tag_name)

def Func(arg_0,
                             arg_1,
                             arg_2,
                             arg_3,
                             arg_4):
        """
        Generates log for tag section with header and body.

        :param list(dict) pull_requests: List of PR's in this tag section.
        :param list(dict) issues: List of issues in this tag section.
        :param dict newer_tag: Github data of tag for this section.
        :param str older_tag_name: Older tag, used for the links.
                                   May be special value, if **newer tag** is
                                   the first tag. (Means **older_tag** is when
                                   the repo was created.)
        :rtype: str
        :return: Ready-to-add and parsed tag section.
        """

        arg_5, arg_6, \
        arg_7 = arg_0.detect_link_tag_time(arg_3)

        arg_8 = "https://github.com" or arg_0.options.github_endpoint
        arg_9 = "{0}/{1}/{2}".format(
            arg_8, arg_0.options.user, arg_0.options.project)

        arg_10 = arg_0.generate_header(arg_6, arg_5,
                                   arg_7, arg_4, arg_9)
        if arg_0.options.issues:
            # Generate issues:
            arg_10 += arg_0.issues_to_log(arg_2, arg_1)
        if arg_0.options.include_pull_request:
            # Generate pull requests:
            arg_10 += arg_0.generate_sub_section(
                arg_1, arg_0.options.merge_prefix
            )
        return arg_10

Generates log for tag section with header and body .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 , CannedObject ) and arg_0 . buffers : for arg_2 , arg_3 in enumerate ( arg_0 . buffers ) : if arg_3 is None : arg_0 . buffers [ arg_2 ] = arg_1 . pop ( 0 )

def Func(arg_0, arg_1):
    """Restore extracted buffers."""
    if isinstance(arg_0, CannedObject) and arg_0.buffers:
        for arg_2, arg_3 in enumerate(arg_0.buffers):
            if arg_3 is None:
                arg_0.buffers[arg_2] = arg_1.pop(0)


def Func ( arg_0 , arg_1 ) : arg_2 = { 'action' : 'accept' , } arg_3 = 'milestone_requests/{}' . format ( arg_1 ) arg_4 = make_put_request ( arg_0 , arg_3 , arg_2 = arg_2 ) arg_5 = arg_4 . json ( ) if arg_4 . status_code == 200 : return arg_5 [ 'status' ] else : raise MilestoneRequestNotAcceptedException ( message = arg_5 [ 'message' ] , error_code = arg_5 [ 'error_code' ] , request_id = arg_5 [ 'request_id' ] )

def Func(arg_0, arg_1):
    """
    Accept a milestone request
    """
    arg_2 = {
        'action': 'accept',
    }
    # POST /api/projects/0.1/milestone_requests/{milestone_request_id}/?action=
    # accept
    arg_3 = 'milestone_requests/{}'.format(arg_1)
    arg_4 = make_put_request(arg_0, arg_3, arg_2=arg_2)
    arg_5 = arg_4.json()
    if arg_4.status_code == 200:
        return arg_5['status']
    else:
        raise MilestoneRequestNotAcceptedException(
            message=arg_5['message'],
            error_code=arg_5['error_code'],
            request_id=arg_5['request_id'])


(params, w_name, scope_name, inputs, layers, weights, names)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert 3d Max pooling.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """

    print('Converting pooling ...')

    if arg_6 == 'short':
        arg_7 = 'P' + random_string(7)
    elif arg_6 == 'keep':
        arg_7 = arg_1
    else:
        arg_7 = arg_1 + str(random.random())

    if 'kernel_shape' in arg_0:
        arg_8, arg_9, arg_10 = arg_0['kernel_shape']
    else:
        arg_8, arg_9, arg_10 = arg_0['kernel_size']

    if 'strides' in arg_0:
        arg_11, arg_12, arg_13 = arg_0['strides']
    else:
        arg_11, arg_12, arg_13 = arg_0['stride']

    if 'pads' in arg_0:
        arg_14, arg_15, arg_16, arg_17, arg_17 = arg_0['pads']
    else:
        arg_14, arg_15, arg_16 = arg_0['padding']

    arg_18 = arg_3[0]
    if arg_14 > 0 and arg_15 > 0 and arg_16 > 0:
        arg_19 = arg_7 + '_pad'
        arg_20 = keras.layers.ZeroPadding3D(
            padding=(arg_14, arg_15, arg_16),
            name=arg_19
        )
        arg_4[arg_19] = arg_20(arg_4[arg_3[0]])
        arg_18 = arg_19

    # Pooling type
    arg_21 = keras.layers.MaxPooling3D(
        pool_size=(arg_8, arg_9, arg_10),
        strides=(arg_11, arg_12, arg_13),
        padding='valid',
        name=arg_7
    )

    arg_4[arg_2] = arg_21(arg_4[arg_18])


def
Func
(
arg_0
)
:
arg_1
=
get_app_config
(
)
arg_2
=
os
.
path
.
splitext
(
arg_0
.
name
)
[
1
]
if
arg_1
and
not
arg_2
.
lower
(
)
in
arg_1
.
valid_image_extensions
:
raise
ValidationError
(
_
(
"Unsupported file extension."
)
)

def Func(arg_0):
    """
    Validate that a particular image extension.
    """
    arg_1 = get_app_config()
    arg_2 = os.path.splitext(arg_0.name)[1]
    if arg_1 and not arg_2.lower() in arg_1.valid_image_extensions:
        raise ValidationError(_("Unsupported file extension."))

Validate that a particular image extension .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
OAUTH_ROOT
+
'/access_token'
arg_3
=
{
'client_id'
:
arg_0
.
client_id
,
'client_secret'
:
arg_0
.
client_secret
,
'redirect_uri'
:
arg_0
.
redirect_uri
,
'code'
:
arg_1
,
}
arg_4
=
requests
.
get
(
arg_2
,
arg_3
=
arg_3
)
if
not
arg_4
.
ok
:
raise
MixcloudOauthError
(
"Could not get access token."
)
return
arg_4
.
json
(
)
[
'access_token'
]

def Func(arg_0, arg_1):
        """
        Exchange the authorization code for an access token.
        """
        arg_2 = OAUTH_ROOT + '/access_token'
        arg_3 = {
            'client_id': arg_0.client_id,
            'client_secret': arg_0.client_secret,
            'redirect_uri': arg_0.redirect_uri,
            'code': arg_1,
        }
        arg_4 = requests.get(arg_2, arg_3=arg_3)
        if not arg_4.ok:
            raise MixcloudOauthError("Could not get access token.")
        return arg_4.json()['access_token']

Exchange the authorization code for an access token .


(self,
                message,
                recipient_mobiles=[],
                url='http://services.ambientmobile.co.za/sms',
                concatenate_message=True,
                message_id=str(time()).replace(".", ""),
                reply_path=None,
                allow_duplicates=True,
                allow_invalid_numbers=True,
                )

def Func(arg_0,
                arg_1,
                arg_2=[],
                arg_3='http://services.ambientmobile.co.za/sms',
                arg_4=True,
                arg_5=arg_6(arg_7()).replace(".", ""),
                arg_9=None,
                arg_10=True,
                arg_11=True,
                ):

        """
        Send a mesage via the AmbientSMS API server
        """
        if not arg_2 or not(isinstance(arg_2, list) \
                or isinstance(arg_2, tuple)):
            raise AmbientSMSError("Missing recipients")

        if not arg_1 or not len(arg_1):
            raise AmbientSMSError("Missing message")

        arg_12 = []
        arg_12.append("<api-key>%s</api-key>" % arg_0.api_key)
        arg_12.append("<password>%s</password>" % arg_0.password)
        arg_12.append("<recipients>%s</recipients>" % \
                "".join(["<mobile>%s</mobile>" % \
                arg_13 for arg_13 in arg_2]))
        arg_12.append("<msg>%s</msg>" % arg_1)
        arg_12.append("<concat>%s</concat>" % \
                (1 if arg_4 else 0))
        arg_12.append("<message_id>%s</message_id>" % arg_5)
        arg_12.append("<allow_duplicates>%s</allow_duplicates>" % \
                (1 if arg_10 else 0))
        arg_12.append(
            "<allow_invalid_numbers>%s</allow_invalid_numbers>" % \
                    (1 if arg_11 else 0)
        )
        if arg_9:
            arg_12.append("<reply_path>%s</reply_path>" % arg_9)

        arg_14 = '<sms>%s</sms>' % "".join(arg_12)
        arg_15 = arg_0.curl(arg_3, arg_14)

        arg_16 = arg_15.get("status", None)
        if arg_16 and int(arg_16) in [0, 1, 2]:
            return arg_15
        else:
            raise AmbientSMSError(int(arg_16))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
tool_re
.
match
(
arg_2
)
if
arg_3
and
validations
.
validate_tool_name
(
arg_3
.
group
(
arg_0
.
TOOL_NAME_GROUP
)
)
:
arg_4
=
arg_3
.
group
(
arg_0
.
TOOL_NAME_GROUP
)
return
creationinfo
.
Tool
(
arg_4
)
else
:
raise
SPDXValueError
(
'Failed to extract tool name'
)

def Func(arg_0, arg_1, arg_2):
        """Builds a tool object out of a string representation.
        Returns built tool. Raises SPDXValueError if failed to extract
        tool name or name is malformed
        """
        arg_3 = arg_0.tool_re.match(arg_2)
        if arg_3 and validations.validate_tool_name(arg_3.group(arg_0.TOOL_NAME_GROUP)):
            arg_4 = arg_3.group(arg_0.TOOL_NAME_GROUP)
            return creationinfo.Tool(arg_4)
        else:
            raise SPDXValueError('Failed to extract tool name')

Builds a tool object out of a string representation . Returns built tool . Raises SPDXValueError if failed to extract tool name or name is malformed


(cls, path, ignore_list=None, white_list=None)

return (cls._matches_patterns(path, ignore_list) and
                not cls._matches_patterns(path, white_list))

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Returns a whether a path should be ignored or not."""
        arg_2 = arg_2 or []
        arg_3 = arg_3 or []
        return (arg_0._matches_patterns(arg_1, arg_2) and
                not arg_0._matches_patterns(arg_1, arg_3))

Returns a whether a path should be ignored or not .


def Func(arg_0, arg_1, *arg_2):
        """
        Run a specific command using the manager
        """
        if arg_0.manager is None:
            raise Exception("Fatal internal error: Missing repository manager")
        if arg_1 not in dir(arg_0.manager):
            raise Exception("Fatal internal error: Invalid command {} being Func".format(arg_1))
        arg_3 = getattr(arg_0.manager, arg_1)
        arg_4 = arg_0
        return arg_3(arg_4, *arg_2)


def Func ( arg_0 ) : try : return pkg_resources . get_distribution ( arg_0 ) . version except pkg_resources . DistributionNotFound : arg_1 = read_configuration ( os . path . join ( PROJECT_DIR , "setup.cfg" ) ) return arg_1 [ "metadata" ] [ "version" ]

def Func(arg_0):
    """
    Get package version from installed distribution or configuration file if not
    installed
    """
    try:
        return pkg_resources.get_distribution(arg_0).version
    except pkg_resources.DistributionNotFound:
        arg_1 = read_configuration(os.path.join(PROJECT_DIR, "setup.cfg"))
    return arg_1["metadata"]["version"]


return rv.decode('utf-8', 'replace') if PY2 else rv

def Func ( arg_0 ) : arg_1 = traceback . format_Func_only ( arg_0 . exc_type , arg_0 . exc_value ) arg_2 = '' . join ( arg_1 ) . strip ( ) return arg_2 . decode ( 'utf-8' , 'replace' ) if PY2 else arg_2

def Func(arg_0):
        """String representation of the Func."""
        arg_1 = traceback.format_Func_only(arg_0.exc_type, arg_0.exc_value)
        arg_2 = ''.join(arg_1).strip()
        return arg_2.decode('utf-8', 'replace') if PY2 else arg_2

String representation of the exception .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
arg_3
=
[
]
for
arg_4
in
arg_1
:
if
arg_4
.
startswith
(
'def '
)
and
arg_4
.
count
(
'('
)
:
arg_5
=
arg_0
.
_get_object_name
(
arg_4
)
if
not
arg_5
.
startswith
(
'_'
)
:
arg_2
.
append
(
arg_5
)
elif
arg_4
.
startswith
(
'class '
)
:
arg_5
=
arg_0
.
_get_object_name
(
arg_4
)
if
not
arg_5
.
startswith
(
'_'
)
:
arg_3
.
append
(
arg_5
)
else
:
pass
arg_2
.
sort
(
)
arg_3
.
sort
(
)
return
arg_2
,
arg_3

def Func(arg_0, arg_1):
        ''' Parse lines of text for functions and classes '''
        arg_2 = []
        arg_3 = []
        for arg_4 in arg_1:
            if arg_4.startswith('def ') and arg_4.count('('):
                # exclude private stuff
                arg_5 = arg_0._get_object_name(arg_4)
                if not arg_5.startswith('_'):
                    arg_2.append(arg_5)
            elif arg_4.startswith('class '):
                # exclude private stuff
                arg_5 = arg_0._get_object_name(arg_4)
                if not arg_5.startswith('_'):
                    arg_3.append(arg_5)
            else:
                pass
        arg_2.sort()
        arg_3.sort()
        return arg_2, arg_3


return _operation(wave, "acosh", "", np.arccosh)

def
Func
(
arg_0
)
:
pexdoc
.
exh
.
addex
(
ValueError
,
"Math domain error"
,
bool
(
min
(
arg_0
.
_dep_vector
)
<
1
)
)
return
_operation
(
arg_0
,
"Func"
,
""
,
np
.
arccosh
)

def Func(arg_0):
    r"""
    Return the hyperbolic arc cosine of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises:
     * RuntimeError (Argument \`wave\` is not valid)

     * ValueError (Math domain error)

    .. [[[end]]]
    """
    pexdoc.exh.addex(ValueError, "Math domain error", bool(min(arg_0._dep_vector) < 1))
    return _operation(arg_0, "Func", "", np.arccosh)

r"""
    Return the hyperbolic arc cosine of a waveform's dependent variable vector.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.acosh

    :raises:
     * RuntimeError (Argument \`wave\` is not valid)

     * ValueError (Math domain error)

    .. [[[end]]]

r Return the hyperbolic arc cosine of a waveform s dependent variable vector .


def Func ( arg_0 ) : if "linux" in sys . platform : arg_1 = ctypes . CDLL ( 'libmkl_rt.so' ) else : arg_1 = ctypes . CDLL ( 'libmkl_rt.dylib' ) arg_2 = arg_1 . mkl_get_max_threads ( ) arg_1 . mkl_set_num_threads ( ctypes . byref ( ctypes . c_int ( arg_0 ) ) ) return arg_2

def Func(arg_0):
    """
    set mkl thread limit and return old value so we can reset
    when finished.
    """
    if "linux" in sys.platform:
        arg_1 = ctypes.CDLL('libmkl_rt.so')
    else:
        arg_1 = ctypes.CDLL('libmkl_rt.dylib')
    arg_2 = arg_1.mkl_get_max_threads()
    arg_1.mkl_set_num_threads(ctypes.byref(ctypes.c_int(arg_0)))
    return arg_2

set mkl thread limit and return old value so we can reset when finished .


def Func ( arg_0 , arg_1 ) : if arg_1 . is_admin : arg_2 = arg_0 . institutes ( ) else : arg_2 = [ arg_0 . institute ( inst_id ) for inst_id in arg_1 . institutes ] return arg_2

def Func(arg_0, arg_1):
    """Preprocess institute objects."""
    if arg_1.is_admin:
        arg_2 = arg_0.institutes()
    else:
        arg_2 = [arg_0.institute(inst_id) for inst_id in arg_1.institutes]

    return arg_2


Configures the server to use a static IP.

def Func(arg_0):
        """
        Configures the server to use a Func IP.
        """
        arg_1 = arg_0.render_to_file('ip/ip_interfaces_Func.template')
        arg_2 = arg_0.local_renderer
        arg_2.put(local_path=arg_1, remote_path=arg_2.env.interfaces_fn, use_sudo=True)

Configures the server to use a static IP .


(self, url, data, response_code=200, follow=False,
            headers={})

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 200 , arg_4 = False , arg_5 = { } ) : if not arg_0 . authed : arg_0 . authorize ( ) arg_6 = arg_0 . client . post ( arg_1 , arg_2 , arg_4 = arg_4 , ** arg_5 ) arg_0 . assertEqual ( arg_3 , arg_6 . status_code ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=200, arg_4=False,
            arg_5={}):
        """Does a django test client ``post`` against the given url after
        logging in the admin first.

        :param url:
            URL to fetch
        :param data:
            Dictionary to form contents to post
        :param response_code:
            Expected response code from the URL fetch.  This value is
            asserted.  Defaults to 200
        :param headers:
            Optional dictionary of headers to send in with the request
        :returns:
            Django testing ``Response`` object
        """
        if not arg_0.authed:
            arg_0.authorize()

        arg_6 = arg_0.client.post(arg_1, arg_2, arg_4=arg_4, **arg_5)
        arg_0.assertEqual(arg_3, arg_6.status_code)
        return arg_6

Does a django test client post against the given url after logging in the admin first .