def Func ( arg_0 , ** arg_1 ) : arg_2 = core . stft ( arg_0 ) arg_3 , arg_4 = decompose . Func ( arg_2 , ** arg_1 ) arg_5 = util . fix_length ( core . istft ( arg_3 , dtype = arg_0 . dtype ) , len ( arg_0 ) ) arg_6 = util . fix_length ( core . istft ( arg_4 , dtype = arg_0 . dtype ) , len ( arg_0 ) ) return arg_5 , arg_6

def Func(arg_0, **arg_1):
    '''Decompose an audio time series into harmonic and percussive components.

    This function automates the STFT->HPSS->ISTFT pipeline, and ensures that
    the output waveforms have equal length to the input waveform `y`.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series
    kwargs : additional keyword arguments.
        See `librosa.decompose.Func` for details.

    Returns
    -------
    y_harmonic : np.ndarray [shape=(n,)]
        audio time series of the harmonic elements

    y_percussive : np.ndarray [shape=(n,)]
        audio time series of the percussive elements

    See Also
    --------
    harmonic : Extract only the harmonic component
    percussive : Extract only the percussive component
    librosa.decompose.Func : HPSS on spectrograms

    Examples
    --------
    >>> # Extract harmonic and percussive components
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> y_harmonic, y_percussive = librosa.effects.Func(y)

    >>> # Get a more isolated percussive component by widening its margin
    >>> y_harmonic, y_percussive = librosa.effects.Func(y, margin=(1.0,5.0))

    '''

    # Compute the STFT matrix
    arg_2 = core.stft(arg_0)

    # Decompose into harmonic and percussives
    arg_3, arg_4 = decompose.Func(arg_2, **arg_1)

    # Invert the STFTs.  Adjust length to match the input.
    arg_5 = util.fix_length(core.istft(arg_3, dtype=arg_0.dtype), len(arg_0))
    arg_6 = util.fix_length(core.istft(arg_4, dtype=arg_0.dtype), len(arg_0))

    return arg_5, arg_6

Decompose an audio time series into harmonic and percussive components.

    This function automates the STFT->HPSS->ISTFT pipeline, and ensures that
    the output waveforms have equal length to the input waveform `y`.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series
    kwargs : additional keyword arguments.
        See `librosa.decompose.hpss` for details.

    Returns
    -------
    y_harmonic : np.ndarray [shape=(n,)]
        audio time series of the harmonic elements

    y_percussive : np.ndarray [shape=(n,)]
        audio time series of the percussive elements

    See Also
    --------
    harmonic : Extract only the harmonic component
    percussive : Extract only the percussive component
    librosa.decompose.hpss : HPSS on spectrograms

    Examples
    --------
    >>> # Extract harmonic and percussive components
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> y_harmonic, y_percussive = librosa.effects.hpss(y)

    >>> # Get a more isolated percussive component by widening its margin
    >>> y_harmonic, y_percussive = librosa.effects.hpss(y, margin=(1.0,5.0))

Decompose an audio time series into harmonic and percussive components .


def Func(arg_0, arg_1=False):
        """
        Get data from the USB device.
        """
        try:
            if arg_1:
                arg_0._device.reset()

            # detach kernel driver from both interfaces if attached, so we can set_configuration()
            for arg_2 in [0,1]:
                if arg_0._device.is_kernel_driver_active(arg_2):
                    LOGGER.debug('Detaching kernel driver for interface %d '
                        'of %r on ports %r', arg_2, arg_0._device, arg_0._ports)
                    arg_0._device.detach_kernel_driver(arg_2)

            arg_0._device.set_configuration()

            # Prevent kernel message:
            # "usbfs: process <PID> (python) did not claim interface x before use"
            # This will become unnecessary once pull-request #124 for
            # PyUSB has been accepted and we depend on a fixed release
            # of PyUSB.  Until then, and even with the fix applied, it
            # does not hurt to explicitly claim the interface.
            usb.util.claim_interface(arg_0._device, INTERFACE)

                # Turns out we don't actually need that ctrl_transfer.
                # Disabling this reduces number of USBErrors from ~7/30 to 0!
                #self._device.ctrl_transfer(bmRequestType=0x21, bRequest=0x09,
                #    wValue=0x0201, wIndex=0x00, data_or_wLength='\x01\x01',
                #    timeout=TIMEOUT)

            # Magic: Our TEMPerV1.4 likes to be asked twice.  When
            # only asked once, it get's stuck on the next access and
            # requires a reset.
            arg_0._control_transfer(COMMANDS['temp'])
            arg_0._interrupt_read()

            # Turns out a whole lot of that magic seems unnecessary.
            #self._control_transfer(COMMANDS['ini1'])
            #self._interrupt_read()
            #self._control_transfer(COMMANDS['ini2'])
            #self._interrupt_read()
            #self._interrupt_read()

            # Get temperature
            arg_0._control_transfer(COMMANDS['temp'])
            arg_3 = arg_0._interrupt_read()

            # Get humidity
            if arg_0._device.product == 'TEMPer1F_H1_V1.4':
                arg_4 = arg_3
            else:
                arg_4 = None

            # Combine temperature and humidity data
            arg_5 = {'temp_data': arg_3, 'humidity_data': arg_4}

            # Be a nice citizen and undo potential interface claiming.
            # Also see: https://github.com/walac/pyusb/blob/master/docs/tutorial.rst#dont-be-selfish
            usb.util.dispose_resources(arg_0._device)
            return arg_5
        except usb.USBError as err:
            if not arg_1:
                LOGGER.warning("Encountered %s, resetting %r and trying again.", err, arg_0._device)
                return arg_0.Func(True)

            # Catch the permissions exception and add our message
            if "not permitted" in str(err):
                raise Exception(
                    "Permission problem accessing USB. "
                    "Maybe I need to run as root?")
            else:
                LOGGER.error(err)
                raise


return Fastq(self.id, self.seq, ''.join([chr(max(0, min(x, 93)) + 33) for x in qual_scores]))

def Func(arg_0, arg_1):
        '''Returns a Fastq object. qual_scores expected to be a list of numbers, like you would get in a .qual file'''
        if len(arg_0) != len(arg_1):
            raise Error('Error making Fastq from Fasta, lengths differ.', arg_0.id)
        return Fastq(arg_0.id, arg_0.seq, ''.join([chr(max(0, min(arg_2, 93)) + 33) for arg_2 in arg_1]))

Returns a Fastq object . qual_scores expected to be a list of numbers like you would get in a . qual file


def
Func
(
arg_0
)
:
arg_0
.
run
(
f'python setup.py Func'
)
arg_1
=
ROOT
.
joinpath
(
'dist'
)
print
(
f'removing {dist}'
)
shutil
.
rmtree
(
str
(
arg_1
)
)

def Func(arg_0):
    """Clean previously built package artifacts.
    """
    arg_0.run(f'python setup.py Func')
    arg_1 = ROOT.joinpath('dist')
    print(f'removing {dist}')
    shutil.rmtree(str(arg_1))

Clean previously built package artifacts .


def Func(arg_0, arg_1, arg_2):
    """Run a simple web Funcr."""
    if os.path.exists(arg_0):
        pass
    elif os.path.exists(arg_2):
        arg_3 = read_settings(arg_2)
        arg_0 = arg_3.get('destination')
        if not os.path.exists(arg_0):
            sys.stderr.write("The '{}' directory doesn't exist, maybe try "
                             "building first?\n".format(arg_0))
            sys.exit(1)
    else:
        sys.stderr.write("The {destination} directory doesn't exist "
                         "and the config file ({config}) could not be read.\n"
                         .format(arg_0=arg_0, arg_2=arg_2))
        sys.exit(2)

    print('DESTINATION : {}'.format(arg_0))
    os.chdir(arg_0)
    arg_4 = Funcr.SimpleHTTPRequestHandler
    arg_5 = socketFuncr.TCPServer(("", arg_1), arg_4, False)
    print(" * Running on http://127.0.0.1:{}/".format(arg_1))

    try:
        arg_5.allow_reuse_address = True
        arg_5.Funcr_bind()
        arg_5.Funcr_activate()
        arg_5.Func_forever()
    except KeyboardInterrupt:
        print('\nAll done!')


return self.create_ml_configuration(search_template, available_columns, dataset_ids)

