(config: Union[str, Path, dict],
                                     iterator: Union[DataLearningIterator, DataFittingIterator] = None, *,
                                     to_train: bool = True,
                                     evaluation_targets: Optional[Iterable[str]] = None,
                                     to_validate: Optional[bool] = None,
                                     download: bool = False,
                                     start_epoch_num: Optional[int] = None,
                                     recursive: bool = False)

def Func(arg_0: arg_1[arg_2, arg_3, arg_4],
                                     arg_5: arg_1[arg_6, arg_7] = None, *,
                                     arg_8: arg_9 = True,
                                     arg_10: arg_11[arg_12[arg_2]] = None,
                                     arg_13: arg_11[arg_9] = None,
                                     arg_14: arg_9 = False,
                                     arg_15: arg_11[arg_16] = None,
                                     arg_17: arg_9 = False) -> Dict[arg_2, Dict[arg_2, float]]:
    """Make training and evaluation of the model described in corresponding configuration file."""
    arg_0 = parse_config(arg_0)

    if arg_14:
        deep_download(arg_0)

    if arg_8 and arg_17:
        for arg_18 in get_all_elems_from_json(arg_0['chainer'], 'config_path'):
            log.info(f'Training "{subconfig}"')
            Func(arg_18, arg_14=False, arg_17=True)

    import_packages(arg_0.get('metadata', {}).get('imports', []))

    if arg_5 is None:
        try:
            arg_19 = read_data_by_config(arg_0)
        except ConfigError as e:
            arg_8 = False
            log.warning(f'Skipping training. {e.message}')
        else:
            arg_5 = get_iterator_from_config(arg_0, arg_19)

    if 'train' not in arg_0:
        log.warning('Train config is missing. Populating with default values')
    arg_20 = arg_0.get('train')

    if arg_15 is not None:
        arg_20['start_epoch_num'] = arg_15

    if 'evaluation_targets' not in arg_20 and ('validate_best' in arg_20
                                                     or 'test_best' in arg_20):
        log.warning('"validate_best" and "test_best" parameters are deprecated.'
                    ' Please, use "evaluation_targets" list instead')

        arg_20['evaluation_targets'] = []
        if arg_20.pop('validate_best', True):
            arg_20['evaluation_targets'].append('valid')
        if arg_20.pop('test_best', True):
            arg_20['evaluation_targets'].append('test')

    arg_21 = get_model(arg_20.pop('class_name', 'nn_trainer'))
    arg_22 = arg_21(arg_0['chainer'], **arg_20)

    if arg_8:
        arg_22.train(arg_5)

    arg_23 = {}

    if arg_5 is not None:
        if arg_13 is not None:
            if arg_10 is None:
                log.warning('"to_validate" parameter is deprecated and will be removed in future versions.'
                            ' Please, use "evaluation_targets" list instead')
                arg_10 = ['test']
                if arg_13:
                    arg_10.append('valid')
            else:
                log.warn('Both "evaluation_targets" and "to_validate" parameters are specified.'
                         ' "to_validate" is deprecated and will be ignored')

        arg_23 = arg_22.evaluate(arg_5, arg_10, print_reports=True)
        arg_22.get_chainer().destroy()

    arg_23 = {k: v['metrics'] for k, v in arg_23.items()}

    return arg_23

Make training and evaluation of the model described in corresponding configuration file .


(
        self, dataset_name, imagesize, voxelres,
            offset, timerange, scalinglevels, scaling)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) : Func = { } Func [ 'dataset_name' ] = arg_1 Func [ 'imagesize' ] = arg_2 Func [ 'voxelres' ] = arg_3 if arg_4 is not None : Func [ 'offset' ] = arg_4 if arg_5 is not None : Func [ 'timerange' ] = arg_5 if arg_6 is not None : Func [ 'scalinglevels' ] = arg_6 if arg_7 is not None : Func [ 'scaling' ] = arg_7 return Func

def Func(
        arg_0, arg_1, arg_2, arg_3,
            arg_4, arg_5, arg_6, arg_7):
        """Generate the dataset dictionary"""
        Func = {}
        Func['dataset_name'] = arg_1
        Func['imagesize'] = arg_2
        Func['voxelres'] = arg_3
        if arg_4 is not None:
            Func['offset'] = arg_4
        if arg_5 is not None:
            Func['timerange'] = arg_5
        if arg_6 is not None:
            Func['scalinglevels'] = arg_6
        if arg_7 is not None:
            Func['scaling'] = arg_7
        return Func


def Func ( arg_0 , arg_1 = None ) : with tf . compat . v1 . name_scope ( arg_1 , "Func" , [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_1 = "logu" ) return pearson ( arg_0 ) / ( 1. + tf . exp ( arg_0 ) )

def Func(arg_0, arg_1=None):
  """The Triangular Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Triangular Csiszar-function is:

  ```none
  f(u) = (u - 1)**2 / (1 + u)
  ```

  This Csiszar-function induces a symmetric f-Divergence, i.e.,
  `D_f[p, q] = D_f[q, p]`.

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    Func_of_u: `float`-like `Tensor` of the Csiszar-function evaluated
      at `u = exp(logu)`.
  """

  with tf.compat.v1.name_scope(arg_1, "Func", [arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1="logu")
    return pearson(arg_0) / (1. + tf.exp(arg_0))

The Triangular Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Triangular Csiszar-function is:

  ```none
  f(u) = (u - 1)**2 / (1 + u)
  ```

  This Csiszar-function induces a symmetric f-Divergence, i.e.,
  `D_f[p, q] = D_f[q, p]`.

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    triangular_of_u: `float`-like `Tensor` of the Csiszar-function evaluated
      at `u = exp(logu)`.

The Triangular Csiszar - function in log - space .


def Func(arg_0, arg_1=None, arg_2=None):
        """
        Set a new name for a column.

        :param col: index or name of the column whose name is to be set; may be skipped for 1-column frames
        :param name: the new name of the column
        """
        assert_is_type(arg_1, None, int, str)
        assert_is_type(arg_2, str)
        arg_3 = arg_0.ncols

        arg_4 = None
        if is_type(arg_1, int):
            if not(-arg_3 <= arg_1 < arg_3):
                raise H2OValueError("Index %d is out of bounds for a frame with %d columns" % (arg_1, arg_3))
            arg_4 = (arg_1 + arg_3) % arg_3  # handle negative indices
        elif is_type(arg_1, str):
            if arg_1 not in arg_0.names:
                raise H2OValueError("Column %s doesn't exist in the frame." % arg_1)
            arg_4 = arg_0.names.index(arg_1)  # lookup the name
        else:
            assert arg_1 is None
            if arg_3 != 1:
                raise H2OValueError("The frame has %d columns; please specify which one to rename" % arg_3)
            arg_4 = 0
        if arg_2 != arg_0.names[arg_4] and arg_2 in arg_0.types:
            raise H2OValueError("Column '%s' already exists in the frame" % arg_2)

        arg_5 = arg_0.names[arg_4]
        arg_6 = arg_0._ex._cache
        arg_0._ex = ExprNode("colnames=", arg_0, arg_4, arg_2)  # Update-in-place, but still lazy
        arg_0._ex._cache.fill_from(arg_6)
        if arg_0.names is None:
            arg_0._frame()._ex._cache.fill()
        else:
            arg_0._ex._cache._names = arg_0.names[:arg_4] + [arg_2] + arg_0.names[arg_4 + 1:]
            arg_0._ex._cache._types[arg_2] = arg_0._ex._cache._types.pop(arg_5)
        return


(self, major_axis, unit_mass='angular', kpc_per_arcsec=None, critical_surface_density=None)

def Func ( arg_0 , arg_1 , arg_2 = 'angular' , arg_3 = None , arg_4 = None ) : if arg_0 . has_mass_profile : return sum ( map ( lambda p : p . Func ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) , arg_0 . mass_profiles ) ) else : return None

def Func(arg_0, arg_1, arg_2='angular', arg_3=None, arg_4=None):
        """Compute the total angular mass of the galaxy's mass profiles within an ellipse of specified major_axis.

        See *profiles.mass_profiles.angualr_mass_within_ellipse* for details of how this is performed.

        Parameters
        ----------
        major_axis : float
            The major-axis radius of the ellipse.
        units_luminosity : str
            The units the luminosity is returned in (eps | counts).
        exposure_time : float
            The exposure time of the observation, which converts luminosity from electrons per second units to counts.
        """
        if arg_0.has_mass_profile:
            return sum(map(lambda p: p.Func(arg_1=arg_1, arg_2=arg_2,
                                                                    arg_3=arg_3,
                                                                    arg_4=arg_4),
                           arg_0.mass_profiles))
        else:
            return None

Compute the total angular mass of the galaxy s mass profiles within an ellipse of specified major_axis .


return dict(
            (x.strip(), pos) for pos, x in enumerate(header.split("\t"))
        )

def Func ( arg_0 ) : return dict ( ( arg_2 . strip ( ) , arg_1 ) for arg_1 , arg_2 in enumerate ( arg_0 . split ( "\t" ) ) )

def Func(arg_0):
        """Parses the trace file header and retrieves the positions of each
        column key.

        Parameters
        ----------
        header : str
            The header line of nextflow's trace file

        Returns
        -------
        dict
            Mapping the column ID to its position (e.g.: {"tag":2})
        """

        return dict(
            (arg_2.strip(), arg_1) for arg_1, arg_2 in enumerate(arg_0.split("\t"))
        )

Parses the trace file header and retrieves the positions of each column key .


def Func(arg_0, arg_1):
        """Enable or disable automatic rate-limit handling."""
        check_type(arg_1, bool, may_be_none=False)
        arg_0._Func = arg_1

Enable or disable automatic rate - limit handling .


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
arg_0
.
selectedLogs
(
)
arg_3
=
True
if
arg_1
!=
[
]
:
if
not
arg_0
.
acceptedUser
(
"MCC"
)
:
QMessageBox
(
)
.
warning
(
arg_0
,
"Invalid User"
,
"Please enter a valid user name!"
)
return
arg_4
=
arg_0
.
xmlSetup
(
"MCC"
,
arg_1
)
if
arg_4
is
:
return
if
not
arg_0
.
imagePixmap
.
isNull
(
)
:
arg_0
.
prepareImages
(
arg_4
,
"MCC"
)
arg_3
=
arg_0
.
sendToLogbook
(
arg_4
,
"MCC"
)
if
arg_2
!=
[
]
:
for
arg_5
in
range
(
len
(
arg_2
)
)
:
arg_4
=
arg_0
.
xmlSetup
(
"Physics"
,
arg_2
[
arg_5
]
)
if
arg_4
is
:
return
if
not
arg_0
.
imagePixmap
.
isNull
(
)
:
arg_0
.
prepareImages
(
arg_4
,
"Physics"
)
arg_6
=
arg_0
.
sendToLogbook
(
arg_4
,
"Physics"
,
arg_2
[
arg_5
]
)
arg_3
=
arg_3
and
arg_6
arg_0
.
done
(
arg_3
)

def Func(arg_0):
        """Process user inputs and subit logbook entry when user clicks Submit button"""

        # logType = self.logui.logType.currentText()
        arg_1, arg_2 = arg_0.selectedLogs()
        arg_3 = True

        if arg_1 != []:
            if not arg_0.acceptedUser("MCC"):
                QMessageBox().warning(arg_0, "Invalid User", "Please enter a valid user name!")
                return

            arg_4 = arg_0.xmlSetup("MCC", arg_1)
            if arg_4 is None:
                return

            if not arg_0.imagePixmap.isNull():
                arg_0.prepareImages(arg_4, "MCC")
            arg_3 = arg_0.sendToLogbook(arg_4, "MCC")

        if arg_2 != []:
            for arg_5 in range(len(arg_2)):
                arg_4 = arg_0.xmlSetup("Physics", arg_2[arg_5])
                if arg_4 is None:
                    return

                if not arg_0.imagePixmap.isNull():
                    arg_0.prepareImages(arg_4, "Physics")
                arg_6 = arg_0.sendToLogbook(arg_4, "Physics", arg_2[arg_5])
                arg_3 = arg_3 and arg_6

        arg_0.done(arg_3)


(self, query, since_id=None, max_id=None, geocode=None, lang=None,
               include_entities=True, result_type=TWEET_TYPE_MIXED)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = True , arg_7 = arg_8 ) : arg_9 = arg_0 . base_url arg_10 = { 'q' : arg_1 , 'count' : arg_0 . max_items } if arg_2 : arg_10 [ 'since_id' ] = arg_2 if arg_3 : arg_10 [ 'max_id' ] = arg_3 if arg_4 : arg_10 [ 'geocode' ] = arg_4 if arg_5 : arg_10 [ 'lang' ] = arg_5 arg_10 [ 'include_entities' ] = arg_6 arg_10 [ 'result_type' ] = arg_7 while True : arg_11 = arg_0 . _fetch ( arg_9 , arg_10 = arg_10 ) Func = json . loads ( arg_11 ) if not Func [ 'statuses' ] : break arg_10 [ 'max_id' ] = Func [ 'statuses' ] [ - 1 ] [ 'id' ] - 1 yield Func [ 'statuses' ]

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None,
               arg_6=True, arg_7=arg_8):
        """Fetch tweets for a given query between since_id and max_id.

        :param query: query to fetch tweets
        :param since_id: if not null, it returns results with an ID greater than the specified ID
        :param max_id: if not null, it returns results with an ID less than the specified ID
        :param geocode: if enabled, returns tweets by users located at latitude,longitude,"mi"|"km"
        :param lang: if enabled, restricts tweets to the given language, given by an ISO 639-1 code
        :param include_entities: if disabled, it excludes entities node
        :param result_type: type of tweets returned. Default is “mixed”, others are "recent" and "popular"

        :returns: a generator of tweets
        """
        arg_9 = arg_0.base_url
        arg_10 = {'q': arg_1,
                  'count': arg_0.max_items}

        if arg_2:
            arg_10['since_id'] = arg_2

        if arg_3:
            arg_10['max_id'] = arg_3

        if arg_4:
            arg_10['geocode'] = arg_4

        if arg_5:
            arg_10['lang'] = arg_5

        arg_10['include_entities'] = arg_6
        arg_10['result_type'] = arg_7

        while True:
            arg_11 = arg_0._fetch(arg_9, arg_10=arg_10)
            Func = json.loads(arg_11)

            if not Func['statuses']:
                break

            arg_10['max_id'] = Func['statuses'][-1]['id'] - 1
            yield Func['statuses']

