Don't split the data and create an empty validation set.
494877
def split_none(self):
        ""
        val = self[[]]
        val.ignore_empty = True
        return self._split(self.path, self, val)
564702
def validate(self, text, **kwargs):
        """"""
        cleaned = self.clean(text, **kwargs)
        return cleaned is not None
323760
def _validate_dataset_names(dataset):
    """"""
    def check_name(name):
        if isinstance(name, str):
            if not name:
                raise ValueError('Invalid name for DataArray or Dataset key: '
                                 'string must be length 1 or greater for '
                                 'serialization to netCDF files')
        elif name is not None:
            raise TypeError('DataArray.name or Dataset key must be either a '
                            'string or None for serialization to netCDF files')

    for k in dataset.variables:
        check_name(k)
116058
private void unlock_data() {
    source.unlock(self());
    if( validation != null && source._key != null && validation._key != null && !source._key.equals(validation._key) )
      validation.unlock(self());
  }
1287940
public void setValidationData(java.util.Collection<AttributeType> validationData) {
        if (validationData == null) {
            this.validationData = null;
            return;
        }

        this.validationData = new java.util.ArrayList<AttributeType>(validationData);
    }
177584
def validate(self, value):
        
        if value in self.empty_values and self.required:
            raise ValidationError(self.error_messages['required'])
684134
def _do_validation_set(self, table: pd.DataFrame, columns, validation_type, failed_only=False) -> pd.DataFrame:
        """"""
        validations = []

        for column in columns:
            validation = column.validate(table=table, failed_only=failed_only)
            validation["column_name"] = column.name
            validation["validation_type"] = validation_type
            validations.append(validation)

        validation_table = pd.concat(validations)
        validation_table.index.name = 'row'

        return validation_table.reset_index().set_index(["validation_type", "column_name", "row"])
1102636
def validate(self, data=None):
        

        errors = {}

        data = self._getData(data)

        # validate each field, one by one
        for name, field in self.fields.items():
            try:
                field.clean(data.get(name))
            except ValidationError, e:
                errors[name] = e.messages
            except AttributeError, e:
                raise ValidationError('data should be of type dict but is %s' % (type(data),))

        # check for extra fields
        extras = set(data.keys()) - set(self.fields.keys())
        if extras:
            errors[', '.join(extras)] = ['field(s) not allowed']

        # if errors, raise ValidationError
        if errors:
            raise ValidationError(errors)
1342722
private function removeInvalidAttributes()
    {
        foreach ($this->getAttributes() as $attribute => $data)
        {
            if ( ! is_null($data) && ! is_scalar($data)) unset($this->{$attribute});
        }
    }
565220
def _validate(self):  # type: () -> None
        """"""
        # class can specify it's empty obj -- list would have empty of []
        self._errors = []

        self._validate_type()

        if self.is_valid():
            self._validate_value()
1267470
def clean(self):
        
        if self.user:
            self.username = self.user.username
        elif not self.username:
            raise ValidationError({
                'username': _NOT_BLANK_MESSAGE,
                'user': _NOT_BLANK_MESSAGE
            })
738037
def _validate(self, data, owner=None):
        
        if isinstance(data, DynamicValue):
            data = data()

        if data is None and not self.nullable:
            raise ValueError('Value can not be null')

        elif data is not None:

            isdict = isinstance(data, dict)

            for name, schema in iteritems(self.getschemas()):

                if name == 'default':
                    continue

                if name in self.required:
                    if (
                        (isdict and name not in data) or
                        (not isdict and not hasattr(data, name))
                    ):
                        part1 = (
                            'Mandatory property {0} by {1} is missing in {2}.'.
                            format(name, self, data)
                        )
                        part2 = '{0} expected.'.format(schema)
                        error = '{0} {1}'.format(part1, part2)

                        raise ValueError(error)

                elif (isdict and name in data) or hasattr(data, name):

                    value = data[name] if isdict else getattr(data, name)
                    schema._validate(data=value, owner=self)
450203
def data_validation(self, in_nc):
        """"""
        data_nc = Dataset(in_nc)
        for dim in self.dims_oi:
            if dim not in data_nc.dimensions.keys():
                data_nc.close()
                raise Exception(self.error_messages[1])

        for var in self.vars_oi:
            if var not in data_nc.variables.keys():
                data_nc.close()
                raise Exception(self.error_messages[2])

        data_nc.close()
        return
812437
def validate(self, data, schema):
        '''
        '''
        try:
            return schema(data)
        except MultipleInvalid as ie:
            errors = []
            for error in ie.errors:
                if error.path:
                    field = '.'.join(str(p) for p in error.path)
                    path = error.path
                    value = data
                    while path:
                        attr = path.pop(0)
                        try:
                            if isinstance(value, (list, tuple)):
                                attr = int(attr)
                            value = value[attr]
                        except Exception:
                            value = None

                    txt = safe_unicode(error).replace('for dictionary value', '')
                    txt = txt.strip()
                    if isinstance(error, RequiredFieldInvalid):
                        msg = '[{0}] {1}'
                    else:
                        msg = '[{0}] {1}: {2}'
                    try:
                        msg = msg.format(field, txt, str(value))
                    except Exception:
                        msg = '[{0}] {1}'.format(field, txt)

                else:
                    msg = str(error)
                errors.append(msg)
            msg = '\n- '.join(['Validation error:'] + errors)
            raise HarvestValidationError(msg)
1341133
def _validate_input(self, table: pd.DataFrame, failed_only=False) -> pd.DataFrame:
        """"""
        return self._do_validation_set(
            table=table,
            columns=self.input_columns,
            validation_type="input",
            failed_only=failed_only,)
355633
def _validate(self, data):
        """"""

        errors = {}

        # if the validator is not enabled, return the empty error dict
        if not self._enabled:
            return errors

        for field in self.validators:

            field_errors = []

            for validator in self.validators[field]:
                try:
                    validator(data.get(field, None))
                except ValidationError as e:
                    field_errors += e.messages

            # if there were errors, cast to ErrorList for output convenience
            if field_errors:
                errors[field] = ErrorList(field_errors)

        return errors
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)