def Func(arg_0, arg_1):
        """
        Creates an ml configuration from dataset_ids and extract_as_keys

        :param dataset_ids: Array of dataset identifiers to make search template from
        :return: An identifier used to request the status of the builder job (get_ml_configuration_status)
        """
        arg_2 = arg_0.search_template_client.get_available_columns(arg_1)

        # Create a search template from dataset ids
        arg_3 = arg_0.search_template_client.create(arg_1, arg_2)
        return arg_0.create_ml_configuration(arg_3, arg_2, arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
__name__
arg_3
=
inspect
.
getargspec
(
arg_0
)
arg_4
=
arg_3
.
args
[
:
]
arg_5
=
list
(
arg_3
.
defaults
or
[
]
)
if
inspect
.
ismethod
(
arg_0
)
and
arg_4
[
:
1
]
==
[
'self'
]
:
arg_4
[
:
1
]
=
[
]
if
arg_5
:
arg_6
=
arg_4
[
:
len
(
arg_5
)
]
else
:
arg_6
=
arg_4
[
:
]
arg_7
=
{
arg
:
arg
.
endswith
(
'_'
)
and
arg
[
:
1
]
or
arg
for
arg
in
arg_4
}
for
arg_8
in
list
(
arg_1
)
:
arg_9
=
'%s_'
%
arg_8
if
arg_9
in
arg_4
:
arg_1
[
arg_9
]
=
arg_1
.
pop
(
arg_8
)
arg_10
=
sorted
(
arg_1
)
arg_11
=
[
arg_7
.
get
(
arg
,
arg
)
for
arg
in
arg_6
if
arg
not
in
arg_10
]
if
arg_11
:
raise
MeteorError
(
400
,
arg_0
.
err
,
'Missing required arguments to %s: %s'
%
(
arg_2
,
' '
.
join
(
arg_11
)
,
)
,
)
arg_12
=
[
arg
for
arg
in
arg_10
if
arg
not
in
arg_4
]
if
arg_12
:
raise
MeteorError
(
400
,
arg_0
.
err
,
'Unknown arguments to %s: %s'
%
(
arg_2
,
' '
.
join
(
arg_12
)
)
,
)

def Func(arg_0, arg_1):
    """Validate arguments to be supplied to func."""
    arg_2 = arg_0.__name__
    arg_3 = inspect.getargspec(arg_0)
    arg_4 = arg_3.args[:]
    arg_5 = list(arg_3.defaults or [])

    # ignore implicit 'self' argument
    if inspect.ismethod(arg_0) and arg_4[:1] == ['self']:
        arg_4[:1] = []

    # don't require arguments that have defaults
    if arg_5:
        arg_6 = arg_4[:-len(arg_5)]
    else:
        arg_6 = arg_4[:]

    # translate 'foo_' to avoid reserved names like 'id'
    arg_7 = {
        arg: arg.endswith('_') and arg[:-1] or arg
        for arg
        in arg_4
    }
    for arg_8 in list(arg_1):
        arg_9 = '%s_' % arg_8
        if arg_9 in arg_4:
            arg_1[arg_9] = arg_1.pop(arg_8)

    # figure out what we're missing
    arg_10 = sorted(arg_1)
    arg_11 = [
        arg_7.get(arg, arg) for arg in arg_6
        if arg not in arg_10
    ]
    if arg_11:
        raise MeteorError(
            400,
            arg_0.err,
            'Missing required arguments to %s: %s' % (
                arg_2,
                ' '.join(arg_11),
            ),
        )

    # figure out what is extra
    arg_12 = [
        arg for arg in arg_10
        if arg not in arg_4
    ]
    if arg_12:
        raise MeteorError(
            400,
            arg_0.err,
            'Unknown arguments to %s: %s' % (arg_2, ' '.join(arg_12)),
        )

Validate arguments to be supplied to func .


def
Func
(
arg_0
,
arg_1
)
:
log
.
msg
(
"{} bytes of data received locally"
.
format
(
len
(
arg_1
)
)
)
if
arg_0
.
connection
is
:
log
.
msg
(
"Connection not made yet, buffering..."
)
arg_0
.
_buffer
.
write
(
arg_1
)
else
:
log
.
msg
(
"Sending data..."
)
arg_0
.
_sendData
(
arg_1
)

def Func(arg_0, arg_1):
        """Received some data from the local side.

        If we have set up the multiplexed connection, sends the data
        over the multiplexed connection. Otherwise, buffers.

        """
        log.msg("{} bytes of data received locally".format(len(arg_1)))
        if arg_0.connection is None:
            # we haven't finished connecting yet
            log.msg("Connection not made yet, buffering...")
            arg_0._buffer.write(arg_1)
        else:
            log.msg("Sending data...")
            arg_0._sendData(arg_1)

Received some data from the local side .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
parsed
is
:
return
False
arg_2
=
[
'UpdatesComplete'
,
True
,
'COMPLETE'
]
arg_3
=
if
arg_0
.
response_format
==
'xml'
:
arg_3
=
arg_1
.
parsed
.
find
(
'./Status'
)
.
text
elif
arg_0
.
response_format
==
'json'
:
arg_3
=
arg_1
.
parsed
.
get
(
'Status'
,
arg_1
.
parsed
.
get
(
'status'
)
)
if
arg_3
is
:
raise
RuntimeError
(
'Unable to get poll response status.'
)
return
arg_3
in
arg_2

def Func(arg_0, arg_1):
        """
        Checks the condition in poll response to determine if it is complete
        and no subsequent poll requests should be done.
        """
        if arg_1.parsed is None:
            return False
        arg_2 = ['UpdatesComplete', True, 'COMPLETE']
        arg_3 = None
        if arg_0.response_format == 'xml':
            arg_3 = arg_1.parsed.find('./Status').text
        elif arg_0.response_format == 'json':
            arg_3 = arg_1.parsed.get(
                'Status', arg_1.parsed.get('status'))
        if arg_3 is None:
            raise RuntimeError('Unable to get poll response status.')
        return arg_3 in arg_2

Checks the condition in poll response to determine if it is complete and no subsequent poll requests should be done .


return all(
            [
                step_event.event_type == DagsterEventType.STEP_SKIPPED
                for step_event in itertools.chain(
                    self.input_expectations, self.output_expectations, self.transforms
                )
            ]
        )

def Func ( arg_0 ) : return all ( [ arg_1 . event_type == DagsterEventType . STEP_SKIPPED for arg_1 in itertools . chain ( arg_0 . input_expectations , arg_0 . output_expectations , arg_0 . transforms ) ] )

def Func(arg_0):
        '''Whether the solid execution was Func'''
        return all(
            [
                arg_1.event_type == DagsterEventType.STEP_SKIPPED
                for arg_1 in itertools.chain(
                    arg_0.input_expectations, arg_0.output_expectations, arg_0.transforms
                )
            ]
        )


def Func ( arg_0 , arg_1 ) : arg_2 = tf . train . import_meta_graph ( '{}.meta' . format ( arg_1 ) ) arg_2 . restore ( arg_0 , arg_1 ) return arg_2

def Func(arg_0, arg_1):
    """Return a TensorFlow saver from a checkpoint containing the metagraph."""
    arg_2 = tf.train.import_meta_graph('{}.meta'.format(arg_1))
    arg_2.restore(arg_0, arg_1)
    return arg_2

Return a TensorFlow saver from a checkpoint containing the metagraph .


def
Func
(
)
:
from
os
.
path
import
dirname
,
join
,
exists
arg_0
=
join
(
dirname
(
__file__
)
,
'README.md'
)
if
exists
(
arg_0
)
:
arg_1
=
[
]
with
open
(
arg_0
,
'r'
)
as
f
:
arg_2
=
False
for
arg_3
in
f
.
readlines
(
)
:
if
'# Purpose'
in
arg_3
:
arg_2
=
True
elif
arg_3
.
startswith
(
'##'
)
:
break
elif
arg_2
:
arg_1
+=
[
arg_3
]
arg_4
=
''
.
join
(
arg_1
)
.
strip
(
)
arg_4
=
arg_4
.
replace
(
'\n\n'
,
'_NLHACK_'
)
arg_4
=
arg_4
.
replace
(
'\n'
,
' '
)
arg_4
=
arg_4
.
replace
(
'_NLHACK_'
,
'\n\n'
)
return
arg_4
return
''

def Func():
    """
    Parse the description in the README file

    CommandLine:
        python -c "import setup; print(setup.Func())"
    """
    from os.path import dirname, join, exists
    arg_0 = join(dirname(__file__), 'README.md')
    # print('readme_fpath = %r' % (readme_fpath,))
    # This breaks on pip install, so check that it exists.
    if exists(arg_0):
        # try:
        #     # convert markdown to rst for pypi
        #     import pypandoc
        #     return pypandoc.convert(readme_fpath, 'rst')
        # except Exception as ex:
            # strip out markdown to make a clean readme for pypi
            arg_1 = []
            with open(arg_0, 'r') as f:
                arg_2 = False
                for arg_3 in f.readlines():
                    if '# Purpose' in arg_3:
                        arg_2 = True
                    elif arg_3.startswith('##'):
                        break
                    elif arg_2:
                        arg_1 += [arg_3]
            arg_4 = ''.join(arg_1).strip()
            arg_4 = arg_4.replace('\n\n', '_NLHACK_')
            arg_4 = arg_4.replace('\n', ' ')
            arg_4 = arg_4.replace('_NLHACK_', '\n\n')
            return arg_4
    return ''

Parse the description in the README file

    CommandLine:
        python -c "import setup; print(setup.parse_description())"


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : with arg_0 . driver . accept_modal ( "confirm" , arg_1 = arg_1 , arg_2 = arg_2 ) : yield

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Execute the wrapped code, accepting a confirm.

        Args:
            text (str | RegexObject, optional): Text to match against the text in the modal.
            wait (int | float, optional): Maximum time to wait for the modal to appear after
                executing the wrapped code.

        Raises:
            ModalNotFound: If a modal dialog hasn't been found.
        """

        with arg_0.driver.accept_modal("confirm", arg_1=arg_1, arg_2=arg_2):
            yield

Execute the wrapped code accepting a confirm .


def Func ( arg_0 ) : def wrapper ( * arg_1 , ** arg_2 ) : arg_3 = cProfile . Profile ( ) arg_3 . enable ( ) arg_4 = arg_0 ( * arg_1 , ** arg_2 ) arg_3 . disable ( ) return arg_3 , arg_4 return wrapper

def Func(arg_0):
    '''
    Decorator that adds a runtime profile object to the output
    '''
    def wrapper(*arg_1,**arg_2):
        arg_3=cProfile.Profile()
        arg_3.enable()
        arg_4 = arg_0(*arg_1,**arg_2)
        arg_3.disable()
        return arg_3,arg_4
    return wrapper


def Func ( * arg_0 ) : arg_1 = [ multiprocessing . Process ( target = mod . run ) for mod in arg_0 ] for arg_2 in arg_1 : arg_2 . start ( ) for arg_2 in arg_1 : arg_2 . join ( )

def Func(*arg_0):
    '''Start all services.
    '''
    arg_1 = [multiprocessing.Process(target=mod.run) for mod in arg_0]
    for arg_2 in arg_1:
        arg_2.start()
    for arg_2 in arg_1:
        arg_2.join()


def Func(arg_0, arg_1=None, arg_2=True):
        """
        Remove all repository from path along with all repository tracked files.

        :Parameters:
            #. path (None, string): The path the repository to remove.
            #. removeEmptyDirs (boolean): Whether to remove remaining empty
               directories.
        """
        assert isinstance(arg_2, bool), "removeEmptyDirs must be boolean"
        if arg_1 is not None:
            if arg_1 != arg_0.__path:
                arg_3 = Repository()
                arg_3.load_repository(arg_1)
            else:
                arg_3 = arg_0
        else:
            arg_3 = arg_0
        assert arg_3.path is not None, "path is not given and repository is not initialized"
        # remove repo files and directories
        for arg_4 in reversed(arg_3.get_repository_state()):
            arg_5   = list(arg_4)[0]
            arg_6   = os.path.join(arg_3.path, arg_5)
            arg_1, arg_7 = os.path.split(arg_6)
            if arg_4[arg_5]['type'] == 'file':
                if os.path.isfile(arg_6):
                    os.remove(arg_6)
                if os.path.isfile(os.path.join(arg_3.path,arg_1,arg_0.__fileInfo%arg_7)):
                    os.remove(os.path.join(arg_3.path,arg_1,arg_0.__fileInfo%arg_7))
                if os.path.isfile(os.path.join(arg_3.path,arg_1,arg_0.__fileLock%arg_7)):
                    os.remove(os.path.join(arg_3.path,arg_1,arg_0.__fileLock%arg_7))
                if os.path.isfile(os.path.join(arg_3.path,arg_1,arg_0.__fileClass%arg_7)):
                    os.remove(os.path.join(arg_3.path,arg_1,arg_0.__fileClass%arg_7))
            elif arg_4[arg_5]['type'] == 'dir':
                if os.path.isfile(os.path.join(arg_6,arg_0.__dirInfo)):
                    os.remove(os.path.join(arg_6,arg_0.__dirInfo))
                if os.path.isfile(os.path.join(arg_6,arg_0.__dirLock)):
                    os.remove(os.path.join(arg_6,arg_0.__dirLock))
                if not len(os.listdir(arg_6)) and arg_2:
                    shutil.rmtree( arg_6 )
        # remove repo information file
        if os.path.isfile(os.path.join(arg_3.path,arg_0.__repoFile)):
            os.remove(os.path.join(arg_3.path,arg_0.__repoFile))
        if os.path.isfile(os.path.join(arg_3.path,arg_0.__repoLock)):
            os.remove(os.path.join(arg_3.path,arg_0.__repoLock))

Remove all repository from path along with all repository tracked files .


def Func(arg_0, arg_1):
        """Merges a dictionary into the Rule object."""
        arg_2 = arg_1.pop("actions")
        for arg_3 in arg_2:
            arg_0.add_action(arg_3)

        arg_0.__dict__.update(arg_1)

Merges a dictionary into the Rule object .


def Func(arg_0):
        """Maps to fortran CDF_Inquire.

        Assigns parameters returned by CDF_Inquire
        to pysatCDF instance. Not intended
        for regular direct use by user.

        """

        arg_1 = copy.deepcopy(arg_0.fname)
        arg_2 = fortran_cdf.Func(arg_1)

        # break out fortran output into something meaningful
        arg_3 = arg_2[0]
        if arg_3 == 0:
            arg_0._num_dims = arg_2[1]
            arg_0._dim_sizes = arg_2[2]
            arg_0._encoding = arg_2[3]
            arg_0._majority = arg_2[4]
            arg_0._max_rec = arg_2[5]
            arg_0._num_r_vars = arg_2[6]
            arg_0._num_z_vars = arg_2[7]
            arg_0._num_attrs = arg_2[8]
        else:
            raise IOError(fortran_cdf.statusreporter(arg_3))


displays last price, for symbol if provided

def Func ( arg_0 : arg_1 ) : arg_2 = PriceDbApplication ( ) if arg_0 : arg_0 = arg_0 . upper ( ) arg_3 = SecuritySymbol ( "" , "" ) arg_3 . parse ( arg_0 ) arg_4 = arg_2 . get_latest_price ( arg_3 ) assert isinstance ( arg_4 , PriceModel ) print ( f"{latest}" ) else : arg_4 = arg_2 . get_latest_prices ( ) for arg_5 in arg_4 : print ( f"{price}" )

def Func(arg_0: arg_1):
    """ displays Func price, for symbol if provided """
    arg_2 = PriceDbApplication()

    # convert to uppercase
    if arg_0:
        arg_0 = arg_0.upper()
        # extract namespace
        arg_3 = SecuritySymbol("", "")
        arg_3.parse(arg_0)

        arg_4 = arg_2.get_latest_price(arg_3)
        assert isinstance(arg_4, PriceModel)
        print(f"{latest}")
    else:
        # Show the latest prices available for all securities.
        arg_4 = arg_2.get_latest_prices()
        for arg_5 in arg_4:
            print(f"{price}")

displays last price for symbol if provided


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_3 = arg_0 . Func_url ( ** arg_2 ) try : arg_4 = arg_0 . filename except AttributeError : arg_4 = arg_3 . split ( '%3B%20filename%3D' ) [ 1 ] arg_4 = unquote ( arg_4 . split ( '&' ) [ 0 ] ) if arg_1 : arg_1 = os . path . expanduser ( arg_1 ) if os . path . isdir ( arg_1 ) : arg_1 = os . path . join ( arg_1 , arg_4 ) else : arg_1 = os . path . join ( tempfile . gettempdir ( ) , arg_4 ) try : arg_5 = requests . request ( method = 'get' , url = arg_3 ) except Exception as e : _handle_request_error ( e ) if not ( 200 <= arg_5 . status_code < 400 ) : _handle_api_error ( arg_5 ) with open ( arg_1 , 'wb' ) as fileobj : fileobj . write ( arg_5 . _content ) return arg_1

def Func(arg_0, arg_1=None, **arg_2):
        """
        Download the file to the specified directory or file path.
        Downloads to a temporary directory if no path is specified.

        Returns the absolute path to the file.
        """
        arg_3 = arg_0.Func_url(**arg_2)
        try:
            # For vault objects, use the object's filename
            # as the fallback if none is specified.
            arg_4 = arg_0.filename
        except AttributeError:
            # If the object has no filename attribute,
            # extract one from the Func URL.
            arg_4 = arg_3.split('%3B%20filename%3D')[1]
            # Remove additional URL params from the name and "unquote" it.
            arg_4 = unquote(arg_4.split('&')[0])

        if arg_1:
            arg_1 = os.path.expanduser(arg_1)
            # If the path is a dir, use the extracted filename
            if os.path.isdir(arg_1):
                arg_1 = os.path.join(arg_1, arg_4)
        else:
            # Create a temporary directory for the file
            arg_1 = os.path.join(tempfile.gettempdir(), arg_4)

        try:
            arg_5 = requests.request(method='get', url=arg_3)
        except Exception as e:
            _handle_request_error(e)

        if not (200 <= arg_5.status_code < 400):
            _handle_api_error(arg_5)

        with open(arg_1, 'wb') as fileobj:
            fileobj.write(arg_5._content)

        return arg_1

Download the file to the specified directory or file path . Downloads to a temporary directory if no path is specified .


def Func ( arg_0 , arg_1 = False ) : if arg_1 is True : arg_0 = [ 'sudo' ] + arg_0 try : arg_2 = Popen ( arg_0 , stderr = STDOUT , stdout = PIPE ) except FileNotFoundError : arg_0 . pop ( 0 ) arg_2 = Popen ( arg_0 , stderr = STDOUT , stdout = PIPE ) arg_3 = arg_2 . communicate ( ) [ 0 ] , arg_2 . returncode arg_2 = { 'message' : arg_3 [ 0 ] , 'return_code' : arg_3 [ 1 ] } if isinstance ( arg_2 [ 'message' ] , bytes ) : arg_2 [ 'message' ] = arg_2 [ 'message' ] . decode ( 'utf-8' ) return arg_2

def Func(arg_0, arg_1=False):
    '''Func uses subprocess to send a command to the terminal.

    Parameters
    ==========
    cmd: the command to send, should be a list for subprocess
    error_message: the error message to give to user if fails,
    if none specified, will alert that command failed.

    '''
    if arg_1 is True:
        arg_0 = ['sudo'] + arg_0

    try:
        arg_2 = Popen(arg_0, stderr=STDOUT, stdout=PIPE)

    except FileNotFoundError:
        arg_0.pop(0)
        arg_2 = Popen(arg_0, stderr=STDOUT, stdout=PIPE)

    arg_3 = arg_2.communicate()[0],arg_2.returncode
    arg_2 = {'message':arg_3[0],
              'return_code':arg_3[1]}

    if isinstance(arg_2['message'], bytes):
        arg_2['message'] = arg_2['message'].decode('utf-8')

    return arg_2

run_command uses subprocess to send a command to the terminal.

    Parameters
    ==========
    cmd: the command to send, should be a list for subprocess
    error_message: the error message to give to user if fails,
    if none specified, will alert that command failed.

run_command uses subprocess to send a command to the terminal .


def Func ( arg_0 , arg_1 = "" ) : arg_2 = { "prefix" : arg_1 } return arg_0 . request ( arg_2 = arg_2 , method = "get" ) . json ( )

def Func(arg_0, arg_1=""):
        """ This endpoint lists all deployments.

           https://www.nomadproject.io/docs/http/deployments.html

            optional_arguments:
              - prefix, (default "") Specifies a string to filter deployments on based on an index prefix.
                        This is specified as a querystring parameter.

            returns: list of dicts
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"prefix": arg_1}
        return arg_0.request(arg_2=arg_2, method="get").json()


