def Func(arg_0, arg_1):
        # type: (S) -> B
        '''Returns the focus within `state`. If multiple items are
        focused then it will attempt to join them together as a monoid.
        See `lenses.typeclass.mappend`.

        Requires kind Fold. This method will raise TypeError if the
        optic has no way to get any foci.

        For technical reasons, this method requires there to be at least
        one foci at the end of the Func. It will raise ValueError when
        there is none.
        '''
        if not arg_0._is_kind(Fold):
            raise TypeError('Must be an instance of Fold to .Func()')

        arg_2 = object()
        arg_3 = arg_0.preFunc(arg_1).maybe(arg_2)
        if arg_3 is arg_2:
            raise ValueError('No focus to Func')
        return cast(B, arg_3)

Returns the focus within `state`. If multiple items are
        focused then it will attempt to join them together as a monoid.
        See `lenses.typeclass.mappend`.

        Requires kind Fold. This method will raise TypeError if the
        optic has no way to get any foci.

        For technical reasons, this method requires there to be at least
        one foci at the end of the view. It will raise ValueError when
        there is none.

Returns the focus within state . If multiple items are focused then it will attempt to join them together as a monoid . See lenses . typeclass . mappend .


def Func(arg_0):
    """Formats elapsed seconds into a human readable format."""
    arg_1 = int(arg_0 / (60 * 60))
    arg_2 = int((arg_0 % (60 * 60)) / 60)
    arg_3 = int(arg_0 % 60)

    arg_4 = ""
    if arg_1:
        arg_4 += "{0}h".format(arg_1)

    if arg_0 > 60:
        arg_4 += "{0}m".format(arg_2)

    arg_4 += "{0}s".format(arg_3)
    return arg_4

Formats elapsed seconds into a human readable format .


def
Func
(
arg_0
,
arg_1
=
1
,
arg_2
=
False
,
arg_3
=
)
:
if
arg_3
is
:
arg_3
=
np
.
argmax
if
arg_0
.
ndim
!=
2
:
raise
ParameterError
(
'Func is only defined for 2D arrays'
)
arg_4
=
arg_3
(
arg_0
,
arg_1
=
np
.
mod
(
1
arg_1
,
arg_0
.
ndim
)
)
arg_5
=
np
.
argsort
(
arg_4
)
arg_6
=
[
slice
(
)
]
*
arg_0
.
ndim
arg_6
[
arg_1
]
=
arg_5
if
arg_2
:
return
arg_0
[
tuple
(
arg_6
)
]
,
arg_5
else
:
return
arg_0
[
tuple
(
arg_6
)
]

def Func(arg_0, arg_1=-1, arg_2=False, arg_3=None):
    '''Sort an array along its rows or columns.

    Examples
    --------
    Visualize NMF output for a spectrogram S

    >>> # Sort the columns of W by peak frequency bin
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> S = np.abs(librosa.stft(y))
    >>> W, H = librosa.decompose.decompose(S, n_components=32)
    >>> W_sort = librosa.util.Func(W)

    Or sort by the lowest frequency bin

    >>> W_sort = librosa.util.Func(W, value=np.argmin)

    Or sort the rows instead of the columns

    >>> W_sort_rows = librosa.util.Func(W, axis=0)

    Get the sorting index also, and use it to permute the rows of H

    >>> W_sort, idx = librosa.util.Func(W, index=True)
    >>> H_sort = H[idx, :]

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(2, 2, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(W, ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('W')
    >>> plt.subplot(2, 2, 2)
    >>> librosa.display.specshow(H, x_axis='time')
    >>> plt.title('H')
    >>> plt.subplot(2, 2, 3)
    >>> librosa.display.specshow(librosa.amplitude_to_db(W_sort,
    ...                                                  ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('W sorted')
    >>> plt.subplot(2, 2, 4)
    >>> librosa.display.specshow(H_sort, x_axis='time')
    >>> plt.title('H sorted')
    >>> plt.tight_layout()

    Parameters
    ----------
    S : np.ndarray [shape=(d, n)]
        Array to be sorted

    axis : int [scalar]
        The axis along which to compute the sorting values

        - `axis=0` to sort rows by peak column index
        - `axis=1` to sort columns by peak row index

    index : boolean [scalar]
        If true, returns the index array as well as the permuted data.

    value : function
        function to return the index corresponding to the sort order.
        Default: `np.argmax`.

    Returns
    -------
    S_sort : np.ndarray [shape=(d, n)]
        `S` with the columns or rows permuted in sorting order

    idx : np.ndarray (optional) [shape=(d,) or (n,)]
        If `index == True`, the sorting index used to permute `S`.
        Length of `idx` corresponds to the selected `axis`.

    Raises
    ------
    ParameterError
        If `S` does not have exactly 2 dimensions (`S.ndim != 2`)
    '''

    if arg_3 is None:
        arg_3 = np.argmax

    if arg_0.ndim != 2:
        raise ParameterError('Func is only defined for 2D arrays')

    arg_4 = arg_3(arg_0, arg_1=np.mod(1-arg_1, arg_0.ndim))
    arg_5 = np.argsort(arg_4)

    arg_6 = [slice(None)] * arg_0.ndim
    arg_6[arg_1] = arg_5

    if arg_2:
        return arg_0[tuple(arg_6)], arg_5
    else:
        return arg_0[tuple(arg_6)]