Fetch tweets for a given query between since_id and max_id .


def Func(arg_0):
    """Return true if this string or integer tuple appears in tables"""
    if isinstance(arg_0, str):
        arg_0 = canonical_name(arg_0)
        return arg_0 in _TO_COLOR_USER or arg_0 in _TO_COLOR
    else:
        arg_0 = tuple(arg_0)
        return arg_0 in _TO_NAME_USER or arg_0 in _TO_NAME


def Func(arg_0, arg_1):
        """
        Returns site data.

        http://dev.wheniwork.com/#get-existing-site
        """
        arg_2 = "/2/sites/%s" % arg_1

        return arg_0.site_from_json(arg_0._get_resource(arg_2)["site"])


def Func(arg_0,arg_1):
        """set the length of the uncompressed sequence. its inverse 'one_mutation'
        is frequently used as a general length scale. This can't be changed once
        it is set.

        Parameters
        ----------
        L : int
            length of the sequence alignment
        """
        if (not hasattr(arg_0, '_Func')) or arg_0._Func is None:
            if arg_1:
                arg_0._Func = int(arg_1)
        else:
            arg_0.logger("TreeAnc: one_mutation and sequence length can't be reset",1)

set the length of the uncompressed sequence . its inverse one_mutation is frequently used as a general length scale . This can t be changed once it is set .


(self, idx, name='', timestamp=42.0, finish_timestamp=1.337,
                      runtime='forever and ever', time='>>Maybe time`s gone on strike',
                      completed=0, parameter_summary='Not yet my friend!',
                      short_environment_hexsha='N/A')

def Func(arg_0, arg_1, arg_2='', arg_3=42.0, arg_4=1.337,
                      arg_5='forever and ever', arg_6='>>Maybe time`s gone on strike',
                      arg_7=0, arg_8='Not yet my friend!',
                      arg_9='N/A'):
        """Adds a new run to the `_run_information` dict."""

        if arg_1 in arg_0._single_run_ids:
            # Delete old entries, they might be replaced by a new name
            arg_10 = arg_0._single_run_ids[arg_1]
            del arg_0._single_run_ids[arg_10]
            del arg_0._single_run_ids[arg_1]
            del arg_0._run_information[arg_10]

        if arg_2 == '':
            arg_2 = arg_0.f_wildcard('$', arg_1)
        # The `_single_run_ids` dict is bidirectional and maps indices to run names and vice versa
        arg_0._single_run_ids[arg_2] = arg_1
        arg_0._single_run_ids[arg_1] = arg_2

        arg_12 = {'idx': arg_1,
                     'timestamp': arg_3,
                     'finish_timestamp': arg_4,
                     'runtime': arg_5,
                     'time': arg_6,
                     'completed': arg_7,
                     'name': arg_2,
                     'parameter_summary': arg_8,
                     'short_environment_hexsha': arg_9}

        arg_0._run_information[arg_2] = arg_12
        arg_0._length = len(arg_0._run_information)

Adds a new run to the _run_information dict .


def Func(arg_0):
    """
    Retrieve a validated and prepped Rendition Key Set from
    settings.VERSATILEIMAGEFIELD_RENDITION_KEY_SETS
    """
    try:
        arg_1 = IMAGE_SETS[arg_0]
    except KeyError:
        raise ImproperlyConfigured(
            "No Rendition Key Set exists at "
            "settings.VERSATILEIMAGEFIELD_RENDITION_KEY_SETS['{}']".format(arg_0)
        )
    else:
        return validate_versatileimagefield_sizekey_list(arg_1)

