Returns true if the model passes the validation, and false if not. Validator must be
    present_optional if validation is not 'simple'.
977946
def is_valid(self, model, validator=None):
    
    if self.property_name and self.is_property_specific:
      arg0 = getattr(model, self.property_name)
    else:
      arg0 = model

    if self.is_simple:
      is_valid = self.callback(arg0)
    else:
      is_valid = self.callback(arg0, validator)

    return (is_valid, None if is_valid else (self.message or "is invalid"))
607029
public function isValid()
    {
        $result = true;
        $fields = $this->getFields();
        // Check each element for validators, validate them and return the result.
        foreach ($fields as $field) {
            if ($field->validate() == false) {
                $result = false;
            }
        }
        return $result;
    }
200601
def validate(self):
        
        required_fields = list(filter(lambda x: self._fields[x], self._fields.keys()))
        for field in (self._top_fields + required_fields):
            if not hasattr(self, field) or hasattr(self, field) and getattr(self, field) == None:
                raise MissingFieldError(field)
7924
def valid?
      return false if @status.nil?
      status_validator = EnumAttributeValidator.new('String', ['error'])
      return false unless status_validator.valid?(@status)
      return false if @errors.nil?
      true
    end
52065
def validate(self, value=None, model=None, context=None):
        
        errors = []
        for validator in self.validators:
            if value is None and not isinstance(validator, Required):
                continue

            error = validator.run(
                value=value,
                model=model,
                context=context if self.use_context else None
            )
            if error:
                errors.append(error)

        return errors
177584
def validate(self, value):
        
        if value in self.empty_values and self.required:
            raise ValidationError(self.error_messages['required'])
1334542
def validate(cls, partial=True, **kwargs):
        
        data = kwargs
        if not partial:
            data = dict(**kwargs, **{col.name: None for col in cls.__table__.c
                                     if col.name not in kwargs})

        errors = defaultdict(list)
        for name, value in data.items():
            for validator in cls._get_validators(name):
                try:
                    validator(value)
                except ValidationError as e:
                    e.model = cls
                    e.column = name
                    errors[name].append(str(e))

        if errors:
            raise ValidationErrors(errors)
1223836
def is_valid_method(model, resource=None):
    """"""
    validation_function_name = 'is_valid_{}'.format(
        request.method.lower())
    if hasattr(model, validation_function_name):
        return getattr(model, validation_function_name)(request, resource)
964887
def _validate(self, validator, data, key, position=None, includes=None):
        
        errors = []

        if position:
            position = '%s.%s' % (position, key)
        else:
            position = key

        try:  # Pull value out of data. Data can be a map or a list/sequence
            data_item = util.get_value(data, key)
        except KeyError:  # Oops, that field didn't exist.
            if validator.is_optional:  # Optional? Who cares.
                return errors
            # SHUT DOWN EVERTYHING
            errors.append('%s: Required field missing' % position)
            return errors

        return self._validate_item(validator, data_item, position, includes)
340998
def validate(self):
        

        missing = self.missing_property_names()

        if len(missing) > 0:
            raise validators.ValidationError(
                "'{0}' are required attributes for {1}"
                            .format(missing, self.__class__.__name__))

        for prop, val in six.iteritems(self._properties):
            if val is None:
                continue

            if isinstance(val, ProtocolBase):
                val.validate()
            elif getattr(val, 'isLiteralClass', None) is True:
                val.validate()
            elif isinstance(val, list):
                for subval in val:
                  subval.validate()
            else:
                # This object is of the wrong type, but just try setting it
                # The property setter will enforce its correctness
                # and handily coerce its type at the same time
                setattr(self, prop, val)

        return True
518780
def validate(self, form, extra_validators=tuple()):
        ''''''
        if not self.has_data:
            return True
        if self.is_list_data:
            if not isinstance(self._formdata[self.name], (list, tuple)):
                return False
        return super(NestedModelList, self).validate(form, extra_validators)
666428
public boolean validationAsBoolean()
   {
      if (this.getMessageadapter() == null || this.getMessageadapter().getMessagelisteners() == null
            || this.getMessageadapter().getMessagelisteners().isEmpty())
         return false;
      MessageListener mlmd = this.getMessageadapter().getMessagelisteners().get(0);
      if (mlmd.getMessagelistenerType() == null || mlmd.getActivationspec() == null
            || mlmd.getActivationspec().getActivationspecClass() == null)
         return false;
      return true;
   }
46071
def valid?
      return false if @is_valid.nil?
      signature_implementation_validator = EnumAttributeValidator.new('String', ["Stamp", "Image", "Annotation", "Sticker", "TextToFormField", "Watermark"])
      return false unless signature_implementation_validator.valid?(@signature_implementation)
      return true
    end
1085769
def valid?
      errors.clear

      validators.each do |validator|
        validator.validate(self)
      end

      errors.empty?
    end
1349452
def validate(self, value, model_instance):
        
        if not self.editable:
            # Skip validation for non-editable fields.
            return
        if self._choices and value:
            print(value)
            l = value
            if type(value) != list:
                l = [ value ]
            for v in value:
                for option_key, option_value in self.choices:
                    if isinstance(option_value, (list, tuple)):
                        # This is an optgroup, so look inside the group for options.
                        for optgroup_key, optgroup_value in option_value:
                            if v == optgroup_key:
                                return
                    elif v == option_key:
                        return
                raise ValidationError(self.error_messages['invalid_choice'] % {'value': value})

        if value is None and not self.null:
            raise ValidationError(self.error_messages['null'])

        if not self.blank and value in validators.EMPTY_VALUES:
            raise ValidationError(self.error_messages['blank'])

        return super(MultipleChoiceCommaSeparatedIntegerField, self).validate(value, model_instance)
206439
def validate(self, value, model_instance):
        
        if not isinstance(value, base.StateWrapper):
            raise exceptions.ValidationError(self.error_messages['wrong_type'] % value)
        elif not value.workflow == self.workflow:
            raise exceptions.ValidationError(self.error_messages['wrong_workflow'] % value.workflow)
        elif value.state not in self.workflow.states:
            raise exceptions.ValidationError(self.error_messages['invalid_state'] % value.state)
314791
protected function hasValidator(Validator $validator) : bool
    {
        $hash = spl_object_hash($validator);

        return isset($this->validators[$hash]);
    }