Validate this measurement and update its 'outcome' field.
119
def validate(self):
    """"""
    # PASS if all our validators return True, otherwise FAIL.
    try:
      if all(v(self.measured_value.value) for v in self.validators):
        self.outcome = Outcome.PASS
      else:
        self.outcome = Outcome.FAIL
      return self
    except Exception as e:  # pylint: disable=bare-except
      _LOG.error('Validation for measurement %s raised an exception %s.',
                 self.name, e)
      self.outcome = Outcome.FAIL
      raise
    finally:
      if self._cached:
        self._cached['outcome'] = self.outcome.name
1153938
def _update(self):
        '''
        
        '''
        self.decimal_degree = self._calc_decimaldegree(self.degree, self.minute, self.second)
        self.degree, self.minute, self.decimal_minute, self.second = self._calc_degreeminutes(self.decimal_degree)
963267
public void addValidation(Object key, Validation validation){
        initMapOnce();
        validations.put(key, validation);
        // update aggregated value
        passedAll = passedAll && validation.passed();
    }
112360
def validate(self, value):
        """"""
        if value is not None and not isinstance(value, bool):
            raise ValidationError("field must be a boolean")

        super().validate(value)
134333
def on_put(self, req, resp, **kwargs):
        """"""
        validated = self.require_validated(req)
        return super().on_put(
            req, resp,
            handler=partial(self._update, validated=validated),
            **kwargs
        )
1124971
def updateCalibration(self):
        """"""
        if self.samplerate() != self._calibration_fs:
            self.setCalibration(self._attenuationVector, self._calFrequencies, self._calFrange)
130735
def update_metric(self, eval_metric, labels, pre_sliced=False):
        
        assert self.binded and self.params_initialized

        for meta, module in zip(self._metas, self._modules):
            if SequentialModule.META_TAKE_LABELS in meta and \
                    meta[SequentialModule.META_TAKE_LABELS]:
                module.update_metric(eval_metric, labels, pre_sliced)
321664
def put(self, measurementId, deviceId):
        
        payload = request.get_json()
        failureReason = json.loads(payload).get('failureReason') if payload is not None else None
        logger.warning('Failing measurement ' + measurementId + ' for ' + deviceId + ' because ' + str(failureReason))
        if self._measurementController.failMeasurement(measurementId, deviceId, failureReason=failureReason):
            logger.warning('Failed measurement ' + measurementId + ' for ' + deviceId)
            return None, 200
        else:
            logger.error('Unable to fail measurement ' + measurementId + ' for ' + deviceId)
            return None, 404
124231
def _validate(self, value):
        """"""
        if self.values and value not in self.values:
            raise ValueError(
                '{} is not a valid value for {}'.format(value, self.name))
1145172
def update(self, request, datum):
        """"""
        if getattr(self, 'action_present', False):
            self.verbose_name = self._get_action_name()
            self.verbose_name_plural = self._get_action_name('plural')
512216
public void updateField(Field field) {
        this.name = field.getName();
        this.obj = TypeCheckUtil.isObjClass(field);
        this.list = TypeCheckUtil.isListClass(field);
        this.number = TypeCheckUtil.isNumberClass(field);
        this.enumType = field.getType().isEnum();
        this.typeClass = field.getType();
        this.type = field.getType().getSimpleName();

        if (this.list) {
            this.innerClass = ValidationObjUtil.getListInnerClassFromGenericType(field.getGenericType());
            this.type += "<" + this.innerClass.getSimpleName() + ">";
        }
    }
107181
def update(self, byte_arr):
        """"""
        if byte_arr:
            self.value = self.calculate(byte_arr, self.value)
234849
public function validate() : void
    {
        $this->value = null;
        $value = $this->filter($this->raw_value);
        if (true === $this->checkValidity($value)) {
            $this->is_valid = true;
        } else {
            $this->is_valid = false;
            $this->reportError($this->error_message);
            $error_message = sprintf($this->error_message, $this->field_name);
            $this->the_message = $error_message;
        }
        // If no issues have been found, check the constraints.
        if ($this->is_valid) {
            foreach ($this->constraints as $constraint) {
                if (false === $constraint->check($value)) {
                    $this->is_valid = false;
                    $this->the_message = sprintf($constraint->getErrorMessage(), $this->field_name);
                }
            }
        }
        // Set the value for retrieval
        if ($this->is_valid) {
            $this->value = $value;
        }
    }
966825
public void update() {
        if (this.measures == null || this.measures.length == 0) {
            // no measures to show -> empty entries
            for (int i = 0; i < this.currentValues.length; i++) {
                this.currentValues[i].setText("-");
                this.meanValues[i].setText("-");
            }
            return;
        }
        
        DecimalFormat d = new DecimalFormat("0.00");
        
        MeasureCollection mc;
        if (this.measures.length > this.measureCollectionSelected) {
        	mc = this.measures[this.measureCollectionSelected];
        }
        else {
        	mc = this.measures[0];
        }
        
        for (int i = 0; i < this.currentValues.length; i++) {
            // set current value
            if(Double.isNaN(mc.getLastValue(i))) {
                this.currentValues[i].setText("-");
            } else {
                this.currentValues[i].setText(d.format(mc.getLastValue(i)));
            }
            
            // set mean value
            if(Double.isNaN(mc.getMean(i))) {
                this.meanValues[i].setText("-");
            } else {
                this.meanValues[i].setText(d.format(mc.getMean(i)));
            }
        } 
    }
459927
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqd1*con.tind)
79346
def update(self, duration):
        """"""
        if duration >= 0:
            self.histogram.update(duration)
            self.meter.mark()
297164
public void updateMetricsRecord() {
    for (Map.Entry<MetricName, Long> entry: counters.entrySet()) {
      String name = (entry.getKey() + "_" + type).toLowerCase();
      record.setMetric(name, entry.getValue());
    }
    record.update();
  }