Sort an array along its rows or columns.

    Examples
    --------
    Visualize NMF output for a spectrogram S

    >>> # Sort the columns of W by peak frequency bin
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> S = np.abs(librosa.stft(y))
    >>> W, H = librosa.decompose.decompose(S, n_components=32)
    >>> W_sort = librosa.util.axis_sort(W)

    Or sort by the lowest frequency bin

    >>> W_sort = librosa.util.axis_sort(W, value=np.argmin)

    Or sort the rows instead of the columns

    >>> W_sort_rows = librosa.util.axis_sort(W, axis=0)

    Get the sorting index also, and use it to permute the rows of H

    >>> W_sort, idx = librosa.util.axis_sort(W, index=True)
    >>> H_sort = H[idx, :]

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(2, 2, 1)
    >>> librosa.display.specshow(librosa.amplitude_to_db(W, ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('W')
    >>> plt.subplot(2, 2, 2)
    >>> librosa.display.specshow(H, x_axis='time')
    >>> plt.title('H')
    >>> plt.subplot(2, 2, 3)
    >>> librosa.display.specshow(librosa.amplitude_to_db(W_sort,
    ...                                                  ref=np.max),
    ...                          y_axis='log')
    >>> plt.title('W sorted')
    >>> plt.subplot(2, 2, 4)
    >>> librosa.display.specshow(H_sort, x_axis='time')
    >>> plt.title('H sorted')
    >>> plt.tight_layout()

    Parameters
    ----------
    S : np.ndarray [shape=(d, n)]
        Array to be sorted

    axis : int [scalar]
        The axis along which to compute the sorting values

        - `axis=0` to sort rows by peak column index
        - `axis=1` to sort columns by peak row index

    index : boolean [scalar]
        If true, returns the index array as well as the permuted data.

    value : function
        function to return the index corresponding to the sort order.
        Default: `np.argmax`.

    Returns
    -------
    S_sort : np.ndarray [shape=(d, n)]
        `S` with the columns or rows permuted in sorting order

    idx : np.ndarray (optional) [shape=(d,) or (n,)]
        If `index == True`, the sorting index used to permute `S`.
        Length of `idx` corresponds to the selected `axis`.

    Raises
    ------
    ParameterError
        If `S` does not have exactly 2 dimensions (`S.ndim != 2`)

Sort an array along its rows or columns .


def Func(arg_0, arg_1=None):
    """Return a valid zero cutoff value."""
    if arg_1 is None:
        return arg_0.tolerance
    else:
        if arg_1 < arg_0.tolerance:
            raise ValueError(
                "The chosen zero cutoff cannot be less than the model's "
                "tolerance value."
            )
        else:
            return arg_1


def Func ( arg_0 ) : arg_0 . visibility = arg_0 . data [ : , : , 3 ] arg_0 . positions = arg_0 . data [ : , : , : 3 ] arg_0 . velocities = np . zeros_like ( arg_0 . positions ) + 1000 for arg_4 in range ( 1 , len ( arg_0 . data ) - 1 ) : arg_5 = arg_0 . data [ arg_4 - 1 ] arg_6 = arg_0 . data [ arg_4 + 1 ] for arg_7 in range ( arg_0 . num_markers ) : if - 1 < arg_5 [ arg_7 , 3 ] < 100 and - 1 < arg_6 [ arg_7 , 3 ] < 100 : arg_0 . velocities [ arg_4 , arg_7 ] = ( arg_6 [ arg_7 , : 3 ] - arg_5 [ arg_7 , : 3 ] ) / ( 2 * arg_0 . world . dt ) arg_0 . cfms = np . zeros_like ( arg_0 . visibility ) + arg_0 . DEFAULT_CFM

def Func(arg_0):
        '''Process data to produce velocity and dropout information.'''
        arg_0.visibility = arg_0.data[:, :, 3]
        arg_0.positions = arg_0.data[:, :, :3]
        arg_0.velocities = np.zeros_like(arg_0.positions) + 1000
        for arg_4 in range(1, len(arg_0.data) - 1):
            arg_5 = arg_0.data[arg_4 - 1]
            arg_6 = arg_0.data[arg_4 + 1]
            for arg_7 in range(arg_0.num_markers):
                if -1 < arg_5[arg_7, 3] < 100 and -1 < arg_6[arg_7, 3] < 100:
                    arg_0.velocities[arg_4, arg_7] = (
                        arg_6[arg_7, :3] - arg_5[arg_7, :3]) / (2 * arg_0.world.dt)
        arg_0.cfms = np.zeros_like(arg_0.visibility) + arg_0.DEFAULT_CFM

Process data to produce velocity and dropout information .


def
Func
(
arg_0
)
:
import
nipy
if
not
os
.
path
.
exists
(
arg_0
)
:
raise
FileNotFound
(
arg_0
)
try
:
return
nipy
.
load_image
(
arg_0
)
except
Exception
as
exc
:
raise
Exception
(
'Reading file {0}.'
.
format
(
repr_imgs
(
arg_0
)
)
)
from
exc

def Func(arg_0):
    """Read a Nifti file and return as nipy.Image

    Parameters
    ----------
    param nii_file: str
        Nifti file path

    Returns
    -------
    nipy.Image
    """
    # delayed import because could not install nipy on Python 3 on OSX
    import nipy

    if not os.path.exists(arg_0):
        raise FileNotFound(arg_0)

    try:
        return nipy.load_image(arg_0)
    except Exception as exc:
        raise Exception('Reading file {0}.'.format(repr_imgs(arg_0))) from exc

Read a Nifti file and return as nipy . Image


def Func(arg_0, arg_1):
        """Disconnect any connected devices that have any of the specified
        service UUIDs.
        """
        # Get list of connected devices with specified services.
        arg_2 = map(uuid_to_cbuuid, arg_1)
        for arg_3 in arg_0._central_manager.retrieveConnectedPeripheralsWithServices_(arg_2):
            arg_0._central_manager.cancelPeripheralConnection_(arg_3)

Disconnect any connected devices that have any of the specified service UUIDs .


return [x for x in re.split(self.delimiter, line.rstrip()) if x != '']

def Func ( arg_0 , Func ) : return [ arg_2 for arg_2 in re . split ( arg_0 . delimiter , Func . rstrip ( ) ) if arg_2 != '' ]

def Func(arg_0, Func):
        """Returns list of strings split by input delimeter

        Argument:
        line - Input line to cut
        """
        # Remove empty strings in case of multiple instances of delimiter
        return [arg_2 for arg_2 in re.split(arg_0.delimiter, Func.rstrip()) if arg_2 != '']


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 : for arg_3 in arg_1 : arg_4 = os . path . join ( arg_3 , arg_2 ) + '.py' if os . path . isfile ( arg_4 ) : yield arg_4

def Func(arg_0):
    """Yield the sources that are present."""
    for arg_1, arg_2 in arg_0:
        for arg_3 in arg_1:
            arg_4 = os.path.join(arg_3, arg_2) + '.py'
            if os.path.isfile(arg_4):
                yield arg_4


def Func(arg_0, arg_1=False):
        """Fetches data from the queue.

        Parameters
        ----------
        return_header : bool (optonal, default: ``False``)
            Determines whether the column headers are returned.

        Returns
        -------
        data : :class:`~numpy.ndarray`
            A six column :class:`~numpy.ndarray` of all the data. The
            columns are:

            * 1st: The arrival time of an agent.
            * 2nd: The service start time of an agent.
            * 3rd: The departure time of an agent.
            * 4th: The length of the queue upon the agents arrival.
            * 5th: The total number of :class:`Agents<.Agent>` in the
              :class:`.QueueServer`.
            * 6th: The :class:`QueueServer's<.QueueServer>` edge index.

        headers : str (optional)
            A comma seperated string of the column headers. Returns
            ``'arrival,service,departure,num_queued,num_total,q_id'``
        """

        arg_2 = []
        for arg_3 in arg_0.data.values():
            arg_2.extend(arg_3)

        arg_4 = np.zeros((len(arg_2), 6))
        if len(arg_2) > 0:
            arg_4[:, :5] = np.array(arg_2)
            arg_4[:, 5] = arg_0.edge[2]

            arg_5 = [
                ('a', float),
                ('s', float),
                ('d', float),
                ('q', float),
                ('n', float),
                ('id', float)
            ]
            arg_4 = np.array([tuple(arg_3) for arg_3 in arg_4], dtype=arg_5)
            arg_4 = np.sort(arg_4, order='a')
            arg_4 = np.array([tuple(arg_3) for arg_3 in arg_4])

        if arg_1:
            return arg_4, 'arrival,service,departure,num_queued,num_total,q_id'

        return arg_4


return PipelineDefinition(
        name=pipeline_def.name,
        solids=list({solid.definition for solid in solids}),
        context_definitions=pipeline_def.context_definitions,
        dependencies=deps,
    )

def Func ( arg_0 , arg_1 ) : check . inst_param ( arg_0 , 'pipeline_def' , PipelineDefinition ) check . list_param ( arg_1 , 'solid_names' , of_type = str ) arg_2 = set ( arg_1 ) arg_3 = list ( map ( arg_0 . solid_named , arg_1 ) ) arg_4 = { arg_8 ( arg_7 ) : { } for arg_7 in arg_3 } def _out_handle_of_inp ( arg_5 ) : if arg_0 . dependency_structure . has_dep ( arg_5 ) : arg_6 = arg_0 . dependency_structure . get_dep ( arg_5 ) if arg_6 . solid . name in arg_2 : return arg_6 return None for arg_7 in arg_3 : for arg_5 in arg_7 . input_handles ( ) : arg_6 = _out_handle_of_inp ( arg_5 ) if arg_6 : arg_4 [ arg_8 ( arg_7 ) ] [ arg_5 . input_def . name ] = DependencyDefinition ( arg_7 = arg_6 . solid . name , output = arg_6 . output_def . name ) return PipelineDefinition ( arg_10 = arg_0 . name , arg_3 = list ( { arg_7 . definition for arg_7 in arg_3 } ) , context_definitions = arg_0 . context_definitions , dependencies = arg_4 , )

def Func(arg_0, arg_1):
    '''
    Build a pipeline which is a subset of another pipeline.
    Only includes the solids which are in solid_names.
    '''

    check.inst_param(arg_0, 'pipeline_def', PipelineDefinition)
    check.list_param(arg_1, 'solid_names', of_type=str)

    arg_2 = set(arg_1)
    arg_3 = list(map(arg_0.solid_named, arg_1))
    arg_4 = {arg_8(arg_7): {} for arg_7 in arg_3}

    def _out_handle_of_inp(arg_5):
        if arg_0.dependency_structure.has_dep(arg_5):
            arg_6 = arg_0.dependency_structure.get_dep(arg_5)
            if arg_6.solid.name in arg_2:
                return arg_6
        return None

    for arg_7 in arg_3:
        for arg_5 in arg_7.input_handles():
            arg_6 = _out_handle_of_inp(arg_5)
            if arg_6:
                arg_4[arg_8(arg_7)][arg_5.input_def.name] = DependencyDefinition(
                    arg_7=arg_6.solid.name, output=arg_6.output_def.name
                )

    return PipelineDefinition(
        arg_10=arg_0.name,
        arg_3=list({arg_7.definition for arg_7 in arg_3}),
        context_definitions=arg_0.context_definitions,
        dependencies=arg_4,
    )

Build a pipeline which is a subset of another pipeline . Only includes the solids which are in solid_names .


def
Func
(
arg_0
)
:
if
arg_0
.
check_update_J
(
)
:
arg_0
.
update_J
(
)
else
:
if
arg_0
.
check_Broyden_J
(
)
:
arg_0
.
update_Broyden_J
(
)
if
arg_0
.
check_update_eig_J
(
)
:
arg_0
.
update_eig_J
(
)
arg_1
=
arg_0
.
find_LM_updates
(
arg_0
.
calc_grad
(
)
)
arg_2
=
arg_0
.
update_function
(
arg_0
.
param_vals
+
arg_1
)
arg_3
=
(
find_best_step
(
[
arg_0
.
error
,
arg_2
]
)
==
1
)
if
not
arg_3
:
arg_4
=
arg_0
.
update_function
(
arg_0
.
param_vals
)
if
np
.
abs
(
arg_4
arg_0
.
error
)
/
arg_4
>
1e-7
:
raise
RuntimeError
(
'Function updates are not exact.'
)
CLOG
.
debug
(
'Bad step, increasing damping'
)
CLOG
.
debug
(
'\t\t%f\t%f'
%
(
arg_0
.
error
,
arg_2
)
)
arg_5
=
arg_0
.
calc_grad
(
)
for
arg_6
in
range
(
arg_0
.
_max_inner_loop
)
:
arg_0
.
increase_damping
(
)
arg_1
=
arg_0
.
find_LM_updates
(
arg_5
)
arg_2
=
arg_0
.
update_function
(
arg_0
.
param_vals
+
arg_1
)
arg_3
=
(
find_best_step
(
[
arg_0
.
error
,
arg_2
]
)
==
1
)
if
arg_3
:
break
else
:
arg_4
=
arg_0
.
update_function
(
arg_0
.
param_vals
)
CLOG
.
warn
(
'Stuck!'
)
if
np
.
abs
(
arg_4
arg_0
.
error
)
/
arg_4
>
1e-7
:
raise
RuntimeError
(
'Function updates are not exact.'
)
if
arg_3
:
arg_0
.
_last_error
=
arg_0
.
error
arg_0
.
error
=
arg_2
CLOG
.
debug
(
'Good step\t%f\t%f'
%
(
arg_0
.
_last_error
,
arg_0
.
error
)
)
arg_0
.
update_param_vals
(
arg_1
,
incremental
=
True
)
arg_0
.
decrease_damping
(
)

def Func(arg_0):
        """workhorse for do_run_1"""
        if arg_0.check_update_J():
            arg_0.update_J()
        else:
            if arg_0.check_Broyden_J():
                arg_0.update_Broyden_J()
            if arg_0.check_update_eig_J():
                arg_0.update_eig_J()

        #1. Assuming that J starts updated:
        arg_1 = arg_0.find_LM_updates(arg_0.calc_grad())

        #2. Increase damping until we get a good step:
        arg_2 = arg_0.update_function(arg_0.param_vals + arg_1)
        arg_3 = (find_best_step([arg_0.error, arg_2]) == 1)
        if not arg_3:
            arg_4 = arg_0.update_function(arg_0.param_vals)
            if np.abs(arg_4 -arg_0.error)/arg_4 > 1e-7:
                raise RuntimeError('Function updates are not exact.')
            CLOG.debug('Bad step, increasing damping')
            CLOG.debug('\t\t%f\t%f' % (arg_0.error, arg_2))
            arg_5 = arg_0.calc_grad()
            for arg_6 in range(arg_0._max_inner_loop):
                arg_0.increase_damping()
                arg_1 = arg_0.find_LM_updates(arg_5)
                arg_2 = arg_0.update_function(arg_0.param_vals + arg_1)
                arg_3 = (find_best_step([arg_0.error, arg_2]) == 1)
                if arg_3:
                    break
            else:
                arg_4 = arg_0.update_function(arg_0.param_vals)
                CLOG.warn('Stuck!')
                if np.abs(arg_4 -arg_0.error)/arg_4 > 1e-7:
                    raise RuntimeError('Function updates are not exact.')

        #state is updated, now params:
        if arg_3:
            arg_0._last_error = arg_0.error
            arg_0.error = arg_2
            CLOG.debug('Good step\t%f\t%f' % (arg_0._last_error, arg_0.error))
            arg_0.update_param_vals(arg_1, incremental=True)
            arg_0.decrease_damping()


return [[int(self.table.cell_values[0][1]), int(self.table.cell_values[0][2])],
                [int(self.table.cell_values[1][1]), int(self.table.cell_values[1][2])]]

def Func ( arg_0 ) : return [ [ int ( arg_0 . table . cell_values [ 0 ] [ 1 ] ) , int ( arg_0 . table . cell_values [ 0 ] [ 2 ] ) ] , [ int ( arg_0 . table . cell_values [ 1 ] [ 1 ] ) , int ( arg_0 . table . cell_values [ 1 ] [ 2 ] ) ] ]

def Func(arg_0):
        """Convert this confusion matrix into a 2x2 plain list of values."""
        return [[int(arg_0.table.cell_values[0][1]), int(arg_0.table.cell_values[0][2])],
                [int(arg_0.table.cell_values[1][1]), int(arg_0.table.cell_values[1][2])]]

Convert this confusion matrix into a 2x2 plain list of values .


def Func(arg_0, arg_1=arg_2):
        """Return the RSSI signal strength in decibels."""
        # Kick off query to get RSSI, then wait for it to return asyncronously
        # when the _Func_changed() function is called.
        arg_0._Func_read.clear()
        arg_0._peripheral.readRSSI()
        if not arg_0._Func_read.wait(arg_1):
            raise RuntimeError('Exceeded timeout waiting for RSSI value!')
        return arg_0._Func

Return the RSSI signal strength in decibels .


def Func ( arg_0 , arg_1 , arg_2 = 0.7 ) : arg_3 , arg_4 = arg_0 , arg_1 arg_5 = max ( 0 , min ( arg_2 , 1 ) ) arg_6 = arg_5 arg_7 = ColorTheme ( name = arg_3 . name [ : int ( len ( arg_3 . name ) * arg_5 ) ] + arg_4 . name [ int ( len ( arg_4 . name ) * arg_6 ) : ] , ranges = arg_3 . ranges [ : int ( len ( arg_3 . ranges ) * arg_5 ) ] + arg_4 . ranges [ int ( len ( arg_4 . ranges ) * arg_6 ) : ] , top = arg_3 . top , cache = os . path . join ( DEFAULT_CACHE , "Funcd" ) , blue = arg_3 . blue , length = arg_3 . length * arg_5 + arg_4 . length * arg_6 ) arg_7 . tags = arg_3 . tags [ : int ( len ( arg_3 . tags ) * arg_5 ) ] arg_7 . tags += arg_4 . tags [ int ( len ( arg_4 . tags ) * arg_6 ) : ] return arg_7

def Func(arg_0, arg_1, arg_2=0.7):
        """
        Genetic recombination of two themes using cut and splice technique.
        """
        arg_3, arg_4 = arg_0, arg_1
        arg_5 = max(0, min(arg_2, 1))
        arg_6 = arg_5

        arg_7 = ColorTheme(
            name=arg_3.name[:int(len(arg_3.name) * arg_5)] +
                 arg_4.name[int(len(arg_4.name) * arg_6):],
            ranges=arg_3.ranges[:int(len(arg_3.ranges) * arg_5)] +
                   arg_4.ranges[int(len(arg_4.ranges) * arg_6):],
            top=arg_3.top,
            cache=os.path.join(DEFAULT_CACHE, "Funcd"),
            blue=arg_3.blue,
            length=arg_3.length * arg_5 + arg_4.length * arg_6
        )
        arg_7.tags = arg_3.tags[:int(len(arg_3.tags) * arg_5)]
        arg_7.tags += arg_4.tags[int(len(arg_4.tags) * arg_6):]
        return arg_7

Genetic recombination of two themes using cut and splice technique .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : arg_1 [ arg_2 ] = replace_chars_for_svg_code ( arg_3 ) return super ( SVGDocument , arg_0 ) . Func ( arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """ Fill the content of the document with the information in doc_contents.
        This is different from the TextDocument Func function, because this will
        check for symbools in the values of `doc_content` and replace them
        to good XML codes before Funcing the template.

        Parameters
        ----------
        doc_contents: dict
            Set of values to set the template document.

        Returns
        -------
        Funced_doc: str
            The content of the document with the template information Funced.
        """
        for arg_2, arg_3 in arg_1.items():
            arg_1[arg_2] = replace_chars_for_svg_code(arg_3)

        return super(SVGDocument, arg_0).Func(arg_1=arg_1)

Fill the content of the document with the information in doc_contents.
        This is different from the TextDocument fill function, because this will
        check for symbools in the values of `doc_content` and replace them
        to good XML codes before filling the template.

        Parameters
        ----------
        doc_contents: dict
            Set of values to set the template document.

        Returns
        -------
        filled_doc: str
            The content of the document with the template information filled.

Fill the content of the document with the information in doc_contents . This is different from the TextDocument fill function because this will check for symbools in the values of doc_content and replace them to good XML codes before filling the template .


return self.get_conn().create_queue(QueueName=queue_name, Attributes=attributes or {})

def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . get_conn ( ) . Func ( QueueName = arg_1 , Attributes = arg_2 or { } )

def Func(arg_0, arg_1, arg_2=None):
        """
        Create queue using connection object

        :param queue_name: name of the queue.
        :type queue_name: str
        :param attributes: additional attributes for the queue (default: None)
            For details of the attributes parameter see :py:meth:`botocore.client.SQS.Func`
        :type attributes: dict

        :return: dict with the information about the queue
            For details of the returned value see :py:meth:`botocore.client.SQS.Func`
        :rtype: dict
        """
        return arg_0.get_conn().Func(QueueName=arg_1, Attributes=arg_2 or {})

Create queue using connection object

        :param queue_name: name of the queue.
        :type queue_name: str
        :param attributes: additional attributes for the queue (default: None)
            For details of the attributes parameter see :py:meth:`botocore.client.SQS.create_queue`
        :type attributes: dict

        :return: dict with the information about the queue
            For details of the returned value see :py:meth:`botocore.client.SQS.create_queue`
        :rtype: dict


def Func ( ) : arg_0 = { 'services' : { 'capture' : ServiceStatus . str ( get_service_status ( Service . CAPTURE ) ) , 'ingest' : ServiceStatus . str ( get_service_status ( Service . INGEST ) ) , 'schedule' : ServiceStatus . str ( get_service_status ( Service . SCHEDULE ) ) , 'agentstate' : ServiceStatus . str ( get_service_status ( Service . AGENTSTATE ) ) } } return make_response ( jsonify ( { 'meta' : arg_0 } ) )

def Func():
    '''Serve a json representation of internal agentstate as meta data
    '''
    arg_0 = {'services': {
        'capture': ServiceStatus.str(get_service_status(Service.CAPTURE)),
        'ingest': ServiceStatus.str(get_service_status(Service.INGEST)),
        'schedule': ServiceStatus.str(get_service_status(Service.SCHEDULE)),
        'agentstate': ServiceStatus.str(get_service_status(Service.AGENTSTATE))
        }
    }
    return make_response(jsonify({'meta': arg_0}))


(self, column, values=None, inplace=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """Encode column as ordinal values and mark it as categorical.

        The existing column is renamed to a hidden column and replaced by a numerical columns
        with values between [0, len(values)-1].
        """
        arg_1 = _ensure_string_from_expression(arg_1)
        arg_4 = arg_0 if arg_3 else arg_0.copy()
        # for the codes, we need to work on the unfiltered dataset, since the filter
        # may change, and we also cannot add an array that is smaller in length
        arg_5 = arg_4.copy()
        # maybe we need some filter manipulation methods
        arg_5.select_nothing(name=FILTER_SELECTION_NAME)
        arg_5._length_unfiltered = arg_4._length_original
        arg_5.set_active_range(0, arg_4._length_original)
        # codes point to the index of found_values
        # meaning: found_values[codes[0]] == ds[column].values[0]
        arg_7, arg_8 = arg_5.unique(arg_1, return_inverse=True)
        if arg_2 is None:
            arg_2 = arg_7
        else:
            # we have specified which values we should support, anything
            # not found will be masked
            arg_9 = np.zeros(len(arg_7), dtype=np.uint64)
            # mark values that are in the column, but not in values with a special value
            arg_10 = len(arg_7)
            for arg_11, arg_12 in enumerate(arg_7):
                try:
                    arg_12 = arg_12.decode('ascii')
                except:
                    pass
                if arg_12 not in arg_2:  # not present, we need a missing value
                    arg_9[arg_11] = arg_10
                else:
                    arg_9[arg_11] = arg_2.index(arg_12)
            arg_8 = arg_9[arg_8]
            if arg_10 in arg_9:
                # all special values will be marked as missing
                arg_8 = np.ma.masked_array(arg_8, arg_8==arg_10)

        arg_13 = arg_4.rename_column(arg_1, '__original_' + arg_1, unique=True)
        arg_14 = [str(k) for k in arg_2]
        arg_4.add_column(arg_1, arg_8)
        arg_4._categories[arg_1] = dict(arg_14=arg_14, N=len(arg_2), arg_2=arg_2)
        return arg_4

Encode column as ordinal values and mark it as categorical .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 not in arg_0 . value : arg_0 . value [ arg_1 ] = ReducedMetric ( arg_0 . reducer ) arg_0 . value [ arg_1 ] . Func ( arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Updates a value of a given key and apply reduction"""
    if arg_1 not in arg_0.value:
      arg_0.value[arg_1] = ReducedMetric(arg_0.reducer)

    arg_0.value[arg_1].Func(arg_2)


return tf.cond(
      pred=tf.equal(tf.rank(a), tf.rank(b)),
      true_fn=all_shapes_equal,
      false_fn=lambda: tf.constant(False))

def Func ( arg_0 , arg_1 ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , name = "a" ) arg_1 = tf . convert_to_tensor ( value = arg_1 , name = "b" ) def all_shapes_equal ( ) : return tf . reduce_all ( input_tensor = tf . equal ( tf . concat ( [ tf . shape ( input = arg_0 ) , tf . shape ( input = arg_1 ) ] , 0 ) , tf . concat ( [ tf . shape ( input = arg_1 ) , tf . shape ( input = arg_0 ) ] , 0 ) ) ) return tf . cond ( pred = tf . equal ( tf . rank ( arg_0 ) , tf . rank ( arg_1 ) ) , true_fn = all_shapes_equal , false_fn = lambda : tf . constant ( False ) )

def Func(arg_0, arg_1):
  """Returns whether a and b have the same dynamic shape.

  Args:
    a: `Tensor`
    b: `Tensor`

  Returns:
    `bool` `Tensor` representing if both tensors have the same shape.
  """
  arg_0 = tf.convert_to_tensor(value=arg_0, name="a")
  arg_1 = tf.convert_to_tensor(value=arg_1, name="b")

  # Here we can't just do tf.equal(a.shape, b.shape), since
  # static shape inference may break the equality comparison between
  # shape(a) and shape(b) in tf.equal.
  def all_shapes_equal():
    return tf.reduce_all(
        input_tensor=tf.equal(
            tf.concat([tf.shape(input=arg_0), tf.shape(input=arg_1)], 0),
            tf.concat([tf.shape(input=arg_1), tf.shape(input=arg_0)], 0)))

  # One of the shapes isn't fully defined, so we need to use the dynamic
  # shape.
  return tf.cond(
      pred=tf.equal(tf.rank(arg_0), tf.rank(arg_1)),
      true_fn=all_shapes_equal,
      false_fn=lambda: tf.constant(False))

Returns whether a and b have the same dynamic shape .


def Func ( arg_0 ) : for arg_1 , arg_2 in list ( arg_0 . items ( ) ) : if arg_2 is None or str ( arg_2 ) == '' : del arg_0 [ arg_1 ] if isinstance ( arg_2 , dict ) : arg_0 [ arg_1 ] = Func ( arg_0 [ arg_1 ] ) return arg_0

def Func(arg_0):
    """
    Prune the "None" or emptry string values from dictionary items
    """
    for arg_1, arg_2 in list(arg_0.items()):
        if arg_2 is None or str(arg_2) == '':
            del arg_0[arg_1]

        if isinstance(arg_2, dict):
            arg_0[arg_1] = Func(arg_0[arg_1])

    return arg_0

Prune the None or emptry string values from dictionary items


(prob, transition, p_state=None, p_init=None, return_logp=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False):
    '''Viterbi decoding from discriminative state predictions.

    Given a sequence of conditional state predictions `prob[s, t]`,
    indicating the conditional likelihood of state `s` given the
    observation at time `t`, and a transition matrix `transition[i, j]`
    which encodes the conditional probability of moving from state `i`
    to state `j`, the Viterbi algorithm computes the most likely sequence
    of states from the observations.

    This implementation uses the standard Viterbi decoding algorithm
    for observation likelihood sequences, under the assumption that
    `P[Obs(t) | State(t) = s]` is proportional to
    `P[State(t) = s | Obs(t)] / P[State(t) = s]`, where the denominator
    is the marginal probability of state `s` occurring as given by `p_state`.

    Parameters
    ----------
    prob : np.ndarray [shape=(n_states, n_steps), non-negative]
        `prob[s, t]` is the probability of state `s` conditional on
        the observation at time `t`.
        Must be non-negative and sum to 1 along each column.

    transition : np.ndarray [shape=(n_states, n_states), non-negative]
        `transition[i, j]` is the probability of a transition from i->j.
        Each row must sum to 1.

    p_state : np.ndarray [shape=(n_states,)]
        Optional: marginal probability distribution over states,
        must be non-negative and sum to 1.
        If not provided, a uniform distribution is assumed.

    p_init : np.ndarray [shape=(n_states,)]
        Optional: initial state distribution.
        If not provided, it is assumed to be uniform.

    return_logp : bool
        If `True`, return the log-likelihood of the state sequence.

    Returns
    -------
    Either `states` or `(states, logp)`:

    states : np.ndarray [shape=(n_steps,)]
        The most likely state sequence.

    logp : scalar [float]
        If `return_logp=True`, the log probability of `states` given
        the observations.

    See Also
    --------
    viterbi : Viterbi decoding from observation likelihoods
    viterbi_binary: Viterbi decoding for multi-label, conditional state likelihoods

    Examples
    --------
    This example constructs a simple, template-based discriminative chord estimator,
    using CENS chroma as input features.

    .. note:: this chord model is not accurate enough to use in practice. It is only
            intended to demonstrate how to use discriminative Viterbi decoding.

    >>> # Create templates for major, minor, and no-chord qualities
    >>> maj_template = np.array([1,0,0, 0,1,0, 0,1,0, 0,0,0])
    >>> min_template = np.array([1,0,0, 1,0,0, 0,1,0, 0,0,0])
    >>> N_template   = np.array([1,1,1, 1,1,1, 1,1,1, 1,1,1.]) / 4.
    >>> # Generate the weighting matrix that maps chroma to labels
    >>> weights = np.zeros((25, 12), dtype=float)
    >>> labels = ['C:maj', 'C#:maj', 'D:maj', 'D#:maj', 'E:maj', 'F:maj',
    ...           'F#:maj', 'G:maj', 'G#:maj', 'A:maj', 'A#:maj', 'B:maj',
    ...           'C:min', 'C#:min', 'D:min', 'D#:min', 'E:min', 'F:min',
    ...           'F#:min', 'G:min', 'G#:min', 'A:min', 'A#:min', 'B:min',
    ...           'N']
    >>> for c in range(12):
    ...     weights[c, :] = np.roll(maj_template, c) # c:maj
    ...     weights[c + 12, :] = np.roll(min_template, c)  # c:min
    >>> weights[-1] = N_template  # the last row is the no-chord class
    >>> # Make a self-loop transition matrix over 25 states
    >>> trans = librosa.sequence.transition_loop(25, 0.9)

    >>> # Load in audio and make features
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> chroma = librosa.feature.chroma_cens(y=y, sr=sr, bins_per_octave=36)
    >>> # Map chroma (observations) to class (state) likelihoods
    >>> probs = np.exp(weights.dot(chroma))  # P[class | chroma] proportional to exp(template' chroma)
    >>> probs /= probs.sum(axis=0, keepdims=True)  # probabilities must sum to 1 in each column
    >>> # Compute independent frame-wise estimates
    >>> chords_ind = np.argmax(probs, axis=0)
    >>> # And viterbi estimates
    >>> chords_vit = librosa.sequence.Func(probs, trans)

    >>> # Plot the features and prediction map
    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(10, 6))
    >>> plt.subplot(2,1,1)
    >>> librosa.display.specshow(chroma, x_axis='time', y_axis='chroma')
    >>> plt.colorbar()
    >>> plt.subplot(2,1,2)
    >>> librosa.display.specshow(weights, x_axis='chroma')
    >>> plt.yticks(np.arange(25) + 0.5, labels)
    >>> plt.ylabel('Chord')
    >>> plt.colorbar()
    >>> plt.tight_layout()

    >>> # And plot the results
    >>> plt.figure(figsize=(10, 4))
    >>> librosa.display.specshow(probs, x_axis='time', cmap='gray')
    >>> plt.colorbar()
    >>> times = librosa.frames_to_time(np.arange(len(chords_vit)))
    >>> plt.scatter(times, chords_ind + 0.75, color='lime', alpha=0.5, marker='+', s=15, label='Independent')
    >>> plt.scatter(times, chords_vit + 0.25, color='deeppink', alpha=0.5, marker='o', s=15, label='Viterbi')
    >>> plt.yticks(0.5 + np.unique(chords_vit), [labels[i] for i in np.unique(chords_vit)], va='center')
    >>> plt.legend(loc='best')
    >>> plt.tight_layout()

    '''

    arg_5, arg_6 = arg_0.shape

    if arg_1.shape != (arg_5, arg_5):
        raise ParameterError('transition.shape={}, must be '
                             '(n_states, n_states)={}'.format(arg_1.shape,
                                                              (arg_5, arg_5)))

    if np.any(arg_1 < 0) or not np.allclose(arg_1.sum(axis=1), 1):
        raise ParameterError('Invalid transition matrix: must be non-negative '
                             'and sum to 1 on each row.')

    if np.any(arg_0 < 0) or not np.allclose(arg_0.sum(axis=0), 1):
        raise ParameterError('Invalid probability values: each column must '
                             'sum to 1 and be non-negative')

    arg_7 = np.zeros(arg_6, dtype=int)
    arg_8 = np.zeros((arg_6, arg_5), dtype=float)
    arg_9 = np.zeros((arg_6, arg_5), dtype=int)

    # Compute log-likelihoods while avoiding log-underflow
    arg_10 = np.finfo(arg_0.dtype).tiny

    # Compute marginal log probabilities while avoiding underflow
    if arg_2 is None:
        arg_2 = np.empty(arg_5)
        arg_2.fill(1./arg_5)
    elif arg_2.shape != (arg_5,):
        raise ParameterError('Marginal distribution p_state must have shape (n_states,). '
                             'Got p_state.shape={}'.format(arg_2.shape))
    elif np.any(arg_2 < 0) or not np.allclose(arg_2.sum(axis=-1), 1):
        raise ParameterError('Invalid marginal state distribution: '
                             'p_state={}'.format(arg_2))

    arg_11 = np.log(arg_1 + arg_10)
    arg_12 = np.log(arg_2 + arg_10)

    # By Bayes' rule, P[X | Y] * P[Y] = P[Y | X] * P[X]
    # P[X] is constant for the sake of maximum likelihood inference
    # and P[Y] is given by the marginal distribution p_state.
    #
    # So we have P[X | y] \propto P[Y | x] / P[Y]
    # if X = observation and Y = states, this can be done in log space as
    # log P[X | y] \propto \log P[Y | x] - \log P[Y]
    arg_13 = np.log(arg_0.T + arg_10) - arg_12

    if arg_3 is None:
        arg_3 = np.empty(arg_5)
        arg_3.fill(1./arg_5)
    elif np.any(arg_3 < 0) or not np.allclose(arg_3.sum(), 1):
        raise ParameterError('Invalid initial state distribution: '
                             'p_init={}'.format(arg_3))

    arg_14 = np.log(arg_3 + arg_10)

    _viterbi(arg_13, arg_11, arg_14, arg_7, arg_8, arg_9)

    if arg_4:
        return arg_7, arg_8[-1, arg_7[-1]]

    return arg_7

Viterbi decoding from discriminative state predictions.

    Given a sequence of conditional state predictions `prob[s, t]`,
    indicating the conditional likelihood of state `s` given the
    observation at time `t`, and a transition matrix `transition[i, j]`
    which encodes the conditional probability of moving from state `i`
    to state `j`, the Viterbi algorithm computes the most likely sequence
    of states from the observations.

    This implementation uses the standard Viterbi decoding algorithm
    for observation likelihood sequences, under the assumption that
    `P[Obs(t) | State(t) = s]` is proportional to
    `P[State(t) = s | Obs(t)] / P[State(t) = s]`, where the denominator
    is the marginal probability of state `s` occurring as given by `p_state`.

    Parameters
    ----------
    prob : np.ndarray [shape=(n_states, n_steps), non-negative]
        `prob[s, t]` is the probability of state `s` conditional on
        the observation at time `t`.
        Must be non-negative and sum to 1 along each column.

    transition : np.ndarray [shape=(n_states, n_states), non-negative]
        `transition[i, j]` is the probability of a transition from i->j.
        Each row must sum to 1.

    p_state : np.ndarray [shape=(n_states,)]
        Optional: marginal probability distribution over states,
        must be non-negative and sum to 1.
        If not provided, a uniform distribution is assumed.

    p_init : np.ndarray [shape=(n_states,)]
        Optional: initial state distribution.
        If not provided, it is assumed to be uniform.

    return_logp : bool
        If `True`, return the log-likelihood of the state sequence.

    Returns
    -------
    Either `states` or `(states, logp)`:

    states : np.ndarray [shape=(n_steps,)]
        The most likely state sequence.

    logp : scalar [float]
        If `return_logp=True`, the log probability of `states` given
        the observations.

    See Also
    --------
    viterbi : Viterbi decoding from observation likelihoods
    viterbi_binary: Viterbi decoding for multi-label, conditional state likelihoods

    Examples
    --------
    This example constructs a simple, template-based discriminative chord estimator,
    using CENS chroma as input features.

    .. note:: this chord model is not accurate enough to use in practice. It is only
            intended to demonstrate how to use discriminative Viterbi decoding.

    >>> # Create templates for major, minor, and no-chord qualities
    >>> maj_template = np.array([1,0,0, 0,1,0, 0,1,0, 0,0,0])
    >>> min_template = np.array([1,0,0, 1,0,0, 0,1,0, 0,0,0])
    >>> N_template   = np.array([1,1,1, 1,1,1, 1,1,1, 1,1,1.]) / 4.
    >>> # Generate the weighting matrix that maps chroma to labels
    >>> weights = np.zeros((25, 12), dtype=float)
    >>> labels = ['C:maj', 'C#:maj', 'D:maj', 'D#:maj', 'E:maj', 'F:maj',
    ...           'F#:maj', 'G:maj', 'G#:maj', 'A:maj', 'A#:maj', 'B:maj',
    ...           'C:min', 'C#:min', 'D:min', 'D#:min', 'E:min', 'F:min',
    ...           'F#:min', 'G:min', 'G#:min', 'A:min', 'A#:min', 'B:min',
    ...           'N']
    >>> for c in range(12):
    ...     weights[c, :] = np.roll(maj_template, c) # c:maj
    ...     weights[c + 12, :] = np.roll(min_template, c)  # c:min
    >>> weights[-1] = N_template  # the last row is the no-chord class
    >>> # Make a self-loop transition matrix over 25 states
    >>> trans = librosa.sequence.transition_loop(25, 0.9)

    >>> # Load in audio and make features
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> chroma = librosa.feature.chroma_cens(y=y, sr=sr, bins_per_octave=36)
    >>> # Map chroma (observations) to class (state) likelihoods
    >>> probs = np.exp(weights.dot(chroma))  # P[class | chroma] proportional to exp(template' chroma)
    >>> probs /= probs.sum(axis=0, keepdims=True)  # probabilities must sum to 1 in each column
    >>> # Compute independent frame-wise estimates
    >>> chords_ind = np.argmax(probs, axis=0)
    >>> # And viterbi estimates
    >>> chords_vit = librosa.sequence.viterbi_discriminative(probs, trans)

    >>> # Plot the features and prediction map
    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(10, 6))
    >>> plt.subplot(2,1,1)
    >>> librosa.display.specshow(chroma, x_axis='time', y_axis='chroma')
    >>> plt.colorbar()
    >>> plt.subplot(2,1,2)
    >>> librosa.display.specshow(weights, x_axis='chroma')
    >>> plt.yticks(np.arange(25) + 0.5, labels)
    >>> plt.ylabel('Chord')
    >>> plt.colorbar()
    >>> plt.tight_layout()

    >>> # And plot the results
    >>> plt.figure(figsize=(10, 4))
    >>> librosa.display.specshow(probs, x_axis='time', cmap='gray')
    >>> plt.colorbar()
    >>> times = librosa.frames_to_time(np.arange(len(chords_vit)))
    >>> plt.scatter(times, chords_ind + 0.75, color='lime', alpha=0.5, marker='+', s=15, label='Independent')
    >>> plt.scatter(times, chords_vit + 0.25, color='deeppink', alpha=0.5, marker='o', s=15, label='Viterbi')
    >>> plt.yticks(0.5 + np.unique(chords_vit), [labels[i] for i in np.unique(chords_vit)], va='center')
    >>> plt.legend(loc='best')
    >>> plt.tight_layout()

Viterbi decoding from discriminative state predictions .


def Func ( arg_0 , arg_1 ) : from airflow . models . dag import DagModel arg_2 = arg_1 if arg_1 in arg_0 . dags : arg_3 = arg_0 . dags [ arg_1 ] if arg_3 . is_subdag : arg_2 = arg_3 . parent_dag . dag_id arg_4 = DagModel . get_current ( arg_2 ) if arg_4 and ( arg_2 not in arg_0 . dags or ( arg_4 . last_expired and arg_3 . last_loaded < arg_4 . last_expired ) ) : arg_5 = arg_0 . process_file ( filepath = arg_4 . fileloc , only_if_updated = False ) if arg_5 and arg_1 in [ arg_6 . dag_id for arg_6 in arg_5 ] : return arg_0 . dags [ arg_1 ] elif arg_1 in arg_0 . dags : del arg_0 . dags [ arg_1 ] return arg_0 . dags . get ( arg_1 )

def Func(arg_0, arg_1):
        """
        Gets the DAG out of the dictionary, and refreshes it if expired
        """
        from airflow.models.dag import DagModel  # Avoid circular import

        # If asking for a known subdag, we want to refresh the parent
        arg_2 = arg_1
        if arg_1 in arg_0.dags:
            arg_3 = arg_0.dags[arg_1]
            if arg_3.is_subdag:
                arg_2 = arg_3.parent_dag.dag_id

        # If the dag corresponding to root_dag_id is absent or expired
        arg_4 = DagModel.get_current(arg_2)
        if arg_4 and (
                arg_2 not in arg_0.dags or
                (
                    arg_4.last_expired and
                    arg_3.last_loaded < arg_4.last_expired
                )
        ):
            # Reprocess source file
            arg_5 = arg_0.process_file(
                filepath=arg_4.fileloc, only_if_updated=False)

            # If the source file no longer exports `dag_id`, delete it from self.dags
            if arg_5 and arg_1 in [arg_6.dag_id for arg_6 in arg_5]:
                return arg_0.dags[arg_1]
            elif arg_1 in arg_0.dags:
                del arg_0.dags[arg_1]
        return arg_0.dags.get(arg_1)

Gets the DAG out of the dictionary and refreshes it if expired


def Func ( arg_0 ) : arg_1 = urllib . request . urlopen ( arg_0 . URL ) arg_2 = ET . ElementTree ( file = arg_1 ) arg_3 = arg_0 . _parse_deputies ( arg_2 . getroot ( ) ) arg_4 = pd . DataFrame ( arg_3 , columns = ( 'congressperson_id' , 'budget_id' , 'condition' , 'congressperson_document' , 'civil_name' , 'congressperson_name' , 'picture_url' , 'gender' , 'state' , 'party' , 'phone_number' , 'email' ) ) return arg_0 . _translate ( arg_4 )

def Func(arg_0):
        """
        Fetches the list of deputies for the current term.
        """
        arg_1 = urllib.request.urlopen(arg_0.URL)

        arg_2 = ET.ElementTree(file=arg_1)
        arg_3 = arg_0._parse_deputies(arg_2.getroot())

        arg_4 = pd.DataFrame(arg_3, columns=(
            'congressperson_id',
            'budget_id',
            'condition',
            'congressperson_document',
            'civil_name',
            'congressperson_name',
            'picture_url',
            'gender',
            'state',
            'party',
            'phone_number',
            'email'
        ))
        return arg_0._translate(arg_4)

Fetches the list of deputies for the current term .


Make a request to the Ansible Tower API, and return the
        response.

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Make a Func to the Ansible Tower API, and return the
        response.
        """

        # If the URL has the api/vX at the front strip it off
        # This is common to have if you are extracting a URL from an existing object.
        # For example, any of the 'related' fields of an object will have this
        import re
        arg_2 = re.sub("^/?api/v[0-9]+/", "", arg_2)

        # Piece together the full URL.
        arg_5 = not arg_2.startswith('/o/')
        arg_2 = '%s%s' % (arg_0.get_prefix(arg_5), arg_2.lstrip('/'))

        # Ansible Tower expects authenticated Funcs; add the authentication
        # from settings if it's provided.
        arg_4.setdefault(
            'auth',
            BasicTowerAuth(
                settings.username,
                settings.password,
                arg_0
            )
        )

        # POST and PUT Funcs will send JSON by default; make this
        # the content_type by default.  This makes it such that we don't have
        # to constantly write that in our code, which gets repetitive.
        arg_6 = arg_4.get('headers', {})
        if arg_1.upper() in ('PATCH', 'POST', 'PUT'):
            arg_6.setdefault('Content-Type', 'application/json')
            arg_4['headers'] = arg_6

        # If debugging is on, print the URL and data being sent.
        debug.log('%s %s' % (arg_1, arg_2), fg='blue', bold=True)
        if arg_1 in ('POST', 'PUT', 'PATCH'):
            debug.log('Data: %s' % arg_4.get('data', {}),
                      fg='blue', bold=True)
        if arg_1 == 'GET' or arg_4.get('params', None):
            debug.log('Params: %s' % arg_4.get('params', {}),
                      fg='blue', bold=True)
        debug.log('')

        # If this is a JSON Func, encode the data value.
        if arg_6.get('Content-Type', '') == 'application/json':
            arg_4['data'] = json.dumps(arg_4.get('data', {}))

        arg_7 = arg_0._make_Func(arg_1, arg_2, arg_3, arg_4)

        # Sanity check: Did the server send back some kind of internal error?
        # If so, bubble this up.
        if arg_7.status_code >= 500:
            raise exc.ServerError('The Tower server sent back a server error. '
                                  'Please try again later.')

        # Sanity check: Did we fail to authenticate properly?
        # If so, fail out now; this is always a failure.
        if arg_7.status_code == 401:
            raise exc.AuthError('Invalid Tower authentication credentials (HTTP 401).')

        # Sanity check: Did we get a forbidden response, which means that
        # the user isn't allowed to do this? Report that.
        if arg_7.status_code == 403:
            raise exc.Forbidden("You don't have permission to do that (HTTP 403).")

        # Sanity check: Did we get a 404 response?
        # Requests with primary keys will return a 404 if there is no response,
        # and we want to consistently trap these.
        if arg_7.status_code == 404:
            raise exc.NotFound('The Funced object could not be found.')

        # Sanity check: Did we get a 405 response?
        # A 405 means we used a method that isn't allowed. Usually this
        # is a bad Func, but it requires special treatment because the
        # API sends it as a logic error in a few situations (e.g. trying to
        # cancel a job that isn't running).
        if arg_7.status_code == 405:
            raise exc.MethodNotAllowed(
                "The Tower server says you can't make a Func with the "
                "%s method to that URL (%s)." % (arg_1, arg_2),
            )

        # Sanity check: Did we get some other kind of error?
        # If so, write an appropriate error message.
        if arg_7.status_code >= 400:
            raise exc.BadRequest(
                'The Tower server claims it was sent a bad Func.\n\n'
                '%s %s\nParams: %s\nData: %s\n\nResponse: %s' %
                (arg_1, arg_2, arg_4.get('params', None),
                 arg_4.get('data', None), arg_7.content.decode('utf8'))
            )

        # Django REST Framework intelligently prints API keys in the
        # order that they are defined in the models and serializer.
        #
        # We want to preserve this behavior when it is possible to do so
        # with minimal effort, because while the order has no explicit meaning,
        # we make some effort to order keys in a convenient manner.
        #
        # To this end, make this response into an APIResponse subclass
        # (defined below), which has a `json` method that doesn't lose key
        # order.
        arg_7.__class__ = APIResponse

        # Return the response object.
        return arg_7

Make a request to the Ansible Tower API and return the response .


def Func ( arg_0 ) : for arg_1 in arg_0 . workers : if arg_1 . is_alive ( ) : arg_1 . Func ( ) arg_0 . nb_workers_finished = len ( arg_0 . workers ) if not arg_0 . queue_result . _closed : arg_0 . queue_result . close ( ) time . sleep ( 0.01 )

def Func(arg_0):
        """
        Terminates all background processes immediately.

        This will also free their RAM.

        """
        for arg_1 in arg_0.workers:
            if arg_1.is_alive():
                arg_1.Func()
        arg_0.nb_workers_finished = len(arg_0.workers)

        if not arg_0.queue_result._closed:
            arg_0.queue_result.close()
        time.sleep(0.01)

Terminates all background processes immediately .


def Func ( arg_0 = None , arg_1 = { } ) : arg_2 = ConfigParser ( ) arg_2 . read ( arg_0 ) arg_3 = _prepare_working_dict ( arg_2 , arg_1 ) arg_4 = { } for arg_5 , arg_6 in arg_3 . iteritems ( ) : arg_4 [ arg_5 ] = { } for arg_7 in arg_6 : arg_4 [ arg_5 ] [ arg_7 ] = arg_2 . get ( arg_5 , arg_7 ) return Bunch ( arg_4 )

def Func(arg_0=None, arg_1={}):
    """
    This function returns a Bunch object from the stated config file.

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    NOTE:
        The values are not evaluated by default.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    filename:
        The desired config file to read.
        The config file must be written in a syntax readable to the
        ConfigParser module -> INI syntax

        [sectionA]
        optionA1 = ...
        optionA2 = ...

    section_option_dict:
        A dictionary that contains keys, which are associated to the sections
        in the config file, and values, which are a list of the desired
        options.
        If empty, everything will be loaded.
        If the lists are empty, everything from the sections will be loaded.

    Example:
        dict = {'sectionA': ['optionA1', 'optionA2', ...],
                'sectionB': ['optionB1', 'optionB2', ...]}

        config = get_config('config.cfg', dict)
        config.sectionA.optionA1

    Other:
        Bunch can be found in configparser.py
    """

    arg_2 = ConfigParser()
    arg_2.read(arg_0)

    arg_3 = _prepare_working_dict(arg_2, arg_1)

    arg_4 = {}

    for arg_5, arg_6 in arg_3.iteritems():
        arg_4[arg_5] = {}
        for arg_7 in arg_6:
            arg_4[arg_5][arg_7] = arg_2.get(arg_5, arg_7)

    return Bunch(arg_4)

This function returns a Bunch object from the stated config file .


(
    is_singular=False,
    loc_initializer=tf.compat.v1.initializers.random_normal(stddev=0.1),
    untransformed_scale_initializer=tf.compat.v1.initializers.random_normal(
        mean=-3., stddev=0.1),
    loc_regularizer=None,
    untransformed_scale_regularizer=None,
    loc_constraint=None,
    untransformed_scale_constraint=None)

def Func(
    arg_0=False,
    arg_1=arg_2.compat.v1.initializers.random_normal(arg_7=0.1),
    arg_8=arg_2.compat.v1.initializers.random_normal(
        arg_9=-3., arg_7=0.1),
    arg_10=None,
    arg_11=None,
    arg_12=None,
    arg_13=None):
  """Creates a function to build Normal distributions with trainable params.

  This function produces a closure which produces `tfd.Normal`
  parameterized by a loc` and `scale` each created using `tf.get_variable`.

  Args:
    is_singular: Python `bool` if `True`, forces the special case limit of
      `scale->0`, i.e., a `Deterministic` distribution.
    loc_initializer: Initializer function for the `loc` parameters.
      The default is `tf.random_normal_initializer(mean=0., stddev=0.1)`.
    untransformed_scale_initializer: Initializer function for the `scale`
      parameters. Default value: `tf.random_normal_initializer(mean=-3.,
      stddev=0.1)`. This implies the softplus transformed result is initialized
      near `0`. It allows a `Normal` distribution with `scale` parameter set to
      this value to approximately act like a point mass.
    loc_regularizer: Regularizer function for the `loc` parameters.
    untransformed_scale_regularizer: Regularizer function for the `scale`
      parameters.
    loc_constraint: An optional projection function to be applied to the
      loc after being updated by an `Optimizer`. The function must take as input
      the unprojected variable and must return the projected variable (which
      must have the same shape). Constraints are not safe to use when doing
      asynchronous distributed training.
    untransformed_scale_constraint: An optional projection function to be
      applied to the `scale` parameters after being updated by an `Optimizer`
      (e.g. used to implement norm constraints or value constraints). The
      function must take as input the unprojected variable and must return the
      projected variable (which must have the same shape). Constraints are not
      safe to use when doing asynchronous distributed training.

  Returns:
    make_normal_fn: Python `callable` which creates a `tfd.Normal`
      using from args: `dtype, shape, name, trainable, add_variable_fn`.
  """
  arg_14 = default_loc_scale_fn(
      arg_0=arg_0,
      arg_1=arg_1,
      arg_8=arg_8,
      arg_10=arg_10,
      arg_11=arg_11,
      arg_12=arg_12,
      arg_13=arg_13)
  def _fn(arg_15, arg_16, arg_17, arg_18, arg_19):
    """Creates multivariate `Deterministic` or `Normal` distribution.

    Args:
      dtype: Type of parameter's event.
      shape: Python `list`-like representing the parameter's event shape.
      name: Python `str` name prepended to any created (or existing)
        `tf.Variable`s.
      trainable: Python `bool` indicating all created `tf.Variable`s should be
        added to the graph collection `GraphKeys.TRAINABLE_VARIABLES`.
      add_variable_fn: `tf.get_variable`-like `callable` used to create (or
        access existing) `tf.Variable`s.

    Returns:
      Multivariate `Deterministic` or `Normal` distribution.
    """
    arg_20, arg_21 = arg_14(arg_15, arg_16, arg_17, arg_18, arg_19)
    if arg_21 is None:
      arg_22 = tfd.Deterministic(arg_20=arg_20)
    else:
      arg_22 = tfd.Normal(arg_20=arg_20, arg_21=arg_21)
    arg_23 = arg_2.size(input=arg_22.batch_shape_tensor())
    return tfd.Independent(arg_22, reinterpreted_batch_ndims=arg_23)
  return _fn

Creates a function to build Normal distributions with trainable params .


(model, reaction_list1=None, reaction_list2=None,
                             method="fba", solution=None, processes=None,
                             **kwargs)

return _multi_deletion(
        model, 'reaction', element_lists=[reaction_list1, reaction_list2],
        method=method, solution=solution, processes=processes, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None,
                             arg_3="fba", arg_4=None, arg_5=None,
                             **arg_6):
    """
    Knock out each reaction pair from the combinations of two given lists.

    We say 'pair' here but the order order does not matter.

    Parameters
    ----------
    model : cobra.Model
        The metabolic model to perform deletions in.
    reaction_list1 : iterable, optional
        First iterable of ``cobra.Reaction``s to be deleted. If not passed,
        all the reactions from the model are used.
    reaction_list2 : iterable, optional
        Second iterable of ``cobra.Reaction``s to be deleted. If not passed,
        all the reactions from the model are used.
    method: {"fba", "moma", "linear moma", "room", "linear room"}, optional
        Method used to predict the growth rate.
    solution : cobra.Solution, optional
        A previous solution to use as a reference for (linear) MOMA or ROOM.
    processes : int, optional
        The number of parallel processes to run. Can speed up the computations
        if the number of knockouts to perform is large. If not passed,
        will be set to the number of CPUs found.
    kwargs :
        Keyword arguments are passed on to underlying simulation functions
        such as ``add_room``.

    Returns
    -------
    pandas.DataFrame
        A representation of all combinations of reaction deletions. The
        columns are 'growth' and 'status', where

        index : frozenset([str])
            The reaction identifiers that were knocked out.
        growth : float
            The growth rate of the adjusted model.
        status : str
            The solution's status.

    """

    arg_1, arg_2 = _element_lists(arg_0.reactions,
                                                    arg_1,
                                                    arg_2)
    return _multi_deletion(
        arg_0, 'reaction', element_lists=[arg_1, arg_2],
        arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, **arg_6)

Knock out each reaction pair from the combinations of two given lists .


return tf.reduce_logsumexp(input_tensor=ms + vs[..., tf.newaxis, :], axis=-1)

def Func ( arg_0 , arg_1 ) : return tf . reduce_logsumexp ( input_tensor = arg_0 + arg_1 [ ... , tf . newaxis , : ] , axis = - 1 )

def Func(arg_0, arg_1):
  """Multiply tensor of matrices by vectors assuming values stored are logs."""

  return tf.reduce_logsumexp(input_tensor=arg_0 + arg_1[..., tf.newaxis, :], axis=-1)

Multiply tensor of matrices by vectors assuming values stored are logs .


(self, norm=False, form='broadcast', real=False, shift=False)

def Func ( arg_0 , arg_1 = False , arg_2 = 'broadcast' , arg_3 = False , arg_4 = False ) : if arg_1 is False : arg_1 = 1 if arg_1 is True : arg_1 = np . array ( arg_0 . shape ) arg_1 = aN ( arg_1 , arg_0 . dim , dtype = 'float' ) arg_5 = list ( np . fft . fftfreq ( arg_0 . shape [ i ] ) / arg_1 [ i ] for i in range ( arg_0 . dim ) ) if arg_4 : arg_5 = list ( np . fft . fftshift ( t ) for t in arg_5 ) if arg_3 : arg_5 [ - 1 ] = arg_5 [ - 1 ] [ : ( arg_0 . shape [ - 1 ] + 1 ) // 2 ] return arg_0 . _format_vector ( arg_5 , arg_2 = arg_2 )

def Func(arg_0, arg_1=False, arg_2='broadcast', arg_3=False, arg_4=False):
        """
        Return the Func associated with this tile, given the standard form
        of -0.5 to 0.5. `norm` and `form` arguments arethe same as that passed to
        `Tile.coords`.

        Parameters
        -----------
        real : boolean
            whether to return Func associated with the real fft instead
        """
        if arg_1 is False:
            arg_1 = 1
        if arg_1 is True:
            arg_1 = np.array(arg_0.shape)
        arg_1 = aN(arg_1, arg_0.dim, dtype='float')

        arg_5 = list(np.fft.fftfreq(arg_0.shape[i])/arg_1[i] for i in range(arg_0.dim))

        if arg_4:
            arg_5 = list(np.fft.fftshift(t) for t in arg_5)

        if arg_3:
            arg_5[-1] = arg_5[-1][:(arg_0.shape[-1]+1)//2]

        return arg_0._format_vector(arg_5, arg_2=arg_2)

Return the kvectors associated with this tile, given the standard form
        of -0.5 to 0.5. `norm` and `form` arguments arethe same as that passed to
        `Tile.coords`.

        Parameters
        -----------
        real : boolean
            whether to return kvectors associated with the real fft instead

Return the kvectors associated with this tile given the standard form of - 0 . 5 to 0 . 5 . norm and form arguments arethe same as that passed to Tile . coords .


def Func ( arg_0 , arg_1 = True ) : arg_2 = arg_0 . parent . Func ( arg_0 . id ) if arg_1 : arg_0 . wait ( ) return arg_2

def Func(arg_0, arg_1=True):
        """
        Delete this droplet

        Parameters
        ----------
        wait: bool, default True
            Whether to block until the pending action is completed
        """
        arg_2 = arg_0.parent.Func(arg_0.id)
        if arg_1:
            arg_0.wait()
        return arg_2


def Func ( arg_0 ) : if arg_0 == AllOps . RISING_EDGE : return SENSITIVITY . RISING elif arg_0 == AllOps . FALLING_EDGE : return SENSITIVITY . FALLING else : raise TypeError ( )

def Func(arg_0):
    """
    get sensitivity type for operator
    """
    if arg_0 == AllOps.RISING_EDGE:
        return SENSITIVITY.RISING
    elif arg_0 == AllOps.FALLING_EDGE:
        return SENSITIVITY.FALLING
    else:
        raise TypeError()


def Func ( arg_0 , arg_1 = '' ) : for arg_2 in '\\:;' : if arg_2 in arg_0 : return True arg_3 = io . StringIO ( arg_0 ) try : list ( tokenize . generate_tokens ( arg_3 . readline ) ) return arg_1 . rstrip ( ) . endswith ( '\\' ) except ( SyntaxError , tokenize . TokenError ) : return True

def Func(arg_0, arg_1=''):
    """Return True if this is part of a multiline statement."""
    for arg_2 in '\\:;':
        if arg_2 in arg_0:
            return True

    arg_3 = io.StringIO(arg_0)
    try:
        list(tokenize.generate_tokens(arg_3.readline))
        return arg_1.rstrip().endswith('\\')
    except (SyntaxError, tokenize.TokenError):
        return True

Return True if this is part of a multiline statement .


def
Func
(
arg_0
)
:
arg_1
=
{
}
for
arg_2
,
arg_3
in
arg_0
.
items
(
)
:
if
not
type
(
arg_3
)
in
PREPROCESSORS
:
raise
KeyError
(
'Invalid type in dict: {}'
.
format
(
type
(
arg_3
)
)
)
arg_1
[
arg_2
]
=
PREPROCESSORS
[
type
(
arg_3
)
]
(
arg_3
)
return
arg_1

def Func(arg_0):
    '''
    Preprocess a dict to be used as environment variables.

    :param d: dict to be processed
    '''

    arg_1 = {}
    for arg_2, arg_3 in arg_0.items():

        if not type(arg_3) in PREPROCESSORS:
            raise KeyError('Invalid type in dict: {}'.format(type(arg_3)))

        arg_1[arg_2] = PREPROCESSORS[type(arg_3)](arg_3)

    return arg_1

Preprocess a dict to be used as environment variables .


def Func ( arg_0 , arg_1 , ** arg_2 ) : @ arg_0 . create_table class DataItem ( pw . Model ) : arg_3 = pw . DateTimeField ( default = dt . datetime . utcnow ) arg_4 = pw . CharField ( )

def Func(arg_0, arg_1, **arg_2):
    """ Write your migrations here.

    > Model = migrator.orm['name']

    > migrator.sql(sql)
    > migrator.create_table(Model)
    > migrator.drop_table(Model, cascade=True)
    > migrator.add_columns(Model, **fields)
    > migrator.change_columns(Model, **fields)
    > migrator.drop_columns(Model, *field_names, cascade=True)
    > migrator.rename_column(Model, old_field_name, new_field_name)
    > migrator.rename_table(Model, new_table_name)
    > migrator.add_index(Model, *col_names, unique=False)
    > migrator.drop_index(Model, index_name)
    > migrator.add_not_null(Model, field_name)
    > migrator.drop_not_null(Model, field_name)
    > migrator.add_default(Model, field_name, default)

    """
    @arg_0.create_table
    class DataItem(pw.Model):
        arg_3 = pw.DateTimeField(default=dt.datetime.utcnow)
        arg_4 = pw.CharField()


return self.THUMBNAIL_TEMPLATE.format(
            snippet=self.get_description()[1], thumbnail=self.thumb_file,
            ref_name=self.reference)

def Func ( arg_0 ) : return arg_0 . THUMBNAIL_TEMPLATE . format ( snippet = arg_0 . get_description ( ) [ 1 ] , thumbnail = arg_0 . thumb_file , ref_name = arg_0 . reference )

def Func(arg_0):
        """The string for creating the thumbnail of this example"""
        return arg_0.THUMBNAIL_TEMPLATE.format(
            snippet=arg_0.get_description()[1], thumbnail=arg_0.thumb_file,
            ref_name=arg_0.reference)


(
    df,
    id_cols: List[str],
    reference_cols: List[str],
    value_cols: List[str],
    new_value_cols: List[str] = None,
    cols_to_keep: List[str] = None
)

def Func(
    arg_0,
    arg_1: arg_2[arg_3],
    arg_4: arg_2[arg_3],
    arg_5: arg_2[arg_3],
    arg_6: arg_2[arg_3] = None,
    arg_7: arg_2[arg_3] = None
):
    """
    Compute cumsum for a group of columns.

    ---

    ### Parameters

    *mandatory :*
    - `id_cols` (*list*): the columns id to create each group
    - `reference_cols` (*list*): the columns to order the cumsum
    - `value_cols` (*list*): the columns to cumsum

    *optional :*
    - `new_value_cols` (*list*): the new columns with the result cumsum
    - `cols_to_keep` (*list*): other columns to keep in the dataset.
      This option can be used if there is only one row by group [id_cols + reference_cols]

    ---

    ### Example

    **Input**

    MONTH | DAY | NAME | VALUE | X
    :---:|:---:|:--:|:---:|:---:
     1   |   1 |   A  |  1 | lo
     2   |   1 |   A  |  1 | lo
     2   |  15 |   A  |  1 | la
     1   |  15 |   B  |  1 | la

    ```cson
    Func:
      id_cols: ['NAME']
      reference_cols: ['MONTH', 'DAY']
      cumsum_cols: ['VALUE']
      cols_to_keep: ['X']
    ```

    **Output**

    NAME | MONTH | DAY | X | VALUE
    :---:|:---:|:--:|:---:|:---:
     A  |   1  |    1 | lo  |    1
     A  |   2  |    1 | la  |    2
     A  |   2  |   15 | lo  |    3
     B  |   1  |   15 | la  |    1
    """
    if arg_7 is None:
        arg_7 = []

    if arg_6 is None:
        arg_6 = arg_5
    if len(arg_5) != len(arg_6):
        raise ParamsValueError('`value_cols` and `new_value_cols` needs '
                               'to have the same number of elements')

    check_params_columns_duplicate(arg_1 + arg_4 + arg_7 + arg_5)

    arg_8 = list(range(0, len(arg_1)))

    arg_0 = arg_0.groupby(arg_1 + arg_4 + arg_7).sum()
    arg_0[arg_6] = arg_0.groupby(level=arg_8)[arg_5].cumsum()

    return arg_0.reset_index()

Compute cumsum for a group of columns.

    ---

    ### Parameters

    *mandatory :*
    - `id_cols` (*list*): the columns id to create each group
    - `reference_cols` (*list*): the columns to order the cumsum
    - `value_cols` (*list*): the columns to cumsum

    *optional :*
    - `new_value_cols` (*list*): the new columns with the result cumsum
    - `cols_to_keep` (*list*): other columns to keep in the dataset.
      This option can be used if there is only one row by group [id_cols + reference_cols]

    ---

    ### Example

    **Input**

    MONTH | DAY | NAME | VALUE | X
    :---:|:---:|:--:|:---:|:---:
     1   |   1 |   A  |  1 | lo
     2   |   1 |   A  |  1 | lo
     2   |  15 |   A  |  1 | la
     1   |  15 |   B  |  1 | la

    ```cson
    compute_cumsum:
      id_cols: ['NAME']
      reference_cols: ['MONTH', 'DAY']
      cumsum_cols: ['VALUE']
      cols_to_keep: ['X']
    ```

    **Output**

    NAME | MONTH | DAY | X | VALUE
    :---:|:---:|:--:|:---:|:---:
     A  |   1  |    1 | lo  |    1
     A  |   2  |    1 | la  |    2
     A  |   2  |   15 | lo  |    3
     B  |   1  |   15 | la  |    1


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = util . parse_time_string ( arg_2 ) if not arg_3 : os . utime ( arg_0 . _file_path , ( arg_4 , arg_4 ) ) return True

def Func(arg_0, arg_1, arg_2, arg_3):
        """Set last modified time for destPath to timeStamp on epoch-format"""
        # Translate time from RFC 1123 to seconds since epoch format
        arg_4 = util.parse_time_string(arg_2)
        if not arg_3:
            os.utime(arg_0._file_path, (arg_4, arg_4))
        return True

Set last modified time for destPath to timeStamp on epoch - format


def Func ( arg_0 ) : arg_1 = Site . objects . get_current ( ) arg_2 = get_dict_to_encoded_url ( arg_0 ) arg_3 = '{}_{}' . format ( arg_1 . domain , arg_2 ) return hashlib . md5 ( arg_3 ) . hexdigest ( )

def Func(arg_0):
    """
    Build a unique key from get data
    """
    arg_1 = Site.objects.get_current()
    arg_2 = get_dict_to_encoded_url(arg_0)
    arg_3 = '{}_{}'.format(arg_1.domain, arg_2)
    return hashlib.md5(arg_3).hexdigest()


return Maybe(method_cache.entry(key, None)).or_else(
            lambda: method_cache.entry(self._default, None)  # type: ignore
        )

def Func ( arg_0 , arg_1 : arg_2 ) -> Optional [ Method ] : arg_3 = arg_0 . methods return Maybe ( arg_3 . entry ( arg_1 , None ) ) . or_else ( lambda : arg_3 . entry ( arg_0 . _default , None ) )

def Func(arg_0, arg_1: arg_2) -> Optional[Method]:
        """Return the method which would handle this dispatch key or
        None if no method defined for this key and no default."""
        arg_3 = arg_0.methods
        # The 'type: ignore' comment below silences a spurious MyPy error
        # about having a return statement in a method which does not return.
        return Maybe(arg_3.entry(arg_1, None)).or_else(
            lambda: arg_3.entry(arg_0._default, None)  # type: ignore
        )

Return the method which would handle this dispatch key or None if no method defined for this key and no default .


def Func ( arg_0 , arg_1 , arg_2 ) : if 0 == len ( arg_2 ) : yield arg_1 , else : for arg_3 in arg_0 . edges [ arg_1 ] : if arg_0 . nodes [ arg_3 ] [ FUNCTION ] == arg_2 [ 0 ] : for arg_4 in Func ( arg_0 , arg_3 , arg_2 [ 1 : ] ) : if arg_1 not in arg_4 : yield ( arg_1 , ) + arg_4

def Func(arg_0, arg_1, arg_2):
    """Matches a simple metapath starting at the given node

    :param pybel.BELGraph graph: A BEL graph
    :param tuple node: A BEL node
    :param list[str] simple_metapath: A list of BEL Functions
    :return: An iterable over paths from the node matching the metapath
    :rtype: iter[tuple]
    """
    if 0 == len(arg_2):
        yield arg_1,

    else:
        for arg_3 in arg_0.edges[arg_1]:
            if arg_0.nodes[arg_3][FUNCTION] == arg_2[0]:
                for arg_4 in Func(arg_0, arg_3, arg_2[1:]):
                    if arg_1 not in arg_4:
                        yield (arg_1,) + arg_4


(self, redirect_uri: str, scope: Optional[str] = None, state: Optional[str] = None)

return OAuth2.url_(self.http.client_id, redirect_uri, scope=scope, state=state)

def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_2] = None, arg_5: arg_4[arg_2] = None) -> arg_2:
        """Generate an outh2 url for user authentication.

        Parameters
        ----------
        redirect_uri : str
            Where spotify should redirect the user to after authentication.
        scope : Optional[str]
            Space seperated spotify scopes for different levels of access.
        state : Optional[str]
            Using a state value can increase your assurance that an incoming connection is the result of an authentication request.

        Returns
        -------
        url : str
            The OAuth2 url.
        """
        return OAuth2.url_(arg_0.http.client_id, arg_1, arg_3=arg_3, arg_5=arg_5)

Generate an outh2 url for user authentication .


def Func ( arg_0 , arg_1 ) : arg_0 . tags = list ( set ( arg_0 . tags or [ ] ) - set ( [ arg_1 ] ) )

def Func(arg_0, arg_1):
        """
            Removes a tag from this object
        """
        arg_0.tags = list(set(arg_0.tags or []) - set([arg_1]))


def Func ( arg_0 = None , arg_1 = None ) : arg_0 = arg_0 or [ 'en' ] arg_1 = arg_1 or ( GENDER_FEMALE , GENDER_MALE ) arg_2 = _get_Funcs ( arg_0 ) arg_3 = { 'm' : 0 , 'f' : 1 } [ random . choice ( arg_1 ) ] return random . choice ( arg_2 ) [ arg_3 ]

def Func(arg_0=None, arg_1=None):
    """
    returns a random Func

    .. code-block:: python

        >>> d.Func()
        u'Mrs.'
        >>> d.Func(['es'])
        u'El Sr.'
        >>> d.Func(None, [GENDER_FEMALE])
        u'Mrs.'

    :param languages: list of allowed languages. ['en'] if None
    :param genders: list of allowed genders. (GENDER_FEMALE, GENDER_MALE) if None
    """
    arg_0 = arg_0 or ['en']
    arg_1 = arg_1 or (GENDER_FEMALE, GENDER_MALE)

    arg_2 = _get_Funcs(arg_0)
    arg_3 = {'m':0, 'f':1}[random.choice(arg_1)]

    return random.choice(arg_2)[arg_3]

returns a random title

    .. code-block:: python

        >>> d.title()
        u'Mrs.'
        >>> d.title(['es'])
        u'El Sr.'
        >>> d.title(None, [GENDER_FEMALE])
        u'Mrs.'

    :param languages: list of allowed languages. ['en'] if None
    :param genders: list of allowed genders. (GENDER_FEMALE, GENDER_MALE) if None


def Func ( arg_0 ) : return ( HTML_START . format ( arg_0 = arg_0 ) , HTML_END . format ( arg_0 = arg_0 ) )

def Func(arg_0):
    """Return sequence of start and end regex patterns for simple HTML tag"""
    return (HTML_START.format(arg_0=arg_0), HTML_END.format(arg_0=arg_0))


def Func(arg_0, arg_1, arg_2):
        "Associate the given client data with the item at position n."
        arg_0.wx_obj.SetClientData(arg_1, arg_2)
        # reverse association:
        arg_0._items_dict[arg_2] = arg_0.get_string(arg_1)

Associate the given client data with the item at position n .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_3 . environ . get ( arg_0 , None ) if arg_1 is not None : arg_3 . environ [ arg_0 ] = arg_1 elif arg_0 in arg_3 . environ : del arg_3 . environ [ arg_0 ] try : yield finally : if arg_2 is not None : arg_3 . environ [ arg_0 ] = arg_2 elif arg_0 in arg_3 . environ : del arg_3 . environ [ arg_0 ]

def Func(arg_0, arg_1):
    """Fix environment variable to a value within context. Unset if value is None."""
    arg_2 = arg_3.environ.get(arg_0, None)
    if arg_1 is not None:
        # Set if value is not None
        arg_3.environ[arg_0] = arg_1
    elif arg_0 in arg_3.environ:
        # Unset if value is None
        del arg_3.environ[arg_0]
    try:
        yield
    finally:
        if arg_2 is not None:
            # Restore original value
            arg_3.environ[arg_0] = arg_2
        elif arg_0 in arg_3.environ:
            # Unset
            del arg_3.environ[arg_0]

Fix environment variable to a value within context . Unset if value is None .


def
Func
(
arg_0
,
arg_1
=
,
)
:
arg_2
=
{
'float'
:
FloatStatsCollector
,
'int'
:
IntStatsCollector
,
'string'
:
StringStatsCollector
,
'datetime'
:
DateTimeStatsCollector
,
'bool'
:
BoolStatsCollector
,
}
arg_0
=
resource_filename
(
"nupic.datafiles"
,
arg_0
)
print
"*"
*
40
print
"Collecting statistics for file:'%s'"
%
(
arg_0
,
)
arg_3
=
FileRecordStream
(
arg_0
)
arg_4
=
[
]
for
arg_5
,
arg_6
,
arg_7
in
arg_3
.
getFields
(
)
:
arg_8
=
arg_2
[
arg_6
]
(
arg_5
,
arg_6
,
arg_7
)
arg_4
.
append
(
arg_8
)
if
arg_1
is
:
arg_1
=
500000
for
arg_9
in
xrange
(
arg_1
)
:
arg_10
=
arg_3
.
getNextRecord
(
)
if
arg_10
is
:
break
for
arg_9
,
arg_11
in
enumerate
(
arg_10
)
:
arg_4
[
arg_9
]
.
addValue
(
arg_11
)
arg_12
=
{
}
for
arg_8
in
arg_4
:
arg_8
.
getStats
(
arg_12
)
if
arg_3
.
getResetFieldIdx
(
)
is
not
:
arg_13
,
arg_14
,
arg_14
=
arg_3
.
getFields
(
)
[
arg_3
.
reset
]
arg_12
.
pop
(
arg_13
)
if
VERBOSITY
>
0
:
pprint
.
pprint
(
arg_12
)
return
arg_12

def Func(arg_0, arg_1 = None,):
  """
  Collect statistics for each of the fields in the user input data file and
  return a stats dict object.

  Parameters:
  ------------------------------------------------------------------------------
  filename:             The path and name of the data file.
  maxSamples:           Upper bound on the number of rows to be processed
  retval:               A dictionary of dictionaries. The top level keys are the
                        field names and the corresponding values are the statistics
                        collected for the individual file.
                        Example:
                        {
                          'consumption':{'min':0,'max':90,'mean':50,...},
                          'gym':{'numDistinctCategories':10,...},
                          ...
                         }

  """
  # Mapping from field type to stats collector object
  arg_2 = {'float':    FloatStatsCollector,
                           'int':      IntStatsCollector,
                           'string':   StringStatsCollector,
                           'datetime': DateTimeStatsCollector,
                           'bool':     BoolStatsCollector,
                           }

  arg_0 = resource_filename("nupic.datafiles", arg_0)
  print "*"*40
  print "Collecting statistics for file:'%s'" % (arg_0,)
  arg_3 = FileRecordStream(arg_0)

  # Initialize collector objects
  # statsCollectors list holds statsCollector objects for each field
  arg_4 = []
  for arg_5, arg_6, arg_7 in arg_3.getFields():
    # Find the corresponding stats collector for each field based on field type
    # and intialize an instance
    arg_8 = \
            arg_2[arg_6](arg_5, arg_6, arg_7)
    arg_4.append(arg_8)

  # Now collect the stats
  if arg_1 is None:
    arg_1 = 500000
  for arg_9 in xrange(arg_1):
    arg_10 = arg_3.getNextRecord()
    if arg_10 is None:
      break
    for arg_9, arg_11 in enumerate(arg_10):
      arg_4[arg_9].addValue(arg_11)

  # stats dict holds the statistics for each field
  arg_12 = {}
  for arg_8 in arg_4:
    arg_8.getStats(arg_12)

  # We don't want to include reset field in permutations
  # TODO: handle reset field in a clean way
  if arg_3.getResetFieldIdx() is not None:
    arg_13,arg_14,arg_14 = arg_3.getFields()[arg_3.reset]
    arg_12.pop(arg_13)

  if VERBOSITY > 0:
    pprint.pprint(arg_12)

  return arg_12

Collect statistics for each of the fields in the user input data file and return a stats dict object .


return "{}-{}-{}".format(self.service_prefix,
                                 self.service_owner,
                                 server_name
                                 )

def Func(arg_0):
        """
        Service name inside the Docker Swarm

        service_suffix should be a numerical value unique for user
        {service_prefix}-{service_owner}-{service_suffix}
        """
        if hasattr(arg_0, "server_name") and arg_0.server_name:
            arg_1 = arg_0.server_name
        else:
            arg_1 = 1

        return "{}-{}-{}".format(arg_0.service_prefix,
                                 arg_0.service_owner,
                                 arg_1
                                 )


def Func(arg_0, arg_1=False):
    """
    Detect crs string format and parse into crs object with appropriate function.

    Arguments:

    - *text*: The crs text representation of unknown type.
    - *strict* (optional): When True, the parser is strict about names having to match
        exactly with upper and lowercases. Default is not strict (False).

    Returns:

    - CRS object.
    """

    if arg_0.startswith("+"):
        arg_2 = from_proj4(arg_0, arg_1)

    elif arg_0.startswith(("PROJCS[","GEOGCS[")):
        arg_2 = from_unknown_wkt(arg_0, arg_1)

    #elif text.startswith("urn:"):
    #    crs = from_ogc_urn(text, strict)

    elif arg_0.startswith("EPSG:"):
        arg_2 = from_epsg_code(arg_0.split(":")[1])

    elif arg_0.startswith("ESRI:"):
        arg_2 = from_esri_code(arg_0.split(":")[1])

    elif arg_0.startswith("SR-ORG:"):
        arg_2 = from_sr_code(arg_0.split(":")[1])

    else: raise FormatError("Could not auto-detect the type of crs format, make sure it is one of the supported formats")

    return arg_2

Detect crs string format and parse into crs object with appropriate function .


(data, out=None, chunksize=None,
        baseargsort=None,
        argmerge=None, np=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : if arg_3 is None : arg_3 = lambda x : x . Func ( ) if arg_4 is None : arg_4 = default_argmerge if arg_2 is None : arg_2 = 1024 * 1024 * 16 if arg_1 is None : arg_6 = numpy . empty ( len ( arg_0 ) , dtype = 'intp' ) arg_1 = arg_6 else : assert arg_1 . dtype == numpy . dtype ( 'intp' ) assert len ( arg_1 ) == len ( arg_0 ) arg_6 = arg_1 if arg_5 is None : arg_5 = sharedmem . cpu_count ( ) if arg_5 <= 1 or len ( arg_0 ) < arg_2 : arg_1 [ : ] = arg_3 ( arg_0 ) return arg_1 arg_7 = [ slice ( arg_9 , arg_9 + arg_2 ) for arg_9 in range ( 0 , len ( arg_0 ) , arg_2 ) ] arg_8 = slice ( len ( arg_0 ) , len ( arg_0 ) ) if len ( arg_7 ) % 2 : arg_7 . append ( arg_8 ) with sharedmem . TPool ( ) as pool : def work ( arg_9 ) : arg_10 = arg_7 [ arg_9 ] arg_11 , arg_12 , arg_13 = arg_10 . indices ( len ( arg_0 ) ) arg_6 [ arg_10 ] = arg_3 ( arg_0 [ arg_10 ] ) arg_6 [ arg_10 ] += arg_11 pool . map ( work , range ( len ( arg_7 ) ) ) arg_14 = numpy . empty_like ( arg_6 ) arg_15 = 0 while len ( arg_7 ) > 1 : with sharedmem . TPool ( ) as pool : def work ( arg_9 ) : arg_16 = arg_7 [ arg_9 ] arg_17 = arg_7 [ arg_9 + 1 ] arg_18 , arg_19 , arg_20 = arg_16 . indices ( len ( arg_0 ) ) arg_21 , arg_22 , arg_23 = arg_17 . indices ( len ( arg_0 ) ) assert arg_21 == arg_19 arg_4 ( arg_0 , arg_6 [ arg_16 ] , arg_6 [ arg_17 ] , arg_14 [ arg_18 : arg_22 ] ) return slice ( arg_18 , arg_22 ) arg_7 = pool . map ( work , range ( 0 , len ( arg_7 ) , 2 ) ) arg_6 , arg_14 = arg_14 , arg_6 arg_15 = arg_15 + 1 if len ( arg_7 ) == 1 : break if len ( arg_7 ) % 2 : arg_7 . append ( arg_8 ) if arg_15 % 2 != 0 : arg_1 [ : ] = arg_6 return arg_1

def Func(arg_0, arg_1=None, arg_2=None,
        arg_3=None,
        arg_4=None, arg_5=None):
    """
     parallel Func, like numpy.Func

     use sizeof(intp) * len(data) as scratch space

     use baseFunc for serial sort
         ind = baseFunc(data)

     use argmerge to merge
         def argmerge(data, A, B, out):
             ensure data[out] is sorted
             and out[:] = A join B

     TODO: shall try to use the inplace merge mentioned in
            http://keithschwarz.com/interesting/code/?dir=inplace-merge.
    """
    if arg_3 is None:
        arg_3 = lambda x:x.Func()

    if arg_4 is None:
        arg_4 = default_argmerge

    if arg_2 is None:
        arg_2 = 1024 * 1024 * 16

    if arg_1 is None:
        arg_6 = numpy.empty(len(arg_0), dtype='intp')
        arg_1 = arg_6
    else:
        assert arg_1.dtype == numpy.dtype('intp')
        assert len(arg_1) == len(arg_0)
        arg_6 = arg_1

    if arg_5 is None:
        arg_5 = sharedmem.cpu_count()

    if arg_5 <= 1 or len(arg_0) < arg_2:
        arg_1[:] = arg_3(arg_0)
        return arg_1

    arg_7 = [slice(arg_9, arg_9 + arg_2) for arg_9 in range(0, len(arg_0), arg_2)]
    arg_8 = slice(len(arg_0), len(arg_0))
    if len(arg_7) % 2: arg_7.append(arg_8)
    with sharedmem.TPool() as pool:
        def work(arg_9):
            arg_10 = arg_7[arg_9]
            arg_11, arg_12, arg_13 = arg_10.indices(len(arg_0))
            arg_6[arg_10] = arg_3(arg_0[arg_10])
            arg_6[arg_10] += arg_11
        pool.map(work, range(len(arg_7)))

    arg_14 = numpy.empty_like(arg_6)

    arg_15 = 0
    while len(arg_7) > 1:
        with sharedmem.TPool() as pool:
            def work(arg_9):
                arg_16 = arg_7[arg_9]
                arg_17 = arg_7[arg_9+1]
                arg_18, arg_19, arg_20 = arg_16.indices(len(arg_0))
                arg_21, arg_22, arg_23 = arg_17.indices(len(arg_0))
        #        print 'argmerge', start1, stop1, start2, stop2
                assert arg_21 == arg_19
                arg_4(arg_0, arg_6[arg_16], arg_6[arg_17], arg_14[arg_18:arg_22])
                return slice(arg_18, arg_22)
            arg_7 = pool.map(work, range(0, len(arg_7), 2))
            arg_6, arg_14 = arg_14, arg_6
            arg_15 = arg_15 + 1
        if len(arg_7) == 1: break
        if len(arg_7) % 2: arg_7.append(arg_8)
    if arg_15 % 2 != 0:
        # only even flips out ends up pointing to arg2 and needs to be
        # copied
        arg_1[:] = arg_6
    return arg_1

parallel argsort, like numpy.argsort

     use sizeof(intp) * len(data) as scratch space

     use baseargsort for serial sort
         ind = baseargsort(data)

     use argmerge to merge
         def argmerge(data, A, B, out):
             ensure data[out] is sorted
             and out[:] = A join B

     TODO: shall try to use the inplace merge mentioned in
            http://keithschwarz.com/interesting/code/?dir=inplace-merge.


def Func(arg_0, **arg_1):
        """List all roles.

        Args:
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the roles returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        # API request - get items
        arg_2 = arg_0._session.get_items(
            API_ENDPOINT,
            params=arg_1
        )

        # Yield role objects created from the returned JSON objects
        for arg_3 in arg_2:
            yield arg_0._object_factory(OBJECT_TYPE, arg_3)


(self, layout, stream=None, encoding=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = sys . stdout if not arg_3 : arg_3 = getattr ( arg_2 , "encoding" , "UTF-8" ) arg_0 . encoding = arg_3 or "UTF-8" arg_0 . out = arg_2 arg_0 . begin_Func ( ) arg_1 . accept ( arg_0 ) arg_0 . end_Func ( )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Func and write the given layout into the stream object

        unicode policy: unicode strings may be found in the layout;
        try to call stream.write with it, but give it back encoded using
        the given encoding if it fails
        """
        if arg_2 is None:
            arg_2 = sys.stdout
        if not arg_3:
            arg_3 = getattr(arg_2, "encoding", "UTF-8")
        arg_0.encoding = arg_3 or "UTF-8"
        arg_0.out = arg_2
        arg_0.begin_Func()
        arg_1.accept(arg_0)
        arg_0.end_Func()

format and write the given layout into the stream object

        unicode policy: unicode strings may be found in the layout;
        try to call stream.write with it, but give it back encoded using
        the given encoding if it fails


return (ec, self.addCaptureToErr(ev, output), tb)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . capturedOutput = output = arg_0 . buffer arg_0 . _buf = None if not output : return arg_2 arg_5 , arg_6 , arg_7 = arg_2 return ( arg_5 , arg_0 . addCaptureToErr ( arg_6 , output ) , arg_7 )

def Func(arg_0, arg_1, arg_2):
        """Add captured output to error report.
        """
        arg_1.capturedOutput = output = arg_0.buffer
        arg_0._buf = None
        if not output:
            # Don't return None as that will prevent other
            # formatters from formatting and remove earlier formatters
            # formats, instead return the err we got
            return arg_2
        arg_5, arg_6, arg_7 = arg_2
        return (arg_5, arg_0.addCaptureToErr(arg_6, output), arg_7)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ entry for entry in arg_0 if all ( entry . matches ( f ) for f in arg_1 ) and not any ( entry . matches ( e ) for e in arg_2 ) ] return arg_3

def Func(arg_0, arg_1, arg_2):
    """
    Filters a list of host entries according to the given filters.

    :param entries: A list of host entries.
    :type entries: [:py:class:`HostEntry`]
    :param filters: Regexes that must match a `HostEntry`.
    :type filters: [``str``]
    :param exclude: Regexes that must NOT match a `HostEntry`.
    :type exclude: [``str``]

    :return: The filtered list of host entries.
    :rtype: [:py:class:`HostEntry`]
    """
    arg_3 = [entry
                for entry in arg_0
                if all(entry.matches(f) for f in arg_1)
                and not any(entry.matches(e) for e in arg_2)]
    return arg_3

Filters a list of host entries according to the given filters .


def Func(arg_0):
        """
        Retrieve the servername extension value if provided in the client hello
        message, or None if there wasn't one.

        :return: A byte string giving the server name or :data:`None`.

        .. versionadded:: 0.13
        """
        arg_1 = _lib.SSL_Func(
            arg_0._ssl, _lib.TLSEXT_NAMETYPE_host_name
        )
        if arg_1 == _ffi.NULL:
            return None

        return _ffi.string(arg_1)

Retrieve the servername extension value if provided in the client hello message or None if there wasn t one .


def Func(arg_0, arg_1):
    """Call CLI command with arguments and returns its return value.

    Parameters
    ----------
    cmd_name: str
        Command name or full path to the binary file.

    arg_strings: list of str
        Argument strings list.

    Returns
    -------
    return_value
        Command return value.
    """
    if not op.isabs(arg_0):
        arg_2 = which(arg_0)
    else:
        arg_2 = arg_0

    try:
        arg_3 = [arg_2] + arg_1

        log.info('Calling: {}.'.format(arg_3))
        arg_4 = subprocess.check_call(arg_3)
    except CalledProcessError as ce:
        log.exception("Error calling command {} with arguments: "
                      "{} \n With return code: {}".format(arg_0, arg_1,
                                                          ce.returncode))
        raise
    else:
        return arg_4

Call CLI command with arguments and returns its return value .


def Func(arg_0="gromacs.log"):
    """Start logging of messages to file and console.

    The default logfile is named ``gromacs.log`` and messages are
    logged with the tag *gromacs*.
    """
    from . import log
    log.create("gromacs", arg_0=arg_0)
    logging.getLogger("gromacs").info("GromacsWrapper %s STARTED logging to %r",
                                      __version__, arg_0)

Start logging of messages to file and console .


Display a list of cases for an institute.

return dict(institute=institute_obj, skip_assigned=skip_assigned,
                is_research=is_research, query=query, **data)

def Func ( arg_0 ) : arg_1 = institute_and_case ( store , arg_0 ) arg_2 = request . args . get ( 'query' ) arg_3 = 100 if request . args . get ( 'limit' ) : arg_3 = int ( request . args . get ( 'limit' ) ) arg_4 = request . args . get ( 'skip_assigned' ) arg_5 = request . args . get ( 'is_research' ) arg_6 = store . Func ( collaborator = arg_0 , name_query = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 ) arg_7 = controllers . Func ( store , arg_6 , arg_3 ) arg_8 = controllers . get_sanger_unevaluated ( store , arg_0 , current_user . email ) if len ( arg_8 ) > 0 : arg_7 [ 'sanger_unevaluated' ] = arg_8 return dict ( institute = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_2 = arg_2 , ** arg_7 )

def Func(arg_0):
    """Display a list of Func for an institute."""
    arg_1 = institute_and_case(store, arg_0)
    arg_2 = request.args.get('query')

    arg_3 = 100
    if request.args.get('limit'):
        arg_3 = int(request.args.get('limit'))

    arg_4 = request.args.get('skip_assigned')
    arg_5 = request.args.get('is_research')
    arg_6 = store.Func(collaborator=arg_0, name_query=arg_2,
                        arg_4=arg_4, arg_5=arg_5)
    arg_7 = controllers.Func(store, arg_6, arg_3)

    arg_8 = controllers.get_sanger_unevaluated(store, arg_0, current_user.email)
    if len(arg_8)> 0:
        arg_7['sanger_unevaluated'] = arg_8

    return dict(institute=arg_1, arg_4=arg_4,
                arg_5=arg_5, arg_2=arg_2, **arg_7)

Display a list of cases for an institute .


(
        data: dict, fmt='{key}={value}', sep=', ', public_only=True
)

return '{' + sep.join([
        to_str(data=v, fmt=fmt, sep=sep)
        if isinstance(v, dict) else fstr(fmt=fmt, key=k, value=v)
        for k, v in data.items() if k in keys
    ]) + '}'

def
Func
(
arg_0
:
arg_1
,
arg_2
=
'{key}={value}'
,
arg_3
=
', '
,
arg_4
=
True
)
->
str
:
if
arg_4
:
arg_5
=
list
(
filter
(
lambda
vv
:
vv
[
0
]
!=
'_'
,
arg_0
.
keys
(
)
)
)
else
:
arg_5
=
list
(
arg_0
.
keys
(
)
)
return
'{'
+
arg_3
.
join
(
[
Func
(
arg_0
=
arg_7
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
if
isinstance
(
arg_7
,
arg_1
)
else
fstr
(
arg_2
=
arg_2
,
key
=
arg_6
,
value
=
arg_7
)
for
arg_6
,
arg_7
in
arg_0
.
items
(
)
if
arg_6
in
arg_5
]
)
+
'}'

def Func(
        arg_0: arg_1, arg_2='{key}={value}', arg_3=', ', arg_4=True
) -> str:
    """
    Convert dict to string

    Args:
        data: dict
        fmt: how key and value being represented
        sep: how pairs of key and value are seperated
        public_only: if display public members only

    Returns:
        str: string representation of dict

    Examples:
        >>> test_dict = dict(b=1, a=0, c=2, _d=3)
        >>> Func(test_dict)
        '{b=1, a=0, c=2}'
        >>> Func(test_dict, sep='|')
        '{b=1|a=0|c=2}'
        >>> Func(test_dict, public_only=False)
        '{b=1, a=0, c=2, _d=3}'
    """
    if arg_4: arg_5 = list(filter(lambda vv: vv[0] != '_', arg_0.keys()))
    else: arg_5 = list(arg_0.keys())
    return '{' + arg_3.join([
        Func(arg_0=arg_7, arg_2=arg_2, arg_3=arg_3)
        if isinstance(arg_7, arg_1) else fstr(arg_2=arg_2, key=arg_6, value=arg_7)
        for arg_6, arg_7 in arg_0.items() if arg_6 in arg_5
    ]) + '}'

Convert dict to string

    Args:
        data: dict
        fmt: how key and value being represented
        sep: how pairs of key and value are seperated
        public_only: if display public members only

    Returns:
        str: string representation of dict

    Examples:
        >>> test_dict = dict(b=1, a=0, c=2, _d=3)
        >>> to_str(test_dict)
        '{b=1, a=0, c=2}'
        >>> to_str(test_dict, sep='|')
        '{b=1|a=0|c=2}'
        >>> to_str(test_dict, public_only=False)
        '{b=1, a=0, c=2, _d=3}'


return self._mc_client._put(url=self._build_path(store_id, 'customers', customer_id), data=data)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Add or update a customer.

        :param store_id: The store id.
        :type store_id: :py:class:`str`
        :param customer_id: The id for the customer of a store.
        :type customer_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "id": string*,
            "email_address": string*,
            "opt_in_status": boolean
        }
        """
        arg_0.store_id = arg_1
        arg_0.customer_id = arg_2
        if 'id' not in arg_3:
            raise KeyError('The store customer must have an id')
        if 'email_address' not in arg_3:
            raise KeyError('Each store customer must have an email_address')
        check_email(arg_3['email_address'])
        if 'opt_in_status' not in arg_3:
            raise KeyError('The store customer must have an opt_in_status')
        if arg_3['opt_in_status'] not in [True, False]:
            raise TypeError('The opt_in_status must be True or False')
        return arg_0._mc_client._put(url=arg_0._build_path(arg_1, 'customers', arg_2), arg_3=arg_3)


(y, radius, mode='two_sided', valid_only=False)

def Func ( arg_0 , arg_1 , arg_2 = 'two_sided' , arg_3 = False ) : assert arg_2 in ( 'two_sided' , 'causal' ) if len ( arg_0 ) < 2 * arg_1 + 1 : return np . ones_like ( arg_0 ) * arg_0 . mean ( ) elif arg_2 == 'two_sided' : arg_4 = np . ones ( 2 * arg_1 + 1 ) arg_5 = np . convolve ( arg_0 , arg_4 , arg_2 = 'same' ) / np . convolve ( np . ones_like ( arg_0 ) , arg_4 , arg_2 = 'same' ) if arg_3 : arg_5 [ : arg_1 ] = arg_5 [ - arg_1 : ] = np . nan elif arg_2 == 'causal' : arg_4 = np . ones ( arg_1 ) arg_5 = np . convolve ( arg_0 , arg_4 , arg_2 = 'full' ) / np . convolve ( np . ones_like ( arg_0 ) , arg_4 , arg_2 = 'full' ) arg_5 = arg_5 [ : - arg_1 + 1 ] if arg_3 : arg_5 [ : arg_1 ] = np . nan return arg_5

def Func(arg_0, arg_1, arg_2='two_sided', arg_3=False):
    '''
    Smooth signal y, where radius is determines the size of the window

    mode='twosided':
        average over the window [max(index - radius, 0), min(index + radius, len(y)-1)]
    mode='causal':
        average over the window [max(index - radius, 0), index]

    valid_only: put nan in entries where the full-sized window is not available

    '''
    assert arg_2 in ('two_sided', 'causal')
    if len(arg_0) < 2*arg_1+1:
        return np.ones_like(arg_0) * arg_0.mean()
    elif arg_2 == 'two_sided':
        arg_4 = np.ones(2 * arg_1+1)
        arg_5 = np.convolve(arg_0, arg_4,arg_2='same') / np.convolve(np.ones_like(arg_0), arg_4, arg_2='same')
        if arg_3:
            arg_5[:arg_1] = arg_5[-arg_1:] = np.nan
    elif arg_2 == 'causal':
        arg_4 = np.ones(arg_1)
        arg_5 = np.convolve(arg_0, arg_4,arg_2='full') / np.convolve(np.ones_like(arg_0), arg_4, arg_2='full')
        arg_5 = arg_5[:-arg_1+1]
        if arg_3:
            arg_5[:arg_1] = np.nan
    return arg_5

Smooth signal y where radius is determines the size of the window