If any of the specified validators pass the validation succeeds
199497
def any(*validators):
    """"""
    def validate_any(fields):
        errors = {}
        for validator in validators:
            validation_errors = validator(fields)
            if not validation_errors:
                return
            errors.update(validation_errors)
        return errors

    validate_any.__doc__ = " or ".join(validator.__doc__ for validator in validators)
    return validate_any
1156806
def is_valid(self, *states):
        """"""

        # if no state is specified, fallback to the base FormGroup's is_valid
        if not states:
            return super(StateValidatorFormGroup, self).is_valid()

        # see if the states pass for all forms that define state_validators
        return all(form.is_valid(*states)
                   for form in self.forms
                   if isinstance(form, StateValidatorFormMixin)) and \
               all(self.state_validators[state].is_valid(self)
                   for state in states)
1017375
def validate(self, *args, **kwargs): # pylint: disable=arguments-differ
        
        return super(ParameterValidator, self)._validate(*args, **kwargs)
76555
def with_validator(self, validator):
    """"""
    if not callable(validator):
      raise ValueError('Validator must be callable', validator)
    self.validators.append(validator)
    self._cached = None
    return self
35023
private void initValidation() {
        // Create validators and collect the results
        SimpleProperty<Result> resultCollector1 = new SimpleProperty<Result>();
        createValidator(textField1, new StickerFeedback(textField1), resultCollector1);
        SimpleProperty<Result> resultCollector2 = new SimpleProperty<Result>();
        createValidator(textField2, new ColorFeedback(textField2, false), resultCollector2);
        SimpleProperty<Result> resultCollector3 = new SimpleProperty<Result>();
        createValidator(textField3, new ColorFeedback(textField3, true), resultCollector3);
        SimpleProperty<Result> resultCollector4 = new SimpleProperty<Result>();
        createValidator(textField4, new IconFeedback(textField4, false), resultCollector4);
        SimpleProperty<Result> resultCollector5 = new SimpleProperty<Result>();
        createValidator(textField5, new IconFeedback(textField5, true), resultCollector5);

        // Enable Apply button only when all fields are valid
        read(resultCollector1, resultCollector2, resultCollector3, resultCollector4, resultCollector5) //
                .transform(new CollectionElementTransformer<Result, Boolean>(new ResultToBooleanTransformer())) //
                .transform(new AndBooleanAggregator()) //
                .write(new ComponentEnabledProperty(applyButton));
    }
1063653
def _run_validators(self, value):
        
        if value in self.empty_values:
            return

        errors = []
        for validator in self.validators:
            try:
                validator(value)
            except exceptions.ValidationError as err:
                if isinstance(err.messages, dict):
                    errors.append(err.messages)
                else:
                    errors.extend(err.messages)

        if errors:
            raise exceptions.ValidationError(errors)
960926
protected boolean validate(Validator validator, UIObject ui) {

        if (notifiedWidgets.containsKey(validator))
            ui = notifiedWidgets.get(validator);

        String msg = validator.validate();
        if (msg == null || msg.length() == 0) {
            validationStyles(validator, null, ui, true);
            return true;
        } else {
            validationStyles(validator, msg, ui, false);
            return false;
        }
    }
1096560
def ready_validations_pass?
      self.class.ready_validations.all? do |validation|
        passed, message = instance_eval(&validation)
        self.ready_error = message if message && !passed
        passed
      end
    end
663746
def run_validator(value)
      return unless validator
      error = validator.call(value)
      raise ValidationError unless error.nil?
    end
445761
public final void setValidator(@NonNull final Validator<Type> validator) {
        Condition.INSTANCE.ensureNotNull(validator, "The validator may not be null");
        this.validator = validator;
    }
964832
function Validator(opts) {
	this.opts = {
		messages: deepExtend({}, defaultMessages)
	};

	if (opts)
		deepExtend(this.opts, opts);

	this.messages = this.opts.messages;
	this.messageKeys = Object.keys(this.messages);

	// Load rules
	this.rules = loadRules();
	this.cache = new Map();
}
412857
def is_valid(self, *states):
        """"""

        # if no state is specified, fallback to the base Form's is_valid
        if not states:
            return super(StateValidatorFormMixin, self).is_valid()

        return all(self.state_validators[state].is_valid(self)
                   for state in states)
646497
protected void performValidation(String path, Object value, List<ValidationResult> results) {
		String name = path != null ? path : "value";

		if (value == null) {
			// Check for required values
			if (_required)
				results.add(new ValidationResult(path, ValidationResultType.Error, "VALUE_IS_NULL",
						name + " cannot be null", "NOT NULL", null));
		} else {
			value = ObjectReader.getValue(value);

			// Check validation rules
			if (_rules != null) {
				for (IValidationRule rule : _rules)
					rule.validate(path, this, value, results);
			}
		}
	}
1322003
def Any(*validators):
    
    @wraps(Any)
    def built(value):
        error = None
        for validator in validators:
            try:
                return validator(value)
            except Error as e:
                error = e
        raise error
    return built
1142947
def _check_validators(text)
      ret = true
      if @validator_objects
        @validator_objects.each do |v|
          v.validate(text)
          unless v.is_valid
            @last_error_message = v.message
            ret = false
          end
        end
      end
      ret
    end
648115
def validators(self):
        """"""
        if not hasattr(self, "_validators"):
            self._validators = ValidatorList(self)
        return self._validators
1113914
def validate(self, value) :
        """"""
        for v in self.validators :
            v.validate(value)
        return True