def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . timestamp if arg_0 . timestamp_format is not None : arg_2 = ( time . strftime ( arg_0 . timestamp_format , arg_1 ) + '-' + arg_0 . batch_name ) else : arg_2 = arg_0 . batch_name arg_3 = os . path . join ( arg_0 . output_directory , * ( arg_0 . subdir + [ arg_2 ] ) ) return os . path . abspath ( arg_3 )

def Func(arg_0, arg_1=None):
        """
        A helper method that supplies the root directory name given a
        timestamp.
        """
        if arg_1 is None: arg_1 = arg_0.timestamp
        if arg_0.timestamp_format is not None:
            arg_2 =  (time.strftime(arg_0.timestamp_format, arg_1)
                          + '-' + arg_0.batch_name)
        else:
            arg_2 = arg_0.batch_name

        arg_3 = os.path.join(arg_0.output_directory,
                                *(arg_0.subdir+[arg_2]))
        return os.path.abspath(arg_3)

A helper method that supplies the root directory name given a timestamp .


(cobra_object, new_dict, optional_attribute_dict,
                     ordered_keys)

def Func(arg_0, arg_1, arg_2,
                     arg_3):
    """update new_dict with optional attributes from cobra_object"""
    for arg_4 in arg_3:
        arg_5 = arg_2[arg_4]
        arg_6 = getattr(arg_0, arg_4)
        if arg_6 is None or arg_6 == arg_5:
            continue
        arg_1[arg_4] = _fix_type(arg_6)


async
def
Func
(
arg_0
,
arg_1
=
)
:
if
isinstance
(
arg_0
,
bytes
)
:
arg_2
=
await
get_type
(
arg_0
,
arg_1
)
else
:
raise
TypeError
(
"get_metadata input must be a bytes"
)
arg_3
=
get_category
(
arg_2
)
_logger
.
info
(
"media_type: %s, media_category: %s"
%
(
arg_2
,
arg_3
)
)
return
arg_2
,
arg_3

async def Func(arg_0, arg_1=None):
    """
        Get all the file's metadata and read any kind of file object

    Parameters
    ----------
    data : bytes
        first bytes of the file (the mimetype shoudl be guessed from the
        file headers
    path : str, optional
        path to the file

    Returns
    -------
    str
        The mimetype of the media
    str
        The category of the media on Twitter
    """
    if isinstance(arg_0, bytes):
        arg_2 = await get_type(arg_0, arg_1)

    else:
        raise TypeError("get_metadata input must be a bytes")

    arg_3 = get_category(arg_2)

    _logger.info("media_type: %s, media_category: %s" % (arg_2,
                                                         arg_3))

    return arg_2, arg_3

Get all the file s metadata and read any kind of file object


(CNN=None, second=10, saveable=True, name='cnn', fig_idx=3119362)

def
Func
(
arg_0
=
,
arg_1
=
10
,
arg_2
=
True
,
arg_3
=
'cnn'
,
arg_4
=
3119362
)
:
import
matplotlib
.
pyplot
as
plt
arg_5
=
arg_0
.
shape
[
3
]
arg_6
=
arg_0
.
shape
[
0
]
arg_7
=
arg_0
.
shape
[
1
]
arg_8
=
arg_0
.
shape
[
2
]
arg_9
=
int
(
np
.
sqrt
(
arg_5
)
)
arg_10
=
int
(
np
.
ceil
(
arg_5
/
arg_9
)
)
plt
.
ion
(
)
arg_11
=
plt
.
figure
(
arg_4
)
arg_12
=
1
for
arg_13
in
range
(
1
,
arg_9
+
1
)
:
for
arg_14
in
range
(
1
,
arg_10
+
1
)
:
if
arg_12
>
arg_5
:
break
arg_11
.
add_subplot
(
arg_10
,
arg_9
,
arg_12
)
if
arg_8
==
1
:
plt
.
imshow
(
np
.
reshape
(
arg_0
[
:
,
:
,
:
,
arg_12
1
]
,
(
arg_6
,
arg_7
)
)
,
cmap
=
'gray'
,
interpolation
=
"nearest"
)
elif
arg_8
==
3
:
plt
.
imshow
(
np
.
reshape
(
arg_0
[
:
,
:
,
:
,
arg_12
1
]
,
(
arg_6
,
arg_7
,
arg_8
)
)
,
cmap
=
'gray'
,
interpolation
=
"nearest"
)
else
:
raise
Exception
(
"Unknown n_color"
)
plt
.
gca
(
)
.
xaxis
.
set_major_locator
(
plt
.
NullLocator
(
)
)
plt
.
gca
(
)
.
yaxis
.
set_major_locator
(
plt
.
NullLocator
(
)
)
arg_12
=
arg_12
+
1
if
arg_2
:
plt
.
savefig
(
arg_3
+
'.pdf'
,
format
=
'pdf'
)
else
:
plt
.
draw
(
)
plt
.
pause
(
arg_1
)

def Func(arg_0=None, arg_1=10, arg_2=True, arg_3='cnn', arg_4=3119362):
    """Display a group of RGB or Greyscale CNN masks.

    Parameters
    ----------
    CNN : numpy.array
        The image. e.g: 64 5x5 RGB images can be (5, 5, 3, 64).
    second : int
        The display second(s) for the image(s), if saveable is False.
    saveable : boolean
        Save or plot the figure.
    name : str
        A name to save the image, if saveable is True.
    fig_idx : int
        The matplotlib figure index.

    Examples
    --------
    >>> tl.visualize.Func(network.all_params[0].eval(), second=10, saveable=True, name='cnn1_mnist', fig_idx=2012)

    """
    import matplotlib.pyplot as plt
    # tl.logging.info(CNN.shape)    # (5, 5, 3, 64)
    # exit()
    arg_5 = arg_0.shape[3]
    arg_6 = arg_0.shape[0]
    arg_7 = arg_0.shape[1]
    arg_8 = arg_0.shape[2]
    arg_9 = int(np.sqrt(arg_5))
    arg_10 = int(np.ceil(arg_5 / arg_9))
    plt.ion()  # active mode
    arg_11 = plt.figure(arg_4)
    arg_12 = 1
    for arg_13 in range(1, arg_9 + 1):
        for arg_14 in range(1, arg_10 + 1):
            if arg_12 > arg_5:
                break
            arg_11.add_subplot(arg_10, arg_9, arg_12)
            # tl.logging.info(CNN[:,:,:,count-1].shape, n_row, n_col)   # (5, 1, 32) 5 5
            # exit()
            # plt.imshow(
            #         np.reshape(CNN[count-1,:,:,:], (n_row, n_col)),
            #         cmap='gray', interpolation="nearest")     # theano
            if arg_8 == 1:
                plt.imshow(np.reshape(arg_0[:, :, :, arg_12 - 1], (arg_6, arg_7)), cmap='gray', interpolation="nearest")
            elif arg_8 == 3:
                plt.imshow(
                    np.reshape(arg_0[:, :, :, arg_12 - 1], (arg_6, arg_7, arg_8)), cmap='gray', interpolation="nearest"
                )
            else:
                raise Exception("Unknown n_color")
            plt.gca().xaxis.set_major_locator(plt.NullLocator())  # distable tick
            plt.gca().yaxis.set_major_locator(plt.NullLocator())
            arg_12 = arg_12 + 1
    if arg_2:
        plt.savefig(arg_3 + '.pdf', format='pdf')
    else:
        plt.draw()
        plt.pause(arg_1)

Display a group of RGB or Greyscale CNN masks.

    Parameters
    ----------
    CNN : numpy.array
        The image. e.g: 64 5x5 RGB images can be (5, 5, 3, 64).
    second : int
        The display second(s) for the image(s), if saveable is False.
    saveable : boolean
        Save or plot the figure.
    name : str
        A name to save the image, if saveable is True.
    fig_idx : int
        The matplotlib figure index.

    Examples
    --------
    >>> tl.visualize.CNN2d(network.all_params[0].eval(), second=10, saveable=True, name='cnn1_mnist', fig_idx=2012)

Display a group of RGB or Greyscale CNN masks .


def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'Setting modified time to %s'
,
arg_1
)
arg_2
=
calendar
.
timegm
(
arg_1
.
utctimetuple
(
)
)
arg_2
+=
arg_1
.
microsecond
/
1000000
arg_3
=
os
.
stat
(
arg_0
)
.
st_atime
os
.
utime
(
arg_0
,
(
arg_3
,
arg_2
)
)

def Func(arg_0, arg_1):
	"""
	Set the modified time of a file
	"""
	log.debug('Setting modified time to %s', arg_1)
	arg_2 = calendar.timegm(arg_1.utctimetuple())
	# utctimetuple discards microseconds, so restore it (for consistency)
	arg_2 += arg_1.microsecond / 1000000
	arg_3 = os.stat(arg_0).st_atime
	os.utime(arg_0, (arg_3, arg_2))


def
Func
(
arg_0
,
arg_1
=
'/'
)
:
if
isinstance
(
arg_0
,
str
)
:
arg_2
=
h5py
.
File
(
arg_0
,
mode
=
'r'
)
else
:
arg_2
=
arg_0
arg_3
=
get_datasets
(
arg_2
,
arg_1
)
arg_4
=
OrderedDict
(
)
try
:
for
arg_5
in
arg_3
:
arg_4
[
arg_5
.
name
.
split
(
'/'
)
[
1
]
]
=
arg_5
[
:
]
except
:
raise
RuntimeError
(
'Error reading datasets in {}/{}.'
.
format
(
arg_2
.
filename
,
arg_1
)
)
finally
:
if
isinstance
(
arg_0
,
str
)
:
arg_2
.
close
(
)
return
arg_4

def Func(arg_0, arg_1='/'):
    """ Return all dataset contents from h5path group in h5file in an OrderedDict.

    Parameters
    ----------
    h5file: h5py.File
        HDF5 file object

    h5path: str
        HDF5 group path to read datasets from

    Returns
    -------
    datasets: OrderedDict
        Dict with variables contained in file_path/h5path
    """
    if isinstance(arg_0, str):
        arg_2 = h5py.File(arg_0, mode='r')
    else:
        arg_2 = arg_0

    arg_3 = get_datasets(arg_2, arg_1)
    arg_4  = OrderedDict()
    try:
        for arg_5 in arg_3:
            arg_4[arg_5.name.split('/')[-1]] = arg_5[:]
    except:
        raise RuntimeError('Error reading datasets in {}/{}.'.format(arg_2.filename, arg_1))
    finally:
        if isinstance(arg_0, str):
            arg_2.close()

    return arg_4

Return all dataset contents from h5path group in h5file in an OrderedDict .


return self._stat(axis, name='mean', keepdims=keepdims)

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : return arg_0 . _stat ( arg_1 , name = 'Func' , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=False):
        """
        Return the Func of the array over the given axis.

        Parameters
        ----------
        axis : tuple or int, optional, default=None
            Axis to compute statistic over, if None
            will compute over all axes

        keepdims : boolean, optional, default=False
            Keep axis remaining after operation with size 1.
        """
        return arg_0._stat(arg_1, name='Func', arg_2=arg_2)

Return the mean of the array over the given axis.

        Parameters
        ----------
        axis : tuple or int, optional, default=None
            Axis to compute statistic over, if None
            will compute over all axes

        keepdims : boolean, optional, default=False
            Keep axis remaining after operation with size 1.

Return the mean of the array over the given axis .


def Func ( arg_0 , arg_1 ) : arg_2 = json . dumps ( { 'messageType' : 'actionStatus' , 'data' : arg_1 . as_action_description ( ) , } ) for arg_3 in list ( arg_0 . subscribers ) : try : arg_3 . write_message ( arg_2 ) except tornado . websocket . WebSocketClosedError : pass

def Func(arg_0, arg_1):
        """
        Notify all subscribers of an action status change.

        action -- the action whose status changed
        """
        arg_2 = json.dumps({
            'messageType': 'actionStatus',
            'data': arg_1.as_action_description(),
        })

        for arg_3 in list(arg_0.subscribers):
            try:
                arg_3.write_message(arg_2)
            except tornado.websocket.WebSocketClosedError:
                pass

Notify all subscribers of an action status change .


def Func(arg_0, arg_1):
        """ Setup self.template

        Parameters
        ----------
        template_file_path: str
            Document template file path.
        """
        try:
            arg_2 = arg_1
            arg_3 = get_environment_for(arg_1)
            arg_4 = arg_3.get_template(os.path.basename(arg_2))
        except:
            raise
        else:
            arg_0._template_file = arg_2
            arg_0._template_env = arg_3
            arg_0.template = arg_4


def
Func
(
arg_0
)
:
arg_1
,
arg_2
,
arg_3
=
arg_0
try
:
arg_4
=
make_fakelc
(
arg_1
,
arg_2
,
**
arg_3
)
return
arg_4
except
Exception
as
e
:
LOGEXCEPTION
(
'could not process %s into a fakelc'
%
arg_1
)
return