def Func ( arg_0 ) : arg_1 = _request_ctx_stack . top if arg_1 is not None and arg_1 . preserved : arg_1 . pop ( arg_1 . _preserved_exc ) arg_2 = _app_ctx_stack . top if arg_2 is None or arg_2 . app != arg_0 . app : arg_2 = arg_0 . app . app_context ( ) arg_2 . Func ( ) arg_0 . _implicit_app_ctx_stack . append ( arg_2 ) else : arg_0 . _implicit_app_ctx_stack . append ( None ) _request_ctx_stack . Func ( arg_0 ) arg_0 . session = arg_0 . app . open_session ( arg_0 . request ) if arg_0 . session is None : arg_0 . session = arg_0 . app . make_null_session ( )

def Func(arg_0):
        """Binds the request context to the current context."""
        # If an exception occurs in debug mode or if context preservation is
        # activated under exception situations exactly one context stays
        # on the stack.  The rationale is that you want to access that
        # information under debug situations.  However if someone forgets to
        # pop that context again we want to make sure that on the next Func
        # it's invalidated, otherwise we run at risk that something leaks
        # memory.  This is usually only a problem in testsuite since this
        # functionality is not active in production environments.
        arg_1 = _request_ctx_stack.top
        if arg_1 is not None and arg_1.preserved:
            arg_1.pop(arg_1._preserved_exc)

        # Before we Func the request context we have to ensure that there
        # is an application context.
        arg_2 = _app_ctx_stack.top
        if arg_2 is None or arg_2.app != arg_0.app:
            arg_2 = arg_0.app.app_context()
            arg_2.Func()
            arg_0._implicit_app_ctx_stack.append(arg_2)
        else:
            arg_0._implicit_app_ctx_stack.append(None)

        _request_ctx_stack.Func(arg_0)

        # Open the session at the moment that the request context is
        # available. This allows a custom open_session method to use the
        # request context (e.g. code that access database information
        # stored on `g` instead of the appcontext).
        arg_0.session = arg_0.app.open_session(arg_0.request)
        if arg_0.session is None:
            arg_0.session = arg_0.app.make_null_session()

Binds the request context to the current context .


def Func(arg_0):
    """Translate a list of tuples to OrderedDict with key and val as strings.

    Parameters
    ----------
    _list : list of tuples

    Returns
    -------
    collections.OrderedDict

    Example
    -------
    ::

        >>> Func([('cmd', 'val'), ('cmd2', 'val2')])
        OrderedDict([('cmd', 'val'), ('cmd2', 'val2')])

    """
    arg_1 = OrderedDict()
    for arg_2, arg_3 in arg_0:
        arg_2 = str(arg_2)
        arg_3 = str(arg_3)
        arg_1[arg_2] = arg_3
    return arg_1

Translate a list of tuples to OrderedDict with key and val as strings.

    Parameters
    ----------
    _list : list of tuples

    Returns
    -------
    collections.OrderedDict

    Example
    -------
    ::

        >>> tuples_as_dict([('cmd', 'val'), ('cmd2', 'val2')])
        OrderedDict([('cmd', 'val'), ('cmd2', 'val2')])

Translate a list of tuples to OrderedDict with key and val as strings .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
not
arg_1
:
raise
ValueError
(
"bad category"
)
if
not
arg_2
:
arg_3
=
u""
elif
'"'
not
in
arg_2
:
arg_3
=
u' and @type="%s"'
%
(
arg_2
,
)
elif
"'"
not
in
type
:
arg_3
=
u" and @type='%s'"
%
(
arg_2
,
)
else
:
raise
ValueError
(
"Invalid type name"
)
if
'"'
not
in
arg_1
:
arg_4
=
u'd:identity[@category="%s"%s]'
%
(
arg_1
,
arg_3
)
elif
"'"
not
in
arg_1
:
arg_4
=
u"d:identity[@category='%s'%s]"
%
(
arg_1
,
arg_3
)
else
:
raise
ValueError
(
"Invalid category name"
)
arg_5
=
arg_0
.
xpath_ctxt
.
xpathEval
(
to_utf8
(
arg_4
)
)
if
arg_5
:
return
True
else
:
return
False

def Func(arg_0,arg_1,arg_2=None):
        """Check if the item described by `self` belongs to the given category
        and type.

        :Parameters:
            - `item_category`: the category name.
            - `item_type`: the type name. If `None` then only the category is
              checked.
        :Types:
            - `item_category`: `unicode`
            - `item_type`: `unicode`

        :return: `True` if `self` contains at least one <identity/> object with
            given type and category.
        :returntype: `bool`"""
        if not arg_1:
            raise ValueError("bad category")
        if not arg_2:
            arg_3=u""
        elif '"' not in arg_2:
            arg_3=u' and @type="%s"' % (arg_2,)
        elif "'" not in type:
            arg_3=u" and @type='%s'" % (arg_2,)
        else:
            raise ValueError("Invalid type name")
        if '"' not in arg_1:
            arg_4=u'd:identity[@category="%s"%s]' % (arg_1,arg_3)
        elif "'" not in arg_1:
            arg_4=u"d:identity[@category='%s'%s]" % (arg_1,arg_3)
        else:
            raise ValueError("Invalid category name")

        arg_5=arg_0.xpath_ctxt.xpathEval(to_utf8(arg_4))
        if arg_5:
            return True
        else:
            return False

Check if the item described by self belongs to the given category and type .


def Func ( arg_0 ) : arg_1 = arg_0 [ 'id' ] arg_2 = arg_0 [ 'version' ] [ 'number' ] return str ( arg_1 ) + '#v' + str ( arg_2 )

def Func(arg_0):
        """Extracts the identifier from a Confluence item.

        This identifier will be the mix of two fields because a
        historical content does not have any unique identifier.
        In this case, 'id' and 'version' values are combined because
        it should not be possible to have two equal version numbers
        for the same content. The value to return will follow the
        pattern: <content>#v<version> (i.e 28979#v10).
        """
        arg_1 = arg_0['id']
        arg_2 = arg_0['version']['number']

        return str(arg_1) + '#v' + str(arg_2)

Extracts the identifier from a Confluence item .


(val_0,
                     val_c,
                     f_lim,
                     sufficient_decrease_param,
                     curvature_param)

def Func(arg_0,
                     arg_1,
                     arg_2,
                     arg_3,
                     arg_4):
  """Checks whether the Wolfe or approx Wolfe conditions are satisfied.

  The Wolfe conditions are a set of stopping criteria for an inexact line search
  algorithm. Let f(a) be the function value along the search direction and
  df(a) the derivative along the search direction evaluated a distance 'a'.
  Here 'a' is the distance along the search direction. The Wolfe conditions are:

    ```None
      f(a) <= f(0) + delta * a * df(0)   (Armijo/Sufficient decrease condition)
      df(a) >= sigma * df(0)             (Weak curvature condition)
    ```
  `delta` and `sigma` are two user supplied parameters satisfying:
   `0 < delta < sigma <= 1.`. In the following, delta is called
   `sufficient_decrease_param` and sigma is called `curvature_param`.

  On a finite precision machine, the Wolfe conditions are difficult to satisfy
  when one is close to the minimum. Hence, Hager-Zhang propose replacing
  the sufficient decrease condition with the following condition on the
  derivative in the vicinity of a minimum.

    ```None
      df(a) <= (2 * delta - 1) * df(0)  (Approx Wolfe sufficient decrease)
    ```
  This condition is only used if one is near the minimum. This is tested using

    ```None
      f(a) <= f(0) + epsilon * |f(0)|
    ```
  The following function checks both the Wolfe and approx Wolfe conditions.
  Here, `epsilon` is a small positive constant. In the following, the argument
  `f_lim` corresponds to the product: epsilon * |f(0)|.

  Args:
    val_0: A namedtuple, as returned by value_and_gradients_function
      evaluated at 0.
    val_c: A namedtuple, as returned by value_and_gradients_function
      evaluated at the point to be tested.
    f_lim: Scalar `Tensor` of real dtype. The function value threshold for
      the approximate Wolfe conditions to be checked.
    sufficient_decrease_param: Positive scalar `Tensor` of real dtype.
      Bounded above by the curvature param. Corresponds to 'delta' in the
      terminology of [Hager and Zhang (2006)][2].
    curvature_param: Positive scalar `Tensor` of real dtype. Bounded above
      by `1.`. Corresponds to 'sigma' in the terminology of
      [Hager Zhang (2005)][1].

  Returns:
    is_satisfied: A scalar boolean `Tensor` which is True if either the
      Wolfe or approximate Wolfe conditions are satisfied.
  """
  arg_5 = (arg_3 * arg_0.df >=
                          (arg_1.f - arg_0.f) / arg_1.x)
  arg_6 = arg_1.df >= arg_4 * arg_0.df
  arg_7 = arg_5 & arg_6
  arg_8 = arg_1.f <= arg_2
  arg_9 = ((2 * arg_3 - 1) * arg_0.df
                           >= arg_1.df)
  arg_10 = arg_8 & arg_9 & arg_6
  arg_11 = arg_7 | arg_10
  return arg_11

