Validate the supersmoother.
765341
def validate_supersmoother():
    """"""
    x, y = smoother_friedman82.build_sample_smoother_problem_friedman82()
    x, y = sort_data(x, y)
    my_smoother = smoother.perform_smooth(x, y, smoother_cls=supersmoother.SuperSmootherWithPlots)
    # smoother.DEFAULT_BASIC_SMOOTHER = BasicFixedSpanSmootherBreiman
    supsmu_result = run_freidman_supsmu(x, y, bass_enhancement=0.0)
    mace_result = run_mace_smothr(x, y, bass_enhancement=0.0)
    plt.plot(x, y, '.', label='Data')
    plt.plot(x, my_smoother.smooth_result, '-', label='pyace')
    plt.plot(x, supsmu_result, '--', label='SUPSMU')
    plt.plot(x, mace_result, ':', label='SMOOTH')
    plt.legend()
    plt.savefig('supersmoother_validation.png')
59454
def validate(self):
        """"""
        super().validate()
        nb_entities = len(self.entities)
        if nb_entities != self.rows:
            raise self.error(
                'Number of entities: %s != number of rows: %s' % (
                    nb_entities, self.rows))
913527
def _validate(self,val):
        """"""
        if isinstance(self.class_, tuple):
            class_name = ('(%s)' % ', '.join(cl.__name__ for cl in self.class_))
        else:
            class_name = self.class_.__name__
        if self.is_instance:
            if not (isinstance(val,self.class_)) and not (val is None and self.allow_None):
                raise ValueError(
                    "Parameter '%s' value must be an instance of %s, not '%s'" %
                    (self.name, class_name, val))
        else:
            if not (val is None and self.allow_None) and not (issubclass(val,self.class_)):
                raise ValueError(
                    "Parameter '%s' must be a subclass of %s, not '%s'" %
                    (val.__name__, class_name, val.__class__.__name__))
66775
private void validate() {
        LibraryUtils.checkArgumentNotNull(config, "configuration is null");
        LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
        LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
        LibraryUtils.checkArgumentNotNull(sqsClient, "sqsClient is null");
        LibraryUtils.checkArgumentNotNull(sourceSerializer, "sourceSerializer is null");
    }
966680
private void validate() {
        if (isDense() && isPattern())
            throw new IllegalArgumentException(
                    "Matrix cannot be dense with pattern storage");
        if (isReal() && isHermitian())
            throw new IllegalArgumentException(
                    "Data cannot be real with hermitian symmetry");
        if (!isComplex() && isHermitian())
            throw new IllegalArgumentException(
                    "Data must be complex with hermitian symmetry");
        if (isPattern() && isSkewSymmetric())
            throw new IllegalArgumentException(
                    "Storage cannot be pattern and skew symmetrical");
    }
177815
def assert_valid(self, instance, value=None):
        """"""
        valid = super(Instance, self).assert_valid(instance, value)
        if not valid:
            return False
        if value is None:
            value = instance._get(self.name)
        if isinstance(value, HasProperties):
            value.validate()
        return True
58643
def _validate_max(self, proposal):
        """"""
        max = proposal['value']
        if max < self.min:
            raise TraitError('setting max < min')
        if max < self.value:
            self.value = max
        return max
958123
private void validate() {
        LibraryUtils.checkArgumentNotNull(config, "configuration is null");
        LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
        LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
        LibraryUtils.checkArgumentNotNull(s3Client, "s3Client is null");
    }
1044877
def validate(self):
        

        extents_valid = (0 <= self.lower_extent <= self.upper_extent
            <= self.global_size)

        if not extents_valid:
            raise ValueError("Dimension '{d}' fails 0 <= {el} <= {eu} <= {gs}"
                .format(d=self.name, gs=self.global_size,
                    el=self.lower_extent, eu=self.upper_extent))
969359
def validate(cls, data):
        """"""
        try:
            jsonschema.validate(
                data, cls.SCHEMA,
                # See: https://github.com/Julian/jsonschema/issues/148
                types={'array': (list, tuple)})
        except jsonschema.ValidationError as e:
            raise InvalidFormat("Failure data not of the"
                                " expected format: %s" % (e.message))
        else:
            # Ensure that all 'exc_type_names' originate from one of
            # base exceptions, because those are the root exceptions that
            # python mandates/provides and anything else is invalid...
            causes = collections.deque([data])
            while causes:
                cause = causes.popleft()
                try:
                    generated_on = cause['generated_on']
                    ok_bases = cls.BASE_EXCEPTIONS[generated_on[0]]
                except (KeyError, IndexError):
                    ok_bases = []
                root_exc_type = cause['exc_type_names'][-1]
                if root_exc_type not in ok_bases:
                    raise InvalidFormat(
                        "Failure data 'exc_type_names' must"
                        " have an initial exception type that is one"
                        " of %s types: '%s' is not one of those"
                        " types" % (ok_bases, root_exc_type))
                sub_cause = cause.get('cause')
                if sub_cause is not None:
                    causes.append(sub_cause)
816923
def validate(self, obj):
        """"""
        try:
            if self.resolver is not None:
                jsonschema.validate(obj, self.schema, resolver=self.resolver)
            else:
                jsonschema.validate(obj, self.schema)
        except jsonschema.ValidationError as exc:
            raise exceptions.ValidationError(str(exc))
403136
def validate(self, *args, **kwds):
        
        if self.behavior:
            return self.behavior.validate(self, *args, **kwds)
        return True
1017375
def validate(self, *args, **kwargs): # pylint: disable=arguments-differ
        
        return super(ParameterValidator, self)._validate(*args, **kwargs)
1306388
def Validate(self):
    """"""
    # All filters can handle the input type.
    bad_filters = []
    for f in self.filters:
      try:
        f.Validate()
      except DefinitionError as e:
        bad_filters.append("%s: %s" % (f.expression, e))
    if bad_filters:
      raise DefinitionError(
          "Filters with invalid expressions: %s" % ", ".join(bad_filters))
1265250
private void validateCoefficients() {
        if (coefsValid)
            return;

        if (n >= 2) {
            double xBar = (double) sumX / n;
            double yBar = (double) sumY / n;

            a1 = (double) ((n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX));
            a0 = (double) (yBar - a1 * xBar);
        } else {
            a0 = a1 = Double.NaN;
        }

        coefsValid = true;
    }
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
362704
def validate(self, instance, value):
        
        if isinstance(value, string_types):
            if (
                    value.upper() not in VECTOR_DIRECTIONS or
                    value.upper() in ('Z', '-Z', 'UP', 'DOWN')
            ):
                self.error(instance, value)
            value = VECTOR_DIRECTIONS[value.upper()][:2]

        return super(Vector2, self).validate(instance, value)