Perform options validation.
978486
def validate(self):
        
        # TODO: at the moment only required_languages is validated.
        # Maybe check other options as well?
        if self.required_languages:
            if isinstance(self.required_languages, (tuple, list)):
                self._check_languages(self.required_languages)
            else:
                self._check_languages(self.required_languages.keys(), extra=('default',))
                for fieldnames in self.required_languages.values():
                    if any(f not in self.fields for f in fieldnames):
                        raise ImproperlyConfigured(
                            'Fieldname in required_languages which is not in fields option.')
200470
public function validate() {
		$required = array_filter($this->orig, function($spec) {
			return $spec[3] & self::REQUIRED;
		});
		foreach ($required as $req) {
			if ($req[3] & self::MULTI) {
				if (is_array($this[$req[0]])) {
					continue;
				}
			} elseif (strlen($this[$req[0]])) {
				continue;
			}
			if (is_numeric($req[0])) {
				yield sprintf("Argument <%s> is required", $req[1]);
			} else {
				yield sprintf("Option --%s is required", $req[1]);
			}
		}
	}
1144370
def validate(self, val):
        """"""
        if self.validation:
            self.type.validate(val)

            if self.custom_validator is not None:
                self.custom_validator(val)

        return True
463270
def options=(options)
      if options
        options.each_pair do |option, value|
          Validators::Option.validate(option)
          send("#{option}=", value)
        end
      end
    end
233398
def validate!(options={})
      begin check_ranks rescue rerank end if options[:rerank]
      check_players
      check_rounds
      check_dates
      check_teams
      check_ranks(:allow_none => true)
      check_type(options[:type]) if options[:type]
      true
    end
206213
def _validate_value(self, proposal):
        ""
        try:
            return tuple(findvalue(self._options_values, i, self.equals) for i in proposal.value)
        except ValueError:
            raise TraitError('Invalid selection: value not found')
1345602
def validate(self, name, value):
        """"""

        if self.valid_set and value not in self.valid_set:
            raise ImproperlyConfigured(
                "%s: \"%s\" is not a valid setting (choose between %s)." %
                (name, value, ", ".join("\"%s\"" % x for x in self.valid_set)))

        return value
1207816
public function validate(string $value)
    {
        if (!$value || in_array($value, $this->values, true)) {
            return;
        }

        $this->error['options'] = [$this->values];
    }
438678
public void validateOptions() throws XDocletException
    {
        if ((_databaseName == null) || (_databaseName.length() == 0)) {
            throw new XDocletException(Translator.getString(XDocletModulesOjbMessages.class,
                XDocletModulesOjbMessages.DATABASENAME_IS_REQUIRED));
        }
    }
1252011
def validate(self):
        """"""
        if not self._resource.get('permissions'):
            self.permissions = self.default_permissions

        try:
            # update _resource so have default values from the schema
            self._resource = self.schema(self._resource)
        except MultipleInvalid as e:
            errors = [format_error(err, self.resource_type) for err in e.errors]
            raise exceptions.ValidationError({'errors': errors})

        yield self.check_service()
        yield self.check_unique()
434662
def valid_value(self, value):
        
        if isinstance(value, Constant):
            value = value.name
        text_value = force_text(value)
        for option_value, option_label, option_title in self.choices:
            if value == option_value or text_value == force_text(option_value):
                return True
        return False
722530
def validate_options(options)
      options = options ? Hash[options] : {}
      options[:count] ||= 10
      options[:order] ||= :asc
      options[:what]  ||= :first
      options[:delete_after_find] ||= false
      options
    end
366285
def validate(self, instance, value):                                       #pylint: disable=inconsistent-return-statements
        """"""
        if not isinstance(value, string_types):
            self.error(instance, value)
        for key, val in self.choices.items():
            test_value = value if self.case_sensitive else value.upper()
            test_key = key if self.case_sensitive else key.upper()
            test_val = val if self.case_sensitive else [_.upper() for _ in val]
            if test_value == test_key or test_value in test_val:
                return key
        self.error(instance, value, extra='Not an available choice.')
778026
def validate_options(self, k, v):
        """"""

        super().validate_options(k, v)
        if k == 'string_types':
            if RE_VALID_STRING_TYPES.match(v) is None:
                raise ValueError("{}: '{}' does not define valid string types".format(self.__class__.__name__, v))
1333964
def validate(self, value):
        """"""
        if value in list(self.choices.keys()):
            self._choice = value
            return True
        try:
            self._choice = list(self.choices.keys())[int(value)]
            return True
        except (ValueError, IndexError):
            self.error_message = '%s is not a valid choice.' % value
            return False
1372834
def _validate(self, config):
        """"""
        if isinstance(config, dict):
            # Recursively validate each item in the config
            for val in config.values():
                self._validate(val)

        elif isinstance(config, list):
            # Recursively validate each item in the config
            for item in config:
                self._validate(item)

        elif isinstance(config, TaggedValue):
            tagged_value = config

            # if tagged_value is invalid, error
            if tagged_value.tag not in tagged_value.tags:
                raise InvalidConfigError(_("{} is not a valid tag for {}".format(tagged_value.tag, self.tool)))
1069155
function checkOptions(options) {
                // @TODO: should we throw an error if there are incorrect options provided?
                options = _.pick(options, permittedOptions);

                let validationErrors = utils.validateOptions(options);

                if (_.isEmpty(validationErrors)) {
                    return Promise.resolve(options);
                }

                // For now, we can only handle showing the first validation error
                return Promise.reject(validationErrors[0]);
            }