def Func(arg_0):
    '''
    This wraps `process_fakelc` for `make_fakelc_collection` below.

    Parameters
    ----------

    task : tuple
        This is of the form::

            task[0] = lcfile
            task[1] = outdir
            task[2] = magrms
            task[3] = dict with keys: {'lcformat', 'timecols', 'magcols',
                                       'errcols', 'randomizeinfo'}

    Returns
    -------

    tuple
        This returns a tuple of the form::

            (fakelc_fpath,
             fakelc_lcdict['columns'],
             fakelc_lcdict['objectinfo'],
             fakelc_lcdict['moments'])
    '''

    arg_1, arg_2, arg_3 = arg_0

    try:

        arg_4 = make_fakelc(
            arg_1,
            arg_2,
            **arg_3
        )

        return arg_4

    except Exception as e:

        LOGEXCEPTION('could not process %s into a fakelc' % arg_1)
        return None

This wraps process_fakelc for make_fakelc_collection below .


def Func(arg_0):
        """
        Extract readout and CNOT errors and compute swap costs.
        """
        arg_1 = arg_0.backend_prop
        for arg_2 in arg_1.gates:
            if arg_2.gate == 'cx':
                for arg_3 in arg_2.parameters:
                    if arg_3.name == 'gate_error':
                        arg_4 = 1.0 - arg_3.value
                        break
                    else:
                        arg_4 = 1.0
                arg_5 = -math.log(pow(arg_4, 3))
                arg_0.swap_graph.add_edge(arg_2.qubits[0], arg_2.qubits[1], weight=arg_5)
                arg_0.swap_graph.add_edge(arg_2.qubits[1], arg_2.qubits[0], weight=arg_5)
                arg_0.cx_errors[(arg_2.qubits[0], arg_2.qubits[1])] = arg_4
                arg_0.gate_list.append((arg_2.qubits[0], arg_2.qubits[1]))
        arg_8 = 0
        for arg_9 in arg_1.qubits:
            for arg_10 in arg_9:
                if arg_10.name == 'readout_error':
                    arg_0.readout_errors[arg_8] = 1.0 - arg_10.value
                    arg_0.available_hw_qubits.append(arg_8)
            arg_8 += 1
        for arg_12 in arg_0.cx_errors:
            arg_0.gate_cost[arg_12] = arg_0.cx_errors[arg_12] * arg_0.readout_errors[arg_12[0]] *\
                arg_0.readout_errors[arg_12[1]]
        arg_0.swap_paths, arg_15 = nx.algorithms.shortest_paths.dense.\
            floyd_warshall_predecessor_and_distance(arg_0.swap_graph, weight='weight')
        for arg_16 in arg_15:
            arg_0.swap_costs[arg_16] = {}
            for arg_18 in arg_15[arg_16]:
                if (arg_16, arg_18) in arg_0.cx_errors:
                    arg_0.swap_costs[arg_16][arg_18] = arg_0.cx_errors[(arg_16, arg_18)]
                elif (arg_18, arg_16) in arg_0.cx_errors:
                    arg_0.swap_costs[arg_16][arg_18] = arg_0.cx_errors[(arg_18, arg_16)]
                else:
                    arg_19 = 0.0
                    for arg_20 in arg_0.swap_graph.neighbors(arg_18):
                        if (arg_20, arg_18) in arg_0.cx_errors:
                            arg_21 = math.exp(-arg_15[arg_16][arg_20])*arg_0.cx_errors[(arg_20, arg_18)]
                        else:
                            arg_21 = math.exp(-arg_15[arg_16][arg_20])*arg_0.cx_errors[(arg_18, arg_20)]
                        if arg_21 > arg_19:
                            arg_19 = arg_21
                    arg_0.swap_costs[arg_16][arg_18] = arg_19

Extract readout and CNOT errors and compute swap costs .


def
Func
(
arg_0
)
:
arg_1
=
time
.
time
(
)
arg_2
=
arg_1
+
FILE_IO_TIMEOUT
while
time
.
time
(
)
<
arg_2
:
try
:
with
open
(
arg_0
)
:
return
except
IOError
:
pass
raise
Timeout
(
"Waiting too long for %s."
%
arg_0
)

def Func(arg_0):
    """Wait until a file exists.

    :param filename: The name of the file to wait for.
    :type filename: string
    """
    arg_1 = time.time()
    arg_2 = arg_1 + FILE_IO_TIMEOUT
    while time.time() < arg_2:
        try:
            with open(arg_0):
                return
        except IOError:
            pass

    raise Timeout("Waiting too long for %s." % arg_0)


return {"$" + class_name: [self._json_convert(item) for item in obj]}

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : return { "$" + arg_2 : [ arg_0 . _json_convert ( arg_4 ) for arg_4 in arg_1 ] }

def Func(arg_0, arg_1, arg_2=arg_3):
        """
        ``set`` dumper.
        """
        return {"$" + arg_2: [arg_0._json_convert(arg_4) for arg_4 in arg_1]}


(self, expected_fn, expected_lines, obtained_fn, obtained_lines)