Checks whether the Wolfe or approx Wolfe conditions are satisfied .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in range ( arg_1 , arg_2 ) : if arg_4 != 0 : arg_3 . append ( str ( arg_4 ) ) if arg_4 < arg_2 : arg_3 . append ( arg_0 . separator ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Creates list of values in a range with output delimiters.

        Arguments:
            start -     range start
            end -       range end
        """
        arg_3 = []
        for arg_4 in range(arg_1, arg_2):
            if arg_4 != 0:
                arg_3.append(str(arg_4))
            if arg_4 < arg_2:
                arg_3.append(arg_0.separator)
        return arg_3

Creates list of values in a range with output delimiters .


def
Func
(
arg_0
)
:
if
arg_0
.
value
:
if
not
isinstance
(
arg_0
.
value
,
bool
)
:
raise
TypeError
(
"expected: {0}, observed: {1}"
.
format
(
bool
,
type
(
arg_0
.
value
)
)
)

def Func(arg_0):
        """
        Verify that the value of the Boolean object is valid.

        Raises:
            TypeError: if the value is not of type bool.
        """
        if arg_0.value:
            if not isinstance(arg_0.value, bool):
                raise TypeError("expected: {0}, observed: {1}".format(
                    bool, type(arg_0.value)))

Verify that the value of the Boolean object is valid .


return [self._sanitize(branch)
                for branch in self._git.branch(color="never").splitlines()]

def Func ( arg_0 ) : return [ arg_0 . _sanitize ( arg_1 ) for arg_1 in arg_0 . _git . branch ( color = "never" ) . splitlines ( ) ]

def Func(arg_0):
        """Returns a list of the branches"""
        return [arg_0._sanitize(arg_1)
                for arg_1 in arg_0._git.branch(color="never").splitlines()]


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = from_api_dirname ( arg_2 ) if arg_3 == '/' : arg_4 = null ( ) arg_5 = null ( ) else : arg_4 = arg_3 [ : arg_3 . rindex ( '/' , 0 , - 1 ) + 1 ] arg_5 = arg_1 arg_0 . execute ( directories . insert ( ) . values ( arg_3 = arg_3 , arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , ) )

def Func(arg_0, arg_1, arg_2):
    """
    Create a directory.
    """
    arg_3 = from_api_dirname(arg_2)
    if arg_3 == '/':
        arg_4 = null()
        arg_5 = null()
    else:
        # Convert '/foo/bar/buzz/' -> '/foo/bar/'
        arg_4 = arg_3[:arg_3.rindex('/', 0, -1) + 1]
        arg_5 = arg_1

    arg_0.execute(
        directories.insert().values(
            arg_3=arg_3,
            arg_1=arg_1,
            arg_4=arg_4,
            arg_5=arg_5,
        )
    )


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Report a Func."""
        arg_0._log('Func', arg_1, arg_2, arg_3)


def Func ( arg_0 , arg_1 = None ) : arg_2 = util . get_object ( obj = arg_0 , predefined_objects = tensorforce . core . optimizers . optimizers , arg_1 = arg_1 ) assert isinstance ( arg_2 , Optimizer ) return arg_2

def Func(arg_0, arg_1=None):
        """
        Creates an optimizer from a specification dict.
        """
        arg_2 = util.get_object(
            obj=arg_0,
            predefined_objects=tensorforce.core.optimizers.optimizers,
            arg_1=arg_1
        )
        assert isinstance(arg_2, Optimizer)
        return arg_2

Creates an optimizer from a specification dict .


(item_list, weight_list=None, ordered=False, labels=None)

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = None ) : if arg_3 is None : arg_4 = defaultdict ( lambda : 0 ) else : arg_4 = { k : 0 for k in arg_3 } if arg_1 is None : arg_1 = it . repeat ( 1 ) for arg_5 , arg_6 in zip ( arg_0 , arg_1 ) : arg_4 [ arg_5 ] += arg_6 if arg_2 : arg_7 = op . itemgetter ( 1 ) arg_8 = OrderedDict ( [ ( key , value ) for ( key , value ) in sorted ( arg_4 . items ( ) , key = arg_7 ) ] ) else : arg_8 = dict ( arg_4 ) return arg_8

def Func(arg_0, arg_1=None, arg_2=False, arg_3=None):
    """
    Builds a histogram of items, counting the number of time each item appears
    in the input.

    Args:
        item_list (Iterable): hashable items (usually containing duplicates)
        weight_list (Iterable): corresponding weights for each item
        ordered (bool): if True the result is ordered by frequency
        labels (Iterable, optional): expected labels (default None)
            Allows this function to pre-initialize the histogram.
            If specified the frequency of each label is initialized to
            zero and item_list can only contain items specified in labels.

    Returns:
        dict : dictionary where the keys are items in item_list, and the values
          are the number of times the item appears in item_list.

    CommandLine:
        python -m ubelt.util_dict Func

    Example:
        >>> import ubelt as ub
        >>> item_list = [1, 2, 39, 900, 1232, 900, 1232, 2, 2, 2, 900]
        >>> hist = ub.Func(item_list)
        >>> print(ub.repr2(hist, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 3, 1232: 2}

    Example:
        >>> import ubelt as ub
        >>> item_list = [1, 2, 39, 900, 1232, 900, 1232, 2, 2, 2, 900]
        >>> hist1 = ub.Func(item_list)
        >>> hist2 = ub.Func(item_list, ordered=True)
        >>> try:
        >>>     hist3 = ub.Func(item_list, labels=[])
        >>> except KeyError:
        >>>     pass
        >>> else:
        >>>     raise AssertionError('expected key error')
        >>> #result = ub.repr2(hist_)
        >>> weight_list = [1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]
        >>> hist4 = ub.Func(item_list, weight_list=weight_list)
        >>> print(ub.repr2(hist1, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 3, 1232: 2}
        >>> print(ub.repr2(hist4, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 1, 1232: 0}
    """
    if arg_3 is None:
        arg_4 = defaultdict(lambda: 0)
    else:
        arg_4 = {k: 0 for k in arg_3}
    if arg_1 is None:
        arg_1 = it.repeat(1)
    # Accumulate frequency
    for arg_5, arg_6 in zip(arg_0, arg_1):
        arg_4[arg_5] += arg_6
    if arg_2:
        # Order by value
        arg_7 = op.itemgetter(1)
        arg_8 = OrderedDict([
            (key, value)
            for (key, value) in sorted(arg_4.items(), key=arg_7)
        ])
    else:
        # Cast to a normal dictionary
        arg_8 = dict(arg_4)
    return arg_8