Retrieve a validated and prepped Rendition Key Set from settings . VERSATILEIMAGEFIELD_RENDITION_KEY_SETS


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 ( token = arg_1 , id = arg_2 ) arg_3 . load ( ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
            Class method that will return a Snapshot object by ID.
        """
        arg_3 = arg_0(token=arg_1, id=arg_2)
        arg_3.load()
        return arg_3

Class method that will return a Snapshot object by ID .


return '-'.join((safer_name(self.distribution.get_name()),
                         safer_version(self.distribution.get_version())))

def Func ( arg_0 ) : return '-' . join ( ( safer_name ( arg_0 . distribution . get_name ( ) ) , safer_version ( arg_0 . distribution . get_version ( ) ) ) )

def Func(arg_0):
        """Return distribution full name with - replaced with _"""
        return '-'.join((safer_name(arg_0.distribution.get_name()),
                         safer_version(arg_0.distribution.get_version())))


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
isinstance
(
arg_2
,
str
)
:
arg_2
=
[
arg_2
]
arg_3
=
pd
.
MultiIndex
.
from_tuples
(
[
(
'Residual Summary'
,
'N'
)
,
(
'Residual Summary'
,
'Median'
)
,
(
'Residual Summary'
,
'LQ'
)
,
(
'Residual Summary'
,
'IQR'
)
,
(
'Residual Summary'
,
'UQ'
)
,
(
'Residual Regression'
,
'Slope'
)
,
(
'Residual Regression'
,
'Slope t'
)
,
(
'Residual Regression'
,
'Slope p'
)
,
(
'Residual Regression'
,
'Intercept'
)
,
(
'Residual Regression'
,
'Intercept t'
)
,
(
'Residual Regression'
,
'Intercept p'
)
,
(
'Residual Regression'
,
'R2'
)
,
(
'Kolmogorov-Smirnov'
,
'KS'
)
,
(
'Kolmogorov-Smirnov'
,
'p'
)
]
)
arg_4
=
pd
.
DataFrame
(
index
=
arg_2
,
columns
=
arg_3
)
arg_5
=
~
(
np
.
isnan
(
arg_0
)
|
np
.
isnan
(
arg_1
)
)
arg_0
=
arg_0
[
arg_5
]
arg_1
=
arg_1
[
arg_5
]
arg_6
=
arg_1
arg_0
arg_7
=
'Residual Summary'
arg_4
.
loc
[
:
,
(
arg_7
,
'N'
)
]
=
len
(
arg_0
)
arg_4
.
loc
[
:
,
(
arg_7
,
'Median'
)
]
=
np
.
median
(
arg_6
)
arg_4
.
loc
[
:
,
[
(
arg_7
,
'LQ'
)
,
(
arg_7
,
'UQ'
)
]
]
=
np
.
percentile
(
arg_6
,
[
25
,
75
]
)
arg_4
.
loc
[
:
,
(
arg_7
,
'IQR'
)
]
=
arg_4
.
loc
[
:
,
(
arg_7
,
'UQ'
)
]
arg_4
.
loc
[
:
,
(
arg_7
,
'LQ'
)
]
arg_7
=
'Kolmogorov-Smirnov'
arg_9
=
stats
.
ks_2samp
(
arg_0
,
arg_1
)
arg_4
.
loc
[
:
,
(
arg_7
,
'KS'
)
]
=
arg_9
.
statistic
arg_4
.
loc
[
:
,
(
arg_7
,
'p'
)
]
=
arg_9
.
pvalue
arg_7
=
'Residual Regression'
arg_10
=
sm
.
add_constant
(
arg_0
)
arg_11
=
sm
.
OLS
(
arg_6
,
arg_10
,
missing
=
'drop'
)
arg_12
=
arg_11
.
fit
(
)
arg_4
.
loc
[
:
,
[
(
arg_7
,
'Intercept'
)
,
(
arg_7
,
'Slope'
)
]
]
=
arg_12
.
params
arg_4
.
loc
[
:
,
[
(
arg_7
,
'Intercept t'
)
,
(
arg_7
,
'Slope t'
)
]
]
=
arg_12
.
tvalues
arg_4
.
loc
[
:
,
(
arg_7
,
'R2'
)
]
=
arg_12
.
rsquared
arg_4
.
loc
[
:
,
[
(
arg_7
,
'Intercept p'
)
,
(
arg_7
,
'Slope p'
)
]
]
=
arg_12
.
pvalues
return
arg_4

def Func(arg_0, arg_1, arg_2=None):
    """
    Compute summary statistics for paired x, y data.

    Tests
    -----

    Parameters
    ----------
    x, y : array-like
        Data to compare
    nm : str (optional)
        Index value of created dataframe.

    Returns
    -------
    pandas dataframe of statistics.
    """
    # create datafrane for results
    if isinstance(arg_2, str):
        arg_2 = [arg_2]
    # cols = pd.MultiIndex.from_arrays([['', 'Pairwise', 'Pairwise', cat, cat, cat, cat],
    #                                   ['N', 'W', 'p', 'Median', 'IQR', 'W', 'p']])
#     cols = ['Median', 'IQR', 'CI95', 'L95', 'LQ', 'UQ', 'U95', 'N',
#             'Wilcoxon_stat', 'Wilcoxon_p',
#             'KS_stat', 'KS_p',
#             'LR_slope', 'LR_intercept', 'LR_slope_tvalue', 'LR_intercept_tvalue', 'LR_slope_p', 'LR_intercept_p', 'LR_R2adj']
#     out = pd.DataFrame(index=nm, columns=cols)

    arg_3 = pd.MultiIndex.from_tuples([('Residual Summary', 'N'),
                                      ('Residual Summary', 'Median'),
                                      ('Residual Summary', 'LQ'),
                                      ('Residual Summary', 'IQR'),
                                      ('Residual Summary', 'UQ'),
                                      ('Residual Regression', 'Slope'),
                                      ('Residual Regression', 'Slope t'),
                                      ('Residual Regression', 'Slope p'),
                                      ('Residual Regression', 'Intercept'),
                                      ('Residual Regression', 'Intercept t'),
                                      ('Residual Regression', 'Intercept p'),
                                      ('Residual Regression', 'R2'),
                                      ('Kolmogorov-Smirnov', 'KS'),
                                      ('Kolmogorov-Smirnov', 'p')])

    arg_4 = pd.DataFrame(index=arg_2, columns=arg_3)

    # remove nan values
    arg_5 = ~(np.isnan(arg_0) | np.isnan(arg_1))
    arg_0 = arg_0[arg_5]
    arg_1 = arg_1[arg_5]

    # calculate residuals
    arg_6 = arg_1 - arg_0

    # summary statistics
    arg_7 = 'Residual Summary'
    arg_4.loc[:, (arg_7, 'N')] = len(arg_0)
    arg_4.loc[:, (arg_7, 'Median')] = np.median(arg_6)
    arg_4.loc[:, [(arg_7, 'LQ'), (arg_7, 'UQ')]] = np.percentile(arg_6, [25, 75])
    arg_4.loc[:, (arg_7, 'IQR')] = arg_4.loc[:, (arg_7, 'UQ')] - arg_4.loc[:, (arg_7, 'LQ')]

    # non-paired test for same distribution
    arg_7 = 'Kolmogorov-Smirnov'
    arg_9 = stats.ks_2samp(arg_0, arg_1)
    arg_4.loc[:, (arg_7, 'KS')] = arg_9.statistic
    arg_4.loc[:, (arg_7, 'p')] = arg_9.pvalue

    # regression analysis of residuals - slope should be 0, intercept should be 0
    arg_7 = 'Residual Regression'
    arg_10 = sm.add_constant(arg_0)
    arg_11 = sm.OLS(arg_6, arg_10, missing='drop')
    arg_12 = arg_11.fit()

    arg_4.loc[:, [(arg_7, 'Intercept'), (arg_7, 'Slope')]] = arg_12.params
    arg_4.loc[:, [(arg_7, 'Intercept t'), (arg_7, 'Slope t')]] = arg_12.tvalues
    arg_4.loc[:, (arg_7, 'R2')] = arg_12.rsquared
    arg_4.loc[:, [(arg_7, 'Intercept p'), (arg_7, 'Slope p')]] = arg_12.pvalues

    return arg_4

Compute summary statistics for paired x y data .


def Func ( ) : from django . conf import settings from django . utils . importlib import import_module from django . utils . module_loading import module_has_submodule for arg_0 in settings . INSTALLED_APPS : arg_1 = import_module ( arg_0 ) try : import_module ( '%s.gadgets' % arg_0 ) except : if module_has_submodule ( arg_1 , 'gadgets' ) : raise

def Func():
    """
    Auto-discover INSTALLED_APPS gadgets.py modules and fail silently when
    not present. This forces an import on them to register any gadgets they
    may want.
    """
    from django.conf import settings
    from django.utils.importlib import import_module
    from django.utils.module_loading import module_has_submodule

    for arg_0 in settings.INSTALLED_APPS:
        arg_1 = import_module(arg_0)
        # Attempt to import the app's gadgets module.
        try:
            import_module('%s.gadgets' % arg_0)
        except:
            # Decide whether to bubble up this error. If the app just
            # doesn't have a gadgets module, we can ignore the error
            # attempting to import it, otherwise we want it to bubble up.
            if module_has_submodule(arg_1, 'gadgets'):
                raise

Auto - discover INSTALLED_APPS gadgets . py modules and fail silently when not present . This forces an import on them to register any gadgets they may want .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_1
def
_mapNumpyValues
(
arg_4
)
:
import
numpy
if
isinstance
(
arg_4
,
numpy
.
float32
)
:
return
float
(
arg_4
)
elif
isinstance
(
arg_4
,
numpy
.
bool_
)
:
return
bool
(
arg_4
)
elif
isinstance
(
arg_4
,
numpy
.
ndarray
)
:
return
arg_4
.
tolist
(
)
else
:
raise
TypeError
(
"UNEXPECTED OBJ: %s; class=%s"
%
(
arg_4
,
arg_4
.
__class__
)
)
arg_5
=
json
.
dumps
(
arg_3
,
indent
=
4
,
default
=
_mapNumpyValues
)
return
arg_5

def Func(arg_0, arg_1, arg_2):
    """ Translates the given metrics value to JSON string

    metrics:        A list of dictionaries per OPFTaskDriver.getMetrics():

    Returns:        JSON string representing the given metrics object.
    """

    # Transcode the MetricValueElement values into JSON-compatible
    # structure
    arg_3 = arg_1

    # Convert the structure to a display-friendly JSON string
    def _mapNumpyValues(arg_4):
      """
      """
      import numpy

      if isinstance(arg_4, numpy.float32):
        return float(arg_4)

      elif isinstance(arg_4, numpy.bool_):
        return bool(arg_4)

      elif isinstance(arg_4, numpy.ndarray):
        return arg_4.tolist()

      else:
        raise TypeError("UNEXPECTED OBJ: %s; class=%s" % (arg_4, arg_4.__class__))

    arg_5 = json.dumps(arg_3, indent=4, default=_mapNumpyValues)

    return arg_5


def Func(arg_0, arg_1, arg_2):
        """
        This method only works for extensible fields. It allows to Func a value, and shifts all other following
        values.

        Parameters
        ----------
        index: position of Funcion
        value: value to Func
        """
        # prepare index (will check for extensible)
        arg_1 = arg_0._prepare_pop_Func_index(arg_1=arg_1)

        # remove extensible fields
        arg_3 = arg_0.clear_extensible_fields()

        # Func
        arg_3.Func(arg_1, arg_2)

        # add new list
        arg_0.add_fields(*arg_3)

This method only works for extensible fields. It allows to insert a value, and shifts all other following
        values.

        Parameters
        ----------
        index: position of insertion
        value: value to insert

This method only works for extensible fields . It allows to insert a value and shifts all other following values .


def Func ( arg_0 , arg_1 ) : arg_2 = int ( hexlify ( bytes ( arg_0 ) ) . decode ( "ascii" ) , 16 ) arg_3 = int ( hexlify ( arg_1 ) . decode ( "ascii" ) , 16 ) arg_4 = ecdsa . SECP256k1 . order arg_5 = ( arg_2 + arg_3 ) % arg_4 arg_6 = "%0x" % arg_5 if len ( arg_6 ) < 64 : arg_6 = ( "0" * ( 64 - len ( arg_6 ) ) ) + arg_6 return PrivateKey ( arg_6 , prefix = arg_0 . pubkey . prefix )

def Func(arg_0, arg_1):
        """ Derive private key using "generate_from_seed" method.
            Here, the key itself serves as a `seed`, and `offset`
            is expected to be a sha256 digest.
        """
        arg_2 = int(hexlify(bytes(arg_0)).decode("ascii"), 16)
        arg_3 = int(hexlify(arg_1).decode("ascii"), 16)
        arg_4 = ecdsa.SECP256k1.order
        arg_5 = (arg_2 + arg_3) % arg_4
        arg_6 = "%0x" % arg_5
        if len(arg_6) < 64: # left-pad with zeroes
            arg_6 = ("0" * (64-len(arg_6))) + arg_6
        return PrivateKey(arg_6, prefix=arg_0.pubkey.prefix)

Derive private key using generate_from_seed method . Here the key itself serves as a seed and offset is expected to be a sha256 digest .


def Func(arg_0, arg_1):
    """Registers a specified task hook to this context

    :type task_hook: heron.instance.src.python.utils.topology.ITaskHook
    :param task_hook: Implementation of ITaskHook
    """
    if not isinstance(arg_1, ITaskHook):
      raise TypeError("In Func(): attempt to add non ITaskHook instance, given: %s"
                      % str(type(arg_1)))
    arg_0.task_hooks.append(arg_1)


def Func ( arg_0 ) : arg_1 = True while True : arg_2 = arg_0 . file . tell ( ) if arg_2 > os . fstat ( arg_0 . file . fileno ( ) ) . st_size : arg_2 = 0 arg_0 . file . seek ( arg_2 ) arg_3 = arg_0 . file . readline ( ) if arg_3 : if arg_1 and arg_3 in arg_0 . LINE_TERMINATORS : arg_1 = False continue arg_4 = arg_0 . suffix_line_terminator ( arg_3 ) if arg_4 : arg_3 = arg_3 [ : - len ( arg_4 ) ] arg_1 = False yield arg_3 else : arg_1 = True arg_0 . file . seek ( arg_2 ) yield None

def Func(arg_0):
        """
        Iterator generator that returns lines as data is added to the file.

        None will be yielded if no new line is available.
        Caller may either wait and re-try or end iteration.
        """
        arg_1 = True

        while True:
            arg_2 = arg_0.file.tell()

            if arg_2 > os.fstat(arg_0.file.fileno()).st_size:
                # File was truncated.
                arg_2 = 0
                arg_0.file.seek(arg_2)

            arg_3 = arg_0.file.readline()

            if arg_3:
                if arg_1 and arg_3 in arg_0.LINE_TERMINATORS:
                    # This is just the line terminator added to the end of the file
                    # before a new line, ignore.
                    arg_1 = False
                    continue

                arg_4 = arg_0.suffix_line_terminator(arg_3)
                if arg_4:
                    arg_3 = arg_3[:-len(arg_4)]

                arg_1 = False
                yield arg_3
            else:
                arg_1 = True
                arg_0.file.seek(arg_2)
                yield None

Iterator generator that returns lines as data is added to the file .


def
Func
(
arg_0
)
:
arg_1
=
0
arg_2
=
1
arg_3
=
{
}
arg_4
=
False
for
arg_5
in
arg_0
:
arg_1
+=
1
arg_5
=
arg_5
.
split
(
'#'
)
[
0
]
.
strip
(
)
if
not
arg_5
:
continue
if
arg_5
.
startswith
(
':'
)
:
if
arg_5
.
lower
(
)
.
startswith
(
':deg'
)
:
arg_4
=
True
continue
if
arg_5
.
isdigit
(
)
:
if
int
(
arg_5
)
!=
arg_2
:
raise
RuntimeError
(
'frame mismatch on line {}: '
'produced {} but file claims {}'
.
format
(
arg_1
,
arg_2
,
arg_5
)
)
yield
arg_3
arg_2
+=
1
arg_3
=
{
}
continue
arg_6
=
arg_5
.
split
(
)
arg_3
[
arg_6
[
0
]
]
=
list
(
map
(
float
,
arg_6
[
1
:
]
)
)

def Func(arg_0):
    '''Parse an AMC motion capture data file.

    Parameters
    ----------
    source : file
        A file-like object that contains AMC motion capture text.

    Yields
    ------
    frame : dict
        Yields a series of motion capture frames. Each frame is a dictionary
        that maps a bone name to a list of the DOF configurations for that bone.
    '''
    arg_1 = 0
    arg_2 = 1
    arg_3 = {}
    arg_4 = False
    for arg_5 in arg_0:
        arg_1 += 1
        arg_5 = arg_5.split('#')[0].strip()
        if not arg_5:
            continue
        if arg_5.startswith(':'):
            if arg_5.lower().startswith(':deg'):
                arg_4 = True
            continue
        if arg_5.isdigit():
            if int(arg_5) != arg_2:
                raise RuntimeError(
                    'frame mismatch on line {}: '
                    'produced {} but file claims {}'.format(arg_1, arg_2, arg_5))
            yield arg_3
            arg_2 += 1
            arg_3 = {}
            continue
        arg_6 = arg_5.split()
        arg_3[arg_6[0]] = list(map(float, arg_6[1:]))


def Func ( arg_0 ) : arg_1 = ( "close" , ) arg_2 = ( ( "read" , "readline" , "readlines" ) , ( "write" , "writeline" , "writelines" ) ) for arg_3 in arg_1 : if not hasmethod ( arg_0 , arg_3 ) : return False arg_4 = [ numpy . all ( [ hasmethod ( arg_0 , arg_3 ) for arg_3 in alternatives ] ) for alternatives in arg_2 ] return numpy . any ( arg_4 )

def Func(arg_0):
    """Detect if `obj` is a stream.

    We consider anything a stream that has the methods

    - ``close()``

    and either set of the following

    - ``read()``, ``readline()``, ``readlines()``
    - ``write()``, ``writeline()``, ``writelines()``

    :Arguments:
      *obj*
          stream or str

    :Returns:
      *bool*, ``True`` if `obj` is a stream, ``False`` otherwise

    .. SeeAlso::
       :mod:`io`

    .. versionadded:: 0.7.1
    """
    arg_1 = ("close",)
    arg_2 = (
        ("read", "readline", "readlines"),
        ("write", "writeline", "writelines"))

    # Must have ALL the signature methods
    for arg_3 in arg_1:
        if not hasmethod(arg_0, arg_3):
            return False
    # Must have at least one complete set of alternative_methods
    arg_4 = [
        numpy.all([hasmethod(arg_0, arg_3) for arg_3 in alternatives])
        for alternatives in arg_2]
    return numpy.any(arg_4)


def Func ( arg_0 ) : arg_1 = set ( ) if arg_0 . accepted : arg_1 . add ( 'accepted' ) if arg_0 . delivered : arg_1 . add ( 'delivered' ) if arg_0 . expired : arg_1 . add ( 'expired' ) if arg_0 . error : arg_1 . add ( 'error' ) return arg_1

def Func(arg_0):
        """ Get the set of Func. Mostly used for pretty printing

            :rtype: set
            :returns: Set of 'accepted', 'delivered', 'expired', 'error'
        """
        arg_1 = set()
        if arg_0.accepted:
            arg_1.add('accepted')
        if arg_0.delivered:
            arg_1.add('delivered')
        if arg_0.expired:
            arg_1.add('expired')
        if arg_0.error:
            arg_1.add('error')
        return arg_1

Get the set of states. Mostly used for pretty printing

            :rtype: set
            :returns: Set of 'accepted', 'delivered', 'expired', 'error'

Get the set of states . Mostly used for pretty printing


def Func(arg_0, arg_1) :
        """
        Trash a file in the appropriate Func directory.
        If the file belong to the same volume of the Func home directory it
        will be Funced in the home Func directory.
        Otherwise it will be Funced in one of the relevant volume Func
        directories.

        Each volume can have two Func directories, they are
            - $volume/.Trash/$uid
            - $volume/.Trash-$uid

        Firstly the software attempt to Func the file in the first directory
        then try to Func in the second Func directory.
        """

        if arg_0._should_skipped_by_specs(arg_1):
            arg_0.reporter.unable_to_Func_dot_entries(arg_1)
            return

        arg_2 = arg_0.volume_of_parent(arg_1)
        arg_0.reporter.volume_of_file(arg_2)
        arg_3 = arg_0._possible_Func_directories_for(
                        arg_2)

        arg_0.try_Func_file_using_candidates(arg_1,
                                             arg_2,
                                             arg_3)

Trash a file in the appropriate trash directory.
        If the file belong to the same volume of the trash home directory it
        will be trashed in the home trash directory.
        Otherwise it will be trashed in one of the relevant volume trash
        directories.

        Each volume can have two trash directories, they are
            - $volume/.Trash/$uid
            - $volume/.Trash-$uid

        Firstly the software attempt to trash the file in the first directory
        then try to trash in the second trash directory.

Trash a file in the appropriate trash directory . If the file belong to the same volume of the trash home directory it will be trashed in the home trash directory . Otherwise it will be trashed in one of the relevant volume trash directories .


def Func(arg_0, arg_1=arg_2):
        """Stop scanning for BLE devices with this adapter."""
        arg_0._scan_stopped.clear()
        arg_0._adapter.StopDiscovery()
        if not arg_0._scan_stopped.wait(arg_1):
            raise RuntimeError('Exceeded timeout waiting for adapter to stop scanning!')

Stop scanning for BLE devices with this adapter .


(self, txt, x, y, width=None, height=1000000, outline=False, draw=True, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=1000000, arg_6=False, arg_7=True, **arg_8):
        '''
        Draws a string of Func according to current font settings.

        :param txt: Text to output
        :param x: x-coordinate of the top left corner
        :param y: y-coordinate of the top left corner
        :param width: Func width
        :param height: Func height
        :param outline: If True draws outline Func (defaults to False)
        :param draw: Set to False to inhibit immediate drawing (defaults to True)
        :return: Path object representing the Func.
        '''
        arg_1 = arg_0.Text(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=arg_6, ctx=None, **arg_8)
        if arg_6:
            arg_9 = arg_1.path
            if arg_7:
                arg_9.draw()
            return arg_9
        else:
            return arg_1

Draws a string of text according to current font settings.

        :param txt: Text to output
        :param x: x-coordinate of the top left corner
        :param y: y-coordinate of the top left corner
        :param width: text width
        :param height: text height
        :param outline: If True draws outline text (defaults to False)
        :param draw: Set to False to inhibit immediate drawing (defaults to True)
        :return: Path object representing the text.

Draws a string of text according to current font settings .


(transactions, positions,
                             ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
**
arg_3
)
:
if
arg_2
is
:
arg_2
=
plt
.
gca
(
)
arg_4
=
txn
.
get_turnover
(
arg_1
,
arg_0
)
sns
.
distplot
(
arg_4
,
arg_2
=
arg_2
,
**
arg_3
)
arg_2
.
set_title
(
'Distribution of daily turnover rates'
)
arg_2
.
set_xlabel
(
'Turnover rate'
)
return
arg_2

def Func(arg_0, arg_1,
                             arg_2=None, **arg_3):
    """
    Plots a histogram of daily turnover rates.

    Parameters
    ----------
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in tears.create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in tears.create_full_tear_sheet.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to seaborn plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_2 is None:
        arg_2 = plt.gca()
    arg_4 = txn.get_turnover(arg_1, arg_0)
    sns.distplot(arg_4, arg_2=arg_2, **arg_3)
    arg_2.set_title('Distribution of daily turnover rates')
    arg_2.set_xlabel('Turnover rate')
    return arg_2

Plots a histogram of daily turnover rates .


def Func ( arg_0 ) : arg_1 = [ ] def append ( arg_2 ) : if USE_BYTES_IN_PY3K : arg_1 . append ( arg_2 . encode ( 'latin1' ) ) else : arg_1 . append ( arg_2 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( 'P' * arg_0 + 'Perl' + 'P' * arg_0 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) append ( 'P' * arg_0 + 'Python' + 'P' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( 'P' * arg_0 + 'Perl' + 'P' * arg_0 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( '-' * arg_0 + 'Perl' + '-' * arg_0 ) append ( '-' * arg_0 + 'PythonPython' + '-' * arg_0 ) append ( 'P' * arg_0 + 'PythonPython' + 'P' * arg_0 ) append ( '-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0 ) append ( '-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0 ) append ( '-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0 ) append ( '-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0 ) append ( '-' * arg_0 + 'Python' + '-' * arg_0 ) return arg_1

def Func(arg_0):
    """Generates the list of strings that will be used in the benchmarks.

    All strings have repeated prefixes and suffices, and n specifies the
    number of repetitions.
    """
    arg_1 = []

    def append(arg_2):
        if USE_BYTES_IN_PY3K:
            arg_1.append(arg_2.encode('latin1'))
        else:
            arg_1.append(arg_2)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('P' * arg_0 + 'Perl' + 'P' * arg_0)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    append('P' * arg_0 + 'Python' + 'P' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('P' * arg_0 + 'Perl' + 'P' * arg_0)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('-' * arg_0 + 'Perl' + '-' * arg_0)
    append('-' * arg_0 + 'PythonPython' + '-' * arg_0)
    append('P' * arg_0 + 'PythonPython' + 'P' * arg_0)
    append('-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0)
    append('-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0)
    append('-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0)
    append('-' * arg_0 + 'a5,b7,c9,' + '-' * arg_0)
    append('-' * arg_0 + 'Python' + '-' * arg_0)
    return arg_1

Generates the list of strings that will be used in the benchmarks .


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
[
]
arg_3
=
set
(
)
arg_4
=
'\t'
arg_5
=
[
'\t'
,
' '
,
';'
]
for
arg_6
,
arg_7
in
enumerate
(
arg_0
)
:
arg_7
=
arg_7
.
rstrip
(
)
if
not
len
(
arg_7
)
>
0
:
continue
if
arg_7
.
startswith
(
'#'
)
:
if
not
arg_7
.
startswith
(
'##'
)
:
arg_8
=
0
arg_4
=
for
arg_9
in
arg_5
:
arg_10
=
arg_7
.
split
(
arg_9
)
if
len
(
arg_10
)
>
arg_8
:
arg_8
=
len
(
arg_10
)
arg_4
=
arg_9
arg_2
=
[
word
.
lower
(
)
for
word
in
arg_7
[
1
:
]
.
split
(
arg_4
)
]
else
:
if
arg_6
==
0
:
arg_8
=
0
for
arg_9
in
arg_5
:
arg_10
=
arg_7
.
split
(
arg_9
)
if
len
(
arg_10
)
>
arg_8
:
arg_8
=
len
(
arg_10
)
arg_4
=
arg_9
if
(
'hgnc'
in
arg_7
or
'HGNC'
in
arg_7
)
:
arg_2
=
[
word
.
lower
(
)
for
word
in
arg_7
.
split
(
arg_4
)
]
continue
if
arg_7
.
split
(
arg_4
)
[
0
]
.
isdigit
(
)
:
arg_2
=
[
'hgnc_id'
]
else
:
arg_2
=
[
'hgnc_symbol'
]
arg_11
=
arg_7
.
split
(
arg_4
)
arg_12
=
dict
(
zip
(
arg_2
,
arg_11
)
)
arg_13
=
False
for
arg_14
in
arg_12
:
if
arg_12
[
arg_14
]
:
arg_13
=
True
break
if
not
arg_13
:
continue
try
:
arg_15
=
parse_gene
(
arg_12
)
except
Exception
as
e
:
LOG
.
warning
(
e
)
raise
SyntaxError
(
"Line {0} is malformed"
.
format
(
arg_6
+
1
)
)
arg_16
=
arg_15
.
pop
(
'identifier'
)
if
not
arg_16
in
arg_3
:
arg_3
.
add
(
arg_16
)
arg_1
.
append
(
arg_15
)
return
arg_1

def Func(arg_0):
    """Parse a file with genes and return the hgnc ids

    Args:
        gene_lines(iterable(str)): Stream with genes

    Returns:
        genes(list(dict)): Dictionaries with relevant gene info
    """
    arg_1 = []
    arg_2 = []
    arg_3 = set()
    arg_4 = '\t'
    # This can be '\t' or ';'
    arg_5 = ['\t', ' ', ';']

    # There are files that have '#' to indicate headers
    # There are some files that start with a header line without
    # any special symbol
    for arg_6,arg_7 in enumerate(arg_0):
        arg_7 = arg_7.rstrip()
        if not len(arg_7) > 0:
            continue
        if arg_7.startswith('#'):
            if not arg_7.startswith('##'):
                # We need to try delimiters
                # We prefer ';' or '\t' byt should accept ' '
                arg_8 = 0
                arg_4 = None
                for arg_9 in arg_5:
                    arg_10 = arg_7.split(arg_9)
                    if len(arg_10) > arg_8:
                        arg_8 = len(arg_10)
                        arg_4 = arg_9

                arg_2 = [word.lower() for word in arg_7[1:].split(arg_4)]
        else:
            # If no header symbol(#) assume first line is header
            if arg_6 == 0:
                arg_8 = 0
                for arg_9 in arg_5:
                    arg_10 = arg_7.split(arg_9)
                    if len(arg_10) > arg_8:
                        arg_8 = len(arg_10)
                        arg_4 = arg_9

                if ('hgnc' in arg_7 or 'HGNC' in arg_7):
                    arg_2 = [word.lower() for word in arg_7.split(arg_4)]
                    continue
                # If first line is not a header try to sniff what the first
                # columns holds
                if arg_7.split(arg_4)[0].isdigit():
                    arg_2 = ['hgnc_id']
                else:
                    arg_2 = ['hgnc_symbol']

            arg_11 = arg_7.split(arg_4)
            arg_12 = dict(zip(arg_2, arg_11))

            # There are cases when excel exports empty lines that looks like
            # ;;;;;;;. This is a exception to handle these
            arg_13 = False
            for arg_14 in arg_12:
                if arg_12[arg_14]:
                    arg_13 = True
                    break
            # If no info was found we skip that line
            if not arg_13:
                continue

            try:
                arg_15 = parse_gene(arg_12)
            except Exception as e:
                LOG.warning(e)
                raise SyntaxError("Line {0} is malformed".format(arg_6 + 1))

            arg_16 = arg_15.pop('identifier')

            if not arg_16 in arg_3:
                arg_3.add(arg_16)
                arg_1.append(arg_15)

    return arg_1


Converts analytes in format '27Al' to 'Al27'.

    Parameters
    ----------
    s : str
        of format [A-z]{1,3}[0-9]{1,3}

    Returns
    -------
    str
        Name in format [0-9]{1,3}[A-z]{1,3}

Converts analytes in format 27Al to Al27 .


(self, expression, binby=[], limits=None, shape=default_shape, selection=False, delay=False, progress=None, edges=False)

return self._delay(delay, finish(self.minmax(expression, binby=binby, limits=limits, shape=shape, selection=selection, delay=delay, progress=progress)))

def Func(arg_0, arg_1, arg_2=[], arg_3=None, arg_4=arg_5, arg_6=False, arg_7=False, arg_8=None, arg_9=False):
        """Calculate the Funcimum for given expressions, possibly on a grid defined by binby.

        Example:

        >>> df.Func("x")
        array(-128.293991)
        >>> df.Func(["x", "y"])
        array([-128.293991 ,  -71.5523682])
        >>> df.Func("x", binby="x", shape=5, limits=[-10, 10])
        array([-9.99919128, -5.99972439, -1.99991322,  2.0000093 ,  6.0004878 ])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}, the last dimension is of shape (2)
        """
        return arg_0._compute_agg('Func', arg_1, arg_2, arg_3, arg_4, arg_6, arg_7, arg_9, arg_8)
        @delayed
        def finish(arg_10):
            return arg_10[..., 0]
        return arg_0._delay(arg_7, finish(arg_0.Funcmax(arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_6=arg_6, arg_7=arg_7, arg_8=arg_8)))

Calculate the minimum for given expressions, possibly on a grid defined by binby.

        Example:

        >>> df.min("x")
        array(-128.293991)
        >>> df.min(["x", "y"])
        array([-128.293991 ,  -71.5523682])
        >>> df.min("x", binby="x", shape=5, limits=[-10, 10])
        array([-9.99919128, -5.99972439, -1.99991322,  2.0000093 ,  6.0004878 ])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}, the last dimension is of shape (2)

Calculate the minimum for given expressions possibly on a grid defined by binby .


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( 'from_date' , date ( 1990 , 1 , 1 ) ) arg_3 = arg_1 . get ( 'to_date' , date . today ( ) ) arg_4 = random . choice ( arg_0 . input_formats or formats . get_format ( 'DATE_INPUT_FORMATS' ) ) return xunit . any_date ( arg_2 = arg_2 , arg_3 = arg_3 ) . strftime ( arg_4 )

def Func(arg_0, **arg_1):
    """
    Return random value for DateField

    >>> result = any_form_field(forms.DateField())
    >>> type(result)
    <type 'str'>
    """
    arg_2 = arg_1.get('from_date', date(1990, 1, 1))
    arg_3 = arg_1.get('to_date', date.today())

    arg_4 = random.choice(arg_0.input_formats or formats.get_format('DATE_INPUT_FORMATS'))

    return xunit.any_date(arg_2=arg_2, arg_3=arg_3).strftime(arg_4)


return list(map(lambda i: i.lstrip(), _list))

def Func ( arg_0 ) : arg_1 = arg_0 . split ( "," ) return list ( map ( lambda i : i . lstrip ( ) , arg_1 ) )

def Func(arg_0):
    """Converts a comma separated string to a list"""
    arg_1 = arg_0.split(",")
    return list(map(lambda i: i.lstrip(), arg_1))


return CourseEnrollment.objects.filter(
            created__gt=datetime.datetime.now() - datetime.timedelta(days=days)
        ).filter(
            user_id__in=enterprise_customer.enterprise_customer_users.values_list('user_id', flat=True)
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return CourseEnrollment . objects . filter ( created__gt = datetime . datetime . now ( ) - datetime . timedelta ( arg_2 = arg_2 ) ) . filter ( user_id__in = arg_1 . enterprise_customer_users . values_list ( 'user_id' , flat = True ) )

def Func(arg_0, arg_1, arg_2):
        """
        Get course enrollments for all the learners of given enterprise customer.

        Arguments:
            enterprise_customer (EnterpriseCustomer): Include Course enrollments for learners
                of this enterprise customer.
            days (int): Include course enrollment of this number of days.

        Returns:
            (list): A list of CourseEnrollment objects.
        """
        return CourseEnrollment.objects.filter(
            created__gt=datetime.datetime.now() - datetime.timedelta(arg_2=arg_2)
        ).filter(
            user_id__in=arg_1.enterprise_customer_users.values_list('user_id', flat=True)
        )

Get course enrollments for all the learners of given enterprise customer .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] arg_5 = [ ] for arg_6 in arg_1 : arg_4 . append ( arg_6 ) arg_5 . append ( arg_1 [ arg_6 ] ) arg_7 = pd . DataFrame ( { arg_2 [ 0 ] : arg_4 , arg_3 [ 0 ] : arg_5 } ) return arg_7

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Converts a dictionnary to a pandas dataframe
        """
        arg_4 = []
        arg_5 = []
        for arg_6 in arg_1:
            arg_4.append(arg_6)
            arg_5.append(arg_1[arg_6])
        arg_7 = pd.DataFrame({arg_2[0]: arg_4, arg_3[0]: arg_5})
        return arg_7


(x0, y0, t0, t1, s0, c0, flip, cs, ss, cmd, scale, rot)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, arg_10, arg_11):

    """ Mark Meyer's code draws elegant CURVETO segments.
    """

    arg_12 = None
    for arg_13 in range(0, 5):
        # travel along the function two points at a time (at time t and t2)
        # the first time through we'll need to get both points
        # after that we only need the second point because the old second point
        # becomes the new first point
        arg_14 = arg_13 * .2
        arg_15 = arg_14+ .2

        arg_16 = arg_2 + arg_14 * (arg_3 - arg_2)
        arg_17 = arg_2 + arg_15 * (arg_3 - arg_2)
        arg_18 = (arg_17 - arg_16) * arg_10

        if not arg_12:
            # get first point
            # avoid calling this again: the next time though x,y will equal x3, y3
            arg_12, arg_19 = eval_cornu(arg_16)
            arg_12 *= arg_6
            arg_12 -= arg_4
            arg_19 -= arg_5
            # calculate derivative of fresnel function at point to get tangent slope
            # just take the integrand of the fresnel function
            arg_20 =  cos(pow(arg_16, 2) + (arg_6 * arg_11))
            arg_21 =  arg_6 * sin(pow(arg_16, 2) + (arg_6 *arg_11))
            # x,y = first point on function
            arg_22 = ((arg_19 * arg_7 - arg_12 * arg_8) +arg_0)
            arg_23 = ((arg_12 * arg_7 + arg_19 * arg_8) + arg_1)

        #evaluate the fresnel further along the function to look ahead to the next point
        arg_24,arg_25 = eval_cornu(arg_17)
        arg_24 *= arg_6
        arg_24 -= arg_4
        arg_25 -= arg_5

        arg_26 = cos(pow(arg_17, 2) + (arg_6 * arg_11))
        arg_27 = arg_6 * sin(pow(arg_17, 2) + (arg_6 * arg_11))
        # x3, y3 = second point on function
        arg_28 = ((arg_25 * arg_7 - arg_24 * arg_8)+arg_0)
        arg_29 = ((arg_24 * arg_7 + arg_25 * arg_8)+arg_1)

        # calculate control points
        arg_30 = (arg_22 + ((arg_18/3.0) * arg_20))
        arg_31 = (arg_23 + ((arg_18/3.0) * arg_21))
        arg_32 = (arg_28 - ((arg_18/3.0) * arg_26))
        arg_33 = (arg_29 - ((arg_18/3.0) * arg_27))

        if arg_9 == 'moveto':
            print_pt(arg_22, arg_23, arg_9)
            arg_9 = 'curveto'
        print_crv(arg_30, arg_31, arg_32, arg_33, arg_28, arg_29)

        arg_20, arg_21 = arg_26, arg_27
        arg_22,arg_23 = arg_28, arg_29

    return arg_9

Mark Meyer s code draws elegant CURVETO segments .


def Func ( arg_0 , arg_1 = "train" ) : arg_2 = 'train-images-idx3-ubyte.gz' arg_3 = 'train-labels-idx1-ubyte.gz' arg_4 = 't10k-images-idx3-ubyte.gz' arg_5 = 't10k-labels-idx1-ubyte.gz' if arg_1 == "train" : arg_6 = base . maybe_download ( arg_2 , arg_0 , SOURCE_URL + arg_2 ) with open ( arg_6 , 'rb' ) as f : arg_7 = extract_images ( f ) arg_6 = base . maybe_download ( arg_3 , arg_0 , SOURCE_URL + arg_3 ) with open ( arg_6 , 'rb' ) as f : arg_8 = extract_labels ( f ) return arg_7 , arg_8 else : arg_6 = base . maybe_download ( arg_4 , arg_0 , SOURCE_URL + arg_4 ) with open ( arg_6 , 'rb' ) as f : arg_9 = extract_images ( f ) arg_6 = base . maybe_download ( arg_5 , arg_0 , SOURCE_URL + arg_5 ) with open ( arg_6 , 'rb' ) as f : arg_10 = extract_labels ( f ) return arg_9 , arg_10

def Func(arg_0, arg_1="train"):
    """
    Parse or download mnist data if train_dir is empty.

    :param: train_dir: The directory storing the mnist data

    :param: data_type: Reading training set or testing set.It can be either "train" or "test"

    :return:

    ```
    (ndarray, ndarray) representing (features, labels)
    features is a 4D unit8 numpy array [index, y, x, depth] representing each pixel valued from 0 to 255.
    labels is 1D unit8 nunpy array representing the label valued from 0 to 9.
    ```

    """
    arg_2 = 'train-images-idx3-ubyte.gz'
    arg_3 = 'train-labels-idx1-ubyte.gz'
    arg_4 = 't10k-images-idx3-ubyte.gz'
    arg_5 = 't10k-labels-idx1-ubyte.gz'

    if arg_1 == "train":
        arg_6 = base.maybe_download(arg_2, arg_0,
                                         SOURCE_URL + arg_2)
        with open(arg_6, 'rb') as f:
            arg_7 = extract_images(f)

        arg_6 = base.maybe_download(arg_3, arg_0,
                                         SOURCE_URL + arg_3)
        with open(arg_6, 'rb') as f:
            arg_8 = extract_labels(f)
        return arg_7, arg_8

    else:
        arg_6 = base.maybe_download(arg_4, arg_0,
                                         SOURCE_URL + arg_4)
        with open(arg_6, 'rb') as f:
            arg_9 = extract_images(f)

        arg_6 = base.maybe_download(arg_5, arg_0,
                                         SOURCE_URL + arg_5)
        with open(arg_6, 'rb') as f:
            arg_10 = extract_labels(f)
        return arg_9, arg_10

Parse or download mnist data if train_dir is empty .


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) arg_3 = arg_0 . size arg_4 = np . sqrt ( arg_3 ) arg_5 = arg_0 . mean ( ) arg_2 [ 'max_cluster_size' ] = arg_5 arg_6 = arg_0 . std ( ddof = 1 ) if arg_6 : arg_7 = np . seterr ( all = 'raise' ) arg_2 [ 'max_cluster_size_ci' ] = scipy . stats . t . interval ( 1 - arg_1 , df = arg_3 - 1 , loc = arg_5 , scale = arg_6 / arg_4 ) np . seterr ( ** arg_7 ) else : arg_2 [ 'max_cluster_size_ci' ] = ( arg_5 * np . ones ( 2 ) ) return arg_2

def Func(arg_0, arg_1):
    """
    Compute the average size of the largest cluster

    Helper function for :func:`microcanonical_averages`

    Parameters
    ----------

    max_cluster_size : 1-D :py:class:`numpy.ndarray` of int
        Each entry is the ``max_cluster_size`` field of the output of
        :func:`sample_states`:
        The size of the largest cluster (absolute number of sites).

    alpha: float
        Significance level.

    Returns
    -------

    ret : dict
        Largest cluster statistics

    ret['max_cluster_size'] : float
        Average size of the largest cluster (absolute number of sites)

    ret['max_cluster_size_ci'] : 1-D :py:class:`numpy.ndarray` of float, size 2
        Lower and upper bounds of the normal confidence interval of the average
        size of the largest cluster (absolute number of sites)

    See Also
    --------

    sample_states : largest cluster detection

    microcanonical_averages : largest cluster statistics
    """

    arg_2 = dict()
    arg_3 = arg_0.size
    arg_4 = np.sqrt(arg_3)

    arg_5 = arg_0.mean()
    arg_2['max_cluster_size'] = arg_5

    arg_6 = arg_0.std(ddof=1)
    if arg_6:
        arg_7 = np.seterr(all='raise')
        arg_2['max_cluster_size_ci'] = scipy.stats.t.interval(
            1 - arg_1,
            df=arg_3 - 1,
            loc=arg_5,
            scale=arg_6 / arg_4
        )
        np.seterr(**arg_7)
    else:
        arg_2['max_cluster_size_ci'] = (
            arg_5 * np.ones(2)
        )

    return arg_2


return pulse_drawer(self._samples, self.duration, **kwargs)

def Func ( arg_0 , ** arg_1 ) : from qiskit . tools . visualization import pulse_Funcer return pulse_Funcer ( arg_0 . _samples , arg_0 . duration , ** arg_1 )

def Func(arg_0, **arg_1):
        """Plot the interpolated envelope of pulse.

        Keyword Args:
            dt (float): Time interval of samples.
            interp_method (str): Method of interpolation
                (set `None` for turn off the interpolation).
            filename (str): Name required to save pulse image.
            interactive (bool): When set true show the circuit in a new window
                (this depends on the matplotlib backend being used supporting this).
            dpi (int): Resolution of saved image.
            nop (int): Data points for interpolation.
            size (tuple): Size of figure.
        """
        from qiskit.tools.visualization import pulse_Funcer

        return pulse_Funcer(arg_0._samples, arg_0.duration, **arg_1)

Plot the interpolated envelope of pulse .


def Func ( arg_0 , arg_1 ) : arg_0 . _check_boolean_expressions ( arg_1 ) arg_2 = 1 if arg_1 . orelse and ( len ( arg_1 . orelse ) > 1 or not isinstance ( arg_1 . orelse [ 0 ] , If ) ) : arg_2 += 1 arg_0 . _inc_branch ( arg_1 , arg_2 ) arg_0 . _inc_all_stmts ( arg_2 )

def Func(arg_0, arg_1):
        """increments the branches counter and checks boolean expressions"""
        arg_0._check_boolean_expressions(arg_1)
        arg_2 = 1
        # don't double count If nodes coming from some 'elif'
        if arg_1.orelse and (len(arg_1.orelse) > 1 or not isinstance(arg_1.orelse[0], If)):
            arg_2 += 1
        arg_0._inc_branch(arg_1, arg_2)
        arg_0._inc_all_stmts(arg_2)


Pipes output of prev_proc into to_cmd.
  Returns piped process

def Func ( arg_0 , arg_1 ) : arg_2 = None if arg_0 is None else arg_0 . stdout arg_3 = subprocess . Popen ( arg_1 , stdout = subprocess . PIPE , arg_2 = arg_2 ) if arg_0 is not None : arg_0 . stdout . close ( ) return arg_3

def Func(arg_0, arg_1):
  """
  Pipes output of prev_proc into to_cmd.
  Returns Funcd process
  """
  arg_2 = None if arg_0 is None else arg_0.stdout
  arg_3 = subprocess.Popen(arg_1,
                             stdout=subprocess.PIPE,
                             arg_2=arg_2)
  if arg_0 is not None:
    arg_0.stdout.close() # Allow prev_proc to receive a SIGPIPE
  return arg_3

Pipes output of prev_proc into to_cmd . Returns piped process


def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , [ str ] ) assert_satisfies ( arg_1 , len ( arg_1 ) == arg_0 . ncol ) arg_0 . _ex = ExprNode ( "colnames=" , arg_0 , range ( arg_0 . ncol ) , arg_1 ) return arg_0

def Func(arg_0, arg_1):
        """
        Change names of all columns in the frame.

        :param List[str] names: The list of new names for every column in the frame.
        """
        assert_is_type(arg_1, [str])
        assert_satisfies(arg_1, len(arg_1) == arg_0.ncol)
        arg_0._ex = ExprNode("colnames=", arg_0, range(arg_0.ncol), arg_1)  # Update-in-place, but still lazy
        return arg_0

Change names of all columns in the frame .


(self, gain_in=0.8, gain_out=0.9, n_echos=1, delays=[60],
             decays=[0.4])

def Func(arg_0, arg_1=0.8, arg_2=0.9, arg_3=1, arg_4=[60],
             arg_5=[0.4]):
        '''Add Funcing to the audio.

        Echoes are reflected sound and can occur naturally amongst mountains
        (and sometimes large buildings) when talking or shouting; digital Func
        effects emulate this behav- iour and are often used to help fill out
        the sound of a single instrument or vocal. The time differ- ence
        between the original signal and the reflection is the 'delay' (time),
        and the loudness of the reflected signal is the 'decay'. Multiple
        Funces can have different delays and decays.

        Parameters
        ----------
        gain_in : float, default=0.8
            Input volume, between 0 and 1
        gain_out : float, default=0.9
            Output volume, between 0 and 1
        n_Funcs : int, default=1
            Number of reflections
        delays : list, default=[60]
            List of delays in miliseconds
        decays : list, default=[0.4]
            List of decays, relative to gain in between 0 and 1

        See Also
        --------
        Funcs, reverb, chorus
        '''
        if not is_number(arg_1) or arg_1 <= 0 or arg_1 > 1:
            raise ValueError("gain_in must be a number between 0 and 1.")

        if not is_number(arg_2) or arg_2 <= 0 or arg_2 > 1:
            raise ValueError("gain_out must be a number between 0 and 1.")

        if not isinstance(arg_3, int) or arg_3 <= 0:
            raise ValueError("n_Funcs must be a positive integer.")

        # validate delays
        if not isinstance(arg_4, list):
            raise ValueError("delays must be a list")

        if len(arg_4) != arg_3:
            raise ValueError("the length of delays must equal n_Funcs")

        if any((not is_number(arg_6) or arg_6 <= 0) for arg_6 in arg_4):
            raise ValueError("the elements of delays must be numbers > 0")

        # validate decays
        if not isinstance(arg_5, list):
            raise ValueError("decays must be a list")

        if len(arg_5) != arg_3:
            raise ValueError("the length of decays must equal n_Funcs")
        if any((not is_number(arg_6) or arg_6 <= 0 or arg_6 > 1) for arg_6 in arg_5):
            raise ValueError(
                "the elements of decays must be between 0 and 1"
            )

        arg_7 = ['Func', '{:f}'.format(arg_1), '{:f}'.format(arg_2)]

        for arg_8 in range(arg_3):
            arg_7.extend([
                '{}'.format(arg_4[arg_8]),
                '{}'.format(arg_5[arg_8])
            ])

        arg_0.effects.extend(arg_7)
        arg_0.effects_log.append('Func')
        return arg_0

Add echoing to the audio.

        Echoes are reflected sound and can occur naturally amongst mountains
        (and sometimes large buildings) when talking or shouting; digital echo
        effects emulate this behav- iour and are often used to help fill out
        the sound of a single instrument or vocal. The time differ- ence
        between the original signal and the reflection is the 'delay' (time),
        and the loudness of the reflected signal is the 'decay'. Multiple
        echoes can have different delays and decays.

        Parameters
        ----------
        gain_in : float, default=0.8
            Input volume, between 0 and 1
        gain_out : float, default=0.9
            Output volume, between 0 and 1
        n_echos : int, default=1
            Number of reflections
        delays : list, default=[60]
            List of delays in miliseconds
        decays : list, default=[0.4]
            List of decays, relative to gain in between 0 and 1

        See Also
        --------
        echos, reverb, chorus


def Func ( arg_0 , arg_1 ) : arg_2 = _parseAccept ( arg_1 . requestHeaders . getRawHeaders ( 'Accept' ) ) for arg_3 in arg_2 . keys ( ) : arg_4 = arg_0 . _acceptHandlers . get ( arg_3 . lower ( ) ) if arg_4 is not None : return arg_4 , arg_4 . contentType if arg_0 . _fallback : arg_4 = arg_0 . _handlers [ 0 ] return arg_4 , arg_4 . contentType return NotAcceptable ( ) , None

def Func(arg_0, arg_1):
        """
        Negotiate a handler based on the content types acceptable to the
        client.

        :rtype: 2-`tuple` of `twisted.web.iweb.IResource` and `bytes`
        :return: Pair of a resource and the content type.
        """
        arg_2 = _parseAccept(arg_1.requestHeaders.getRawHeaders('Accept'))
        for arg_3 in arg_2.keys():
            arg_4 = arg_0._acceptHandlers.get(arg_3.lower())
            if arg_4 is not None:
                return arg_4, arg_4.contentType

        if arg_0._fallback:
            arg_4 = arg_0._handlers[0]
            return arg_4, arg_4.contentType
        return NotAcceptable(), None

Negotiate a handler based on the content types acceptable to the client .


def Func(arg_0, arg_1=False, arg_2=True):
    """
    A generator to convert raw text segments, with xml, and other
    non-textual content to a list of words without any markup.
    Additionally dates are replaced by `7777` for normalization.

    Arguments
    ---------
       text: str, input text to tokenize, strip of markup.
       keep_whitespace : bool, should the output retain the
          whitespace of the input (so that char offsets in the
          output correspond to those in the input).

    Returns
    -------
        generator<list<list<str>>>, a generator for sentences, with
            within each sentence a list of the words separated.
    """
    arg_3 = arg_0
    arg_3 = _remove_urls(arg_0)
    arg_3 = _remove_mvar(arg_3)
    arg_3 = _remove_squiggly_bracket(arg_3)
    arg_3 = _remove_table(arg_3)
    arg_3 = _remove_brackets(arg_3)
    arg_3 = remove_remaining_double_brackets(arg_3)
    arg_3 = remove_markup(arg_3)
    arg_3 = remove_wikipedia_link.sub(anchor_replacer, arg_3)
    arg_3 = remove_bullets_nbsps.sub(empty_space, arg_3)
    arg_3 = remove_dates(arg_3)
    arg_3 = remove_math_sections(arg_3)
    arg_3 = remove_html(arg_3)
    arg_3 = sent_tokenize(arg_3, arg_1, arg_2)
    return arg_3

A generator to convert raw text segments with xml and other non - textual content to a list of words without any markup . Additionally dates are replaced by 7777 for normalization .


(self,
                        instance_id,
                        main_cluster_id,
                        main_cluster_zone,
                        project_id=None,
                        replica_cluster_id=None,
                        replica_cluster_zone=None,
                        instance_display_name=None,
                        instance_type=enums.Instance.Type.TYPE_UNSPECIFIED,
                        instance_labels=None,
                        cluster_nodes=None,
                        cluster_storage_type=enums.StorageType.STORAGE_TYPE_UNSPECIFIED,
                        timeout=None)

def Func(arg_0,
                        arg_1,
                        arg_2,
                        arg_3,
                        arg_4=None,
                        arg_5=None,
                        arg_6=None,
                        arg_7=None,
                        arg_8=arg_9.Instance.Type.TYPE_UNSPECIFIED,
                        arg_13=None,
                        arg_14=None,
                        arg_15=arg_9.StorageType.STORAGE_TYPE_UNSPECIFIED,
                        arg_18=None):
        """
        Creates new instance.

        :type instance_id: str
        :param instance_id: The ID for the new instance.
        :type main_cluster_id: str
        :param main_cluster_id: The ID for main cluster for the new instance.
        :type main_cluster_zone: str
        :param main_cluster_zone: The zone for main cluster.
            See https://cloud.google.com/bigtable/docs/locations for more details.
        :type project_id: str
        :param project_id: Optional, Google Cloud Platform project ID where the
            BigTable exists. If set to None or missing,
            the default project_id from the GCP connection is used.
        :type replica_cluster_id: str
        :param replica_cluster_id: (optional) The ID for replica cluster for the new
            instance.
        :type replica_cluster_zone: str
        :param replica_cluster_zone: (optional)  The zone for replica cluster.
        :type instance_type: enums.Instance.Type
        :param instance_type: (optional) The type of the instance.
        :type instance_display_name: str
        :param instance_display_name: (optional) Human-readable name of the instance.
                Defaults to ``instance_id``.
        :type instance_labels: dict
        :param instance_labels: (optional) Dictionary of labels to associate with the
            instance.
        :type cluster_nodes: int
        :param cluster_nodes: (optional) Number of nodes for cluster.
        :type cluster_storage_type: enums.StorageType
        :param cluster_storage_type: (optional) The type of storage.
        :type timeout: int
        :param timeout: (optional) timeout (in seconds) for instance creation.
                        If None is not specified, Operator will wait indefinitely.
        """
        arg_15 = arg_9.StorageType(arg_15)
        arg_8 = arg_9.Instance.Type(arg_8)

        arg_19 = arg_10(
            arg_1,
            arg_0._get_client(arg_4=arg_4),
            arg_7,
            arg_8,
            arg_13,
        )

        arg_20 = [
            arg_19.cluster(
                arg_2,
                arg_3,
                arg_14,
                arg_15
            )
        ]
        if arg_5 and arg_6:
            arg_20.append(arg_19.cluster(
                arg_5,
                arg_6,
                arg_14,
                arg_15
            ))
        arg_21 = arg_19.create(
            arg_20=arg_20
        )
        arg_21.result(arg_18)
        return arg_19


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_2
=
seed_stream
.
SeedStream
(
arg_2
,
salt
=
'von_mises_fisher_3d'
)
arg_3
=
tf
.
concat
(
[
[
arg_1
]
,
arg_0
.
_batch_shape_tensor
(
)
]
,
axis
=
0
)
arg_4
=
tf
.
random
.
uniform
(
arg_3
,
arg_2
=
arg_2
(
)
,
dtype
=
arg_0
.
dtype
)
arg_5
=
tf
.
where
(
arg_0
.
concentration
>
0
,
arg_0
.
concentration
,
tf
.
ones_like
(
arg_0
.
concentration
)
)
arg_6
=
tf
.
where
(
arg_4
>
0
,
arg_4
,
tf
.
ones_like
(
arg_4
)
)
arg_7
=
1
+
tf
.
reduce_logsumexp
(
input_tensor
=
[
tf
.
math
.
log
(
arg_6
)
,
tf
.
math
.
log1p
(
arg_6
)
2
*
arg_5
]
,
axis
=
0
)
/
arg_5
arg_8
=
tf
.
where
(
arg_0
.
concentration
>
tf
.
zeros_like
(
arg_7
)
,
arg_7
,
2
*
arg_4
1
)
arg_8
=
tf
.
where
(
tf
.
equal
(
arg_4
,
0
)
,
tf
.
ones_like
(
arg_8
)
,
arg_8
)
if
not
arg_0
.
_allow_nan_stats
:
arg_8
=
tf
.
debugging
.
check_numerics
(
arg_8
,
'u in Func'
)
return
arg_8
[
...
,
tf
.
newaxis
]

def Func(arg_0, arg_1, arg_2=None):
    """Specialized inversion sampler for 3D."""
    arg_2 = seed_stream.SeedStream(arg_2, salt='von_mises_fisher_3d')
    arg_3 = tf.concat([[arg_1], arg_0._batch_shape_tensor()], axis=0)
    arg_4 = tf.random.uniform(arg_3, arg_2=arg_2(), dtype=arg_0.dtype)
    # TODO(bjp): Higher-order odd dim analytic CDFs are available in [1], could
    # be bisected for bounded sampling runtime (i.e. not rejection sampling).
    # [1]: Inversion sampler via: https://ieeexplore.ieee.org/document/7347705/
    # The inversion is: u = 1 + log(z + (1-z)*exp(-2*kappa)) / kappa
    # We must protect against both kappa and z being zero.
    arg_5 = tf.where(arg_0.concentration > 0,
                         arg_0.concentration,
                         tf.ones_like(arg_0.concentration))
    arg_6 = tf.where(arg_4 > 0, arg_4, tf.ones_like(arg_4))
    arg_7 = 1 + tf.reduce_logsumexp(
        input_tensor=[
            tf.math.log(arg_6),
            tf.math.log1p(-arg_6) - 2 * arg_5
        ],
        axis=0) / arg_5
    # Limit of the above expression as kappa->0 is 2*z-1
    arg_8 = tf.where(arg_0.concentration > tf.zeros_like(arg_7), arg_7,
                 2 * arg_4 - 1)
    # Limit of the expression as z->0 is -1.
    arg_8 = tf.where(tf.equal(arg_4, 0), -tf.ones_like(arg_8), arg_8)
    if not arg_0._allow_nan_stats:
      arg_8 = tf.debugging.check_numerics(arg_8, 'u in Func')
    return arg_8[..., tf.newaxis]


(self, bucket_name, prefix='', delimiter='',
                  page_size=None, max_items=None)

def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = '' , arg_4 = None , arg_5 = None ) : arg_6 = { 'PageSize' : arg_4 , 'MaxItems' : arg_5 , } arg_7 = arg_0 . get_conn ( ) . get_paginator ( 'list_objects_v2' ) arg_8 = arg_7 . paginate ( Bucket = arg_1 , Prefix = arg_2 , Delimiter = arg_3 , PaginationConfig = arg_6 ) arg_9 = False arg_10 = [ ] for arg_11 in arg_8 : if 'Contents' in arg_11 : arg_9 = True for arg_12 in arg_11 [ 'Contents' ] : arg_10 . append ( arg_12 [ 'Key' ] ) if arg_9 : return arg_10

def Func(arg_0, arg_1, arg_2='', arg_3='',
                  arg_4=None, arg_5=None):
        """
        Lists keys in a bucket under prefix and not containing delimiter

        :param bucket_name: the name of the bucket
        :type bucket_name: str
        :param prefix: a key prefix
        :type prefix: str
        :param delimiter: the delimiter marks key hierarchy.
        :type delimiter: str
        :param page_size: pagination size
        :type page_size: int
        :param max_items: maximum items to return
        :type max_items: int
        """
        arg_6 = {
            'PageSize': arg_4,
            'MaxItems': arg_5,
        }

        arg_7 = arg_0.get_conn().get_paginator('list_objects_v2')
        arg_8 = arg_7.paginate(Bucket=arg_1,
                                      Prefix=arg_2,
                                      Delimiter=arg_3,
                                      PaginationConfig=arg_6)

        arg_9 = False
        arg_10 = []
        for arg_11 in arg_8:
            if 'Contents' in arg_11:
                arg_9 = True
                for arg_12 in arg_11['Contents']:
                    arg_10.append(arg_12['Key'])

        if arg_9:
            return arg_10


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
False
)
:
arg_5
=
arg_3
+
"/swhlab4/%s_index.html"
%
arg_0
if
arg_4
is
False
and
os
.
path
.
exists
(
arg_5
)
:
return
arg_6
=
TEMPLATES
[
'abf'
]
arg_6
=
arg_6
.
replace
(
"~ID~"
,
arg_0
)
arg_6
=
arg_6
.
replace
(
"~CONTENT~"
,
Funccontent
(
arg_0
,
arg_1
,
arg_2
)
)
print
(
" <- writing [%s]"
%
os
.
path
.
basename
(
arg_5
)
)
with
open
(
arg_5
,
'w'
)
as
f
:
f
.
write
(
arg_6
)
return

def Func(arg_0,arg_1,arg_2,arg_3,arg_4=False):
    """given an ID and the dict of files, generate a static html for that abf."""
    arg_5=arg_3+"/swhlab4/%s_index.html"%arg_0
    if arg_4 is False and os.path.exists(arg_5):
        return
    arg_6=TEMPLATES['abf']
    arg_6=arg_6.replace("~ID~",arg_0)
    arg_6=arg_6.replace("~CONTENT~",Funccontent(arg_0,arg_1,arg_2))
    print(" <- writing [%s]"%os.path.basename(arg_5))
    with open(arg_5,'w') as f:
        f.write(arg_6)
    return

given an ID and the dict of files generate a static html for that abf .


def
Func
(
arg_0
)
:
try
:
if
not
os
.
path
.
exists
(
arg_0
)
:
os
.
makedirs
(
arg_0
)
arg_1
=
glob
(
os
.
path
.
join
(
arg_0
,
"[0-9]*"
)
)
arg_2
=
os
.
path
.
join
(
arg_0
,
'000'
)
if
arg_1
:
arg_3
=
sorted
(
[
int
(
os
.
path
.
basename
(
arg_3
)
)
for
arg_3
in
arg_1
]
)
[
1
]
arg_2
=
os
.
path
.
join
(
arg_0
,
'{0:03}'
.
format
(
arg_3
+
1
)
)
os
.
makedirs
(
arg_2
)
logger
.
debug
(
"Parsl run initializing in rundir: {0}"
.
format
(
arg_2
)
)
return
os
.
path
.
abspath
(
arg_2
)
except
Exception
as
e
:
logger
.
error
(
"Failed to create a run directory"
)
logger
.
error
(
"Error: {0}"
.
format
(
e
)
)
raise

def Func(arg_0):
    """When a path has not been specified, make the run directory.

    Creates a rundir with the following hierarchy:
        ./runinfo <- Home of all run directories
          |----000
          |----001 <- Directories for each run
          | ....
          |----NNN

    Kwargs:
        - path (str): String path to a specific run dir
               Default : None.
    """
    try:
        if not os.path.exists(arg_0):
            os.makedirs(arg_0)

        arg_1 = glob(os.path.join(arg_0, "[0-9]*"))

        arg_2 = os.path.join(arg_0, '000')

        if arg_1:
            # Since we globbed on files named as 0-9
            arg_3 = sorted([int(os.path.basename(arg_3)) for arg_3 in arg_1])[-1]
            arg_2 = os.path.join(arg_0, '{0:03}'.format(arg_3 + 1))

        os.makedirs(arg_2)
        logger.debug("Parsl run initializing in rundir: {0}".format(arg_2))
        return os.path.abspath(arg_2)

    except Exception as e:
        logger.error("Failed to create a run directory")
        logger.error("Error: {0}".format(e))
        raise

When a path has not been specified make the run directory .


Returns true iff this interval contains the interval i

return self.start <= i.start and i.end <= self.end

def Func ( arg_0 , arg_1 ) : return arg_0 . start <= arg_1 . start and arg_1 . end <= arg_0 . end

def Func(arg_0, arg_1):
        '''Returns true iff this interval Func the interval i'''
        return arg_0.start <= arg_1.start and arg_1.end <= arg_0.end


def Func(arg_0):
        """Count the occurrences of operation names.

        Returns a dictionary of counts keyed on the operation name.
        """
        arg_1 = {}
        for arg_2 in arg_0.topological_op_nodes():
            arg_3 = arg_2.name
            if arg_3 not in arg_1:
                arg_1[arg_3] = 1
            else:
                arg_1[arg_3] += 1
        return arg_1

Count the occurrences of operation names .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = [ ] arg_3 = arg_1 . get ( 'prefix' , '' ) arg_4 = arg_1 . get ( 'buf_count' , 2 ) if len ( arg_0 ) == 1 : arg_0 = list ( arg_0 [ 0 ] ) else : arg_0 = list ( zip ( * arg_0 ) ) arg_5 = arg_1 . get ( "headers" , [ ] ) if arg_5 : arg_0 . insert ( 0 , arg_5 ) arg_6 = arg_1 . get ( "widths" , [ ] ) arg_7 = Counter ( ) for arg_8 in range ( len ( arg_6 ) ) : arg_7 [ arg_8 ] = int ( arg_6 [ arg_8 ] ) arg_9 = int ( arg_1 . get ( "width" , 0 ) ) for arg_10 in arg_0 : for arg_8 , arg_11 in enumerate ( arg_10 ) : if isinstance ( arg_11 , basestring ) : arg_12 = len ( arg_11 ) else : arg_12 = len ( str ( arg_11 ) ) if arg_12 > arg_7 [ arg_8 ] : arg_7 [ arg_8 ] = arg_12 arg_9 = int ( arg_1 . get ( "width" , 0 ) ) if arg_9 : for arg_8 in arg_7 : if arg_7 [ arg_8 ] < arg_9 : arg_7 [ arg_8 ] = arg_9 def colstr ( arg_11 ) : if isinstance ( arg_11 , basestring ) : return arg_11 return str ( arg_11 ) def rowstr ( arg_10 , arg_3 , arg_7 ) : arg_13 = arg_3 arg_14 = list ( map ( colstr , arg_10 ) ) for arg_8 in range ( len ( arg_7 ) ) : arg_11 = arg_14 [ arg_8 ] if re . match ( r"^\d+(?:\.\d+)?$" , arg_11 ) : if arg_8 == 0 : arg_13 += "{:>" + str ( arg_7 [ arg_8 ] ) + "}" else : arg_13 += "{:>" + str ( arg_7 [ arg_8 ] + arg_4 ) + "}" else : arg_13 += "{:<" + str ( arg_7 [ arg_8 ] + arg_4 ) + "}" return arg_13 . format ( * arg_14 ) for arg_10 in arg_0 : arg_2 . append ( rowstr ( arg_10 , arg_3 , arg_7 ) ) out ( os . linesep . join ( arg_2 ) )

def Func(*arg_0, **arg_1):
    """
    format columned data so we can easily print it out on a console, this just takes
    columns of data and it will format it into properly aligned columns, it's not
    fancy, but it works for most type of strings that I need it for, like server name
    lists.

    other formatting options:
        http://stackoverflow.com/a/8234511/5006

    other packages that probably do this way better:
        https://stackoverflow.com/a/26937531/5006

    :Example:
        >>> echo.Func([(1, 2), (3, 4), (5, 6), (7, 8), (9, 0)])
        1  2
        3  4
        5  6
        7  8
        9  0
        >>> echo.Func([1, 3, 5, 7, 9], [2, 4, 6, 8, 0])
        1  2
        3  4
        5  6
        7  8
        9  0

    :param *columns: can either be a list of rows or multiple lists representing each
        column in the Func
    :param **kwargs: dict
        prefix -- string -- what you want before each row (eg, a tab)
        buf_count -- integer -- how many spaces between longest col value and its neighbor
        headers -- list -- the headers you want, must match column count
        widths -- list -- the widths of each column you want to use, this doesn't have
            to match column count, so you can do something like [0, 5] to set the
            width of the second column
        width -- int -- similar to widths except it will set this value for all columns
    """
    arg_2 = []
    arg_3 = arg_1.get('prefix', '')
    arg_4 = arg_1.get('buf_count', 2)
    if len(arg_0) == 1:
        arg_0 = list(arg_0[0])
    else:
        # without the list the zip iterator gets spent, I'm sure I can make this
        # better
        arg_0 = list(zip(*arg_0))

    arg_5 = arg_1.get("headers", [])
    if arg_5:
        arg_0.insert(0, arg_5)

    # we have to go through all the rows and calculate the length of each
    # column of each row
    arg_6 = arg_1.get("widths", [])
    arg_7 = Counter()
    for arg_8 in range(len(arg_6)):
        arg_7[arg_8] = int(arg_6[arg_8])

    arg_9 = int(arg_1.get("width", 0))
    for arg_10 in arg_0:
        for arg_8, arg_11 in enumerate(arg_10):
            if isinstance(arg_11, basestring):
                arg_12 = len(arg_11)
            else:
                arg_12 = len(str(arg_11))
            if arg_12 > arg_7[arg_8]:
                arg_7[arg_8] = arg_12

    arg_9 = int(arg_1.get("width", 0))
    if arg_9:
        for arg_8 in arg_7:
            if arg_7[arg_8] < arg_9:
                arg_7[arg_8] = arg_9

    # actually go through and format each row
    def colstr(arg_11):
        if isinstance(arg_11, basestring): return arg_11
        return str(arg_11)

    def rowstr(arg_10, arg_3, arg_7):
        arg_13 = arg_3
        arg_14 = list(map(colstr, arg_10))
        for arg_8 in range(len(arg_7)):
            arg_11 = arg_14[arg_8]
            # build the format string for each row, we use the row_counts found
            # above to decide how much padding each column should get
            # https://stackoverflow.com/a/9536084/5006
            if re.match(r"^\d+(?:\.\d+)?$", arg_11):
                if arg_8 == 0:
                    arg_13 += "{:>" + str(arg_7[arg_8]) + "}"
                else:
                    arg_13 += "{:>" + str(arg_7[arg_8] + arg_4) + "}"
            else:
                arg_13 += "{:<" + str(arg_7[arg_8] + arg_4) + "}"

        return arg_13.format(*arg_14)

    for arg_10 in arg_0:
        arg_2.append(rowstr(arg_10, arg_3, arg_7))

    out(os.linesep.join(arg_2))

format columned data so we can easily print it out on a console, this just takes
    columns of data and it will format it into properly aligned columns, it's not
    fancy, but it works for most type of strings that I need it for, like server name
    lists.

    other formatting options:
        http://stackoverflow.com/a/8234511/5006

    other packages that probably do this way better:
        https://stackoverflow.com/a/26937531/5006

    :Example:
        >>> echo.table([(1, 2), (3, 4), (5, 6), (7, 8), (9, 0)])
        1  2
        3  4
        5  6
        7  8
        9  0
        >>> echo.table([1, 3, 5, 7, 9], [2, 4, 6, 8, 0])
        1  2
        3  4
        5  6
        7  8
        9  0

    :param *columns: can either be a list of rows or multiple lists representing each
        column in the table
    :param **kwargs: dict
        prefix -- string -- what you want before each row (eg, a tab)
        buf_count -- integer -- how many spaces between longest col value and its neighbor
        headers -- list -- the headers you want, must match column count
        widths -- list -- the widths of each column you want to use, this doesn't have
            to match column count, so you can do something like [0, 5] to set the
            width of the second column
        width -- int -- similar to widths except it will set this value for all columns

format columned data so we can easily print it out on a console this just takes columns of data and it will format it into properly aligned columns it s not fancy but it works for most type of strings that I need it for like server name lists .


(self, context, context_id, external_tool_id,
                              json_data)

def Func(arg_0, arg_1, arg_2, arg_3,
                              arg_4):
        """
        Update the external tool identified by external_tool_id with the passed
        json data.

        context is either COURSES_API or ACCOUNTS_API.
        context_id is the course_id or account_id, depending on context

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.update
        """
        arg_5 = arg_1.format(arg_2) + "/external_tools/{}".format(
            arg_3)
        return arg_0._put_resource(arg_5, body=arg_4)

Update the external tool identified by external_tool_id with the passed json data .


def Func ( arg_0 , * , arg_1 = False ) : arg_2 = str ( arg_0 ) if arg_1 : from retype_hgext import apply_job_security arg_2 = apply_job_security ( arg_2 ) return arg_2

def Func(arg_0, *, arg_1=False):
    """Given a lib2to3 node, return its string representation."""
    arg_2 = str(arg_0)
    if arg_1:
        from retype_hgext import apply_job_security
        arg_2 = apply_job_security(arg_2)
    return arg_2

Given a lib2to3 node return its string representation .


def Func(arg_0, arg_1, arg_2):
        """
        Creates a course enrollment for an EnterpriseCustomerUser.
        """
        arg_3 = arg_0.get_object()
        arg_4 = serializers.EnterpriseCustomerCourseEnrollmentsSerializer(
            data=arg_1.data,
            many=True,
            context={
                'enterprise_customer': arg_3,
                'request_user': arg_1.user,
            }
        )
        if arg_4.is_valid():
            arg_4.save()
            return Response(arg_4.data, status=HTTP_200_OK)

        return Response(arg_4.errors, status=HTTP_400_BAD_REQUEST)

Creates a course enrollment for an EnterpriseCustomerUser .


def Func ( ) : arg_0 = widgets . IntProgress ( arg_6 = 0 , min = 0 , max = 50 , description = '' , orientation = 'horizontal' , layout = widgets . Layout ( max_width = '180px' ) ) arg_0 . style . bar_color = '#71cddd' arg_3 = widgets . Label ( arg_6 = str ( arg_0 . value ) , layout = widgets . Layout ( min_width = 'auto' ) ) arg_4 = widgets . Label ( arg_6 = str ( arg_0 . max ) , layout = widgets . Layout ( min_width = 'auto' ) ) def _on_max_change ( arg_5 ) : arg_4 . value = str ( arg_5 [ 'new' ] ) def _on_val_change ( arg_5 ) : arg_3 . value = str ( arg_5 [ 'new' ] ) arg_0 . observe ( _on_max_change , names = 'max' ) arg_0 . observe ( _on_val_change , names = 'value' ) arg_7 = widgets . HBox ( [ arg_3 , arg_0 , arg_4 ] , layout = widgets . Layout ( max_width = '250px' , min_width = '250px' , justify_content = 'center' ) ) return arg_7

def Func():
    """Generates a jobs_pending progress bar widget.
    """
    arg_0 = widgets.IntProgress(
        arg_6=0,
        min=0,
        max=50,
        description='',
        orientation='horizontal', layout=widgets.Layout(max_width='180px'))
    arg_0.style.bar_color = '#71cddd'

    arg_3 = widgets.Label(
        arg_6=str(arg_0.value), layout=widgets.Layout(min_width='auto'))
    arg_4 = widgets.Label(
        arg_6=str(arg_0.max), layout=widgets.Layout(min_width='auto'))

    def _on_max_change(arg_5):
        arg_4.value = str(arg_5['new'])

    def _on_val_change(arg_5):
        arg_3.value = str(arg_5['new'])

    arg_0.observe(_on_max_change, names='max')
    arg_0.observe(_on_val_change, names='value')

    arg_7 = widgets.HBox([arg_3, arg_0, arg_4],
                               layout=widgets.Layout(max_width='250px',
                                                     min_width='250px',
                                                     justify_content='center'))

    return arg_7

Generates a jobs_pending progress bar widget .


(self,
               alert_config,
               occurrence_frequency_count=None,
               occurrence_frequency_unit=None,
               alert_frequency_count=None,
               alert_frequency_unit=None)

return self._post(
            request=ApiActions.CREATE.value,
            uri=ApiUri.ACTIONS.value,
            params=data
        )

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = { 'rate_count' : arg_2 or 1 , 'rate_range' : arg_3 or 'hour' , 'limit_count' : arg_4 or 1 , 'limit_range' : arg_5 or 'hour' , 'schedule' : [ ] , 'enabled' : True , } arg_6 . update ( arg_1 . args ( ) ) return arg_0 . _post ( request = ApiActions . CREATE . value , uri = ApiUri . ACTIONS . value , params = arg_6 )

def Func(arg_0,
               arg_1,
               arg_2=None,
               arg_3=None,
               arg_4=None,
               arg_5=None):
        """
        Create a new alert

        :param alert_config: A list of AlertConfig classes (Ex:
            ``[EmailAlertConfig('me@mydomain.com')]``)
        :type alert_config: list of
            :class:`PagerDutyAlertConfig<logentries_api.alerts.PagerDutyAlertConfig>`,
            :class:`WebHookAlertConfig<logentries_api.alerts.WebHookAlertConfig>`,
            :class:`EmailAlertConfig<logentries_api.alerts.EmailAlertConfig>`,
            :class:`SlackAlertConfig<logentries_api.alerts.SlackAlertConfig>`, or
            :class:`HipChatAlertConfig<logentries_api.alerts.HipChatAlertConfig>`

        :param occurrence_frequency_count: How many times per
            ``alert_frequency_unit`` for a match before issuing an alert.
            Defaults to 1
        :type occurrence_frequency_count: int

        :param occurrence_frequency_unit: The time period to monitor for sending
            an alert. Must be 'day', or 'hour'. Defaults to 'hour'
        :type occurrence_frequency_unit: str

        :param alert_frequency_count: How many times per
            ``alert_frequency_unit`` to issue an alert. Defaults to 1
        :type alert_frequency_count: int

        :param alert_frequency_unit: How often to regulate sending alerts.
            Must be 'day', or 'hour'. Defaults to 'hour'
        :type alert_frequency_unit: str

        :returns: The response of your post
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_6 = {
            'rate_count': arg_2 or 1,
            'rate_range': arg_3 or 'hour',
            'limit_count': arg_4 or 1,
            'limit_range': arg_5 or 'hour',
            'schedule': [],
            'enabled': True,
        }
        arg_6.update(arg_1.args())

        # Yes, it's confusing. the `/actions/` endpoint is used for alerts, while
        # the /tags/ endpoint is used for labels.
        return arg_0._post(
            request=ApiActions.CREATE.value,
            uri=ApiUri.ACTIONS.value,
            params=arg_6
        )


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
"selection"
:
{
"selectionType"
:
"thermostats"
,
"selectionMatch"
:
arg_0
.
thermostats
[
arg_1
]
[
'identifier'
]
}
,
"thermostat"
:
{
"settings"
:
{
"hvacMode"
:
arg_2
}
}
}
arg_4
=
"set HVAC mode"
return
arg_0
.
make_request
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2):
        ''' possible hvac modes are auto, auxHeatOnly, cool, heat, off '''
        arg_3 = {"selection": {"selectionType": "thermostats",
                              "selectionMatch": arg_0.thermostats[arg_1]['identifier']},
                              "thermostat": {
                                  "settings": {
                                      "hvacMode": arg_2
                                  }
                              }}
        arg_4 = "set HVAC mode"
        return arg_0.make_request(arg_3, arg_4)

possible hvac modes are auto auxHeatOnly cool heat off


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . _filters : if not arg_2 : arg_0 . app . jinja_env . filters [ arg_1 . replace ( "f_" , "" ) ] = getattr ( flask_nemo . filters , arg_1 ) else : arg_0 . app . jinja_env . filters [ arg_1 . replace ( "f_" , "" ) ] = getattr ( arg_2 , arg_1 . replace ( "_{}" . format ( arg_2 . name ) , "" ) )

def Func(arg_0):
        """ Register filters for Jinja to use

       .. note::  Extends the dictionary filters of jinja_env using self._filters list
        """
        for arg_1, arg_2 in arg_0._filters:
            if not arg_2:
                arg_0.app.jinja_env.filters[
                    arg_1.replace("f_", "")
                ] = getattr(flask_nemo.filters, arg_1)
            else:
                arg_0.app.jinja_env.filters[
                    arg_1.replace("f_", "")
                ] = getattr(arg_2, arg_1.replace("_{}".format(arg_2.name), ""))


def Func(arg_0, arg_1):
    """Independant Kaiser window

    For the definition of the Kaiser window, see A. V. Oppenheim & R. W. Schafer, "Discrete-Time Signal Processing".

    The continuous version of width n centered about x=0 is:

    .. note:: 2 times slower than scipy.kaiser
    """
    from scipy.special import iv as besselI
    arg_2 = arg_0 - 1
    arg_3 = arange(0, arg_2)
    arg_3 = 2. * arg_1 / arg_2 * sqrt (arg_3 * (arg_2 - arg_3))
    arg_4 = besselI (0, arg_3) / besselI (0, arg_1)
    return arg_4


def Func ( arg_0 , arg_1 ) : for arg_2 in re_source_block_formats : if arg_2 . start . match ( arg_1 ) : arg_0 . add_block_lines ( ) arg_0 . format = arg_2 arg_0 . lineno = fileinput . filelineno ( ) arg_0 . lines . append ( arg_1 )

def  Func( arg_0, arg_1 ):
        """process a normal line and check whether it is the start of a new block"""
        for arg_2 in re_source_block_formats:
            if arg_2.start.match( arg_1 ):
                arg_0.add_block_lines()
                arg_0.format = arg_2
                arg_0.lineno = fileinput.filelineno()

        arg_0.lines.append( arg_1 )


async def Func ( arg_0 ) : if not arg_0 . is_complete ( ) : arg_1 = arg_0 . _loop . create_future ( ) arg_0 . _waiters . append ( arg_1 ) await arg_1

async def Func(arg_0):
        """
        Waits until the result set changes. Possible changes can be a result
        being added or the result set becoming complete. If the result set is
        already completed, this method returns immediately.
        """

        if not arg_0.is_complete():
            arg_1 = arg_0._loop.create_future()
            arg_0._waiters.append(arg_1)
            await arg_1

Waits until the result set changes . Possible changes can be a result being added or the result set becoming complete . If the result set is already completed this method returns immediately .


def Func ( arg_0 : arg_1 [ arg_2 , arg_3 ] ) -> arg_1 [ arg_2 , arg_1 [ arg_2 , float ] ] : arg_4 = set ( itt . chain . from_iterable ( arg_0 . values ( ) ) ) arg_5 = len ( arg_4 ) arg_6 : Dict [ arg_2 , Dict [ arg_2 , float ] ] = defaultdict ( dict ) for arg_7 , arg_8 in itt . combinations ( arg_0 , 2 ) : arg_6 [ arg_7 ] [ arg_8 ] = arg_6 [ arg_8 ] [ arg_7 ] = 1.0 - len ( arg_0 [ arg_7 ] | arg_0 [ arg_8 ] ) / arg_5 for arg_7 in arg_0 : arg_6 [ arg_7 ] [ arg_7 ] = 1.0 - len ( arg_7 ) / arg_5 return dict ( arg_6 )

def Func(arg_0: arg_1[arg_2, arg_3]) -> arg_1[arg_2, arg_1[arg_2, float]]:
    r"""Calculate an alternative distance matrix based on the following equation.

    .. math:: distance(A, B)=1- \|A \cup B\| / \| \cup_{s \in S} s\|

    :param dict_of_sets: A dict of {x: set of y}
    :return: A similarity matrix based on the alternative tanimoto distance as a dict of dicts
    """
    arg_4 = set(itt.chain.from_iterable(arg_0.values()))
    arg_5 = len(arg_4)

    arg_6: Dict[arg_2, Dict[arg_2, float]] = defaultdict(dict)

    for arg_7, arg_8 in itt.combinations(arg_0, 2):
        arg_6[arg_7][arg_8] = arg_6[arg_8][arg_7] = 1.0 - len(arg_0[arg_7] | arg_0[arg_8]) / arg_5

    for arg_7 in arg_0:
        arg_6[arg_7][arg_7] = 1.0 - len(arg_7) / arg_5

    return dict(arg_6)

r Calculate an alternative distance matrix based on the following equation .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
urijoin
(
arg_0
.
base_url
,
"rate_limit"
)
arg_0
.
session
.
headers
.
update
(
{
'Authorization'
:
'token '
+
arg_1
}
)
arg_3
=
0
try
:
arg_4
=
super
(
)
.
fetch
(
arg_2
)
.
headers
if
arg_0
.
rate_limit_header
in
arg_4
:
arg_3
=
int
(
arg_4
[
arg_0
.
rate_limit_header
]
)
except
requests
.
exceptions
.
HTTPError
as
error
:
logger
.
warning
(
"Rate limit not initialized: %s"
,
error
)
return
arg_3

def Func(arg_0, arg_1):
        """Return token's remaining API points"""

        arg_2 = urijoin(arg_0.base_url, "rate_limit")
        arg_0.session.headers.update({'Authorization': 'token ' + arg_1})
        arg_3 = 0
        try:
            arg_4 = super().fetch(arg_2).headers
            if arg_0.rate_limit_header in arg_4:
                arg_3 = int(arg_4[arg_0.rate_limit_header])
        except requests.exceptions.HTTPError as error:
            logger.warning("Rate limit not initialized: %s", error)
        return arg_3