return differ.make_file(
            fromlines=expected_lines,
            fromdesc=expected_fn,
            tolines=obtained_lines,
            todesc=obtained_fn,
        )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : import difflib arg_5 = difflib . HtmlDiff ( ) return arg_5 . make_file ( fromlines = arg_2 , fromdesc = arg_1 , tolines = arg_4 , todesc = arg_3 , )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Returns a nice side-by-side diff of the given files, as a string.

        """
        import difflib
        arg_5 = difflib.HtmlDiff()
        return arg_5.make_file(
            fromlines=arg_2,
            fromdesc=arg_1,
            tolines=arg_4,
            todesc=arg_3,
        )

Returns a nice side - by - side diff of the given files as a string .


def Func(arg_0):
        ''' Deletes itself if find queue name or topic name and subscription
        name. '''
        if arg_0._queue_name:
            arg_0.service_bus_service.Func_queue_message(
                arg_0._queue_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        elif arg_0._topic_name and arg_0._subscription_name:
            arg_0.service_bus_service.Func_subscription_message(
                arg_0._topic_name,
                arg_0._subscription_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        else:
            raise AzureServiceBusPeekLockError(_ERROR_MESSAGE_NOT_PEEK_LOCKED_ON_DELETE)

Deletes itself if find queue name or topic name and subscription name .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = "" ) : if arg_0 is None : return arg_3 if arg_1 in [ int , _binary_type , _text_type ] : return "{0}" . format ( arg_0 ) elif arg_1 is float : return format ( float ( arg_0 ) , arg_2 ) else : return "{0}" . format ( arg_0 )


def Func ( arg_0 ) : class Capture ( object ) : def __init__ ( arg_0 , arg_1 ) : arg_0 . satchel = arg_1 arg_0 . _dryrun = arg_0 . satchel . dryrun arg_0 . satchel . dryrun = 1 begincap ( ) arg_0 . _stdout = arg_11 . stdout arg_0 . _stderr = arg_11 . stderr arg_0 . stdout = arg_11 . stdout = StringIO ( ) arg_0 . stderr = arg_11 . stderr = StringIO ( ) def __enter__ ( arg_0 ) : return arg_0 def __exit__ ( arg_0 , arg_8 , arg_9 , arg_10 ) : endcap ( ) arg_0 . satchel . dryrun = arg_0 . _dryrun arg_11 . stdout = arg_0 . _stdout arg_11 . stderr = arg_0 . _stderr return Capture ( arg_0 )

def Func(arg_0):
        """
        Context manager that hides the command prefix and activates dryrun to capture all following task commands to their equivalent Bash outputs.
        """
        class Capture(object):

            def __init__(arg_0, arg_1):
                arg_0.satchel = arg_1
                arg_0._dryrun = arg_0.satchel.dryrun
                arg_0.satchel.dryrun = 1
                begincap()
                arg_0._stdout = arg_11.stdout
                arg_0._stderr = arg_11.stderr
                arg_0.stdout = arg_11.stdout = StringIO()
                arg_0.stderr = arg_11.stderr = StringIO()

            def __enter__(arg_0):
                return arg_0

            def __exit__(arg_0, arg_8, arg_9, arg_10): # pylint: disable=redefined-builtin
                endcap()
                arg_0.satchel.dryrun = arg_0._dryrun
                arg_11.stdout = arg_0._stdout
                arg_11.stderr = arg_0._stderr

        return Capture(arg_0)

Context manager that hides the command prefix and activates dryrun to capture all following task commands to their equivalent Bash outputs .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : arg_0 [ arg_2 ] = { 'meta' : { 'title' : arg_1 [ arg_2 ] [ 'title' ] } } return arg_0

def Func(arg_0, arg_1):
    """ Compose the projects JSON file only with the projects name

    :param projects: projects.json
    :param data: eclipse JSON with the origin format
    :return: projects.json with titles
    """
    for arg_2 in arg_1:
        arg_0[arg_2] = {
            'meta': {
                'title': arg_1[arg_2]['title']
            }
        }
    return arg_0


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . transform ( arg_1 ) if isinstance ( arg_2 , dict ) : arg_2 = sorted ( arg_2 . items ( ) ) if isinstance ( arg_2 , ( TT . TensorVariable , SS . SparseVariable ) ) : arg_2 = [ ( 'out' , arg_2 ) ] arg_4 = { arg_0 . full_name ( name ) : expr for name , expr in arg_2 } return arg_4 , arg_3

def Func(arg_0, arg_1):
        '''Create Theano variables representing the outputs of this layer.

        Parameters
        ----------
        inputs : dict of Theano expressions
            Symbolic inputs to this layer, given as a dictionary mapping string
            names to Theano expressions. Each string key should be of the form
            "{layer_name}:{output_name}" and refers to a specific output from
            a specific layer in the graph.

        Returns
        -------
        outputs : dict
            A dictionary mapping names to Theano expressions for the outputs
            from this layer.
        updates : sequence of (parameter, expression) tuples
            Updates that should be performed by a Theano function that computes
            something using this layer.
        '''
        arg_2, arg_3 = arg_0.transform(arg_1)
        # transform the outputs to be a list of ordered pairs if needed.
        if isinstance(arg_2, dict):
            arg_2 = sorted(arg_2.items())
        if isinstance(arg_2, (TT.TensorVariable, SS.SparseVariable)):
            arg_2 = [('out', arg_2)]
        arg_4 = {arg_0.full_name(name): expr for name, expr in arg_2}
        return arg_4, arg_3

Create Theano variables representing the outputs of this layer .


def Func(arg_0, arg_1):
    """Parse a list of matchmaker matches objects and returns
       a readable list of matches to display in matchmaker matches view.

    Args:
        patient_id(str): id of a mme patient
        match_objs(list): list of match objs returned by MME server for the patient
                # match_objs looks like this:
                    [
                        {
                            'node' : { id : node_id , label: node_label},
                            'patients' : [
                                { 'patient': {patient1_data} },
                                { 'patient': {patient2_data} },
                                ..
                            ]
                        },
                        ..
                    ]

    Returns:
        parsed_matches(list): a list of parsed match objects

    """
    LOG.info('Parsing MatchMaker matches for patient {}'.format(arg_0))
    arg_2 = []

    for arg_3 in arg_1:

        # convert match date from millisecond to readable date
        arg_4 = arg_3['created']['$date']
        arg_5 = datetime.datetime.fromtimestamp(arg_4/1000.0)
        arg_6 = 'external'
        arg_7 = []

        arg_8 = {
            'match_oid' : arg_3['_id']['$oid'],# save match object ID
            'match_date' : arg_5
        }

        # if patient was used as query patient:
        if arg_3['data']['patient']['id'] == arg_0:
            arg_9 = arg_3['results'] # List of matching patients
            for arg_10 in arg_9:
                if arg_3['match_type'] == 'internal':
                    arg_6 = 'internal'

                for arg_11 in arg_10['patients']:
                    arg_12 = {
                        'patient_id' : arg_11['patient']['id'],
                        'score' : arg_11['score'],
                        'patient' : arg_11['patient'],
                        'node' : arg_10['node']
                    }
                    arg_7.append(arg_12)

        else: # else if patient was returned as a match result for another patient
            arg_13 = arg_3['data']['patient']
            arg_14 = arg_13['contact'].get('institution')
            if arg_14 and 'Scout software user' in arg_14:
                arg_6 = 'internal'

            # loop over match results to capture score for matching
            arg_15 = None
            for arg_16 in arg_3['results']:
                for arg_11 in arg_16['patients']:
                    LOG.info('Looping in else, patient:{}'.format(arg_11['patient']['id']))
                    if arg_11['patient']['id'] == arg_0:

                        arg_15 = arg_11['score']
                        arg_12 = {
                            'patient_id' : arg_13['id'],
                            'score' : arg_15,
                            'patient' : arg_13,
                            'node' : arg_16['node']
                        }
                        arg_7.append(arg_12)

        arg_8['match_type'] = arg_6
        arg_8['patients'] = arg_7
        arg_2.append(arg_8)

    # sort results by descending score
    arg_2 = sorted(arg_2, key=lambda k: k['match_date'], reverse=True)
    return arg_2

Parse a list of matchmaker matches objects and returns a readable list of matches to display in matchmaker matches view .


return (b"SHA256:" + base64.b64encode(fp_plain).replace(b"=", b"")).decode("utf-8")

def Func ( arg_0 ) : arg_1 = hashlib . sha256 ( arg_0 . _decoded_key ) . digest ( ) return ( b"SHA256:" + base64 . b64encode ( arg_1 ) . replace ( b"=" , b"" ) ) . decode ( "utf-8" )

def Func(arg_0):
        """Calculate sha256 fingerprint."""
        arg_1 = hashlib.sha256(arg_0._decoded_key).digest()
        return (b"SHA256:" + base64.b64encode(arg_1).replace(b"=", b"")).decode("utf-8")


def Func(arg_0, arg_1, arg_2=False):
    '''
        Func - Searches a given pid's cwd for a given pattern

            @param pid <int> - A running process ID on this system
            @param searchPortion <str> - Any portion of directory to search
            @param isExactMatch <bool> Default False - If match should be exact, otherwise a partial match is performed.

            @return <dict> - If result is found, the following dict is returned. If no match found on the given pid, or pid is not found running, None is returned.
                {
                    'searchPortion' : The passed search pattern
                    'pid'           : The passed pid (as an integer)
                    'owner'         : String of process owner, or uid if no mapping can be found, or "unknown" if neither could be determined.
                    'cmdline'       : Commandline string
                    'cwd'           : The exact cwd of matched process
                }
    '''
    try:
        try:
            arg_0 = int(arg_0)
        except ValueError as e:
            sys.stderr.write('Expected an integer, got %s for pid.\n' %(str(type(arg_0)),))
            raise e

        arg_3 = getProcessCwd(arg_0)
        if not arg_3:
            return None

        arg_4 = False
        if arg_2 is True:
            if arg_1 == arg_3:
                arg_4 = True
            else:
                if arg_1.endswith('/') and arg_1[:-1] == arg_3:
                    arg_4 = True
        else:
            if arg_1 in arg_3:
                arg_4 = True
            else:
                if arg_1.endswith('/') and arg_1[:-1] in arg_3:
                    arg_4 = True

        if not arg_4:
            return None

        arg_5 = getProcessCommandLineStr(arg_0)
        arg_6   = getProcessOwnerStr(arg_0)

        return {
            'searchPortion' : arg_1,
            'pid'           : arg_0,
            'owner'         : arg_6,
            'cmdline'       : arg_5,
            'cwd'           : arg_3,
        }
    except OSError:
        return None
    except IOError:
        return None
    except FileNotFoundError:
        return None
    except PermissionError:
        return None

scanProcessForCwd - Searches a given pid's cwd for a given pattern

            @param pid <int> - A running process ID on this system
            @param searchPortion <str> - Any portion of directory to search
            @param isExactMatch <bool> Default False - If match should be exact, otherwise a partial match is performed.

            @return <dict> - If result is found, the following dict is returned. If no match found on the given pid, or pid is not found running, None is returned.
                {
                    'searchPortion' : The passed search pattern
                    'pid'           : The passed pid (as an integer)
                    'owner'         : String of process owner, or uid if no mapping can be found, or "unknown" if neither could be determined.
                    'cmdline'       : Commandline string
                    'cwd'           : The exact cwd of matched process
                }

scanProcessForCwd - Searches a given pid s cwd for a given pattern


def Func(arg_0, arg_1, arg_2):
        """
        Sends a message to a user as an IM

        * user - The user to send to.  This can be a SlackUser object, a user id, or the username (without the @)
        * text - String to send
        """
        if isinstance(arg_1, SlackUser):
            arg_1 = arg_1.id
            arg_3 = arg_0._find_im_channel(arg_1)
        else:
            arg_3 = arg_1.id
        arg_0.send_message(arg_3, arg_2)


def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : if isinstance ( arg_0 . parms [ "center" ] , ( tuple , list ) ) : arg_0 . _means = arg_0 . parms [ "center" ] if isinstance ( arg_0 . parms [ "scale" ] , ( tuple , list ) ) : arg_0 . _stds = arg_0 . parms [ "scale" ] if arg_0 . means is None and arg_0 . parms [ "center" ] : arg_0 . _means = arg_1 . mean ( return_frame = True ) . getrow ( ) else : arg_0 . _means = False if arg_0 . stds is None and arg_0 . parms [ "scale" ] : arg_0 . _stds = arg_1 . sd ( ) else : arg_0 . _stds = False return arg_0

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """
        Fit this object by computing the means and standard deviations used by the transform method.

        :param X: An H2OFrame; may contain NAs and/or categoricals.
        :param y: None (Ignored)
        :param params: Ignored
        :returns: This H2OScaler instance
        """
        if isinstance(arg_0.parms["center"], (tuple, list)): arg_0._means = arg_0.parms["center"]
        if isinstance(arg_0.parms["scale"], (tuple, list)): arg_0._stds = arg_0.parms["scale"]
        if arg_0.means is None and arg_0.parms["center"]:
            arg_0._means = arg_1.mean(return_frame=True).getrow()
        else:
            arg_0._means = False
        if arg_0.stds is None and arg_0.parms["scale"]:
            arg_0._stds = arg_1.sd()
        else:
            arg_0._stds = False
        return arg_0

Fit this object by computing the means and standard deviations used by the transform method .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , default_name = 'get_mixing_indices' , values = [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 ) arg_3 = arg_0 . dtype arg_4 = distributions . SeedStream ( arg_1 , salt = 'get_mixing_indices' ) arg_5 = tf . random . uniform ( [ arg_0 ] , maxval = arg_0 - 1 , arg_3 = arg_3 , arg_1 = arg_4 ( ) ) arg_6 = tf . random . uniform ( [ arg_0 ] , maxval = arg_0 - 2 , arg_3 = arg_3 , arg_1 = arg_4 ( ) ) arg_7 = tf . random . uniform ( [ arg_0 ] , maxval = arg_0 - 3 , arg_3 = arg_3 , arg_1 = arg_4 ( ) ) arg_6 = tf . where ( arg_5 < arg_6 , x = arg_6 , y = arg_6 + 1 ) arg_8 = tf . math . minimum ( arg_5 , arg_6 ) arg_9 = tf . math . maximum ( arg_5 , arg_6 ) arg_7 = tf . where ( arg_7 < arg_8 , x = arg_7 , y = arg_7 + 1 ) arg_7 = tf . where ( arg_7 < arg_9 , x = arg_7 , y = arg_7 + 1 ) arg_10 = tf . stack ( [ arg_5 , arg_6 , arg_7 ] , axis = 1 ) arg_11 = tf . expand_dims ( tf . range ( arg_0 ) , axis = - 1 ) arg_10 = tf . where ( arg_10 < arg_11 , x = arg_10 , y = arg_10 + 1 ) return arg_10

def Func(arg_0, arg_1=None, arg_2=None):
  """Generates an array of indices suitable for mutation operation.

  The mutation operation in differential evolution requires that for every
  element of the population, three distinct other elements be chosen to produce
  a trial candidate. This function generates an array of shape [size, 3]
  satisfying the properties that:
    (a). array[i, :] does not contain the index 'i'.
    (b). array[i, :] does not contain any overlapping indices.
    (c). All elements in the array are between 0 and size - 1 inclusive.

  Args:
    size: Scalar integer `Tensor`. The number of samples as well as a the range
      of the indices to sample from.
    seed: `int` or None. The random seed for this `Op`. If `None`, no seed is
      applied.
      Default value: `None`.
    name:  Python `str` name prefixed to Ops created by this function.
      Default value: 'get_mixing_indices'.

  Returns:
    sample: A `Tensor` of shape [size, 3] and same dtype as `size` containing
    samples without replacement between 0 and size - 1 (inclusive) with the
    `i`th row not including the number `i`.
  """
  with tf.compat.v1.name_scope(
      arg_2, default_name='get_mixing_indices', values=[arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0)
    arg_3 = arg_0.dtype
    arg_4 = distributions.SeedStream(arg_1, salt='get_mixing_indices')
    arg_5 = tf.random.uniform([arg_0],
                              maxval=arg_0-1,
                              arg_3=arg_3,
                              arg_1=arg_4())
    arg_6 = tf.random.uniform([arg_0],
                               maxval=arg_0-2,
                               arg_3=arg_3,
                               arg_1=arg_4())
    arg_7 = tf.random.uniform([arg_0],
                              maxval=arg_0-3,
                              arg_3=arg_3,
                              arg_1=arg_4())

    # Shift second if it is on top of or to the right of first
    arg_6 = tf.where(arg_5 < arg_6, x=arg_6, y=arg_6 + 1)
    arg_8 = tf.math.minimum(arg_5, arg_6)
    arg_9 = tf.math.maximum(arg_5, arg_6)
    # Shift the third one so it does not coincide with either the first or the
    # second number. Assuming first < second, shift by 1 if the number is in
    # [first, second) and by 2 if the number is greater than or equal to the
    # second.
    arg_7 = tf.where(arg_7 < arg_8, x=arg_7, y=arg_7 + 1)
    arg_7 = tf.where(arg_7 < arg_9, x=arg_7, y=arg_7 + 1)
    arg_10 = tf.stack([arg_5, arg_6, arg_7], axis=1)
    arg_11 = tf.expand_dims(tf.range(arg_0), axis=-1)
    arg_10 = tf.where(arg_10 < arg_11, x=arg_10, y=arg_10 + 1)
    return arg_10

Generates an array of indices suitable for mutation operation .


def
Func
(
arg_0
)
:
assert
'\\'
not
in
arg_0
assert
'('
not
in
arg_0
assert
')'
not
in
arg_0
assert
';'
not
in
arg_0
if
arg_0
.
lstrip
(
)
.
startswith
(
(
'import'
,
'from'
)
)
:
arg_1
=
arg_0
.
split
(
)
[
1
]
else
:
return
arg_2
=
arg_1
.
split
(
'.'
)
[
0
]
assert
' '
not
in
arg_2
return
arg_2

def Func(arg_0):
    """Return package name in import statement."""
    assert '\\' not in arg_0
    assert '(' not in arg_0
    assert ')' not in arg_0
    assert ';' not in arg_0

    if arg_0.lstrip().startswith(('import', 'from')):
        arg_1 = arg_0.split()[1]
    else:
        # Ignore doctests.
        return None

    arg_2 = arg_1.split('.')[0]
    assert ' ' not in arg_2

    return arg_2

Return package name in import statement .


(self, x_analyte, y_analyte, window=15, filt=True, recalc=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 15 , arg_4 = True , arg_5 = True ) : arg_6 = '{:}_{:}_{:.0f}' . format ( arg_1 , arg_2 , arg_3 ) if arg_6 in arg_0 . correlations and not arg_5 : return if arg_3 % 2 != 1 : arg_3 += 1 arg_7 = arg_0 . filt . grab_filt ( arg_4 , [ arg_1 , arg_2 ] ) arg_8 = nominal_values ( arg_0 . focus [ arg_1 ] ) arg_8 [ ~ arg_7 ] = np . nan arg_9 = rolling_window ( arg_8 , arg_3 , pad = np . nan ) arg_10 = nominal_values ( arg_0 . focus [ arg_2 ] ) arg_10 [ ~ arg_7 ] = np . nan arg_11 = rolling_window ( arg_10 , arg_3 , pad = np . nan ) arg_12 , arg_13 = zip ( * map ( nan_pearsonr , arg_9 , arg_11 ) ) arg_12 = np . array ( arg_12 ) arg_13 = np . array ( arg_13 ) arg_0 . correlations [ arg_6 ] = arg_12 , arg_13 return

def Func(arg_0, arg_1, arg_2, arg_3=15, arg_4=True, arg_5=True):
        """
        Calculate local correlation between two analytes.

        Parameters
        ----------
        x_analyte, y_analyte : str
            The names of the x and y analytes to correlate.
        window : int, None
            The rolling window used when calculating the correlation.
        filt : bool
            Whether or not to apply existing filters to the data before
            calculating this filter.
        recalc : bool
            If True, the correlation is re-calculated, even if it is already present.

        Returns
        -------
        None
        """
        arg_6 = '{:}_{:}_{:.0f}'.format(arg_1, arg_2, arg_3)

        if arg_6 in arg_0.correlations and not arg_5:
            return

        # make window odd
        if arg_3 % 2 != 1:
            arg_3 += 1

        # get filter
        arg_7 = arg_0.filt.grab_filt(arg_4, [arg_1, arg_2])

        arg_8 = nominal_values(arg_0.focus[arg_1])
        arg_8[~arg_7] = np.nan
        arg_9 = rolling_window(arg_8, arg_3, pad=np.nan)

        arg_10 = nominal_values(arg_0.focus[arg_2])
        arg_10[~arg_7] = np.nan
        arg_11 = rolling_window(arg_10, arg_3, pad=np.nan)

        arg_12, arg_13 = zip(*map(nan_pearsonr, arg_9, arg_11))

        arg_12 = np.array(arg_12)
        arg_13 = np.array(arg_13)

        # save correlation info

        arg_0.correlations[arg_6] = arg_12, arg_13
        return

Calculate local correlation between two analytes .


def Func ( arg_0 ) : def wrapper ( arg_1 : arg_2 , arg_3 : arg_4 . ndarray , * arg_6 , ** arg_7 ) : if not hasattr ( arg_1 , "cache" ) : arg_1 . cache = { } arg_9 = ( arg_0 . __name__ , arg_3 . tobytes ( ) ) if arg_9 not in arg_1 . cache : arg_1 . cache [ arg_9 ] = arg_0 ( arg_1 , arg_3 ) return arg_1 . cache [ arg_9 ] return wrapper

def Func(arg_0):
    """
    Caches results of a call to a grid function. If a grid that evaluates to the same byte value is passed into the same
    function of the same instance as previously then the cached result is returned.

    Parameters
    ----------
    func
        Some instance method that takes a grid as its argument

    Returns
    -------
    result
        Some result, either newly calculated or recovered from the cache
    """

    def wrapper(arg_1: arg_2, arg_3: arg_4.ndarray, *arg_6, **arg_7):
        if not hasattr(arg_1, "cache"):
            arg_1.cache = {}
        arg_9 = (arg_0.__name__, arg_3.tobytes())
        if arg_9 not in arg_1.cache:
            arg_1.cache[arg_9] = arg_0(arg_1, arg_3)
        return arg_1.cache[arg_9]

    return wrapper

Caches results of a call to a grid function . If a grid that evaluates to the same byte value is passed into the same function of the same instance as previously then the cached result is returned .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
,
arg_4
=
get_build_or_local
(
arg_0
.
obj
.
get
(
'project'
)
,
arg_0
.
obj
.
get
(
'build'
)
)
if
not
arg_1
and
not
click
.
confirm
(
"Are sure you want to Func "
"job `{}`"
.
format
(
arg_4
)
)
:
click
.
echo
(
'Existing without Funcping build job.'
)
sys
.
exit
(
0
)
try
:
PolyaxonClient
(
)
.
build_job
.
Func
(
arg_2
,
arg_3
,
arg_4
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func build job `{}`.'
.
format
(
arg_4
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Printer
.
print_success
(
"Build job is being Funcped."
)

def Func(arg_0, arg_1):
    """Stop build job.

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

    Examples:

    \b
    ```bash
    $ polyaxon build Func
    ```

    \b
    ```bash
    $ polyaxon build -b 2 Func
    ```
    """
    arg_2, arg_3, arg_4 = get_build_or_local(arg_0.obj.get('project'), arg_0.obj.get('build'))
    if not arg_1 and not click.confirm("Are sure you want to Func "
                                     "job `{}`".format(arg_4)):
        click.echo('Existing without Funcping build job.')
        sys.exit(0)

    try:
        PolyaxonClient().build_job.Func(arg_2, arg_3, arg_4)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func build job `{}`.'.format(arg_4))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Build job is being Funcped.")

Stop build job.

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

    Examples:

    \b
    ```bash
    $ polyaxon build stop
    ```

    \b
    ```bash
    $ polyaxon build -b 2 stop
    ```


def Func ( arg_0 ) : arg_1 = 0 arg_2 = arg_0 . spouts ( ) + arg_0 . bolts ( ) for arg_3 in arg_2 : arg_4 = arg_3 . comp . config for arg_5 in arg_4 . kvs : if arg_5 . key == api_constants . TOPOLOGY_COMPONENT_PARALLELISM : arg_1 += int ( arg_5 . value ) break return arg_1

def Func(arg_0):
    """
    Number of spouts + bolts
    """
    arg_1 = 0

    # Get all the components
    arg_2 = arg_0.spouts() + arg_0.bolts()

    # Get instances for each worker
    for arg_3 in arg_2:
      arg_4 = arg_3.comp.config
      for arg_5 in arg_4.kvs:
        if arg_5.key == api_constants.TOPOLOGY_COMPONENT_PARALLELISM:
          arg_1 += int(arg_5.value)
          break

    return arg_1


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in zip ( arg_0 . __metrics , arg_0 . __metricLabels ) : arg_4 = arg_2 . getMetric ( ) arg_1 [ arg_3 ] = arg_4 [ 'value' ] return arg_1

def Func(arg_0):
    """
    Gets the current metric values

    :returns: (dict) where each key is the metric-name, and the values are
              it scalar value. Same as the output of
              :meth:`~nupic.frameworks.opf.prediction_metrics_manager.MetricsManager.update`
    """

    arg_1 = {}

    for arg_2, arg_3 in zip(arg_0.__metrics, arg_0.__metricLabels):
      arg_4 = arg_2.getMetric()
      arg_1[arg_3] = arg_4['value']

    return arg_1


def Func ( arg_0 , arg_1 = 512 ) : Func = TCPBatchClient ( arg_0 . host , arg_0 . port , arg_0 . prefix , arg_1 ) arg_0 . _configure_client ( Func ) return Func

def Func(arg_0, arg_1=512):
        # type: (int) -> TCPBatchClient
        """Return a TCP batch client with same settings of the TCP client"""

        Func = TCPBatchClient(arg_0.host, arg_0.port, arg_0.prefix, arg_1)
        arg_0._configure_client(Func)
        return Func


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
super
(
TokenAuthentication
,
arg_0
)
.
Func
(
arg_1
)
if
arg_3
.
expires
<
timezone
.
now
(
)
:
arg_4
=
_
(
'Token has expired.'
)
raise
exceptions
.
AuthenticationFailed
(
arg_4
)
arg_3
.
update_expiry
(
)
return
(
arg_2
,
arg_3
)

def Func(arg_0, arg_1):
        """Custom authentication to check if auth token has expired."""
        arg_2, arg_3 = super(TokenAuthentication, arg_0).Func(arg_1)

        if arg_3.expires < timezone.now():
            arg_4 = _('Token has expired.')
            raise exceptions.AuthenticationFailed(arg_4)

        # Update the token's expiration date
        arg_3.update_expiry()

        return (arg_2, arg_3)

Custom authentication to check if auth token has expired .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] arg_4 = 0 for arg_5 in arg_1 : if isinstance ( arg_5 , Future ) : if arg_0 . tasks [ arg_5 . tid ] [ 'status' ] not in FINAL_STATES : arg_4 += 1 arg_3 . extend ( [ arg_5 ] ) for arg_6 in arg_2 : arg_5 = arg_2 [ arg_6 ] if isinstance ( arg_5 , Future ) : if arg_0 . tasks [ arg_5 . tid ] [ 'status' ] not in FINAL_STATES : arg_4 += 1 arg_3 . extend ( [ arg_5 ] ) for arg_5 in arg_2 . get ( 'inputs' , [ ] ) : if isinstance ( arg_5 , Future ) : if arg_0 . tasks [ arg_5 . tid ] [ 'status' ] not in FINAL_STATES : arg_4 += 1 arg_3 . extend ( [ arg_5 ] ) return arg_4 , arg_3

def Func(arg_0, arg_1, arg_2):
        """Count the number of unresolved futures on which a task depends.

        Args:
            - args (List[args]) : The list of args list to the fn
            - kwargs (Dict{kwargs}) : The dict of all kwargs passed to the fn

        Returns:
            - count, [list of dependencies]

        """
        # Check the positional args
        arg_3 = []
        arg_4 = 0
        for arg_5 in arg_1:
            if isinstance(arg_5, Future):
                if arg_0.tasks[arg_5.tid]['status'] not in FINAL_STATES:
                    arg_4 += 1
                arg_3.extend([arg_5])

        # Check for explicit kwargs ex, fu_1=<fut>
        for arg_6 in arg_2:
            arg_5 = arg_2[arg_6]
            if isinstance(arg_5, Future):
                if arg_0.tasks[arg_5.tid]['status'] not in FINAL_STATES:
                    arg_4 += 1
                arg_3.extend([arg_5])

        # Check for futures in inputs=[<fut>...]
        for arg_5 in arg_2.get('inputs', []):
            if isinstance(arg_5, Future):
                if arg_0.tasks[arg_5.tid]['status'] not in FINAL_STATES:
                    arg_4 += 1
                arg_3.extend([arg_5])

        return arg_4, arg_3

Count the number of unresolved futures on which a task depends .


def Func(arg_0):
    """
    Generate indexes and run server from the given directory downwards.
    @param {String} dir_path - The directory path (absolute, or relative to CWD)
    @return {None}
    """
    # Create index files, and store the list of their paths for cleanup later
    # This time, force no processing - this gives us a fast first-pass in terms
    # of page generation, but potentially slow serving for large image files
    print('Performing first pass index file generation')
    arg_1 = _create_index_files(arg_0, True)
    if (PIL_ENABLED):
        # If PIL is enabled, we'd like to process the HTML indexes to include
        # generated thumbnails - this slows down generation so we don't do it
        # first time around, but now we're serving it's good to do in the
        # background
        print('Performing PIL-enchanced optimised index file generation in background')
        arg_2 = BackgroundIndexFileGenerator(arg_0)
        arg_2.run()
    # Run the server in the current location - this blocks until it's stopped
    _run_server()
    # Clean up the index files created earlier so we don't make a mess of
    # the image directories
    _clean_up(arg_1)

Generate indexes and run server from the given directory downwards .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = TextQuery ( * arg_1 , ** arg_2 ) @ arg_0 . synchronize ( wait = arg_3 . wait ) def Func ( ) : arg_4 = arg_3 . resolve_for ( arg_0 ) if matches_count ( arg_4 , arg_3 . options ) and ( arg_4 > 0 or expects_none ( arg_3 . options ) ) : raise ExpectationNotMet ( arg_3 . negative_failure_message ) return True return Func ( )

def Func(arg_0, *arg_1, **arg_2):
        """
        Asserts that the page or current node doesn't have the given text content, ignoring any
        HTML tags.

        Args:
            *args: Variable length argument list for :class:`TextQuery`.
            **kwargs: Arbitrary keyword arguments for :class:`TextQuery`.

        Returns:
            True

        Raises:
            ExpectationNotMet: If the assertion hasn't succeeded during the wait time.
        """

        arg_3 = TextQuery(*arg_1, **arg_2)

        @arg_0.synchronize(wait=arg_3.wait)
        def Func():
            arg_4 = arg_3.resolve_for(arg_0)

            if matches_count(arg_4, arg_3.options) and (
                   arg_4 > 0 or expects_none(arg_3.options)):
                raise ExpectationNotMet(arg_3.negative_failure_message)

            return True

        return Func()

Asserts that the page or current node doesn t have the given text content ignoring any HTML tags .


return Image(width = x2 - x1, height = y2 - y1, content_scale = self._content_scale, handle = handle)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        '''Get an image that refers to the given rectangle within this image.  The image data is not actually
        copied; if the image region is rendered into, it will affect this image.

        :param int x1: left edge of the image region to return
        :param int y1: top edge of the image region to return
        :param int x2: right edge of the image region to return
        :param int y2: bottom edge of the image region to return
        :return: :class:`Image`
        '''
        arg_5 = c_int()
        lib.GetImageRegion(byref(arg_5), arg_0._handle, arg_1, arg_2, arg_3, arg_4)
        return Image(width = arg_3 - arg_1, height = arg_4 - arg_2, content_scale = arg_0._content_scale, arg_5 = arg_5)

Get an image that refers to the given rectangle within this image . The image data is not actually copied ; if the image region is rendered into it will affect this image .


return [(i, self._memory[i]) for i in chosen_idx]

def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 ) if arg_2 == 0 : return [ ] arg_3 = arg_0 . _memory [ 0 ] / arg_1 arg_4 = [ ] if abs ( arg_0 . _memory [ 0 ] ) < util . epsilon : arg_4 = np . random . randint ( arg_0 . _capacity - 1 , arg_0 . _capacity - 1 + len ( arg_0 ) , size = arg_1 ) . tolist ( ) else : for arg_5 in xrange ( arg_1 ) : arg_6 = max ( arg_5 * arg_3 , 0 ) arg_7 = min ( ( arg_5 + 1 ) * arg_3 , arg_0 . _memory [ 0 ] ) arg_8 = random . uniform ( arg_6 , arg_7 ) arg_4 . append ( arg_0 . _sample_with_priority ( arg_8 ) ) return [ ( arg_5 , arg_0 . _memory [ arg_5 ] ) for arg_5 in arg_4 ]

def Func(arg_0, arg_1):
        """
        Sample minibatch of size batch_size.
        """
        arg_2 = len(arg_0)
        if arg_2 == 0:
            return []

        arg_3 = arg_0._memory[0] / arg_1
        arg_4 = []
        # if all priorities sum to ~0  choose randomly otherwise random sample
        if abs(arg_0._memory[0]) < util.epsilon:
            arg_4 = np.random.randint(arg_0._capacity - 1, arg_0._capacity - 1 + len(arg_0), size=arg_1).tolist()
        else:
            for arg_5 in xrange(arg_1):
                arg_6 = max(arg_5 * arg_3, 0)
                arg_7 = min((arg_5 + 1) * arg_3, arg_0._memory[0])
                arg_8 = random.uniform(arg_6, arg_7)
                arg_4.append(arg_0._sample_with_priority(arg_8))
        return [(arg_5, arg_0._memory[arg_5]) for arg_5 in arg_4]


def Func ( arg_0 , arg_1 , arg_2 ) : from armet . resources . managed . request import read if arg_0 . slug is None : raise http . exceptions . NotImplemented ( ) arg_3 = arg_0 . read ( ) arg_4 = arg_0 . _parse_link_headers ( arg_1 [ 'Link' ] ) for Func in arg_4 : arg_0 . relate ( arg_3 , read ( arg_0 , Func [ 'uri' ] ) ) arg_0 . response . status = http . client . NO_CONTENT arg_0 . make_response ( )

def Func(arg_0, arg_1, arg_2):
        """Processes a `LINK` request.

        A `LINK` request is asking to create a relation from the currently
        represented URI to all of the `Link` request headers.
        """
        from armet.resources.managed.request import read

        if arg_0.slug is None:
            # Mass-LINK is not implemented.
            raise http.exceptions.NotImplemented()

        # Get the current target.
        arg_3 = arg_0.read()

        # Collect all the passed link headers.
        arg_4 = arg_0._parse_link_headers(arg_1['Link'])

        # Pull targets for each represented link.
        for Func in arg_4:
            # Delegate to a connector.
            arg_0.relate(arg_3, read(arg_0, Func['uri']))

        # Build the response object.
        arg_0.response.status = http.client.NO_CONTENT
        arg_0.make_response()


def
Func
(
arg_0
=
80
,
arg_1
=
4
)
:
def
format_binding
(
arg_2
,
arg_3
)
:
arg_4
=
pprint
.
pformat
(
arg_3
,
width
=
(
arg_0
arg_1
)
)
arg_5
=
arg_4
.
split
(
'\n'
)
if
(
len
(
arg_5
)
==
1
and
len
(
arg_2
+
arg_4
)
<=
arg_0
)
:
arg_6
=
'{} = {}'
.
format
(
arg_2
,
arg_4
)
else
:
arg_7
=
'\n'
.
join
(
[
' '
*
arg_1
+
line
for
line
in
arg_5
]
)
arg_6
=
'{} = \\\n{}'
.
format
(
arg_2
,
arg_7
)
return
arg_6
def
sort_key
(
arg_8
)
:
arg_9
,
arg_10
=
arg_8
[
0
]
arg_11
=
arg_10
.
lower
(
)
.
split
(
'.'
)
[
:
:
1
]
+
arg_9
.
lower
(
)
.
split
(
'/'
)
[
:
:
1
]
return
'/'
.
join
(
arg_11
)
arg_12
=
[
'import {}'
.
format
(
module
)
for
module
in
sorted
(
_IMPORTED_MODULES
)
]
if
arg_12
:
arg_12
.
append
(
''
)
arg_13
=
{
}
for
(
arg_9
,
arg_10
)
,
arg_14
in
six
.
iteritems
(
_OPERATIVE_CONFIG
)
:
if
_REGISTRY
[
arg_10
]
.
fn_or_cls
==
macro
:
arg_13
[
arg_9
,
arg_10
]
=
arg_14
if
arg_13
:
arg_12
.
append
(
'# Macros:'
)
arg_12
.
append
(
'# '
+
'='
*
(
arg_0
2
)
)
for
(
arg_15
,
arg_16
)
,
arg_14
in
sorted
(
arg_13
.
items
(
)
,
arg_2
=
sort_key
)
:
arg_17
=
format_binding
(
arg_15
,
arg_14
[
'value'
]
)
arg_12
.
append
(
arg_17
)
if
arg_13
:
arg_12
.
append
(
''
)
arg_18
=
sorted
(
_OPERATIVE_CONFIG
.
items
(
)
,
arg_2
=
sort_key
)
for
(
arg_9
,
arg_10
)
,
arg_14
in
arg_18
:
arg_19
=
_REGISTRY
[
arg_10
]
arg_20
=
arg_19
.
fn_or_cls
if
arg_20
==
macro
or
arg_20
==
_retrieve_constant
:
continue
arg_21
=
_REGISTRY
.
minimal_selector
(
arg_19
.
selector
)
arg_22
=
(
arg_9
+
'/'
if
arg_9
else
''
)
+
arg_21
arg_23
=
[
(
k
,
v
)
for
k
,
v
in
six
.
iteritems
(
arg_14
)
if
_is_literally_representable
(
v
)
]
arg_12
.
append
(
'# Parameters for {}:'
.
format
(
arg_22
)
)
arg_12
.
append
(
'# '
+
'='
*
(
arg_0
2
)
)
for
arg_24
,
arg_25
in
sorted
(
arg_23
)
:
arg_17
=
format_binding
(
'{}.{}'
.
format
(
arg_22
,
arg_24
)
,
arg_25
)
arg_12
.
append
(
arg_17
)
if
not
arg_23
:
arg_12
.
append
(
'# None.'
)
arg_12
.
append
(
''
)
return
'\n'
.
join
(
arg_12
)

def Func(arg_0=80, arg_1=4):
  """Retrieve the "operative" configuration as a config string.

  The operative configuration consists of all parameter values used by
  configurable functions that are actually called during execution of the
  current program. Parameters associated with configurable functions that are
  not called (and so can have no effect on program execution) won't be included.

  The goal of the function is to return a config that captures the full set of
  relevant configurable "hyperparameters" used by a program. As such, the
  returned configuration will include the default values of arguments from
  configurable functions (as long as the arguments aren't blacklisted or missing
  from a supplied whitelist), as well as any parameter values overridden via
  `bind_parameter` or through `parse_config`.

  Any parameters that can't be represented as literals (capable of being parsed
  by `parse_config`) are excluded. The resulting config string is sorted
  lexicographically and grouped by configurable name.

  Args:
    max_line_length: A (soft) constraint on the maximum length of a line in the
      formatted string. Large nested structures will be split across lines, but
      e.g. long strings won't be split into a concatenation of shorter strings.
    continuation_indent: The indentation for continued lines.

  Returns:
    A config string capturing all parameter values used by the current program.
  """
  def format_binding(arg_2, arg_3):
    """Pretty print the given key/value pair."""
    arg_4 = pprint.pformat(
        arg_3, width=(arg_0 - arg_1))
    arg_5 = arg_4.split('\n')
    if (len(arg_5) == 1 and
        len(arg_2 + arg_4) <= arg_0):
      arg_6 = '{} = {}'.format(arg_2, arg_4)
    else:
      arg_7 = '\n'.join(
          [' ' * arg_1 + line for line in arg_5])
      arg_6 = '{} = \\\n{}'.format(arg_2, arg_7)
    return arg_6

  def sort_key(arg_8):
    """Sort configurable selector/innermost scopes, ignoring case."""
    arg_9, arg_10 = arg_8[0]
    arg_11 = arg_10.lower().split('.')[::-1] + arg_9.lower().split('/')[::-1]
    return '/'.join(arg_11)

  # Build the output as an array of formatted Gin statements. Each statement may
  # span multiple lines. Imports are first, followed by macros, and finally all
  # other bindings sorted in alphabetical order by configurable name.
  arg_12 = [
      'import {}'.format(module) for module in sorted(_IMPORTED_MODULES)
  ]
  if arg_12:
    arg_12.append('')

  arg_13 = {}
  for (arg_9, arg_10), arg_14 in six.iteritems(_OPERATIVE_CONFIG):
    if _REGISTRY[arg_10].fn_or_cls == macro:
      arg_13[arg_9, arg_10] = arg_14
  if arg_13:
    arg_12.append('# Macros:')
    arg_12.append('# ' + '=' * (arg_0 - 2))
  for (arg_15, arg_16), arg_14 in sorted(arg_13.items(), arg_2=sort_key):
    arg_17 = format_binding(arg_15, arg_14['value'])
    arg_12.append(arg_17)
  if arg_13:
    arg_12.append('')

  arg_18 = sorted(_OPERATIVE_CONFIG.items(), arg_2=sort_key)
  for (arg_9, arg_10), arg_14 in arg_18:
    arg_19 = _REGISTRY[arg_10]

    arg_20 = arg_19.fn_or_cls
    if arg_20 == macro or arg_20 == _retrieve_constant:
      continue

    arg_21 = _REGISTRY.minimal_selector(arg_19.selector)
    arg_22 = (arg_9 + '/' if arg_9 else '') + arg_21
    arg_23 = [(k, v) for k, v in six.iteritems(arg_14)
                  if _is_literally_representable(v)]
    arg_12.append('# Parameters for {}:'.format(arg_22))
    arg_12.append('# ' + '=' * (arg_0 - 2))
    for arg_24, arg_25 in sorted(arg_23):
      arg_17 = format_binding('{}.{}'.format(arg_22, arg_24), arg_25)
      arg_12.append(arg_17)
    if not arg_23:
      arg_12.append('# None.')
    arg_12.append('')

  return '\n'.join(arg_12)

Retrieve the operative configuration as a config string .


def Func ( arg_0 , arg_1 ) : arg_0 . expire_in = arg_1 . get ( 'expires' ) if arg_1 . get ( 'token_type' ) == 'bearer' : arg_0 . token_type = 'Bearer' return arg_0

def Func(arg_0, arg_1):
        """
        We need to override this method to fix Facebooks naming deviation.
        """

        # Facebook returns "expires" instead of "expires_in".
        arg_0.expire_in = arg_1.get('expires')

        if arg_1.get('token_type') == 'bearer':
            # TODO: cls is not available here, hardcode for now.
            arg_0.token_type = 'Bearer'

        return arg_0

We need to override this method to fix Facebooks naming deviation .


def Func ( arg_0 , arg_1 = None , arg_2 = "jet" ) : arg_3 = arg_0 . to_uint8 ( ) arg_4 = [ ] for arg_5 in sm . xrange ( arg_3 . shape [ 2 ] ) : arg_6 = arg_3 [ ... , arg_5 : arg_5 + 1 ] if arg_1 is not None : arg_7 = ia . imresize_single_image ( arg_6 , arg_1 , interpolation = "nearest" ) else : arg_7 = arg_6 arg_7 = np . squeeze ( arg_7 ) . astype ( np . float32 ) / 255.0 if arg_2 is not None : import matplotlib . pyplot as plt arg_8 = plt . get_cmap ( arg_2 ) arg_9 = arg_8 ( arg_7 ) arg_9 = np . delete ( arg_9 , 3 , 2 ) else : arg_9 = np . tile ( arg_7 [ ... , np . newaxis ] , ( 1 , 1 , 3 ) ) arg_9 = np . clip ( arg_9 * 255 , 0 , 255 ) . astype ( np . uint8 ) arg_4 . append ( arg_9 ) return arg_4

def Func(arg_0, arg_1=None, arg_2="jet"):
        """
        Render the heatmaps as RGB images.

        Parameters
        ----------
        size : None or float or iterable of int or iterable of float, optional
            Size of the rendered RGB image as ``(height, width)``.
            See :func:`imgaug.imgaug.imresize_single_image` for details.
            If set to None, no resizing is performed and the size of the heatmaps array is used.

        cmap : str or None, optional
            Color map of ``matplotlib`` to use in order to convert the heatmaps to RGB images.
            If set to None, no color map will be used and the heatmaps will be converted
            to simple intensity maps.

        Returns
        -------
        heatmaps_Funcn : list of (H,W,3) ndarray
            Rendered heatmaps. One per heatmap array channel. Dtype is uint8.

        """
        arg_3 = arg_0.to_uint8()
        arg_4 = []

        for arg_5 in sm.xrange(arg_3.shape[2]):
            # c:c+1 here, because the additional axis is needed by imresize_single_image
            arg_6 = arg_3[..., arg_5:arg_5+1]

            if arg_1 is not None:
                arg_7 = ia.imresize_single_image(arg_6, arg_1, interpolation="nearest")
            else:
                arg_7 = arg_6
            arg_7 = np.squeeze(arg_7).astype(np.float32) / 255.0

            if arg_2 is not None:
                # import only when necessary (faster startup; optional dependency; less fragile -- see issue #225)
                import matplotlib.pyplot as plt

                arg_8 = plt.get_cmap(arg_2)
                arg_9 = arg_8(arg_7)
                arg_9 = np.delete(arg_9, 3, 2)
            else:
                arg_9 = np.tile(arg_7[..., np.newaxis], (1, 1, 3))

            arg_9 = np.clip(arg_9 * 255, 0, 255).astype(np.uint8)

            arg_4.append(arg_9)
        return arg_4

Render the heatmaps as RGB images.

        Parameters
        ----------
        size : None or float or iterable of int or iterable of float, optional
            Size of the rendered RGB image as ``(height, width)``.
            See :func:`imgaug.imgaug.imresize_single_image` for details.
            If set to None, no resizing is performed and the size of the heatmaps array is used.

        cmap : str or None, optional
            Color map of ``matplotlib`` to use in order to convert the heatmaps to RGB images.
            If set to None, no color map will be used and the heatmaps will be converted
            to simple intensity maps.

        Returns
        -------
        heatmaps_drawn : list of (H,W,3) ndarray
            Rendered heatmaps. One per heatmap array channel. Dtype is uint8.


(self, topic_name, subscription_name,
                            subscription=None, fail_on_exist=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = False ) : _validate_not_none ( 'topic_name' , arg_1 ) _validate_not_none ( 'subscription_name' , arg_2 ) arg_5 = HTTPRequest ( ) arg_5 . method = 'PUT' arg_5 . host = arg_0 . _get_host ( ) arg_5 . path = '/' + _str ( arg_1 ) + '/subscriptions/' + _str ( arg_2 ) + '' arg_5 . body = _get_request_body ( _convert_subscription_to_xml ( arg_3 ) ) arg_5 . path , arg_5 . query = arg_0 . _httpclient . _update_request_uri_query ( arg_5 ) arg_5 . headers = arg_0 . _update_service_bus_header ( arg_5 ) if not arg_4 : try : arg_0 . _perform_request ( arg_5 ) return True except AzureHttpError as ex : _dont_fail_on_exist ( ex ) return False else : arg_0 . _perform_request ( arg_5 ) return True

def Func(arg_0, arg_1, arg_2,
                            arg_3=None, arg_4=False):
        '''
        Creates a new subscription. Once created, this subscription resource
        manifest is immutable.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        fail_on_exist:
            Specify whether throw exception when subscription exists.
        '''
        _validate_not_none('topic_name', arg_1)
        _validate_not_none('subscription_name', arg_2)
        arg_5 = HTTPRequest()
        arg_5.method = 'PUT'
        arg_5.host = arg_0._get_host()
        arg_5.path = '/' + \
            _str(arg_1) + '/subscriptions/' + _str(arg_2) + ''
        arg_5.body = _get_request_body(
            _convert_subscription_to_xml(arg_3))
        arg_5.path, arg_5.query = arg_0._httpclient._update_request_uri_query(arg_5)  # pylint: disable=protected-access
        arg_5.headers = arg_0._update_service_bus_header(arg_5)
        if not arg_4:
            try:
                arg_0._perform_request(arg_5)
                return True
            except AzureHttpError as ex:
                _dont_fail_on_exist(ex)
                return False
        else:
            arg_0._perform_request(arg_5)
            return True

Creates a new subscription . Once created this subscription resource manifest is immutable .


def Func ( arg_0 ) : try : arg_0 . tag = arg_0 . tag . split ( '}' ) [ 1 ] except IndexError : pass for arg_2 in arg_0 . getchildren ( ) : Func ( arg_2 )

def Func(arg_0):
    """Strip out namespace data from an ElementTree.

    This function is recursive and will traverse all
    subnodes to the root element

    @param root: the root element

    @return: the same root element, minus namespace
    """
    try:
        arg_0.tag = arg_0.tag.split('}')[1]
    except IndexError:
        pass

    for arg_2 in arg_0.getchildren():
        Func(arg_2)

Strip out namespace data from an ElementTree .


def Func ( arg_0 , arg_1 , * , arg_2 = 'artist' ) : arg_3 = Route ( 'GET' , '/me/following/contains' ) arg_4 = { 'ids' : arg_1 , 'type' : arg_2 } return arg_0 . request ( arg_3 , params = arg_4 )

def Func(arg_0, arg_1, *, arg_2='artist'):
        """Check to see if the current user is following one or more artists or other Spotify users.

        Parameters
        ----------
        ids : List[str]
            A comma-separated list of the artist or the user Spotify IDs to check.
            A maximum of 50 IDs can be sent in one request.
        type : Optional[str]
            The ID type: either "artist" or "user".
            Default: "artist"
        """
        arg_3 = Route('GET', '/me/following/contains')
        arg_4 = {'ids': arg_1, 'type': arg_2}

        return arg_0.request(arg_3, params=arg_4)

Check to see if the current user is following one or more artists or other Spotify users .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
[
"sprint"
]
arg_3
=
arg_1
[
"error"
]
arg_2
(
"Call to Func issued"
,
level
=
"verbose"
)
if
not
arg_0
:
arg_3
(
"Sakefile is empty"
)
return
False
if
len
(
arg_0
.
keys
(
)
)
!=
len
(
set
(
arg_0
.
keys
(
)
)
)
:
arg_3
(
"Sakefile contains duplicate targets"
)
return
False
for
arg_4
in
arg_0
:
if
arg_4
==
"all"
:
if
not
check_target_integrity
(
arg_4
,
arg_0
[
"all"
]
,
all
=
True
)
:
arg_3
(
"Failed to accept target 'all'"
)
return
False
continue
if
"formula"
not
in
arg_0
[
arg_4
]
:
if
not
check_target_integrity
(
arg_4
,
arg_0
[
arg_4
]
,
meta
=
True
)
:
arg_5
=
"Failed to accept meta-target '{}'"
.
format
(
arg_4
)
arg_3
(
arg_5
)
return
False
for
arg_6
in
arg_0
[
arg_4
]
:
if
arg_6
==
"help"
:
continue
if
not
check_target_integrity
(
arg_6
,
arg_0
[
arg_4
]
[
arg_6
]
,
parent
=
arg_4
)
:
arg_5
=
"Failed to accept target '{}'\n"
.
format
(
arg_6
)
arg_3
(
arg_5
)
return
False
continue
if
not
check_target_integrity
(
arg_4
,
arg_0
[
arg_4
]
)
:
arg_5
=
"Failed to accept target '{}'\n"
.
format
(
arg_4
)
arg_3
(
arg_5
)
return
False
return
True

def Func(arg_0, arg_1):
    """
    Checks the format of the sakefile dictionary
    to ensure it conforms to specification

    Args:
        A dictionary that is the parsed Sakefile (from sake.py)
        The setting dictionary (for print functions)
    Returns:
        True if the Sakefile is conformant
        False if not
    """
    arg_2 = arg_1["sprint"]
    arg_3 = arg_1["error"]
    arg_2("Call to Func issued", level="verbose")
    if not arg_0:
        arg_3("Sakefile is empty")
        return False
    # checking for duplicate targets
    if len(arg_0.keys()) != len(set(arg_0.keys())):
        arg_3("Sakefile contains duplicate targets")
        return False
    for arg_4 in arg_0:
        if arg_4 == "all":
            if not check_target_integrity(arg_4, arg_0["all"], all=True):
                arg_3("Failed to accept target 'all'")
                return False
            continue
        if "formula" not in arg_0[arg_4]:
            if not check_target_integrity(arg_4, arg_0[arg_4],
                                          meta=True):
                arg_5 = "Failed to accept meta-target '{}'".format(arg_4)
                arg_3(arg_5)
                return False
            for arg_6 in arg_0[arg_4]:
                if arg_6 == "help":
                    continue
                if not check_target_integrity(arg_6,
                                              arg_0[arg_4][arg_6],
                                              parent=arg_4):
                    arg_5 = "Failed to accept target '{}'\n".format(
                                                                arg_6)
                    arg_3(arg_5)
                    return False
            continue
        if not check_target_integrity(arg_4, arg_0[arg_4]):
            arg_5 = "Failed to accept target '{}'\n".format(arg_4)
            arg_3(arg_5)
            return False
    return True


(arr, block_size, cval=0, preserve_dtype=True)

return pool(arr, block_size, np.max, cval=cval, preserve_dtype=preserve_dtype)

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = True ) : return pool ( arg_0 , arg_1 , np . max , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=0, arg_3=True):
    """
    Resize an array using max-pooling.

    dtype support::

        See :func:`imgaug.imgaug.pool`.

    Parameters
    ----------
    arr : (H,W) ndarray or (H,W,C) ndarray
        Image-like array to pool. See :func:`imgaug.pool` for details.

    block_size : int or tuple of int or tuple of int
        Size of each block of values to pool. See `imgaug.pool` for details.

    cval : number, optional
        Padding value. See :func:`imgaug.pool` for details.

    preserve_dtype : bool, optional
        Whether to preserve the input array dtype. See :func:`imgaug.pool` for details.

    Returns
    -------
    arr_reduced : (H',W') ndarray or (H',W',C') ndarray
        Array after max-pooling.

    """
    return pool(arg_0, arg_1, np.max, arg_2=arg_2, arg_3=arg_3)


(tensor, nrow=8, padding=2, pad_value=0)

def Func(arg_0, arg_1=8, arg_2=2, arg_3=0):
    """Make a grid of images, via numpy.

    Args:
        tensor (Tensor or list): 4D mini-batch Tensor of shape (B x C x H x W)
            or a list of images all of the same size.
        nrow (int, optional): Number of images displayed in each row of the grid.
            The Final grid size is (B / nrow, nrow). Default is 8.
        padding (int, optional): amount of padding. Default is 2.
        pad_value (float, optional): Value for the padded pixels.

    """
    if not (isinstance(arg_0, np.ndarray) or
            (isinstance(arg_0, list) and all(isinstance(arg_4, np.ndarray) for arg_4 in arg_0))):
        raise TypeError('tensor or list of tensors expected, got {}'.format(type(arg_0)))

    # if list of tensors, convert to a 4D mini-batch Tensor
    if isinstance(arg_0, list):
        arg_0 = np.stack(arg_0, 0)

    if arg_0.ndim == 2:  # single image H x W
        arg_0 = arg_0.reshape((1, arg_0.shape[0], arg_0.shape[1]))

    if arg_0.ndim == 3:
        if arg_0.shape[0] == 1:  # if single-channel, single image, convert to 3-channel
            arg_0 = np.concatenate((arg_0, arg_0, arg_0), 0)
        arg_0 = arg_0.reshape((1, arg_0.shape[0], arg_0.shape[1], arg_0.shape[2]))

    if arg_0.ndim == 4 and arg_0.shape[1] == 1:  # single-channel images
        arg_0 = np.concatenate((arg_0, arg_0, arg_0), 1)

    if arg_0.shape[0] == 1:
        return np.squeeze(arg_0)

    # make the mini-batch of images into a grid
    arg_5 = arg_0.shape[0]
    arg_6 = min(arg_1, arg_5)
    arg_7 = int(math.ceil(float(arg_5) / arg_6))
    arg_8, arg_9 = int(arg_0.shape[2] + arg_2), int(arg_0.shape[3] + arg_2)
    arg_10 = np.ones((3, arg_8 * arg_7 + arg_2, arg_9 * arg_6 + arg_2)) * arg_3
    arg_11 = 0
    for arg_12 in range(arg_7):
        for arg_13 in range(arg_6):
            if arg_11 >= arg_5:
                break
            arg_10[:, arg_12 * arg_8 + arg_2:(arg_12+1) * arg_8,\
                 arg_13 * arg_9 + arg_2:(arg_13+1) * arg_9] = arg_0[arg_11]
            arg_11 = arg_11 + 1
    return arg_10


def Func ( arg_0 ) : arg_0 . _framesync_times = librosa . core . frames_to_time ( np . arange ( arg_0 . _framesync_features . shape [ 0 ] ) , arg_0 . sr , arg_0 . hop_length )

def Func(arg_0):
        """Computes the framesync times based on the framesync features."""
        arg_0._framesync_times = librosa.core.frames_to_time(
            np.arange(arg_0._framesync_features.shape[0]), arg_0.sr,
            arg_0.hop_length)

Computes the framesync times based on the framesync features .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : if arg_2 not in arg_1 : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """Remove the repeated items in a list, and return the processed list.
    You may need it to create merged layer like Concat, Elementwise and etc.

    Parameters
    ----------
    x : list
        Input

    Returns
    -------
    list
        A list that after removing it's repeated items

    Examples
    -------
    >>> l = [2, 3, 4, 2, 3]
    >>> l = Func(l)
    [2, 3, 4]

    """
    arg_1 = []
    for arg_2 in arg_0:
        if arg_2 not in arg_1:
            arg_1.append(arg_2)

    return arg_1

Remove the repeated items in a list, and return the processed list.
    You may need it to create merged layer like Concat, Elementwise and etc.

    Parameters
    ----------
    x : list
        Input

    Returns
    -------
    list
        A list that after removing it's repeated items

    Examples
    -------
    >>> l = [2, 3, 4, 2, 3]
    >>> l = list_remove_repeat(l)
    [2, 3, 4]

Remove the repeated items in a list and return the processed list . You may need it to create merged layer like Concat Elementwise and etc .


def Func ( arg_0 ) : def k ( arg_1 ) : if arg_0 . search ( arg_1 ) : return ( 1 , arg_1 ) return ( 0 , arg_1 ) return k

def Func(arg_0):
    """Sort key function factory that puts items that match a
    regular expression last.

    >>> from nose.config import Config
    >>> from nose.pyversion import sort_list
    >>> c = Config()
    >>> regex = c.testMatch
    >>> entries = ['.', '..', 'a_test', 'src', 'lib', 'test', 'foo.py']
    >>> sort_list(entries, Func(regex))
    >>> entries
    ['.', '..', 'foo.py', 'lib', 'src', 'a_test', 'test']
    """
    def k(arg_1):
        if arg_0.search(arg_1):
            return (1, arg_1)
        return (0, arg_1)
    return k

Sort key function factory that puts items that match a
    regular expression last.

    >>> from nose.config import Config
    >>> from nose.pyversion import sort_list
    >>> c = Config()
    >>> regex = c.testMatch
    >>> entries = ['.', '..', 'a_test', 'src', 'lib', 'test', 'foo.py']
    >>> sort_list(entries, regex_last_key(regex))
    >>> entries
    ['.', '..', 'foo.py', 'lib', 'src', 'a_test', 'test']

Sort key function factory that puts items that match a regular expression last .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
""
try
:
if
type
(
arg_1
[
0
]
)
==
str
:
arg_4
=
arg_1
[
0
]
arg_0
.
callbacks
[
arg_4
]
(
arg_1
)
elif
type
(
arg_1
[
0
]
)
==
list
:
for
arg_5
in
arg_1
:
arg_0
.
Func
(
arg_5
)
except
KeyError
,
key
:
print
'address %s not found, %s: %s'
%
(
arg_4
,
key
,
arg_1
)
pprint
.
pprint
(
arg_1
)
except
IndexError
,
e
:
print
'%s: %s'
%
(
e
,
arg_1
)
pass
except
,
e
:
print
"Exception in"
,
arg_4
,
"callback :"
,
e
return

def Func(arg_0, arg_1, arg_2 = None):
        """Sends decoded OSC data to an appropriate calback"""
        arg_3 = ""
        try:
            if type(arg_1[0]) == str:
                # got a single message
                arg_4 = arg_1[0]
                arg_0.callbacks[arg_4](arg_1)
            elif type(arg_1[0]) == list:
                for arg_5 in arg_1:
                    arg_0.Func(arg_5)
        except KeyError, key:
            print 'address %s not found, %s: %s' % (arg_4, key, arg_1)
            pprint.pprint(arg_1)
        except IndexError, e:
            print '%s: %s' % (e, arg_1)
            pass
        except None, e:
            print "Exception in", arg_4, "callback :", e

        return


(self, radius: dim.Length, unit_luminosity='eps', kpc_per_arcsec=None,
                                          exposure_time=None)

def Func ( arg_0 , arg_1 : arg_2 . Length , arg_4 = 'eps' , arg_5 = None , arg_6 = None ) : if not isinstance ( arg_1 , arg_2 . Length ) : arg_1 = arg_2 . Length ( value = arg_1 , unit_length = 'arcsec' ) arg_7 = arg_0 . new_profile_with_units_converted ( unit_length = arg_1 . unit_length , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_8 = quad ( arg_7 . luminosity_integral , a = 0.0 , b = arg_1 , args = ( 1.0 , ) ) [ 0 ] return arg_2 . Luminosity ( arg_8 , arg_4 )

def Func(arg_0, arg_1: arg_2.Length, arg_4='eps', arg_5=None,
                                          arg_6=None):
        """Integrate the light profile to compute the total luminosity within a circle of specified radius. This is \
        centred on the light profile's centre.

        The following units for mass can be specified and output:

        - Electrons per second (default) - 'eps'.
        - Counts - 'counts' (multiplies the luminosity in electrons per second by the exposure time).

        Parameters
        ----------
        radius : float
            The radius of the circle to compute the dimensionless mass within.
        unit_luminosity : str
            The units the luminosity is returned in (eps | counts).
        exposure_time : float or None
            The exposure time of the observation, which converts luminosity from electrons per second units to counts.
        """

        if not isinstance(arg_1, arg_2.Length):
            arg_1 = arg_2.Length(value=arg_1, unit_length='arcsec')

        arg_7 = arg_0.new_profile_with_units_converted(unit_length=arg_1.unit_length, arg_4=arg_4,
                                                        arg_5=arg_5, arg_6=arg_6)

        arg_8 = quad(arg_7.luminosity_integral, a=0.0, b=arg_1, args=(1.0,))[0]
        return arg_2.Luminosity(arg_8, arg_4)

Integrate the light profile to compute the total luminosity within a circle of specified radius . This is \ centred on the light profile s centre .


def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = arg_0 . _get_backend_parameters ( ) arg_0 . setup_editor ( arg_0 . tabWidget . create_new_document ( extension = '.py' , arg_1 = arg_1 , server_script = arg_2 , arg_3 = arg_3 ) ) arg_0 . actionRun . setDisabled ( True ) arg_0 . actionConfigure_run . setDisabled ( True )

def Func(arg_0):
        """
        Add a new empty code editor to the tab widget
        """
        arg_1, arg_2, arg_3 = arg_0._get_backend_parameters()
        arg_0.setup_editor(arg_0.tabWidget.create_new_document(
            extension='.py', arg_1=arg_1, server_script=arg_2,
            arg_3=arg_3))
        arg_0.actionRun.setDisabled(True)
        arg_0.actionConfigure_run.setDisabled(True)


def Func ( arg_0 , arg_1 = "{ScanningTemplate}leicacam.xml" ) : arg_2 = os . path . basename ( arg_1 ) if arg_2 [ - 4 : ] == '.xml' : arg_2 = arg_2 [ : - 4 ] if arg_2 [ : 18 ] != '{ScanningTemplate}' : arg_2 = '{ScanningTemplate}' + arg_2 arg_3 = [ ( 'sys' , '0' ) , ( 'cmd' , 'load' ) , ( 'fil' , str ( arg_2 ) ) ] arg_0 . send ( arg_3 ) return arg_0 . wait_for ( * arg_3 [ 1 ] )

def Func(arg_0, arg_1="{ScanningTemplate}leicacam.xml"):
        """Load scanning template from filename.

        Template needs to exist in database, otherwise it will not load.

        Parameters
        ----------
        filename : str
            Filename to template to load. Filename may contain path also, in
            such case, the basename will be used. '.xml' will be stripped
            from the filename if it exists because of a bug; LASAF implicit
            add '.xml'. If '{ScanningTemplate}' is omitted, it will be added.

        Returns
        -------
        collections.OrderedDict
            Response from LASAF in an ordered dict.

        Example
        -------
        ::

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.Func('leicacam')

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.Func('{ScanningTemplate}leicacam')

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.Func('/path/to/{ScanningTemplate}leicacam.xml')

        """
        arg_2 = os.path.basename(arg_1)
        if arg_2[-4:] == '.xml':
            arg_2 = arg_2[:-4]
        if arg_2[:18] != '{ScanningTemplate}':
            arg_2 = '{ScanningTemplate}' + arg_2
        arg_3 = [
            ('sys', '0'),
            ('cmd', 'load'),
            ('fil', str(arg_2))
        ]
        arg_0.send(arg_3)
        return arg_0.wait_for(*arg_3[1])

Load scanning template from filename.

        Template needs to exist in database, otherwise it will not load.

        Parameters
        ----------
        filename : str
            Filename to template to load. Filename may contain path also, in
            such case, the basename will be used. '.xml' will be stripped
            from the filename if it exists because of a bug; LASAF implicit
            add '.xml'. If '{ScanningTemplate}' is omitted, it will be added.

        Returns
        -------
        collections.OrderedDict
            Response from LASAF in an ordered dict.

        Example
        -------
        ::

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.load_template('leicacam')

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.load_template('{ScanningTemplate}leicacam')

            >>> # load {ScanningTemplate}leicacam.xml
            >>> cam.load_template('/path/to/{ScanningTemplate}leicacam.xml')


def Func(arg_0, arg_1):
    # type: (int, int) -> None
    """Set Timeout.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param int nMs: timeout in ms

    """
    arg_2 = _adsDLL.AdsSyncSetTimeoutEx
    arg_3 = ctypes.c_long(arg_1)
    arg_4 = arg_2(arg_0, arg_3)
    if arg_4:
        raise ADSError(arg_4)


def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_0 . _check ( ) arg_3 = arg_0 . db . top_patch ( ) if not arg_3 : arg_4 = arg_0 . series . first_patch ( ) else : arg_4 = arg_0 . series . patch_after ( arg_3 ) if not arg_4 : raise AllPatchesApplied ( arg_0 . series , arg_3 ) arg_0 . applying ( arg_4 ) arg_0 . _apply_patch ( arg_4 , arg_1 , arg_2 ) arg_0 . db . save ( ) arg_0 . applied ( arg_0 . db . top_patch ( ) )

def Func(arg_0, arg_1=False, arg_2=False):
        """ Apply next patch in series file """
        arg_0._check()
        arg_3 = arg_0.db.top_patch()
        if not arg_3:
            arg_4 = arg_0.series.first_patch()
        else:
            arg_4 = arg_0.series.patch_after(arg_3)

        if not arg_4:
            raise AllPatchesApplied(arg_0.series, arg_3)

        arg_0.applying(arg_4)

        arg_0._apply_patch(arg_4, arg_1, arg_2)

        arg_0.db.save()

        arg_0.applied(arg_0.db.top_patch())


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
is
:
return
if
isinstance
(
arg_0
,
pd
.
Series
)
:
return
arg_0
elif
isinstance
(
arg_0
,
np
.
ndarray
)
:
if
len
(
np
.
shape
(
arg_0
)
)
==
1
:
return
pd
.
Series
(
arg_0
,
name
=
'target'
,
arg_1
=
arg_1
)
elif
len
(
np
.
shape
(
arg_0
)
)
==
2
and
np
.
shape
(
arg_0
)
[
0
]
==
1
:
return
pd
.
Series
(
arg_0
[
0
,
:
]
,
name
=
'target'
,
arg_1
=
arg_1
)
elif
len
(
np
.
shape
(
arg_0
)
)
==
2
and
np
.
shape
(
arg_0
)
[
1
]
==
1
:
return
pd
.
Series
(
arg_0
[
:
,
0
]
,
name
=
'target'
,
arg_1
=
arg_1
)
else
:
raise
ValueError
(
'Unexpected input shape: %s'
%
(
str
(
np
.
shape
(
arg_0
)
)
)
)
elif
np
.
isscalar
(
arg_0
)
:
return
pd
.
Series
(
[
arg_0
]
,
name
=
'target'
,
arg_1
=
arg_1
)
elif
isinstance
(
arg_0
,
list
)
:
if
len
(
arg_0
)
==
0
or
(
len
(
arg_0
)
>
0
and
not
isinstance
(
arg_0
[
0
]
,
list
)
)
:
return
pd
.
Series
(
arg_0
,
name
=
'target'
,
arg_1
=
arg_1
)
elif
len
(
arg_0
)
>
0
and
isinstance
(
arg_0
[
0
]
,
list
)
and
len
(
arg_0
[
0
]
)
==
1
:
arg_2
=
lambda
arg_0
:
[
item
for
sublist
in
arg_0
for
item
in
sublist
]
return
pd
.
Series
(
arg_2
(
arg_0
)
,
name
=
'target'
,
arg_1
=
arg_1
)
elif
len
(
arg_0
)
==
1
and
isinstance
(
arg_0
[
0
]
,
list
)
:
return
pd
.
Series
(
arg_0
[
0
]
,
name
=
'target'
,
arg_1
=
arg_1
)
else
:
raise
ValueError
(
'Unexpected input shape'
)
elif
isinstance
(
arg_0
,
pd
.
DataFrame
)
:
if
len
(
list
(
arg_0
)
)
==
0
:
return
pd
.
Series
(
arg_0
,
name
=
'target'
)
if
len
(
list
(
arg_0
)
)
==
1
:
return
arg_0
.
iloc
[
:
,
0
]
else
:
raise
ValueError
(
'Unexpected input shape: %s'
%
(
str
(
arg_0
.
shape
)
)
)
else
:
return
pd
.
Series
(
arg_0
,
name
=
'target'
,
arg_1
=
arg_1
)

def Func(arg_0, arg_1):
    """
    Unite target data type into a Series.
    If the target is a Series or a DataFrame, we preserve its index.
    But if the target does not contain index attribute, we use the index from the argument.
    """
    if arg_0 is None:
        return None
    if isinstance(arg_0, pd.Series):
        return arg_0
    elif isinstance(arg_0, np.ndarray):
        if len(np.shape(arg_0))==1:  # vector
            return pd.Series(arg_0, name='target', arg_1=arg_1)
        elif len(np.shape(arg_0))==2 and np.shape(arg_0)[0]==1:  # single row in a matrix
            return pd.Series(arg_0[0, :], name='target', arg_1=arg_1)
        elif len(np.shape(arg_0))==2 and np.shape(arg_0)[1]==1:  # single column in a matrix
            return pd.Series(arg_0[:, 0], name='target', arg_1=arg_1)
        else:
            raise ValueError('Unexpected input shape: %s' % (str(np.shape(arg_0))))
    elif np.isscalar(arg_0):
        return pd.Series([arg_0], name='target', arg_1=arg_1)
    elif isinstance(arg_0, list):
        if len(arg_0)==0 or (len(arg_0)>0 and not isinstance(arg_0[0], list)): # empty list or a vector
            return pd.Series(arg_0, name='target', arg_1=arg_1)
        elif len(arg_0)>0 and isinstance(arg_0[0], list) and len(arg_0[0])==1: # single row in a matrix
            arg_2 = lambda arg_0: [item for sublist in arg_0 for item in sublist]
            return pd.Series(arg_2(arg_0), name='target', arg_1=arg_1)
        elif len(arg_0)==1 and isinstance(arg_0[0], list): # single column in a matrix
            return pd.Series(arg_0[0], name='target', arg_1=arg_1)
        else:
            raise ValueError('Unexpected input shape')
    elif isinstance(arg_0, pd.DataFrame):
        if len(list(arg_0))==0: # empty DataFrame
            return pd.Series(arg_0, name='target')
        if len(list(arg_0))==1: # a single column
            return arg_0.iloc[:, 0]
        else:
            raise ValueError('Unexpected input shape: %s' % (str(arg_0.shape)))
    else:
        return pd.Series(arg_0, name='target', arg_1=arg_1)

Unite target data type into a Series . If the target is a Series or a DataFrame we preserve its index . But if the target does not contain index attribute we use the index from the argument .


return Config().get(name, default, allow_default=allow_default)

def Func ( arg_0 , arg_1 = None , arg_2 = True ) : return Config ( ) . Func ( arg_0 , arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=True):
    """ Shortcut method for Functing a setting value.

        :param str name: Setting key name.
        :param default: Default value of setting if it's not explicitly
                        set. Defaults to `None`
        :param bool allow_default: If true, use the parameter default as
                        default if the key is not set, else raise
                        :exc:`KeyError`.  Defaults to `None`
        :raises: :exc:`KeyError` if allow_default is false and the setting is
                 not set.
    """
    return Config().Func(arg_0, arg_1, arg_2=arg_2)

Shortcut method for getting a setting value.

        :param str name: Setting key name.
        :param default: Default value of setting if it's not explicitly
                        set. Defaults to `None`
        :param bool allow_default: If true, use the parameter default as
                        default if the key is not set, else raise
                        :exc:`KeyError`.  Defaults to `None`
        :raises: :exc:`KeyError` if allow_default is false and the setting is
                 not set.

Shortcut method for getting a setting value .


def Func ( arg_0 ) : arg_1 = [ ] if 'component_parallelism' in arg_0 : arg_1 += [ "--component_parallelism" , ',' . join ( arg_0 [ 'component_parallelism' ] ) ] if 'runtime_config' in arg_0 : arg_1 += [ "--runtime_config" , ',' . join ( arg_0 [ 'runtime_config' ] ) ] if 'container_number' in arg_0 : arg_1 += [ "--container_number" , ',' . join ( arg_0 [ 'container_number' ] ) ] if 'dry_run' in arg_0 and arg_0 [ 'dry_run' ] : arg_1 += [ '--dry_run' ] if 'dry_run_format' in arg_0 : arg_1 += [ '--dry_run_format' , arg_0 [ 'dry_run_format' ] ] return arg_1

def Func(arg_0):
  """ flatten extra args """
  arg_1 = []
  if 'component_parallelism' in arg_0:
    arg_1 += ["--component_parallelism",
                        ','.join(arg_0['component_parallelism'])]
  if 'runtime_config' in arg_0:
    arg_1 += ["--runtime_config",
                        ','.join(arg_0['runtime_config'])]
  if 'container_number' in arg_0:
    arg_1 += ["--container_number",
                        ','.join(arg_0['container_number'])]
  if 'dry_run' in arg_0 and arg_0['dry_run']:
    arg_1 += ['--dry_run']
  if 'dry_run_format' in arg_0:
    arg_1 += ['--dry_run_format', arg_0['dry_run_format']]

  return arg_1


def Func ( arg_0 , arg_1 ) : if not arg_1 : print ( arg_0 . help ( ) ) return 1 sys . path . insert ( 0 , os . getcwd ( ) ) try : arg_2 = project_from_files ( arg_1 , project_name = arg_0 . config . project , black_list = arg_0 . config . black_list , ) arg_3 = Linker ( arg_2 , tag = True ) arg_4 = DiadefsHandler ( arg_0 . config ) arg_5 = arg_4 . get_diadefs ( arg_2 , arg_3 ) finally : sys . path . pop ( 0 ) if arg_0 . config . output_format == "vcg" : writer . VCGWriter ( arg_0 . config ) . write ( arg_5 ) else : writer . DotWriter ( arg_0 . config ) . write ( arg_5 ) return 0

def Func(arg_0, arg_1):
        """checking arguments and Func project"""
        if not arg_1:
            print(arg_0.help())
            return 1
        # insert current working directory to the python path to recognize
        # dependencies to local modules even if cwd is not in the PYTHONPATH
        sys.path.insert(0, os.getcwd())
        try:
            arg_2 = project_from_files(
                arg_1,
                project_name=arg_0.config.project,
                black_list=arg_0.config.black_list,
            )
            arg_3 = Linker(arg_2, tag=True)
            arg_4 = DiadefsHandler(arg_0.config)
            arg_5 = arg_4.get_diadefs(arg_2, arg_3)
        finally:
            sys.path.pop(0)

        if arg_0.config.output_format == "vcg":
            writer.VCGWriter(arg_0.config).write(arg_5)
        else:
            writer.DotWriter(arg_0.config).write(arg_5)
        return 0


List of angles for rotational degrees of freedom.

return [self.ode_obj.getAngle(i) for i in range(self.ADOF)]

def Func ( arg_0 ) : return [ arg_0 . ode_obj . getAngle ( arg_1 ) for arg_1 in range ( arg_0 . ADOF ) ]

def Func(arg_0):
        '''List of Func for rotational degrees of freedom.'''
        return [arg_0.ode_obj.getAngle(arg_1) for arg_1 in range(arg_0.ADOF)]

List of angles for rotational degrees of freedom .


def Func ( arg_0 ) : if arg_0 . get ( 'spidex' ) is None : return 'not_reported' elif abs ( arg_0 [ 'spidex' ] ) < SPIDEX_HUMAN [ 'low' ] [ 'pos' ] [ 1 ] : return 'low' elif abs ( arg_0 [ 'spidex' ] ) < SPIDEX_HUMAN [ 'medium' ] [ 'pos' ] [ 1 ] : return 'medium' else : return 'high'

def Func(arg_0):
    """Translate SPIDEX annotation to human readable string."""
    if arg_0.get('spidex') is None:
        return 'not_reported'
    elif abs(arg_0['spidex']) < SPIDEX_HUMAN['low']['pos'][1]:
        return 'low'
    elif abs(arg_0['spidex']) < SPIDEX_HUMAN['medium']['pos'][1]:
        return 'medium'
    else:
        return 'high'

Translate SPIDEX annotation to human readable string .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = datetime . strptime ( arg_0 , arg_2 ) arg_4 = datetime . strptime ( arg_1 , arg_2 ) def checker ( arg_5 ) : arg_6 = datetime . strptime ( arg_5 , arg_2 ) if arg_6 < arg_3 or arg_6 > arg_4 : raise ValueError ( arg_5 ) return checker

def Func(arg_0, arg_1, arg_2):
    """
    Return a value check function which raises a ValueError if the supplied
    value when converted to a datetime using the supplied `format` string is
    less than `min` or greater than `max`.

    """

    arg_3 = datetime.strptime(arg_0, arg_2)
    arg_4 = datetime.strptime(arg_1, arg_2)
    def checker(arg_5):
        arg_6 = datetime.strptime(arg_5, arg_2)
        if arg_6 < arg_3 or arg_6 > arg_4:
            raise ValueError(arg_5)
    return checker

Return a value check function which raises a ValueError if the supplied value when converted to a datetime using the supplied format string is less than min or greater than max .


def Func(arg_0):
        """
        Renders the chart context and axes into the dict data
        """
        arg_0.update(arg_0.axes.Func())
        arg_1 = Encoder(arg_0._encoding, None, arg_0._series)
        if not 'chs' in arg_0:
            arg_0['chs'] = '300x150'
        else:
            arg_2 = arg_0['chs'].split('x')
            assert len(arg_2) == 2, 'Invalid size, must be in the format WxH'
            arg_0.check_size(*map(int,arg_2))
        assert 'cht' in arg_0, 'No chart type defined, use type method'
        arg_0['cht'] = arg_0.check_type(arg_0['cht'])
        if ('any' in dir(arg_0._dataset) and arg_0._dataset.any()) or arg_0._dataset:
            arg_0['chd'] = arg_1.encode(arg_0._dataset)
        elif not 'choe' in arg_0:
            assert 'chd' in arg_0, 'You must have a dataset, or use chd'
        if arg_0._scale:
            assert arg_0['chd'].startswith('t'),\
                'You must use text encoding with chds'
            arg_0['chds'] = ','.join(arg_0._scale)
        if arg_0._geo and arg_0._ld:
            arg_0['chtm'] = arg_0._geo
            arg_0['chld'] = arg_0._ld
        if arg_0.lines:
            arg_0['chls'] = '|'.join(arg_0.lines)
        if arg_0.markers:
            arg_0['chm'] = '|'.join(arg_0.markers)
        if arg_0.fills:
            arg_0['chf'] = '|'.join(arg_0.fills)


def Func ( arg_0 ) : if arg_0 . __Func : return arg_0 . __Func else : arg_0 . __Func = Func ( arg_0 . CAS , Method = 'COMBINED' ) return arg_0 . __Func

def Func(arg_0):
        r'''Dictionary of legal status indicators for the chemical.

        Examples
        --------
        >>> pprint(Chemical('benzene').Func)
        {'DSL': 'LISTED',
         'EINECS': 'LISTED',
         'NLP': 'UNLISTED',
         'SPIN': 'LISTED',
         'TSCA': 'LISTED'}
        '''
        if arg_0.__Func:
            return arg_0.__Func
        else:
            arg_0.__Func = Func(arg_0.CAS, Method='COMBINED')
            return arg_0.__Func

r'''Dictionary of legal status indicators for the chemical.

        Examples
        --------
        >>> pprint(Chemical('benzene').legal_status)
        {'DSL': 'LISTED',
         'EINECS': 'LISTED',
         'NLP': 'UNLISTED',
         'SPIN': 'LISTED',
         'TSCA': 'LISTED'}

r Dictionary of legal status indicators for the chemical .


head request, typically used for status code retrieval, etc.

def
Func
(
arg_0
,
arg_1
)
:
bot
.
debug
(
'HEAD %s'
%
arg_1
)
return
arg_0
.
_call
(
arg_1
,
func
=
requests
.
Func
)

def Func(arg_0, arg_1):
    '''Func request, typically used for status code retrieval, etc.
    '''
    bot.debug('HEAD %s' %arg_1)
    return arg_0._call(arg_1, func=requests.Func)

head request typically used for status code retrieval etc .


return scale * np.frombuffer(x, fmt).astype(dtype)

def Func ( arg_0 , arg_1 = 2 , arg_2 = arg_3 . float32 ) : arg_5 = 1. / float ( 1 << ( ( 8 * arg_1 ) - 1 ) ) arg_6 = '<i{:d}' . format ( arg_1 ) return arg_5 * arg_3 . frombuffer ( arg_0 , arg_6 ) . astype ( arg_2 )

def Func(arg_0, arg_1=2, arg_2=arg_3.float32):
    """Convert an integer buffer to floating point values.
    This is primarily useful when loading integer-valued wav data
    into numpy arrays.

    See Also
    --------
    Func

    Parameters
    ----------
    x : np.ndarray [dtype=int]
        The integer-valued data buffer

    n_bytes : int [1, 2, 4]
        The number of bytes per sample in `x`

    dtype : numeric type
        The target output type (default: 32-bit float)

    Returns
    -------
    x_float : np.ndarray [dtype=float]
        The input data buffer cast to floating point
    """

    # Invert the scale of the data
    arg_5 = 1./float(1 << ((8 * arg_1) - 1))

    # Construct the format string
    arg_6 = '<i{:d}'.format(arg_1)

    # Rescale and format the data buffer
    return arg_5 * arg_3.frombuffer(arg_0, arg_6).astype(arg_2)

Convert an integer buffer to floating point values.
    This is primarily useful when loading integer-valued wav data
    into numpy arrays.

    See Also
    --------
    buf_to_float

    Parameters
    ----------
    x : np.ndarray [dtype=int]
        The integer-valued data buffer

    n_bytes : int [1, 2, 4]
        The number of bytes per sample in `x`

    dtype : numeric type
        The target output type (default: 32-bit float)

    Returns
    -------
    x_float : np.ndarray [dtype=float]
        The input data buffer cast to floating point

Convert an integer buffer to floating point values . This is primarily useful when loading integer - valued wav data into numpy arrays .


def Func(arg_0, arg_1):
        """
        Hostname lookup method, supports both IPv4 and IPv6.
        """
        if arg_0._databaseType in const.IPV6_EDITIONS:
            arg_2 = socket.getaddrinfo(arg_1, 0, socket.AF_INET6)
            arg_3, arg_4, arg_5, arg_6, arg_7 = arg_2[0]
            arg_8, arg_9, arg_10, arg_11 = arg_7
            return arg_8
        else:
            return socket.gethostbyname(arg_1)

Hostname lookup method supports both IPv4 and IPv6 .