Builds a histogram of items, counting the number of time each item appears
    in the input.

    Args:
        item_list (Iterable): hashable items (usually containing duplicates)
        weight_list (Iterable): corresponding weights for each item
        ordered (bool): if True the result is ordered by frequency
        labels (Iterable, optional): expected labels (default None)
            Allows this function to pre-initialize the histogram.
            If specified the frequency of each label is initialized to
            zero and item_list can only contain items specified in labels.

    Returns:
        dict : dictionary where the keys are items in item_list, and the values
          are the number of times the item appears in item_list.

    CommandLine:
        python -m ubelt.util_dict dict_hist

    Example:
        >>> import ubelt as ub
        >>> item_list = [1, 2, 39, 900, 1232, 900, 1232, 2, 2, 2, 900]
        >>> hist = ub.dict_hist(item_list)
        >>> print(ub.repr2(hist, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 3, 1232: 2}

    Example:
        >>> import ubelt as ub
        >>> item_list = [1, 2, 39, 900, 1232, 900, 1232, 2, 2, 2, 900]
        >>> hist1 = ub.dict_hist(item_list)
        >>> hist2 = ub.dict_hist(item_list, ordered=True)
        >>> try:
        >>>     hist3 = ub.dict_hist(item_list, labels=[])
        >>> except KeyError:
        >>>     pass
        >>> else:
        >>>     raise AssertionError('expected key error')
        >>> #result = ub.repr2(hist_)
        >>> weight_list = [1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]
        >>> hist4 = ub.dict_hist(item_list, weight_list=weight_list)
        >>> print(ub.repr2(hist1, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 3, 1232: 2}
        >>> print(ub.repr2(hist4, nl=0))
        {1: 1, 2: 4, 39: 1, 900: 1, 1232: 0}

Builds a histogram of items counting the number of time each item appears in the input .


(self, distance, type="sum", decay="linear", imp_name=None,
                  name="tmp")

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"sum"
,
arg_3
=
"linear"
,
arg_4
=
,
arg_5
=
"tmp"
)
:
arg_6
=
arg_0
.
_imp_name_to_num
(
arg_4
)
arg_2
=
arg_2
.
lower
(
)
if
arg_2
==
"ave"
:
arg_2
=
"mean"
assert
arg_5
in
arg_0
.
variable_names
,
"A variable with that name "
"has not yet been initialized"
arg_7
=
arg_0
.
net
.
get_all_Func_accessibility_variables
(
arg_1
,
arg_5
.
encode
(
'utf-8'
)
,
arg_2
.
encode
(
'utf-8'
)
,
arg_3
.
encode
(
'utf-8'
)
,
arg_6
)
return
pd
.
Series
(
arg_7
,
index
=
arg_0
.
node_ids
)

def Func(arg_0, arg_1, arg_2="sum", arg_3="linear", arg_4=None,
                  arg_5="tmp"):
        """
        Aggregate information for every source node in the network - this is
        really the main purpose of this library.  This allows you to touch
        the data specified by calling set and perform some aggregation on it
        within the specified distance.  For instance, summing the population
        within 1000 meters.

        Parameters
        ----------
        distance : float
            The maximum distance to Func data within. 'distance' can
            represent any impedance unit that you have set as your edge
            weight. This will usually be a distance unit in meters however
            if you have customized the impedance this could be in other
            units such as utility or time etc.
        type : string
            The type of aggregation, can be one of "ave", "sum", "std",
            "count", and now "min", "25pct", "median", "75pct", and "max" will
            compute the associated quantiles.  (Quantiles are computed by
            sorting so might be slower than the others.)
        decay : string
            The type of decay to apply, which makes things that are further
            away count less in the aggregation - must be one of "linear",
            "exponential" or "flat" (which means no decay).  Linear is the
            fastest computation to perform.  When performing an "ave",
            the decay is typically "flat"
        imp_name : string, optional
            The impedance name to use for the aggregation on this network.
            Must be one of the impedance names passed in the constructor of
            this object.  If not specified, there must be only one impedance
            passed in the constructor, which will be used.
        name : string, optional
            The variable to Func.  This variable will have been created
            and named by a call to set.  If not specified, the default
            variable name will be used so that the most recent call to set
            without giving a name will be the variable used.

        Returns
        -------
        agg : Pandas Series
            Returns a Pandas Series for every origin node in the network,
            with the index which is the same as the node_ids passed to the
            init method and the values are the aggregations for each source
            node in the network.
        """

        arg_6 = arg_0._imp_name_to_num(arg_4)
        arg_2 = arg_2.lower()
        if arg_2 == "ave":
            arg_2 = "mean"  # changed generic ave to mean

        assert arg_5 in arg_0.variable_names, "A variable with that name " \
                                            "has not yet been initialized"

        arg_7 = arg_0.net.get_all_Func_accessibility_variables(arg_1,
                                                                 arg_5.encode('utf-8'),
                                                                 arg_2.encode('utf-8'),
                                                                 arg_3.encode('utf-8'),
                                                                 arg_6)

        return pd.Series(arg_7, index=arg_0.node_ids)

Aggregate information for every source node in the network - this is
        really the main purpose of this library.  This allows you to touch
        the data specified by calling set and perform some aggregation on it
        within the specified distance.  For instance, summing the population
        within 1000 meters.

        Parameters
        ----------
        distance : float
            The maximum distance to aggregate data within. 'distance' can
            represent any impedance unit that you have set as your edge
            weight. This will usually be a distance unit in meters however
            if you have customized the impedance this could be in other
            units such as utility or time etc.
        type : string
            The type of aggregation, can be one of "ave", "sum", "std",
            "count", and now "min", "25pct", "median", "75pct", and "max" will
            compute the associated quantiles.  (Quantiles are computed by
            sorting so might be slower than the others.)
        decay : string
            The type of decay to apply, which makes things that are further
            away count less in the aggregation - must be one of "linear",
            "exponential" or "flat" (which means no decay).  Linear is the
            fastest computation to perform.  When performing an "ave",
            the decay is typically "flat"
        imp_name : string, optional
            The impedance name to use for the aggregation on this network.
            Must be one of the impedance names passed in the constructor of
            this object.  If not specified, there must be only one impedance
            passed in the constructor, which will be used.
        name : string, optional
            The variable to aggregate.  This variable will have been created
            and named by a call to set.  If not specified, the default
            variable name will be used so that the most recent call to set
            without giving a name will be the variable used.

        Returns
        -------
        agg : Pandas Series
            Returns a Pandas Series for every origin node in the network,
            with the index which is the same as the node_ids passed to the
            init method and the values are the aggregations for each source
            node in the network.

Aggregate information for every source node in the network - this is really the main purpose of this library . This allows you to touch the data specified by calling set and perform some aggregation on it within the specified distance . For instance summing the population within 1000 meters .


def Func ( arg_0 , arg_1 ) : arg_0 = _make_list_or_1d_tensor ( arg_0 ) arg_1 = tf . convert_to_tensor ( value = arg_1 , name = 'ndims' , dtype = tf . int32 ) arg_2 = tf . get_static_value ( arg_1 ) if _is_list_like ( arg_0 ) and arg_2 is not None : arg_3 = [ ] for arg_4 in arg_0 : if arg_4 < 0 : arg_4 = arg_2 + arg_4 arg_3 . append ( arg_4 ) else : arg_0 = tf . convert_to_tensor ( value = arg_0 , name = 'axis' , dtype = tf . int32 ) arg_3 = tf . where ( arg_0 >= 0 , arg_0 , arg_0 + arg_1 ) return arg_3

def Func(arg_0, arg_1):
  """Rectify possibly negatively axis. Prefer return Python list."""
  arg_0 = _make_list_or_1d_tensor(arg_0)

  arg_1 = tf.convert_to_tensor(value=arg_1, name='ndims', dtype=tf.int32)
  arg_2 = tf.get_static_value(arg_1)

  if _is_list_like(arg_0) and arg_2 is not None:
    # Static case
    arg_3 = []
    for arg_4 in arg_0:
      if arg_4 < 0:
        arg_4 = arg_2 + arg_4
      arg_3.append(arg_4)
  else:
    # Dynamic case
    arg_0 = tf.convert_to_tensor(value=arg_0, name='axis', dtype=tf.int32)
    arg_3 = tf.where(arg_0 >= 0, arg_0, arg_0 + arg_1)

  return arg_3

Rectify possibly negatively axis . Prefer return Python list .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _char_on_changed . get ( arg_1 , None ) if arg_2 is not None : arg_2 ( arg_1 . value ( ) . bytes ( ) . tobytes ( ) ) arg_3 = characteristic_list ( ) . get ( arg_1 ) if arg_3 is not None : arg_3 . _value_read . set ( )

def Func(arg_0, arg_1):
        """Called when the specified characteristic has changed its value."""
        # Called when a characteristic is changed.  Get the on_changed handler
        # for this characteristic (if it exists) and call it.
        arg_2 = arg_0._char_on_changed.get(arg_1, None)
        if arg_2 is not None:
            arg_2(arg_1.value().bytes().tobytes())
        # Also tell the characteristic that it has a new value.
        # First get the service that is associated with this characteristic.
        arg_3 = characteristic_list().get(arg_1)
        if arg_3 is not None:
            arg_3._value_read.set()

Called when the specified characteristic has changed its value .


def Func(arg_0):
	"""
	Takes a string in BibTex format and returns a list of BibTex entries, where
	each entry is a dictionary containing the entries' key-value pairs.

	@type  string: string
	@param string: bibliography in BibTex format

	@rtype: list
	@return: a list of dictionaries representing a bibliography
	"""

	# bibliography
	arg_1 = []

	# make sure we are dealing with unicode strings
	if not isinstance(arg_0, six.text_type):
		arg_0 = arg_0.decode('utf-8')

	# replace special characters
	for arg_2, arg_3 in special_chars:
		arg_0 = arg_0.replace(arg_2, arg_3)
	arg_0 = re.sub(r'\\[cuHvs]{?([a-zA-Z])}?', r'\1', arg_0)

	# split into BibTex entries
	arg_4 = re.findall(
		r'(?u)@(\w+)[ \t]?{[ \t]*([^,\s]*)[ \t]*,?\s*((?:[^=,\s]+\s*\=\s*(?:"[^"]*"|{(?:[^{}]*|{[^{}]*})*}|[^,}]*),?\s*?)+)\s*}',
		arg_0)

	for arg_5 in arg_4:
		# Func entry
		arg_6 = re.findall(r'(?u)([^=,\s]+)\s*\=\s*("[^"]*"|{(?:[^{}]*|{[^{}]*})*}|[^,]*)', arg_5[2])

		# add to bibliography
		arg_1.append({'type': arg_5[0].lower(), 'key': arg_5[1]})

		for arg_2, arg_3 in arg_6:
			# post-process key and value
			arg_2 = arg_2.lower()
			if arg_3 and arg_3[0] == '"' and arg_3[-1] == '"':
				arg_3 = arg_3[1:-1]
			if arg_3 and arg_3[0] == '{' and arg_3[-1] == '}':
				arg_3 = arg_3[1:-1]
			if arg_2 not in ['booktitle', 'title']:
				arg_3 = arg_3.replace('}', '').replace('{', '')
			else:
				if arg_3.startswith('{') and arg_3.endswith('}'):
					arg_3 = arg_3[1:]
					arg_3 = arg_3[:-1]
			arg_3 = arg_3.strip()
			arg_3 = re.sub(r'\s+', ' ', arg_3)

			# store pair in bibliography
			arg_1[-1][arg_2] = arg_3

	return arg_1

Takes a string in BibTex format and returns a list of BibTex entries where each entry is a dictionary containing the entries key - value pairs .


def Func(arg_0, arg_1):
        """Read a signed byte from the specified register."""
        arg_2 = arg_0.readU8(arg_1)
        if arg_2 > 127:
            arg_2 -= 256
        return arg_2

Read a signed byte from the specified register .


def Func ( arg_0 , arg_1 = '__version__' ) : arg_2 = os . path . realpath ( arg_0 ) arg_3 = { } with io . open ( arg_2 , encoding = "utf8" ) as f : exec ( f . read ( ) , { } , arg_3 ) return arg_3 [ arg_1 ]

def Func(arg_0, arg_1='__version__'):
    """Get the version of the package from the given file by
    executing it and extracting the given `name`.
    """
    arg_2 = os.path.realpath(arg_0)
    arg_3 = {}
    with io.open(arg_2, encoding="utf8") as f:
        exec(f.read(), {}, arg_3)
    return arg_3[arg_1]

Get the version of the package from the given file by executing it and extracting the given name .


(job,
                                     mode,
                                     vcf,
                                     recal_table, tranches,
                                     ref_fasta, ref_fai, ref_dict,
                                     ts_filter_level=99.0,
                                     unsafe_mode=False)

def Func(arg_0,
                                     arg_1,
                                     arg_2,
                                     arg_3, arg_4,
                                     arg_5, arg_6, arg_7,
                                     arg_8=99.0,
                                     arg_9=False):
    """
    Applies variant quality score recalibration to VCF file using GATK ApplyRecalibration

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str mode: Determines variant recalibration mode (SNP or INDEL)
    :param str vcf: FileStoreID for input VCF file
    :param str recal_table: FileStoreID for recalibration table file
    :param str tranches: FileStoreID for tranches file
    :param str ref_fasta: FileStoreID for reference genome fasta
    :param str ref_fai: FileStoreID for reference genome index file
    :param str ref_dict: FileStoreID for reference genome sequence dictionary file
    :param float ts_filter_level: Sensitivity expressed as a percentage, default is 99.0
    :param bool unsafe_mode: If True, runs gatk UNSAFE mode: "-U ALLOW_SEQ_DICT_INCOMPATIBILITY"
    :return: FileStoreID for recalibrated VCF file
    :rtype: str
    """
    arg_10 = {'genome.fa': arg_5,
              'genome.fa.fai': arg_6,
              'genome.dict': arg_7,
              'input.vcf': arg_2,
              'recal': arg_3,
              'tranches': arg_4}

    arg_11 = arg_0.fileStore.getLocalTempDir()
    for arg_12, arg_13 in arg_10.iteritems():
        arg_0.fileStore.readGlobalFile(arg_13, os.path.join(arg_11, arg_12))

    arg_1 = arg_1.upper()

    # GATK recommended parameters:
    # https://software.broadinstitute.org/gatk/documentation/article?id=2805
    arg_14 = ['-T', 'ApplyRecalibration',
               '-mode', arg_1,
               '-R', 'genome.fa',
               '-input', 'input.vcf',
               '-o', 'vqsr.vcf',
               '-ts_filter_level', str(arg_8),
               '-recalFile', 'recal',
               '-tranchesFile', 'tranches']

    if arg_9:
        arg_14.extend(['-U', 'ALLOW_SEQ_DICT_INCOMPATIBILITY'])

    arg_0.fileStore.logToMaster('Running GATK ApplyRecalibration on {mode}s '
                              'with a sensitivity of {sensitivity}%'.format(arg_1=arg_1,
                                                                            sensitivity=arg_8))
    arg_15 = ['--rm', 'log-driver', 'none',
                         '-e', 'JAVA_OPTS=-Djava.io.tmpdir=/data/ -Xmx{}'.format(arg_0.memory)]
    dockerCall(arg_0=arg_0, workDir=arg_11,
               parameters=arg_14,
               tool='quay.io/ucsc_cgl/gatk:3.5--dba6dae49156168a909c43330350c6161dc7ecc2',
               dockerParameters=arg_15)

    return arg_0.fileStore.writeGlobalFile(os.path.join(arg_11, 'vqsr.vcf'))


return await self._mgmt_request_response(
            REQUEST_RESPONSE_CANCEL_SCHEDULED_MESSAGE_OPERATION,
            request_body,
            mgmt_handlers.default)

async def Func(arg_0, *arg_1):
        """Cancel one or more messages that have previsouly been scheduled and are still pending.

        :param sequence_numbers: The seqeuence numbers of the scheduled messages.
        :type sequence_numbers: int

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START cancel_schedule_messages]
                :end-before: [END cancel_schedule_messages]
                :language: python
                :dedent: 4
                :caption: Schedule messages.

        """
        if not arg_0.running:
            await arg_0.open()
        arg_2 = [types.AMQPLong(s) for s in arg_1]
        arg_3 = {'sequence-numbers': types.AMQPArray(arg_2)}
        return await arg_0._mgmt_request_response(
            REQUEST_RESPONSE_CANCEL_SCHEDULED_MESSAGE_OPERATION,
            arg_3,
            mgmt_handlers.default)

Cancel one or more messages that have previsouly been scheduled and are still pending .


def Func(arg_0, arg_1, arg_2, arg_3):
    r'''Calculates saturation liquid volume, using Yamada and Gunn CSP method
    and a chemical's critical properties and acentric factor.

    The molar volume of a liquid is given by:

    .. math::
        V_s = \frac{RT_c}{P_c}{(0.29056-0.08775\omega)}^{[1+(1-{T/T_c})^{2/7}]}

    Units are in m^3/mol.

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    omega : float
        Acentric factor for fluid, [-]

    Returns
    -------
    Vs : float
        saturation liquid volume, [m^3/mol]

    Notes
    -----
    This equation is an improvement on the Rackett equation.
    This is often presented as the Rackett equation.
    The acentric factor is used here, instead of the critical compressibility
    A variant using a reference fluid also exists

    Examples
    --------
    >>> Func(300, 647.14, 22048320.0, 0.245)
    2.1882836429895796e-05

    References
    ----------
    .. [1] Gunn, R. D., and Tomoyoshi Yamada. "A Corresponding States
        Correlation of Saturated Liquid Volumes." AIChE Journal 17, no. 6
        (1971): 1341-45. doi:10.1002/aic.690170613
    .. [2] Yamada, Tomoyoshi, and Robert D. Gunn. "Saturated Liquid Molar
        Volumes. Rackett Equation." Journal of Chemical & Engineering Data 18,
        no. 2 (1973): 234-36. doi:10.1021/je60057a006
    '''
    return R*arg_1/arg_2*(0.29056 - 0.08775*arg_3)**(1 + (1 - arg_0/arg_1)**(2/7.))

r'''Calculates saturation liquid volume, using Yamada and Gunn CSP method
    and a chemical's critical properties and acentric factor.

    The molar volume of a liquid is given by:

    .. math::
        V_s = \frac{RT_c}{P_c}{(0.29056-0.08775\omega)}^{[1+(1-{T/T_c})^{2/7}]}

    Units are in m^3/mol.

    Parameters
    ----------
    T : float
        Temperature of fluid [K]
    Tc : float
        Critical temperature of fluid [K]
    Pc : float
        Critical pressure of fluid [Pa]
    omega : float
        Acentric factor for fluid, [-]

    Returns
    -------
    Vs : float
        saturation liquid volume, [m^3/mol]

    Notes
    -----
    This equation is an improvement on the Rackett equation.
    This is often presented as the Rackett equation.
    The acentric factor is used here, instead of the critical compressibility
    A variant using a reference fluid also exists

    Examples
    --------
    >>> Yamada_Gunn(300, 647.14, 22048320.0, 0.245)
    2.1882836429895796e-05

    References
    ----------
    .. [1] Gunn, R. D., and Tomoyoshi Yamada. "A Corresponding States
        Correlation of Saturated Liquid Volumes." AIChE Journal 17, no. 6
        (1971): 1341-45. doi:10.1002/aic.690170613
    .. [2] Yamada, Tomoyoshi, and Robert D. Gunn. "Saturated Liquid Molar
        Volumes. Rackett Equation." Journal of Chemical & Engineering Data 18,
        no. 2 (1973): 234-36. doi:10.1021/je60057a006

r Calculates saturation liquid volume using Yamada and Gunn CSP method and a chemical s critical properties and acentric factor .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
quilt_pc
+
arg_2
.
get_name
(
)
arg_4
=
arg_3
+
File
(
arg_1
)
if
not
arg_4
.
exists
(
)
:
raise
QuiltError
(
"File %s is not in patch %s"
%
(
arg_1
,
arg_2
.
get_name
(
)
)
)

def Func(arg_0, arg_1, arg_2):
        """ Checks if a backup file of the filename in the current patch
        exists and raises a QuiltError if not.
        """
        arg_3 = arg_0.quilt_pc + arg_2.get_name()
        arg_4 = arg_3 + File(arg_1)
        if not arg_4.exists():
            raise QuiltError("File %s is not in patch %s" % (arg_1,
                             arg_2.get_name()))

Checks if a backup file of the filename in the current patch exists and raises a QuiltError if not .


def Func ( arg_0 = 0 ) : arg_1 = get_frame_locals ( arg_0 + 1 ) for arg_2 in arg_1 : if not arg_2 . startswith ( '_' ) and arg_2 . upper ( ) == arg_2 : yield arg_2 , arg_1

def Func(arg_0=0):
    """Generator to walk through variables considered as preferences
    in locals dict of a given frame.

    :param int stepback:

    :rtype: tuple

    """
    arg_1 = get_frame_locals(arg_0+1)
    for arg_2 in arg_1:
        if not arg_2.startswith('_') and arg_2.upper() == arg_2:
            yield arg_2, arg_1

Generator to walk through variables considered as preferences in locals dict of a given frame .


def Func ( arg_0 ) : if arg_0 . app is not None : if not arg_0 . blueprint : arg_0 . blueprint = arg_0 . create_blueprint ( ) arg_0 . app . Func_blueprint ( arg_0 . blueprint ) if arg_0 . cache is None : setattr ( arg_0 . app . jinja_env , "_fake_cache_extension" , arg_0 ) arg_0 . app . jinja_env . add_extension ( FakeCacheExtension ) return arg_0 . blueprint return None

def Func(arg_0):
        """ Register the app using Blueprint

        :return: Nemo blueprint
        :rtype: flask.Blueprint
        """
        if arg_0.app is not None:
            if not arg_0.blueprint:
                arg_0.blueprint = arg_0.create_blueprint()
            arg_0.app.Func_blueprint(arg_0.blueprint)
            if arg_0.cache is None:
                # We Func a fake cache extension.
                setattr(arg_0.app.jinja_env, "_fake_cache_extension", arg_0)
                arg_0.app.jinja_env.add_extension(FakeCacheExtension)
            return arg_0.blueprint
        return None


(cls, extension_name=None, extension_tag=None,
               extension_type=None)

return ExtensionInformation(
            extension_name=extension_name,
            extension_tag=extension_tag,
            extension_type=extension_type)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_1 = ExtensionName ( arg_1 ) arg_2 = ExtensionTag ( arg_2 ) arg_3 = ExtensionType ( arg_3 ) return ExtensionInformation ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1=None, arg_2=None,
               arg_3=None):
        """
        Construct an ExtensionInformation object from provided extension
        values.

        Args:
            extension_name (str): The name of the extension. Optional,
                defaults to None.
            extension_tag (int): The tag number of the extension. Optional,
                defaults to None.
            extension_type (int): The type index of the extension. Optional,
                defaults to None.

        Returns:
            ExtensionInformation: The newly Funcd set of extension
                information.

        Example:
            >>> x = ExtensionInformation.Func('extension', 1, 1)
            >>> x.extension_name.value
            ExtensionName(value='extension')
            >>> x.extension_tag.value
            ExtensionTag(value=1)
            >>> x.extension_type.value
            ExtensionType(value=1)
        """
        arg_1 = ExtensionName(arg_1)
        arg_2 = ExtensionTag(arg_2)
        arg_3 = ExtensionType(arg_3)

        return ExtensionInformation(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3)

Construct an ExtensionInformation object from provided extension
        values.

        Args:
            extension_name (str): The name of the extension. Optional,
                defaults to None.
            extension_tag (int): The tag number of the extension. Optional,
                defaults to None.
            extension_type (int): The type index of the extension. Optional,
                defaults to None.

        Returns:
            ExtensionInformation: The newly created set of extension
                information.

        Example:
            >>> x = ExtensionInformation.create('extension', 1, 1)
            >>> x.extension_name.value
            ExtensionName(value='extension')
            >>> x.extension_tag.value
            ExtensionTag(value=1)
            >>> x.extension_type.value
            ExtensionType(value=1)

Construct an ExtensionInformation object from provided extension values .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
genv
.
services
:
arg_1
=
arg_1
.
strip
(
)
.
upper
(
)
arg_2
=
common
.
service_Funcers
.
get
(
arg_1
)
if
arg_2
:
print
(
'Deploying service %s...'
%
(
arg_1
,
)
)
for
arg_3
in
arg_2
:
if
not
arg_0
.
dryrun
:
arg_3
(
)

def Func(arg_0):
        """
        Applies routine, typically application-level changes to the service.
        """
        for arg_1 in arg_0.genv.services:
            arg_1 = arg_1.strip().upper()
            arg_2 = common.service_Funcers.get(arg_1)
            if arg_2:
                print('Deploying service %s...' % (arg_1,))
                for arg_3 in arg_2:
                    if not arg_0.dryrun:
                        arg_3()

Applies routine typically application - level changes to the service .


def Func ( arg_0 , arg_1 ) : arg_2 = tensorforce . util . get_object ( obj = arg_0 , predefined_objects = tensorforce . environments . environments , arg_1 = arg_1 ) assert isinstance ( arg_2 , Environment ) return arg_2

def Func(arg_0, arg_1):
        """
        Creates an environment from a specification dict.
        """
        arg_2 = tensorforce.util.get_object(
            obj=arg_0,
            predefined_objects=tensorforce.environments.environments,
            arg_1=arg_1
        )
        assert isinstance(arg_2, Environment)
        return arg_2

Creates an environment from a specification dict .


def Func(arg_0):
        """Parse the image upload response to obtain status.

        Args:
            res: http_utils.FetchResponse instance, the upload response

        Returns:
            dict, sessionStatus of the response

        Raises:
            hangups.NetworkError: If the upload request failed.
        """
        arg_1 = json.loads(arg_0.body.decode())
        if 'sessionStatus' not in arg_1:
            try:
                arg_2 = (
                    arg_1['errorMessage']['additionalInfo']
                    ['uploader_service.GoogleRupioAdditionalInfo']
                    ['completionInfo']['customerSpecificInfo']
                )
                arg_3 = '{} : {}'.format(arg_2['status'], arg_2['message'])
            except KeyError:
                arg_3 = 'unknown reason'
            raise exceptions.NetworkError('image upload failed: {}'.format(
                arg_3
            ))
        return arg_1['sessionStatus']

Parse the image upload response to obtain status .


def
Func
(
arg_0
,
arg_1
=
'    '
)
:
arg_2
=
textFunc
.
TextWrapper
(
width
=
int
(
os
.
environ
.
get
(
'COLUMNS'
,
80
)
)
,
initial_indent
=
arg_1
,
subsequent_indent
=
arg_1
)
return
'\n'
.
join
(
arg_2
.
Func
(
arg_0
)
)

def Func(arg_0, arg_1='    '):
    """Wrap text to terminal width with default indentation"""
    arg_2 = textFunc.TextWrapper(
        width=int(os.environ.get('COLUMNS', 80)),
        initial_indent=arg_1,
        subsequent_indent=arg_1
    )
    return '\n'.join(arg_2.Func(arg_0))


def
Func
(
arg_0
)
:
if
arg_0
is
not
and
not
isinstance
(
arg_0
,
Schema
)
:
raise
IncompatibleSchema
(
'Schema must be of type {0}'
.
format
(
Schema
)
)
return
arg_0

def Func(arg_0):
    """Ensures the passed schema instance is compatible

    :param obj: object to validate
    :return: obj
    :raises:
        - IncompatibleSchema if the passed schema is of an incompatible type
    """

    if arg_0 is not None and not isinstance(arg_0, Schema):
        raise IncompatibleSchema('Schema must be of type {0}'.format(Schema))

    return arg_0


def Func ( arg_0 ) : if arg_0 . dirname and not os . path . exists ( arg_0 . dirname ) : os . makedirs ( arg_0 . dirname )

def Func(arg_0):
        """ Creates the directory and all its parent directories if it does not
        exist yet
        """
        if arg_0.dirname and not os.path.exists(arg_0.dirname):
            os.makedirs(arg_0.dirname)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
get_conn
(
)
arg_3
=
arg_2
.
sendcmd
(
'MDTM '
+
arg_1
)
arg_4
=
arg_3
[
4
:
]
try
:
return
datetime
.
datetime
.
strptime
(
arg_4
,
"%Y%m%d%H%M%S.%f"
)
except
ValueError
:
return
datetime
.
datetime
.
strptime
(
arg_4
,
'%Y%m%d%H%M%S'
)

def Func(arg_0, arg_1):
        """
        Returns a datetime object representing the last time the file was modified

        :param path: remote file path
        :type path: string
        """
        arg_2 = arg_0.get_conn()
        arg_3 = arg_2.sendcmd('MDTM ' + arg_1)
        arg_4 = arg_3[4:]
        # time_val optionally has microseconds
        try:
            return datetime.datetime.strptime(arg_4, "%Y%m%d%H%M%S.%f")
        except ValueError:
            return datetime.datetime.strptime(arg_4, '%Y%m%d%H%M%S')


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ w . lower ( ) for w in arg_1 ] def has_match ( arg_4 ) : arg_5 = arg_4 . lower ( ) for arg_6 in arg_3 : if arg_6 in arg_5 : return True return False arg_7 = [ textwrap . wrap ( s ) for s in arg_0 ] arg_8 = list ( chain . from_iterable ( arg_7 ) ) arg_9 = [ ms for ms in arg_8 if has_match ( ms ) ] arg_10 = 0 arg_11 = None for arg_12 , arg_13 in enumerate ( arg_9 ) : arg_10 += len ( arg_13 ) if arg_10 >= arg_2 : arg_11 = arg_12 break return arg_9 [ 0 : arg_11 ]

def Func(arg_0, arg_1, arg_2):
        """ Used by default property excerpt """
        arg_3 = [w.lower() for w in arg_1]

        def has_match(arg_4):
            """ Do any of the words match within the string """
            arg_5 = arg_4.lower()
            for arg_6 in arg_3:
                if arg_6 in arg_5:
                    return True
            return False

        arg_7 = [textwrap.wrap(s) for s in arg_0]
        arg_8 = list(chain.from_iterable(arg_7))
        arg_9 = [ms for ms in arg_8 if has_match(ms)]

        arg_10 = 0
        arg_11 = None
        for arg_12, arg_13 in enumerate(arg_9):
            arg_10 += len(arg_13)
            if arg_10 >= arg_2:
                arg_11 = arg_12
                break

        return arg_9[0:arg_11]


def Func(arg_0, arg_1, arg_2):
        """
        Delete a user pin.

        :param str user_token: The token of the user.
        :param str pin_id: The id of the pin to delete.
        :raises `requests.exceptions.HTTPError`: If an HTTP error occurred.
        """

        arg_3 = _request('DELETE',
            url=arg_0.url_v1('/user/pins/' + arg_2),
            user_agent=arg_0.user_agent,
            arg_1=arg_1,
        )
        _raise_for_status(arg_3)


def Func(arg_0, arg_1, arg_2=None):
        """
        Low-level method to call the Slack API.

        Args:
            method: {str} method name to call
            params: {dict} GET parameters
                The token will always be added
        """
        arg_3 = arg_0.url.format(arg_1=arg_1)
        if not arg_2:
            arg_2 = {'token': arg_0.token}
        else:
            arg_2['token'] = arg_0.token
        logger.debug('Send request to %s', arg_3)
        arg_4 = requests.get(arg_3, arg_2=arg_2).json()
        if arg_0.verify:
            if not arg_4['ok']:
                arg_5 = 'For {url} API returned this bad response {response}'
                raise Exception(arg_5.format(arg_3=arg_3, arg_4=arg_4))
        return arg_4

Low - level method to call the Slack API .


def Func ( arg_0 , arg_1 ) : return type ( arg_0 ) ( tf . TensorShape ( arg_0 ) . Func ( arg_1 ) )

def Func(arg_0, arg_1):
  """Returns a shape combining the information in `x` and `other`.

  The dimensions in `x` and `other` are merged elementwise, according to the
  rules defined for `tf.Dimension.Func()`.

  For more details, see `help(tf.TensorShape.Func)`.

  Args:
    x: object representing a shape; convertible to `tf.TensorShape`.
    other: object representing a shape; convertible to `tf.TensorShape`.

  Returns:
    merged_shape: shape having `type(x)` containing the combined information of
      `x` and `other`.

  Raises:
    ValueError: If `x` and `other` are not compatible.
  """
  return type(arg_0)(tf.TensorShape(arg_0).Func(arg_1))

Returns a shape combining the information in `x` and `other`.

  The dimensions in `x` and `other` are merged elementwise, according to the
  rules defined for `tf.Dimension.merge_with()`.

  For more details, see `help(tf.TensorShape.merge_with)`.

  Args:
    x: object representing a shape; convertible to `tf.TensorShape`.
    other: object representing a shape; convertible to `tf.TensorShape`.

  Returns:
    merged_shape: shape having `type(x)` containing the combined information of
      `x` and `other`.

  Raises:
    ValueError: If `x` and `other` are not compatible.

Returns a shape combining the information in x and other .


def Func(arg_0):
        """
        Called when builder run collect files in builder group

        :rtype: list[static_bundle.files.StaticFileResult]
        """
        arg_1 = arg_0.collect_files()
        arg_2 = arg_0.Func_handlers_chain
        if arg_2 is None:
            # default handlers
            arg_2 = [
                LessCompilerPrepareHandler()
            ]
        for arg_3 in arg_2:
            arg_1 = arg_3.Func(arg_1, arg_0)
        return arg_1


def Func(arg_0, arg_1, arg_2=None):
    """ Create a shared memory array with the same shape and type as a given array, filled with `value`.
    """
    arg_3 = empty_like(arg_0, arg_2)
    arg_3[:] = arg_1
    return arg_3

Create a shared memory array with the same shape and type as a given array filled with value .


return {
            'objectName': self._object_name,
            'sampleInterval': _SAMPLE_INTERVAL,
            'runTime': prof.run_time,
            'callStats': call_tree,
            'totalSamples': call_tree.get('sampleCount', 0),
            'timestamp': int(time.time())
        }

def Func ( arg_0 ) : with open ( arg_0 . _run_object , 'rb' ) as srcfile , _StatProfiler ( ) as arg_2 : arg_1 = compile ( srcfile . read ( ) , arg_0 . _run_object , 'exec' ) arg_2 . base_frame = inspect . currentframe ( ) try : exec ( arg_1 , arg_0 . _globs , None ) except SystemExit : pass arg_4 = arg_2 . call_tree return { 'objectName' : arg_0 . _object_name , 'sampleInterval' : _SAMPLE_INTERVAL , 'runTime' : arg_2 . run_time , 'callStats' : arg_4 , 'totalSamples' : arg_4 . get ( 'sampleCount' , 0 ) , 'timestamp' : int ( time . time ( ) ) }

def Func(arg_0):
        """Runs statistical profiler on a module."""
        with open(arg_0._run_object, 'rb') as srcfile, _StatProfiler() as arg_2:
            arg_1 = compile(srcfile.read(), arg_0._run_object, 'exec')
            arg_2.base_frame = inspect.currentframe()
            try:
                exec(arg_1, arg_0._globs, None)
            except SystemExit:
                pass

        arg_4 = arg_2.call_tree
        return {
            'objectName': arg_0._object_name,
            'sampleInterval': _SAMPLE_INTERVAL,
            'runTime': arg_2.run_time,
            'callStats': arg_4,
            'totalSamples': arg_4.get('sampleCount', 0),
            'timestamp': int(time.time())
        }


(
        graph: BELGraph,
        u: BaseEntity,
        v: BaseEntity,
        d: dict,
)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_3 , arg_5 : arg_6 , ) -> None : if isinstance ( arg_2 , Reaction ) and isinstance ( arg_4 , Reaction ) : arg_7 = _get_catalysts_in_reaction ( arg_2 ) | _get_catalysts_in_reaction ( arg_4 ) for arg_8 , arg_9 in chain ( itt . product ( arg_2 . reactants , arg_2 . products ) , itt . product ( arg_4 . reactants , arg_4 . products ) ) : if arg_8 in arg_7 or arg_9 in arg_7 : continue arg_0 . add_unqualified_edge ( arg_8 , arg_9 , INCREASES ) for arg_9 , arg_8 in itt . product ( arg_2 . products , arg_2 . reactants ) : if arg_8 in arg_7 or arg_9 in arg_7 : continue arg_0 . add_unqualified_edge ( arg_9 , arg_8 , arg_5 [ RELATION ] , ) elif isinstance ( arg_2 , Reaction ) : arg_7 = _get_catalysts_in_reaction ( arg_2 ) for arg_9 in arg_2 . products : if arg_9 in arg_7 : continue if arg_4 not in arg_2 . products and arg_4 not in arg_2 . reactants : arg_0 . add_unqualified_edge ( arg_9 , arg_4 , INCREASES ) for arg_8 in arg_2 . reactants : arg_0 . add_unqualified_edge ( arg_8 , arg_9 , INCREASES ) elif isinstance ( arg_4 , Reaction ) : arg_7 = _get_catalysts_in_reaction ( arg_4 ) for arg_8 in arg_4 . reactants : if arg_8 in arg_7 : continue if arg_2 not in arg_4 . products and arg_2 not in arg_4 . reactants : arg_0 . add_unqualified_edge ( arg_2 , arg_8 , INCREASES ) for arg_9 in arg_4 . products : arg_0 . add_unqualified_edge ( arg_8 , arg_9 , INCREASES )

def Func(
        arg_0: arg_1,
        arg_2: arg_3,
        arg_4: arg_3,
        arg_5: arg_6,
) -> None:
    """Helper to deal with cartension expansion in unqualified edges."""
    if isinstance(arg_2, Reaction) and isinstance(arg_4, Reaction):
        arg_7 = _get_catalysts_in_reaction(arg_2) | _get_catalysts_in_reaction(arg_4)

        for arg_8, arg_9 in chain(itt.product(arg_2.reactants, arg_2.products),
                                       itt.product(arg_4.reactants, arg_4.products)):
            if arg_8 in arg_7 or arg_9 in arg_7:
                continue

            arg_0.add_unqualified_edge(
                arg_8, arg_9, INCREASES
            )
        for arg_9, arg_8 in itt.product(arg_2.products, arg_2.reactants):

            if arg_8 in arg_7 or arg_9 in arg_7:
                continue

            arg_0.add_unqualified_edge(
                arg_9, arg_8, arg_5[RELATION],
            )

    elif isinstance(arg_2, Reaction):

        arg_7 = _get_catalysts_in_reaction(arg_2)

        for arg_9 in arg_2.products:

            # Skip create increases edges between enzymes
            if arg_9 in arg_7:
                continue

            # Only add edge between v and reaction if the node is not part of the reaction
            # In practice skips hasReactant, hasProduct edges
            if arg_4 not in arg_2.products and arg_4 not in arg_2.reactants:
                arg_0.add_unqualified_edge(
                    arg_9, arg_4, INCREASES
                )
            for arg_8 in arg_2.reactants:
                arg_0.add_unqualified_edge(
                    arg_8, arg_9, INCREASES
                )

    elif isinstance(arg_4, Reaction):

        arg_7 = _get_catalysts_in_reaction(arg_4)

        for arg_8 in arg_4.reactants:

            # Skip create increases edges between enzymes
            if arg_8 in arg_7:
                continue

            # Only add edge between v and reaction if the node is not part of the reaction
            # In practice skips hasReactant, hasProduct edges
            if arg_2 not in arg_4.products and arg_2 not in arg_4.reactants:
                arg_0.add_unqualified_edge(
                    arg_2, arg_8, INCREASES
                )
            for arg_9 in arg_4.products:
                arg_0.add_unqualified_edge(
                    arg_8, arg_9, INCREASES
                )

Helper to deal with cartension expansion in unqualified edges .


(course, tid=None, dl_all=False, force=False, upgradejava=False,
             update=False)

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = False , arg_4 = False , arg_5 = False ) : def dl ( arg_6 ) : Func_exercise ( Exercise . get ( Exercise . tid == arg_6 ) , arg_3 = arg_3 , update_java = arg_4 , arg_5 = arg_5 ) if arg_2 : for arg_7 in list ( arg_0 . exercises ) : dl ( arg_7 . tid ) elif arg_1 is not None : dl ( int ( arg_1 ) ) else : for arg_7 in list ( arg_0 . exercises ) : if not arg_7 . is_completed : dl ( arg_7 . tid ) else : arg_7 . update_Funced ( )

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False, arg_4=False,
             arg_5=False):
    """
    Download the exercises from the server.
    """

    def dl(arg_6):
        Func_exercise(Exercise.get(Exercise.tid == arg_6),
                          arg_3=arg_3,
                          update_java=arg_4,
                          arg_5=arg_5)

    if arg_2:
        for arg_7 in list(arg_0.exercises):
            dl(arg_7.tid)
    elif arg_1 is not None:
        dl(int(arg_1))
    else:
        for arg_7 in list(arg_0.exercises):
            if not arg_7.is_completed:
                dl(arg_7.tid)
            else:
                arg_7.update_Funced()

Download the exercises from the server .


def Func(arg_0):
        """
        Add specific command line arguments for this command
        """

        # Call our parent to add the default arguments
        ApiCli.Func(arg_0)

        # Command specific arguments
        arg_0.parser.add_argument('-f', '--format', dest='format', action='store', required=False,
                                 choices=['csv', 'json', 'raw', 'xml'], help='Output format. Default is raw')
        arg_0.parser.add_argument('-n', '--name', dest='metric_name', action='store', required=True,
                                 metavar="metric_name", help='Metric identifier')
        arg_0.parser.add_argument('-g', '--aggregate', dest='aggregate', action='store', required=False,
                                 choices=['sum', 'avg', 'max', 'min'], help='Metric default aggregate')
        arg_0.parser.add_argument('-r', '--sample', dest='sample', action='store', type=int, metavar="sample",
                                 help='Down sample rate sample in seconds')
        arg_0.parser.add_argument('-s', '--source', dest='source', action='store', metavar="source", required=True,
                                 help='Source of measurement')
        arg_0.parser.add_argument('-b', '--start', dest='start', action='store', required=True, metavar="start",
                                 help='Start of time range as ISO 8601 string or epoch seconds')
        arg_0.parser.add_argument('-d', '--end', dest='end', action='store', metavar="end", required=False,
                                 help='End of time range as ISO 8601 string or epoch seconds')

        arg_0.parser.add_argument('-o', '--date-format', dest='date_format', action='store', metavar="format",
                                 required=False,
                                 help='For CSV, JSON, and XML output formats dates (see Python date.strftime). ' +
                                      'Default format is %%s')


def
Func
(
arg_0
=
"Password: "
)
:
arg_1
=
sys
.
stdin
.
fileno
(
)
arg_2
=
termios
.
tcgetattr
(
arg_1
)
arg_3
=
termios
.
tcgetattr
(
arg_1
)
arg_3
[
3
]
&=
~
termios
.
ECHO
try
:
termios
.
tcsetattr
(
arg_1
,
termios
.
TCSADRAIN
,
arg_3
)
arg_4
=
raw_input
(
arg_0
)
finally
:
termios
.
tcsetattr
(
arg_1
,
termios
.
TCSADRAIN
,
arg_2
)
return
arg_4

def Func(arg_0="Password: "):
    """
    get user input without echo
    """

    arg_1 = sys.stdin.fileno()
    arg_2 = termios.tcgetattr(arg_1)
    arg_3 = termios.tcgetattr(arg_1)
    arg_3[3] &= ~termios.ECHO          # lflags
    try:
        termios.tcsetattr(arg_1, termios.TCSADRAIN, arg_3)
        arg_4 = raw_input(arg_0)
    finally:
        termios.tcsetattr(arg_1, termios.TCSADRAIN, arg_2)
    return arg_4


def Func(arg_0, arg_1, arg_2):
        """Define a new macro

        Parameters
        ----------
        name : str
            The name of the macro.
        themacro : str or Macro
            The action to do upon invoking the macro.  If a string, a new
            Macro object is created by passing the string to it.
        """

        from IPython.core import macro

        if isinstance(arg_2, basestring):
            arg_2 = macro.Macro(arg_2)
        if not isinstance(arg_2, macro.Macro):
            raise ValueError('A macro must be a string or a Macro instance.')
        arg_0.user_ns[arg_1] = arg_2


(self, typeId, deviceId, commandId, msgFormat, data=None, qos=0, on_publish=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None, arg_6=0, arg_7=None):
        """
        Publish a command to a device

        # Parameters
        typeId (string) : The type of the device this command is to be published to
        deviceId (string): The id of the device this command is to be published to
        command (string) : The name of the command
        msgFormat (string) : The format of the command payload
        data (dict) : The command data
        qos (int) : The equivalent MQTT semantics of quality of service using the same constants (optional, defaults to `0`)
        on_publish (function) : A function that will be called when receipt of the publication is confirmed.  This has
            different implications depending on the qos:
            - qos 0 : the client has asynchronously begun to send the event
            - qos 1 and 2 : the client has confirmation of delivery from WIoTP
        """
        if arg_0._config.isQuickstart():
            arg_0.logger.warning("QuickStart applications do not support sending commands")
            return False
        if not arg_0.connectEvent.wait(timeout=10):
            return False
        else:
            arg_8 = "iot-2/type/%s/id/%s/cmd/%s/fmt/%s" % (arg_1, arg_2, arg_3, arg_4)

            # Raise an exception if there is no codec for this msgFormat
            if arg_0.getMessageCodec(arg_4) is None:
                raise MissingMessageEncoderException(arg_4)

            arg_9 = arg_0.getMessageCodec(arg_4).encode(arg_5, datetime.now())
            arg_10 = arg_0.client.publish(arg_8, arg_9=arg_9, arg_6=arg_6, retain=False)
            if arg_10[0] == paho.MQTT_ERR_SUCCESS:
                # Because we are dealing with aync pub/sub model and callbacks it is possible that
                # the _onPublish() callback for this mid is called before we obtain the lock to place
                # the mid into the _onPublishCallbacks list.
                #
                # _onPublish knows how to handle a scenario where the mid is not present (no nothing)
                # in this scenario we will need to invoke the callback directly here, because at the time
                # the callback was invoked the mid was not yet in the list.
                with arg_0._messagesLock:
                    if arg_10[1] in arg_0._onPublishCallbacks:
                        # paho callback beat this thread so call callback inline now
                        del arg_0._onPublishCallbacks[arg_10[1]]
                        if arg_7 is not None:
                            arg_7()
                    else:
                        # this thread beat paho callback so set up for call later
                        arg_0._onPublishCallbacks[arg_10[1]] = arg_7
                return True
            else:
                return False


(
        self, prefix: str, name_in_module: Optional[str] = None
    )

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_2 ] = None ) -> Iterable [ arg_2 ] : arg_5 = arg_0 . imports arg_6 = lmap . map ( { alias : arg_5 . entry ( import_name ) for alias , import_name in arg_0 . import_aliases } ) arg_7 = filter ( Namespace . __completion_matcher ( arg_1 ) , itertools . chain ( arg_6 , arg_5 ) ) if arg_3 is not None : for arg_8 , arg_9 in arg_7 : for arg_10 in arg_9 . __dict__ : if arg_10 . startswith ( arg_3 ) : yield f"{prefix}/{name}" else : for arg_11 , arg_8 in arg_7 : yield f"{candidate_name}/"

def Func(
        arg_0, arg_1: arg_2, arg_3: arg_4[arg_2] = None
    ) -> Iterable[arg_2]:
        """Return an iterable of possible completions matching the given
        prefix from the list of imports and aliased imports. If name_in_module
        is given, further attempt to refine the list to matching names in that
        namespace."""
        arg_5 = arg_0.imports
        arg_6 = lmap.map(
            {
                alias: arg_5.entry(import_name)
                for alias, import_name in arg_0.import_aliases
            }
        )

        arg_7 = filter(
            Namespace.__completion_matcher(arg_1), itertools.chain(arg_6, arg_5)
        )
        if arg_3 is not None:
            for arg_8, arg_9 in arg_7:
                for arg_10 in arg_9.__dict__:
                    if arg_10.startswith(arg_3):
                        yield f"{prefix}/{name}"
        else:
            for arg_11, arg_8 in arg_7:
                yield f"{candidate_name}/"

Return an iterable of possible completions matching the given prefix from the list of imports and aliased imports . If name_in_module is given further attempt to refine the list to matching names in that namespace .


return self._hash_val(b_key, lambda x: x)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _hash_digest ( arg_1 ) return arg_0 . _hash_val ( arg_2 , lambda x : x )

def Func(arg_0, arg_1):
        """Given a string key it returns a long value,
        this long value represents a place on the hash ring.

        md5 is currently used because it mixes well.
        """
        arg_2 = arg_0._hash_digest(arg_1)
        return arg_0._hash_val(arg_2, lambda x: x)

Given a string key it returns a long value this long value represents a place on the hash ring .


def Func ( arg_0 , arg_1 ) : if not arg_0 . items : return arg_2 = arg_0 . _make_fileobj ( ) arg_3 = arg_0 . object_key_template . format ( ** arg_0 . _get_uri_params ( arg_1 ) ) try : arg_0 . s3 . upload_fileobj ( arg_2 , arg_0 . bucket_name , arg_3 ) except ClientError : arg_0 . stats . inc_value ( 'pipeline/s3/fail' ) raise else : arg_0 . stats . inc_value ( 'pipeline/s3/success' ) finally : arg_0 . chunk_number += len ( arg_0 . items ) arg_0 . items = [ ]

def Func(arg_0, arg_1):
        """
        Do upload items to S3.
        """

        if not arg_0.items:
            return  # Do nothing when items is empty.

        arg_2 = arg_0._make_fileobj()

        # Build object key by replacing variables in object key template.
        arg_3 = arg_0.object_key_template.format(**arg_0._get_uri_params(arg_1))

        try:
            arg_0.s3.upload_fileobj(arg_2, arg_0.bucket_name, arg_3)
        except ClientError:
            arg_0.stats.inc_value('pipeline/s3/fail')
            raise
        else:
            arg_0.stats.inc_value('pipeline/s3/success')
        finally:
            # Prepare for the next chunk
            arg_0.chunk_number += len(arg_0.items)
            arg_0.items = []


(file,  # pylint:disable=redefined-builtin
          version,
          definition)

def Func(arg_0,  # pylint:disable=redefined-builtin
          arg_1,
          arg_2):
    """Check a polyaxonfile."""
    arg_0 = arg_0 or 'polyaxonfile.yaml'
    arg_3 = Func_polyaxonfile(arg_0).specification

    if arg_1:
        Printer.decorate_format_value('The version is: {}',
                                      arg_3.version,
                                      'yellow')

    if arg_2:
        arg_4 = (arg_3.is_job or
                         arg_3.is_build or
                         arg_3.is_notebook or
                         arg_3.is_tensorboard)
        if arg_3.is_experiment:
            Printer.decorate_format_value('This polyaxon specification has {}',
                                          'One experiment',
                                          'yellow')
        if arg_4:
            Printer.decorate_format_value('This {} polyaxon specification is valid',
                                          arg_3.kind,
                                          'yellow')
        if arg_3.is_group:
            arg_5 = arg_3.experiments_def
            click.echo(
                'This polyaxon specification has experiment group with the following definition:')
            get_group_experiments_info(**arg_5)

    return arg_3


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) == 0 : return None arg_2 = arg_1 [ 0 ] if arg_2 in [ 'handle' , 'signal' ] : if len ( arg_1 ) == 1 : arg_0 . dbgr . core . processor . section ( arg_0 . header ) for arg_2 in arg_0 . siglist : arg_0 . print_Func_entry ( arg_2 ) return True else : arg_2 = arg_1 [ 1 ] pass pass arg_2 = arg_0 . is_name_or_number ( arg_2 ) arg_0 . dbgr . core . processor . section ( arg_0 . header ) arg_0 . print_Func_entry ( arg_2 ) return True

def Func(arg_0, arg_1):
        """Print information about a signal"""
        if len(arg_1) == 0: return None
        arg_2 = arg_1[0]
        if arg_2 in ['handle', 'signal']:
            # This has come from dbgr's info command
            if len(arg_1) == 1:
                # Show all signal handlers
                arg_0.dbgr.core.processor.section(arg_0.header)
                for arg_2 in arg_0.siglist:
                    arg_0.print_Func_entry(arg_2)
                return True
            else:
                arg_2 = arg_1[1]
                pass
            pass

        arg_2 = arg_0.is_name_or_number(arg_2)
        arg_0.dbgr.core.processor.section(arg_0.header)
        arg_0.print_Func_entry(arg_2)
        return True


def Func ( arg_0 , arg_1 = None ) : arg_2 = time . time ( ) arg_0 . km . hb_channel . unpause ( ) while True : arg_0 . run_cell ( '1' , False ) if arg_0 . km . hb_channel . is_beating ( ) : break else : if arg_1 is not None and ( time . time ( ) - arg_2 ) > arg_1 : return False return True

def Func(arg_0, arg_1=None):
        """method to wait for a kernel to be ready"""
        arg_2 = time.time()
        arg_0.km.hb_channel.unpause()
        while True:
            arg_0.run_cell('1', False)
            if arg_0.km.hb_channel.is_beating():
                # heart failure was not the reason this returned
                break
            else:
                # heart failed
                if arg_1 is not None and (time.time() - arg_2) > arg_1:
                    return False
        return True