Replace all the parameter values with the averages.
        Save the current parameter values to restore later.
347106
def assign_average_value(self) -> None:
        
        for name, parameter in self._parameters:
            self._backups[name].copy_(parameter.data)
            parameter.data.copy_(self._shadows[name])
910623
def PARAMLIMITS(self, value):
        """"""
        assert set(value.keys()) == set(self.PARAMLIMITS.keys()), "The \
                new parameter limits are not defined for the same set \
                of parameters as before."
        for param in value.keys():
            assert value[param][0] < value[param][1], "The new \
                    minimum value for {0}, {1}, is equal to or \
                    larger than the new maximum value, {2}"\
                    .format(param, value[param][0], value[param][1])
        self._PARAMLIMITS = value.copy()
789586
def setParams(self, minSupport=0.3, minConfidence=0.8, itemsCol="items",
                  predictionCol="prediction", numPartitions=None):
        
        kwargs = self._input_kwargs
        return self._set(**kwargs)
896575
@SuppressWarnings("all")
  public void normalize() {
    // Start on samples
    int samplesPerFrame = (int) ((float) getSamplesPerSecond() / (float) getFramesPerSecond());
    setFrames(getFrames() + (int) (getSamples() * (1.0f / samplesPerFrame)));
    setSamples(getSamples() % samplesPerFrame);

    setSeconds(getSeconds() + (int) ((float) getFrames() / getFramesPerSecond()));
    setFrames((int) (getFrames() % getFramesPerSecond()));

    while (getSeconds() >= 60) {
      setSeconds(getSeconds() - 60);
      setMinutes(getMinutes() + 1);
    }
    while (getMinutes() >= 60) {
      setMinutes(getMinutes() - 60);
      setHours(getHours() + 1);
    }
  }
989451
private void update(){
        
        total = 0;
        for (int i = 0; i < values.length; i++) {
            total += values[i];
        }

        mean   = HistogramStatistics.Mean( values );
        stdDev = HistogramStatistics.StdDev( values, mean );
        kurtosis = HistogramStatistics.Kurtosis(values, mean, stdDev);
        skewness = HistogramStatistics.Skewness(values, mean, stdDev);
        median = HistogramStatistics.Median( values );
        mode = HistogramStatistics.Mode(values);
        entropy = HistogramStatistics.Entropy(values);
    }
1058292
def set_parameters(self):
        
        for key in (ADMITTED_STR_PARAMETERS + ADMITTED_FLOAT_PARAMETERS +
                    ADMITTED_SET_PARAMETERS):
            try:
                val = getattr(self.gmpe, key)
            except AttributeError:
                pass
            else:
                setattr(self, key, val)
876257
def diff_parameters(old_params, new_params):
    
    [changes, diff] = diff_dictionaries(old_params, new_params)
    if changes == 0:
        return []
    return diff
848997
def update_params(self, param_d):
        
        for param in self.paramlst:
            if param.name in param_d:
                value = param_d[param.name]
                setattr(self.obj, param.name, value)
402919
def get_values_fix_params(self, exp, rep, tag, which='last', **kwargs):
         
        subexps = self.get_exps(exp)
        tagvalues = ['%s%s'%(k, convert_param_to_dirname(kwargs[k])) for k in kwargs]
        
        values = [self.get_value(se, rep, tag, which) for se in subexps if all(map(lambda tv: tv in se, tagvalues))]
        params = [self.get_params(se) for se in subexps if all(map(lambda tv: tv in se, tagvalues))]
        
        return values, params
705746
def update_params(params, updates):
    ''''''
    params = params.copy() if isinstance(params, dict) else dict()
    params.update(updates)
    return params
1126369
def updateParams(self, newvalues, update_all=False):
        """"""
        assert all(map(lambda x: x in self.freeparams, newvalues.keys())),\
                "Invalid entry in newvalues: {0}\nfreeparams: {1}".format(
                ', '.join(newvalues.keys()), ', '.join(self.freeparams))

        newvalues_list = [{} for k in range(self.ncats)]

        if update_all or any([param in self.distributionparams for param
                in newvalues.keys()]):
            self._d_distributionparams = {}
            for param in self.distributionparams:
                if param in newvalues:
                    _checkParam(param, newvalues[param], self.PARAMLIMITS,
                            self.PARAMTYPES)
                    setattr(self, param, copy.copy(newvalues[param]))
            self._lambdas = DiscreteGamma(self.alpha_lambda, self.beta_lambda,
                    self.ncats)
            for (k, l) in enumerate(self._lambdas):
                newvalues_list[k][self.distributedparam] = l
        for name in self.freeparams:
            if name not in self.distributionparams:
                if name in newvalues:
                    value = newvalues[name]
                    _checkParam(name, value, self.PARAMLIMITS, self.PARAMTYPES)
                    setattr(self, name, copy.copy(value))
                    for k in range(self.ncats):
                        newvalues_list[k][name] = value
                elif update_all:
                    for k in range(self.ncats):
                        newvalues_list[k][name] = getattr(self, name)

        assert len(newvalues_list) == len(self._models) == self.ncats
        for (k, newvalues_k) in enumerate(newvalues_list):
            self._models[k].updateParams(newvalues_k)

        # check to make sure all models have same parameter values
        for param in self.freeparams:
            if param not in self.distributionparams:
                pvalue = getattr(self, param)
                assert all([scipy.allclose(pvalue, getattr(model, param))
                        for model in self._models]), ("{0}\n{1}".format(
                        pvalue, '\n'.join([str(getattr(model, param))
                        for model in self._models])))
1348946
def _update(self):
        
        aps = []
        for k, v in self.records.items():
            recall, prec = self._recall_prec(v, self.counts[k])
            ap = self._average_precision(recall, prec)
            aps.append(ap)
            if self.num is not None and k < (self.num - 1):
                self.sum_metric[k] = ap
                self.num_inst[k] = 1
        if self.num is None:
            self.num_inst = 1
            self.sum_metric = np.mean(aps)
        else:
            self.num_inst[-1] = 1
            self.sum_metric[-1] = np.mean(aps)
238493
def fix_parameters(self):
        """"""
        for W, b in zip(self.W_list, self.b_list):
            W.fix()
            b.fix()
1111177
private String replaceParameters(String text) {
    	if (text == null) {
    		return null;
    	}
        for  (String param : parameterValues.keySet()) {
             text = StringUtil.replace(text, "\\$P\\{" + param + "\\}", StringUtil.getValueAsString(parameterValues.get(param), null,I18nUtil.getLanguageByName(chart, language)));
        }
        return text;
    }
1013285
public void update(double sample) {
        // Adjust min&max
        min = (sample < min ? sample : min);
        max = (sample > max ? sample : max);

        // Update average
        average += (sample - average) / ++count;
        _pwrSumAverage += ( sample * sample - _pwrSumAverage) / count;

        // Update variance
        stdDev = Math.sqrt((_pwrSumAverage * count - count * average * average) / (count - 1));
        cv = 100 * (stdDev / average);
    }
1141426
def update(self):
        

        s = self.extract()
        self.mean = s[2][0]

        self.gradient = None
        self.gradient_error = None
        self.gradient_relative_error = None
567220
def set_parameters(self, parameter, value):
        
        if parameter == 'lo':
            self.parameters['lo'] = 1 / value
        else:
            self.parameters[parameter] = value